From 9a1071748eb1bdee67fdc30e2662cc393833476f Mon Sep 17 00:00:00 2001 From: Saad Zaher Date: Thu, 30 Apr 2026 12:13:33 +0100 Subject: [PATCH] feat(auth): verify API client connectivity in set_api_client Add an authentication check when setting a custom API client to catch misconfigured or invalid clients early. The verification calls AuthenticationApi.get_api_group() to confirm the client can reach the Kubernetes API server before proceeding. Signed-off-by: Saad Zaher --- src/codeflare_sdk/common/kubernetes_cluster/auth.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/codeflare_sdk/common/kubernetes_cluster/auth.py b/src/codeflare_sdk/common/kubernetes_cluster/auth.py index 1f933ef0b..0706055c0 100644 --- a/src/codeflare_sdk/common/kubernetes_cluster/auth.py +++ b/src/codeflare_sdk/common/kubernetes_cluster/auth.py @@ -358,3 +358,7 @@ def set_api_client(new_client: client.ApiClient): global api_client, config_path api_client = new_client config_path = "custom" # Mark as configured with custom client + # verify the client works by making a simple API call + client.AuthenticationApi(api_client).get_api_group() + # print message confirming successful configuration + print("Custom API client has been set and verified successfully.")