diff --git a/Dockerfile b/Dockerfile index ced0726..c54f887 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,19 +13,13 @@ RUN set -x && \ # Build the multus project FROM base-builder as multus-builder -ARG TAG=v4.0.2 +ARG TAG=v4.1.0 ARG SRC=github.com/k8snetworkplumbingwg/multus-cni ARG PKG=github.com/k8snetworkplumbingwg/multus-cni RUN git clone --depth=1 https://${SRC}.git $GOPATH/src/${PKG} WORKDIR $GOPATH/src/${PKG} -# patch to solve https://github.com/rancher/rke2/issues/4568 -# to be removed once upstream merges the fix -# https://github.com/k8snetworkplumbingwg/multus-cni/pull/1137 -COPY self_delegation_bug.patch /tmp - RUN git fetch --all --tags --prune && \ - git checkout tags/${TAG} -b ${TAG} && \ - git apply /tmp/self_delegation_bug.patch + git checkout tags/${TAG} -b ${TAG} RUN go mod download # cross-compilation setup ARG TARGETARCH diff --git a/Makefile b/Makefile index 9c2aa0c..0b4cd36 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ SRC ?= github.com/k8snetworkplumbingwg/multus-cni TAG ?= ${GITHUB_ACTION_TAG} ifeq ($(TAG),) -TAG := v4.0.2$(BUILD_META) +TAG := v4.1.0$(BUILD_META) endif ifeq (,$(filter %$(BUILD_META),$(TAG))) diff --git a/self_delegation_bug.patch b/self_delegation_bug.patch deleted file mode 100644 index 7e07b13..0000000 --- a/self_delegation_bug.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/cmd/thin_entrypoint/main.go b/cmd/thin_entrypoint/main.go -index ac721518..3f0e835f 100644 ---- a/cmd/thin_entrypoint/main.go -+++ b/cmd/thin_entrypoint/main.go -@@ -23,7 +23,9 @@ import ( - "fmt" - "io" - "os" -+ "path" - "path/filepath" -+ "regexp" - "strings" - "text/template" - "time" -@@ -294,7 +296,20 @@ func (o *Options) createMultusConfig() (string, error) { - return "", fmt.Errorf("cannot find master CNI config in %q: %v", o.MultusAutoconfigDir, err) - } - -- masterConfigPath := files[0] -+ var masterConfigPath string -+ // skip existing multus configuration file to avoid creating a situation -+ // where multus delegates to itself and breaks pod networking -+ multusRegexp, err := regexp.Compile("multus") -+ if err != nil { -+ return "", fmt.Errorf("regexp compilation failed: %v", err) -+ } -+ for _, filename := range files { -+ if !multusRegexp.MatchString(path.Base(filename)) { -+ masterConfigPath = filename -+ break -+ } -+ } -+ - masterConfigBytes, err := os.ReadFile(masterConfigPath) - if err != nil { - return "", fmt.Errorf("cannot read master CNI config file %q: %v", masterConfigPath, err)