{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/22724","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/22724/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/22724/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/22724/events","html_url":"https://github.com/kubernetes/kubernetes/pull/22724","id":139435259,"number":22724,"title":"Support for both map-based and set-based selectors in extensions/v1beta1.Scale","user":{"login":"madhusudancs","id":10183,"avatar_url":"https://avatars.githubusercontent.com/u/10183?v=3","gravatar_id":"","url":"https://api.github.com/users/madhusudancs","html_url":"https://github.com/madhusudancs","followers_url":"https://api.github.com/users/madhusudancs/followers","following_url":"https://api.github.com/users/madhusudancs/following{/other_user}","gists_url":"https://api.github.com/users/madhusudancs/gists{/gist_id}","starred_url":"https://api.github.com/users/madhusudancs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madhusudancs/subscriptions","organizations_url":"https://api.github.com/users/madhusudancs/orgs","repos_url":"https://api.github.com/users/madhusudancs/repos","events_url":"https://api.github.com/users/madhusudancs/events{/privacy}","received_events_url":"https://api.github.com/users/madhusudancs/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/cherrypick-candidate","name":"cherrypick-candidate","color":"fef2c0"},{"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/lgtm","name":"lgtm","color":"15dd18"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/priority/P0","name":"priority/P0","color":"e11d21"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/size/XL","name":"size/XL","color":"ee5500"}],"state":"closed","locked":false,"assignee":{"login":"bgrant0607","id":7725777,"avatar_url":"https://avatars.githubusercontent.com/u/7725777?v=3","gravatar_id":"","url":"https://api.github.com/users/bgrant0607","html_url":"https://github.com/bgrant0607","followers_url":"https://api.github.com/users/bgrant0607/followers","following_url":"https://api.github.com/users/bgrant0607/following{/other_user}","gists_url":"https://api.github.com/users/bgrant0607/gists{/gist_id}","starred_url":"https://api.github.com/users/bgrant0607/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgrant0607/subscriptions","organizations_url":"https://api.github.com/users/bgrant0607/orgs","repos_url":"https://api.github.com/users/bgrant0607/repos","events_url":"https://api.github.com/users/bgrant0607/events{/privacy}","received_events_url":"https://api.github.com/users/bgrant0607/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/kubernetes/kubernetes/milestones/15","html_url":"https://github.com/kubernetes/kubernetes/milestones/v1.2","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones/15/labels","id":1278499,"number":15,"title":"v1.2","description":"https://github.com/kubernetes/kubernetes/wiki/Release-1.2","creator":{"login":"bgrant0607","id":7725777,"avatar_url":"https://avatars.githubusercontent.com/u/7725777?v=3","gravatar_id":"","url":"https://api.github.com/users/bgrant0607","html_url":"https://github.com/bgrant0607","followers_url":"https://api.github.com/users/bgrant0607/followers","following_url":"https://api.github.com/users/bgrant0607/following{/other_user}","gists_url":"https://api.github.com/users/bgrant0607/gists{/gist_id}","starred_url":"https://api.github.com/users/bgrant0607/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgrant0607/subscriptions","organizations_url":"https://api.github.com/users/bgrant0607/orgs","repos_url":"https://api.github.com/users/bgrant0607/repos","events_url":"https://api.github.com/users/bgrant0607/events{/privacy}","received_events_url":"https://api.github.com/users/bgrant0607/received_events","type":"User","site_admin":false},"open_issues":112,"closed_issues":700,"state":"open","created_at":"2015-08-29T03:54:16Z","updated_at":"2016-03-10T03:16:26Z","due_on":"2016-03-14T07:00:00Z","closed_at":null},"comments":25,"created_at":"2016-03-09T00:28:33Z","updated_at":"2016-03-10T03:21:49Z","closed_at":"2016-03-10T03:16:26Z","pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/22724","html_url":"https://github.com/kubernetes/kubernetes/pull/22724","diff_url":"https://github.com/kubernetes/kubernetes/pull/22724.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/22724.patch"},"body":"Fixes: #15313, #22505\r\nRef: #16500 (This PR partially fixes #16500, but we will have a more generic solution in v1.3 as proposed in PR #22511)\r\n\r\nHere are a list of changes along with an explanation of how they work:\r\n\r\n1. Add a new string field called TargetSelector to the external version of extensions\r\n   Scale type (extensions/v1beta1.Scale). This is a serialized version\r\n   of either the map-based selector (in case of ReplicationControllers) or the\r\n   unversioned.LabelSelector struct (in case of Deployments and ReplicaSets).\r\n2. Change the selector field in the internal Scale type (extensions.Scale) to\r\n   unversioned.LabelSelector.\r\n3. Add conversion functions to convert from two external selector fields to a single\r\n   internal selector field. The rules for conversion are as follows:\r\n   1.   If the target resource that this scale targets supports LabelSelector\r\n        (Deployments and ReplicaSets), then serialize the LabelSelector and\r\n        store the string in the TargetSelector field in the external version\r\n        and leave the map-based Selector field as nil.\r\n   2.  If the target resource only supports a map-based selector\r\n        (ReplicationControllers), then still serialize that selector and store\r\n        the serialized string in the TargetSelector field. Also, set the the Selector\r\n        map field in the external Scale type to the resource's selector.\r\n   3. When converting from external to internal version, parse the\r\n        TargetSelector string into LabelSelector struct if the string isn't\r\n\tempty. If it is empty, then check if the Selector map is set and just\r\n\tassign that map to the MatchLabels component of the LabelSelector.\r\n   4.  When converting from internal to external version, serialize the\r\n        LabelSelector and store it in the TargetSelector field. If only\r\n\tthe MatchLabel component is set, then also copy that value to\r\n\tthe Selector map field in the external version.\r\n4. HPA now just converts the LabelSelector field to a Selector interface\r\n   type to list the pods.\r\n5. Scale Get and Update etcd methods for Deployments and ReplicaSets now\r\n   return extensions.Scale instead of autoscaling.Scale.\r\n6. Consequently, SubresourceGroupVersion override and is \"autoscaling\"\r\n   enabled check is now removed from pkg/master/master.go\r\n7. Other small changes to labels package, fuzzer and LabelSelector\r\n   helpers to piece this all together.\r\n8. Add unit tests to HPA targeting Deployments and ReplicaSets.\r\n9. Add an e2e test to HPA targeting ReplicaSets.\r\n\r\ncc @bgrant0607 @lavalamp "},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/194642091","html_url":"https://github.com/kubernetes/kubernetes/pull/22724#issuecomment-194642091","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/22724","id":194642091,"user":{"login":"madhusudancs","id":10183,"avatar_url":"https://avatars.githubusercontent.com/u/10183?v=3","gravatar_id":"","url":"https://api.github.com/users/madhusudancs","html_url":"https://github.com/madhusudancs","followers_url":"https://api.github.com/users/madhusudancs/followers","following_url":"https://api.github.com/users/madhusudancs/following{/other_user}","gists_url":"https://api.github.com/users/madhusudancs/gists{/gist_id}","starred_url":"https://api.github.com/users/madhusudancs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madhusudancs/subscriptions","organizations_url":"https://api.github.com/users/madhusudancs/orgs","repos_url":"https://api.github.com/users/madhusudancs/repos","events_url":"https://api.github.com/users/madhusudancs/events{/privacy}","received_events_url":"https://api.github.com/users/madhusudancs/received_events","type":"User","site_admin":false},"created_at":"2016-03-10T03:21:49Z","updated_at":"2016-03-10T03:21:49Z","body":"@bgrant0607 Thanks for the LGTM. HPA e2e tests have passed in two separate runs - one run in which I had only enabled Deployments and RCs and another run where I had enabled ReplicaSets. I am running them all together now, but they are going to take a long time (2h+)."}}