From 0ce83faa8dec8f2d719cb9082a7c94a1e23ea76a Mon Sep 17 00:00:00 2001 From: Russell Centanni Date: Tue, 14 May 2024 11:34:30 -0400 Subject: [PATCH] fix: add --debug flag to helm command when running DevSpace with the --debug flag Signed-off-by: Russell Centanni --- pkg/devspace/helm/v3/client.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/devspace/helm/v3/client.go b/pkg/devspace/helm/v3/client.go index 2d65927dd3..69b62f326f 100644 --- a/pkg/devspace/helm/v3/client.go +++ b/pkg/devspace/helm/v3/client.go @@ -57,6 +57,12 @@ func (c *client) InstallChart(ctx devspacecontext.Context, releaseName string, r valuesFile, "--install", } + + // Add debug flag + if ctx.Log().GetLevel() == logrus.DebugLevel { + args = append(args, "--debug") + } + if releaseNamespace != "" { args = append(args, "--namespace", releaseNamespace) } @@ -118,6 +124,7 @@ func (c *client) InstallChart(ctx devspacecontext.Context, releaseName string, r } } } + // Upgrade options args = append(args, helmConfig.UpgradeArgs...) output, err := c.genericHelm.Exec(ctx, args) @@ -224,9 +231,11 @@ func (c *client) DeleteRelease(ctx devspacecontext.Context, releaseName string, "delete", releaseName, } + if releaseNamespace != "" { args = append(args, "--namespace", releaseNamespace) } + _, err := c.genericHelm.Exec(ctx, args) if err != nil { return err