From 5c754a31dc12c0159f3a9f23a6b7926daf7d12c2 Mon Sep 17 00:00:00 2001 From: Justin SB Date: Thu, 27 Feb 2020 05:14:57 -0500 Subject: [PATCH] declarative pattern: Support cluster scoped types We weren't processing the Namespaced field. Equivalent of #864 --- plugins/addon/type.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/addon/type.go b/plugins/addon/type.go index 49f2b8549e5..4c33ce30f89 100644 --- a/plugins/addon/type.go +++ b/plugins/addon/type.go @@ -74,6 +74,7 @@ type {{.Resource.Kind}}Status struct { } // +kubebuilder:object:root=true +{{ if not .Resource.Namespaced }} // +kubebuilder:resource:scope=Cluster {{ end }} // {{.Resource.Kind}} is the Schema for the {{ .Resource.Resource }} API type {{.Resource.Kind}} struct { @@ -107,6 +108,7 @@ func (o *{{.Resource.Kind}}) SetCommonStatus(s addonv1alpha1.CommonStatus) { } // +kubebuilder:object:root=true +{{ if not .Resource.Namespaced }} // +kubebuilder:resource:scope=Cluster {{ end }} // {{.Resource.Kind}}List contains a list of {{.Resource.Kind}} type {{.Resource.Kind}}List struct {