Open llody55 opened 1 year ago
I also encountered this problem.
Error from server (BadRequest): error when creating "crd.yml": CustomResourceDefinition in version "v1" cannot be handled as a CustomResourceDefinition: strict decoding error: unknown field "spec.versions[0].schema.properties", unknown field "spec.versions[0].schema.type"
k8s version:
Client Version: version.Info{Major:"1", Minor:"27", GitVersion:"v1.27.3+k3s1", GitCommit:"fe9604cac119216e67f8bd5f14eb5608e3bcd3cf", GitTreeState:"clean", BuildDate:"2023-06-26T16:49:54Z", GoVersion:"go1.20.5", Compiler:"gc", Platform:"linux/amd64"} Kustomize Version: v5.0.1 Server Version: version.Info{Major:"1", Minor:"27", GitVersion:"v1.27.3+k3s1", GitCommit:"fe9604cac119216e67f8bd5f14eb5608e3bcd3cf", GitTreeState:"clean", BuildDate:"2023-06-26T16:49:54Z", GoVersion:"go1.20.5", Compiler:"gc", Platform:"linux/amd64"}
Seems like crd has a bug in formatting, since they did linting in 1.8.0 and I can apply it after these changes:
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
name:
type: string
minLength: 2
kubernetesL1.20 permission-manager:1.9.0 error: error validating "permission-manager/crd.yml": error validating data: [ValidationError(CustomResourceDefinition.spec.versions[0].schema): unknown field "properties" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceValidation, ValidationError(CustomResourceDefinition.spec.versions[0].schema): unknown field "type" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceValidation]; if you choose to ignore these errors, turn validation off with --validate=false