{"action":"created","comment":{"url":"https://api.github.com/repos/portworx/talisman/pulls/comments/166122305","pull_request_review_id":94154498,"id":166122305,"diff_hunk":"@@ -243,3 +256,217 @@ func (ops *pxClusterOps) runDockerPuller(imageToPull string) error {\n \n \treturn nil\n }\n+\n+func (ops *pxClusterOps) scaleSharedAppsToZero() error {\n+\tsharedDeps, sharedSS, err := ops.getPXSharedApps()\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\n+\tlogrus.Infof(\"found %d deployments and %d statefulsets to scale down\", len(sharedDeps), len(sharedSS))\n+\n+\tvar valZero int32\n+\tfor _, d := range sharedDeps {\n+\t\tdeploymentName := d.Name\n+\t\tdeploymentNamespace := d.Namespace\n+\t\tlogrus.Infof(\"scaling down deployment: [%s] %s\", deploymentNamespace, deploymentName)\n+\n+\t\tt := func() (interface{}, bool, error) {\n+\t\t\tdCopy, err := ops.kubeClient.Apps().Deployments(deploymentNamespace).Get(deploymentName, metav1.GetOptions{})\n+\t\t\tif err != nil {\n+\t\t\t\tif matched, _ := regexp.MatchString(\".+ not found\", err.Error()); matched {\n+\t\t\t\t\treturn nil, false, nil // done as deployment is deleted\n+\t\t\t\t}\n+\n+\t\t\t\treturn nil, true, err\n+\t\t\t}\n+\n+\t\t\tdCopy = dCopy.DeepCopy()\n+\t\t\tdCopy.Annotations[replicaMemoryKey] = fmt.Sprintf(\"%d\", *dCopy.Spec.Replicas)","path":"pkg/cluster/px/px.go","position":114,"original_position":114,"commit_id":"f554b122a7f298ff47bef5ecfe0167bf3ed6f63c","original_commit_id":"f554b122a7f298ff47bef5ecfe0167bf3ed6f63c","user":{"login":"lpabon","id":3880001,"avatar_url":"https://avatars2.githubusercontent.com/u/3880001?v=4","gravatar_id":"","url":"https://api.github.com/users/lpabon","html_url":"https://github.com/lpabon","followers_url":"https://api.github.com/users/lpabon/followers","following_url":"https://api.github.com/users/lpabon/following{/other_user}","gists_url":"https://api.github.com/users/lpabon/gists{/gist_id}","starred_url":"https://api.github.com/users/lpabon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lpabon/subscriptions","organizations_url":"https://api.github.com/users/lpabon/orgs","repos_url":"https://api.github.com/users/lpabon/repos","events_url":"https://api.github.com/users/lpabon/events{/privacy}","received_events_url":"https://api.github.com/users/lpabon/received_events","type":"User","site_admin":false},"body":"May want to add a comment to as what this is doing and why it is needed","created_at":"2018-02-05T21:47:18Z","updated_at":"2018-02-05T21:50:34Z","html_url":"https://github.com/portworx/talisman/pull/17#discussion_r166122305","pull_request_url":"https://api.github.com/repos/portworx/talisman/pulls/17","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/portworx/talisman/pulls/comments/166122305"},"html":{"href":"https://github.com/portworx/talisman/pull/17#discussion_r166122305"},"pull_request":{"href":"https://api.github.com/repos/portworx/talisman/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/portworx/talisman/pulls/17","id":166978129,"html_url":"https://github.com/portworx/talisman/pull/17","diff_url":"https://github.com/portworx/talisman/pull/17.diff","patch_url":"https://github.com/portworx/talisman/pull/17.patch","issue_url":"https://api.github.com/repos/portworx/talisman/issues/17","number":17,"state":"open","locked":false,"title":"Scale down and restore PX shared applications during upgrade","user":{"login":"harsh-px","id":26801153,"avatar_url":"https://avatars1.githubusercontent.com/u/26801153?v=4","gravatar_id":"","url":"https://api.github.com/users/harsh-px","html_url":"https://github.com/harsh-px","followers_url":"https://api.github.com/users/harsh-px/followers","following_url":"https://api.github.com/users/harsh-px/following{/other_user}","gists_url":"https://api.github.com/users/harsh-px/gists{/gist_id}","starred_url":"https://api.github.com/users/harsh-px/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harsh-px/subscriptions","organizations_url":"https://api.github.com/users/harsh-px/orgs","repos_url":"https://api.github.com/users/harsh-px/repos","events_url":"https://api.github.com/users/harsh-px/events{/privacy}","received_events_url":"https://api.github.com/users/harsh-px/received_events","type":"User","site_admin":false},"body":"Closes #13\r\n\r\n<!--\r\n  Make sure to have done the following:\r\n  [] Signed off your work as per the DCO.\r\n  [] Add unit-tests\r\n-->\r\n\r\n**What this PR does / why we need it**:\r\n\r\n**Which issue(s) this PR fixes** (optional)\r\nCloses #\r\n\r\n**Special notes for your reviewer**:\r\n\r\n","created_at":"2018-02-03T20:07:10Z","updated_at":"2018-02-05T21:50:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"54c7e28fa17fe047ed06e03a9bbe976bd47ebe1c","assignee":{"login":"harsh-px","id":26801153,"avatar_url":"https://avatars1.githubusercontent.com/u/26801153?v=4","gravatar_id":"","url":"https://api.github.com/users/harsh-px","html_url":"https://github.com/harsh-px","followers_url":"https://api.github.com/users/harsh-px/followers","following_url":"https://api.github.com/users/harsh-px/following{/other_user}","gists_url":"https://api.github.com/users/harsh-px/gists{/gist_id}","starred_url":"https://api.github.com/users/harsh-px/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harsh-px/subscriptions","organizations_url":"https://api.github.com/users/harsh-px/orgs","repos_url":"https://api.github.com/users/harsh-px/repos","events_url":"https://api.github.com/users/harsh-px/events{/privacy}","received_events_url":"https://api.github.com/users/harsh-px/received_events","type":"User","site_admin":false},"assignees":[{"login":"harsh-px","id":26801153,"avatar_url":"https://avatars1.githubusercontent.com/u/26801153?v=4","gravatar_id":"","url":"https://api.github.com/users/harsh-px","html_url":"https://github.com/harsh-px","followers_url":"https://api.github.com/users/harsh-px/followers","following_url":"https://api.github.com/users/harsh-px/following{/other_user}","gists_url":"https://api.github.com/users/harsh-px/gists{/gist_id}","starred_url":"https://api.github.com/users/harsh-px/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harsh-px/subscriptions","organizations_url":"https://api.github.com/users/harsh-px/orgs","repos_url":"https://api.github.com/users/harsh-px/repos","events_url":"https://api.github.com/users/harsh-px/events{/privacy}","received_events_url":"https://api.github.com/users/harsh-px/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/portworx/talisman/pulls/17/commits","review_comments_url":"https://api.github.com/repos/portworx/talisman/pulls/17/comments","review_comment_url":"https://api.github.com/repos/portworx/talisman/pulls/comments{/number}","comments_url":"https://api.github.com/repos/portworx/talisman/issues/17/comments","statuses_url":"https://api.github.com/repos/portworx/talisman/statuses/f554b122a7f298ff47bef5ecfe0167bf3ed6f63c","head":{"label":"harsh-px:drain-shared","ref":"drain-shared","sha":"f554b122a7f298ff47bef5ecfe0167bf3ed6f63c","user":{"login":"harsh-px","id":26801153,"avatar_url":"https://avatars1.githubusercontent.com/u/26801153?v=4","gravatar_id":"","url":"https://api.github.com/users/harsh-px","html_url":"https://github.com/harsh-px","followers_url":"https://api.github.com/users/harsh-px/followers","following_url":"https://api.github.com/users/harsh-px/following{/other_user}","gists_url":"https://api.github.com/users/harsh-px/gists{/gist_id}","starred_url":"https://api.github.com/users/harsh-px/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harsh-px/subscriptions","organizations_url":"https://api.github.com/users/harsh-px/orgs","repos_url":"https://api.github.com/users/harsh-px/repos","events_url":"https://api.github.com/users/harsh-px/events{/privacy}","received_events_url":"https://api.github.com/users/harsh-px/received_events","type":"User","site_admin":false},"repo":{"id":116344104,"name":"talisman","full_name":"harsh-px/talisman","owner":{"login":"harsh-px","id":26801153,"avatar_url":"https://avatars1.githubusercontent.com/u/26801153?v=4","gravatar_id":"","url":"https://api.github.com/users/harsh-px","html_url":"https://github.com/harsh-px","followers_url":"https://api.github.com/users/harsh-px/followers","following_url":"https://api.github.com/users/harsh-px/following{/other_user}","gists_url":"https://api.github.com/users/harsh-px/gists{/gist_id}","starred_url":"https://api.github.com/users/harsh-px/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harsh-px/subscriptions","organizations_url":"https://api.github.com/users/harsh-px/orgs","repos_url":"https://api.github.com/users/harsh-px/repos","events_url":"https://api.github.com/users/harsh-px/events{/privacy}","received_events_url":"https://api.github.com/users/harsh-px/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/harsh-px/talisman","description":"Talisman is an operator to manage the lifecycle of a Portworx cluster on Kubernetes","fork":true,"url":"https://api.github.com/repos/harsh-px/talisman","forks_url":"https://api.github.com/repos/harsh-px/talisman/forks","keys_url":"https://api.github.com/repos/harsh-px/talisman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/harsh-px/talisman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/harsh-px/talisman/teams","hooks_url":"https://api.github.com/repos/harsh-px/talisman/hooks","issue_events_url":"https://api.github.com/repos/harsh-px/talisman/issues/events{/number}","events_url":"https://api.github.com/repos/harsh-px/talisman/events","assignees_url":"https://api.github.com/repos/harsh-px/talisman/assignees{/user}","branches_url":"https://api.github.com/repos/harsh-px/talisman/branches{/branch}","tags_url":"https://api.github.com/repos/harsh-px/talisman/tags","blobs_url":"https://api.github.com/repos/harsh-px/talisman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/harsh-px/talisman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/harsh-px/talisman/git/refs{/sha}","trees_url":"https://api.github.com/repos/harsh-px/talisman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/harsh-px/talisman/statuses/{sha}","languages_url":"https://api.github.com/repos/harsh-px/talisman/languages","stargazers_url":"https://api.github.com/repos/harsh-px/talisman/stargazers","contributors_url":"https://api.github.com/repos/harsh-px/talisman/contributors","subscribers_url":"https://api.github.com/repos/harsh-px/talisman/subscribers","subscription_url":"https://api.github.com/repos/harsh-px/talisman/subscription","commits_url":"https://api.github.com/repos/harsh-px/talisman/commits{/sha}","git_commits_url":"https://api.github.com/repos/harsh-px/talisman/git/commits{/sha}","comments_url":"https://api.github.com/repos/harsh-px/talisman/comments{/number}","issue_comment_url":"https://api.github.com/repos/harsh-px/talisman/issues/comments{/number}","contents_url":"https://api.github.com/repos/harsh-px/talisman/contents/{+path}","compare_url":"https://api.github.com/repos/harsh-px/talisman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/harsh-px/talisman/merges","archive_url":"https://api.github.com/repos/harsh-px/talisman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/harsh-px/talisman/downloads","issues_url":"https://api.github.com/repos/harsh-px/talisman/issues{/number}","pulls_url":"https://api.github.com/repos/harsh-px/talisman/pulls{/number}","milestones_url":"https://api.github.com/repos/harsh-px/talisman/milestones{/number}","notifications_url":"https://api.github.com/repos/harsh-px/talisman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/harsh-px/talisman/labels{/name}","releases_url":"https://api.github.com/repos/harsh-px/talisman/releases{/id}","deployments_url":"https://api.github.com/repos/harsh-px/talisman/deployments","created_at":"2018-01-05T05:02:19Z","updated_at":"2018-01-05T05:02:21Z","pushed_at":"2018-02-05T02:58:23Z","git_url":"git://github.com/harsh-px/talisman.git","ssh_url":"git@github.com:harsh-px/talisman.git","clone_url":"https://github.com/harsh-px/talisman.git","svn_url":"https://github.com/harsh-px/talisman","homepage":null,"size":7160,"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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"portworx:master","ref":"master","sha":"36400e558dfd5c2a6a521bd40871762e46918ee4","user":{"login":"portworx","id":12014092,"avatar_url":"https://avatars3.githubusercontent.com/u/12014092?v=4","gravatar_id":"","url":"https://api.github.com/users/portworx","html_url":"https://github.com/portworx","followers_url":"https://api.github.com/users/portworx/followers","following_url":"https://api.github.com/users/portworx/following{/other_user}","gists_url":"https://api.github.com/users/portworx/gists{/gist_id}","starred_url":"https://api.github.com/users/portworx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/portworx/subscriptions","organizations_url":"https://api.github.com/users/portworx/orgs","repos_url":"https://api.github.com/users/portworx/repos","events_url":"https://api.github.com/users/portworx/events{/privacy}","received_events_url":"https://api.github.com/users/portworx/received_events","type":"Organization","site_admin":false},"repo":{"id":115672153,"name":"talisman","full_name":"portworx/talisman","owner":{"login":"portworx","id":12014092,"avatar_url":"https://avatars3.githubusercontent.com/u/12014092?v=4","gravatar_id":"","url":"https://api.github.com/users/portworx","html_url":"https://github.com/portworx","followers_url":"https://api.github.com/users/portworx/followers","following_url":"https://api.github.com/users/portworx/following{/other_user}","gists_url":"https://api.github.com/users/portworx/gists{/gist_id}","starred_url":"https://api.github.com/users/portworx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/portworx/subscriptions","organizations_url":"https://api.github.com/users/portworx/orgs","repos_url":"https://api.github.com/users/portworx/repos","events_url":"https://api.github.com/users/portworx/events{/privacy}","received_events_url":"https://api.github.com/users/portworx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/portworx/talisman","description":"Talisman is an operator to manage the lifecycle of a Portworx cluster on Kubernetes","fork":false,"url":"https://api.github.com/repos/portworx/talisman","forks_url":"https://api.github.com/repos/portworx/talisman/forks","keys_url":"https://api.github.com/repos/portworx/talisman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/portworx/talisman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/portworx/talisman/teams","hooks_url":"https://api.github.com/repos/portworx/talisman/hooks","issue_events_url":"https://api.github.com/repos/portworx/talisman/issues/events{/number}","events_url":"https://api.github.com/repos/portworx/talisman/events","assignees_url":"https://api.github.com/repos/portworx/talisman/assignees{/user}","branches_url":"https://api.github.com/repos/portworx/talisman/branches{/branch}","tags_url":"https://api.github.com/repos/portworx/talisman/tags","blobs_url":"https://api.github.com/repos/portworx/talisman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/portworx/talisman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/portworx/talisman/git/refs{/sha}","trees_url":"https://api.github.com/repos/portworx/talisman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/portworx/talisman/statuses/{sha}","languages_url":"https://api.github.com/repos/portworx/talisman/languages","stargazers_url":"https://api.github.com/repos/portworx/talisman/stargazers","contributors_url":"https://api.github.com/repos/portworx/talisman/contributors","subscribers_url":"https://api.github.com/repos/portworx/talisman/subscribers","subscription_url":"https://api.github.com/repos/portworx/talisman/subscription","commits_url":"https://api.github.com/repos/portworx/talisman/commits{/sha}","git_commits_url":"https://api.github.com/repos/portworx/talisman/git/commits{/sha}","comments_url":"https://api.github.com/repos/portworx/talisman/comments{/number}","issue_comment_url":"https://api.github.com/repos/portworx/talisman/issues/comments{/number}","contents_url":"https://api.github.com/repos/portworx/talisman/contents/{+path}","compare_url":"https://api.github.com/repos/portworx/talisman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/portworx/talisman/merges","archive_url":"https://api.github.com/repos/portworx/talisman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/portworx/talisman/downloads","issues_url":"https://api.github.com/repos/portworx/talisman/issues{/number}","pulls_url":"https://api.github.com/repos/portworx/talisman/pulls{/number}","milestones_url":"https://api.github.com/repos/portworx/talisman/milestones{/number}","notifications_url":"https://api.github.com/repos/portworx/talisman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/portworx/talisman/labels{/name}","releases_url":"https://api.github.com/repos/portworx/talisman/releases{/id}","deployments_url":"https://api.github.com/repos/portworx/talisman/deployments","created_at":"2017-12-29T01:04:30Z","updated_at":"2018-01-18T01:51:25Z","pushed_at":"2018-02-03T20:07:11Z","git_url":"git://github.com/portworx/talisman.git","ssh_url":"git@github.com:portworx/talisman.git","clone_url":"https://github.com/portworx/talisman.git","svn_url":"https://github.com/portworx/talisman","homepage":null,"size":5480,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":6,"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":1,"open_issues":6,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/portworx/talisman/pulls/17"},"html":{"href":"https://github.com/portworx/talisman/pull/17"},"issue":{"href":"https://api.github.com/repos/portworx/talisman/issues/17"},"comments":{"href":"https://api.github.com/repos/portworx/talisman/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/portworx/talisman/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/portworx/talisman/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/portworx/talisman/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/portworx/talisman/statuses/f554b122a7f298ff47bef5ecfe0167bf3ed6f63c"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"lpabon"}}