Skip to content

Commit

Permalink
fix: get workload type with utils func and remove daemonset
Browse files Browse the repository at this point in the history
  • Loading branch information
liquidiert committed Dec 19, 2024
1 parent de522ce commit 2489812
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions client/gefyra/api/bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from gefyra.types import GefyraBridge


from .utils import stopwatch, wrap_bridge
from .utils import get_workload_type, stopwatch, wrap_bridge

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -67,14 +67,11 @@ def check_workloads(
# Validate workload and probes
api = config.K8S_APP_API
try:
if workload_type == "deployment":
reconstructed_workload_type = get_workload_type(workload_type)
if reconstructed_workload_type == "deployment":
workload = api.read_namespaced_deployment(workload_name, namespace)
elif workload_type == "statefulset":
elif reconstructed_workload_type == "statefulset":
workload = api.read_namespaced_stateful_set(workload_name, namespace)
elif workload_type == "daemonset":
workload = api.read_namespaced_daemon_set(workload_name, namespace)
else:
raise RuntimeError(f"Unsupported workload type: {workload_type}")
except ApiException as e:
raise RuntimeError(
f"Error fetching workload {workload_type}/{workload_name}: {e}"
Expand Down

0 comments on commit 2489812

Please sign in to comment.