From 0cd8eb1bcd84522333fc6bfdce7c40155f435e73 Mon Sep 17 00:00:00 2001 From: Shyam Doshi Date: Tue, 26 May 2026 15:02:56 +0530 Subject: [PATCH 1/6] [patch] Added support for FACILITIES.properties in Facilities --- src/mas/devops/tekton.py | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/mas/devops/tekton.py b/src/mas/devops/tekton.py index a0228a83..f4d842ae 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,24 @@ def prepareInstallSecrets(dynClient: DynamicClient, namespace: str, slsLicenseFi } secretsAPI.create(body=db2LicenseFile, namespace=namespace) + # 7. Secret/pipeline-facilities-properties + # ------------------------------------------------------------------------- + try: + secretsAPI.delete(name="pipeline-facilities-properties", namespace=namespace) + except NotFoundError: + pass + + if facilitiesProperties is None: + facilitiesProperties = { + "apiVersion": "v1", + "kind": "Secret", + "type": "Opaque", + "metadata": { + "name": "pipeline-facilities-properties" + } + } + secretsAPI.create(body=facilitiesProperties, namespace=namespace) + def prepareUpdateSecrets(dynClient: DynamicClient, slack_token: str = None, slack_channel: str = None, db2LicenseFile: dict | None = None) -> None: """ From c008ecc4a31e1e94b6eb24d3ba6242102be8646c Mon Sep 17 00:00:00 2001 From: Shyam Doshi Date: Wed, 27 May 2026 15:29:59 +0530 Subject: [PATCH 2/6] [patch] Added environment vars to install pipeline --- src/mas/devops/templates/pipelinerun-install.yml.j2 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/mas/devops/templates/pipelinerun-install.yml.j2 b/src/mas/devops/templates/pipelinerun-install.yml.j2 index f1321de6..ce3eb5a6 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 %} From 32e3ec2bb47b3798ea328f2562be08220b62fc42 Mon Sep 17 00:00:00 2001 From: Shyam Doshi Date: Wed, 27 May 2026 19:14:25 +0530 Subject: [PATCH 3/6] [patch] Added facilities properties configurations --- src/mas/devops/templates/pipelinerun-install.yml.j2 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mas/devops/templates/pipelinerun-install.yml.j2 b/src/mas/devops/templates/pipelinerun-install.yml.j2 index ce3eb5a6..4754fc83 100644 --- a/src/mas/devops/templates/pipelinerun-install.yml.j2 +++ b/src/mas/devops/templates/pipelinerun-install.yml.j2 @@ -989,3 +989,12 @@ spec: - name: shared-aiservice-config secret: secretName: pipeline-aiservice-config + +{%- if mas_ws_facilities_custom_properties is defined and mas_ws_facilities_custom_properties == "true" %} + + # Facilities Properties configurations + # ------------------------------------------------------------------------- + - name: shared-facilities-properties + secret: + secretName: pipeline-facilities-properties +{%- endif %} From aeb6afad8256cd1fa08e90ec80fda482ad5645fc Mon Sep 17 00:00:00 2001 From: Shyam Doshi Date: Wed, 27 May 2026 20:34:56 +0530 Subject: [PATCH 4/6] [patch] Refactor the code --- src/mas/devops/tekton.py | 22 ++++++------------- .../templates/pipelinerun-install.yml.j2 | 3 +-- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/mas/devops/tekton.py b/src/mas/devops/tekton.py index f4d842ae..6fc9309d 100644 --- a/src/mas/devops/tekton.py +++ b/src/mas/devops/tekton.py @@ -747,21 +747,13 @@ def prepareInstallSecrets(dynClient: DynamicClient, namespace: str, slsLicenseFi # 7. Secret/pipeline-facilities-properties # ------------------------------------------------------------------------- - try: - secretsAPI.delete(name="pipeline-facilities-properties", namespace=namespace) - except NotFoundError: - pass - - if facilitiesProperties is None: - facilitiesProperties = { - "apiVersion": "v1", - "kind": "Secret", - "type": "Opaque", - "metadata": { - "name": "pipeline-facilities-properties" - } - } - secretsAPI.create(body=facilitiesProperties, namespace=namespace) + # 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 4754fc83..9ff39b63 100644 --- a/src/mas/devops/templates/pipelinerun-install.yml.j2 +++ b/src/mas/devops/templates/pipelinerun-install.yml.j2 @@ -990,10 +990,9 @@ spec: secret: secretName: pipeline-aiservice-config -{%- if mas_ws_facilities_custom_properties is defined and mas_ws_facilities_custom_properties == "true" %} - # Facilities Properties configurations # ------------------------------------------------------------------------- +{%- if mas_ws_facilities_custom_properties is defined and mas_ws_facilities_custom_properties == "true" %} - name: shared-facilities-properties secret: secretName: pipeline-facilities-properties From e7923cb1c76ff13f0991c847ce731b350833579f Mon Sep 17 00:00:00 2001 From: Shyam Doshi Date: Fri, 29 May 2026 17:28:14 +0530 Subject: [PATCH 5/6] [patch] Made changes in workspace config --- src/mas/devops/templates/pipelinerun-install.yml.j2 | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/mas/devops/templates/pipelinerun-install.yml.j2 b/src/mas/devops/templates/pipelinerun-install.yml.j2 index 9ff39b63..119f0a73 100644 --- a/src/mas/devops/templates/pipelinerun-install.yml.j2 +++ b/src/mas/devops/templates/pipelinerun-install.yml.j2 @@ -992,8 +992,6 @@ spec: # Facilities Properties configurations # ------------------------------------------------------------------------- -{%- if mas_ws_facilities_custom_properties is defined and mas_ws_facilities_custom_properties == "true" %} - name: shared-facilities-properties secret: secretName: pipeline-facilities-properties -{%- endif %} From 9407f20df2324cd7ce1738f075e7ee3905f155a8 Mon Sep 17 00:00:00 2001 From: Shyam Doshi Date: Mon, 1 Jun 2026 13:41:17 +0530 Subject: [PATCH 6/6] [patch] Made secret mount optional --- src/mas/devops/templates/pipelinerun-install.yml.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mas/devops/templates/pipelinerun-install.yml.j2 b/src/mas/devops/templates/pipelinerun-install.yml.j2 index 119f0a73..294a388c 100644 --- a/src/mas/devops/templates/pipelinerun-install.yml.j2 +++ b/src/mas/devops/templates/pipelinerun-install.yml.j2 @@ -992,6 +992,8 @@ spec: # Facilities Properties configurations # ------------------------------------------------------------------------- + {% if mas_ws_facilities_custom_properties == "true" %} - name: shared-facilities-properties secret: secretName: pipeline-facilities-properties + {% endif %}