From fa467caf4dcce94048fa50f6151e439ee4d7f8dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= Date: Fri, 9 Feb 2024 16:05:50 +0100 Subject: [PATCH] builder-next/mobyexporter: Use OptKeyName const MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Paweł Gronowski --- builder/builder-next/exporter/mobyexporter/export.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/builder/builder-next/exporter/mobyexporter/export.go b/builder/builder-next/exporter/mobyexporter/export.go index 5ade3be7d6..74b22d99d4 100644 --- a/builder/builder-next/exporter/mobyexporter/export.go +++ b/builder/builder-next/exporter/mobyexporter/export.go @@ -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 {