Skip to content

fix: allow storing additional network info in network-config.json #4385

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

haytok
Copy link
Contributor

@haytok haytok commented Jun 27, 2025

Details are described in commits.

@AkihiroSuda AkihiroSuda added this to the v2.1.3 milestone Jun 27, 2025
@@ -55,26 +55,30 @@ func New(dataStore, namespace, containerID string) (ns *NetworkStore, err error)
}, nil
}

type NetworkConfig struct {
PortMappings []cni.PortMapping
Copy link
Member

Choose a reason for hiding this comment

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

Should have json tag?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, sorry, I'll add json tag.

When we specify the `-p` option with `nerdctl run`, etc., the port mapping
information is stored in the following `network-config.json`.

```
<DATAROOT>/<ADDRHASH>/containers/<NAMESPACE>/<CID>/network-config.json
```

However, the current implementation can only store port mapping
information and does not have the extensibility to store other
network-related information.

This point was feedback in the following PR.

- containerd#4376

Therefore, this commit updates the `network-config.json` to allow for the
expansion of the information that can be stored.

Signed-off-by: Hayato Kiwata <[email protected]>
@haytok haytok force-pushed the followup_of_issue_4027 branch from f527009 to 59890cb Compare June 27, 2025 17:47
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.

3 participants