Skip to content

Commit

Permalink
Merge pull request #851 from ayberk/master
Browse files Browse the repository at this point in the history
Add additional logging for outpost arn handling
  • Loading branch information
k8s-ci-robot authored Apr 23, 2021
2 parents f1ad3b1 + 24e4302 commit aa83722
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/cloud/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ func NewMetadataService(svc EC2Metadata) (MetadataService, error) {
// it's guaranteed to be in the form `arn:<partition>:outposts:<region>:<account>:outpost/<outpost-id>`
// There's a case to be made here to ignore the error so a failure here wouldn't affect non-outpost calls.
if err != nil && !strings.Contains(err.Error(), "404") {
return nil, fmt.Errorf("something went wrong while getting EC2 outpost arn")
return nil, fmt.Errorf("something went wrong while getting EC2 outpost arn: %s", err.Error())
} else if err == nil {
klog.Infof("Running in an outpost environment with arn: %s", outpostArn)
}

metadata := Metadata{
Expand All @@ -119,6 +121,7 @@ func NewMetadataService(svc EC2Metadata) (MetadataService, error) {
if err != nil {
klog.Warningf("Failed to parse the outpost arn: %s", outpostArn)
} else {
klog.Infof("Using outpost arn: %v", parsedArn)
metadata.OutpostArn = parsedArn
}

Expand Down

0 comments on commit aa83722

Please sign in to comment.