Skip to content

Commit

Permalink
Added counter for IMDS out of sync
Browse files Browse the repository at this point in the history
Fixed merge conflict
  • Loading branch information
jayanthvn committed Apr 8, 2021
1 parent 83af18e commit 9a2c6d9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/awsutils/awsutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,11 @@ func (cache *EC2InstanceMetadataCache) RefreshSGIDs(mac string) error {
_, err = cache.ec2SVC.ModifyNetworkInterfaceAttributeWithContext(context.Background(), attributeInput)
awsAPILatency.WithLabelValues("ModifyNetworkInterfaceAttribute", fmt.Sprint(err != nil), awsReqStatus(err)).Observe(msSince(start))
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
if aerr.Code() == "InvalidNetworkInterfaceID.NotFound" {
awsAPIErrInc("IMDSMetaDataOutOfSync", err)
}
}
awsAPIErrInc("ModifyNetworkInterfaceAttribute", err)
//No need to return error here since retry will happen in 30seconds and also
//If update failed due to stale ENI then returning error will prevent updating SG
Expand Down

0 comments on commit 9a2c6d9

Please sign in to comment.