diff --git a/changelog/v0.19.8/add-to-scheme-change.yaml b/changelog/v0.19.8/add-to-scheme-change.yaml new file mode 100644 index 000000000..0c938915d --- /dev/null +++ b/changelog/v0.19.8/add-to-scheme-change.yaml @@ -0,0 +1,3 @@ +changelog: +- type: NON_USER_FACING + description: Update clients go template so that we use AddToScheme from the SchemeBuilder diff --git a/codegen/templates/code/types/clients.gotmpl b/codegen/templates/code/types/clients.gotmpl index 6a43f06e8..723dbd101 100644 --- a/codegen/templates/code/types/clients.gotmpl +++ b/codegen/templates/code/types/clients.gotmpl @@ -55,7 +55,7 @@ type clientSet struct { func NewClientsetFromConfig(cfg *rest.Config) (Clientset, error) { scheme := scheme.Scheme - if err := {{ $import_prefix }}AddToScheme(scheme); err != nil{ + if err := {{ $import_prefix }}SchemeBuilder.AddToScheme(scheme); err != nil{ return nil, err } client, err := client.New(cfg, client.Options{ diff --git a/codegen/test/api/things.test.io/v1/clients.go b/codegen/test/api/things.test.io/v1/clients.go index 2e4ea477d..bd77f6b06 100644 --- a/codegen/test/api/things.test.io/v1/clients.go +++ b/codegen/test/api/things.test.io/v1/clients.go @@ -51,7 +51,7 @@ type clientSet struct { func NewClientsetFromConfig(cfg *rest.Config) (Clientset, error) { scheme := scheme.Scheme - if err := AddToScheme(scheme); err != nil { + if err := SchemeBuilder.AddToScheme(scheme); err != nil { return nil, err } client, err := client.New(cfg, client.Options{ diff --git a/pkg/api/multicluster.solo.io/v1alpha1/clients.go b/pkg/api/multicluster.solo.io/v1alpha1/clients.go index 63aa4ca8b..96d05d43d 100644 --- a/pkg/api/multicluster.solo.io/v1alpha1/clients.go +++ b/pkg/api/multicluster.solo.io/v1alpha1/clients.go @@ -49,7 +49,7 @@ type clientSet struct { func NewClientsetFromConfig(cfg *rest.Config) (Clientset, error) { scheme := scheme.Scheme - if err := AddToScheme(scheme); err != nil { + if err := SchemeBuilder.AddToScheme(scheme); err != nil { return nil, err } client, err := client.New(cfg, client.Options{ diff --git a/pkg/multicluster/internal/k8s/admissionregistration.k8s.io/v1/clients.go b/pkg/multicluster/internal/k8s/admissionregistration.k8s.io/v1/clients.go index d2758aa3b..89bddf457 100644 --- a/pkg/multicluster/internal/k8s/admissionregistration.k8s.io/v1/clients.go +++ b/pkg/multicluster/internal/k8s/admissionregistration.k8s.io/v1/clients.go @@ -50,7 +50,7 @@ type clientSet struct { func NewClientsetFromConfig(cfg *rest.Config) (Clientset, error) { scheme := scheme.Scheme - if err := admissionregistration_k8s_io_v1.AddToScheme(scheme); err != nil { + if err := admissionregistration_k8s_io_v1.SchemeBuilder.AddToScheme(scheme); err != nil { return nil, err } client, err := client.New(cfg, client.Options{ diff --git a/pkg/multicluster/internal/k8s/apiextensions.k8s.io/v1beta1/clients.go b/pkg/multicluster/internal/k8s/apiextensions.k8s.io/v1beta1/clients.go index e7237c793..f0cef0ab2 100644 --- a/pkg/multicluster/internal/k8s/apiextensions.k8s.io/v1beta1/clients.go +++ b/pkg/multicluster/internal/k8s/apiextensions.k8s.io/v1beta1/clients.go @@ -50,7 +50,7 @@ type clientSet struct { func NewClientsetFromConfig(cfg *rest.Config) (Clientset, error) { scheme := scheme.Scheme - if err := apiextensions_k8s_io_v1beta1.AddToScheme(scheme); err != nil { + if err := apiextensions_k8s_io_v1beta1.SchemeBuilder.AddToScheme(scheme); err != nil { return nil, err } client, err := client.New(cfg, client.Options{ diff --git a/pkg/multicluster/internal/k8s/certificates.k8s.io/v1beta1/clients.go b/pkg/multicluster/internal/k8s/certificates.k8s.io/v1beta1/clients.go index 5cbd88208..44a161a31 100644 --- a/pkg/multicluster/internal/k8s/certificates.k8s.io/v1beta1/clients.go +++ b/pkg/multicluster/internal/k8s/certificates.k8s.io/v1beta1/clients.go @@ -50,7 +50,7 @@ type clientSet struct { func NewClientsetFromConfig(cfg *rest.Config) (Clientset, error) { scheme := scheme.Scheme - if err := certificates_k8s_io_v1beta1.AddToScheme(scheme); err != nil { + if err := certificates_k8s_io_v1beta1.SchemeBuilder.AddToScheme(scheme); err != nil { return nil, err } client, err := client.New(cfg, client.Options{ diff --git a/pkg/multicluster/internal/k8s/core/v1/clients.go b/pkg/multicluster/internal/k8s/core/v1/clients.go index c05bd97ea..e1ad39e7d 100644 --- a/pkg/multicluster/internal/k8s/core/v1/clients.go +++ b/pkg/multicluster/internal/k8s/core/v1/clients.go @@ -54,7 +54,7 @@ type clientSet struct { func NewClientsetFromConfig(cfg *rest.Config) (Clientset, error) { scheme := scheme.Scheme - if err := v1.AddToScheme(scheme); err != nil { + if err := v1.SchemeBuilder.AddToScheme(scheme); err != nil { return nil, err } client, err := client.New(cfg, client.Options{ diff --git a/pkg/multicluster/internal/k8s/rbac.authorization.k8s.io/v1/clients.go b/pkg/multicluster/internal/k8s/rbac.authorization.k8s.io/v1/clients.go index ef91cfe49..111392a61 100644 --- a/pkg/multicluster/internal/k8s/rbac.authorization.k8s.io/v1/clients.go +++ b/pkg/multicluster/internal/k8s/rbac.authorization.k8s.io/v1/clients.go @@ -56,7 +56,7 @@ type clientSet struct { func NewClientsetFromConfig(cfg *rest.Config) (Clientset, error) { scheme := scheme.Scheme - if err := rbac_authorization_k8s_io_v1.AddToScheme(scheme); err != nil { + if err := rbac_authorization_k8s_io_v1.SchemeBuilder.AddToScheme(scheme); err != nil { return nil, err } client, err := client.New(cfg, client.Options{