Skip to content

Commit

Permalink
Merge pull request caas-team#91 from viktorhaid/main
Browse files Browse the repository at this point in the history
Fix KEDA ScaledObject KeyError on upscaling
  • Loading branch information
samuel-esp authored Aug 23, 2024
2 parents fde7266 + cd275ab commit c3dd270
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kube_downscaler/scaler.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,8 @@ def scale_up(
f"Scaling up {resource.kind} {resource.namespace}/{resource.name} from {replicas} to {original_replicas} replicas (uptime: {uptime}, downtime: {downtime})"
)
elif resource.kind == "ScaledObject":
if ScaledObject.keda_pause_annotation in resource.annotations:
if resource.annotations[ScaledObject.keda_pause_annotation] is not None:
if ScaledObject.last_keda_pause_annotation_if_present in resource.annotations:
if resource.annotations[ScaledObject.last_keda_pause_annotation_if_present] is not None:
paused_replicas = resource.annotations[ScaledObject.last_keda_pause_annotation_if_present]
resource.annotations[ScaledObject.keda_pause_annotation] = paused_replicas
resource.annotations[ScaledObject.last_keda_pause_annotation_if_present] = None
Expand Down

0 comments on commit c3dd270

Please sign in to comment.