Merge pull request #3859 from deitch/safety-check-platforms

catch error with descriptor missing platform
This commit is contained in:
Avi Deitcher
2022-10-30 11:15:58 +02:00
committed by GitHub

View File

@@ -317,6 +317,9 @@ func (p Pkg) Build(bos ...BuildOpt) error {
if desc == nil {
return fmt.Errorf("no valid descriptor returned for image for arch %s", platform.Architecture)
}
if desc.Platform == nil {
return fmt.Errorf("descriptor for platform %v has no information on the platform: %#v", platform, desc)
}
descs = append(descs, *desc)
}