Skip to content

Commit

Permalink
getting imds error.
Browse files Browse the repository at this point in the history
  • Loading branch information
orsenthil committed Nov 28, 2024
1 parent 7154da4 commit 13cd8b3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/awsutils/imds.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,16 @@ func (typedimds TypedIMDS) GetLocalIPv4s(ctx context.Context, mac string) ([]net
func (typedimds TypedIMDS) GetIPv4Prefixes(ctx context.Context, mac string) ([]net.IPNet, error) {
key := fmt.Sprintf("network/interfaces/macs/%s/ipv4-prefix", mac)
prefixes, err := typedimds.getCIDRs(ctx, key)
var oe *smithy.OperationError
oe = new(smithy.OperationError)

if err != nil {
if errors.As(err, &oe) {
if IsNotFound(oe) {
return nil, nil
}
}

if imdsErr, ok := err.(*imdsRequestError); ok {
if IsNotFound(imdsErr.err) {
return nil, nil
Expand Down

0 comments on commit 13cd8b3

Please sign in to comment.