{"action":"created","comment":{"url":"https://api.github.com/repos/portworx/torpedo/pulls/comments/181911245","pull_request_review_id":112605600,"id":181911245,"diff_hunk":"@@ -625,6 +627,81 @@ func (d *portworx) WaitForUpgrade(n node.Node, image, tag string) error {\n \treturn nil\n }\n \n+func (d *portworx) GetReplicationFactor(vol *torpedovolume.Volume) (int64, error) {\n+\tname := d.schedOps.GetVolumeName(vol)\n+\tt := func() (interface{}, bool, error) {\n+\t\tvols, err := d.volDriver.Inspect([]string{name})\n+\t\tif err != nil && err == volume.ErrEnoEnt {\n+\t\t\treturn 0, false, volume.ErrEnoEnt\n+\t\t} else if err != nil {\n+\t\t\treturn 0, false, err\n+\t\t}\n+\t\tif len(vols) == 1 {\n+\t\t\treturn vols[0].Spec.HaLevel, false, nil\n+\t\t}\n+\t\treturn 0, false, fmt.Errorf(\"Extra volumes with the same volume name/ID seen\") //Shouldn't reach this line\n+\t}\n+\n+\ttmp, err := task.DoRetryWithTimeout(t, defaultRetryInterval, defaultRetryInterval)\n+\tif err != nil {\n+\t\treturn 0, &ErrFailedToGetReplicationFactor{\n+\t\t\tID:    name,\n+\t\t\tCause: err.Error(),\n+\t\t}\n+\t}\n+\trepFactor, ok := tmp.(int64)\n+\tif !ok {\n+\t\treturn 0, &ErrFailedToGetReplicationFactor{\n+\t\t\tID:    name,\n+\t\t\tCause: fmt.Sprintf(\"Replication factor is not of type int64\"),\n+\t\t}\n+\t}\n+\n+\treturn repFactor, nil\n+}\n+\n+func (d *portworx) SetReplicationFactor(vol *torpedovolume.Volume, replFactor int64) error {\n+\tname := d.schedOps.GetVolumeName(vol)\n+\tt := func() (interface{}, bool, error) {\n+\t\tvols, err := d.volDriver.Inspect([]string{name})\n+\t\tif err != nil && err == volume.ErrEnoEnt {\n+\t\t\treturn nil, false, volume.ErrEnoEnt\n+\t\t} else if err != nil {\n+\t\t\treturn nil, false, err\n+\t\t}\n+\t\tspec := &api.VolumeSpec{\n+\t\t\tHaLevel:          int64(replFactor),\n+\t\t\tSnapshotInterval: math.MaxUint32,\n+\t\t\tReplicaSet:       &api.ReplicaSet{},\n+\t\t}\n+\n+\t\tlogrus.Infof(\"Replication passed here is: %d\", replFactor)","path":"drivers/volume/portworx/portworx.go","position":68,"original_position":68,"commit_id":"7177a4d870a2d3182bdeb75ecc5a72b13529922c","original_commit_id":"7177a4d870a2d3182bdeb75ecc5a72b13529922c","user":{"login":"piyush-nimbalkar","id":313758,"avatar_url":"https://avatars0.githubusercontent.com/u/313758?v=4","gravatar_id":"","url":"https://api.github.com/users/piyush-nimbalkar","html_url":"https://github.com/piyush-nimbalkar","followers_url":"https://api.github.com/users/piyush-nimbalkar/followers","following_url":"https://api.github.com/users/piyush-nimbalkar/following{/other_user}","gists_url":"https://api.github.com/users/piyush-nimbalkar/gists{/gist_id}","starred_url":"https://api.github.com/users/piyush-nimbalkar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piyush-nimbalkar/subscriptions","organizations_url":"https://api.github.com/users/piyush-nimbalkar/orgs","repos_url":"https://api.github.com/users/piyush-nimbalkar/repos","events_url":"https://api.github.com/users/piyush-nimbalkar/events{/privacy}","received_events_url":"https://api.github.com/users/piyush-nimbalkar/received_events","type":"User","site_admin":false},"body":"was this for debugging? If not, let's put it outside the retry function.","created_at":"2018-04-16T23:08:40Z","updated_at":"2018-04-16T23:43:23Z","html_url":"https://github.com/portworx/torpedo/pull/143#discussion_r181911245","pull_request_url":"https://api.github.com/repos/portworx/torpedo/pulls/143","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/portworx/torpedo/pulls/comments/181911245"},"html":{"href":"https://github.com/portworx/torpedo/pull/143#discussion_r181911245"},"pull_request":{"href":"https://api.github.com/repos/portworx/torpedo/pulls/143"}}},"pull_request":{"url":"https://api.github.com/repos/portworx/torpedo/pulls/143","id":181971828,"html_url":"https://github.com/portworx/torpedo/pull/143","diff_url":"https://github.com/portworx/torpedo/pull/143.diff","patch_url":"https://github.com/portworx/torpedo/pull/143.patch","issue_url":"https://api.github.com/repos/portworx/torpedo/issues/143","number":143,"state":"open","locked":false,"title":"Vol repl increase decrease tests","user":{"login":"varunturlapati","id":16810494,"avatar_url":"https://avatars0.githubusercontent.com/u/16810494?v=4","gravatar_id":"","url":"https://api.github.com/users/varunturlapati","html_url":"https://github.com/varunturlapati","followers_url":"https://api.github.com/users/varunturlapati/followers","following_url":"https://api.github.com/users/varunturlapati/following{/other_user}","gists_url":"https://api.github.com/users/varunturlapati/gists{/gist_id}","starred_url":"https://api.github.com/users/varunturlapati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/varunturlapati/subscriptions","organizations_url":"https://api.github.com/users/varunturlapati/orgs","repos_url":"https://api.github.com/users/varunturlapati/repos","events_url":"https://api.github.com/users/varunturlapati/events{/privacy}","received_events_url":"https://api.github.com/users/varunturlapati/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-04-16T19:58:53Z","updated_at":"2018-04-16T23:43:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0a68cb924c6bc0e82347b033bace55953ea43dfd","assignee":null,"assignees":[],"requested_reviewers":[{"login":"adityadani","id":313611,"avatar_url":"https://avatars3.githubusercontent.com/u/313611?v=4","gravatar_id":"","url":"https://api.github.com/users/adityadani","html_url":"https://github.com/adityadani","followers_url":"https://api.github.com/users/adityadani/followers","following_url":"https://api.github.com/users/adityadani/following{/other_user}","gists_url":"https://api.github.com/users/adityadani/gists{/gist_id}","starred_url":"https://api.github.com/users/adityadani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adityadani/subscriptions","organizations_url":"https://api.github.com/users/adityadani/orgs","repos_url":"https://api.github.com/users/adityadani/repos","events_url":"https://api.github.com/users/adityadani/events{/privacy}","received_events_url":"https://api.github.com/users/adityadani/received_events","type":"User","site_admin":false},{"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},{"login":"Rohit-PX","id":32072909,"avatar_url":"https://avatars3.githubusercontent.com/u/32072909?v=4","gravatar_id":"","url":"https://api.github.com/users/Rohit-PX","html_url":"https://github.com/Rohit-PX","followers_url":"https://api.github.com/users/Rohit-PX/followers","following_url":"https://api.github.com/users/Rohit-PX/following{/other_user}","gists_url":"https://api.github.com/users/Rohit-PX/gists{/gist_id}","starred_url":"https://api.github.com/users/Rohit-PX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rohit-PX/subscriptions","organizations_url":"https://api.github.com/users/Rohit-PX/orgs","repos_url":"https://api.github.com/users/Rohit-PX/repos","events_url":"https://api.github.com/users/Rohit-PX/events{/privacy}","received_events_url":"https://api.github.com/users/Rohit-PX/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/portworx/torpedo/pulls/143/commits","review_comments_url":"https://api.github.com/repos/portworx/torpedo/pulls/143/comments","review_comment_url":"https://api.github.com/repos/portworx/torpedo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/portworx/torpedo/issues/143/comments","statuses_url":"https://api.github.com/repos/portworx/torpedo/statuses/7177a4d870a2d3182bdeb75ecc5a72b13529922c","head":{"label":"varunturlapati:vol_resize","ref":"vol_resize","sha":"7177a4d870a2d3182bdeb75ecc5a72b13529922c","user":{"login":"varunturlapati","id":16810494,"avatar_url":"https://avatars0.githubusercontent.com/u/16810494?v=4","gravatar_id":"","url":"https://api.github.com/users/varunturlapati","html_url":"https://github.com/varunturlapati","followers_url":"https://api.github.com/users/varunturlapati/followers","following_url":"https://api.github.com/users/varunturlapati/following{/other_user}","gists_url":"https://api.github.com/users/varunturlapati/gists{/gist_id}","starred_url":"https://api.github.com/users/varunturlapati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/varunturlapati/subscriptions","organizations_url":"https://api.github.com/users/varunturlapati/orgs","repos_url":"https://api.github.com/users/varunturlapati/repos","events_url":"https://api.github.com/users/varunturlapati/events{/privacy}","received_events_url":"https://api.github.com/users/varunturlapati/received_events","type":"User","site_admin":false},"repo":{"id":103712002,"name":"torpedo","full_name":"varunturlapati/torpedo","owner":{"login":"varunturlapati","id":16810494,"avatar_url":"https://avatars0.githubusercontent.com/u/16810494?v=4","gravatar_id":"","url":"https://api.github.com/users/varunturlapati","html_url":"https://github.com/varunturlapati","followers_url":"https://api.github.com/users/varunturlapati/followers","following_url":"https://api.github.com/users/varunturlapati/following{/other_user}","gists_url":"https://api.github.com/users/varunturlapati/gists{/gist_id}","starred_url":"https://api.github.com/users/varunturlapati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/varunturlapati/subscriptions","organizations_url":"https://api.github.com/users/varunturlapati/orgs","repos_url":"https://api.github.com/users/varunturlapati/repos","events_url":"https://api.github.com/users/varunturlapati/events{/privacy}","received_events_url":"https://api.github.com/users/varunturlapati/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/varunturlapati/torpedo","description":"A test suite to qualify storage providers for stateful containers running in a cluster.","fork":true,"url":"https://api.github.com/repos/varunturlapati/torpedo","forks_url":"https://api.github.com/repos/varunturlapati/torpedo/forks","keys_url":"https://api.github.com/repos/varunturlapati/torpedo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/varunturlapati/torpedo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/varunturlapati/torpedo/teams","hooks_url":"https://api.github.com/repos/varunturlapati/torpedo/hooks","issue_events_url":"https://api.github.com/repos/varunturlapati/torpedo/issues/events{/number}","events_url":"https://api.github.com/repos/varunturlapati/torpedo/events","assignees_url":"https://api.github.com/repos/varunturlapati/torpedo/assignees{/user}","branches_url":"https://api.github.com/repos/varunturlapati/torpedo/branches{/branch}","tags_url":"https://api.github.com/repos/varunturlapati/torpedo/tags","blobs_url":"https://api.github.com/repos/varunturlapati/torpedo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/varunturlapati/torpedo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/varunturlapati/torpedo/git/refs{/sha}","trees_url":"https://api.github.com/repos/varunturlapati/torpedo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/varunturlapati/torpedo/statuses/{sha}","languages_url":"https://api.github.com/repos/varunturlapati/torpedo/languages","stargazers_url":"https://api.github.com/repos/varunturlapati/torpedo/stargazers","contributors_url":"https://api.github.com/repos/varunturlapati/torpedo/contributors","subscribers_url":"https://api.github.com/repos/varunturlapati/torpedo/subscribers","subscription_url":"https://api.github.com/repos/varunturlapati/torpedo/subscription","commits_url":"https://api.github.com/repos/varunturlapati/torpedo/commits{/sha}","git_commits_url":"https://api.github.com/repos/varunturlapati/torpedo/git/commits{/sha}","comments_url":"https://api.github.com/repos/varunturlapati/torpedo/comments{/number}","issue_comment_url":"https://api.github.com/repos/varunturlapati/torpedo/issues/comments{/number}","contents_url":"https://api.github.com/repos/varunturlapati/torpedo/contents/{+path}","compare_url":"https://api.github.com/repos/varunturlapati/torpedo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/varunturlapati/torpedo/merges","archive_url":"https://api.github.com/repos/varunturlapati/torpedo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/varunturlapati/torpedo/downloads","issues_url":"https://api.github.com/repos/varunturlapati/torpedo/issues{/number}","pulls_url":"https://api.github.com/repos/varunturlapati/torpedo/pulls{/number}","milestones_url":"https://api.github.com/repos/varunturlapati/torpedo/milestones{/number}","notifications_url":"https://api.github.com/repos/varunturlapati/torpedo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/varunturlapati/torpedo/labels{/name}","releases_url":"https://api.github.com/repos/varunturlapati/torpedo/releases{/id}","deployments_url":"https://api.github.com/repos/varunturlapati/torpedo/deployments","created_at":"2017-09-16T00:19:13Z","updated_at":"2017-09-16T00:19:15Z","pushed_at":"2018-04-16T19:56:58Z","git_url":"git://github.com/varunturlapati/torpedo.git","ssh_url":"git@github.com:varunturlapati/torpedo.git","clone_url":"https://github.com/varunturlapati/torpedo.git","svn_url":"https://github.com/varunturlapati/torpedo","homepage":null,"size":77706,"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":"cab5a3ca351b990bca2706859b543ff3d8d279fa","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":92557685,"name":"torpedo","full_name":"portworx/torpedo","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/torpedo","description":"A test suite to qualify storage providers for stateful containers running in a cluster.","fork":false,"url":"https://api.github.com/repos/portworx/torpedo","forks_url":"https://api.github.com/repos/portworx/torpedo/forks","keys_url":"https://api.github.com/repos/portworx/torpedo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/portworx/torpedo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/portworx/torpedo/teams","hooks_url":"https://api.github.com/repos/portworx/torpedo/hooks","issue_events_url":"https://api.github.com/repos/portworx/torpedo/issues/events{/number}","events_url":"https://api.github.com/repos/portworx/torpedo/events","assignees_url":"https://api.github.com/repos/portworx/torpedo/assignees{/user}","branches_url":"https://api.github.com/repos/portworx/torpedo/branches{/branch}","tags_url":"https://api.github.com/repos/portworx/torpedo/tags","blobs_url":"https://api.github.com/repos/portworx/torpedo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/portworx/torpedo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/portworx/torpedo/git/refs{/sha}","trees_url":"https://api.github.com/repos/portworx/torpedo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/portworx/torpedo/statuses/{sha}","languages_url":"https://api.github.com/repos/portworx/torpedo/languages","stargazers_url":"https://api.github.com/repos/portworx/torpedo/stargazers","contributors_url":"https://api.github.com/repos/portworx/torpedo/contributors","subscribers_url":"https://api.github.com/repos/portworx/torpedo/subscribers","subscription_url":"https://api.github.com/repos/portworx/torpedo/subscription","commits_url":"https://api.github.com/repos/portworx/torpedo/commits{/sha}","git_commits_url":"https://api.github.com/repos/portworx/torpedo/git/commits{/sha}","comments_url":"https://api.github.com/repos/portworx/torpedo/comments{/number}","issue_comment_url":"https://api.github.com/repos/portworx/torpedo/issues/comments{/number}","contents_url":"https://api.github.com/repos/portworx/torpedo/contents/{+path}","compare_url":"https://api.github.com/repos/portworx/torpedo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/portworx/torpedo/merges","archive_url":"https://api.github.com/repos/portworx/torpedo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/portworx/torpedo/downloads","issues_url":"https://api.github.com/repos/portworx/torpedo/issues{/number}","pulls_url":"https://api.github.com/repos/portworx/torpedo/pulls{/number}","milestones_url":"https://api.github.com/repos/portworx/torpedo/milestones{/number}","notifications_url":"https://api.github.com/repos/portworx/torpedo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/portworx/torpedo/labels{/name}","releases_url":"https://api.github.com/repos/portworx/torpedo/releases{/id}","deployments_url":"https://api.github.com/repos/portworx/torpedo/deployments","created_at":"2017-05-27T00:15:29Z","updated_at":"2018-04-16T23:22:08Z","pushed_at":"2018-04-16T23:22:07Z","git_url":"git://github.com/portworx/torpedo.git","ssh_url":"git@github.com:portworx/torpedo.git","clone_url":"https://github.com/portworx/torpedo.git","svn_url":"https://github.com/portworx/torpedo","homepage":null,"size":77674,"stargazers_count":35,"watchers_count":35,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"archived":false,"open_issues_count":24,"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":15,"open_issues":24,"watchers":35,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/portworx/torpedo/pulls/143"},"html":{"href":"https://github.com/portworx/torpedo/pull/143"},"issue":{"href":"https://api.github.com/repos/portworx/torpedo/issues/143"},"comments":{"href":"https://api.github.com/repos/portworx/torpedo/issues/143/comments"},"review_comments":{"href":"https://api.github.com/repos/portworx/torpedo/pulls/143/comments"},"review_comment":{"href":"https://api.github.com/repos/portworx/torpedo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/portworx/torpedo/pulls/143/commits"},"statuses":{"href":"https://api.github.com/repos/portworx/torpedo/statuses/7177a4d870a2d3182bdeb75ecc5a72b13529922c"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"piyush-nimbalkar"}}