Fix snapshot key error

When obtaining the container information fails, the key for deleting the snapshot is incorrect.

Signed-off-by: wangqiang <shivaqiang@qq.com>
This commit is contained in:
wangqiang 2024-03-16 14:34:59 +08:00 committed by Alex Ellis
parent 70b0929cf2
commit dd31784824

View File

@ -57,7 +57,7 @@ func Remove(ctx context.Context, client *containerd.Client, name string) error {
} else { } else {
service := client.SnapshotService("") service := client.SnapshotService("")
key := name + "snapshot" key := name + "-snapshot"
if _, err := client.SnapshotService("").Stat(ctx, key); err == nil { if _, err := client.SnapshotService("").Stat(ctx, key); err == nil {
service.Remove(ctx, key) service.Remove(ctx, key)
} }