Skip to content

Commit

Permalink
Merge pull request #755 from k8s-infra-cherrypick-robot/cherry-pick-7…
Browse files Browse the repository at this point in the history
…54-to-release-0.11

🐛  Revert Fix the generation of listType=set
  • Loading branch information
k8s-ci-robot authored Dec 20, 2022
2 parents cce03d2 + d4ef1b3 commit 9d91b25
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 20 deletions.
7 changes: 0 additions & 7 deletions pkg/crd/markers/topology.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions pkg/crd/testdata/cronjob_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
9 changes: 1 addition & 8 deletions pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9d91b25

Please sign in to comment.