Skip to content

v1.5.0

Choose a tag to compare

@lexfrei lexfrei released this 25 May 14:37
· 7 commits to main since this release
v1.5.0
56fefc1

What's Changed

Features

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 on values.schema.json;
  • the same entry on the CRD (via controller-gen passthrough).

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

Full Changelog: v1.4.0...v1.5.0