Skip to content

Conversation

@yankay
Copy link
Contributor

@yankay yankay commented Oct 9, 2025

Description

fix: #4525

This PR addresses a critical regression in the namestore directory creation logic, ensuring that container names are stored in the correct subdirectory structure.

Problem

Starting with v2.0, the namestore directory has been incorrectly created as <DATAROOT>/<ADDRHASH>/<NAMESPACE> (e.g., /var/lib/nerdctl/1935db59/default/foo) instead of the intended <DATAROOT>/<ADDRHASH>/names/<NAMESPACE>. This was caused by commit bf89c08, where the "names" subdirectory was inadvertently omitted from the path.

Breaking Change Warning

This fix introduces a breaking change because existing containers will no longer be recognized in the corrected path. Affected users must:

  • Migrate existing name data to the new path

Due to the breaking fix, this may not be included in a patch release.

@yankay yankay changed the title Fix namestore directory regression: restore 'names' subdirectory in path Fix: namestore directory regression - restore 'names' subdirectory in path Oct 9, 2025
@yankay yankay requested a review from Copilot October 9, 2025 06:49
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a critical regression in the namestore directory creation logic by restoring the missing "names" subdirectory in the path structure. This ensures container names are stored in the correct location as intended.

  • Adds the missing "names" subdirectory to the namestore path construction
  • Introduces comprehensive tests to verify the correct directory path creation
  • Restores the intended directory structure from <DATAROOT>/<ADDRHASH>/<NAMESPACE> to <DATAROOT>/<ADDRHASH>/names/<NAMESPACE>

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pkg/namestore/namestore.go Fixes the path construction by adding "names" subdirectory to filepath.Join call
pkg/namestore/namestore_test.go Adds test coverage for namestore creation with validation of correct directory path

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@AkihiroSuda AkihiroSuda added this to the v2.2.0 (?) milestone Oct 9, 2025
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

Thanks, will merge when approaching the v2.2 release

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.

Regression: <DATAROOT>/<ADDRHASH>/names/<NAMESPACE> is accidentally created as <DATAROOT>/<ADDRHASH>/<NAMESPACE>

2 participants