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:
		| @@ -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 | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Derek McGowan
					Derek McGowan