{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/28949","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/28949/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/28949/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/28949/events","html_url":"https://github.com/kubernetes/kubernetes/pull/28949","id":165524044,"number":28949,"title":"Add new command \"kubectl set selector\"","user":{"login":"asalkeld","id":420707,"avatar_url":"https://avatars.githubusercontent.com/u/420707?v=3","gravatar_id":"","url":"https://api.github.com/users/asalkeld","html_url":"https://github.com/asalkeld","followers_url":"https://api.github.com/users/asalkeld/followers","following_url":"https://api.github.com/users/asalkeld/following{/other_user}","gists_url":"https://api.github.com/users/asalkeld/gists{/gist_id}","starred_url":"https://api.github.com/users/asalkeld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asalkeld/subscriptions","organizations_url":"https://api.github.com/users/asalkeld/orgs","repos_url":"https://api.github.com/users/asalkeld/repos","events_url":"https://api.github.com/users/asalkeld/events{/privacy}","received_events_url":"https://api.github.com/users/asalkeld/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/do-not-merge","name":"do-not-merge","color":"e11d21"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/kind/old-docs","name":"kind/old-docs","color":"c7def8"},{"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/XL","name":"size/XL","color":"ee5500"}],"state":"open","locked":false,"assignee":{"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},"assignees":[{"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}],"milestone":null,"comments":6,"created_at":"2016-07-14T10:02:05Z","updated_at":"2016-08-01T16:57:26Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/28949","html_url":"https://github.com/kubernetes/kubernetes/pull/28949","diff_url":"https://github.com/kubernetes/kubernetes/pull/28949.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/28949.patch"},"body":"This is also to aid PR #27109 (create subcommands)\r\n\r\nPart of the new set commands: #21648\r\n\r\n```release-note\r\nAdded new command kubectl set selector\r\n```\r\n\r\nRelated: #7296\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/236640390","html_url":"https://github.com/kubernetes/kubernetes/pull/28949#issuecomment-236640390","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/28949","id":236640390,"user":{"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},"created_at":"2016-08-01T16:57:26Z","updated_at":"2016-08-01T16:57:26Z","body":"@asalkeld @deads2k \r\n\r\nNote that this doesn't actually fix #7296, which was about setting nodeSelector, so I changed the PR description to just reference that issue rather than close it. There was a confusing comment in the issue, which I just deleted.\r\n\r\nMore importantly, this is very likely to orphan pods and/or create overlapping selectors, which probably is not what the user intended. I'm not keen to make it easier for users to shoot themselves in the foot/torso/head.\r\n\r\nIt's important to think about the use case. I believe a common use case is:\r\n\r\n1. User creates a controller and service.\r\n2. Later, user wants to perform rolling update or create a canary, but didn't add a label to the original whose value could be changed in the new controller.\r\n\r\nOne solution could be a command to add a label to a controller's pod template and to all of the pods before also adding the label to the label selector. That's pretty tricky to do correctly. It should be a library routine that could be used in all the places we need to do that, such as `kubectl rolling-update --image`. We'd want to add fullyLabeledReplicas to the controllers that don't yet support it.\r\n\r\nAnother solution, for controllers supporting the new selector, is to update the selector of the original controller to exclude pods with the new label key (using DoesNotExist). That wouldn't orphan its existing pods, and isn't as race-prone as adding labels to existing pods. \r\n\r\nThis command could be used to do that, but the chance of users figuring out that trick on their own before doing something damaging is low.\r\n\r\nWhat did you intend to do with this?"}}
{"actor":{"display_login":"bgrant0607"}}