From 88d30f940d8e71d620823014980f4db8c4a354a8 Mon Sep 17 00:00:00 2001 From: Brad Davidson Date: Mon, 4 Mar 2024 18:45:43 +0000 Subject: [PATCH] Use and version flannel/cni-plugin properly Moves us closer to using the proper upstream for our flannel CNI plugin, instead of the snapshot that is vendored into our plugins fork. Signed-off-by: Brad Davidson --- scripts/build | 7 +++++-- scripts/version.sh | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/build b/scripts/build index 2a6390295f..f440316778 100755 --- a/scripts/build +++ b/scripts/build @@ -41,7 +41,7 @@ VERSIONFLAGS=" -X ${PKG_CNI_PLUGINS}/pkg/utils/buildversion.BuildVersion=${VERSION_CNIPLUGINS} -X ${PKG_CNI_PLUGINS}/plugins/meta/flannel.Program=flannel - -X ${PKG_CNI_PLUGINS}/plugins/meta/flannel.Version=${VERSION_FLANNEL} + -X ${PKG_CNI_PLUGINS}/plugins/meta/flannel.Version=${VERSION_FLANNEL_PLUGIN} -X ${PKG_CNI_PLUGINS}/plugins/meta/flannel.Commit=HEAD -X ${PKG_CNI_PLUGINS}/plugins/meta/flannel.buildDate=${buildDate} @@ -149,8 +149,11 @@ if [ ! -x ${INSTALLBIN}/cni${BINARY_POSTFIX} ]; then TMPDIR=$(mktemp -d) trap cleanup EXIT WORKDIR=$TMPDIR/src/github.com/containernetworking/plugins - git clone -b $VERSION_CNIPLUGINS https://github.com/rancher/plugins.git $WORKDIR + git clone --single-branch --depth=1 --branch=$VERSION_CNIPLUGINS https://github.com/rancher/plugins.git $WORKDIR cd $WORKDIR + rm -rf plugins/meta/flannel + git clone --single-branch --depth=1 --branch=$VERSION_FLANNEL_PLUGIN https://github.com/flannel-io/cni-plugin.git plugins/meta/flannel + sed -i 's/package main/package flannel/; s/func main/func Main/' plugins/meta/flannel/*.go GO111MODULE=off GOPATH=$TMPDIR CGO_ENABLED=0 "${GO}" build -tags "$TAGS" -gcflags="all=${GCFLAGS}" -ldflags "$VERSIONFLAGS $LDFLAGS $STATIC" -o $INSTALLBIN/cni${BINARY_POSTFIX} ) fi diff --git a/scripts/version.sh b/scripts/version.sh index a67f0d5607..986603e835 100755 --- a/scripts/version.sh +++ b/scripts/version.sh @@ -69,6 +69,7 @@ if [ -z "$VERSION_CRI_DOCKERD" ]; then fi VERSION_CNIPLUGINS="v1.4.0-k3s2" +VERSION_FLANNEL_PLUGIN="v1.4.0-flannel1" VERSION_KUBE_ROUTER=$(get-module-version github.com/cloudnativelabs/kube-router/v2) if [ -z "$VERSION_KUBE_ROUTER" ]; then