nutanix / calm-dsl

Keep Calm and DSL On!
https://nutanix.github.io/calm-dsl/
Apache License 2.0
33 stars 51 forks source link

Fix Azure environment credential reference for readiness probe. #192

Closed glover-chris closed 6 months ago

glover-chris commented 3 years ago

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
dwivediprab commented 6 months ago

Issue is fixed in DSL v3.7.2.2 release, Hence closing it.