Commit 70edc31b
70edc31b6905Merged
Svyatoslav Dumchenko <[email protected]> · 4 years ago · 4 files · ~4 modified
Description
feat: allow to set kubecontext per release
Details
- Commit
- 70edc31b6905
- Parent
- 41aeef59a699
pkg/helper/helm.gomodifiedView file
@@ -44,14 +44,18 @@
4444
return client4545
}4646
47-
// NewCfg creates helm internal configuration for provided namespace.48-
func NewCfg(ns string) (*action.Configuration, error) {47+
// NewCfg creates helm internal configuration for provided namespace and kubecontext.48+
func NewCfg(ns string, kubecontext string) (*action.Configuration, error) {4949
cfg := new(action.Configuration)5050
helmDriver := os.Getenv("HELM_DRIVER") // TODO: get rid of getenv in runtime5151
config := genericclioptions.NewConfigFlags(false)5252
config.WrapConfigFn = wrapConfigFn5353
config.Namespace = &ns54-
config.Context = &Helm.KubeContext54+
if kubecontext != "" {55+
config.Context = &kubecontext56+
} else {57+
config.Context = &Helm.KubeContext58+
}5559
5660
if Helm.Debug {5761
helmLogLevel = log.Infofpkg/helper/helm_test.gomodifiedView file
Loading diff…
pkg/release/config.gomodifiedView file
Loading diff…
pkg/release/sync.gomodifiedView file
Loading diff…