-
Notifications
You must be signed in to change notification settings - Fork 1.8k
CRD scope reset to Namespaced on YAML generation #1650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
cc @hasbro17 What do you think of the above feature request, as you worked on the operator scopes. |
@NicolasT add the type comment // Memcached is the Schema for the memcacheds API
// +k8s:openapi-gen=true
// +kubebuilder:subresource:status
// +genclient:nonNamespaced
type Memcached struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec MemcachedSpec `json:"spec,omitempty"`
Status MemcachedStatus `json:"status,omitempty"`
} Apologies for the lack of documentation on codegen annotations. We are in the process of refactoring the SDK to use controller-runtime/tools v0.2.0, which will have a complete list of new API annotations available that we will link to. |
I'll update the cluster scope doc with the requirement of |
That was fast 😄 I'll test this later today, but seems very reasonable, thanks for getting back! Looking forward to see more documentation about the available annotations. Thanks again! |
There's documentation on how to turn a scaffolded CRD into a cluster-scoped one, which works. However, when re-generating the OpenAPI CRD manifests, the CRD
scope
gets reset toNamespaced
, which requires special care / manual reverts / ... It'd be nice if somehow the scope of a CRD could be declared somewhere, and this being honoured by the code generator.For reference: https://kubernetes.slack.com/archives/CAW0GV7A5/p1562255836345700
The text was updated successfully, but these errors were encountered: