Add Cleanup to snapshot API

Cleanup is an optional method a snapshotter may implement.
Cleanup can be used to cleanup resources after a snapshot
has been removed. This function allows a snapshotter to defer
longer resource cleanup until after snapshot removals are
completed. Adding this to the API allows proxy snapshotters
to leverage this enhancement.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
Derek McGowan
2020-01-02 16:38:21 -08:00
parent b95fa01b95
commit 123af61c0b
8 changed files with 354 additions and 70 deletions

View File

@@ -3446,6 +3446,16 @@ file {
json_name: "inodes"
}
}
message_type {
name: "CleanupRequest"
field {
name: "snapshotter"
number: 1
label: LABEL_OPTIONAL
type: TYPE_STRING
json_name: "snapshotter"
}
}
enum_type {
name: "Kind"
value {
@@ -3529,6 +3539,11 @@ file {
input_type: ".containerd.services.snapshots.v1.UsageRequest"
output_type: ".containerd.services.snapshots.v1.UsageResponse"
}
method {
name: "Cleanup"
input_type: ".containerd.services.snapshots.v1.CleanupRequest"
output_type: ".google.protobuf.Empty"
}
}
options {
go_package: "github.com/containerd/containerd/api/services/snapshots/v1;snapshots"