worker: fix crash if no autoscale instance is defined
The worker assumes that when running on AWS an autoscale is defined. If not defined, the worker crashes
This commit is contained in:
parent
d176df2ca5
commit
07c1f3b2f8
1 changed files with 4 additions and 0 deletions
|
|
@ -128,6 +128,10 @@ func setProtection(protected bool) {
|
|||
}
|
||||
return
|
||||
}
|
||||
if len(asInstanceOutput.AutoScalingInstances) == 0 {
|
||||
logrus.Info("No Autoscaling instace is defined")
|
||||
return
|
||||
}
|
||||
|
||||
// make the request to protect (or unprotect) the instance
|
||||
input := &autoscaling.SetInstanceProtectionInput{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue