diff --git a/pkg/awsutils/awsutils.go b/pkg/awsutils/awsutils.go index b10ce12b23..708cce7682 100644 --- a/pkg/awsutils/awsutils.go +++ b/pkg/awsutils/awsutils.go @@ -870,7 +870,12 @@ func (cache *EC2InstanceMetadataCache) AllocIPAddresses(eniID string, numIPs int var needIPs = numIPs ipLimit, err := cache.GetENIipLimit() - if err == nil && ipLimit < needIPs { + if err != nil { + awsUtilsErrInc("UnknownInstanceType", err) + return err + } + + if ipLimit < needIPs { needIPs = ipLimit }