Skip to content

Commit f26aa57

Browse files
committed
Document how "schemaless" interacts with CEL rules
1 parent 0ac75da commit f26aa57

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

pkg/apis/postgres-operator.crunchydata.com/v1beta1/shared_types.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,18 @@ func (spec *VolumeClaimSpec) AsPersistentVolumeClaimSpec() corev1.PersistentVolu
139139
return out
140140
}
141141

142+
// ---
142143
// SchemalessObject is a map compatible with JSON object.
143144
//
144145
// Use with the following markers:
145-
// - kubebuilder:pruning:PreserveUnknownFields
146-
// - kubebuilder:validation:Schemaless
147-
// - kubebuilder:validation:Type=object
146+
// - kubebuilder:pruning:PreserveUnknownFields
147+
// - kubebuilder:validation:Schemaless
148+
// - kubebuilder:validation:Type=object
149+
//
150+
// NOTE: PreserveUnknownFields allows arbitrary values within fields of this
151+
// type but also prevents any validation rules from reaching inside; its CEL
152+
// type is "object" or "message" with zero fields:
153+
// https://kubernetes.io/docs/reference/using-api/cel/#type-system-integration
148154
type SchemalessObject map[string]any
149155

150156
// DeepCopy creates a new SchemalessObject by copying the receiver.

0 commit comments

Comments
 (0)