From 6d796ab20232bdea4087f7c67a644cf824eddaf4 Mon Sep 17 00:00:00 2001 From: bpopovschi Date: Fri, 24 May 2019 16:46:53 +0300 Subject: [PATCH] Added error handling for GetENIipLimit in AllocIPAddresses func --- pkg/awsutils/awsutils.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 }