Skip to content

Commit

Permalink
Skip k0s VIP and calico CNI interfaces in address detection
Browse files Browse the repository at this point in the history
Signed-off-by: Jussi Nummelin <[email protected]>
(cherry picked from commit ccc492d)
(cherry picked from commit 804dc1b)
(cherry picked from commit be3e1b6)
(cherry picked from commit 3177fcc)
  • Loading branch information
jnummelin authored and github-actions[bot] committed Jun 18, 2024
1 parent d246f81 commit c5c217e
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions internal/pkg/iface/iface.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package iface
import (
"fmt"
"net"
"strings"

"github.com/sirupsen/logrus"
)
Expand Down Expand Up @@ -64,8 +65,21 @@ func FirstPublicAddress() (string, error) {
}
ipv6addr := ""
for _, i := range ifs {
if i.Name == "vxlan.calico" || i.Name == "kube-bridge" {
// Skip calico and kube-router interfaces
switch {
// Skip calico CNI interface
case i.Name == "vxlan.calico":
continue
// Skip kube-router CNI interface
case i.Name == "kube-bridge":
continue
// Skip k0s CPLB interface
case i.Name == "dummyvip0":
continue
// Skip kube-router pod CNI interfaces
case strings.HasPrefix(i.Name, "veth"):
continue
// Skip calico pod CNI interfaces
case strings.HasPrefix(i.Name, "cali"):
continue
}
addresses, err := i.Addrs()
Expand Down

0 comments on commit c5c217e

Please sign in to comment.