Skip to content

Commit

Permalink
fix eksmanager create_client calls
Browse files Browse the repository at this point in the history
  • Loading branch information
morga471 committed Oct 14, 2025
1 parent c184c34 commit ad7ee05
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def scale_down(self, clusters: List[Dict[str, Any]], dry_run: bool = False) -> N

try:
region = cluster["region"]
eks_client = self.create_client("eks", region)
eks_client = self.get_client("eks")

# Get current scaling parameters from tags or nodegroups
min_nodes = cluster.get("min_nodes", "")
Expand Down Expand Up @@ -251,7 +251,7 @@ def scale_up(self, clusters: List[Dict[str, Any]], dry_run: bool = False) -> Non

try:
region = cluster["region"]
eks_client = self.create_client("eks", region)
eks_client = self.get_client("eks")

# Check for original values in backup tags
original_min = cluster.get("original_min", "")
Expand Down Expand Up @@ -557,7 +557,8 @@ def discover_clusters(self, regions: List[str]) -> List[Dict[str, Any]]:

for region in regions:
try:
eks_client = self.create_client("eks", region)
self.region = region # Set region context for get_client
eks_client = self.get_client("eks")
if not eks_client:
logger.warning(f"Could not create EKS client in {region}")
continue
Expand Down Expand Up @@ -660,7 +661,8 @@ def _get_kubeconfig(self, cluster_name: str, region: str, account_id: str) -> st
Returns path to the kubeconfig file.
"""
eks = self.create_client("eks", region)
self.region = region # Set region context for get_client
eks = self.get_client("eks")
cluster_info = eks.describe_cluster(name=cluster_name)["cluster"]
# Use awscli to get token (assumes awscli is configured for this account)
token = self._get_eks_token(cluster_name, region)
Expand Down

0 comments on commit ad7ee05

Please sign in to comment.