-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
kind/documentationCategorizes issue or PR as related to documentation.Categorizes issue or PR as related to documentation.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.Indicates that an issue or PR should not be auto-closed due to staleness.
Milestone
Description
Bug Report
- we need to improve the doc to make it more clear. See: https://master.sdk.operatorframework.io/docs/building-operators/golang/crds-scope/
- we can link k8s reference to describe what CRD cluster and namespaced scope means
- the marker there is wrong. It is:
// +kubebuilder:resource:scope=Cluster
. Example
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Cluster
// Memcached2 is the Schema for the memcached2s API
type Memcached2 struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec Memcached2Spec `json:"spec,omitempty"`
Status Memcached2Status `json:"status,omitempty"`
}
- Also, we ought to tell to the users that to generated Cluster scoped CRD's the can use the flag
--namespaced=false
E.g
$ operator-sdk create api --group cache --version v1 --kind Memcached2 --resource=true --controller=true --namespaced=false
- And then, that by default they are namespaced scope which means that no requires marker at all.
Metadata
Metadata
Assignees
Labels
kind/documentationCategorizes issue or PR as related to documentation.Categorizes issue or PR as related to documentation.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.Indicates that an issue or PR should not be auto-closed due to staleness.