Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Revert Fix the generation of listType=set #755

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 0 additions & 7 deletions pkg/crd/markers/topology.go
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
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
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