inspektor-gadget
82 строки · 1.9 Кб
1// Copyright 2019-2021 The Inspektor Gadget authors
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17option go_package = "github.com/inspektor-gadget/inspektor-gadget/pkg/gadgettracermanager";
18
19package gadgettracermanager;
20
21service GadgetTracerManager {
22// Methods called via kubectl-exec
23rpc ReceiveStream(TracerID) returns (stream StreamData) {}
24
25// Methods called by OCI Hooks
26rpc AddContainer(ContainerDefinition) returns (AddContainerResponse) {}
27rpc RemoveContainer(ContainerDefinition) returns (RemoveContainerResponse) {}
28
29// Methods called for debugging
30rpc DumpState(DumpStateRequest) returns (Dump) {}
31}
32
33message Label {
34string key = 1;
35string value = 2;
36}
37
38message AddContainerResponse {
39string debug = 1;
40}
41
42message RemoveContainerResponse {
43string debug = 1;
44}
45
46message TracerID {
47string id = 1;
48}
49
50message StreamData {
51string line = 1;
52}
53
54message OwnerReference {
55string apiversion = 1;
56string kind = 2;
57string name = 3;
58string uid = 4;
59}
60
61message ContainerDefinition {
62string id = 1;
63uint32 pid = 2;
64string oci_config = 3;
65
66// NRI and OCI hooks don't give the OCI config but give pod details
67string namespace = 4;
68string podname = 5;
69string name = 6;
70repeated Label labels = 7;
71// Some hooks do not have information about the pod labels
72bool labels_set = 8;
73}
74
75message DumpStateRequest {
76}
77
78message Dump {
79string containers = 1;
80string traces = 2;
81string stacks = 3;
82}
83