Compare commits

..

1 Commits
0.2.7 ... 0.2.8

Author SHA1 Message Date
38f26b213f Clear snapshot when container doesn't exist
This clears up a scenario where a container can be deleted but
its snapshot is not.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2019-12-28 20:01:01 +00:00

View File

@ -43,6 +43,12 @@ func Remove(ctx context.Context, client *containerd.Client, name string) error {
if err != nil { if err != nil {
return fmt.Errorf("error deleting container %s, %s, %s", container.ID(), name, err) return fmt.Errorf("error deleting container %s, %s, %s", container.ID(), name, err)
} }
} else {
service := client.SnapshotService("")
key := name + "snapshot"
if _, err := client.SnapshotService("").Stat(ctx, key); err == nil {
service.Remove(ctx, key)
}
} }
return nil return nil
} }