1111from tests .model_registry .utils import (
1212 get_model_registry_deployment_template_dict ,
1313 create_model_registry_instance ,
14- make_mysql_config ,
1514)
1615from tests .model_registry .constants import (
1716 DB_RESOURCES_NAME ,
@@ -106,26 +105,19 @@ def patch_invalid_ca(
106105@pytest .fixture (scope = "function" )
107106def model_registry_instance_ca (
108107 model_registry_namespace : str ,
109- model_registry_db_secret : Secret ,
110- model_registry_db_service : Service ,
111- patch_invalid_ca : str ,
108+ model_registry_mysql_config : dict [str , Any ],
112109) -> Generator [ModelRegistry , Any , Any ]:
113110 """
114111 Deploys a Model Registry instance with a custom CA certificate.
115112 """
116- mysql_config = make_mysql_config (
117- db_service = model_registry_db_service ,
118- db_secret = model_registry_db_secret ,
119- ssl_ca = patch_invalid_ca ,
120- )
121113 with create_model_registry_instance (
122114 namespace = model_registry_namespace ,
123115 name = SECURE_MR_NAME ,
124116 labels = MODEL_REGISTRY_STANDARD_LABELS ,
125117 grpc = {},
126118 rest = {},
127119 istio = ISTIO_CONFIG_DICT ,
128- mysql = mysql_config ,
120+ mysql = model_registry_mysql_config ,
129121 wait_for_resource = True ,
130122 ) as mr :
131123 mr .wait_for_condition (condition = "Available" , status = "True" )
@@ -138,6 +130,7 @@ def deploy_secure_mysql_and_mr(
138130 model_registry_db_secret : Secret ,
139131 model_registry_db_service : Service ,
140132 model_registry_db_deployment : Deployment ,
133+ model_registry_mysql_config : dict [str , Any ],
141134) -> Generator [ModelRegistry , None , None ]:
142135 """
143136 Deploys MySQL with SSL/TLS and a Model Registry configured to use a secure DB connection.
@@ -161,19 +154,14 @@ def deploy_secure_mysql_and_mr(
161154 patch = {"spec" : {"template" : mysql_template ["spec" ]}}
162155
163156 with ResourceEditor (patches = {model_registry_db_deployment : patch }):
164- mysql_config = make_mysql_config (
165- db_service = model_registry_db_service ,
166- db_secret = model_registry_db_secret ,
167- ssl_ca = CA_FILE_PATH ,
168- )
169157 with create_model_registry_instance (
170158 namespace = model_registry_namespace ,
171159 name = SECURE_MR_NAME ,
172160 labels = MODEL_REGISTRY_STANDARD_LABELS ,
173161 grpc = {},
174162 rest = {},
175163 istio = ISTIO_CONFIG_DICT ,
176- mysql = mysql_config ,
164+ mysql = model_registry_mysql_config ,
177165 wait_for_resource = True ,
178166 ) as mr :
179167 mr .wait_for_condition (condition = "Available" , status = "True" )
0 commit comments