From d8febe06794ca6ec171a7d58b6a2d73e346ba5f7 Mon Sep 17 00:00:00 2001 From: Andrea Mazzotti Date: Wed, 10 Jan 2024 18:24:03 +0100 Subject: [PATCH] Add new schemes to test suites Signed-off-by: Andrea Mazzotti --- bootstrap/controllers/suite_test.go | 5 +++-- controlplane/controllers/suite_test.go | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bootstrap/controllers/suite_test.go b/bootstrap/controllers/suite_test.go index b86d5562..b65de245 100644 --- a/bootstrap/controllers/suite_test.go +++ b/bootstrap/controllers/suite_test.go @@ -28,6 +28,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/envtest" bootstrapv1beta1 "github.com/cluster-api-provider-k3s/cluster-api-k3s/bootstrap/api/v1beta1" + bootstrapv1 "github.com/cluster-api-provider-k3s/cluster-api-k3s/bootstrap/api/v1beta2" ) // These tests use Ginkgo (BDD-style Go testing framework). Refer to @@ -57,8 +58,8 @@ var _ = BeforeSuite(func(done Done) { Expect(err).ToNot(HaveOccurred()) Expect(cfg).ToNot(BeNil()) - err = bootstrapv1beta1.AddToScheme(scheme.Scheme) - Expect(err).NotTo(HaveOccurred()) + Expect(bootstrapv1beta1.AddToScheme(scheme.Scheme)).Should(Succeed()) + Expect(bootstrapv1.AddToScheme(scheme.Scheme)).Should(Succeed()) // +kubebuilder:scaffold:scheme diff --git a/controlplane/controllers/suite_test.go b/controlplane/controllers/suite_test.go index dc60c0e5..12ab7b5a 100644 --- a/controlplane/controllers/suite_test.go +++ b/controlplane/controllers/suite_test.go @@ -28,6 +28,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/envtest" controlplanev1beta1 "github.com/cluster-api-provider-k3s/cluster-api-k3s/controlplane/api/v1beta1" + controlplanev1 "github.com/cluster-api-provider-k3s/cluster-api-k3s/controlplane/api/v1beta2" ) // These tests use Ginkgo (BDD-style Go testing framework). Refer to @@ -57,8 +58,8 @@ var _ = BeforeSuite(func(done Done) { Expect(err).ToNot(HaveOccurred()) Expect(cfg).ToNot(BeNil()) - err = controlplanev1beta1.AddToScheme(scheme.Scheme) - Expect(err).NotTo(HaveOccurred()) + Expect(controlplanev1beta1.AddToScheme(scheme.Scheme)).Should(Succeed()) + Expect(controlplanev1.AddToScheme(scheme.Scheme)).Should(Succeed()) // +kubebuilder:scaffold:scheme