@@ -91,29 +91,20 @@ def deploy_cluster(
9191 terraform_deployer .cleanup ()
9292
9393 config = get_terraform_config (split_mode = (kraft_mode == "multi" ))
94- config ["ingress_offer" ] = ingress_offer
94+ config ["ingress_offer" ] = ingress_offer . split ( ":" )[ - 1 ] # Remove the controller: prefix
9595 tfvars_file = terraform_deployer .create_tfvars (config )
9696
9797 terraform_deployer .terraform_init ()
9898 terraform_deployer .terraform_apply (tfvars_file )
9999
100100
101101@pytest .fixture ()
102- def enable_terraform_tls (juju : jubilant . Juju , model_uuid : str , kraft_mode ):
102+ def enable_terraform_tls (model_uuid : str , kraft_mode : KRaftMode ):
103103 """Deploy a tls endpoint and update terraform."""
104- jubilant .Juju ().add_model (model = CORE_MODEL_NAME )
105- tls_model = jubilant .Juju (model = CORE_MODEL_NAME )
106- tls_model .deploy (CERTIFICATES_APP_NAME , config = {"ca-common-name" : "test-ca" }, channel = "stable" )
107- tls_model .wait (
108- lambda status : all_active_idle (status , CERTIFICATES_APP_NAME ),
109- delay = 5 ,
110- successes = 5 ,
111- timeout = 600 ,
112- )
113- tls_model .offer (f"{ CORE_MODEL_NAME } .{ CERTIFICATES_APP_NAME } " , endpoint = "certificates" )
104+ core_juju = jubilant .Juju (model = CORE_MODEL_NAME )
114105
115106 # Store the CA cert for requests
116- result = tls_model .run (f"{ CERTIFICATES_APP_NAME } /0" , "get-ca-certificate" )
107+ result = core_juju .run (f"{ CERTIFICATES_APP_NAME } /0" , "get-ca-certificate" )
117108 ca = result .results .get ("ca-certificate" )
118109 open (CA_FILE , "w" ).write (ca )
119110
0 commit comments