{"action":"created","comment":{"url":"https://api.github.com/repos/cisco-sso/kdk/pulls/comments/210745221","pull_request_review_id":147028032,"id":210745221,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMDc0NTIyMQ==","diff_hunk":"@@ -15,17 +15,81 @@\n package cmd\n \n import (\n+\t\"context\"\n \t\"fmt\"\n+\t\"strings\"\n \n+\t\"github.com/docker/docker/api/types\"\n+\t\"github.com/docker/docker/api/types/container\"\n+\t\"github.com/docker/docker/client\"\n+\t\"github.com/docker/go-connections/nat\"\n+\t\"github.com/Sirupsen/logrus\"\n \t\"github.com/spf13/cobra\"\n+\t\"github.com/spf13/viper\"\n )\n \n var upCmd = &cobra.Command{\n \tUse:   \"up\",\n \tShort: \"Start KDK container\",\n-\tLong: `Start KDK container`,\n+\tLong:  `Start KDK container`,\n \tRun: func(cmd *cobra.Command, args []string) {\n-\t\tfmt.Println(\"up called\")\n+\t\tlogger := logrus.New().WithField(\"command\", \"up\")\n+\n+\t\timageCoordinates := []string{viper.Get(\"image.repository\").(string), viper.Get(\"image.tag\").(string)}\n+\n+\t\tclient, err := client.NewEnvClient()\n+\t\tif err != nil {\n+\t\t\tlogger.WithField(\"error\", err).Fatal(\"Failed to create docker client\")\n+\t\t}\n+\n+\t\tctx := context.Background()\n+\n+\t\tvar binds []string\n+\n+\t\tfor _, bind := range viper.Get(\"docker.binds\").([]interface{}) {\n+\t\t\tconfigBind := make(map[string]string)\n+\t\t\tfor key, value := range bind.(map[interface{}]interface{}) {\n+\t\t\t\tconfigBind[key.(string)] = value.(string)\n+\t\t\t}\n+\t\t\tbinds = append(binds, fmt.Sprintf(\"%s:%s\", configBind[\"source\"], configBind[\"target\"]))\n+\t\t}\n+\n+\t\tcontainerCreateResp, err := client.ContainerCreate(\n+\t\t\tctx,\n+\t\t\t&container.Config{\n+\t\t\t\tHostname: viper.Get(\"docker.hostname\").(string),\n+\t\t\t\tImage:    strings.Join(imageCoordinates, \":\"),","path":"cmd/up.go","position":49,"original_position":49,"commit_id":"425c9c3d8064e7435065313bd709f066e50c70d5","original_commit_id":"425c9c3d8064e7435065313bd709f066e50c70d5","user":{"login":"drekle","id":1883554,"node_id":"MDQ6VXNlcjE4ODM1NTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1883554?v=4","gravatar_id":"","url":"https://api.github.com/users/drekle","html_url":"https://github.com/drekle","followers_url":"https://api.github.com/users/drekle/followers","following_url":"https://api.github.com/users/drekle/following{/other_user}","gists_url":"https://api.github.com/users/drekle/gists{/gist_id}","starred_url":"https://api.github.com/users/drekle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drekle/subscriptions","organizations_url":"https://api.github.com/users/drekle/orgs","repos_url":"https://api.github.com/users/drekle/repos","events_url":"https://api.github.com/users/drekle/events{/privacy}","received_events_url":"https://api.github.com/users/drekle/received_events","type":"User","site_admin":false},"body":"There is a mixture of strings.Join with fmt.Sprintf in this structure initialization.","created_at":"2018-08-16T21:18:57Z","updated_at":"2018-08-16T21:18:57Z","html_url":"https://github.com/cisco-sso/kdk/pull/29#discussion_r210745221","pull_request_url":"https://api.github.com/repos/cisco-sso/kdk/pulls/29","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/cisco-sso/kdk/pulls/comments/210745221"},"html":{"href":"https://github.com/cisco-sso/kdk/pull/29#discussion_r210745221"},"pull_request":{"href":"https://api.github.com/repos/cisco-sso/kdk/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/cisco-sso/kdk/pulls/29","id":208747970,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA4NzQ3OTcw","html_url":"https://github.com/cisco-sso/kdk/pull/29","diff_url":"https://github.com/cisco-sso/kdk/pull/29.diff","patch_url":"https://github.com/cisco-sso/kdk/pull/29.patch","issue_url":"https://api.github.com/repos/cisco-sso/kdk/issues/29","number":29,"state":"open","locked":false,"title":"Implement up command","user":{"login":"rtluckie","id":1850059,"node_id":"MDQ6VXNlcjE4NTAwNTk=","avatar_url":"https://avatars2.githubusercontent.com/u/1850059?v=4","gravatar_id":"","url":"https://api.github.com/users/rtluckie","html_url":"https://github.com/rtluckie","followers_url":"https://api.github.com/users/rtluckie/followers","following_url":"https://api.github.com/users/rtluckie/following{/other_user}","gists_url":"https://api.github.com/users/rtluckie/gists{/gist_id}","starred_url":"https://api.github.com/users/rtluckie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rtluckie/subscriptions","organizations_url":"https://api.github.com/users/rtluckie/orgs","repos_url":"https://api.github.com/users/rtluckie/repos","events_url":"https://api.github.com/users/rtluckie/events{/privacy}","received_events_url":"https://api.github.com/users/rtluckie/received_events","type":"User","site_admin":false},"body":"- implement up cmd\r\n- quiet output of user provision","created_at":"2018-08-16T05:20:24Z","updated_at":"2018-08-16T21:18:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ebd35ab11fc8df1a34e07504c3e7820e7f2886d6","assignee":null,"assignees":[],"requested_reviewers":[{"login":"josdotso","id":13571670,"node_id":"MDQ6VXNlcjEzNTcxNjcw","avatar_url":"https://avatars3.githubusercontent.com/u/13571670?v=4","gravatar_id":"","url":"https://api.github.com/users/josdotso","html_url":"https://github.com/josdotso","followers_url":"https://api.github.com/users/josdotso/followers","following_url":"https://api.github.com/users/josdotso/following{/other_user}","gists_url":"https://api.github.com/users/josdotso/gists{/gist_id}","starred_url":"https://api.github.com/users/josdotso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josdotso/subscriptions","organizations_url":"https://api.github.com/users/josdotso/orgs","repos_url":"https://api.github.com/users/josdotso/repos","events_url":"https://api.github.com/users/josdotso/events{/privacy}","received_events_url":"https://api.github.com/users/josdotso/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/cisco-sso/kdk/pulls/29/commits","review_comments_url":"https://api.github.com/repos/cisco-sso/kdk/pulls/29/comments","review_comment_url":"https://api.github.com/repos/cisco-sso/kdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cisco-sso/kdk/issues/29/comments","statuses_url":"https://api.github.com/repos/cisco-sso/kdk/statuses/425c9c3d8064e7435065313bd709f066e50c70d5","head":{"label":"rtluckie:feature/implement_up_command","ref":"feature/implement_up_command","sha":"425c9c3d8064e7435065313bd709f066e50c70d5","user":{"login":"rtluckie","id":1850059,"node_id":"MDQ6VXNlcjE4NTAwNTk=","avatar_url":"https://avatars2.githubusercontent.com/u/1850059?v=4","gravatar_id":"","url":"https://api.github.com/users/rtluckie","html_url":"https://github.com/rtluckie","followers_url":"https://api.github.com/users/rtluckie/followers","following_url":"https://api.github.com/users/rtluckie/following{/other_user}","gists_url":"https://api.github.com/users/rtluckie/gists{/gist_id}","starred_url":"https://api.github.com/users/rtluckie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rtluckie/subscriptions","organizations_url":"https://api.github.com/users/rtluckie/orgs","repos_url":"https://api.github.com/users/rtluckie/repos","events_url":"https://api.github.com/users/rtluckie/events{/privacy}","received_events_url":"https://api.github.com/users/rtluckie/received_events","type":"User","site_admin":false},"repo":{"id":137138136,"node_id":"MDEwOlJlcG9zaXRvcnkxMzcxMzgxMzY=","name":"kdk","full_name":"rtluckie/kdk","owner":{"login":"rtluckie","id":1850059,"node_id":"MDQ6VXNlcjE4NTAwNTk=","avatar_url":"https://avatars2.githubusercontent.com/u/1850059?v=4","gravatar_id":"","url":"https://api.github.com/users/rtluckie","html_url":"https://github.com/rtluckie","followers_url":"https://api.github.com/users/rtluckie/followers","following_url":"https://api.github.com/users/rtluckie/following{/other_user}","gists_url":"https://api.github.com/users/rtluckie/gists{/gist_id}","starred_url":"https://api.github.com/users/rtluckie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rtluckie/subscriptions","organizations_url":"https://api.github.com/users/rtluckie/orgs","repos_url":"https://api.github.com/users/rtluckie/repos","events_url":"https://api.github.com/users/rtluckie/events{/privacy}","received_events_url":"https://api.github.com/users/rtluckie/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rtluckie/kdk","description":"Dockerized Kubernetes Development Kit","fork":true,"url":"https://api.github.com/repos/rtluckie/kdk","forks_url":"https://api.github.com/repos/rtluckie/kdk/forks","keys_url":"https://api.github.com/repos/rtluckie/kdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rtluckie/kdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rtluckie/kdk/teams","hooks_url":"https://api.github.com/repos/rtluckie/kdk/hooks","issue_events_url":"https://api.github.com/repos/rtluckie/kdk/issues/events{/number}","events_url":"https://api.github.com/repos/rtluckie/kdk/events","assignees_url":"https://api.github.com/repos/rtluckie/kdk/assignees{/user}","branches_url":"https://api.github.com/repos/rtluckie/kdk/branches{/branch}","tags_url":"https://api.github.com/repos/rtluckie/kdk/tags","blobs_url":"https://api.github.com/repos/rtluckie/kdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rtluckie/kdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rtluckie/kdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/rtluckie/kdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rtluckie/kdk/statuses/{sha}","languages_url":"https://api.github.com/repos/rtluckie/kdk/languages","stargazers_url":"https://api.github.com/repos/rtluckie/kdk/stargazers","contributors_url":"https://api.github.com/repos/rtluckie/kdk/contributors","subscribers_url":"https://api.github.com/repos/rtluckie/kdk/subscribers","subscription_url":"https://api.github.com/repos/rtluckie/kdk/subscription","commits_url":"https://api.github.com/repos/rtluckie/kdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/rtluckie/kdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/rtluckie/kdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/rtluckie/kdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/rtluckie/kdk/contents/{+path}","compare_url":"https://api.github.com/repos/rtluckie/kdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rtluckie/kdk/merges","archive_url":"https://api.github.com/repos/rtluckie/kdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rtluckie/kdk/downloads","issues_url":"https://api.github.com/repos/rtluckie/kdk/issues{/number}","pulls_url":"https://api.github.com/repos/rtluckie/kdk/pulls{/number}","milestones_url":"https://api.github.com/repos/rtluckie/kdk/milestones{/number}","notifications_url":"https://api.github.com/repos/rtluckie/kdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rtluckie/kdk/labels{/name}","releases_url":"https://api.github.com/repos/rtluckie/kdk/releases{/id}","deployments_url":"https://api.github.com/repos/rtluckie/kdk/deployments","created_at":"2018-06-12T23:26:52Z","updated_at":"2018-06-26T19:56:03Z","pushed_at":"2018-08-16T20:25:24Z","git_url":"git://github.com/rtluckie/kdk.git","ssh_url":"git@github.com:rtluckie/kdk.git","clone_url":"https://github.com/rtluckie/kdk.git","svn_url":"https://github.com/rtluckie/kdk","homepage":null,"size":66,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cisco-sso:master","ref":"master","sha":"0c63492c0e5c37adc7ba714a9f99696dcb7bdfc5","user":{"login":"cisco-sso","id":39065680,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5MDY1Njgw","avatar_url":"https://avatars0.githubusercontent.com/u/39065680?v=4","gravatar_id":"","url":"https://api.github.com/users/cisco-sso","html_url":"https://github.com/cisco-sso","followers_url":"https://api.github.com/users/cisco-sso/followers","following_url":"https://api.github.com/users/cisco-sso/following{/other_user}","gists_url":"https://api.github.com/users/cisco-sso/gists{/gist_id}","starred_url":"https://api.github.com/users/cisco-sso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cisco-sso/subscriptions","organizations_url":"https://api.github.com/users/cisco-sso/orgs","repos_url":"https://api.github.com/users/cisco-sso/repos","events_url":"https://api.github.com/users/cisco-sso/events{/privacy}","received_events_url":"https://api.github.com/users/cisco-sso/received_events","type":"Organization","site_admin":false},"repo":{"id":137135977,"node_id":"MDEwOlJlcG9zaXRvcnkxMzcxMzU5Nzc=","name":"kdk","full_name":"cisco-sso/kdk","owner":{"login":"cisco-sso","id":39065680,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5MDY1Njgw","avatar_url":"https://avatars0.githubusercontent.com/u/39065680?v=4","gravatar_id":"","url":"https://api.github.com/users/cisco-sso","html_url":"https://github.com/cisco-sso","followers_url":"https://api.github.com/users/cisco-sso/followers","following_url":"https://api.github.com/users/cisco-sso/following{/other_user}","gists_url":"https://api.github.com/users/cisco-sso/gists{/gist_id}","starred_url":"https://api.github.com/users/cisco-sso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cisco-sso/subscriptions","organizations_url":"https://api.github.com/users/cisco-sso/orgs","repos_url":"https://api.github.com/users/cisco-sso/repos","events_url":"https://api.github.com/users/cisco-sso/events{/privacy}","received_events_url":"https://api.github.com/users/cisco-sso/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cisco-sso/kdk","description":"Dockerized Kubernetes Development Kit","fork":false,"url":"https://api.github.com/repos/cisco-sso/kdk","forks_url":"https://api.github.com/repos/cisco-sso/kdk/forks","keys_url":"https://api.github.com/repos/cisco-sso/kdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cisco-sso/kdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cisco-sso/kdk/teams","hooks_url":"https://api.github.com/repos/cisco-sso/kdk/hooks","issue_events_url":"https://api.github.com/repos/cisco-sso/kdk/issues/events{/number}","events_url":"https://api.github.com/repos/cisco-sso/kdk/events","assignees_url":"https://api.github.com/repos/cisco-sso/kdk/assignees{/user}","branches_url":"https://api.github.com/repos/cisco-sso/kdk/branches{/branch}","tags_url":"https://api.github.com/repos/cisco-sso/kdk/tags","blobs_url":"https://api.github.com/repos/cisco-sso/kdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cisco-sso/kdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cisco-sso/kdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/cisco-sso/kdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cisco-sso/kdk/statuses/{sha}","languages_url":"https://api.github.com/repos/cisco-sso/kdk/languages","stargazers_url":"https://api.github.com/repos/cisco-sso/kdk/stargazers","contributors_url":"https://api.github.com/repos/cisco-sso/kdk/contributors","subscribers_url":"https://api.github.com/repos/cisco-sso/kdk/subscribers","subscription_url":"https://api.github.com/repos/cisco-sso/kdk/subscription","commits_url":"https://api.github.com/repos/cisco-sso/kdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/cisco-sso/kdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/cisco-sso/kdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/cisco-sso/kdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/cisco-sso/kdk/contents/{+path}","compare_url":"https://api.github.com/repos/cisco-sso/kdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cisco-sso/kdk/merges","archive_url":"https://api.github.com/repos/cisco-sso/kdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cisco-sso/kdk/downloads","issues_url":"https://api.github.com/repos/cisco-sso/kdk/issues{/number}","pulls_url":"https://api.github.com/repos/cisco-sso/kdk/pulls{/number}","milestones_url":"https://api.github.com/repos/cisco-sso/kdk/milestones{/number}","notifications_url":"https://api.github.com/repos/cisco-sso/kdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cisco-sso/kdk/labels{/name}","releases_url":"https://api.github.com/repos/cisco-sso/kdk/releases{/id}","deployments_url":"https://api.github.com/repos/cisco-sso/kdk/deployments","created_at":"2018-06-12T22:51:56Z","updated_at":"2018-08-09T17:18:09Z","pushed_at":"2018-08-16T20:25:25Z","git_url":"git://github.com/cisco-sso/kdk.git","ssh_url":"git@github.com:cisco-sso/kdk.git","clone_url":"https://github.com/cisco-sso/kdk.git","svn_url":"https://github.com/cisco-sso/kdk","homepage":"","size":68,"stargazers_count":6,"watchers_count":6,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":8,"open_issues":3,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cisco-sso/kdk/pulls/29"},"html":{"href":"https://github.com/cisco-sso/kdk/pull/29"},"issue":{"href":"https://api.github.com/repos/cisco-sso/kdk/issues/29"},"comments":{"href":"https://api.github.com/repos/cisco-sso/kdk/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/cisco-sso/kdk/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/cisco-sso/kdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cisco-sso/kdk/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/cisco-sso/kdk/statuses/425c9c3d8064e7435065313bd709f066e50c70d5"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"drekle"}}