Made changes to assume iptables-nft as the default backend for iptables, and provisioned for changing to legacy mode if required

This commit is contained in:
Raj Chaudhuri committed 2024-12-22 18:56:07 +05:30
1 parent 9057156d28
commit 999aeb7d0b
4 files changed
+61 -14

No files matched your search

+21
View File
@@ -2,6 +2,27 @@
All changes made to the weave net codebase since the fork will be documented in this file.
## 2.9.0-beta1
From this version onwards, we will assume that the default backend for `iptables` is `iptables-nft`. For backward compatibility, we will include `iptables-legacy` in the weave images, and provide a way to use that if required.
### Changed
* Upgraded golang.org/x/crypto to v0.31.1
* Upgraded golang.org/x/net to v0.33.0
* Which upgraded:
golang.org/x/mod v0.17.0
golang.org/x/sync v0.10.0
golang.org/x/term v0.27.0
golang.org/x/text v0.21.0
* Ran `go mod tidy` and `go mod vendor`
### Added
* The Dockerfile was modified to keep the default iptables backend (nft) for all Alpine-based images, and to include the legacy backend but not set it as default.
* The `weave` script was modified to accept and propogate a new environment variable called `IPTABLES_BACKEND`, whose default value is `nft`. If its value is set to `legacy`, the script will use the command `iptables-legacy` instead of `iptables` when invoking that tool.
* The `launch.sh` script, which is the entry point for the `weave-kube` and `weave-npc` images, was modified to assume the `nft` backend as default, and to change the backend only if legacy mode was autodiscovered or set via the existing environment variable `IPTABLES_BACKEND`.
## 2.8.10
### Changed
+13 -9
View File
@@ -86,7 +86,7 @@ EOMAKE
# Stage 3: Alpine Base
# This stage exists in case there are any additional tweaks
# required in the alpine base image.
FROM --platform=linux/${TARGETARCH} ${ALPINE_BASEIMAGE} as alpinebase
FROM --platform=linux/${TARGETARCH} ${ALPINE_BASEIMAGE} AS alpinebase
# Any additional tweaks will appear here
# Last update on top of alpine:3.19.1
RUN apk update \
@@ -124,11 +124,13 @@ RUN <<EOWEAVER
bind-tools \
ca-certificates
# Alpine 3.19 made nftables the default backend for iptables
# For backward compatibility, the following is required:
# From weave version 2.9.0 onwards, weave will also assume
# the same, but will include iptables-legacy for backward
# compatibility.
apk add iptables-legacy
ln -sf /sbin/iptables-legacy /sbin/iptables
ln -sf /sbin/iptables-legacy-save /sbin/iptables-save
ln -sf /sbin/iptables-legacy-restore /sbin/iptables-restore
# ln -sf /sbin/iptables-legacy /sbin/iptables
# ln -sf /sbin/iptables-legacy-save /sbin/iptables-save
# ln -sf /sbin/iptables-legacy-restore /sbin/iptables-restore
rm -rf /var/cache/apk/*
EOWEAVER
@@ -218,11 +220,13 @@ RUN <<EONPC
mknod /var/log/ulogd.pcap p
# Alpine 3.19 made nftables the default backend for iptables
# For backward compatibility, the following is required:
# From weave version 2.9.0 onwards, weave will also assume
# the same, but will include iptables-legacy for backward
# compatibility.
apk add iptables-legacy
ln -sf /sbin/iptables-legacy /sbin/iptables
ln -sf /sbin/iptables-legacy-save /sbin/iptables-save
ln -sf /sbin/iptables-legacy-restore /sbin/iptables-restore
# ln -sf /sbin/iptables-legacy /sbin/iptables
# ln -sf /sbin/iptables-legacy-save /sbin/iptables-save
# ln -sf /sbin/iptables-legacy-restore /sbin/iptables-restore
rm -rf /var/cache/apk/*
EONPC