Repository navigation
v1.5.0
What's Changed
Features
- feat: add
@immutableannotation emitting CEL XValidation rule by Aleksei Sviridkin (@lexfrei) in #24
A new ## @immutable flag annotation in values.yaml marks a chart field as immutable-after-creation. cozyvalues-gen lowers it into:
- a kubebuilder validation marker (
+kubebuilder:validation:XValidation:rule="self == oldSelf",message="<field> is immutable") on the generated Go field; - an
x-kubernetes-validations: [{rule: "self == oldSelf"}]entry onvalues.schema.json; - the same entry on the CRD (via
controller-genpassthrough).
Schema-aware consumers — notably the Cozystack UI — render annotated fields read-only on edit forms. The Kubernetes apiserver also enforces the rule on CRDs; on aggregated apiservers without CEL evaluation the annotation is informational until enforcement lands (see cozystack/cozystack#2657).
Diagnostics
The PR also adds a sitewide warning for constraint placement: any constraint annotation (@minimum, @maximum, @pattern, @immutable, …) appearing after the YAML value line of its parent @param/@field still attaches as before (no behaviour change), but cozyvalues-gen prints a warning: line to stderr so the misplacement is observable instead of silent. The warning never fails the build.
Downstream
- cozystack/cozystack#2639 — apply
@immutabletostorageClassacross every stateful Cozystack app. - cozystack/cozystack-ui#6 — UI consumes the rule to render the field grey-out on edit forms.
Full Changelog: v1.4.0...v1.5.0