diff --git a/pkg/crd/testdata/cronjob_types.go b/pkg/crd/testdata/cronjob_types.go index 42af267ab..d43622516 100644 --- a/pkg/crd/testdata/cronjob_types.go +++ b/pkg/crd/testdata/cronjob_types.go @@ -342,6 +342,13 @@ type CronJobSpec struct { // +kubebuilder:validation:items:XIntOrString // +kubebuilder:validation:items:Pattern="^((100|[0-9]{1,2})%|[0-9]+)$" IntOrStringArrayWithAPattern []*intstr.IntOrString `json:"intOrStringArrayWithAPattern,omitempty"` + + // This tests that we can embed protocol correctly (without ending up with allOf). + // Context: https://github.com/kubernetes-sigs/controller-tools/issues/1027 + // Defaults to "TCP". + // +optional + // +default="TCP" + Protocol corev1.Protocol `json:"protocol,omitempty" protobuf:"bytes,4,opt,name=protocol,casttype=Protocol"` } type ContainsNestedMap struct { diff --git a/pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml b/pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml index a041e99f5..189f407a7 100644 --- a/pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml +++ b/pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml @@ -8949,6 +8949,13 @@ spec: description: This tests that pattern validator is properly applied. pattern: ^$|^((https):\/\/?)[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|\/?))$ type: string + protocol: + default: TCP + description: |- + This tests that we can embed protocol correctly (without ending up with allOf). + Context: https://github.com/kubernetes-sigs/controller-tools/issues/1027 + Defaults to "TCP". + type: string ptrData: additionalProperties: type: string