Skip to content

Commit bfd3eef

Browse files
authored
Merge pull request #80 from mengqiy/kustomize
fix CRD gen to not fail CRD validation
2 parents e5aa9a3 + e1e18d8 commit bfd3eef

6 files changed

Lines changed: 13 additions & 10 deletions

File tree

pkg/crd/generator/testData/config/crds/fun_v1alpha1_toy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,5 @@ status:
8989
acceptedNames:
9090
kind: ""
9191
plural: ""
92-
conditions: null
93-
storedVersions: null
92+
conditions: []
93+
storedVersions: []

pkg/internal/codegen/parse/crd.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ func (b *APIs) parseCRDs() {
9393
resource.CRD.Spec.Subresources.Status = &v1beta1.CustomResourceSubresourceStatus{}
9494
}
9595

96+
resource.CRD.Status.Conditions = []v1beta1.CustomResourceDefinitionCondition{}
97+
resource.CRD.Status.StoredVersions = []string{}
98+
9699
if hasScaleSubresource(resource.Type) {
97100
if resource.CRD.Spec.Subresources == nil {
98101
resource.CRD.Spec.Subresources = &v1beta1.CustomResourceSubresources{}

test/config/crds/creatures_v2alpha1_kraken.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ status:
2929
acceptedNames:
3030
kind: ""
3131
plural: ""
32-
conditions: null
33-
storedVersions: null
32+
conditions: []
33+
storedVersions: []

test/config/crds/crew_v1_firstmate.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ status:
2929
acceptedNames:
3030
kind: ""
3131
plural: ""
32-
conditions: null
33-
storedVersions: null
32+
conditions: []
33+
storedVersions: []

test/config/crds/policy_v1beta1_healthcheckpolicy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ status:
2929
acceptedNames:
3030
kind: ""
3131
plural: ""
32-
conditions: null
33-
storedVersions: null
32+
conditions: []
33+
storedVersions: []

test/config/crds/ship_v1beta1_frigate.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ status:
2929
acceptedNames:
3030
kind: ""
3131
plural: ""
32-
conditions: null
33-
storedVersions: null
32+
conditions: []
33+
storedVersions: []

0 commit comments

Comments
 (0)