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
commit f8947c6ae6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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