From 3f5e5ec415753c81056199675c85454771daf8c2 Mon Sep 17 00:00:00 2001 From: Alvaro Aleman Date: Mon, 3 Mar 2025 15:39:05 -0500 Subject: [PATCH] :seedling: Validate that unstructued objects don't require scheme registriation If someone is interacting with objects through unstructured, we generally do not expect that to require any sort of registration in the scheme. It look like we never had any tests for this, this change adds them. --- pkg/client/client_test.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/client/client_test.go b/pkg/client/client_test.go index 42a04c5b06..ff014e7321 100644 --- a/pkg/client/client_test.go +++ b/pkg/client/client_test.go @@ -1036,7 +1036,7 @@ U5wwSivyi7vmegHKmblOzNVKA5qPO8zWzqBC Context("with unstructured objects", func() { It("should be able to read the Scale subresource", func() { - cl, err := client.New(cfg, client.Options{}) + cl, err := client.New(cfg, client.Options{Scheme: runtime.NewScheme()}) Expect(err).NotTo(HaveOccurred()) Expect(cl).NotTo(BeNil()) @@ -1061,7 +1061,7 @@ U5wwSivyi7vmegHKmblOzNVKA5qPO8zWzqBC Expect(int32(val)).To(Equal(*dep.Spec.Replicas)) }) It("should be able to create ServiceAccount tokens", func() { - cl, err := client.New(cfg, client.Options{}) + cl, err := client.New(cfg, client.Options{Scheme: runtime.NewScheme()}) Expect(err).NotTo(HaveOccurred()) Expect(cl).NotTo(BeNil()) @@ -1089,7 +1089,7 @@ U5wwSivyi7vmegHKmblOzNVKA5qPO8zWzqBC }) It("should be able to create Pod evictions", func() { - cl, err := client.New(cfg, client.Options{}) + cl, err := client.New(cfg, client.Options{Scheme: runtime.NewScheme()}) Expect(err).NotTo(HaveOccurred()) Expect(cl).NotTo(BeNil()) @@ -1122,7 +1122,7 @@ U5wwSivyi7vmegHKmblOzNVKA5qPO8zWzqBC }) It("should be able to create Pod bindings", func() { - cl, err := client.New(cfg, client.Options{}) + cl, err := client.New(cfg, client.Options{Scheme: runtime.NewScheme()}) Expect(err).NotTo(HaveOccurred()) Expect(cl).NotTo(BeNil()) @@ -1157,7 +1157,7 @@ U5wwSivyi7vmegHKmblOzNVKA5qPO8zWzqBC }) It("should be able to approve CSRs", func() { - cl, err := client.New(cfg, client.Options{}) + cl, err := client.New(cfg, client.Options{Scheme: runtime.NewScheme()}) Expect(err).NotTo(HaveOccurred()) Expect(cl).NotTo(BeNil()) @@ -1188,7 +1188,7 @@ U5wwSivyi7vmegHKmblOzNVKA5qPO8zWzqBC }) It("should be able to approve CSRs using Patch", func() { - cl, err := client.New(cfg, client.Options{}) + cl, err := client.New(cfg, client.Options{Scheme: runtime.NewScheme()}) Expect(err).NotTo(HaveOccurred()) Expect(cl).NotTo(BeNil()) @@ -1220,7 +1220,7 @@ U5wwSivyi7vmegHKmblOzNVKA5qPO8zWzqBC }) It("should be able to update the scale subresource", func() { - cl, err := client.New(cfg, client.Options{}) + cl, err := client.New(cfg, client.Options{Scheme: runtime.NewScheme()}) Expect(err).NotTo(HaveOccurred()) Expect(cl).NotTo(BeNil()) @@ -1250,7 +1250,7 @@ U5wwSivyi7vmegHKmblOzNVKA5qPO8zWzqBC }) It("should be able to patch the scale subresource", func() { - cl, err := client.New(cfg, client.Options{}) + cl, err := client.New(cfg, client.Options{Scheme: runtime.NewScheme()}) Expect(err).NotTo(HaveOccurred()) Expect(cl).NotTo(BeNil())