Skip to content

Support annotations errors#2

Open
margori wants to merge 7 commits into
dignajar:masterfrom
margori:annotations-errors
Open

Support annotations errors#2
margori wants to merge 7 commits into
dignajar:masterfrom
margori:annotations-errors

Conversation

@margori

@margori margori commented Apr 19, 2022

Copy link
Copy Markdown
Contributor

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

Comment thread files/aautoscaler.py Outdated
@margori

margori commented Apr 20, 2022

Copy link
Copy Markdown
Contributor Author

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

Comment thread files/aautoscaler.py
# start-replicas
startReplicas = 1
startReplicasAnnotation = 'another-autoscaler/start-replicas'
if startReplicasAnnotation not in deployAnnotations:

Copy link
Copy Markdown

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.

Comment thread files/aautoscaler.py
# stop-replicas
stopReplicas = 0
stopReplicasAnnotation = 'another-autoscaler/stop-replicas'
if stopReplicasAnnotation not in deployAnnotations:

Copy link
Copy Markdown

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