diff --git a/exporter/containerimage/export.go b/exporter/containerimage/export.go index 6be45b03..a837554f 100644 --- a/exporter/containerimage/export.go +++ b/exporter/containerimage/export.go @@ -99,6 +99,9 @@ func (e *imageExporterInstance) Name() string { } func (e *imageExporterInstance) Export(ctx context.Context, src exporter.Source) (map[string]string, error) { + if src.Metadata == nil { + src.Metadata = make(map[string][]byte) + } for k, v := range e.meta { src.Metadata[k] = v } diff --git a/exporter/oci/export.go b/exporter/oci/export.go index 5e5e41ad..e007ffc2 100644 --- a/exporter/oci/export.go +++ b/exporter/oci/export.go @@ -109,6 +109,9 @@ func (e *imageExporterInstance) Export(ctx context.Context, src exporter.Source) return nil, errors.Errorf("docker exporter does not currently support exporting manifest lists") } + if src.Metadata == nil { + src.Metadata = make(map[string][]byte) + } for k, v := range e.meta { src.Metadata[k] = v }