Skip to content

Commit

Permalink
Replaced load_kube_config() with config_check()
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobbins228 authored and openshift-merge-robot committed Sep 18, 2023
1 parent 17e62ae commit abec0ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/codeflare_sdk/cluster/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,8 @@ def get_current_namespace(): # pragma: no cover

def get_cluster(cluster_name: str, namespace: str = "default"):
try:
config.load_kube_config()
api_instance = client.CustomObjectsApi()
config_check()
api_instance = client.CustomObjectsApi(api_config_handler())
rcs = api_instance.list_namespaced_custom_object(
group="ray.io",
version="v1alpha1",
Expand All @@ -477,7 +477,7 @@ def get_cluster(cluster_name: str, namespace: str = "default"):
# private methods
def _get_ingress_domain():
try:
config.load_kube_config()
config_check()
api_client = client.CustomObjectsApi(api_config_handler())
ingress = api_client.get_cluster_custom_object(
"config.openshift.io", "v1", "ingresses", "cluster"
Expand Down
4 changes: 2 additions & 2 deletions src/codeflare_sdk/utils/generate_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +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
from ..cluster.auth import api_config_handler, config_check


def read_template(template):
Expand Down Expand Up @@ -268,7 +268,7 @@ def enable_local_interactive(resources, cluster_name, namespace):

command = command.replace("deployment-name", cluster_name)
try:
config.load_kube_config()
config_check()
api_client = client.CustomObjectsApi(api_config_handler())
ingress = api_client.get_cluster_custom_object(
"config.openshift.io", "v1", "ingresses", "cluster"
Expand Down

0 comments on commit abec0ef

Please sign in to comment.