Skip to content

Commit d1df3a6

Browse files
authored
Merge pull request #4634 from k0sproject/backport-4612-to-release-1.29
[Backport release-1.29] Skip k0s VIP and calico CNI interfaces in address detection
2 parents 1ca9907 + be3e1b6 commit d1df3a6

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

internal/pkg/iface/iface.go

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package iface
1919
import (
2020
"fmt"
2121
"net"
22+
"strings"
2223

2324
"github.com/sirupsen/logrus"
2425
)
@@ -64,8 +65,21 @@ func FirstPublicAddress() (string, error) {
6465
}
6566
ipv6addr := ""
6667
for _, i := range ifs {
67-
if i.Name == "vxlan.calico" || i.Name == "kube-bridge" {
68-
// Skip calico and kube-router interfaces
68+
switch {
69+
// Skip calico CNI interface
70+
case i.Name == "vxlan.calico":
71+
continue
72+
// Skip kube-router CNI interface
73+
case i.Name == "kube-bridge":
74+
continue
75+
// Skip k0s CPLB interface
76+
case i.Name == "dummyvip0":
77+
continue
78+
// Skip kube-router pod CNI interfaces
79+
case strings.HasPrefix(i.Name, "veth"):
80+
continue
81+
// Skip calico pod CNI interfaces
82+
case strings.HasPrefix(i.Name, "cali"):
6983
continue
7084
}
7185
addresses, err := i.Addrs()

0 commit comments

Comments
 (0)