38 lines
848 B
Go
38 lines
848 B
Go
package cmd
|
|
|
|
import (
|
|
"github.com/roboll/helmfile/pkg/app"
|
|
"github.com/roboll/helmfile/pkg/argparser"
|
|
"github.com/roboll/helmfile/pkg/helmexec"
|
|
"github.com/roboll/helmfile/pkg/state"
|
|
"github.com/urfave/cli"
|
|
)
|
|
|
|
func Deps() cli.Command {
|
|
return cli.Command{
|
|
Name: "deps",
|
|
Usage: "update charts based on the contents of requirements.yaml",
|
|
Flags: []cli.Flag{
|
|
cli.StringFlag{
|
|
Name: "args",
|
|
Value: "",
|
|
Usage: "pass args to helm exec",
|
|
},
|
|
},
|
|
Action: func(c *cli.Context) error {
|
|
return VisitAllDesiredStates(c, func(state *state.HelmState, helm helmexec.Interface, ctx app.Context) (bool, []error) {
|
|
args := argparser.GetArgs(c.String("args"), state)
|
|
if len(args) > 0 {
|
|
helm.SetExtraArgs(args...)
|
|
}
|
|
|
|
errs := state.UpdateDeps(helm)
|
|
|
|
ok := len(errs) == 0
|
|
|
|
return ok, errs
|
|
})
|
|
},
|
|
}
|
|
}
|