mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-19 04:42:40 +02:00
added support for environment variables, adding value files during runtime and a global kube-context flag to pass down to helm
This commit is contained in:
+9
-2
@@ -15,11 +15,15 @@ const (
|
||||
|
||||
type execer struct {
|
||||
writer io.Writer
|
||||
kubeContext string
|
||||
extra []string
|
||||
}
|
||||
|
||||
func NewHelmExec(writer io.Writer) Interface {
|
||||
return &execer{writer: writer}
|
||||
func NewHelmExec(writer io.Writer, kubeContext string) Interface {
|
||||
return &execer{
|
||||
writer: writer,
|
||||
kubeContext: kubeContext,
|
||||
}
|
||||
}
|
||||
|
||||
func (helm *execer) SetExtraArgs(args ...string) {
|
||||
@@ -69,6 +73,9 @@ func (helm *execer) exec(args ...string) ([]byte, error) {
|
||||
if len(helm.extra) > 0 {
|
||||
cmdargs = append(cmdargs, helm.extra...)
|
||||
}
|
||||
if helm.kubeContext != "" {
|
||||
cmdargs = append(cmdargs, "--kube-context", helm.kubeContext)
|
||||
}
|
||||
if helm.writer != nil {
|
||||
helm.writer.Write([]byte(fmt.Sprintf("exec: helm %s\n", strings.Join(cmdargs, " "))))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user