unpack: return error when no platforms defined
Require platforms to be non-empty to avoid no-op unpack Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
parent
8017daa12d
commit
39692e7672
@ -145,6 +145,9 @@ func NewUnpacker(ctx context.Context, cs content.Store, opts ...UnpackerOpt) (*U
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if len(u.platforms) == 0 {
|
||||||
|
return nil, fmt.Errorf("no unpack platforms defined: %w", errdefs.ErrInvalidArgument)
|
||||||
|
}
|
||||||
return u, nil
|
return u, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user