Skip to content

Commit 3e6d7f6

Browse files
committed
metadata/gc: remove the noop-loop for snapshot reference
The noop-loop does nothing. The containerd doesn't have any snapshotter buckets at the beginning. If user uses specific dir as rootfs to create container, and sets `snapshotter` key to the container, like `overlayfs` by mistake, the gc scheduler will try to scan the snapshotter and panic. In order to avoid this case, remove the noop-loop here. Signed-off-by: Wei Fu <[email protected]> (cherry picked from commit 34672d4) Signed-off-by: Wei Fu <[email protected]>
1 parent 813e5f6 commit 3e6d7f6

1 file changed

Lines changed: 0 additions & 4 deletions

File tree

metadata/gc.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,6 @@ func references(ctx context.Context, tx *bolt.Tx, node gc.Node, fn func(gc.Node)
227227

228228
bkt := getBucket(tx, bucketKeyVersion, []byte(node.Namespace), bucketKeyObjectSnapshots, []byte(ss), []byte(name))
229229
if bkt == nil {
230-
getBucket(tx, bucketKeyVersion, []byte(node.Namespace), bucketKeyObjectSnapshots).ForEach(func(k, v []byte) error {
231-
return nil
232-
})
233-
234230
// Node may be created from dead edge
235231
return nil
236232
}

0 commit comments

Comments
 (0)