What did you do?
operator-sdk generate k8s && operator-sdk generate openapioperator-sdk up localWhat did you expect to see?
kubectl get crd apps.example.com -o yaml to include the subresource setting somewhereWhat did you see instead? Under which circumstances?
subresources.status setting or the schema section that ARE present in disk, under the v1 version.Environment
operator-sdk version: "v0.10.0-48-g5f663690", commit: "5f663690a3bb97bf7b9e9b8a15a2f8d6bc481808", go version: "go1.13 darwin/amd64"
go version go1.12.7 darwin/amd64
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.6", GitCommit:"96fac5cd13a5dc064f7d9f4f23030a6aeface6cc", GitTreeState:"clean", BuildDate:"2019-08-19T11:13:49Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.6", GitCommit:"96fac5cd13a5dc064f7d9f4f23030a6aeface6cc", GitTreeState:"clean", BuildDate:"2019-08-19T11:05:16Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
Kubernetes cluster kind: minikube (local)
Are you writing your operator in ansible, helm, or go? go
Possible Solution
subresources a top-level fieldschema to the top-level validation field.Additional context
subresources section.
The CustomResourceDefinition "apps.example.org" is invalid:
<ul>
<li>spec.versions: Invalid value: []apiextensions.CustomResourceDefinitionVersion{apiextensions.CustomResourceDefinitionVersion{Name:"v1", <a href="Served:true">Served:true</a>, <a href="Storage:true">Storage:true</a>, Schema:(<em>apiextensions.CustomResourceValidation)(0xc00ad95438), Subresources:(</em>apiextensions.CustomResourceSubresources)(0xc004f98ed0), AdditionalPrinterColumns:[]apiextensions.CustomResourceColumnDefinition(nil)}}: per-version schemas may not all be set to identical values (top-level validation should be used instead)</li>
<li>spec.versions: Invalid value: []apiextensions.CustomResourceDefinitionVersion{apiextensions.CustomResourceDefinitionVersion{Name:"v1", <a href="Served:true">Served:true</a>, <a href="Storage:true">Storage:true</a>, Schema:(<em>apiextensions.CustomResourceValidation)(0xc00ad95438), Subresources:(</em>apiextensions.CustomResourceSubresources)(0xc004f98ed0), AdditionalPrinterColumns:[]apiextensions.CustomResourceColumnDefinition(nil)}}: per-version subresources may not all be set to identical values (top-level subresources should be used instead)<br />
/cc @estroz @hasbro17
Is testing on this with an Ansible operator needed?
@flickerfly I don't believe so. My hunch is that there's an issue with controller-tools (or our usage of it), and controller-tools is scoped to Go-related generation.
I don't think this impacts the Ansible operator.
This should be solved in controller-tools by https://github.com/kubernetes-sigs/controller-tools/pull/322
We'll have to re-vendor controller-tools after this is merged.
Most helpful comment
This should be solved in controller-tools by https://github.com/kubernetes-sigs/controller-tools/pull/322
We'll have to re-vendor controller-tools after this is merged.