Skip to content

Commit 5c754a3

Browse files
committed
declarative pattern: Support cluster scoped types
We weren't processing the Namespaced field. Equivalent of #864
1 parent 6987a7f commit 5c754a3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

plugins/addon/type.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ type {{.Resource.Kind}}Status struct {
7474
}
7575
7676
// +kubebuilder:object:root=true
77+
{{ if not .Resource.Namespaced }} // +kubebuilder:resource:scope=Cluster {{ end }}
7778
7879
// {{.Resource.Kind}} is the Schema for the {{ .Resource.Resource }} API
7980
type {{.Resource.Kind}} struct {
@@ -107,6 +108,7 @@ func (o *{{.Resource.Kind}}) SetCommonStatus(s addonv1alpha1.CommonStatus) {
107108
}
108109
109110
// +kubebuilder:object:root=true
111+
{{ if not .Resource.Namespaced }} // +kubebuilder:resource:scope=Cluster {{ end }}
110112
111113
// {{.Resource.Kind}}List contains a list of {{.Resource.Kind}}
112114
type {{.Resource.Kind}}List struct {

0 commit comments

Comments
 (0)