Closed wlan0 closed 6 years ago
I don't think we should set the Deployment Labels, since those don't affect the behavior of the Deployment.
For extensions/v1beta1 and apps/v1beta1, Deployment Selector defaults to the Template Labels, so the current output is fine. For apps/v1beta2, the Deployment Selector does not default to the Template Labels, so we populate it the same as the Template Labels.
It's not just about affecting the behavior of deployments. Users won't get a consistent experience with the current method.
If the deployment selector defaults to template labels, then we might as well add the template label. Explicitly specifying only improves readability.
If the deployment selector does not default, explicitly stating only make the user's experience consistent without worrying about api group nuances.
If the user provides no labels for a deployment like so:
Then the resulting kube deployment should have the selector, not the label (like the ouput I get today)
If a user provides a label, then the label, selector and the podTemplate label all should have the same value.
If the user provides a label and a selector, then the podTemplate should have the value in selector.