Skip to content

Commit 67819ee

Browse files
authored
Merge pull request #433 from mcristina422/removeStatus
✨ Remove status from generated CRDs
2 parents 581f622 + b9fd300 commit 67819ee

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

pkg/crd/spec.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,7 @@ func (p *Parser) NeedCRDFor(groupKind schema.GroupKind, maxDescLen *int) {
164164
packages[0].AddError(fmt.Errorf("CRD for %s with version(s) %v does not serve any version", groupKind, crd.Spec.Versions))
165165
}
166166

167-
// NB(directxman12): CRD's status doesn't have omitempty markers, which means things
168-
// get serialized as null, which causes the validator to freak out. Manually set
169-
// these to empty till we get a better solution.
170-
crd.Status.Conditions = []apiext.CustomResourceDefinitionCondition{}
171-
crd.Status.StoredVersions = []string{}
167+
crd.Status = apiext.CustomResourceDefinitionStatus{}
172168

173169
p.CustomResourceDefinitions[groupKind] = crd
174170
}

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

-6
Original file line numberDiff line numberDiff line change
@@ -5183,9 +5183,3 @@ spec:
51835183
storage: true
51845184
subresources:
51855185
status: {}
5186-
status:
5187-
acceptedNames:
5188-
kind: ""
5189-
plural: ""
5190-
conditions: []
5191-
storedVersions: []

0 commit comments

Comments
 (0)