Skip to content

transfer: fix the differ selection if differ is ""#13080

Merged
mxpv merged 1 commit intocontainerd:mainfrom
erofs:transfer-differ-fix
Mar 23, 2026
Merged

transfer: fix the differ selection if differ is ""#13080
mxpv merged 1 commit intocontainerd:mainfrom
erofs:transfer-differ-fix

Conversation

@hsiangkao
Copy link
Copy Markdown
Member

@hsiangkao hsiangkao commented Mar 21, 2026

We must use the platforms supported by the differ to match the platform in UnpackConfiguration.

For example, a differ might only support "linux/amd64", while the platform in UnpackConfiguration is "linux(+erofs)/amd64";
Currently the logic is reversed, so that the wrong differ will be applied, as below:

// the wrong logic
if target[`linux(+erofs)/amd64`].Match(p[`linux/amd64`]) {

And

func (m *matcher) Match(platform specs.Platform) bool {
	normalized := Normalize(platform)
	if m.OS == normalized.OS &&
		m.Architecture == normalized.Architecture &&
		m.Variant == normalized.Variant &&
		m.matchOSVersion(platform) {
		if len(normalized.OSFeatures) == 0 { // `linux/amd64` should always match incorrectly.
			return true
		}

It should use all potential differs' capablities to match the corresponding platform requirements:

if platforms.Only(pd)`linux/amd64`.Match(p`linux(+erofs)/amd64`) {

-- A dependency patch of EROFS image osfeature support

@github-project-automation github-project-automation Bot moved this from Needs Triage to Review In Progress in Pull Request Review Mar 23, 2026
@hsiangkao
Copy link
Copy Markdown
Member Author

thanks @dmcgowan @djdongjin , @containerd/committers could help merge this one?

Copy link
Copy Markdown
Member

@ChengyuZhu6 ChengyuZhu6 left a comment

Choose a reason for hiding this comment

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

LGTM

@dmcgowan dmcgowan added this pull request to the merge queue Mar 23, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Mar 23, 2026
@mxpv mxpv added this pull request to the merge queue Mar 23, 2026
Merged via the queue into containerd:main with commit 1568602 Mar 23, 2026
54 checks passed
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in Pull Request Review Mar 23, 2026
@hsiangkao hsiangkao deleted the transfer-differ-fix branch March 24, 2026 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

6 participants