controller-tools icon indicating copy to clipboard operation
controller-tools copied to clipboard

Add `creationTimestamp` to the allow-listed set of properties of embedded ObjectMeta to prevent API warnings

Open snorwin opened this issue 8 months ago • 16 comments

The absence of creationTimestamp in the generated embedded ObjectMeta in the CRD is causing API Warnings, as the field CreationTimestamp cannot be unset and defaults to null. In order to prevent such warnings, it would be nice to add the creationTimestamp to the allow-listed set of properties of ObjectMeta (https://github.com/kubernetes-sigs/controller-tools/blob/main/pkg/crd/known_types.go#L107).

Example warning:

"logger":"operator.KubeAPIWarningLogger","message":"unknown field \"spec.template.metadata.creationTimestamp\""

Additionally, it could be required that if the creationTimestamp field is specified, the value must be null.

snorwin avatar Mar 12 '25 12:03 snorwin