refactor: extract K8s logic into ContainerK8s library target - #2079
Open
jshi991 wants to merge 3 commits into
Open
refactor: extract K8s logic into ContainerK8s library target#2079jshi991 wants to merge 3 commits into
jshi991 wants to merge 3 commits into
Conversation
jshi991
force-pushed
the
k8s-plugin-refactor
branch
from
August 6, 2026 18:44
60bd997 to
6c30a15
Compare
jglogan
requested changes
Aug 6, 2026
| ctr -n k8s.io images tag registry.k8s.io/pause:3.10 registry.k8s.io/pause:3.10.1 2>/dev/null || true | ||
| iptables -t mangle -A OUTPUT -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1220 | ||
| iptables -t mangle -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1220 | ||
| /usr/sbin/iptables-nft -t mangle -A OUTPUT -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1220 2>/dev/null || true |
Contributor
There was a problem hiding this comment.
Why dump the diagnostic output to /dev/null? I think we'd want to see that.
Why don't we let the command just fail if it doesn't work, instead of ignoring failure?
Contributor
Author
There was a problem hiding this comment.
yup ill fail and log
egernst
reviewed
Aug 6, 2026
| ctr -n k8s.io images tag registry.k8s.io/pause:3.10 registry.k8s.io/pause:3.10.1 2>/dev/null || true | ||
| iptables -t mangle -A OUTPUT -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1220 | ||
| iptables -t mangle -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1220 | ||
| /usr/sbin/iptables-nft -t mangle -A OUTPUT -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1220 2>/dev/null || true |
Contributor
There was a problem hiding this comment.
since this is different than the rest of the commit, you mind just adding this one as its own commit and describe the rationale on it?
Contributor
Author
There was a problem hiding this comment.
yup I can do that do you want this to be left with just the two commits
Contributor
There was a problem hiding this comment.
@jshi991 Yes. Ideally three commits:
- Library extraction
- nftables
- test optimization (see https://github.com/apple/container/blob/main/Tests/IntegrationTests/Images/TestCLIImagePruneSerial.swift#L62 for restoreWarmupImage example)
jshi991
force-pushed
the
k8s-plugin-refactor
branch
from
August 7, 2026 02:17
b2486e0 to
ae55815
Compare
Code Coverage
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2078
Move all K8s sources from the container-k8s executable into a new ContainerK8s library target. Sources/Plugins/K8s/ becomes a thin entry point (K8sMain.swift) that calls K8sCommand.main().
Also make iptables MSS clamping non-fatal: if xt_TCPMSS is unavailable in the VM kernel the node prep no longer aborts; a warning is logged instead.