operator-sdk: Invalid CRD generated when using pkg/status.Conditions
What did you do?
- Built operator-sdk from master
- Used
pkg/status.Conditions
in my CRD
What did you expect to see? A valid CRD with status.conditions as a array of condition objects
What did you see instead? Under which circumstances?
The CustomResourceDefinition "..." is invalid: spec.validation.openAPIV3Schema.properties[status].properties[conditions].items: Required value: must be specified
The CRD has an additionalProperties
under the conditions
object instead of items
.
Environment
-
operator-sdk version:
"v0.15.0-80-g373ebf37", commit: "373ebf3751b61a37f3589687043b0eda095cf156"
-
go version:
go1.14 darwin/amd64
-
Kubernetes version information:
Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.3", GitCommit:"06ad960bfd03b39c8310aaf92d1e7c12ce618213", GitTreeState:"clean", BuildDate:"2020-02-13T18:08:14Z", GoVersion:"go1.13.8", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.2", GitCommit:"59603c6e503c87169aea6106f57b9f242f64df89", GitTreeState:"clean", BuildDate:"2020-01-18T23:22:30Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"linux/amd64"}
-
Kubernetes cluster kind: kubeadm 1.17
-
Are you writing your operator in ansible, helm, or go?
Go
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 21 (16 by maintainers)
H @joelanford and @kraman,
I could reproduce the issue 😃
To do that we need to use the
sigs.k8s.io/controller-tools/cmd/controller-gen@v0.2.5
to generate the CRD instead of the current implementation used in the SDK.Following the steps.
1- Define the type as:
2 - Add the Makefile with: (See: https://github.com/camilamacedo86/operator-sdk-samples/blob/test-issue/go/memcached-operator/Makefile#L87)
3 - Run the target
make manifests
(to gen with controller-gen)4 - Apply the CRD gen by the controller-gen@v0.2.5
So, now will be are working to identify the root cause of this issue and solve it.