Skip to content

Commit

Permalink
fix: allow an environment variable to default the deploy namespace
Browse files Browse the repository at this point in the history
lets allow an environment variable to be used to define the helm deploy namespace
fixes #496
  • Loading branch information
jstrachan committed Apr 30, 2018
1 parent d30c921 commit a42c024
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/skaffold/deploy/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"context"
"fmt"
"io"
"os"
"os/exec"

"github.com/GoogleContainerTools/skaffold/pkg/skaffold/build"
Expand Down Expand Up @@ -106,8 +107,12 @@ func (h *HelmDeployer) deployRelease(out io.Writer, r v1alpha2.HelmRelease, b *b
args = append(args, "upgrade", r.Name, r.ChartPath)
}

if r.Namespace != "" {
args = append(args, "--namespace", r.Namespace)
ns := r.Namespace
if ns == "" {
ns = os.Getenv("SKAFFOLD_DEPLOY_NAMESPACE")
}
if ns != "" {
args = append(args, "--namespace", ns)
}
if r.ValuesFilePath != "" {
args = append(args, "-f", r.ValuesFilePath)
Expand Down

0 comments on commit a42c024

Please sign in to comment.