mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-03 14:13:42 +02:00
* Improve code organization To make sure it is still readable after upcoming changes to helmfile * feat: `helmfile deps` to update dependencies of all the local charts Resolves #450 * feat: helmfile updates repos and build deps by default But not update deps. Use `helmfile deps` to update deps, and provide `--skip-deps` to skip updating repos and builds deps in sync/diff/apply/template Resolves #415 * Improve integration test coverage
38 lines
836 B
Go
38 lines
836 B
Go
package cmd
|
|
|
|
import (
|
|
"github.com/roboll/helmfile/args"
|
|
"github.com/roboll/helmfile/helmexec"
|
|
"github.com/roboll/helmfile/pkg/app"
|
|
"github.com/roboll/helmfile/state"
|
|
"github.com/urfave/cli"
|
|
)
|
|
|
|
func Deps(a *app.App) 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 := args.GetArgs(c.String("args"), state)
|
|
if len(args) > 0 {
|
|
helm.SetExtraArgs(args...)
|
|
}
|
|
|
|
errs := state.UpdateDeps(helm)
|
|
|
|
ok := len(errs) == 0
|
|
|
|
return ok, errs
|
|
})
|
|
},
|
|
}
|
|
}
|