From b46c77461d9c0382573d2db89fd9d7eec8d7bbf6 Mon Sep 17 00:00:00 2001 From: Raj Chaudhuri Date: Mon, 18 Mar 2024 09:07:38 +0530 Subject: [PATCH] Updated CNI conflist file content, and ensured correct version stamping --- reweave/CHANGELOG.md | 19 ++++++++++++++++++- reweave/Makefile | 2 +- reweave/build/Makefile | 12 +++++++++++- reweave/tools/build-images.sh | 3 ++- weave | 2 +- 5 files changed, 33 insertions(+), 5 deletions(-) diff --git a/reweave/CHANGELOG.md b/reweave/CHANGELOG.md index 852a539e..0b6a9333 100644 --- a/reweave/CHANGELOG.md +++ b/reweave/CHANGELOG.md @@ -2,7 +2,24 @@ All changes made to the weave net codebase during the reweave effort will be documented in this file. -## 2.8.3 +## latest + +### Changed + +* Changed the CNI version configured in the `weave` script to `1.0.0`, as per [this](https://www.cni.dev/docs/spec/#configuration-format) +* Ensured that the weave version gets added to `weaveutil` via linker flag + +## 2.8.4-beta1 (bcab10a4) + +### Changed +* Added tracing The `launch.sh` and `init.sh` scripts if the WEAVE_DEBUG environment variable is set. +* When publishing images, the `:latest` tag is also applied. It will not be applied any more if the tag includes "-beta" anywhere. + +### Fixed + +* The Alpine Linux base image had been upgraded to 3.19.1. In this version, the default iptables backend is nftables, and the legacy backend is not included by default. Our scripts and programs assume legacy as the default backend, and change to nft if autodetected, or if we ask for it. So, changed our build script to install the Alpine `iptables-legacy` package, and changed the symbolic links to point to the legacy backend by default. + +## 2.8.3 (d0878790) ### Changed diff --git a/reweave/Makefile b/reweave/Makefile index cf0db554..f5d751f5 100644 --- a/reweave/Makefile +++ b/reweave/Makefile @@ -1,4 +1,4 @@ -IMAGE_VERSION ?= 2.8.4-beta1 +IMAGE_VERSION ?= 2.8.4-beta2 REGISTRY_USER ?= rajchaudhuri ALPINE_BASEIMAGE ?= alpine:3.19.1 diff --git a/reweave/build/Makefile b/reweave/build/Makefile index 9b0ddf11..89d16e84 100644 --- a/reweave/build/Makefile +++ b/reweave/build/Makefile @@ -68,6 +68,13 @@ EXES=$(WEAVER_EXE) $(SIGPROXY_EXE) $(KUBEUTILS_EXE) $(WEAVENPC_EXE) $(WEAVEWAIT_ # -tags "osusergo netgo" to use native Go UID and DNS implementations BUILD_FLAGS=-ldflags "-extldflags -static -X main.version=$(WEAVE_VERSION) -s -w" -tags "osusergo netgo" +# This allows adding up to three extra switches to the -ldflags value inside +# the same string returned by BUILD_FLAGS. Needed because the go # tool does +# not combine multiple -ldflags +define extraldflags +-ldflags "-extldflags -static -X main.version=$(WEAVE_VERSION) $(strip $(1) $(2) $(3)) -s -w" -tags "osusergo netgo" +endef + # Targets all: showbuild exes @@ -97,7 +104,10 @@ exes: $(EXES) $(WEAVER_EXE): CC=$(CC) GOOS=linux GOARCH=$(ARCH) go build $(BUILD_FLAGS) -o $@ ./$(@D) -$(WEAVEUTIL_EXE) $(KUBEUTILS_EXE) $(WEAVENPC_EXE) $(NETWORKTESTER_EXE): +$(WEAVEUTIL_EXE): + CC=$(CC) GOOS=linux GOARCH=$(ARCH) go build $(call extraldflags,-X github.com/containernetworking/plugins/pkg/utils/buildversion.BuildVersion=$(WEAVE_VERSION)) -o $@ ./$(@D) + +$(KUBEUTILS_EXE) $(WEAVENPC_EXE) $(NETWORKTESTER_EXE): CC=$(CC) GOOS=linux GOARCH=$(ARCH) go build $(BUILD_FLAGS) -o $@ ./$(@D) $(WEAVEWAIT_EXE): diff --git a/reweave/tools/build-images.sh b/reweave/tools/build-images.sh index aba12a57..146a648d 100755 --- a/reweave/tools/build-images.sh +++ b/reweave/tools/build-images.sh @@ -14,7 +14,7 @@ fi # These variables are used to control the build process # Change with care. : "${ALPINE_BASEIMAGE:=alpine:3.19.1}" -: "${WEAVE_VERSION=git-$(git rev-parse --short=12 HEAD)}" +: "${WEAVE_VERSION=${IMAGE_VERSION}}" : "${GIT_REVISION=$(git rev-parse HEAD)}" : "${PLATFORMS:=linux/amd64,linux/arm,linux/arm64,linux/ppc64le,linux/s390x}" : "${PUBLISH:=}" @@ -59,6 +59,7 @@ build_image() { # shellcheck disable=SC2086 docker buildx build \ ${POSTBUILD} \ + --progress=plain \ --platform=${PLATFORMS} \ --target="$1" \ --build-arg=ALPINE_BASEIMAGE=${ALPINE_BASEIMAGE} \ diff --git a/weave b/weave index c81d02d9..8ffffb58 100755 --- a/weave +++ b/weave @@ -735,7 +735,7 @@ upgrade_cni_plugin() { create_cni_config() { cat >"$1" <