catch error with descriptor missing platform

Signed-off-by: Avi Deitcher <avi@deitcher.net>
This commit is contained in:
Avi Deitcher 2022-10-24 21:44:50 +03:00
parent 25c8e68f98
commit 33180047f5

View File

@ -316,6 +316,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)
}