@@ -93,11 +93,12 @@ def patch_invalid_ca(
9393 request : pytest .FixtureRequest ,
9494) -> Generator [str , Any , Any ]:
9595 """
96- Patches the odh-trusted-ca-bundle ConfigMap with an invalid CA certificate.
96+ Patches the ConfigMap with an invalid CA certificate.
9797 """
9898 ca_configmap_name = request .param .get ("ca_configmap_name" , "odh-trusted-ca-bundle" )
9999 ca_file_name = request .param .get ("ca_file_name" , "invalid-ca.crt" )
100100 ca_file_path = f"{ CA_MOUNT_PATH } /{ ca_file_name } "
101+ LOGGER .info (f"Patching the { ca_configmap_name } ConfigMap with an invalid CA certificate: { ca_file_path } " )
101102 ca_data = {ca_file_name : "-----BEGIN CERTIFICATE-----\n INVALIDCERTIFICATE\n -----END CERTIFICATE-----" }
102103 ca_configmap = ConfigMap (
103104 client = admin_client ,
@@ -113,6 +114,7 @@ def patch_invalid_ca(
113114 "data" : ca_data ,
114115 }
115116 with ResourceEditor (patches = {ca_configmap : patch }):
117+ LOGGER .info (f"Patched the { ca_configmap_name } ConfigMap with an invalid CA certificate: { ca_file_path } " )
116118 yield ca_file_path
117119
118120
@@ -159,6 +161,7 @@ def deploy_secure_mysql_and_mr(
159161 model_registry_db_deployment: The deployment for the model registry's MySQL database
160162 model_registry_mysql_config: The MySQL config dictionary
161163 mysql_template_with_ca: The MySQL template with the CA file path and volume mount
164+ patch_mysql_deployment_with_ssl_ca: The MySQL deployment with the CA file path and volume mount
162165 """
163166 with ModelRegistry (
164167 name = SECURE_MR_NAME ,
@@ -240,14 +243,18 @@ def patch_mysql_deployment_with_ssl_ca(
240243 model_registry_namespace : str ,
241244 model_registry_db_deployment : Deployment ,
242245 mysql_ssl_secrets : dict [str , Any ],
243- ca_configmap_for_test : ConfigMap ,
244246) -> Generator [Deployment , Any , Any ]:
245247 """
246248 Patch the MySQL deployment to use the test CA bundle (mysql-ca-configmap),
247249 and mount the server cert/key for SSL.
248250 """
251+
252+ if request .param .get ("ca_configmap_for_test" ):
253+ LOGGER .info ("Invoking ca_configmap_for_test fixture" )
254+ request .getfixturevalue ("ca_configmap_for_test" ) # noqa: FCN001
249255 CA_CONFIGMAP_NAME = request .param .get ("ca_configmap_name" , "mysql-ca-configmap" )
250256 CA_MOUNT_PATH = request .param .get ("ca_mount_path" , "/etc/mysql/ssl" )
257+
251258 deployment = model_registry_db_deployment .instance .to_dict ()
252259 spec = deployment ["spec" ]["template" ]["spec" ]
253260 my_sql_container = next (container for container in spec ["containers" ] if container ["name" ] == "mysql" )
0 commit comments