Skip to content

Conversation

@AkihiroSuda
Copy link
Member

@AkihiroSuda AkihiroSuda commented Sep 29, 2025

This commit significantly simplifies the guestagent, by removing the complex and non-robust iptables watcher that had existed solely for sudo nerdctl.

This iptables watcher is no longer needed since nerdctl v2.1.6, as it exposes proper /proc/net entries even for rootful containers.

See:

Fix #4083
Fix #4085
Fix #4094

@AkihiroSuda AkihiroSuda modified the milestones: v2.0.0, v2.1.0 (?) Sep 30, 2025
@AkihiroSuda AkihiroSuda changed the title guestagent: remove iptables watcher for rootful nerdctl (v2.1.6-beta.0) guestagent: remove iptables watcher for rootful nerdctl (v2.1.6) Sep 30, 2025
This commit significantly simplifies the guestagent, by removing
the complex and non-robust iptables watcher that had existed solely for
`sudo nerdctl`.

This iptables watcher is no longer needed since nerdctl v2.1.6,
as it exposes proper `/proc/net` entries even for rootful containers.

See containerd/nerdctl PR 4526.

Fix issue 4085

Signed-off-by: Akihiro Suda <[email protected]>
Copy link
Member

@jandubois jandubois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

I've been running hack/bats/extras/port-monitor.bats with both docker and default templates. The docker test failed once, but succeeded on retries. This is a known issue:

time TEMPLATE=docker ./lib/bats-core/bin/bats -T extras/port-monitor.bats
port-monitor.bats
 ✓ Verify that the container is working [5073]
 ✗ Stop and restart the container multiple times [6497]
   (from function `assert_success' in file lib/bats-assert/src/assert_success.bash, line 45,
    from function `verify_port' in file extras/port-monitor.bats, line 51,
    in test file extras/port-monitor.bats, line 66)
     `verify_port' failed
...

   -- command failed --
   status : 7
   output :
   --

}

func (a *agent) LocalPorts(ctx context.Context) ([]*api.IPPort, error) {
func (a *agent) LocalPorts(_ context.Context) ([]*api.IPPort, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The _ is only needed when you mix named and unnamed parameters.

Suggested change
func (a *agent) LocalPorts(_ context.Context) ([]*api.IPPort, error) {
func (a *agent) LocalPorts(context.Context) ([]*api.IPPort, error) {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linter doesn't allow that

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure?

GOOS=linux golangci-lint run pkg/guestagent/...
0 issues.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC CI failed without that, but I could be wrong

@jandubois jandubois merged commit 386bb5c into lima-vm:master Sep 30, 2025
61 of 63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants