transfer: fix the differ selection if differ is ""

Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
This commit is contained in:
Gao Xiang
2026-03-21 15:21:59 +08:00
parent 667843fe5a
commit dc9cb1dfd5

View File

@@ -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
}
}