Skip to content

Match and Compare platforms with OSFeatures#20

Merged
fuweid merged 1 commit intocontainerd:mainfrom
dmcgowan:match-features
Mar 14, 2026
Merged

Match and Compare platforms with OSFeatures#20
fuweid merged 1 commit intocontainerd:mainfrom
dmcgowan:match-features

Conversation

@dmcgowan
Copy link
Member

@dmcgowan dmcgowan commented Nov 16, 2024

Add-on to #16

This allows using the OSFeatures field for matching and comparing. To match, the checked platform's features must be a subset of the matcher's platforms. The matcher platform represents the supported features by the host and the checked platforms the platform needed for each image in an index or used to match a plugin instance.

This provides a way to add feature variation in a backwards compatible wherever platform matching is involved.

@dmcgowan
Copy link
Member Author

I proposed this as a cleaner solution to containerd/containerd#12784. Using the feature in the platform, the manifest selection logic can prefer an erofs manifest based on the availability of the snapshotter.

@hsiangkao
Copy link
Member

I proposed this as a cleaner solution to containerd/containerd#12784. Using the feature in the platform, the manifest selection logic can prefer an erofs manifest based on the availability of the snapshotter.

@dmcgowan I hope we could move forward for v2.3, but anything somewhat relating to OCI just s*cks..

Signed-off-by: Derek McGowan <derek@mcg.dev>
@dmcgowan dmcgowan marked this pull request as ready for review March 13, 2026 23:17
Copy link
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

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

2 years? :)

@fuweid fuweid merged commit 54c1ef4 into containerd:main Mar 14, 2026
7 checks passed
m.Variant == normalized.Variant &&
m.matchOSVersion(platform)
m.matchOSVersion(platform) {
if len(normalized.OSFeatures) == 0 {
Copy link
Member

Choose a reason for hiding this comment

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

iiuc this is backwards. normalized is the manifest platform, but manifest platforms should be subset of daemon/matcher platform, not the other way around.

Copy link
Member

Choose a reason for hiding this comment

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

Anyway, what I can think out is that I think we could differentiate which kinds of os.features we need to Match (For example, I can think out adding some prefix or a single-char annotation for example); Other os.features (including win32k or random previous garbage os.features generated by vendors) will not be considered as a part of Match.

But all os.features will be participate in sorting and formating.

Copy link
Member

@hsiangkao hsiangkao Mar 26, 2026

Choose a reason for hiding this comment

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

Otherwise, if no Match functionality for some erofs os.features for example, it will make such os.features just another random flag, and almost useless except another kind of a comment for human beings somewhere.

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.

5 participants