-
Notifications
You must be signed in to change notification settings - Fork 201
Switch ACK to CEL-Based Immutability and Remove Runtime Checks #565
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
Conversation
3ee1b27
to
c483a60
Compare
Controllers with immutable (reference to
|
/test s3-controller-test |
/test cloudfront-controller-test |
/hold |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat! Good job on this @rushmash91 🚀
As you stated, we'll wait until EKS 1.24 reaches end of support ship this to all controllers
fix aws-controllers-k8s/code-generator#565 Description of changes: Remove `getImmutableFieldChanges` from hooks to support cel immutability By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
fix aws-controllers-k8s/code-generator#565 Description of changes: Remove getImmutableFieldChanges from hooks to support cel immutability By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
fix aws-controllers-k8s/code-generator#565 Description of changes: Remove getImmutableFieldChanges from hooks to support cel immutability By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
fix aws-controllers-k8s/code-generator#565 Description of changes: Remove getImmutableFieldChanges from hooks to support cel immutability By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
fix aws-controllers-k8s/code-generator#565 Description of changes: Remove getImmutableFieldChanges from hooks to support cel immutability Remove immutability tests By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
fix aws-controllers-k8s/code-generator#565 Description of changes: Remove getImmutableFieldChanges from hooks to support cel immutability field `Name` immutability test removed for resource `Topic` By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
fix aws-controllers-k8s/code-generator#565 Description of changes: Remove getImmutableFieldChanges from hooks to support cel immutability By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
fix aws-controllers-k8s/code-generator#565 Description of changes: Remove getImmutableFieldChanges from hooks to support cel immutability By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Really excited for this to go through
/unhold
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: a-hilaly, rushmash91 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test eks-controller-test |
/test efs-controller-test |
/test cloudfront-controller-test |
/test ec2-controller-test |
2 similar comments
/test ec2-controller-test |
/test ec2-controller-test |
@rushmash91: The following tests failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
Issue #2202
Description of changes:
Updates the ACK code generation process to enforce immutability using CEL validation rules instead of runtime comparisons. By adding
+kubebuilder:validation:XValidation
annotations to fields markedis_immutable: true
, Kubernetes1.25+
now blocks changes at admission time, eliminating the need for separate runtime checks or conditions.Why?
HasImmutableFieldChanges()
and similar logic can be removed.Caveats
Clusters must be on Kubernetes 1.25+, which supports CEL.
Blog
Changes
•Add CEL rules for
is_immutable: true
fields in the CRD template (+kubebuilder:validation:XValidation
).•Remove runtime immutability checks (
HasImmutableFieldChanges
, etc.) in the generatedsdk.go
files.•Clean up references to "immutable fields” in
crd.go
to avoid duplicating logic.•Update inline comments and docstrings to clarify that immutability is now admission-based.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.