diff --git a/pkg/crd/testdata/cronjob_types.go b/pkg/crd/testdata/cronjob_types.go index 3b9a9ef76..85d07bf4f 100644 --- a/pkg/crd/testdata/cronjob_types.go +++ b/pkg/crd/testdata/cronjob_types.go @@ -165,9 +165,13 @@ type CronJobSpec struct { StructWithSeveralFields NestedObject `json:"structWithSeveralFields"` // A struct that can only be entirely replaced via a nested type. - // +structType=atomic NestedStructWithSeveralFields NestedStructWithSeveralFields `json:"nestedStructWithSeveralFields"` + // A struct that can only be entirely replaced via a nested type and + // field markers. + // +structType=atomic + NestedStructWithSeveralFieldsDoubleMarked NestedStructWithSeveralFields `json:"nestedStructWithSeveralFieldsDoubleMarked"` + // This tests that type references are properly flattened // +kubebuilder:validation:optional JustNestedObject *JustNestedObject `json:"justNestedObject,omitempty"` diff --git a/pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml b/pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml index ce3163cba..bdd7f2307 100644 --- a/pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml +++ b/pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml @@ -7301,6 +7301,19 @@ spec: - foo type: object x-kubernetes-map-type: atomic + nestedStructWithSeveralFieldsDoubleMarked: + description: A struct that can only be entirely replaced via a nested + type and field markers. + properties: + bar: + type: boolean + foo: + type: string + required: + - bar + - foo + type: object + x-kubernetes-map-type: atomic nestedassociativeList: description: This tests that associative lists work via a nested type. items: @@ -7434,6 +7447,7 @@ spec: - mapOfInfo - nestedMapOfInfo - nestedStructWithSeveralFields + - nestedStructWithSeveralFieldsDoubleMarked - nestedassociativeList - patternObject - schedule