diff --git a/docs/detailed-documentation/cluster/auth.html b/docs/detailed-documentation/cluster/auth.html index 61d199e52..d35b46093 100644 --- a/docs/detailed-documentation/cluster/auth.html +++ b/docs/detailed-documentation/cluster/auth.html @@ -126,17 +126,7 @@

Module codeflare_sdk.cluster.auth

self.token = token self.server = server self.skip_tls = skip_tls - self.ca_cert_path = self._gen_ca_cert_path(ca_cert_path) - - def _gen_ca_cert_path(self, ca_cert_path: str): - if ca_cert_path is not None: - return ca_cert_path - elif "CF_SDK_CA_CERT_PATH" in os.environ: - return os.environ.get("CF_SDK_CA_CERT_PATH") - elif os.path.exists(WORKBENCH_CA_CERT_PATH): - return WORKBENCH_CA_CERT_PATH - else: - return None + self.ca_cert_path = _gen_ca_cert_path(ca_cert_path) def login(self) -> str: """ @@ -152,25 +142,14 @@

Module codeflare_sdk.cluster.auth

configuration.host = self.server configuration.api_key["authorization"] = self.token + api_client = client.ApiClient(configuration) if not self.skip_tls: - if self.ca_cert_path is None: - configuration.ssl_ca_cert = None - elif os.path.isfile(self.ca_cert_path): - print( - f"Authenticated with certificate located at {self.ca_cert_path}" - ) - configuration.ssl_ca_cert = self.ca_cert_path - else: - raise FileNotFoundError( - f"Certificate file not found at {self.ca_cert_path}" - ) - configuration.verify_ssl = True + _client_with_cert(api_client, self.ca_cert_path) else: urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) print("Insecure request warnings have been disabled") configuration.verify_ssl = False - api_client = client.ApiClient(configuration) client.AuthenticationApi(api_client).get_api_group() config_path = None return "Logged into %s" % self.server @@ -244,14 +223,36 @@

Module codeflare_sdk.cluster.auth

return config_path -def api_config_handler() -> Optional[client.ApiClient]: - """ - This function is used to load the api client if the user has logged in - """ - if api_client != None and config_path == None: - return api_client +def _client_with_cert(client: client.ApiClient, ca_cert_path: Optional[str] = None): + client.configuration.verify_ssl = True + cert_path = _gen_ca_cert_path(ca_cert_path) + if cert_path is None: + client.configuration.ssl_ca_cert = None + elif os.path.isfile(cert_path): + client.configuration.ssl_ca_cert = cert_path else: - return None + raise FileNotFoundError(f"Certificate file not found at {cert_path}") + + +def _gen_ca_cert_path(ca_cert_path: Optional[str]): + """Gets the path to the default CA certificate file either through env config or default path""" + if ca_cert_path is not None: + return ca_cert_path + elif "CF_SDK_CA_CERT_PATH" in os.environ: + return os.environ.get("CF_SDK_CA_CERT_PATH") + elif os.path.exists(WORKBENCH_CA_CERT_PATH): + return WORKBENCH_CA_CERT_PATH + else: + return None + + +def get_api_client() -> client.ApiClient: + "This function should load the api client with defaults" + if api_client != None: + return api_client + to_return = client.ApiClient() + _client_with_cert(to_return) + return to_return
@@ -261,25 +262,6 @@

Module codeflare_sdk.cluster.auth

Functions

-
-def api_config_handler() ‑> Optional[kubernetes.client.api_client.ApiClient] -
-
-

This function is used to load the api client if the user has logged in

-
- -Expand source code - -
def api_config_handler() -> Optional[client.ApiClient]:
-    """
-    This function is used to load the api client if the user has logged in
-    """
-    if api_client != None and config_path == None:
-        return api_client
-    else:
-        return None
-
-
def config_check() ‑> str
@@ -318,6 +300,24 @@

Functions

return config_path +
+def get_api_client() ‑> kubernetes.client.api_client.ApiClient +
+
+

This function should load the api client with defaults

+
+ +Expand source code + +
def get_api_client() -> client.ApiClient:
+    "This function should load the api client with defaults"
+    if api_client != None:
+        return api_client
+    to_return = client.ApiClient()
+    _client_with_cert(to_return)
+    return to_return
+
+
@@ -573,17 +573,7 @@

Methods

self.token = token self.server = server self.skip_tls = skip_tls - self.ca_cert_path = self._gen_ca_cert_path(ca_cert_path) - - def _gen_ca_cert_path(self, ca_cert_path: str): - if ca_cert_path is not None: - return ca_cert_path - elif "CF_SDK_CA_CERT_PATH" in os.environ: - return os.environ.get("CF_SDK_CA_CERT_PATH") - elif os.path.exists(WORKBENCH_CA_CERT_PATH): - return WORKBENCH_CA_CERT_PATH - else: - return None + self.ca_cert_path = _gen_ca_cert_path(ca_cert_path) def login(self) -> str: """ @@ -599,25 +589,14 @@

Methods

configuration.host = self.server configuration.api_key["authorization"] = self.token + api_client = client.ApiClient(configuration) if not self.skip_tls: - if self.ca_cert_path is None: - configuration.ssl_ca_cert = None - elif os.path.isfile(self.ca_cert_path): - print( - f"Authenticated with certificate located at {self.ca_cert_path}" - ) - configuration.ssl_ca_cert = self.ca_cert_path - else: - raise FileNotFoundError( - f"Certificate file not found at {self.ca_cert_path}" - ) - configuration.verify_ssl = True + _client_with_cert(api_client, self.ca_cert_path) else: urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) print("Insecure request warnings have been disabled") configuration.verify_ssl = False - api_client = client.ApiClient(configuration) client.AuthenticationApi(api_client).get_api_group() config_path = None return "Logged into %s" % self.server @@ -665,25 +644,14 @@

Methods

configuration.host = self.server configuration.api_key["authorization"] = self.token + api_client = client.ApiClient(configuration) if not self.skip_tls: - if self.ca_cert_path is None: - configuration.ssl_ca_cert = None - elif os.path.isfile(self.ca_cert_path): - print( - f"Authenticated with certificate located at {self.ca_cert_path}" - ) - configuration.ssl_ca_cert = self.ca_cert_path - else: - raise FileNotFoundError( - f"Certificate file not found at {self.ca_cert_path}" - ) - configuration.verify_ssl = True + _client_with_cert(api_client, self.ca_cert_path) else: urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) print("Insecure request warnings have been disabled") configuration.verify_ssl = False - api_client = client.ApiClient(configuration) client.AuthenticationApi(api_client).get_api_group() config_path = None return "Logged into %s" % self.server @@ -729,8 +697,8 @@

Index

  • Functions

  • Classes

    diff --git a/docs/detailed-documentation/cluster/awload.html b/docs/detailed-documentation/cluster/awload.html index c77ac0e7c..fba18e3ff 100644 --- a/docs/detailed-documentation/cluster/awload.html +++ b/docs/detailed-documentation/cluster/awload.html @@ -55,7 +55,7 @@

    Module codeflare_sdk.cluster.awload

    from kubernetes import client, config from ..utils.kube_api_helpers import _kube_api_error_handling -from .auth import config_check, api_config_handler +from .auth import config_check, get_api_client class AWManager: @@ -90,7 +90,7 @@

    Module codeflare_sdk.cluster.awload

    """ try: config_check() - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) api_instance.create_namespaced_custom_object( group="workload.codeflare.dev", version="v1beta2", @@ -115,7 +115,7 @@

    Module codeflare_sdk.cluster.awload

    try: config_check() - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) api_instance.delete_namespaced_custom_object( group="workload.codeflare.dev", version="v1beta2", @@ -184,7 +184,7 @@

    Classes

    """ try: config_check() - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) api_instance.create_namespaced_custom_object( group="workload.codeflare.dev", version="v1beta2", @@ -209,7 +209,7 @@

    Classes

    try: config_check() - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) api_instance.delete_namespaced_custom_object( group="workload.codeflare.dev", version="v1beta2", @@ -246,7 +246,7 @@

    Methods

    try: config_check() - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) api_instance.delete_namespaced_custom_object( group="workload.codeflare.dev", version="v1beta2", @@ -276,7 +276,7 @@

    Methods

    """ try: config_check() - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) api_instance.create_namespaced_custom_object( group="workload.codeflare.dev", version="v1beta2", diff --git a/docs/detailed-documentation/cluster/cluster.html b/docs/detailed-documentation/cluster/cluster.html index 5276ee942..12865c04b 100644 --- a/docs/detailed-documentation/cluster/cluster.html +++ b/docs/detailed-documentation/cluster/cluster.html @@ -58,7 +58,7 @@

    Module codeflare_sdk.cluster.cluster

    from kubernetes import config from ray.job_submission import JobSubmissionClient -from .auth import config_check, api_config_handler +from .auth import config_check, get_api_client from ..utils import pretty_print from ..utils.generate_yaml import ( generate_appwrapper, @@ -113,7 +113,7 @@

    Module codeflare_sdk.cluster.cluster

    @property def _client_headers(self): - k8_client = api_config_handler() or client.ApiClient() + k8_client = get_api_client() return { "Authorization": k8_client.configuration.get_api_key_with_prefix( "authorization" @@ -128,7 +128,7 @@

    Module codeflare_sdk.cluster.cluster

    @property def job_client(self): - k8client = api_config_handler() or client.ApiClient() + k8client = get_api_client() if self._job_submission_client: return self._job_submission_client if is_openshift_cluster(): @@ -174,7 +174,7 @@

    Module codeflare_sdk.cluster.cluster

    try: config_check() - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) if self.config.appwrapper: if self.config.write_to_file: with open(self.app_wrapper_yaml) as f: @@ -205,7 +205,7 @@

    Module codeflare_sdk.cluster.cluster

    return _kube_api_error_handling(e) def _throw_for_no_raycluster(self): - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) try: api_instance.list_namespaced_custom_object( group="ray.io", @@ -232,7 +232,7 @@

    Module codeflare_sdk.cluster.cluster

    self._throw_for_no_raycluster() try: config_check() - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) if self.config.appwrapper: api_instance.delete_namespaced_custom_object( group="workload.codeflare.dev", @@ -391,7 +391,7 @@

    Module codeflare_sdk.cluster.cluster

    config_check() if is_openshift_cluster(): try: - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) routes = api_instance.list_namespaced_custom_object( group="route.openshift.io", version="v1", @@ -413,7 +413,7 @@

    Module codeflare_sdk.cluster.cluster

    return f"{protocol}://{route['spec']['host']}" else: try: - api_instance = client.NetworkingV1Api(api_config_handler()) + api_instance = client.NetworkingV1Api(get_api_client()) ingresses = api_instance.list_namespaced_ingress(self.config.namespace) except Exception as e: # pragma no cover return _kube_api_error_handling(e) @@ -612,9 +612,6 @@

    Module codeflare_sdk.cluster.cluster

    return active_context except Exception as e: print("Unable to find current namespace") - - if api_config_handler() != None: - return None print("trying to gather from current context") try: _, active_context = config.list_kube_config_contexts(config_check()) @@ -634,7 +631,7 @@

    Module codeflare_sdk.cluster.cluster

    ): try: config_check() - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) rcs = api_instance.list_namespaced_custom_object( group="ray.io", version="v1", @@ -689,7 +686,7 @@

    Module codeflare_sdk.cluster.cluster

    def _check_aw_exists(name: str, namespace: str) -> bool: try: config_check() - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) aws = api_instance.list_namespaced_custom_object( group="workload.codeflare.dev", version="v1beta2", @@ -716,7 +713,7 @@

    Module codeflare_sdk.cluster.cluster

    if is_openshift_cluster(): try: - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) routes = api_instance.list_namespaced_custom_object( group="route.openshift.io", @@ -735,7 +732,7 @@

    Module codeflare_sdk.cluster.cluster

    domain = route["spec"]["host"] else: try: - api_client = client.NetworkingV1Api(api_config_handler()) + api_client = client.NetworkingV1Api(get_api_client()) ingresses = api_client.list_namespaced_ingress(namespace) except Exception as e: # pragma: no cover return _kube_api_error_handling(e) @@ -749,7 +746,7 @@

    Module codeflare_sdk.cluster.cluster

    def _app_wrapper_status(name, namespace="default") -> Optional[AppWrapper]: try: config_check() - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) aws = api_instance.list_namespaced_custom_object( group="workload.codeflare.dev", version="v1beta2", @@ -768,7 +765,7 @@

    Module codeflare_sdk.cluster.cluster

    def _ray_cluster_status(name, namespace="default") -> Optional[RayCluster]: try: config_check() - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) rcs = api_instance.list_namespaced_custom_object( group="ray.io", version="v1", @@ -790,7 +787,7 @@

    Module codeflare_sdk.cluster.cluster

    list_of_clusters = [] try: config_check() - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) rcs = api_instance.list_namespaced_custom_object( group="ray.io", version="v1", @@ -819,7 +816,7 @@

    Module codeflare_sdk.cluster.cluster

    try: config_check() - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) aws = api_instance.list_namespaced_custom_object( group="workload.codeflare.dev", version="v1beta2", @@ -848,7 +845,7 @@

    Module codeflare_sdk.cluster.cluster

    dashboard_url = None if is_openshift_cluster(): try: - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) routes = api_instance.list_namespaced_custom_object( group="route.openshift.io", version="v1", @@ -867,7 +864,7 @@

    Module codeflare_sdk.cluster.cluster

    dashboard_url = f"{protocol}://{route['spec']['host']}" else: try: - api_instance = client.NetworkingV1Api(api_config_handler()) + api_instance = client.NetworkingV1Api(get_api_client()) ingresses = api_instance.list_namespaced_ingress( rc["metadata"]["namespace"] ) @@ -986,7 +983,7 @@

    Functions

    ): try: config_check() - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) rcs = api_instance.list_namespaced_custom_object( group="ray.io", version="v1", @@ -1027,9 +1024,6 @@

    Functions

    return active_context except Exception as e: print("Unable to find current namespace") - - if api_config_handler() != None: - return None print("trying to gather from current context") try: _, active_context = config.list_kube_config_contexts(config_check()) @@ -1135,7 +1129,7 @@

    Classes

    @property def _client_headers(self): - k8_client = api_config_handler() or client.ApiClient() + k8_client = get_api_client() return { "Authorization": k8_client.configuration.get_api_key_with_prefix( "authorization" @@ -1150,7 +1144,7 @@

    Classes

    @property def job_client(self): - k8client = api_config_handler() or client.ApiClient() + k8client = get_api_client() if self._job_submission_client: return self._job_submission_client if is_openshift_cluster(): @@ -1196,7 +1190,7 @@

    Classes

    try: config_check() - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) if self.config.appwrapper: if self.config.write_to_file: with open(self.app_wrapper_yaml) as f: @@ -1227,7 +1221,7 @@

    Classes

    return _kube_api_error_handling(e) def _throw_for_no_raycluster(self): - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) try: api_instance.list_namespaced_custom_object( group="ray.io", @@ -1254,7 +1248,7 @@

    Classes

    self._throw_for_no_raycluster() try: config_check() - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) if self.config.appwrapper: api_instance.delete_namespaced_custom_object( group="workload.codeflare.dev", @@ -1413,7 +1407,7 @@

    Classes

    config_check() if is_openshift_cluster(): try: - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) routes = api_instance.list_namespaced_custom_object( group="route.openshift.io", version="v1", @@ -1435,7 +1429,7 @@

    Classes

    return f"{protocol}://{route['spec']['host']}" else: try: - api_instance = client.NetworkingV1Api(api_config_handler()) + api_instance = client.NetworkingV1Api(get_api_client()) ingresses = api_instance.list_namespaced_ingress(self.config.namespace) except Exception as e: # pragma no cover return _kube_api_error_handling(e) @@ -1606,7 +1600,7 @@

    Instance variables

    @property
     def job_client(self):
    -    k8client = api_config_handler() or client.ApiClient()
    +    k8client = get_api_client()
         if self._job_submission_client:
             return self._job_submission_client
         if is_openshift_cluster():
    @@ -1641,7 +1635,7 @@ 

    Methods

    config_check() if is_openshift_cluster(): try: - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) routes = api_instance.list_namespaced_custom_object( group="route.openshift.io", version="v1", @@ -1663,7 +1657,7 @@

    Methods

    return f"{protocol}://{route['spec']['host']}" else: try: - api_instance = client.NetworkingV1Api(api_config_handler()) + api_instance = client.NetworkingV1Api(get_api_client()) ingresses = api_instance.list_namespaced_ingress(self.config.namespace) except Exception as e: # pragma no cover return _kube_api_error_handling(e) @@ -1762,7 +1756,7 @@

    Methods

    self._throw_for_no_raycluster() try: config_check() - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) if self.config.appwrapper: api_instance.delete_namespaced_custom_object( group="workload.codeflare.dev", @@ -2046,7 +2040,7 @@

    Methods

    try: config_check() - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) if self.config.appwrapper: if self.config.write_to_file: with open(self.app_wrapper_yaml) as f: diff --git a/docs/detailed-documentation/cluster/widgets.html b/docs/detailed-documentation/cluster/widgets.html index e07fa2ea2..b0334903f 100644 --- a/docs/detailed-documentation/cluster/widgets.html +++ b/docs/detailed-documentation/cluster/widgets.html @@ -58,7 +58,7 @@

    Module codeflare_sdk.cluster.widgets

    from .config import ClusterConfiguration from .model import RayClusterStatus from ..utils.kube_api_helpers import _kube_api_error_handling -from .auth import config_check, api_config_handler +from .auth import config_check, get_api_client def cluster_up_down_buttons(cluster: "codeflare_sdk.cluster.Cluster") -> widgets.Button: @@ -372,7 +372,7 @@

    Module codeflare_sdk.cluster.widgets

    try: config_check() - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) if _check_aw_exists(cluster_name, namespace): api_instance.delete_namespaced_custom_object( diff --git a/docs/detailed-documentation/utils/generate_cert.html b/docs/detailed-documentation/utils/generate_cert.html index 176584c40..01084d84f 100644 --- a/docs/detailed-documentation/utils/generate_cert.html +++ b/docs/detailed-documentation/utils/generate_cert.html @@ -47,7 +47,7 @@

    Module codeflare_sdk.utils.generate_cert

    from cryptography import x509 from cryptography.x509.oid import NameOID import datetime -from ..cluster.auth import config_check, api_config_handler +from ..cluster.auth import config_check, get_api_client from kubernetes import client, config from .kube_api_helpers import _kube_api_error_handling @@ -131,7 +131,7 @@

    Module codeflare_sdk.utils.generate_cert

    # oc get secret ca-secret-<cluster-name> -o template='{{index .data "ca.key"}}' # oc get secret ca-secret-<cluster-name> -o template='{{index .data "ca.crt"}}'|base64 -d > ${TLSDIR}/ca.crt config_check() - v1 = client.CoreV1Api(api_config_handler()) + v1 = client.CoreV1Api(get_api_client()) # Secrets have a suffix appended to the end so we must list them and gather the secret that includes cluster_name-ca-secret- secret_name = get_secret_name(cluster_name, namespace, v1) @@ -316,7 +316,7 @@

    Functions

    # oc get secret ca-secret-<cluster-name> -o template='{{index .data "ca.key"}}' # oc get secret ca-secret-<cluster-name> -o template='{{index .data "ca.crt"}}'|base64 -d > ${TLSDIR}/ca.crt config_check() - v1 = client.CoreV1Api(api_config_handler()) + v1 = client.CoreV1Api(get_api_client()) # Secrets have a suffix appended to the end so we must list them and gather the secret that includes cluster_name-ca-secret- secret_name = get_secret_name(cluster_name, namespace, v1) diff --git a/docs/detailed-documentation/utils/generate_yaml.html b/docs/detailed-documentation/utils/generate_yaml.html index 60ce89dfe..c2a7bb347 100644 --- a/docs/detailed-documentation/utils/generate_yaml.html +++ b/docs/detailed-documentation/utils/generate_yaml.html @@ -58,7 +58,7 @@

    Module codeflare_sdk.utils.generate_yaml

    import uuid from kubernetes import client, config from .kube_api_helpers import _kube_api_error_handling -from ..cluster.auth import api_config_handler, config_check +from ..cluster.auth import get_api_client, config_check from os import urandom from base64 import b64encode from urllib3.util import parse_url @@ -88,7 +88,7 @@

    Module codeflare_sdk.utils.generate_yaml

    def is_openshift_cluster(): try: config_check() - for api in client.ApisApi(api_config_handler()).get_api_versions().groups: + for api in client.ApisApi(get_api_client()).get_api_versions().groups: for v in api.versions: if "route.openshift.io/v1" in v.group_version: return True @@ -266,7 +266,7 @@

    Module codeflare_sdk.utils.generate_yaml

    # If the local queue is set, use it. Otherwise, try to use the default queue. try: config_check() - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) local_queues = api_instance.list_namespaced_custom_object( group="kueue.x-k8s.io", version="v1beta1", @@ -292,7 +292,7 @@

    Module codeflare_sdk.utils.generate_yaml

    # get all local queues in the namespace try: config_check() - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) local_queues = api_instance.list_namespaced_custom_object( group="kueue.x-k8s.io", version="v1beta1", @@ -514,7 +514,7 @@

    Functions

    # If the local queue is set, use it. Otherwise, try to use the default queue. try: config_check() - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) local_queues = api_instance.list_namespaced_custom_object( group="kueue.x-k8s.io", version="v1beta1", @@ -627,7 +627,7 @@

    Functions

    def is_openshift_cluster():
         try:
             config_check()
    -        for api in client.ApisApi(api_config_handler()).get_api_versions().groups:
    +        for api in client.ApisApi(get_api_client()).get_api_versions().groups:
                 for v in api.versions:
                     if "route.openshift.io/v1" in v.group_version:
                         return True
    @@ -650,7 +650,7 @@ 

    Functions

    # get all local queues in the namespace try: config_check() - api_instance = client.CustomObjectsApi(api_config_handler()) + api_instance = client.CustomObjectsApi(get_api_client()) local_queues = api_instance.list_namespaced_custom_object( group="kueue.x-k8s.io", version="v1beta1",