{"action":"created","comment":{"url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/pulls/comments/176910248","pull_request_review_id":106700053,"id":176910248,"diff_hunk":"@@ -106,3 +129,51 @@ func (c *client) Networking() NetworkingInterface {\n func (c *client) Compute() ComputeInterface {\n \treturn c\n }\n+\n+func configureCustomTransport(baseClient *common.BaseClient) error {\n+\thttpClient := baseClient.HTTPClient.(*http.Client)\n+\n+\tvar transport *http.Transport\n+\tif httpClient.Transport == nil {\n+\t\ttransport = &http.Transport{\n+\t\t\tDialContext: (&net.Dialer{\n+\t\t\t\tTimeout:   30 * time.Second,\n+\t\t\t\tKeepAlive: 30 * time.Second,\n+\t\t\t\tDualStack: true,\n+\t\t\t}).DialContext,\n+\t\t\tMaxIdleConns:          100,\n+\t\t\tIdleConnTimeout:       90 * time.Second,\n+\t\t\tTLSHandshakeTimeout:   10 * time.Second,\n+\t\t\tExpectContinueTimeout: 1 * time.Second,\n+\t\t}\n+\t} else {\n+\t\ttransport = httpClient.Transport.(*http.Transport)\n+\t}\n+\n+\tociProxy := os.Getenv(\"OCI_PROXY\")\n+\tif ociProxy != \"\" {\n+\t\tproxyURL, err := url.Parse(ociProxy)\n+\t\tif err != nil {\n+\t\t\treturn fmt.Errorf(\"failed to parse OCI proxy url: %s, err: %v\", ociProxy, err)\n+\t\t}\n+\t\ttransport.Proxy = func(req *http.Request) (*url.URL, error) {\n+\t\t\treturn proxyURL, nil\n+\t\t}\n+\t}\n+\n+\ttrustedCACertPath := os.Getenv(\"TRUSTED_CA_CERT_PATH\")\n+\tif trustedCACertPath != \"\" {\n+\t\tglog.Infof(\"configuring OCI client with a new trusted ca: %s\", trustedCACertPath)\n+\t\ttrustedCACert, err := ioutil.ReadFile(trustedCACertPath)\n+\t\tif err != nil {\n+\t\t\treturn fmt.Errorf(\"failed to read root certificate: %s, err: %v\", trustedCACertPath, err)\n+\t\t}\n+\t\tcaCertPool := x509.NewCertPool()\n+\t\tok := caCertPool.AppendCertsFromPEM(trustedCACert)\n+\t\tif !ok {\n+\t\t\treturn fmt.Errorf(\"failed to parse root certificate: %s\", trustedCACertPath)","path":"pkg/oci/client/client.go","position":93,"original_position":93,"commit_id":"190db16d877b46596292fdf9f1cafb7923b34ab5","original_commit_id":"190db16d877b46596292fdf9f1cafb7923b34ab5","user":{"login":"prydie","id":244160,"avatar_url":"https://avatars1.githubusercontent.com/u/244160?v=4","gravatar_id":"","url":"https://api.github.com/users/prydie","html_url":"https://github.com/prydie","followers_url":"https://api.github.com/users/prydie/followers","following_url":"https://api.github.com/users/prydie/following{/other_user}","gists_url":"https://api.github.com/users/prydie/gists{/gist_id}","starred_url":"https://api.github.com/users/prydie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prydie/subscriptions","organizations_url":"https://api.github.com/users/prydie/orgs","repos_url":"https://api.github.com/users/prydie/repos","events_url":"https://api.github.com/users/prydie/events{/privacy}","received_events_url":"https://api.github.com/users/prydie/received_events","type":"User","site_admin":false},"body":"`errors.Errorf` so that we record the stack trace","created_at":"2018-03-24T14:10:18Z","updated_at":"2018-03-24T14:19:05Z","html_url":"https://github.com/oracle/oci-cloud-controller-manager/pull/156#discussion_r176910248","pull_request_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/pulls/156","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/pulls/comments/176910248"},"html":{"href":"https://github.com/oracle/oci-cloud-controller-manager/pull/156#discussion_r176910248"},"pull_request":{"href":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/pulls/156"}}},"pull_request":{"url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/pulls/156","id":177077413,"html_url":"https://github.com/oracle/oci-cloud-controller-manager/pull/156","diff_url":"https://github.com/oracle/oci-cloud-controller-manager/pull/156.diff","patch_url":"https://github.com/oracle/oci-cloud-controller-manager/pull/156.patch","issue_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/issues/156","number":156,"state":"open","locked":false,"title":"Re-add support for custom transport options","user":{"login":"owainlewis","id":733944,"avatar_url":"https://avatars1.githubusercontent.com/u/733944?v=4","gravatar_id":"","url":"https://api.github.com/users/owainlewis","html_url":"https://github.com/owainlewis","followers_url":"https://api.github.com/users/owainlewis/followers","following_url":"https://api.github.com/users/owainlewis/following{/other_user}","gists_url":"https://api.github.com/users/owainlewis/gists{/gist_id}","starred_url":"https://api.github.com/users/owainlewis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owainlewis/subscriptions","organizations_url":"https://api.github.com/users/owainlewis/orgs","repos_url":"https://api.github.com/users/owainlewis/repos","events_url":"https://api.github.com/users/owainlewis/events{/privacy}","received_events_url":"https://api.github.com/users/owainlewis/received_events","type":"User","site_admin":false},"body":"This change re-adds support for setting custom http proxy and ca certificate options for using the CCM in non standard setups. ","created_at":"2018-03-23T13:58:25Z","updated_at":"2018-03-24T14:19:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"17d7cc6f7ff7230ea5a30d98c95b81535a450ae4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":684479759,"url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/pulls/156/commits","review_comments_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/pulls/156/comments","review_comment_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/pulls/comments{/number}","comments_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/issues/156/comments","statuses_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/statuses/190db16d877b46596292fdf9f1cafb7923b34ab5","head":{"label":"oracle:add-support-for-svc-proxy","ref":"add-support-for-svc-proxy","sha":"190db16d877b46596292fdf9f1cafb7923b34ab5","user":{"login":"oracle","id":4430336,"avatar_url":"https://avatars1.githubusercontent.com/u/4430336?v=4","gravatar_id":"","url":"https://api.github.com/users/oracle","html_url":"https://github.com/oracle","followers_url":"https://api.github.com/users/oracle/followers","following_url":"https://api.github.com/users/oracle/following{/other_user}","gists_url":"https://api.github.com/users/oracle/gists{/gist_id}","starred_url":"https://api.github.com/users/oracle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oracle/subscriptions","organizations_url":"https://api.github.com/users/oracle/orgs","repos_url":"https://api.github.com/users/oracle/repos","events_url":"https://api.github.com/users/oracle/events{/privacy}","received_events_url":"https://api.github.com/users/oracle/received_events","type":"Organization","site_admin":false},"repo":{"id":102544030,"name":"oci-cloud-controller-manager","full_name":"oracle/oci-cloud-controller-manager","owner":{"login":"oracle","id":4430336,"avatar_url":"https://avatars1.githubusercontent.com/u/4430336?v=4","gravatar_id":"","url":"https://api.github.com/users/oracle","html_url":"https://github.com/oracle","followers_url":"https://api.github.com/users/oracle/followers","following_url":"https://api.github.com/users/oracle/following{/other_user}","gists_url":"https://api.github.com/users/oracle/gists{/gist_id}","starred_url":"https://api.github.com/users/oracle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oracle/subscriptions","organizations_url":"https://api.github.com/users/oracle/orgs","repos_url":"https://api.github.com/users/oracle/repos","events_url":"https://api.github.com/users/oracle/events{/privacy}","received_events_url":"https://api.github.com/users/oracle/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/oracle/oci-cloud-controller-manager","description":"Kubernetes Cloud Controller Manager implementation for Oracle Cloud Infrastucture","fork":false,"url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager","forks_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/forks","keys_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/teams","hooks_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/hooks","issue_events_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/issues/events{/number}","events_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/events","assignees_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/assignees{/user}","branches_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/branches{/branch}","tags_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/tags","blobs_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/statuses/{sha}","languages_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/languages","stargazers_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/stargazers","contributors_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/contributors","subscribers_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/subscribers","subscription_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/subscription","commits_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/issues/comments{/number}","contents_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/contents/{+path}","compare_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/merges","archive_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/downloads","issues_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/issues{/number}","pulls_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/pulls{/number}","milestones_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/milestones{/number}","notifications_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/labels{/name}","releases_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/releases{/id}","deployments_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/deployments","created_at":"2017-09-06T00:40:07Z","updated_at":"2018-03-22T12:41:57Z","pushed_at":"2018-03-23T16:29:09Z","git_url":"git://github.com/oracle/oci-cloud-controller-manager.git","ssh_url":"git@github.com:oracle/oci-cloud-controller-manager.git","clone_url":"https://github.com/oracle/oci-cloud-controller-manager.git","svn_url":"https://github.com/oracle/oci-cloud-controller-manager","homepage":"","size":78452,"stargazers_count":8,"watchers_count":8,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":29,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":6,"open_issues":29,"watchers":8,"default_branch":"master"}},"base":{"label":"oracle:master","ref":"master","sha":"b3ba47d21f5ad9a8c01aa1a31939f94f19c5fd1e","user":{"login":"oracle","id":4430336,"avatar_url":"https://avatars1.githubusercontent.com/u/4430336?v=4","gravatar_id":"","url":"https://api.github.com/users/oracle","html_url":"https://github.com/oracle","followers_url":"https://api.github.com/users/oracle/followers","following_url":"https://api.github.com/users/oracle/following{/other_user}","gists_url":"https://api.github.com/users/oracle/gists{/gist_id}","starred_url":"https://api.github.com/users/oracle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oracle/subscriptions","organizations_url":"https://api.github.com/users/oracle/orgs","repos_url":"https://api.github.com/users/oracle/repos","events_url":"https://api.github.com/users/oracle/events{/privacy}","received_events_url":"https://api.github.com/users/oracle/received_events","type":"Organization","site_admin":false},"repo":{"id":102544030,"name":"oci-cloud-controller-manager","full_name":"oracle/oci-cloud-controller-manager","owner":{"login":"oracle","id":4430336,"avatar_url":"https://avatars1.githubusercontent.com/u/4430336?v=4","gravatar_id":"","url":"https://api.github.com/users/oracle","html_url":"https://github.com/oracle","followers_url":"https://api.github.com/users/oracle/followers","following_url":"https://api.github.com/users/oracle/following{/other_user}","gists_url":"https://api.github.com/users/oracle/gists{/gist_id}","starred_url":"https://api.github.com/users/oracle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oracle/subscriptions","organizations_url":"https://api.github.com/users/oracle/orgs","repos_url":"https://api.github.com/users/oracle/repos","events_url":"https://api.github.com/users/oracle/events{/privacy}","received_events_url":"https://api.github.com/users/oracle/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/oracle/oci-cloud-controller-manager","description":"Kubernetes Cloud Controller Manager implementation for Oracle Cloud Infrastucture","fork":false,"url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager","forks_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/forks","keys_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/teams","hooks_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/hooks","issue_events_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/issues/events{/number}","events_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/events","assignees_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/assignees{/user}","branches_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/branches{/branch}","tags_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/tags","blobs_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/statuses/{sha}","languages_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/languages","stargazers_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/stargazers","contributors_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/contributors","subscribers_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/subscribers","subscription_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/subscription","commits_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/issues/comments{/number}","contents_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/contents/{+path}","compare_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/merges","archive_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/downloads","issues_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/issues{/number}","pulls_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/pulls{/number}","milestones_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/milestones{/number}","notifications_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/labels{/name}","releases_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/releases{/id}","deployments_url":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/deployments","created_at":"2017-09-06T00:40:07Z","updated_at":"2018-03-22T12:41:57Z","pushed_at":"2018-03-23T16:29:09Z","git_url":"git://github.com/oracle/oci-cloud-controller-manager.git","ssh_url":"git@github.com:oracle/oci-cloud-controller-manager.git","clone_url":"https://github.com/oracle/oci-cloud-controller-manager.git","svn_url":"https://github.com/oracle/oci-cloud-controller-manager","homepage":"","size":78452,"stargazers_count":8,"watchers_count":8,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":29,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":6,"open_issues":29,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/pulls/156"},"html":{"href":"https://github.com/oracle/oci-cloud-controller-manager/pull/156"},"issue":{"href":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/issues/156"},"comments":{"href":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/issues/156/comments"},"review_comments":{"href":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/pulls/156/comments"},"review_comment":{"href":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/pulls/156/commits"},"statuses":{"href":"https://api.github.com/repos/oracle/oci-cloud-controller-manager/statuses/190db16d877b46596292fdf9f1cafb7923b34ab5"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"prydie"}}