Skip to content

Commit

Permalink
Merge pull request #497 from jstrachan/496
Browse files Browse the repository at this point in the history
fix: allow an environment variable to default the deploy namespace
  • Loading branch information
dgageot authored May 26, 2018
2 parents 753b9c8 + a42c024 commit bed41e9
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 @@ -107,8 +108,12 @@ func (h *HelmDeployer) deployRelease(out io.Writer, r v1alpha2.HelmRelease, buil
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 bed41e9

Please sign in to comment.