builder-next/mobyexporter: Use OptKeyName const

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paweł Gronowski 2024-02-09 16:05:50 +01:00
parent 59ad1690f7
commit fa467caf4d
No known key found for this signature in database
GPG key ID: B85EFCFE26DEF92A

View file

@ -14,10 +14,6 @@ import (
"github.com/pkg/errors"
)
const (
keyImageName = "name"
)
// Differ can make a moby layer from a snapshot
type Differ interface {
EnsureLayer(ctx context.Context, key string) ([]layer.DiffID, error)
@ -50,8 +46,8 @@ func (e *imageExporter) Resolve(ctx context.Context, id int, opt map[string]stri
id: id,
}
for k, v := range opt {
switch k {
case keyImageName:
switch exptypes.ImageExporterOptKey(k) {
case exptypes.OptKeyName:
for _, v := range strings.Split(v, ",") {
ref, err := distref.ParseNormalizedNamed(v)
if err != nil {