diff --git a/plugin_test.go b/plugin_test.go index 8b17f88..c4a61ae 100644 --- a/plugin_test.go +++ b/plugin_test.go @@ -169,6 +169,33 @@ func TestDetHelmInit(t *testing.T) { } } +func TestDetHelmInitClient(t *testing.T) { + plugin := &Plugin{ + Config: Config{ + HelmCommand: nil, + Namespace: "default", + SkipTLSVerify: true, + Debug: true, + DryRun: true, + Chart: "./chart/test", + Release: "test-release", + Prefix: "MY", + Values: "image.tag=$TAG,api=${API_SERVER},nameOverride=my-over-app,second.tag=${TAG}", + ClientOnly: true, + }, + } + init := doHelmInit(plugin) + result := strings.Join(init, " ") + expected := "init " + if plugin.Config.ClientOnly { + expected = expected + "--client-only" + } + + if expected != result { + t.Error("Helm cannot init in client only") + } +} + func TestResolveSecretsFallback(t *testing.T) { tag := "v0.1.1" api := "http://apiserver"