Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,13 @@ spec:
singular: etcdcluster
scope: Namespaced
version: v1beta2
validation:
openAPIV3Schema:
properties:
spec:
type: object
properties:
test:
type: integer
minimum: 1
maximum: 32767
5 changes: 3 additions & 2 deletions pkg/lib/bundle/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,11 @@ func (i imageValidator) ValidateBundleContent(manifestDir string) error {
}
}
} else if gvk.Kind == CRDKind {
dec := k8syaml.NewYAMLOrJSONDecoder(strings.NewReader(string(data)), 30)
switch gv := gvk.GroupVersion().String(); gv {
case v1CRDapiVersion:
crd := &apiextensionsv1.CustomResourceDefinition{}
err := runtime.DefaultUnstructuredConverter.FromUnstructured(k8sFile.Object, crd)
err := dec.Decode(crd)
if err != nil {
validationErrors = append(validationErrors, err)
continue
Expand All @@ -330,7 +331,7 @@ func (i imageValidator) ValidateBundleContent(manifestDir string) error {
}
case v1beta1CRDapiVersion:
crd := &apiextensionsv1beta1.CustomResourceDefinition{}
err := runtime.DefaultUnstructuredConverter.FromUnstructured(k8sFile.Object, crd)
err := dec.Decode(crd)
if err != nil {
validationErrors = append(validationErrors, err)
continue
Expand Down