diff --git a/README.md b/README.md index c2cb9303..863c3cd8 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,8 @@ repositories: - name: roboll url: http://roboll.io/charts +context: kube-context # kube-context (--kube-context) + charts: # Published chart example - name: vault # helm deployment name diff --git a/main.go b/main.go index b7460058..ac6ba583 100644 --- a/main.go +++ b/main.go @@ -225,7 +225,13 @@ func before(c *cli.Context) (*state.HelmState, helmexec.Interface, error) { if err != nil { return nil, nil, err } - + if state.Context != "" { + if kubeContext != "" { + log.Printf("err: Cannot use option --kube-context and set attribute context.") + os.Exit(1) + } + kubeContext = state.Context + } var writer io.Writer if !quiet { writer = os.Stdout diff --git a/state/state.go b/state/state.go index ffd2f03c..d1c52831 100644 --- a/state/state.go +++ b/state/state.go @@ -20,6 +20,7 @@ import ( type HelmState struct { BaseChartPath string + Context string `yaml:"context"` Repositories []RepositorySpec `yaml:"repositories"` Charts []ChartSpec `yaml:"charts"` }