@@ -29,15 +29,6 @@ def get_help(self):
2929 return 'Wrap common helmfile tasks using hierarchical configuration support'
3030
3131 def configure (self , parser ):
32- parser .add_argument (
33- 'subcommand' ,
34- help = 'plan | sync | apply | template' ,
35- type = str )
36- parser .add_argument (
37- 'extra_args' ,
38- type = str ,
39- nargs = '*' ,
40- help = 'Extra args' )
4132 parser .add_argument (
4233 '--helmfile-path' ,
4334 type = str ,
@@ -51,7 +42,9 @@ def get_epilog(self):
5142 # Run helmfile sync
5243 ops data/env=dev/region=va6/project=ee/cluster=experiments/composition=helmfiles helmfile sync
5344 # Run helmfile sync for a single chart
54- ops data/env=dev/region=va6/project=ee/cluster=experiments/composition=helmfiles helmfile sync -- --selector chart=nginx-controller
45+ ops data/env=dev/region=va6/project=ee/cluster=experiments/composition=helmfiles helmfile --selector chart=nginx-controller sync
46+ # Run helmfile sync with concurrency flag
47+ ops data/env=dev/region=va6/project=ee/cluster=experiments/composition=helmfiles helmfile --selector chart=nginx-controller sync --concurrency=1
5548 '''
5649
5750
@@ -63,7 +56,7 @@ def __init__(self, ops_config, cluster_config_path, execute):
6356 self .cluster_config_path = cluster_config_path
6457 self .execute = execute
6558
66- def run (self , args ):
59+ def run (self , args , extra_args ):
6760 config_path_prefix = os .path .join (self .cluster_config_path , '' )
6861 default_helmfiles = '../ee-k8s-infra/compositions/helmfiles'
6962 args .helmfile_path = default_helmfiles if args .helmfile_path is None else os .path .join (
@@ -79,7 +72,7 @@ def run(self, args):
7972 data = self .generate_helmfile_config (conf_path , args )
8073 self .setup_kube_config (data )
8174
82- command = self .get_helmfile_command (args )
75+ command = self .get_helmfile_command (args , extra_args )
8376 return dict (command = command )
8477
8578 def setup_kube_config (self , data ):
@@ -150,6 +143,8 @@ def generate_helmfile_config(self, path, args):
150143 output_file = output_file ,
151144 print_data = True )
152145
153- def get_helmfile_command (self , args ):
154- cmd = ' ' .join (args .extra_args + [args .subcommand ])
155- return "cd {} && helmfile {}" .format (args .helmfile_path , cmd )
146+ def get_helmfile_command (self , args , extra_args ):
147+ helmfile_args = ' ' .join (extra_args )
148+ return "cd {helmfile_path} && helmfile {helmfile_args}" .format (
149+ helmfile_path = args .helmfile_path ,
150+ helmfile_args = helmfile_args )
0 commit comments