Skip to content

Commit bed41e9

Browse files
authored
Merge pull request #497 from jstrachan/496
fix: allow an environment variable to default the deploy namespace
2 parents 753b9c8 + a42c024 commit bed41e9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pkg/skaffold/deploy/helm.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"context"
2121
"fmt"
2222
"io"
23+
"os"
2324
"os/exec"
2425

2526
"github.com/GoogleContainerTools/skaffold/pkg/skaffold/build"
@@ -107,8 +108,12 @@ func (h *HelmDeployer) deployRelease(out io.Writer, r v1alpha2.HelmRelease, buil
107108
args = append(args, "upgrade", r.Name, r.ChartPath)
108109
}
109110

110-
if r.Namespace != "" {
111-
args = append(args, "--namespace", r.Namespace)
111+
ns := r.Namespace
112+
if ns == "" {
113+
ns = os.Getenv("SKAFFOLD_DEPLOY_NAMESPACE")
114+
}
115+
if ns != "" {
116+
args = append(args, "--namespace", ns)
112117
}
113118
if r.ValuesFilePath != "" {
114119
args = append(args, "-f", r.ValuesFilePath)

0 commit comments

Comments
 (0)