Merge pull request #1565 from allencloud/fix-potential-panic
fix a potential panic when map is nil
This commit is contained in:
		
							
								
								
									
										2
									
								
								image.go
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								image.go
									
									
									
									
									
								
							| @@ -80,10 +80,10 @@ func (i *image) Unpack(ctx context.Context, snapshotterName string) error { | ||||
| 			if err != nil { | ||||
| 				return err | ||||
| 			} | ||||
| 			if info.Labels["containerd.io/uncompressed"] != layer.Diff.Digest.String() { | ||||
| 			if info.Labels == nil { | ||||
| 				info.Labels = map[string]string{} | ||||
| 			} | ||||
| 			if info.Labels["containerd.io/uncompressed"] != layer.Diff.Digest.String() { | ||||
| 				info.Labels["containerd.io/uncompressed"] = layer.Diff.Digest.String() | ||||
| 				if _, err := cs.Update(ctx, info, "labels.containerd.io/uncompressed"); err != nil { | ||||
| 					return err | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Phil Estes
					Phil Estes