mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: github.com/moby/buildkit 6bd81372ad6f (v0.13.0-dev)
full diff: 6bd81372ad...d6e142600e
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
14
vendor/github.com/moby/buildkit/exporter/containerimage/exptypes/parse.go
generated
vendored
14
vendor/github.com/moby/buildkit/exporter/containerimage/exptypes/parse.go
generated
vendored
@ -17,6 +17,18 @@ func ParsePlatforms(meta map[string][]byte) (Platforms, error) {
|
||||
return Platforms{}, errors.Wrapf(err, "failed to parse platforms passed to provenance processor")
|
||||
}
|
||||
}
|
||||
if len(ps.Platforms) == 0 {
|
||||
return Platforms{}, errors.Errorf("invalid empty platforms index for exporter")
|
||||
}
|
||||
for i, p := range ps.Platforms {
|
||||
if p.ID == "" {
|
||||
return Platforms{}, errors.Errorf("invalid empty platform key for exporter")
|
||||
}
|
||||
if p.Platform.OS == "" || p.Platform.Architecture == "" {
|
||||
return Platforms{}, errors.Errorf("invalid platform value %v for exporter", p.Platform)
|
||||
}
|
||||
ps.Platforms[i].Platform = platforms.Normalize(p.Platform)
|
||||
}
|
||||
return ps, nil
|
||||
}
|
||||
|
||||
@ -36,6 +48,8 @@ func ParsePlatforms(meta map[string][]byte) (Platforms, error) {
|
||||
OSFeatures: img.OSFeatures,
|
||||
Variant: img.Variant,
|
||||
}
|
||||
} else if img.OS != "" || img.Architecture != "" {
|
||||
return Platforms{}, errors.Errorf("invalid image config: os and architecture must be specified together")
|
||||
}
|
||||
}
|
||||
p = platforms.Normalize(p)
|
||||
|
Reference in New Issue
Block a user