mirror of
https://github.com/helmfile/helmfile.git
synced 2026-09-30 07:42:04 +02:00
Move repos subcommand to a dedicated source file (#137)
Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/helmfile/helmfile/pkg/app"
|
||||
"github.com/helmfile/helmfile/pkg/config"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
func addReposSubcommand(cliApp *cli.App) {
|
||||
cliApp.Commands = append(cliApp.Commands, cli.Command{
|
||||
Name: "repos",
|
||||
Usage: "sync repositories from state file (helm repo add && helm repo update)",
|
||||
Flags: []cli.Flag{
|
||||
cli.StringFlag{
|
||||
Name: "args",
|
||||
Value: "",
|
||||
Usage: "pass args to helm exec",
|
||||
},
|
||||
},
|
||||
Action: Action(func(a *app.App, c config.ConfigImpl) error {
|
||||
return a.Repos(c)
|
||||
}),
|
||||
})
|
||||
}
|
||||
@@ -26,6 +26,7 @@ func RootCommand() *cli.App {
|
||||
|
||||
// add subcommands
|
||||
addDepsSubcommand(cliApp)
|
||||
addReposSubcommand(cliApp)
|
||||
|
||||
return cliApp
|
||||
}
|
||||
|
||||
@@ -14,20 +14,6 @@ func main() {
|
||||
|
||||
rootCmd := cmd.RootCommand()
|
||||
subCommands := []cli.Command{
|
||||
{
|
||||
Name: "repos",
|
||||
Usage: "sync repositories from state file (helm repo add && helm repo update)",
|
||||
Flags: []cli.Flag{
|
||||
cli.StringFlag{
|
||||
Name: "args",
|
||||
Value: "",
|
||||
Usage: "pass args to helm exec",
|
||||
},
|
||||
},
|
||||
Action: cmd.Action(func(a *app.App, c config.ConfigImpl) error {
|
||||
return a.Repos(c)
|
||||
}),
|
||||
},
|
||||
{
|
||||
Name: "charts",
|
||||
Usage: "DEPRECATED: sync releases from state file (helm upgrade --install)",
|
||||
|
||||
Reference in New Issue
Block a user