Add mount manager to protobuf services and types

Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
Derek McGowan
2024-12-08 09:41:19 -08:00
parent 4d34b01ce0
commit c5097ac63f
3 changed files with 117 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
/*
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package mounts

View File

@@ -0,0 +1,78 @@
/*
Copyright The containerd Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
syntax = "proto3";
package containerd.services.mounts.v1;
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "github.com/containerd/containerd/api/types/mount.proto";
option go_package = "github.com/containerd/containerd/api/services/mounts/v1;mounts";
// Mounts service manages mounts
service Mounts {
rpc Activate(ActivateRequest) returns (ActivateResponse);
rpc Deactivate(DeactivateRequest) returns (google.protobuf.Empty);
rpc Info(InfoRequest) returns (InfoResponse);
rpc Update(UpdateRequest) returns (UpdateResponse);
rpc List(ListRequest) returns (stream ListMessage);
}
message ActivateRequest {
string name = 1;
repeated containerd.types.Mount mounts = 2;
map<string, string> labels = 3;
bool temporary = 4;
}
message ActivateResponse {
containerd.types.ActivationInfo info = 1;
}
message DeactivateRequest {
string name = 1;
}
message InfoRequest {
string name = 1;
}
message InfoResponse {
containerd.types.ActivationInfo info = 1;
}
message UpdateRequest {
containerd.types.ActivationInfo info = 1;
google.protobuf.FieldMask update_mask = 2;
}
message UpdateResponse {
containerd.types.ActivationInfo info = 1;
}
message ListRequest {
repeated string filters = 1;
}
message ListMessage {
containerd.types.ActivationInfo info = 1;
}

View File

@@ -18,6 +18,8 @@ syntax = "proto3";
package containerd.types;
import "google/protobuf/timestamp.proto";
option go_package = "github.com/containerd/containerd/api/types;types";
// Mount describes mounts for a container.
@@ -41,3 +43,23 @@ message Mount {
// Options specifies zero or more fstab style mount options.
repeated string options = 4;
}
message ActiveMount {
Mount mount = 1;
google.protobuf.Timestamp mounted_at = 2;
string mount_point = 3;
map<string, string> data = 4;
}
message ActivationInfo {
string name = 1;
repeated ActiveMount active = 2;
repeated Mount system = 3;
map<string, string> labels = 4;
}