{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/origin/pulls/comments/30596870","id":30596870,"diff_hunk":"@@ -53,35 +53,49 @@ func (c *DeploymentConfigController) Handle(config *deployapi.DeploymentConfig)\n \t\treturn nil\n \t}\n \n-\t// Check if the latest deployment already exists\n-\tif deployment, err := c.deploymentClient.getDeployment(config.Namespace, deployutil.LatestDeploymentNameForConfig(config)); err != nil {\n-\t\tif !errors.IsNotFound(err) {\n-\t\t\treturn fmt.Errorf(\"couldn't get deployment for config %s: %v\", deployutil.LabelForDeploymentConfig(config), err)\n-\t\t}\n-\t} else {\n-\t\t// If there's an existing deployment, nothing needs to be done.\n-\t\tif deployment != nil {\n-\t\t\treturn nil\n-\t\t}\n-\t}\n-\n-\t// Check if any previous deployment is still running (any non-terminal state).\n+\t// Check if any existing inflight deployments (any non-terminal state).\n \texistingDeployments, err := c.deploymentClient.listDeploymentsForConfig(config.Namespace, config.Name)\n \tif err != nil {\n \t\treturn fmt.Errorf(\"couldn't list deployments for config %s: %v\", deployutil.LabelForDeploymentConfig(config), err)\n \t}\n+\tvar inflightDeployment, deploymentForCancellation *kapi.ReplicationController","path":"pkg/deploy/controller/deploymentconfig/controller.go","position":22,"original_position":22,"commit_id":"db1edf56c83760632404402c566ad618daf931de","original_commit_id":"db1edf56c83760632404402c566ad618daf931de","user":{"login":"deads2k","id":8225098,"avatar_url":"https://avatars.githubusercontent.com/u/8225098?v=3","gravatar_id":"","url":"https://api.github.com/users/deads2k","html_url":"https://github.com/deads2k","followers_url":"https://api.github.com/users/deads2k/followers","following_url":"https://api.github.com/users/deads2k/following{/other_user}","gists_url":"https://api.github.com/users/deads2k/gists{/gist_id}","starred_url":"https://api.github.com/users/deads2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deads2k/subscriptions","organizations_url":"https://api.github.com/users/deads2k/orgs","repos_url":"https://api.github.com/users/deads2k/repos","events_url":"https://api.github.com/users/deads2k/events{/privacy}","received_events_url":"https://api.github.com/users/deads2k/received_events","type":"User","site_admin":false},"body":"Looks like `deploymentForCancellation` is scoped inside the `default` block.","created_at":"2015-05-19T13:14:20Z","updated_at":"2015-05-19T13:14:20Z","html_url":"https://github.com/openshift/origin/pull/2327#discussion_r30596870","pull_request_url":"https://api.github.com/repos/openshift/origin/pulls/2327","_links":{"self":{"href":"https://api.github.com/repos/openshift/origin/pulls/comments/30596870"},"html":{"href":"https://github.com/openshift/origin/pull/2327#discussion_r30596870"},"pull_request":{"href":"https://api.github.com/repos/openshift/origin/pulls/2327"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/origin/pulls/2327","id":35664679,"html_url":"https://github.com/openshift/origin/pull/2327","diff_url":"https://github.com/openshift/origin/pull/2327.diff","patch_url":"https://github.com/openshift/origin/pull/2327.patch","issue_url":"https://api.github.com/repos/openshift/origin/issues/2327","number":2327,"state":"open","locked":false,"title":"[WIP] Considering existing deployments for deployment configs","user":{"login":"abhgupta","id":1211613,"avatar_url":"https://avatars.githubusercontent.com/u/1211613?v=3","gravatar_id":"","url":"https://api.github.com/users/abhgupta","html_url":"https://github.com/abhgupta","followers_url":"https://api.github.com/users/abhgupta/followers","following_url":"https://api.github.com/users/abhgupta/following{/other_user}","gists_url":"https://api.github.com/users/abhgupta/gists{/gist_id}","starred_url":"https://api.github.com/users/abhgupta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhgupta/subscriptions","organizations_url":"https://api.github.com/users/abhgupta/orgs","repos_url":"https://api.github.com/users/abhgupta/repos","events_url":"https://api.github.com/users/abhgupta/events{/privacy}","received_events_url":"https://api.github.com/users/abhgupta/received_events","type":"User","site_admin":false},"body":" - If a running/pending/new deployment exists, the config is requeued\r\n - If multiple running/previous/new deployments exists, older ones are cancelled","created_at":"2015-05-18T19:19:57Z","updated_at":"2015-05-19T13:14:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aea23101935e049ca488bc5c671d55a305c1be71","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openshift/origin/pulls/2327/commits","review_comments_url":"https://api.github.com/repos/openshift/origin/pulls/2327/comments","review_comment_url":"https://api.github.com/repos/openshift/origin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/origin/issues/2327/comments","statuses_url":"https://api.github.com/repos/openshift/origin/statuses/db1edf56c83760632404402c566ad618daf931de","head":{"label":"abhgupta:abhgupta-dev","ref":"abhgupta-dev","sha":"db1edf56c83760632404402c566ad618daf931de","user":{"login":"abhgupta","id":1211613,"avatar_url":"https://avatars.githubusercontent.com/u/1211613?v=3","gravatar_id":"","url":"https://api.github.com/users/abhgupta","html_url":"https://github.com/abhgupta","followers_url":"https://api.github.com/users/abhgupta/followers","following_url":"https://api.github.com/users/abhgupta/following{/other_user}","gists_url":"https://api.github.com/users/abhgupta/gists{/gist_id}","starred_url":"https://api.github.com/users/abhgupta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhgupta/subscriptions","organizations_url":"https://api.github.com/users/abhgupta/orgs","repos_url":"https://api.github.com/users/abhgupta/repos","events_url":"https://api.github.com/users/abhgupta/events{/privacy}","received_events_url":"https://api.github.com/users/abhgupta/received_events","type":"User","site_admin":false},"repo":{"id":23977841,"name":"origin","full_name":"abhgupta/origin","owner":{"login":"abhgupta","id":1211613,"avatar_url":"https://avatars.githubusercontent.com/u/1211613?v=3","gravatar_id":"","url":"https://api.github.com/users/abhgupta","html_url":"https://github.com/abhgupta","followers_url":"https://api.github.com/users/abhgupta/followers","following_url":"https://api.github.com/users/abhgupta/following{/other_user}","gists_url":"https://api.github.com/users/abhgupta/gists{/gist_id}","starred_url":"https://api.github.com/users/abhgupta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhgupta/subscriptions","organizations_url":"https://api.github.com/users/abhgupta/orgs","repos_url":"https://api.github.com/users/abhgupta/repos","events_url":"https://api.github.com/users/abhgupta/events{/privacy}","received_events_url":"https://api.github.com/users/abhgupta/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/abhgupta/origin","description":"OpenShift 3 - build, deploy, and manage your applications with Docker and Kubernetes","fork":true,"url":"https://api.github.com/repos/abhgupta/origin","forks_url":"https://api.github.com/repos/abhgupta/origin/forks","keys_url":"https://api.github.com/repos/abhgupta/origin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/abhgupta/origin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/abhgupta/origin/teams","hooks_url":"https://api.github.com/repos/abhgupta/origin/hooks","issue_events_url":"https://api.github.com/repos/abhgupta/origin/issues/events{/number}","events_url":"https://api.github.com/repos/abhgupta/origin/events","assignees_url":"https://api.github.com/repos/abhgupta/origin/assignees{/user}","branches_url":"https://api.github.com/repos/abhgupta/origin/branches{/branch}","tags_url":"https://api.github.com/repos/abhgupta/origin/tags","blobs_url":"https://api.github.com/repos/abhgupta/origin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/abhgupta/origin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/abhgupta/origin/git/refs{/sha}","trees_url":"https://api.github.com/repos/abhgupta/origin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/abhgupta/origin/statuses/{sha}","languages_url":"https://api.github.com/repos/abhgupta/origin/languages","stargazers_url":"https://api.github.com/repos/abhgupta/origin/stargazers","contributors_url":"https://api.github.com/repos/abhgupta/origin/contributors","subscribers_url":"https://api.github.com/repos/abhgupta/origin/subscribers","subscription_url":"https://api.github.com/repos/abhgupta/origin/subscription","commits_url":"https://api.github.com/repos/abhgupta/origin/commits{/sha}","git_commits_url":"https://api.github.com/repos/abhgupta/origin/git/commits{/sha}","comments_url":"https://api.github.com/repos/abhgupta/origin/comments{/number}","issue_comment_url":"https://api.github.com/repos/abhgupta/origin/issues/comments{/number}","contents_url":"https://api.github.com/repos/abhgupta/origin/contents/{+path}","compare_url":"https://api.github.com/repos/abhgupta/origin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/abhgupta/origin/merges","archive_url":"https://api.github.com/repos/abhgupta/origin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/abhgupta/origin/downloads","issues_url":"https://api.github.com/repos/abhgupta/origin/issues{/number}","pulls_url":"https://api.github.com/repos/abhgupta/origin/pulls{/number}","milestones_url":"https://api.github.com/repos/abhgupta/origin/milestones{/number}","notifications_url":"https://api.github.com/repos/abhgupta/origin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/abhgupta/origin/labels{/name}","releases_url":"https://api.github.com/repos/abhgupta/origin/releases{/id}","created_at":"2014-09-12T21:38:33Z","updated_at":"2015-05-08T20:42:26Z","pushed_at":"2015-05-19T01:35:51Z","git_url":"git://github.com/abhgupta/origin.git","ssh_url":"git@github.com:abhgupta/origin.git","clone_url":"https://github.com/abhgupta/origin.git","svn_url":"https://github.com/abhgupta/origin","homepage":"https://openshift.github.io","size":104963,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openshift:master","ref":"master","sha":"a7bed7ab45c2bdeda8644854c98ec51493e872a0","user":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"repo":{"id":22442668,"name":"origin","full_name":"openshift/origin","owner":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openshift/origin","description":"OpenShift 3 - build, deploy, and manage your applications with Docker and Kubernetes","fork":false,"url":"https://api.github.com/repos/openshift/origin","forks_url":"https://api.github.com/repos/openshift/origin/forks","keys_url":"https://api.github.com/repos/openshift/origin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/origin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/origin/teams","hooks_url":"https://api.github.com/repos/openshift/origin/hooks","issue_events_url":"https://api.github.com/repos/openshift/origin/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/origin/events","assignees_url":"https://api.github.com/repos/openshift/origin/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/origin/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/origin/tags","blobs_url":"https://api.github.com/repos/openshift/origin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/origin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/origin/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/origin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/origin/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/origin/languages","stargazers_url":"https://api.github.com/repos/openshift/origin/stargazers","contributors_url":"https://api.github.com/repos/openshift/origin/contributors","subscribers_url":"https://api.github.com/repos/openshift/origin/subscribers","subscription_url":"https://api.github.com/repos/openshift/origin/subscription","commits_url":"https://api.github.com/repos/openshift/origin/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/origin/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/origin/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/origin/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/origin/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/origin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/origin/merges","archive_url":"https://api.github.com/repos/openshift/origin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/origin/downloads","issues_url":"https://api.github.com/repos/openshift/origin/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/origin/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/origin/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/origin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/origin/labels{/name}","releases_url":"https://api.github.com/repos/openshift/origin/releases{/id}","created_at":"2014-07-30T20:04:05Z","updated_at":"2015-05-19T04:29:35Z","pushed_at":"2015-05-19T10:05:40Z","git_url":"git://github.com/openshift/origin.git","ssh_url":"git@github.com:openshift/origin.git","clone_url":"https://github.com/openshift/origin.git","svn_url":"https://github.com/openshift/origin","homepage":"http://www.openshift.org","size":160881,"stargazers_count":427,"watchers_count":427,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":208,"mirror_url":null,"open_issues_count":203,"forks":208,"open_issues":203,"watchers":427,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/origin/pulls/2327"},"html":{"href":"https://github.com/openshift/origin/pull/2327"},"issue":{"href":"https://api.github.com/repos/openshift/origin/issues/2327"},"comments":{"href":"https://api.github.com/repos/openshift/origin/issues/2327/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/origin/pulls/2327/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/origin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/origin/pulls/2327/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/origin/statuses/db1edf56c83760632404402c566ad618daf931de"}}}}