From fdfad8921342dccfe27a34f563259aa619481033 Mon Sep 17 00:00:00 2001 From: "k.zagorski" Date: Mon, 23 Sep 2024 10:30:28 +0200 Subject: [PATCH 1/2] fix: change outdated plugin release namespace references --- pkg/controllers/plugin/remote_cluster_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/controllers/plugin/remote_cluster_test.go b/pkg/controllers/plugin/remote_cluster_test.go index 8316ee669..5780550ef 100644 --- a/pkg/controllers/plugin/remote_cluster_test.go +++ b/pkg/controllers/plugin/remote_cluster_test.go @@ -44,6 +44,7 @@ var ( Spec: greenhousev1alpha1.PluginSpec{ ClusterName: "test-cluster", PluginDefinition: "test-plugindefinition", + ReleaseNamespace: test.TestNamespace, }, } @@ -391,7 +392,7 @@ var _ = Describe("HelmController reconciliation", Ordered, func() { By("creating plugin definition with CRDs") Expect(test.K8sClient.Create(test.Ctx, testPluginWithHelmChartCRDs)).To(Succeed(), "should create plugin definition") - remoteRestClientGetter := clientutil.NewRestClientGetterFromBytes(remoteKubeConfig, testPluginWithCRDs.GetReleaseNamespace(), clientutil.WithPersistentConfig()) + remoteRestClientGetter := clientutil.NewRestClientGetterFromBytes(remoteKubeConfig, testPluginWithCRDs.Spec.ReleaseNamespace, clientutil.WithPersistentConfig()) By("creating test plugin referencing the cluster") testPluginWithCRDs.Spec.ClusterName = "test-cluster" @@ -410,7 +411,7 @@ var _ = Describe("HelmController reconciliation", Ordered, func() { }).Should(BeTrue(), "the ClusterAccessReadyCondition should be false") By("checking the helm releases deployed to the remote cluster") - helmConfig, err := helm.ExportNewHelmAction(remoteRestClientGetter, testPluginWithCRDs.GetReleaseNamespace()) + helmConfig, err := helm.ExportNewHelmAction(remoteRestClientGetter, testPluginWithCRDs.Spec.ReleaseNamespace) Expect(err).ShouldNot(HaveOccurred(), "there should be no error creating helm config") listAction := action.NewList(helmConfig) Eventually(func() []*release.Release { From 91d99c56b6777196ed07edece3eb56e10c7f84e8 Mon Sep 17 00:00:00 2001 From: "k.zagorski" Date: Mon, 23 Sep 2024 11:24:01 +0200 Subject: [PATCH 2/2] fix: fix missing release namespace in plugin tests --- pkg/helm/diff_test.go | 1 + pkg/helm/suite_test.go | 1 + 2 files changed, 2 insertions(+) diff --git a/pkg/helm/diff_test.go b/pkg/helm/diff_test.go index 7a7c79f7f..2b0887545 100644 --- a/pkg/helm/diff_test.go +++ b/pkg/helm/diff_test.go @@ -62,6 +62,7 @@ var _ = Describe("ensure helm diff against the release manifest works as expecte Value: test.MustReturnJSONFor("true"), }, }, + ReleaseNamespace: namespace, }, } diff --git a/pkg/helm/suite_test.go b/pkg/helm/suite_test.go index bd0ad6992..1d02ed70b 100644 --- a/pkg/helm/suite_test.go +++ b/pkg/helm/suite_test.go @@ -146,6 +146,7 @@ var ( PluginDefinition: "test-plugindefinition", ClusterName: "test-cluster", OptionValues: []greenhousesapv1alpha1.PluginOptionValue{}, + ReleaseNamespace: "test-release-namespace", }, }