Skip to content

Conversation

@margori
Copy link
Contributor

@margori margori commented Apr 19, 2022

If there is an error in an annotation, service stops completely.

'another-autoscaler/stop-time': '1-59/2 * * *' <- missing last column
'another-autoscaler/stop-replicas': '' <- empty string is not an integer

@margori
Copy link
Contributor Author

margori commented Apr 20, 2022

Refactor implemented. Reduced complexity in methods and added exception catches for wrong annotations inside methods

# start-replicas
startReplicas = 1
startReplicasAnnotation = 'another-autoscaler/start-replicas'
if startReplicasAnnotation not in deployAnnotations:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

startReplicas has a default value 1; if startReplicasAnnotation not in deployAnnotations we should use the default and continue processing, not return.

# stop-replicas
stopReplicas = 0
stopReplicasAnnotation = 'another-autoscaler/stop-replicas'
if stopReplicasAnnotation not in deployAnnotations:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stopReplicas has a default value 0; if stopReplicasAnnotation not in deployAnnotations we should use the default and continue processing, not return.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants