← Back to Pull requests

Remove iptables-wrapper from trixie distroless-iptables build #4612

Open
unknown opened this pull request with 456 lines diff across 5 files
View on GitHub
unknown unknown commented on Nov 04, 2026 22:11 UTC
Author

What type of PR is this?


/kind cleanup

What this PR does / why we need it:


k8s 1.38 no longer requires the iptables-wrapper script (https://github.com/kubernetes/kubernetes/pull/143065) so this drops it, simplifying the image.

Older k8s releases still require iptables-wrapper and won't work correctly without it. It seems that we've currently forked into using the trixie build for master/1.38 only, and the bookworm build for older releases (https://github.com/kubernetes/release/pull/4531#discussion_r403358322). So I only changed things for the trixie build and left the bookworm build as it was. Can someone confirm that I understood this correctly, and this is OK (we don't expect to move older releases away from bookworm)? (@cpanato @saschagrunert?)

/assign @BenTheElder @aojea

diff from the current image:

--- /tmp/files.before	2026-11-04 16:11:19.361279376 -0500
+++ /tmp/files.after	2026-11-04 16:43:17.709219613 -0500
@@ -8,0 +9,7 @@
+etc/alternatives/
+etc/alternatives/ip6tables
+etc/alternatives/ip6tables-restore
+etc/alternatives/ip6tables-save
+etc/alternatives/iptables
+etc/alternatives/iptables-restore
+etc/alternatives/iptables-save
@@ -54,4 +60,0 @@
-usr/bin/cat
-usr/bin/chmod
-usr/bin/dash
-usr/bin/grep
@@ -60 +62,0 @@
-usr/bin/ln
@@ -62,4 +63,0 @@
-usr/bin/rm
-usr/bin/sh
-usr/bin/sleep
-usr/bin/wc
@@ -121,2 +118,0 @@
-usr/lib/x86_64-linux-gnu/libpcre2-8.so.0
-usr/lib/x86_64-linux-gnu/libpcre2-8.so.0.11.2
@@ -298 +293,0 @@
-usr/sbin/iptables-wrapper
@@ -308,0 +304,9 @@
+usr/share/base-files/
+usr/share/base-files/dot.bashrc
+usr/share/base-files/dot.profile
+usr/share/base-files/dot.profile.md5sums
+usr/share/base-files/info.dir
+usr/share/base-files/motd
+usr/share/base-files/profile
+usr/share/base-files/profile.md5sums
+usr/share/base-files/staff-group-for-usr-local
@@ -350,2 +353,0 @@
-usr/share/doc/coreutils/
-usr/share/doc/coreutils/copyright
@@ -386,2 +387,0 @@
-usr/share/doc/libpcre2-8-0/
-usr/share/doc/libpcre2-8-0/copyright
@@ -422,0 +423 @@
+usr/share/man/
@@ -1682 +1682,0 @@
-var/lib/dpkg/status.d/coreutils
@@ -1700 +1699,0 @@
-var/lib/dpkg/status.d/libpcre2-8-0

/etc/alternatives/ should have been there before, but there was a bug in iptables-wrapper-installer.sh that made it use the plain symlink install method on Debian rather than using update-alternatives as was intended, so in the old image, /usr/sbin/iptables ended up being a symlink directly to /usr/sbin/iptables-wrapper rather than being a symlink to /etc/alternatives/iptables which was a symlink to /usr/sbin/iptables-wrapper. But anyway, it's just symlinks, so it doesn't hurt anything having it in the image, and it's easier to do it this way than to write the symlinks by hand. (Also, the symlinks don't count as being part of the dpkg, and since we're creating them from the build stage rather than the (almost-)final stage now, we have to explicitly copy them over.)

The addition of /usr/share/base-files/ (and the empty /usr/share/man/ dir) is because we need to do the clean-distroless.sh step in the build stage rather than the (almost-)final stage now since we no longer have things like rm in the latter stage. But that means we're only cleaning out stuff from the debian base, not from the distroless base. We could fix this by rearranging the steps a little, but it seems like the files are small and this doesn't really matter?

Does this PR introduce a user-facing change?


``release-note
The trixie version of distroless-iptables no longer includes the
iptables-wrapper binary.
``

Diff: 456 lines (+342 / -114) across 5 files Reviewer: danwinship Review duration: 8098m
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.46) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 456 lines diff across 5 files
0.46
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
46%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.366
Shallow Review Depth shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #4612"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 46.7% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 45.5% (MEDIUM) · Higher = larger blast radius
45.5%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 46.7% · Lower = rushed or shallow review
46.7%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 24.2% · Safe to merge
24.2%