From d4ef1b37fe1148249ead9c33e7c85de4315fc215 Mon Sep 17 00:00:00 2001 From: Vince Prignano Date: Tue, 20 Dec 2022 10:58:19 -0800 Subject: [PATCH] Revert ":bug: Fix the generation of listType=set" --- pkg/crd/markers/topology.go | 7 ------- pkg/crd/testdata/cronjob_types.go | 5 ----- pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml | 9 +-------- 3 files changed, 1 insertion(+), 20 deletions(-) diff --git a/pkg/crd/markers/topology.go b/pkg/crd/markers/topology.go index a7757152f..a92995c80 100644 --- a/pkg/crd/markers/topology.go +++ b/pkg/crd/markers/topology.go @@ -114,13 +114,6 @@ func (l ListType) ApplyToSchema(schema *apiext.JSONSchemaProps) error { if l != "map" && l != "atomic" && l != "set" { return fmt.Errorf(`ListType must be either "map", "set" or "atomic"`) } - - if l == "set" { - if itemSchema := schema.Items.Schema; itemSchema != nil { - v := "atomic" - itemSchema.XMapType = &v - } - } p := string(l) schema.XListType = &p return nil diff --git a/pkg/crd/testdata/cronjob_types.go b/pkg/crd/testdata/cronjob_types.go index c02796e6d..279b81157 100644 --- a/pkg/crd/testdata/cronjob_types.go +++ b/pkg/crd/testdata/cronjob_types.go @@ -233,11 +233,6 @@ type CronJobSpec struct { // Checks that arrays work when the type contains a composite literal ArrayUsingCompositeLiteral [len(struct{ X [3]int }{}.X)]string `json:"arrayUsingCompositeLiteral,omitempty"` - - // Tests the generation of a set list type - // +listType=set - // +optional - Set []string `json:"set,omitempty"` } type ContainsNestedMap struct { diff --git a/pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml b/pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml index 54128b2b9..ead8723de 100644 --- a/pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml +++ b/pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml @@ -3,9 +3,9 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: + controller-gen.kubebuilder.io/version: (devel) api-approved.kubernetes.io: https://github.com/kubernetes-sigs/controller-tools cert-manager.io/inject-ca-from-secret: cert-manager/cert-manager-webhook-ca - controller-gen.kubebuilder.io/version: (devel) creationTimestamp: null name: cronjobs.testdata.kubebuilder.io spec: @@ -7330,13 +7330,6 @@ spec: type: string schemaless: description: This tests that the schemaless marker works - set: - description: Tests the generation of a set list type - items: - type: string - x-kubernetes-map-type: atomic - type: array - x-kubernetes-list-type: set startingDeadlineSeconds: description: Optional deadline in seconds for starting the job if it misses scheduled time for any reason. Missed jobs executions