G
YouTube TikTok Games
Skip to content

platforms: add Validate utility for OCI platform specifications - #39

Open
thaJeztah wants to merge 3 commits into
containerd:mainfrom
thaJeztah:add_validate
Open

thaJeztah wants to merge 3 commits into
containerd:mainfrom
thaJeztah:add_validate

Conversation

@thaJeztah

@thaJeztah thaJeztah commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

platforms: add Validate utility for OCI platform specifications

Add Validate to check that a platform has non-empty OS and
architecture fields and that its components are well-formed.

Validation follows the existing platform specifier syntax, rejecting
invalid characters and path components such as "." and "..", without
restricting values to known or supported platforms.

This allows callers to validate platform specifications without
formatting, parsing, or normalizing them.

Comment thread platforms.go Resolved
Return only the reason for validation failure from validateSpecifierComponent,
and make callers responsible for including the invalid value and its context.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Add Validate to check that a platform has non-empty OS and
architecture fields and that its components are well-formed.

Validation follows the existing platform specifier syntax, rejecting
invalid characters and path components such as "." and "..", without
restricting values to known or supported platforms.

This allows callers to validate platform specifications without
formatting, parsing, or normalizing them.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

This comment was marked as resolved.

Validate OSVersion and OSFeatures against the existing OS-option
syntax, accounting for escaped characters.

Reject malformed values and empty OS features, and add tests
covering valid and invalid metadata.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues block the addition of direct OCI platform validation.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@thaJeztah
thaJeztah marked this pull request as ready for review November 9, 2026 11:11
@thaJeztah
thaJeztah requested a review from tianon November 9, 2026 11:11
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