{"action":"created","comment":{"url":"https://api.github.com/repos/redhat-developer/odo/pulls/comments/220863903","pull_request_review_id":159370267,"id":220863903,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMDg2MzkwMw==","diff_hunk":"@@ -911,12 +942,26 @@ func addBootstrapVolumeMount(dc *appsv1.DeploymentConfig, dcName string) {\n \t}\n }\n \n+// updateEnvVar updates the environmental variables to the container in the DC\n+// dc is the deployment config to be updated\n+// inputEnvVars is the array containing the corev1.EnvVar values\n+func updateEnvVar(dc *appsv1.DeploymentConfig, inputEnvVars []corev1.EnvVar) error {\n+\tnumContainers := len(dc.Spec.Template.Spec.Containers)\n+\tif numContainers != 1 {\n+\t\treturn fmt.Errorf(\"expected exactly one container in Deployment Config %v, got %v\", dc.Name, numContainers)\n+\t}\n+\n+\tdc.Spec.Template.Spec.Containers[0].Env = inputEnvVars\n+\treturn nil\n+}\n+\n // UpdateBuildConfig updates the BuildConfig file\n // buildConfigName is the name of the BuildConfig file to be updated\n // projectName is the name of the project\n // gitUrl equals to the git URL of the source and is equals to \"\" if the source is of type dir or binary\n // annotations contains the annotations for the BuildConfig file\n-func (c *Client) UpdateBuildConfig(buildConfigName string, projectName string, gitUrl string, annotations map[string]string) error {\n+// envVars are the env vars for the buildConfig file\n+func (c *Client) UpdateBuildConfig(buildConfigName string, projectName string, gitUrl string, annotations map[string]string, envVars []corev1.EnvVar) error {","path":"pkg/occlient/occlient.go","position":108,"original_position":108,"commit_id":"36d8e896a0820af02dcc4eb50e076992b12e4a3d","original_commit_id":"36d8e896a0820af02dcc4eb50e076992b12e4a3d","user":{"login":"codeclimate[bot]","id":36754821,"node_id":"MDM6Qm90MzY3NTQ4MjE=","avatar_url":"https://avatars0.githubusercontent.com/in/9403?v=4","gravatar_id":"","url":"https://api.github.com/users/codeclimate%5Bbot%5D","html_url":"https://github.com/apps/codeclimate","followers_url":"https://api.github.com/users/codeclimate%5Bbot%5D/followers","following_url":"https://api.github.com/users/codeclimate%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/codeclimate%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/codeclimate%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeclimate%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/codeclimate%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/codeclimate%5Bbot%5D/repos","events_url":"https://api.github.com/users/codeclimate%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/codeclimate%5Bbot%5D/received_events","type":"Bot","site_admin":false},"body":"method parameter gitUrl should be gitURL","created_at":"2018-09-27T09:59:41Z","updated_at":"2018-09-27T09:59:42Z","html_url":"https://github.com/redhat-developer/odo/pull/626#discussion_r220863903","pull_request_url":"https://api.github.com/repos/redhat-developer/odo/pulls/626","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/redhat-developer/odo/pulls/comments/220863903"},"html":{"href":"https://github.com/redhat-developer/odo/pull/626#discussion_r220863903"},"pull_request":{"href":"https://api.github.com/repos/redhat-developer/odo/pulls/626"}}},"pull_request":{"url":"https://api.github.com/repos/redhat-developer/odo/pulls/626","id":207319370,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA3MzE5Mzcw","html_url":"https://github.com/redhat-developer/odo/pull/626","diff_url":"https://github.com/redhat-developer/odo/pull/626.diff","patch_url":"https://github.com/redhat-developer/odo/pull/626.patch","issue_url":"https://api.github.com/repos/redhat-developer/odo/issues/626","number":626,"state":"open","locked":false,"title":"Adds the env flag to add the env variables to the component. ","user":{"login":"mik-dass","id":14028106,"node_id":"MDQ6VXNlcjE0MDI4MTA2","avatar_url":"https://avatars2.githubusercontent.com/u/14028106?v=4","gravatar_id":"","url":"https://api.github.com/users/mik-dass","html_url":"https://github.com/mik-dass","followers_url":"https://api.github.com/users/mik-dass/followers","following_url":"https://api.github.com/users/mik-dass/following{/other_user}","gists_url":"https://api.github.com/users/mik-dass/gists{/gist_id}","starred_url":"https://api.github.com/users/mik-dass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mik-dass/subscriptions","organizations_url":"https://api.github.com/users/mik-dass/orgs","repos_url":"https://api.github.com/users/mik-dass/repos","events_url":"https://api.github.com/users/mik-dass/events{/privacy}","received_events_url":"https://api.github.com/users/mik-dass/received_events","type":"User","site_admin":false},"body":"fixes #501 \r\nSigned-off-by: mdas <mrinald7@gmail.com>\r\n\r\nIncase of git component the env vars are added to both the buildConfig and the deploymentConfig but incase of local/binary, only the deploymentConfig is updated.\r\n\r\nThe update functionality was changed to add the env vars to the buildConfig incase of git otherwise remove it. A new fucntion GetEnvVarsFromDC() was introduced to retrieve the env vars from the DC.\r\n\r\nFunction getinputEnvsFromStrings is added to retrive the env vars from the input strings. Also function addEnv is added to add the corev1.EnvVars to the deploymentConfig.","created_at":"2018-08-09T13:38:10Z","updated_at":"2018-09-27T09:59:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9f4a120ddc98a0c9a1ccf8c5796b6727d0b351f8","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/redhat-developer/odo/pulls/626/commits","review_comments_url":"https://api.github.com/repos/redhat-developer/odo/pulls/626/comments","review_comment_url":"https://api.github.com/repos/redhat-developer/odo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/redhat-developer/odo/issues/626/comments","statuses_url":"https://api.github.com/repos/redhat-developer/odo/statuses/36d8e896a0820af02dcc4eb50e076992b12e4a3d","head":{"label":"mik-dass:env_create","ref":"env_create","sha":"36d8e896a0820af02dcc4eb50e076992b12e4a3d","user":{"login":"mik-dass","id":14028106,"node_id":"MDQ6VXNlcjE0MDI4MTA2","avatar_url":"https://avatars2.githubusercontent.com/u/14028106?v=4","gravatar_id":"","url":"https://api.github.com/users/mik-dass","html_url":"https://github.com/mik-dass","followers_url":"https://api.github.com/users/mik-dass/followers","following_url":"https://api.github.com/users/mik-dass/following{/other_user}","gists_url":"https://api.github.com/users/mik-dass/gists{/gist_id}","starred_url":"https://api.github.com/users/mik-dass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mik-dass/subscriptions","organizations_url":"https://api.github.com/users/mik-dass/orgs","repos_url":"https://api.github.com/users/mik-dass/repos","events_url":"https://api.github.com/users/mik-dass/events{/privacy}","received_events_url":"https://api.github.com/users/mik-dass/received_events","type":"User","site_admin":false},"repo":{"id":129362344,"node_id":"MDEwOlJlcG9zaXRvcnkxMjkzNjIzNDQ=","name":"odo","full_name":"mik-dass/odo","private":false,"owner":{"login":"mik-dass","id":14028106,"node_id":"MDQ6VXNlcjE0MDI4MTA2","avatar_url":"https://avatars2.githubusercontent.com/u/14028106?v=4","gravatar_id":"","url":"https://api.github.com/users/mik-dass","html_url":"https://github.com/mik-dass","followers_url":"https://api.github.com/users/mik-dass/followers","following_url":"https://api.github.com/users/mik-dass/following{/other_user}","gists_url":"https://api.github.com/users/mik-dass/gists{/gist_id}","starred_url":"https://api.github.com/users/mik-dass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mik-dass/subscriptions","organizations_url":"https://api.github.com/users/mik-dass/orgs","repos_url":"https://api.github.com/users/mik-dass/repos","events_url":"https://api.github.com/users/mik-dass/events{/privacy}","received_events_url":"https://api.github.com/users/mik-dass/received_events","type":"User","site_admin":false},"html_url":"https://github.com/mik-dass/odo","description":"OpenShift Command line for Developers","fork":true,"url":"https://api.github.com/repos/mik-dass/odo","forks_url":"https://api.github.com/repos/mik-dass/odo/forks","keys_url":"https://api.github.com/repos/mik-dass/odo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mik-dass/odo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mik-dass/odo/teams","hooks_url":"https://api.github.com/repos/mik-dass/odo/hooks","issue_events_url":"https://api.github.com/repos/mik-dass/odo/issues/events{/number}","events_url":"https://api.github.com/repos/mik-dass/odo/events","assignees_url":"https://api.github.com/repos/mik-dass/odo/assignees{/user}","branches_url":"https://api.github.com/repos/mik-dass/odo/branches{/branch}","tags_url":"https://api.github.com/repos/mik-dass/odo/tags","blobs_url":"https://api.github.com/repos/mik-dass/odo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mik-dass/odo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mik-dass/odo/git/refs{/sha}","trees_url":"https://api.github.com/repos/mik-dass/odo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mik-dass/odo/statuses/{sha}","languages_url":"https://api.github.com/repos/mik-dass/odo/languages","stargazers_url":"https://api.github.com/repos/mik-dass/odo/stargazers","contributors_url":"https://api.github.com/repos/mik-dass/odo/contributors","subscribers_url":"https://api.github.com/repos/mik-dass/odo/subscribers","subscription_url":"https://api.github.com/repos/mik-dass/odo/subscription","commits_url":"https://api.github.com/repos/mik-dass/odo/commits{/sha}","git_commits_url":"https://api.github.com/repos/mik-dass/odo/git/commits{/sha}","comments_url":"https://api.github.com/repos/mik-dass/odo/comments{/number}","issue_comment_url":"https://api.github.com/repos/mik-dass/odo/issues/comments{/number}","contents_url":"https://api.github.com/repos/mik-dass/odo/contents/{+path}","compare_url":"https://api.github.com/repos/mik-dass/odo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mik-dass/odo/merges","archive_url":"https://api.github.com/repos/mik-dass/odo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mik-dass/odo/downloads","issues_url":"https://api.github.com/repos/mik-dass/odo/issues{/number}","pulls_url":"https://api.github.com/repos/mik-dass/odo/pulls{/number}","milestones_url":"https://api.github.com/repos/mik-dass/odo/milestones{/number}","notifications_url":"https://api.github.com/repos/mik-dass/odo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mik-dass/odo/labels{/name}","releases_url":"https://api.github.com/repos/mik-dass/odo/releases{/id}","deployments_url":"https://api.github.com/repos/mik-dass/odo/deployments","created_at":"2018-04-13T07:01:23Z","updated_at":"2018-09-10T10:40:30Z","pushed_at":"2018-09-27T09:59:03Z","git_url":"git://github.com/mik-dass/odo.git","ssh_url":"git@github.com:mik-dass/odo.git","clone_url":"https://github.com/mik-dass/odo.git","svn_url":"https://github.com/mik-dass/odo","homepage":"","size":34325,"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":"redhat-developer:master","ref":"master","sha":"e1978514c5fc9e13710d3f8f232b3f26296b722c","user":{"login":"redhat-developer","id":11033755,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMDMzNzU1","avatar_url":"https://avatars0.githubusercontent.com/u/11033755?v=4","gravatar_id":"","url":"https://api.github.com/users/redhat-developer","html_url":"https://github.com/redhat-developer","followers_url":"https://api.github.com/users/redhat-developer/followers","following_url":"https://api.github.com/users/redhat-developer/following{/other_user}","gists_url":"https://api.github.com/users/redhat-developer/gists{/gist_id}","starred_url":"https://api.github.com/users/redhat-developer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redhat-developer/subscriptions","organizations_url":"https://api.github.com/users/redhat-developer/orgs","repos_url":"https://api.github.com/users/redhat-developer/repos","events_url":"https://api.github.com/users/redhat-developer/events{/privacy}","received_events_url":"https://api.github.com/users/redhat-developer/received_events","type":"Organization","site_admin":false},"repo":{"id":118630356,"node_id":"MDEwOlJlcG9zaXRvcnkxMTg2MzAzNTY=","name":"odo","full_name":"redhat-developer/odo","private":false,"owner":{"login":"redhat-developer","id":11033755,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMDMzNzU1","avatar_url":"https://avatars0.githubusercontent.com/u/11033755?v=4","gravatar_id":"","url":"https://api.github.com/users/redhat-developer","html_url":"https://github.com/redhat-developer","followers_url":"https://api.github.com/users/redhat-developer/followers","following_url":"https://api.github.com/users/redhat-developer/following{/other_user}","gists_url":"https://api.github.com/users/redhat-developer/gists{/gist_id}","starred_url":"https://api.github.com/users/redhat-developer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redhat-developer/subscriptions","organizations_url":"https://api.github.com/users/redhat-developer/orgs","repos_url":"https://api.github.com/users/redhat-developer/repos","events_url":"https://api.github.com/users/redhat-developer/events{/privacy}","received_events_url":"https://api.github.com/users/redhat-developer/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/redhat-developer/odo","description":"OpenShift Command line for Developers","fork":false,"url":"https://api.github.com/repos/redhat-developer/odo","forks_url":"https://api.github.com/repos/redhat-developer/odo/forks","keys_url":"https://api.github.com/repos/redhat-developer/odo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/redhat-developer/odo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/redhat-developer/odo/teams","hooks_url":"https://api.github.com/repos/redhat-developer/odo/hooks","issue_events_url":"https://api.github.com/repos/redhat-developer/odo/issues/events{/number}","events_url":"https://api.github.com/repos/redhat-developer/odo/events","assignees_url":"https://api.github.com/repos/redhat-developer/odo/assignees{/user}","branches_url":"https://api.github.com/repos/redhat-developer/odo/branches{/branch}","tags_url":"https://api.github.com/repos/redhat-developer/odo/tags","blobs_url":"https://api.github.com/repos/redhat-developer/odo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/redhat-developer/odo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/redhat-developer/odo/git/refs{/sha}","trees_url":"https://api.github.com/repos/redhat-developer/odo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/redhat-developer/odo/statuses/{sha}","languages_url":"https://api.github.com/repos/redhat-developer/odo/languages","stargazers_url":"https://api.github.com/repos/redhat-developer/odo/stargazers","contributors_url":"https://api.github.com/repos/redhat-developer/odo/contributors","subscribers_url":"https://api.github.com/repos/redhat-developer/odo/subscribers","subscription_url":"https://api.github.com/repos/redhat-developer/odo/subscription","commits_url":"https://api.github.com/repos/redhat-developer/odo/commits{/sha}","git_commits_url":"https://api.github.com/repos/redhat-developer/odo/git/commits{/sha}","comments_url":"https://api.github.com/repos/redhat-developer/odo/comments{/number}","issue_comment_url":"https://api.github.com/repos/redhat-developer/odo/issues/comments{/number}","contents_url":"https://api.github.com/repos/redhat-developer/odo/contents/{+path}","compare_url":"https://api.github.com/repos/redhat-developer/odo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/redhat-developer/odo/merges","archive_url":"https://api.github.com/repos/redhat-developer/odo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/redhat-developer/odo/downloads","issues_url":"https://api.github.com/repos/redhat-developer/odo/issues{/number}","pulls_url":"https://api.github.com/repos/redhat-developer/odo/pulls{/number}","milestones_url":"https://api.github.com/repos/redhat-developer/odo/milestones{/number}","notifications_url":"https://api.github.com/repos/redhat-developer/odo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/redhat-developer/odo/labels{/name}","releases_url":"https://api.github.com/repos/redhat-developer/odo/releases{/id}","deployments_url":"https://api.github.com/repos/redhat-developer/odo/deployments","created_at":"2018-01-23T15:36:17Z","updated_at":"2018-09-27T08:43:06Z","pushed_at":"2018-09-27T09:59:05Z","git_url":"git://github.com/redhat-developer/odo.git","ssh_url":"git@github.com:redhat-developer/odo.git","clone_url":"https://github.com/redhat-developer/odo.git","svn_url":"https://github.com/redhat-developer/odo","homepage":"","size":92154,"stargazers_count":225,"watchers_count":225,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":47,"mirror_url":null,"archived":false,"open_issues_count":146,"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":47,"open_issues":146,"watchers":225,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/redhat-developer/odo/pulls/626"},"html":{"href":"https://github.com/redhat-developer/odo/pull/626"},"issue":{"href":"https://api.github.com/repos/redhat-developer/odo/issues/626"},"comments":{"href":"https://api.github.com/repos/redhat-developer/odo/issues/626/comments"},"review_comments":{"href":"https://api.github.com/repos/redhat-developer/odo/pulls/626/comments"},"review_comment":{"href":"https://api.github.com/repos/redhat-developer/odo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/redhat-developer/odo/pulls/626/commits"},"statuses":{"href":"https://api.github.com/repos/redhat-developer/odo/statuses/36d8e896a0820af02dcc4eb50e076992b12e4a3d"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"codeclimate"}}