Test for bug
@@ -914,6 +914,14 @@ func TestImagePruning(t *testing.T) {
},
},
+ "layers shared with young images are not pruned": {
+ images: imageList(
+ agedImage("sha256:0000000000000000000000000000000000000000000000000000000000000001", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000001", 43200),
+ agedImage("sha256:0000000000000000000000000000000000000000000000000000000000000002", registryHost+"/foo/bar@sha256:0000000000000000000000000000000000000000000000000000000000000002", 5),
+ ),
+ expectedImageDeletions: []string{"sha256:0000000000000000000000000000000000000000000000000000000000000001"},
+ },
+
"image exceeding limits": {
pruneOverSizeLimit: newBool(true),
images: imageList(
