Merge pull request #557 from ijc/exporter-nil-map

Initialise `src.Metadata` in all `{image,oci}ExporterInstance.Export`
docker-18.09
Tõnis Tiigi 2018-08-06 11:10:46 -07:00 committed by GitHub
commit e37916545d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -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
}

View File

@ -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
}