From 052551573d7e5b63874c9b02b420432894a7c441 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Fri, 14 Jun 2019 15:20:32 +0000 Subject: [PATCH] Ensure labels is not nil in differ Signed-off-by: Michael Crosby --- diff/walking/differ.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/diff/walking/differ.go b/diff/walking/differ.go index 1c82860d7..5ce35910c 100644 --- a/diff/walking/differ.go +++ b/diff/walking/differ.go @@ -150,7 +150,9 @@ func (s *walkingDiff) Compare(ctx context.Context, lower, upper []mount.Mount, o if err != nil { return errors.Wrap(err, "failed to get info from content store") } - + if info.Labels == nil { + info.Labels = make(map[string]string) + } // Set uncompressed label if digest already existed without label if _, ok := info.Labels[uncompressed]; !ok { info.Labels[uncompressed] = config.Labels[uncompressed]