Skip to content

Commit

Permalink
Add plugin info call to introspection API
Browse files Browse the repository at this point in the history
Signed-off-by: Derek McGowan <derek@mcg.dev>
  • Loading branch information
dmcgowan committed Jan 25, 2024
1 parent 3616b9c commit 27bb861
Show file tree
Hide file tree
Showing 12 changed files with 520 additions and 250 deletions.
58 changes: 51 additions & 7 deletions api/next.pb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4311,6 +4311,24 @@ file {
name: "github.com/containerd/containerd/api/types/introspection.proto"
package: "containerd.types"
dependency: "google/protobuf/any.proto"
message_type {
name: "RuntimeRequest"
field {
name: "runtime_path"
number: 1
label: LABEL_OPTIONAL
type: TYPE_STRING
json_name: "runtimePath"
}
field {
name: "options"
number: 2
label: LABEL_OPTIONAL
type: TYPE_MESSAGE
type_name: ".google.protobuf.Any"
json_name: "options"
}
}
message_type {
name: "RuntimeVersion"
field {
Expand Down Expand Up @@ -4596,23 +4614,49 @@ file {
}
}
message_type {
name: "RuntimeRequest"
name: "PluginInfoRequest"
field {
name: "runtime_path"
name: "type"
number: 1
label: LABEL_OPTIONAL
type: TYPE_STRING
json_name: "runtimePath"
json_name: "type"
}
field {
name: "options"
name: "id"
number: 2
label: LABEL_OPTIONAL
type: TYPE_STRING
json_name: "id"
}
field {
name: "options"
number: 3
label: LABEL_OPTIONAL
type: TYPE_MESSAGE
type_name: ".google.protobuf.Any"
json_name: "options"
}
}
message_type {
name: "PluginInfoResponse"
field {
name: "plugin"
number: 1
label: LABEL_OPTIONAL
type: TYPE_MESSAGE
type_name: ".containerd.services.introspection.v1.Plugin"
json_name: "plugin"
}
field {
name: "extra"
number: 2
label: LABEL_OPTIONAL
type: TYPE_MESSAGE
type_name: ".google.protobuf.Any"
json_name: "extra"
}
}
service {
name: "Introspection"
method {
Expand All @@ -4626,9 +4670,9 @@ file {
output_type: ".containerd.services.introspection.v1.ServerResponse"
}
method {
name: "Runtime"
input_type: ".containerd.services.introspection.v1.RuntimeRequest"
output_type: ".containerd.types.RuntimeInfo"
name: "PluginInfo"
input_type: ".containerd.services.introspection.v1.PluginInfoRequest"
output_type: ".containerd.services.introspection.v1.PluginInfoResponse"
}
}
options {
Expand Down
236 changes: 163 additions & 73 deletions api/services/introspection/v1/introspection.pb.go

Large diffs are not rendered by default.

23 changes: 16 additions & 7 deletions api/services/introspection/v1/introspection.proto
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ service Introspection {
rpc Plugins(PluginsRequest) returns (PluginsResponse);
// Server returns information about the containerd server
rpc Server(google.protobuf.Empty) returns (ServerResponse);
// Runtime returns the runtime info
rpc Runtime(RuntimeRequest) returns (types.RuntimeInfo);
// PluginInfo returns information directly from a plugin if the plugin supports it
rpc PluginInfo(PluginInfoRequest) returns (PluginInfoResponse);
}

message Plugin {
Expand Down Expand Up @@ -116,9 +116,18 @@ message DeprecationWarning {
google.protobuf.Timestamp last_occurrence = 3;
}

message RuntimeRequest {
string runtime_path = 1;
// Options correspond to CreateTaskRequest.options.
// This is needed to pass the runc binary path, etc.
google.protobuf.Any options = 2;
message PluginInfoRequest {
string type = 1;
string id = 2;

// Options may be used to request extra dynamic information from
// a plugin.
// This object is determined by the plugin and the plugin may return
// NotImplemented or InvalidArgument if it is not supported
google.protobuf.Any options = 3;
}

message PluginInfoResponse {
Plugin plugin = 1;
google.protobuf.Any extra = 2;
}
33 changes: 16 additions & 17 deletions api/services/introspection/v1/introspection_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 27bb861

Please sign in to comment.