{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/24331","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/24331/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/24331/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/24331/events","html_url":"https://github.com/kubernetes/kubernetes/pull/24331","id":148680776,"number":24331,"title":"Refactor persistent volume controller","user":{"login":"jsafrane","id":1745006,"avatar_url":"https://avatars.githubusercontent.com/u/1745006?v=3","gravatar_id":"","url":"https://api.github.com/users/jsafrane","html_url":"https://github.com/jsafrane","followers_url":"https://api.github.com/users/jsafrane/followers","following_url":"https://api.github.com/users/jsafrane/following{/other_user}","gists_url":"https://api.github.com/users/jsafrane/gists{/gist_id}","starred_url":"https://api.github.com/users/jsafrane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsafrane/subscriptions","organizations_url":"https://api.github.com/users/jsafrane/orgs","repos_url":"https://api.github.com/users/jsafrane/repos","events_url":"https://api.github.com/users/jsafrane/events{/privacy}","received_events_url":"https://api.github.com/users/jsafrane/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/cla:%20yes","name":"cla: yes","color":"bfe5bf"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/kind/api-change","name":"kind/api-change","color":"c7def8"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/release-note","name":"release-note","color":"c2e0c6"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/release-note-label-needed","name":"release-note-label-needed","color":"db5a64"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/size/XXL","name":"size/XXL","color":"ee0000"}],"state":"open","locked":false,"assignee":{"login":"saad-ali","id":10052848,"avatar_url":"https://avatars.githubusercontent.com/u/10052848?v=3","gravatar_id":"","url":"https://api.github.com/users/saad-ali","html_url":"https://github.com/saad-ali","followers_url":"https://api.github.com/users/saad-ali/followers","following_url":"https://api.github.com/users/saad-ali/following{/other_user}","gists_url":"https://api.github.com/users/saad-ali/gists{/gist_id}","starred_url":"https://api.github.com/users/saad-ali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saad-ali/subscriptions","organizations_url":"https://api.github.com/users/saad-ali/orgs","repos_url":"https://api.github.com/users/saad-ali/repos","events_url":"https://api.github.com/users/saad-ali/events{/privacy}","received_events_url":"https://api.github.com/users/saad-ali/received_events","type":"User","site_admin":false},"milestone":null,"comments":12,"created_at":"2016-04-15T14:49:19Z","updated_at":"2016-05-03T05:27:50Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/24331","html_url":"https://github.com/kubernetes/kubernetes/pull/24331","diff_url":"https://github.com/kubernetes/kubernetes/pull/24331.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/24331.patch"},"body":"Here is complete persistent controller as designed in https://github.com/pmorie/pv-haxxz/blob/master/controller.go\r\n\r\nIt's feature complete and compatible with current binder/recycler/provisioner. No new features, it *should* be much more stable and predictable.\r\n\r\nTesting\r\n--\r\nThe unit test framework is quite complicated, still it was necessary to reach reasonable coverage (78% in `persistentvolume_controller.go`). The untested part are error cases, which are quite hard to test in reasonable way - sure, I can inject a VersionConflictError on any object update and check the error bubbles up to appropriate places, but the real test would be to run `syncClaim`/`syncVolume` again and check it recovers appropriately from the error in the next periodic sync. That's the hard part.\r\n\r\nOrganization\r\n---\r\nThe PR starts with `rm -rf kubernetes/pkg/controller/persistentvolume`. I find it easier to read when I see only the new controller without old pieces scattered around.\r\n[`types.go` from the old controller is reused to speed up matching a bit, the code looks solid and has 95% unit test coverage].\r\n\r\nI tried to split the PR into smaller patches, let me know what you think.\r\n\r\nTODO\r\n--\r\n\r\n* ~~Missing: provisioning, recycling~~.\r\n* Fix integration tests\r\n* Fix e2e tests\r\n\r\n@kubernetes/sig-storage "},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/216442045","html_url":"https://github.com/kubernetes/kubernetes/pull/24331#issuecomment-216442045","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/24331","id":216442045,"user":{"login":"pmorie","id":366488,"avatar_url":"https://avatars.githubusercontent.com/u/366488?v=3","gravatar_id":"","url":"https://api.github.com/users/pmorie","html_url":"https://github.com/pmorie","followers_url":"https://api.github.com/users/pmorie/followers","following_url":"https://api.github.com/users/pmorie/following{/other_user}","gists_url":"https://api.github.com/users/pmorie/gists{/gist_id}","starred_url":"https://api.github.com/users/pmorie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmorie/subscriptions","organizations_url":"https://api.github.com/users/pmorie/orgs","repos_url":"https://api.github.com/users/pmorie/repos","events_url":"https://api.github.com/users/pmorie/events{/privacy}","received_events_url":"https://api.github.com/users/pmorie/received_events","type":"User","site_admin":false},"created_at":"2016-05-03T05:27:50Z","updated_at":"2016-05-03T05:27:50Z","body":"@jsafrane I have to quit for the night but this is looking awesome so far.\r\n\r\nOne thing:  I think it would be extremely advantageous to keep the existing controller in a different package.  I have some ideas / plans for how to do that; don't worry about it for now, just keep plugging."}}