Skip to content

Commit

Permalink
fix: change outdated plugin release namespace references (#602)
Browse files Browse the repository at this point in the history
* fix: change outdated plugin release namespace references

* fix: fix missing release namespace in plugin tests

---------

Co-authored-by: k.zagorski <k.zagorski@accenture.com>
  • Loading branch information
Zaggy21 and k.zagorski authored Sep 23, 2024
1 parent 25719d8 commit efb4926
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/controllers/plugin/remote_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ var (
Spec: greenhousev1alpha1.PluginSpec{
ClusterName: "test-cluster",
PluginDefinition: "test-plugindefinition",
ReleaseNamespace: test.TestNamespace,
},
}

Expand Down Expand Up @@ -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"
Expand All @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions pkg/helm/diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ var _ = Describe("ensure helm diff against the release manifest works as expecte
Value: test.MustReturnJSONFor("true"),
},
},
ReleaseNamespace: namespace,
},
}

Expand Down
1 change: 1 addition & 0 deletions pkg/helm/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ var (
PluginDefinition: "test-plugindefinition",
ClusterName: "test-cluster",
OptionValues: []greenhousesapv1alpha1.PluginOptionValue{},
ReleaseNamespace: "test-release-namespace",
},
}

Expand Down

0 comments on commit efb4926

Please sign in to comment.