{"action":"created","comment":{"url":"https://api.github.com/repos/docker/cli/pulls/comments/236385141","pull_request_review_id":178449294,"id":236385141,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjM4NTE0MQ==","diff_hunk":"@@ -331,35 +405,27 @@ func getServerHost(hosts []string, tlsOptions *tlsconfig.Options) (string, error\n \treturn dopts.ParseHost(tlsOptions != nil, host)\n }\n \n-func withHTTPClient(tlsOpts *tlsconfig.Options) func(*client.Client) error {\n-\treturn func(c *client.Client) error {\n-\t\tif tlsOpts == nil {\n-\t\t\t// Use the default HTTPClient\n-\t\t\treturn nil\n-\t\t}\n-\n-\t\topts := *tlsOpts\n-\t\topts.ExclusiveRootPools = true\n-\t\ttlsConfig, err := tlsconfig.Client(opts)\n-\t\tif err != nil {\n-\t\t\treturn err\n-\t\t}\n-\n-\t\thttpClient := &http.Client{\n-\t\t\tTransport: &http.Transport{\n-\t\t\t\tTLSClientConfig: tlsConfig,\n-\t\t\t\tDialContext: (&net.Dialer{\n-\t\t\t\t\tKeepAlive: 30 * time.Second,\n-\t\t\t\t\tTimeout:   30 * time.Second,\n-\t\t\t\t}).DialContext,\n-\t\t\t},\n-\t\t\tCheckRedirect: client.CheckRedirect,\n-\t\t}\n-\t\treturn client.WithHTTPClient(httpClient)(c)\n-\t}\n-}\n-\n // UserAgent returns the user agent string used for making API requests\n func UserAgent() string {\n \treturn \"Docker-Client/\" + cli.Version + \" (\" + runtime.GOOS + \")\"\n }\n+\n+func resolveContextName(opts *cliflags.CommonOptions, config *configfile.ConfigFile) string {\n+\tif opts.Context != \"\" {","path":"cli/command/cli.go","position":287,"original_position":287,"commit_id":"7262e2e2f832fd457ee600c05f31a7d323118459","original_commit_id":"7262e2e2f832fd457ee600c05f31a7d323118459","user":{"login":"simonferquel","id":1677333,"node_id":"MDQ6VXNlcjE2NzczMzM=","avatar_url":"https://avatars3.githubusercontent.com/u/1677333?v=4","gravatar_id":"","url":"https://api.github.com/users/simonferquel","html_url":"https://github.com/simonferquel","followers_url":"https://api.github.com/users/simonferquel/followers","following_url":"https://api.github.com/users/simonferquel/following{/other_user}","gists_url":"https://api.github.com/users/simonferquel/gists{/gist_id}","starred_url":"https://api.github.com/users/simonferquel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonferquel/subscriptions","organizations_url":"https://api.github.com/users/simonferquel/orgs","repos_url":"https://api.github.com/users/simonferquel/repos","events_url":"https://api.github.com/users/simonferquel/events{/privacy}","received_events_url":"https://api.github.com/users/simonferquel/received_events","type":"User","site_admin":false},"body":"It is in sync with the `--context` flag description. But my guess is that having both opts.Context and opts.Hosts should be considered as ambiguous (and maybe also DOCKER_HOST vs DOCKER_CONTEXT, but I am a bit less sure for existing scripts compatibility)","created_at":"2018-11-26T19:00:46Z","updated_at":"2018-11-26T19:00:46Z","html_url":"https://github.com/docker/cli/pull/1500#discussion_r236385141","pull_request_url":"https://api.github.com/repos/docker/cli/pulls/1500","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/docker/cli/pulls/comments/236385141"},"html":{"href":"https://github.com/docker/cli/pull/1500#discussion_r236385141"},"pull_request":{"href":"https://api.github.com/repos/docker/cli/pulls/1500"}},"in_reply_to_id":236246450},"pull_request":{"url":"https://api.github.com/repos/docker/cli/pulls/1500","id":228987692,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI4OTg3Njky","html_url":"https://github.com/docker/cli/pull/1500","diff_url":"https://github.com/docker/cli/pull/1500.diff","patch_url":"https://github.com/docker/cli/pull/1500.patch","issue_url":"https://api.github.com/repos/docker/cli/issues/1500","number":1500,"state":"open","locked":false,"title":"Fast context switch: foundation","user":{"login":"simonferquel","id":1677333,"node_id":"MDQ6VXNlcjE2NzczMzM=","avatar_url":"https://avatars3.githubusercontent.com/u/1677333?v=4","gravatar_id":"","url":"https://api.github.com/users/simonferquel","html_url":"https://github.com/simonferquel","followers_url":"https://api.github.com/users/simonferquel/followers","following_url":"https://api.github.com/users/simonferquel/following{/other_user}","gists_url":"https://api.github.com/users/simonferquel/gists{/gist_id}","starred_url":"https://api.github.com/users/simonferquel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonferquel/subscriptions","organizations_url":"https://api.github.com/users/simonferquel/orgs","repos_url":"https://api.github.com/users/simonferquel/repos","events_url":"https://api.github.com/users/simonferquel/events{/privacy}","received_events_url":"https://api.github.com/users/simonferquel/received_events","type":"User","site_admin":false},"body":"**- What I did**\r\n\r\nThis is foundational work for enabling support for fast context switch. ~This is related to https://github.com/moby/moby/pull/38148~. -> actually, the code from moby/moby has been pulled out into this PR. Keeping the link for discussion history\r\n\r\nWhat it does is that it modifies how the CLI behaves to configure clients for both Docker engine and Kubernetes. It also change the way the default value for orchestrator in stacks related command is defined, making it possible to set a different default value on each context\r\n\r\n**- How I did it**\r\n\r\nThis leverages the moby side PR, and add similar facilities to create/parse endpoint information for Kubernetes\r\n\r\n**- How to verify it**\r\n\r\nUnit tests + upcoming commands PR related to context switch\r\n\r\n**- Description for the changelog**\r\n\r\nFast context switch: you can now store, import and export credentials for different clusters and switch between them quickly using the command line\r\n\r\n**- A picture of a cute animal (not mandatory but encouraged)**\r\n\r\n","created_at":"2018-11-07T10:50:00Z","updated_at":"2018-11-26T19:00:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6380e73ed53a4e5f88b59c2c58868a44968e50c9","assignee":null,"assignees":[],"requested_reviewers":[{"login":"dnephin","id":442180,"node_id":"MDQ6VXNlcjQ0MjE4MA==","avatar_url":"https://avatars1.githubusercontent.com/u/442180?v=4","gravatar_id":"","url":"https://api.github.com/users/dnephin","html_url":"https://github.com/dnephin","followers_url":"https://api.github.com/users/dnephin/followers","following_url":"https://api.github.com/users/dnephin/following{/other_user}","gists_url":"https://api.github.com/users/dnephin/gists{/gist_id}","starred_url":"https://api.github.com/users/dnephin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnephin/subscriptions","organizations_url":"https://api.github.com/users/dnephin/orgs","repos_url":"https://api.github.com/users/dnephin/repos","events_url":"https://api.github.com/users/dnephin/events{/privacy}","received_events_url":"https://api.github.com/users/dnephin/received_events","type":"User","site_admin":false},{"login":"dhiltgen","id":4033016,"node_id":"MDQ6VXNlcjQwMzMwMTY=","avatar_url":"https://avatars2.githubusercontent.com/u/4033016?v=4","gravatar_id":"","url":"https://api.github.com/users/dhiltgen","html_url":"https://github.com/dhiltgen","followers_url":"https://api.github.com/users/dhiltgen/followers","following_url":"https://api.github.com/users/dhiltgen/following{/other_user}","gists_url":"https://api.github.com/users/dhiltgen/gists{/gist_id}","starred_url":"https://api.github.com/users/dhiltgen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhiltgen/subscriptions","organizations_url":"https://api.github.com/users/dhiltgen/orgs","repos_url":"https://api.github.com/users/dhiltgen/repos","events_url":"https://api.github.com/users/dhiltgen/events{/privacy}","received_events_url":"https://api.github.com/users/dhiltgen/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":585916070,"node_id":"MDU6TGFiZWw1ODU5MTYwNzA=","url":"https://api.github.com/repos/docker/cli/labels/status/1-design-review","name":"status/1-design-review","color":"fef2c0","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/docker/cli/pulls/1500/commits","review_comments_url":"https://api.github.com/repos/docker/cli/pulls/1500/comments","review_comment_url":"https://api.github.com/repos/docker/cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/cli/issues/1500/comments","statuses_url":"https://api.github.com/repos/docker/cli/statuses/7262e2e2f832fd457ee600c05f31a7d323118459","head":{"label":"simonferquel:use-context-foundation","ref":"use-context-foundation","sha":"7262e2e2f832fd457ee600c05f31a7d323118459","user":{"login":"simonferquel","id":1677333,"node_id":"MDQ6VXNlcjE2NzczMzM=","avatar_url":"https://avatars3.githubusercontent.com/u/1677333?v=4","gravatar_id":"","url":"https://api.github.com/users/simonferquel","html_url":"https://github.com/simonferquel","followers_url":"https://api.github.com/users/simonferquel/followers","following_url":"https://api.github.com/users/simonferquel/following{/other_user}","gists_url":"https://api.github.com/users/simonferquel/gists{/gist_id}","starred_url":"https://api.github.com/users/simonferquel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonferquel/subscriptions","organizations_url":"https://api.github.com/users/simonferquel/orgs","repos_url":"https://api.github.com/users/simonferquel/repos","events_url":"https://api.github.com/users/simonferquel/events{/privacy}","received_events_url":"https://api.github.com/users/simonferquel/received_events","type":"User","site_admin":false},"repo":{"id":99563380,"node_id":"MDEwOlJlcG9zaXRvcnk5OTU2MzM4MA==","name":"cli","full_name":"simonferquel/cli","private":false,"owner":{"login":"simonferquel","id":1677333,"node_id":"MDQ6VXNlcjE2NzczMzM=","avatar_url":"https://avatars3.githubusercontent.com/u/1677333?v=4","gravatar_id":"","url":"https://api.github.com/users/simonferquel","html_url":"https://github.com/simonferquel","followers_url":"https://api.github.com/users/simonferquel/followers","following_url":"https://api.github.com/users/simonferquel/following{/other_user}","gists_url":"https://api.github.com/users/simonferquel/gists{/gist_id}","starred_url":"https://api.github.com/users/simonferquel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonferquel/subscriptions","organizations_url":"https://api.github.com/users/simonferquel/orgs","repos_url":"https://api.github.com/users/simonferquel/repos","events_url":"https://api.github.com/users/simonferquel/events{/privacy}","received_events_url":"https://api.github.com/users/simonferquel/received_events","type":"User","site_admin":false},"html_url":"https://github.com/simonferquel/cli","description":"The Docker CLI","fork":true,"url":"https://api.github.com/repos/simonferquel/cli","forks_url":"https://api.github.com/repos/simonferquel/cli/forks","keys_url":"https://api.github.com/repos/simonferquel/cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/simonferquel/cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/simonferquel/cli/teams","hooks_url":"https://api.github.com/repos/simonferquel/cli/hooks","issue_events_url":"https://api.github.com/repos/simonferquel/cli/issues/events{/number}","events_url":"https://api.github.com/repos/simonferquel/cli/events","assignees_url":"https://api.github.com/repos/simonferquel/cli/assignees{/user}","branches_url":"https://api.github.com/repos/simonferquel/cli/branches{/branch}","tags_url":"https://api.github.com/repos/simonferquel/cli/tags","blobs_url":"https://api.github.com/repos/simonferquel/cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/simonferquel/cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/simonferquel/cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/simonferquel/cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/simonferquel/cli/statuses/{sha}","languages_url":"https://api.github.com/repos/simonferquel/cli/languages","stargazers_url":"https://api.github.com/repos/simonferquel/cli/stargazers","contributors_url":"https://api.github.com/repos/simonferquel/cli/contributors","subscribers_url":"https://api.github.com/repos/simonferquel/cli/subscribers","subscription_url":"https://api.github.com/repos/simonferquel/cli/subscription","commits_url":"https://api.github.com/repos/simonferquel/cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/simonferquel/cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/simonferquel/cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/simonferquel/cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/simonferquel/cli/contents/{+path}","compare_url":"https://api.github.com/repos/simonferquel/cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/simonferquel/cli/merges","archive_url":"https://api.github.com/repos/simonferquel/cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/simonferquel/cli/downloads","issues_url":"https://api.github.com/repos/simonferquel/cli/issues{/number}","pulls_url":"https://api.github.com/repos/simonferquel/cli/pulls{/number}","milestones_url":"https://api.github.com/repos/simonferquel/cli/milestones{/number}","notifications_url":"https://api.github.com/repos/simonferquel/cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/simonferquel/cli/labels{/name}","releases_url":"https://api.github.com/repos/simonferquel/cli/releases{/id}","deployments_url":"https://api.github.com/repos/simonferquel/cli/deployments","created_at":"2017-08-07T09:53:21Z","updated_at":"2017-08-07T09:53:24Z","pushed_at":"2018-11-23T10:25:28Z","git_url":"git://github.com/simonferquel/cli.git","ssh_url":"git@github.com:simonferquel/cli.git","clone_url":"https://github.com/simonferquel/cli.git","svn_url":"https://github.com/simonferquel/cli","homepage":null,"size":21247,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"docker:master","ref":"master","sha":"e042b58f7d03d69aa76ececdcf8c723ec84d819f","user":{"login":"docker","id":5429470,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU0Mjk0NzA=","avatar_url":"https://avatars1.githubusercontent.com/u/5429470?v=4","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":88013053,"node_id":"MDEwOlJlcG9zaXRvcnk4ODAxMzA1Mw==","name":"cli","full_name":"docker/cli","private":false,"owner":{"login":"docker","id":5429470,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU0Mjk0NzA=","avatar_url":"https://avatars1.githubusercontent.com/u/5429470?v=4","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/docker/cli","description":"The Docker CLI","fork":false,"url":"https://api.github.com/repos/docker/cli","forks_url":"https://api.github.com/repos/docker/cli/forks","keys_url":"https://api.github.com/repos/docker/cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/cli/teams","hooks_url":"https://api.github.com/repos/docker/cli/hooks","issue_events_url":"https://api.github.com/repos/docker/cli/issues/events{/number}","events_url":"https://api.github.com/repos/docker/cli/events","assignees_url":"https://api.github.com/repos/docker/cli/assignees{/user}","branches_url":"https://api.github.com/repos/docker/cli/branches{/branch}","tags_url":"https://api.github.com/repos/docker/cli/tags","blobs_url":"https://api.github.com/repos/docker/cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/cli/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/cli/languages","stargazers_url":"https://api.github.com/repos/docker/cli/stargazers","contributors_url":"https://api.github.com/repos/docker/cli/contributors","subscribers_url":"https://api.github.com/repos/docker/cli/subscribers","subscription_url":"https://api.github.com/repos/docker/cli/subscription","commits_url":"https://api.github.com/repos/docker/cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/cli/contents/{+path}","compare_url":"https://api.github.com/repos/docker/cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/cli/merges","archive_url":"https://api.github.com/repos/docker/cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/cli/downloads","issues_url":"https://api.github.com/repos/docker/cli/issues{/number}","pulls_url":"https://api.github.com/repos/docker/cli/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/cli/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/cli/labels{/name}","releases_url":"https://api.github.com/repos/docker/cli/releases{/id}","deployments_url":"https://api.github.com/repos/docker/cli/deployments","created_at":"2017-04-12T05:27:42Z","updated_at":"2018-11-26T16:19:41Z","pushed_at":"2018-11-26T16:09:42Z","git_url":"git://github.com/docker/cli.git","ssh_url":"git@github.com:docker/cli.git","clone_url":"https://github.com/docker/cli.git","svn_url":"https://github.com/docker/cli","homepage":null,"size":21336,"stargazers_count":971,"watchers_count":971,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":585,"mirror_url":null,"archived":false,"open_issues_count":339,"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":585,"open_issues":339,"watchers":971,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/cli/pulls/1500"},"html":{"href":"https://github.com/docker/cli/pull/1500"},"issue":{"href":"https://api.github.com/repos/docker/cli/issues/1500"},"comments":{"href":"https://api.github.com/repos/docker/cli/issues/1500/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/cli/pulls/1500/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/cli/pulls/1500/commits"},"statuses":{"href":"https://api.github.com/repos/docker/cli/statuses/7262e2e2f832fd457ee600c05f31a7d323118459"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"simonferquel"}}