From b9fd30032a18daa07219de8a574c0e33ae6b913d Mon Sep 17 00:00:00 2001 From: Michael Cristina Date: Fri, 24 Apr 2020 12:42:01 -0500 Subject: [PATCH] :sparkles: Remove status from generated CRDs --- pkg/crd/spec.go | 6 +----- pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml | 6 ------ 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/pkg/crd/spec.go b/pkg/crd/spec.go index e00349a41..09c410cdc 100644 --- a/pkg/crd/spec.go +++ b/pkg/crd/spec.go @@ -164,11 +164,7 @@ func (p *Parser) NeedCRDFor(groupKind schema.GroupKind, maxDescLen *int) { packages[0].AddError(fmt.Errorf("CRD for %s with version(s) %v does not serve any version", groupKind, crd.Spec.Versions)) } - // NB(directxman12): CRD's status doesn't have omitempty markers, which means things - // get serialized as null, which causes the validator to freak out. Manually set - // these to empty till we get a better solution. - crd.Status.Conditions = []apiext.CustomResourceDefinitionCondition{} - crd.Status.StoredVersions = []string{} + crd.Status = apiext.CustomResourceDefinitionStatus{} p.CustomResourceDefinitions[groupKind] = crd } diff --git a/pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml b/pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml index 8bdefa79c..7b4573d2a 100644 --- a/pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml +++ b/pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml @@ -5178,9 +5178,3 @@ spec: storage: true subresources: status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: []