Handle non-nil, empty Instances return refs #20978
authorPeter Amstutz <peter.amstutz@curii.com>
Thu, 9 Nov 2023 18:03:03 +0000 (13:03 -0500)
committerPeter Amstutz <peter.amstutz@curii.com>
Thu, 9 Nov 2023 18:03:03 +0000 (13:03 -0500)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

lib/cloud/ec2/ec2.go

index 0d181be0e9f87212f5f833b35e8e9220476d4815..07a146d99f080ab8a5294626062d47fc22a803f4 100644 (file)
@@ -327,7 +327,7 @@ func (instanceSet *ec2InstanceSet) Create(
                atomic.StoreInt32(&instanceSet.currentSubnetIDIndex, int32(tryIndex))
                break
        }
-       if rsv == nil {
+       if rsv == nil || len(rsv.Instances) == 0 {
                return nil, wrapError(errToReturn, &instanceSet.throttleDelayCreate)
        }
        return &ec2Instance{