Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Controller selector should not default to template labels #50339

Closed
crimsonfaith91 opened this issue Aug 8, 2017 · 0 comments · Fixed by #50164
Closed

Controller selector should not default to template labels #50339

crimsonfaith91 opened this issue Aug 8, 2017 · 0 comments · Fixed by #50164
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. sig/apps Categorizes an issue or PR as relevant to SIG Apps.

Comments

@crimsonfaith91
Copy link
Contributor

/kind bug

What happened:
Currently, obj.Spec.Selector.MatchLabels is set to obj.Spec.Template.Labels if obj.Spec.Template.Labels != nil && obj.Spec.Selector == nil. We should not perform this defaulting operation as controller selectors are meant to be immutable.

What you expected to happen:
No defaulting operation happens for controller selectors.

/sig apps

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. sig/apps Categorizes an issue or PR as relevant to SIG Apps. labels Aug 8, 2017
k8s-github-robot pushed a commit that referenced this issue Aug 10, 2017
Automatic merge from submit-queue

remove apps/v1beta2 defaulting codes for obj.Spec.Selector and obj.Labels

**What this PR does / why we need it**:
This PR removes defaulting codes for `obj.Spec.Selector`. Currently, `obj.Spec.Selector.MatchLabels` is set to `obj.Spec.Template.Labels` if `obj.Spec.Template.Labels != nil && obj.Spec.Selector == nil`. We should not perform this defaulting operation as controllers selectors are immutable.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #50339

**Special notes for your reviewer**:
This PR removes defaulting codes for `apps/v1beta2` only. The defaulting codes for validation will be removed in another PR.

**Release note**:

```NONE
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. sig/apps Categorizes an issue or PR as relevant to SIG Apps.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants