diff --git a/src/codeflare_sdk/common/kubernetes_cluster/auth.py b/src/codeflare_sdk/common/kubernetes_cluster/auth.py index 2525d2e35..e61460937 100644 --- a/src/codeflare_sdk/common/kubernetes_cluster/auth.py +++ b/src/codeflare_sdk/common/kubernetes_cluster/auth.py @@ -109,14 +109,15 @@ def login(self) -> str: configuration.host = self.server configuration.api_key["authorization"] = self.token - api_client = client.ApiClient(configuration) - if not self.skip_tls: - _client_with_cert(api_client, self.ca_cert_path) - else: + if self.skip_tls: urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) print("Insecure request warnings have been disabled") configuration.verify_ssl = False + api_client = client.ApiClient(configuration) + if not self.skip_tls: + _client_with_cert(api_client, self.ca_cert_path) + client.AuthenticationApi(api_client).get_api_group() config_path = None return "Logged into %s" % self.server