Skip to content

Commit d4ef1b3

Browse files
vinceprik8s-infra-cherrypick-robot
authored andcommitted
Revert ":bug: Fix the generation of listType=set"
1 parent cce03d2 commit d4ef1b3

File tree

3 files changed

+1
-20
lines changed

3 files changed

+1
-20
lines changed

pkg/crd/markers/topology.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,6 @@ func (l ListType) ApplyToSchema(schema *apiext.JSONSchemaProps) error {
114114
if l != "map" && l != "atomic" && l != "set" {
115115
return fmt.Errorf(`ListType must be either "map", "set" or "atomic"`)
116116
}
117-
118-
if l == "set" {
119-
if itemSchema := schema.Items.Schema; itemSchema != nil {
120-
v := "atomic"
121-
itemSchema.XMapType = &v
122-
}
123-
}
124117
p := string(l)
125118
schema.XListType = &p
126119
return nil

pkg/crd/testdata/cronjob_types.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,6 @@ type CronJobSpec struct {
233233

234234
// Checks that arrays work when the type contains a composite literal
235235
ArrayUsingCompositeLiteral [len(struct{ X [3]int }{}.X)]string `json:"arrayUsingCompositeLiteral,omitempty"`
236-
237-
// Tests the generation of a set list type
238-
// +listType=set
239-
// +optional
240-
Set []string `json:"set,omitempty"`
241236
}
242237

243238
type ContainsNestedMap struct {

pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6+
controller-gen.kubebuilder.io/version: (devel)
67
api-approved.kubernetes.io: https://github.com/kubernetes-sigs/controller-tools
78
cert-manager.io/inject-ca-from-secret: cert-manager/cert-manager-webhook-ca
8-
controller-gen.kubebuilder.io/version: (devel)
99
creationTimestamp: null
1010
name: cronjobs.testdata.kubebuilder.io
1111
spec:
@@ -7330,13 +7330,6 @@ spec:
73307330
type: string
73317331
schemaless:
73327332
description: This tests that the schemaless marker works
7333-
set:
7334-
description: Tests the generation of a set list type
7335-
items:
7336-
type: string
7337-
x-kubernetes-map-type: atomic
7338-
type: array
7339-
x-kubernetes-list-type: set
73407333
startingDeadlineSeconds:
73417334
description: Optional deadline in seconds for starting the job if
73427335
it misses scheduled time for any reason. Missed jobs executions

0 commit comments

Comments
 (0)