Skip to content

pkg/identifiers: add tests for ValidateDockerCompat - #5088

Open
nikolauspschuetz wants to merge 1 commit into
containerd:mainfrom
nikolauspschuetz:test-identifiers-validatedockercompat
Open

pkg/identifiers: add tests for ValidateDockerCompat#5088
nikolauspschuetz wants to merge 1 commit into
containerd:mainfrom
nikolauspschuetz:test-identifiers-validatedockercompat

Conversation

@nikolauspschuetz

Copy link
Copy Markdown

pkg/identifiers had no tests, even though ValidateDockerCompat validates container, volume, and network names throughout the codebase. This adds table-driven coverage: the accepted charset (alphanumeric plus _.-), the Docker-compatible two-character minimum, rejection of leading separators and invalid characters, and the empty-string case. Each error case also asserts the wrapped errdefs.ErrInvalidArgument.

Test-only, no behavior change.

@nikolauspschuetz
nikolauspschuetz force-pushed the test-identifiers-validatedockercompat branch from 4bb3102 to 659e6c2 Compare July 20, 2026 21:46
pkg/identifiers had no test coverage, though ValidateDockerCompat gates
container, volume, and network names across the codebase. Add table-driven
tests for the accepted charset, the Docker-compatible two-character minimum,
leading-separator and invalid-character rejection, and the empty case,
asserting both the message and the wrapped errdefs.ErrInvalidArgument.

Signed-off-by: Nikolaus Schuetz <nikolauspschuetz@gmail.com>
@nikolauspschuetz
nikolauspschuetz force-pushed the test-identifiers-validatedockercompat branch from 659e6c2 to f558bab Compare July 21, 2026 14:36
@nikolauspschuetz
nikolauspschuetz marked this pull request as ready for review July 22, 2026 21:46
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.

1 participant