Skip to content

plugins: preserve network device annotation defaults - #332

Closed
git-jxj wants to merge 1 commit into
containerd:mainfrom
git-jxj:fix/network-interface-defaults
Closed

git-jxj wants to merge 1 commit into
containerd:mainfrom
git-jxj:fix/network-interface-defaults

Conversation

@git-jxj

@git-jxj git-jxj commented Oct 20, 2026

Copy link
Copy Markdown

The network device injector discards its default interface name and IP prefix because it updates a copy of each parsed device. Preserve those defaults in the returned slice, and correct the annotation key in the README and sample pod so the example is recognized by the plugin.

Add regression coverage for current and legacy annotation keys, IPv4/IPv6 defaults, explicit values, and the sample pod. Include this plugin's tests in make test.

Validation: make test, plugin tests with -race, go vet, plugin build, plugin golangci-lint, and codespell passed. Root golangci-lint 2.14 reports the existing deprecated LinuxMemory.Kernel field, also reproduced on unmodified upstream. No network interfaces or runtime configuration were changed during validation.

AI assistance was used in preparing this contribution.

Defaulting in parseNetdevices updates a range variable rather than the
returned slice. Keep omitted interface names and address prefixes on the
parsed devices, so injection receives the intended interface name.

Correct the sample's annotation prefix to the one accepted by the plugin
and run its parser regressions as part of make test.

Signed-off-by: xinjun.jiang <xinjun.jiang@daocloud.io>
@samuelkarp samuelkarp closed this Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants