From 2d841a384feb482b28a6415e00bdb4df593ec964 Mon Sep 17 00:00:00 2001 From: Bobbins228 Date: Tue, 1 Aug 2023 11:32:20 +0100 Subject: [PATCH] Fixed ingress domain methods --- src/codeflare_sdk/cluster/cluster.py | 2 +- src/codeflare_sdk/utils/generate_yaml.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/codeflare_sdk/cluster/cluster.py b/src/codeflare_sdk/cluster/cluster.py index ff92bfcf0..a1afc1580 100644 --- a/src/codeflare_sdk/cluster/cluster.py +++ b/src/codeflare_sdk/cluster/cluster.py @@ -429,7 +429,7 @@ def get_cluster(cluster_name: str, namespace: str = "default"): def _get_ingress_domain(): try: config.load_kube_config() - api_client = client.CustomObjectsApi() + api_client = client.CustomObjectsApi(api_config_handler()) ingress = api_client.get_cluster_custom_object( "config.openshift.io", "v1", "ingresses", "cluster" ) diff --git a/src/codeflare_sdk/utils/generate_yaml.py b/src/codeflare_sdk/utils/generate_yaml.py index c4361abae..6592001eb 100755 --- a/src/codeflare_sdk/utils/generate_yaml.py +++ b/src/codeflare_sdk/utils/generate_yaml.py @@ -23,6 +23,7 @@ import uuid from kubernetes import client, config from .kube_api_helpers import _kube_api_error_handling +from ..cluster.auth import api_config_handler def read_template(template): @@ -251,7 +252,7 @@ def enable_local_interactive(resources, cluster_name, namespace): command = command.replace("deployment-name", cluster_name) try: config.load_kube_config() - api_client = client.CustomObjectsApi() + api_client = client.CustomObjectsApi(api_config_handler()) ingress = api_client.get_cluster_custom_object( "config.openshift.io", "v1", "ingresses", "cluster" )