From 2e57203181e76f2921b243d7abc22b2221976c78 Mon Sep 17 00:00:00 2001 From: Anoop Gopalakrishnan Date: Wed, 25 Oct 2023 15:17:18 -0700 Subject: [PATCH] Fix: the helm command runner --- modules/helm/template.go | 2 +- test/helm_keda_remote_example_template_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/helm/template.go b/modules/helm/template.go index f313da8f3..55a4ca7c4 100644 --- a/modules/helm/template.go +++ b/modules/helm/template.go @@ -107,7 +107,7 @@ func RenderRemoteTemplateE(t testing.TestingT, options *Options, chartURL string args = append(args, extraHelmArgs...) // ... and add the name and chart at the end as the command expects - args = append(args, chartURL, releaseName) + args = append(args, releaseName, "--repo", chartURL) // Finally, call out to helm template command return RunHelmCommandAndGetStdOutE(t, options, "template", args...) diff --git a/test/helm_keda_remote_example_template_test.go b/test/helm_keda_remote_example_template_test.go index 4d72e44d3..ab3fcb003 100644 --- a/test/helm_keda_remote_example_template_test.go +++ b/test/helm_keda_remote_example_template_test.go @@ -61,7 +61,7 @@ func TestHelmKedaRemoteExampleTemplateRenderedDeployment(t *testing.T) { // we want to assert that the template renders without any errors. // Additionally, although we know there is only one yaml file in the template, we deliberately path a templateFiles // arg to demonstrate how to select individual templates to render. - output := helm.RenderRemoteTemplate(t, options, "--repo https://kedacore.github.io/charts", releaseName, []string{"templates/metrics-server/deployment.yamll"}) + output := helm.RenderRemoteTemplate(t, options, "https://kedacore.github.io/charts", releaseName, []string{"templates/metrics-server/deployment.yamll"}) // Now we use kubernetes/client-go library to render the template output into the Deployment struct. This will // ensure the Deployment resource is rendered correctly.