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

Add immutable marker for fields in CRDs definitions #1524

Closed
enxebre opened this issue Oct 14, 2019 · 16 comments
Closed

Add immutable marker for fields in CRDs definitions #1524

enxebre opened this issue Oct 14, 2019 · 16 comments
Assignees
Labels
area/api Issues or PRs related to the APIs kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@enxebre
Copy link
Member

enxebre commented Oct 14, 2019

User Story

As a user I would like to be notified early about immutable fields for a better UX
As a developer I would like to notify early about immutable fields for a better UX and prevent not supported corner cases scenarios to take place.

Detailed Description
Once CRDs support immutable fields we need to add the immutable markers in the core API and providers where is relevant e.g https://github.com/kubernetes-sigs/cluster-api-provider-aws/blob/3abd1936dcae8dd5165f5cbc6b3ed5e568120286/controllers/awsmachine_controller.go#L380-L432
so we fail early before persisting providing a better experience.

Goals

  • Immutable fields fail early before being persisted when tried to be mutated.

Work for immutable fields:
kubernetes/enhancements#1265
kubernetes/kubernetes#83743
kubernetes-sigs/controller-tools#339

/kind feature

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 14, 2019
@detiber
Copy link
Member

detiber commented Oct 14, 2019

@enxebre Which Kubernetes release is this being targeted for? Is this something that will fail gracefully when deployed on earlier versions of k8s, or will it introduce a hard requirement for a minimum version of k8s for the management cluster?

@sttts
Copy link

sttts commented Oct 15, 2019

It uses unknown fields from the point of view of an old kube version, and hence those fields are just ignored by an old API server.

@detiber
Copy link
Member

detiber commented Oct 15, 2019

ok, so it sounds like we'd need to do validation through a webhook as well for enforcing this behavior until we can rely on a version of k8s that supports this natively.

@sttts
Copy link

sttts commented Oct 15, 2019

yes, if you want to enforce it for older kube versions.

@ncdc ncdc changed the title Add immutable maker for fields in CRDs definitions Add immutable marker for fields in CRDs definitions Oct 16, 2019
@ncdc ncdc added the priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. label Oct 16, 2019
@ncdc ncdc added this to the Next milestone Oct 16, 2019
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 14, 2020
@vincepri
Copy link
Member

/lifecycle frozen

@k8s-ci-robot k8s-ci-robot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jan 15, 2020
@vincepri vincepri removed the priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. label Mar 11, 2020
@vincepri
Copy link
Member

This work item is blocked on upstream support for now

/priority backlog

@k8s-ci-robot k8s-ci-robot added the priority/backlog Higher priority than priority/awaiting-more-evidence. label Mar 11, 2020
@vincepri
Copy link
Member

Given that this work is still in progress, and we'll need to tackle this in controller-runtime (and tools) first, what do you think of closing this for now?

/remove-lifecycle frozen

@k8s-ci-robot k8s-ci-robot removed the lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. label Apr 20, 2020
@vincepri
Copy link
Member

/area api

@k8s-ci-robot k8s-ci-robot added the area/api Issues or PRs related to the APIs label Apr 20, 2020
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 19, 2020
@vincepri
Copy link
Member

/lifecycle frozen

@k8s-ci-robot k8s-ci-robot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jul 20, 2020
@vincepri
Copy link
Member

vincepri commented Oct 22, 2021

/remove-lifecycle frozen
/assign @enxebre
to re-prioritize

@k8s-ci-robot
Copy link
Contributor

@vincepri: GitHub didn't allow me to assign the following users: to, re-prioritize.

Note that only kubernetes-sigs members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

/remove-lifecycle frozen
/assign @enxebre to re-prioritize

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot removed the lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. label Oct 22, 2021
@enxebre
Copy link
Member Author

enxebre commented Oct 25, 2021

Initial proposal got merged kubernetes/enhancements#1265 but implementation efforts got stuck. I'll close this for now since no progress has been made for a while, I'll reopen if the effort is revived in api machinery.
/close

@k8s-ci-robot
Copy link
Contributor

@enxebre: Closing this issue.

In response to this:

Initial proposal got merged kubernetes/enhancements#1265 but implementation efforts got stuck. I'll close this for now since no progress has been made for a while, I'll reopen if the effort is revived in api machinery.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@sbueringer
Copy link
Member

sbueringer commented Oct 25, 2021

@enxebre Doesn't solve immutability, but a similar effort which could be useful once it's implemented: https://github.com/kubernetes/enhancements/tree/master/keps/sig-api-machinery/2876-crd-validation-expression-language

(just wanted to share, in case you're not already aware of it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Issues or PRs related to the APIs kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

No branches or pull requests

8 participants