Skip to content

Commit f2170bc

Browse files
committed
kube-proxy: log but don't exit if ipv4 or ipv6 is not available
1 parent 091f87c commit f2170bc

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

cmd/kube-proxy/app/server_linux.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,17 @@ func (s *ProxyServer) platformCheckSupported(ctx context.Context) (ipv4Supported
9090

9191
if isIPTablesBased(s.Config.Mode) {
9292
// Check for the iptables and ip6tables binaries.
93-
var ipts map[v1.IPFamily]utiliptables.Interface
94-
ipts, err = utiliptables.NewDualStack()
93+
ipts, errDS := utiliptables.NewDualStack()
9594

9695
ipv4Supported = ipts[v1.IPv4Protocol] != nil
9796
ipv6Supported = ipts[v1.IPv6Protocol] != nil
9897

9998
if !ipv4Supported && !ipv6Supported {
100-
err = fmt.Errorf("iptables is not available on this host : %w", err)
99+
err = fmt.Errorf("iptables is not available on this host : %w", errDS)
101100
} else if !ipv4Supported {
102-
logger.Info("No iptables support for family", "ipFamily", v1.IPv4Protocol, "error", err)
101+
logger.Info("No iptables support for family", "ipFamily", v1.IPv4Protocol, "error", errDS)
103102
} else if !ipv6Supported {
104-
logger.Info("No iptables support for family", "ipFamily", v1.IPv6Protocol, "error", err)
103+
logger.Info("No iptables support for family", "ipFamily", v1.IPv6Protocol, "error", errDS)
105104
}
106105
} else {
107106
// The nft CLI always supports both families.

0 commit comments

Comments
 (0)