Skip to content

Commit

Permalink
Fix mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
siadat committed Sep 12, 2024
1 parent e0a8bc9 commit 7288c60
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions paasta_tools/vitesscluster_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ class RequestsDict(TypedDict, total=False):

class ResourceConfigDict(TypedDict, total=False):
replicas: int
min_instances: int
max_instances: int
min_instances: Optional[int]
max_instances: Optional[int]
requests: Dict[str, RequestsDict]
limits: Dict[str, RequestsDict]

Expand All @@ -155,6 +155,8 @@ class GatewayConfigDict(TypedDict, total=False):
extraLabels: Dict[str, str]
lifecycle: Dict[str, Dict[str, Dict[str, List[str]]]]
replicas: int
min_instances: int
max_instances: int
resources: Dict[str, Any]
annotations: Mapping[str, Any]

Expand Down Expand Up @@ -858,9 +860,8 @@ def get_update_strategy(self) -> Dict[str, str]:
return {"type": "Immediate"}

def is_vtgate_autoscaling_enabled(self, cell_config) -> bool:
min_instances = self.get_min_instances()
max_instances = self.get_max_instances()
return min_instances and max_instances
return max_instances is not None

def get_desired_scalablevtgate_cr(
self,
Expand Down Expand Up @@ -904,7 +905,7 @@ def get_autoscaling_target(self, name: str) -> V2beta2CrossVersionObjectReferenc
name=name,
)

def get_autoscaling_metric_spec(
def get_desired_hpa_spec(
self,
name: str,
cluster: str,
Expand Down Expand Up @@ -1007,7 +1008,7 @@ def reconcile_vtgate_hpa(
)

if should_exist:
hpa = self.get_autoscaling_metric_spec(
hpa = self.get_desired_hpa_spec(
name=name,
cluster=self.get_cluster(),
kube_client=kube_client,
Expand Down

0 comments on commit 7288c60

Please sign in to comment.