Added ability to set context in charts.yaml (#21)
* Added ability to set context in charts.yaml * Added context to the documentation Added error if —kube-context and context are both used.
This commit is contained in:
parent
5da5cd1c39
commit
c00b869045
|
|
@ -21,6 +21,8 @@ repositories:
|
||||||
- name: roboll
|
- name: roboll
|
||||||
url: http://roboll.io/charts
|
url: http://roboll.io/charts
|
||||||
|
|
||||||
|
context: kube-context # kube-context (--kube-context)
|
||||||
|
|
||||||
charts:
|
charts:
|
||||||
# Published chart example
|
# Published chart example
|
||||||
- name: vault # helm deployment name
|
- name: vault # helm deployment name
|
||||||
|
|
|
||||||
8
main.go
8
main.go
|
|
@ -225,7 +225,13 @@ func before(c *cli.Context) (*state.HelmState, helmexec.Interface, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
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
|
var writer io.Writer
|
||||||
if !quiet {
|
if !quiet {
|
||||||
writer = os.Stdout
|
writer = os.Stdout
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ import (
|
||||||
|
|
||||||
type HelmState struct {
|
type HelmState struct {
|
||||||
BaseChartPath string
|
BaseChartPath string
|
||||||
|
Context string `yaml:"context"`
|
||||||
Repositories []RepositorySpec `yaml:"repositories"`
|
Repositories []RepositorySpec `yaml:"repositories"`
|
||||||
Charts []ChartSpec `yaml:"charts"`
|
Charts []ChartSpec `yaml:"charts"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue