-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
📖 Add crd-scope and operator-scope documentation #4035
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bavarianbidi, camilamacedo86 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
b84b225
to
e12911f
Compare
…n and update summary Co-authored-by: Mario Constanti <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The --namespaced=false parameter is optional. The default value is false. You can set it to true only when you are trying it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The --namespaced=false parameter is optional. The default value is false. You can set it to true only when you are trying it out.
Hi @fengshunli, By default, ALL APIs/Custom Resource Definitions (CRDs) are not Cluster scoped. When you use the flag
kubebuilder/pkg/model/resource/api.go Lines 28 to 29 in dcc031d
kubebuilder/pkg/plugins/golang/v4/scaffolds/internal/templates/api/types.go Lines 94 to 95 in dcc031d
You can also test this behavior locally to validate it:
Check the marker in the API: // +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// Frigate is the Schema for the frigates API
type Frigate struct {
....
You will see it still lacks the ClusterScope marker: // +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// FrigateNamespacedEmpty is the Schema for the frigatenamespacedempties API
type FrigateNamespacedEmpty struct {
It still lacks the ClusterScope marker (default behavior):
Now, it includes the ClusterScope marker: // +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Cluster // SEE HERE
// FrigateNamespacedFalse is the Schema for the frigatenamespacedfalses API
type FrigateNamespacedFalse struct {
.... I hope this helps! |
We have an approval already/lgtm |
This PR add a required info to let users know what is API and Manager scope as how to manage them.
Closes; #3623