calm-dsl
calm-dsl copied to clipboard
Fix Azure environment credential reference for readiness probe.
Have a workaround thus far adding this code to the environments.py. Abhijeet is aware of the issue.
Adding uuid to creds and substrates
cred_name_uuid_map = {}
for cred in env_payload["spec"]["resources"].get("credential_definition_list", []):
cred["uuid"] = str(uuid.uuid4())
cred_name_uuid_map[cred["name"]] = cred["uuid"]
for sub in env_payload["spec"]["resources"]["substrate_definition_list"]:
try:
cred_ref_obj = sub["readiness_probe"]["login_credential_local_reference"]
cred_ref_obj["uuid"] = cred_name_uuid_map[cred_ref_obj["name"]]
except Exception:
pass