From dc9cb1dfd5b45546be45f6f26a10fddeddc343da Mon Sep 17 00:00:00 2001 From: Gao Xiang Date: Sat, 21 Mar 2026 15:21:59 +0800 Subject: [PATCH] transfer: fix the differ selection if differ is "" Signed-off-by: Gao Xiang --- plugins/transfer/plugin.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/transfer/plugin.go b/plugins/transfer/plugin.go index d730d45fbe..9fc4168e13 100644 --- a/plugins/transfer/plugin.go +++ b/plugins/transfer/plugin.go @@ -128,8 +128,14 @@ func init() { continue } var matched bool - for _, p := range plugin.Meta.Platforms { - if target.Match(p) { + for _, pd := range plugin.Meta.Platforms { + // Note that 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". + // If we reverse this logic, this wrong differ will be applied. + if platforms.Only(pd).Match(p) { matched = true } }