diff --git a/src/mas/devops/tekton.py b/src/mas/devops/tekton.py index a0228a83..6fc9309d 100644 --- a/src/mas/devops/tekton.py +++ b/src/mas/devops/tekton.py @@ -564,12 +564,13 @@ def prepareRestoreSecrets(dynClient: DynamicClient, namespace: str, restoreConfi secretsAPI.create(body=restoreConfigs, namespace=namespace) -def prepareInstallSecrets(dynClient: DynamicClient, namespace: str, slsLicenseFile: str = None, additionalConfigs: dict = None, certs: str = None, podTemplates: str = None, slack_token: str = None, slack_channel: str = None, aiserviceConfig: str = None, db2LicenseFile: dict | None = None) -> None: +def prepareInstallSecrets(dynClient: DynamicClient, namespace: str, slsLicenseFile: str = None, additionalConfigs: dict = None, certs: str = None, podTemplates: str = None, slack_token: str = None, slack_channel: str = None, aiserviceConfig: str = None, db2LicenseFile: dict | None = None, facilitiesProperties: dict | None = None) -> None: """ Create or update secrets required for MAS installation pipelines. - Creates five secrets in the specified namespace: mas-devops-slack, pipeline-additional-configs, - pipeline-sls-entitlement, pipeline-certificates, pipeline-pod-templates and pipeline-aiservice-config. + Creates secrets in the specified namespace: mas-devops-slack, pipeline-additional-configs, + pipeline-sls-entitlement, pipeline-certificates, pipeline-pod-templates, pipeline-aiservice-config, + pipeline-db2-license, and pipeline-facilities-properties. Parameters: dynClient (DynamicClient): OpenShift Dynamic Client @@ -582,6 +583,7 @@ def prepareInstallSecrets(dynClient: DynamicClient, namespace: str, slsLicenseFi slack_token (str, optional): Slack bot token for notifications. Defaults to None. slack_channel (str, optional): Slack channel ID for notifications. Defaults to None. aiserviceConfig (str, optional): AI Service tenant config data. Defaults to None (empty secret). + facilitiesProperties (dict, optional): Facilities properties file content. Defaults to None (empty secret). Returns: None @@ -743,6 +745,16 @@ def prepareInstallSecrets(dynClient: DynamicClient, namespace: str, slsLicenseFi } secretsAPI.create(body=db2LicenseFile, namespace=namespace) + # 7. Secret/pipeline-facilities-properties + # ------------------------------------------------------------------------- + # Only create secret if custom facilities properties are provided + if facilitiesProperties is not None: + try: + secretsAPI.delete(name="pipeline-facilities-properties", namespace=namespace) + except NotFoundError: + pass + secretsAPI.create(body=facilitiesProperties, namespace=namespace) + def prepareUpdateSecrets(dynClient: DynamicClient, slack_token: str = None, slack_channel: str = None, db2LicenseFile: dict | None = None) -> None: """ diff --git a/src/mas/devops/templates/pipelinerun-install.yml.j2 b/src/mas/devops/templates/pipelinerun-install.yml.j2 index f1321de6..294a388c 100644 --- a/src/mas/devops/templates/pipelinerun-install.yml.j2 +++ b/src/mas/devops/templates/pipelinerun-install.yml.j2 @@ -820,6 +820,18 @@ spec: - name: mas_ws_facilities_config_map_name value: "{{ mas_ws_facilities_config_map_name }}" {%- endif %} +{%- if mas_ws_facilities_custom_properties is defined and mas_ws_facilities_custom_properties != "" %} + - name: mas_ws_facilities_custom_properties + value: "{{ mas_ws_facilities_custom_properties }}" +{%- endif %} +{%- if mas_ws_facilities_properties_file_local is defined and mas_ws_facilities_properties_file_local != "" %} + - name: mas_ws_facilities_properties_file_local + value: "{{ mas_ws_facilities_properties_file_local }}" +{%- endif %} +{%- if mas_ws_facilities_properties_secret_name is defined and mas_ws_facilities_properties_secret_name != "" %} + - name: mas_ws_facilities_properties_secret_name + value: "{{ mas_ws_facilities_properties_secret_name }}" +{%- endif %} {%- endif %} @@ -977,3 +989,11 @@ spec: - name: shared-aiservice-config secret: secretName: pipeline-aiservice-config + + # Facilities Properties configurations + # ------------------------------------------------------------------------- + {% if mas_ws_facilities_custom_properties == "true" %} + - name: shared-facilities-properties + secret: + secretName: pipeline-facilities-properties + {% endif %}