Skip to content

ValidationError occurs when install crd #45

@xiaolao

Description

@xiaolao

when applying the crd config to a kubernetes 1.16.3 cluster, it will error out with this message:

$ kubectl create -f crd.yaml
error: error validating "crd.yaml": error validating data: ValidationError(CustomResourceDefinition.status): missing required field "storedVersions" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceDefinitionStatus; if you choose to ignore these errors, turn validation off with --validate=false

Currently this problem can be fixed by updating CRD file as following:

   acceptedNames:
     kind: ""
     plural: ""
-  conditions: null
-  storedVersions: null
+  conditions: []
+  storedVersions: []

OR create crd by command as: kubectl create crd.yaml --validate=false

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions