Skip to content

Commit b9fd300

Browse files
committed
✨ Remove status from generated CRDs
1 parent 44656d3 commit b9fd300

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

pkg/crd/spec.go

Lines changed: 1 addition & 5 deletions
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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5178,9 +5178,3 @@ spec:
51785178
storage: true
51795179
subresources:
51805180
status: {}
5181-
status:
5182-
acceptedNames:
5183-
kind: ""
5184-
plural: ""
5185-
conditions: []
5186-
storedVersions: []

0 commit comments

Comments
 (0)