Skip to content

Commit 56de576

Browse files
authored
Merge pull request #472 from mcristina422/revert-433-removeStatus
✨ Revert "✨ Remove status from generated CRDs"
2 parents 0107350 + 09922e7 commit 56de576

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

pkg/crd/spec.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,11 @@ 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-
crd.Status = apiext.CustomResourceDefinitionStatus{}
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{}
168172

169173
p.CustomResourceDefinitions[groupKind] = crd
170174
}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5202,3 +5202,9 @@ spec:
52025202
storage: true
52035203
subresources:
52045204
status: {}
5205+
status:
5206+
acceptedNames:
5207+
kind: ""
5208+
plural: ""
5209+
conditions: []
5210+
storedVersions: []

0 commit comments

Comments
 (0)