"There is no ODU workflow yet able to manage multiple OKAs for a KSU"
)
oka_item = oka_list[0]
+ oka_params = oka_item.get("transformation", {})
if "sw_catalog_path" in oka_item:
oka_path = oka_item["sw_catalog_path"]
else:
osm_project_name = "osm_admin" # TODO: get project name from db_ksu
kustomization_name = ksu_name
helmrelease_name = ksu_name
- target_ns = ksu_params.get("namespace", "default")
profile_type = ksu_params.get("profile", {}).get("profile_type")
profile_type = MAP_PROFILE[profile_type]
profile_name = ksu_params.get("profile", {}).get("name")
age_public_key = ksu_params.get("profile", {}).get("age_pubkey")
- substitute_environment = ksu_params.get("substitute_environment", "false")
- substitution_filter = ksu_params.get("substitution_filter", "")
- custom_env_vars = ksu_params.get("custom_env_vars", "")
+ target_ns = oka_params.get("namespace", "default")
+ substitute_environment = oka_params.get("substitute_environment", "false")
+ substitution_filter = oka_params.get("substitution_filter", "")
+ custom_env_vars = oka_params.get("custom_env_vars", "")
if custom_env_vars:
custom_env_vars = "|\n" + "\n".join(
[" " * 10 + f"{k}={v}" for k, v in custom_env_vars.items()]
)
else:
custom_env_vars = '""'
- inline_values = ksu_params.get("inline_values", "")
+ inline_values = oka_params.get("inline_values", "")
if inline_values:
yaml_string = yaml.safe_dump(
inline_values, sort_keys=False, default_flow_style=False
else:
inline_values = '""'
is_preexisting_cm = "false"
- cm_values = ksu_params.get("configmap_values", "")
+ cm_values = oka_params.get("configmap_values", "")
if cm_values:
yaml_string = yaml.safe_dump(
cm_values, sort_keys=False, default_flow_style=False
cm_key = ""
cm_values = '""'
is_preexisting_secret = "false"
- secret_values = ksu_params.get("secret_values", "")
+ secret_values = oka_params.get("secret_values", "")
if secret_values:
values_secret_name = f"secret-{ksu_name}"
reference_secret_for_values = f"ref-secret-{ksu_name}"
raise Exception(
"There is no ODU workflow yet able to manage multiple OKAs for a KSU"
)
- oka_path = oka_list[0]["sw_catalog_path"]
+ oka_item = oka_list[0]
+ oka_params = oka_item.get("transformation", {})
+ if "sw_catalog_path" in oka_item:
+ oka_path = oka_item["sw_catalog_path"]
+ else:
+ oka_type = "infra-controllers"
+ oka_name = oka_item["git_name"]
+ oka_path = f"{oka_type}/{oka_name}/templates"
workflow_template = "launcher-update-ksu-hr.j2"
workflow_name = f"update-ksus-{op_id}"
osm_project_name = "osm_admin" # TODO: get project name from db_ksu
kustomization_name = ksu_name
helmrelease_name = ksu_name
- target_ns = ksu_params.get("namespace", "default")
profile_type = ksu_params.get("profile", {}).get("profile_type")
profile_type = MAP_PROFILE[profile_type]
profile_name = ksu_params.get("profile", {}).get("name")
age_public_key = ksu_params.get("profile", {}).get("age_pubkey")
- substitute_environment = ksu_params.get("substitute_environment", "false")
- substitution_filter = ksu_params.get("substitution_filter", "")
- custom_env_vars = ksu_params.get("custom_env_vars", "")
+ target_ns = oka_params.get("namespace", "default")
+ substitute_environment = oka_params.get("substitute_environment", "false")
+ substitution_filter = oka_params.get("substitution_filter", "")
+ custom_env_vars = oka_params.get("custom_env_vars", "")
if custom_env_vars:
custom_env_vars = "|\n" + "\n".join(
[" " * 10 + f"{k}={v}" for k, v in custom_env_vars.items()]
)
else:
custom_env_vars = '""'
- inline_values = ksu_params.get("inline_values", "")
+ inline_values = oka_params.get("inline_values", "")
if inline_values:
yaml_string = yaml.safe_dump(
inline_values, sort_keys=False, default_flow_style=False
else:
inline_values = '""'
is_preexisting_cm = "false"
- cm_values = ksu_params.get("configmap_values", "")
+ cm_values = oka_params.get("configmap_values", "")
if cm_values:
yaml_string = yaml.safe_dump(
cm_values, sort_keys=False, default_flow_style=False
cm_key = ""
cm_values = '""'
is_preexisting_secret = "false"
- secret_values = ksu_params.get("secret_values", "")
+ secret_values = oka_params.get("secret_values", "")
if secret_values:
values_secret_name = f"secret-{ksu_name}"
reference_secret_for_values = f"ref-secret-{ksu_name}"