77 UpdateDetails , BindDetails
88
99from .celery import app
10- from .utils import command , get_plan_path , get_chart_path , get_cred_value , \
10+ from .utils import get_plan_path , get_chart_path , get_cred_value , \
1111 InstanceLock , dump_instance_meta , dump_binding_meta , load_instance_meta , \
12- get_instance_file
12+ get_instance_file , helm
1313
1414
1515@app .task (serializer = 'pickle' )
@@ -25,7 +25,7 @@ def provision(instance_id: str, details: ProvisionDetails):
2525 "update" ,
2626 chart_path ,
2727 ]
28- command ( " helm" , * args )
28+ helm ( instance_id , * args )
2929 values_file = os .path .join (get_plan_path (instance_id ), "values.yaml" )
3030 args = [
3131 "install" ,
@@ -43,7 +43,7 @@ def provision(instance_id: str, details: ProvisionDetails):
4343 f"fullnameOverride=helmbroker-{ details .context ['instance_name' ]} "
4444 ]
4545
46- status , output = command ( " helm" , * args )
46+ status , output = helm ( instance_id , * args )
4747 data = load_instance_meta (instance_id )
4848 if status != 0 :
4949 data ["last_operation" ]["state" ] = OperationState .FAILED .value
@@ -91,7 +91,7 @@ def update(instance_id: str, details: UpdateDetails):
9191 f"fullnameOverride=helmbroker-{ details .context ['instance_name' ]} "
9292 ]
9393
94- status , output = command ( " helm" , * args )
94+ status , output = helm ( instance_id , * args )
9595 if status != 0 :
9696 data ["last_operation" ]["state" ] = OperationState .FAILED .value
9797 data ["last_operation" ]["description" ] = (
@@ -131,7 +131,7 @@ def bind(instance_id: str,
131131 "--set" ,
132132 f"fullnameOverride=helmbroker-{ details .context ['instance_name' ]} "
133133 ]
134- status , templates = command ( " helm" , * args ) # output: templates.yaml
134+ status , templates = helm ( instance_id , * args ) # output: templates.yaml
135135 if status != 0 :
136136 data ["last_operation" ]["state" ] = OperationState .FAILED .value
137137 data ["last_operation" ]["description" ] = "binding %s failed: %s" % (instance_id , templates ) # noqa
@@ -179,8 +179,8 @@ def deprovision(instance_id: str):
179179 data ["last_operation" ]["description" ] = (
180180 "deprovision %s in progress at %s" % (instance_id , time .time ()))
181181 dump_instance_meta (instance_id , data )
182- status , output = command (
183- "helm" ,
182+ status , output = helm (
183+ instance_id ,
184184 "uninstall" ,
185185 data ["details" ]["context" ]["instance_name" ],
186186 "--namespace" ,
0 commit comments