Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion app/controllers/network_routes_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"time"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/ec2metadata"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/ec2"
Expand Down Expand Up @@ -904,10 +905,18 @@ func (nrc *NetworkRoutingController) disableSourceDestinationCheck() {
},
)
if err != nil {
glog.Errorf("Failed to disable source destination check due to: " + err.Error())
awserr := err.(awserr.Error)
if awserr.Code() == "UnauthorizedOperation" {
glog.Errorf("Node does not have necessary IAM creds to modify instance attribute. So skipping disabling src-dst check.")
return
}
glog.Errorf("Failed to disable source destination check due to: %v", err.Error())
} else {
glog.Infof("Disabled source destination check for the instance: " + instanceID)
}

// to prevent EC2 rejecting API call due to API throttling give a delay between the calls
time.Sleep(100 * time.Millisecond)
}
}

Expand Down