diff --git a/pkg/kubernetes/helm.go b/pkg/kubernetes/helm.go index 3ad1b8e7ff..727127eece 100644 --- a/pkg/kubernetes/helm.go +++ b/pkg/kubernetes/helm.go @@ -296,6 +296,9 @@ func (h *HelmExecute) RunHelmUninstall() error { if len(h.config.Namespace) <= 0 { return fmt.Errorf("namespace has not been set, please configure namespace parameter") } + if len(h.config.KubeContext) > 0 { + helmParams = append(helmParams, "--kube-context", h.config.KubeContext) + } helmParams = append(helmParams, "--namespace", h.config.Namespace) if h.config.HelmDeployWaitSeconds > 0 { helmParams = append(helmParams, "--wait", "--timeout", fmt.Sprintf("%vs", h.config.HelmDeployWaitSeconds))