Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix duplicate log for tunnel interface decision #1823

Merged
merged 1 commit into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion pkg/daemon/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import (

// Configuration is the daemon conf
type Configuration struct {
// interface being used for tunnel
tunnelIface string
Iface string
DPDKTunnelIface string
MTU int
Expand Down Expand Up @@ -205,7 +207,10 @@ func (config *Configuration) initNicConfig(nicBridgeMappings map[string]string)
if len(encapIP) == 0 {
return fmt.Errorf("iface %s has no valid IP address", tunnelNic)
}

klog.Infof("use %s as tunnel interface", iface.Name)
mtu = iface.MTU
config.tunnelIface = iface.Name
}

encapIsIPv6 := util.CheckProtocol(encapIP) == kubeovnv1.ProtocolIPv6
Expand Down Expand Up @@ -278,7 +283,6 @@ func findInterface(ifaceStr string) (*net.Interface, error) {
}
for _, iface := range ifaces {
if ifaceRegex.MatchString(iface.Name) {
klog.Infof("use %s as tunnel interface", iface.Name)
return &iface, nil
}
}
Expand Down
4 changes: 4 additions & 0 deletions pkg/daemon/controller_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,10 @@ func (c *Controller) loopEncapIpCheck() {
klog.Errorf("iface %s has no ip address", nodeTunnelName)
return
}
if iface.Name != c.config.tunnelIface {
klog.Infof("use %s as tunnel interface", iface.Name)
c.config.tunnelIface = iface.Name
}

// if assigned iface in node annotation is down or with no ip, the error msg should be printed periodically
if c.config.Iface == nodeTunnelName {
Expand Down