Skip to content

Commit

Permalink
Added error handling for GetENIipLimit in AllocIPAddresses func
Browse files Browse the repository at this point in the history
  • Loading branch information
Zyqsempai authored and tiffanyfay committed May 29, 2019
1 parent 73ba53b commit 8f9d1c2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/awsutils/awsutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,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
}

Expand Down

0 comments on commit 8f9d1c2

Please sign in to comment.