Skip to content

Commit

Permalink
remove hard-coded comment for eth0 (#2706)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdn5126 committed Dec 8, 2023
1 parent 048a66a commit 60efe2e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/awsutils/awsutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ func (cache *EC2InstanceMetadataCache) initWithEC2Metadata(ctx context.Context)
}
log.Debugf("Found availability zone: %s ", cache.availabilityZone)

// retrieve eth0 local-ipv4
// retrieve primary interface local-ipv4
cache.localIPv4, err = cache.imds.GetLocalIPv4(ctx)
if err != nil {
awsAPIErrInc("GetLocalIPv4", err)
Expand Down
3 changes: 1 addition & 2 deletions pkg/networkutils/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,12 @@ func (n *linuxNetwork) SetupHostNetwork(vpcv4CIDRs []string, primaryMAC string,
v4Enabled bool, v6Enabled bool) error {
log.Info("Setting up host network... ")

primaryIntf := "eth0"
link, err := linkByMac(primaryMAC, n.netLink, retryLinkByMacInterval)
if err != nil {
return errors.Wrapf(err, "setupHostNetwork: failed to find the link primary ENI with MAC address %s", primaryMAC)
}
if err = n.netLink.LinkSetMTU(link, n.mtu); err != nil {
return errors.Wrapf(err, "setupHostNetwork: failed to set MTU to %d for %s", n.mtu, primaryIntf)
return errors.Wrapf(err, "setupHostNetwork: failed to set primary interface MTU to %d", n.mtu)
}

ipFamily := unix.AF_INET
Expand Down

0 comments on commit 60efe2e

Please sign in to comment.