diff --git a/image/cli/mascli/functions/internal/save_config b/image/cli/mascli/functions/internal/save_config index 6d119e1a1c..d7a85931e5 100644 --- a/image/cli/mascli/functions/internal/save_config +++ b/image/cli/mascli/functions/internal/save_config @@ -50,6 +50,7 @@ export MAS_CONFIGURE_INGRESS=$MAS_CONFIGURE_INGRESS export MAS_TRUST_DEFAULT_CAS=$MAS_TRUST_DEFAULT_CAS export OCP_INGRESS_TLS_SECRET_NAME=$OCP_INGRESS_TLS_SECRET_NAME export MAS_USE_SERVICE_MESH=$MAS_USE_SERVICE_MESH +export MAS_MANUAL_ROUTE_MGMT=$MAS_MANUAL_ROUTE_MGMT # Additional Config Support export LOCAL_MAS_CONFIG_DIR=$LOCAL_MAS_CONFIG_DIR diff --git a/python/src/mas/cli/install/app.py b/python/src/mas/cli/install/app.py index 1e42c5b491..b7595d9b53 100644 --- a/python/src/mas/cli/install/app.py +++ b/python/src/mas/cli/install/app.py @@ -702,6 +702,7 @@ def configMAS(self): self.configCATrust() self.configDNSAndCerts() self.configRoutingMode() + self.configManualRoutesMgmt() self.configServiceMesh() self.configSSOProperties() self.configSpecialCharacters() @@ -1015,6 +1016,15 @@ def _checkIngressControllerPermissions(self, controllerName="default"): logger.warning(f"User may not have permissions to configure IngressController '{controllerName}': {e}") return False + @logMethodCall + def configManualRoutesMgmt(self) -> None: + if self.showAdvancedOptions: + self.printH1("Configure Routes Manually") + self.printDescription(["Disable automatic route creation."]) + self.yesOrNo("Disable Route Creation", "mas_manual_route_mgmt") + else: + self.setParam("mas_manual_route_mgmt", "false") + @logMethodCall def configServiceMesh(self) -> None: if self.showAdvancedOptions: diff --git a/python/src/mas/cli/install/argBuilder.py b/python/src/mas/cli/install/argBuilder.py index 0e3d17ec29..cb891849c5 100644 --- a/python/src/mas/cli/install/argBuilder.py +++ b/python/src/mas/cli/install/argBuilder.py @@ -113,6 +113,9 @@ def buildCommand(self) -> str: if self.getParam("mas_use_service_mesh") != "": command += f" --servicemesh \"{self.getParam('mas_use_service_mesh')}\"{newline}" + if self.getParam("mas_manual_route_mgmt").lower() == "true": + command += f" --manual-routes{newline}" + if self.getParam("mas_domain") != "": command += f" --domain \"{self.getParam('mas_domain')}\"{newline}" diff --git a/python/src/mas/cli/install/argParser.py b/python/src/mas/cli/install/argParser.py index 8e3cbe6c91..603d02dafe 100644 --- a/python/src/mas/cli/install/argParser.py +++ b/python/src/mas/cli/install/argParser.py @@ -166,6 +166,15 @@ def isValidFile(parser: argparse.ArgumentParser, arg: str) -> str: help="Configure MAS to use Service Mesh networking (default: false)", choices=["true", "false"], ) +masAdvancedArgGroup.add_argument( + "--manual-routes", + dest="mas_manual_route_mgmt", + required=False, + action="store_const", + const="true", + default="false", + help="Disable automatic creation of routes.", +) masAdvancedArgGroup.add_argument( "--manual-certificates", required=False, diff --git a/python/src/mas/cli/install/params.py b/python/src/mas/cli/install/params.py index fd36b28a53..950ae7d0f3 100644 --- a/python/src/mas/cli/install/params.py +++ b/python/src/mas/cli/install/params.py @@ -40,6 +40,7 @@ "mas_routing_mode", "mas_use_service_mesh", "mas_ingress_controller_name", + "mas_manual_route_mgmt", "mas_app_settings_server_bundles_size", "mas_app_settings_default_jms", "mas_app_settings_persistent_volumes_flag", diff --git a/python/src/mas/cli/install/summarizer.py b/python/src/mas/cli/install/summarizer.py index fe910d44cd..8f7038f4f7 100644 --- a/python/src/mas/cli/install/summarizer.py +++ b/python/src/mas/cli/install/summarizer.py @@ -143,6 +143,9 @@ def masSummary(self) -> None: self.printParamSummary("IngressController Name", "mas_ingress_controller_name") self.printParamSummary("Configure IngressController", "mas_configure_ingress") + print() + self.printParamSummary("Manual Routes", "mas_manual_route_mgmt") + print() self.printParamSummary("Use Service Mesh", "mas_use_service_mesh") diff --git a/python/test/install/test_dev_mode.py b/python/test/install/test_dev_mode.py index b9274a19f5..072c815391 100644 --- a/python/test/install/test_dev_mode.py +++ b/python/test/install/test_dev_mode.py @@ -252,6 +252,8 @@ def test_install_master_dev_mode_with_path_routing(tmpdir): # 4. Routing Mode Configuration - Select path-based routing ".*Routing Mode.*": lambda msg: "1", # Select path-based routing # Note: IngressController selection prompt does NOT appear because there's only one controller + # 5. Manual Routes Configuration - to use manual route configuration + ".*Disable Route Creation.*": lambda msg: "y", # Select to use service mesh # 5. Service Mesh Configuration - to use service mesg ".*Use Service Mesh.*": lambda msg: "y", # Select to use service mesh # 5. Configure IngressController for path-based routing diff --git a/tekton/src/params/install.yml.j2 b/tekton/src/params/install.yml.j2 index 7333624293..2c0239ab5d 100644 --- a/tekton/src/params/install.yml.j2 +++ b/tekton/src/params/install.yml.j2 @@ -458,6 +458,9 @@ - name: mas_use_service_mesh type: string default: "" +- name: mas_manual_route_mgmt + type: string + default: "" - name: mas_ingress_controller_name type: string default: "" diff --git a/tekton/src/pipelines/taskdefs/core/suite-install.yml.j2 b/tekton/src/pipelines/taskdefs/core/suite-install.yml.j2 index 0c52a5d5d6..db89c87def 100644 --- a/tekton/src/pipelines/taskdefs/core/suite-install.yml.j2 +++ b/tekton/src/pipelines/taskdefs/core/suite-install.yml.j2 @@ -66,6 +66,8 @@ value: $(params.mas_routing_mode) - name: mas_use_service_mesh value: $(params.mas_use_service_mesh) + - name: mas_manual_route_mgmt + value: $(params.mas_manual_route_mgmt) - name: mas_ingress_controller_name value: $(params.mas_ingress_controller_name) - name: mas_manual_cert_mgmt diff --git a/tekton/src/tasks/suite-install.yml.j2 b/tekton/src/tasks/suite-install.yml.j2 index dad12053fb..24ecbcecfd 100644 --- a/tekton/src/tasks/suite-install.yml.j2 +++ b/tekton/src/tasks/suite-install.yml.j2 @@ -51,6 +51,10 @@ spec: type: string description: Optional string parameter, either true or false (defaults to false), defines whether the suite will be configured to use redhat service mesh for networking default: "" + - name: mas_manual_route_mgmt + type: string + description: Optional string parameter, either true or false (defaults to false), defines whether the suite will disable automatic route creation, allowing manual definitiion of routes. + default: "" - name: mas_ingress_controller_name type: string description: Name of the IngressController to use for path-based routing @@ -185,6 +189,8 @@ spec: value: $(params.mas_ingress_controller_name) - name: MAS_USE_SERVICE_MESH value: $(params.mas_use_service_mesh) + - name: MAS_MANUAL_ROUTE_MGMT + value: $(params.mas_manual_route_mgmt) - name: MAS_MANUAL_CERT_MGMT value: $(params.mas_manual_cert_mgmt) - name: MAS_TRUST_DEFAULT_CAS