Skip to content

Commit

Permalink
Add additional logging for outpost arn handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ayberk committed Apr 23, 2021
1 parent aa4427a commit 24e4302
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 24e4302

Please sign in to comment.