File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -165,10 +165,14 @@ def bind(instance_id: str,
165165 if status != 0 :
166166 data ["last_operation" ]["state" ] = OperationState .FAILED .value
167167 data ["last_operation" ]["description" ] = f"binding { instance_id } failed: { templates } "
168- credential_template = yaml .load (templates .split ('bind.yaml' )[1 ], Loader = yaml .Loader )
168+ credential_template = {}
169+ templates = yaml .load_all (templates , Loader = yaml .SafeLoader )
170+ credential_template = next (
171+ (item for item in templates if isinstance (item , dict ) and "credential" in item ), {}
172+ )
169173 success_flag = True
170174 errors = []
171- for _ in credential_template [ 'credential' ] :
175+ for _ in credential_template . get ( 'credential' , {}) :
172176 if _ .get ('valueFrom' ):
173177 status , val = get_cred_value (details .context ["namespace" ], _ ['valueFrom' ])
174178 elif _ .get ('value' ):
You can’t perform that action at this time.
0 commit comments