Skip to content

Commit

Permalink
Added check to not check br_filter in case of windows
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Bonafiglia <[email protected]>
  • Loading branch information
rbrtbnfgl committed Nov 7, 2024
1 parent e843ffb commit 6242bc8
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"net/http"
"os"
"os/signal"
"runtime"
"strconv"
"strings"
"sync"
Expand Down Expand Up @@ -261,17 +262,19 @@ func main() {
os.Exit(1)
}

// From Kubernetes 1.30 kubeadm doesn't check if the br_netfilter module is loaded and in case it's missing Flannel wrongly starts
if config.EnableIPv4 {
if _, err = os.Stat("/proc/sys/net/bridge/bridge-nf-call-iptables"); os.IsNotExist(err) {
log.Error("Failed to check br_netfilter: ", err)
os.Exit(1)
if runtime.GOOS != "windows" {
// From Kubernetes 1.30 kubeadm doesn't check if the br_netfilter module is loaded and in case it's missing Flannel wrongly starts
if config.EnableIPv4 {
if _, err = os.Stat("/proc/sys/net/bridge/bridge-nf-call-iptables"); os.IsNotExist(err) {
log.Error("Failed to check br_netfilter: ", err)
os.Exit(1)
}
}
}
if config.EnableIPv6 {
if _, err = os.Stat("/proc/sys/net/bridge/bridge-nf-call-ip6tables"); os.IsNotExist(err) {
log.Error("Failed to check br_netfilter: ", err)
os.Exit(1)
if config.EnableIPv6 {
if _, err = os.Stat("/proc/sys/net/bridge/bridge-nf-call-ip6tables"); os.IsNotExist(err) {
log.Error("Failed to check br_netfilter: ", err)
os.Exit(1)
}
}
}

Expand Down

0 comments on commit 6242bc8

Please sign in to comment.