Merge pull request #557 from ijc/exporter-nil-map
Initialise `src.Metadata` in all `{image,oci}ExporterInstance.Export`docker-18.09
commit
e37916545d
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue