diff --git a/apis/runtime/v1alpha1/api.pb.go b/apis/runtime/v1alpha1/api.pb.go new file mode 100644 index 000000000..114790b5e --- /dev/null +++ b/apis/runtime/v1alpha1/api.pb.go @@ -0,0 +1,1101 @@ +// +//Copyright 2022 The Koordinator 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. + +// To regenerate api.pb.go run scripts/generate_runtime.sh + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc v3.17.3 +// source: api.proto + +package v1alpha1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// PodSandboxMetadata holds all necessary information for sandbox. +type PodSandboxMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Pod name of the sandbox. Same as the pod name in the Pod ObjectMeta. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Pod UID of the sandbox. Same as the pod UID in the Pod ObjectMeta. + Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` + // Pod namespace of the sandbox. Same as the pod namespace in the Pod ObjectMeta. + Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` + // Attempt number of creating the sandbox. Default: 0. + Attempt uint32 `protobuf:"varint,4,opt,name=attempt,proto3" json:"attempt,omitempty"` +} + +func (x *PodSandboxMetadata) Reset() { + *x = PodSandboxMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_api_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PodSandboxMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PodSandboxMetadata) ProtoMessage() {} + +func (x *PodSandboxMetadata) ProtoReflect() protoreflect.Message { + mi := &file_api_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PodSandboxMetadata.ProtoReflect.Descriptor instead. +func (*PodSandboxMetadata) Descriptor() ([]byte, []int) { + return file_api_proto_rawDescGZIP(), []int{0} +} + +func (x *PodSandboxMetadata) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *PodSandboxMetadata) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +func (x *PodSandboxMetadata) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *PodSandboxMetadata) GetAttempt() uint32 { + if x != nil { + return x.Attempt + } + return 0 +} + +// RunPodSandboxHookRequest is sent to RuntimeHookServer before pod creating request transferred to +// backend containerd or dockerd. This Request is generated basing on CRI's RunPodSandboxRequest, including pod +// Meta, Resources, Annotations .e.g and RuntimeHookServer should ensure correct operations basing on +// this request. +type RunPodSandboxHookRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Metadata of the sandbox. This information will uniquely identify the sandbox. + PodMeta *PodSandboxMetadata `protobuf:"bytes,1,opt,name=pod_meta,json=podMeta,proto3" json:"pod_meta,omitempty"` + // Named runtime to use for podSandbox. + RuntimeHandler string `protobuf:"bytes,2,opt,name=runtime_handler,json=runtimeHandler,proto3" json:"runtime_handler,omitempty"` + // Labels/Annotations are key-value pairs that may be used. + Labels map[string]string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Annotations map[string]string `protobuf:"bytes,4,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Parent cgroup of the pod sandbox. + CgroupParent string `protobuf:"bytes,5,opt,name=cgroup_parent,json=cgroupParent,proto3" json:"cgroup_parent,omitempty"` + // Optional overhead represents the overheads associated with this sandbox, + // same as LinuxPodSandboxConfig.overhead under CRI scenario + Overhead *LinuxContainerResources `protobuf:"bytes,6,opt,name=overhead,proto3" json:"overhead,omitempty"` + // Optional resources represents the sum of container resources for this sandbox + // same as LinuxPodSandboxConfig.resources under CRI scenario + Resources *LinuxContainerResources `protobuf:"bytes,7,opt,name=resources,proto3" json:"resources,omitempty"` +} + +func (x *RunPodSandboxHookRequest) Reset() { + *x = RunPodSandboxHookRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RunPodSandboxHookRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RunPodSandboxHookRequest) ProtoMessage() {} + +func (x *RunPodSandboxHookRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RunPodSandboxHookRequest.ProtoReflect.Descriptor instead. +func (*RunPodSandboxHookRequest) Descriptor() ([]byte, []int) { + return file_api_proto_rawDescGZIP(), []int{1} +} + +func (x *RunPodSandboxHookRequest) GetPodMeta() *PodSandboxMetadata { + if x != nil { + return x.PodMeta + } + return nil +} + +func (x *RunPodSandboxHookRequest) GetRuntimeHandler() string { + if x != nil { + return x.RuntimeHandler + } + return "" +} + +func (x *RunPodSandboxHookRequest) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +func (x *RunPodSandboxHookRequest) GetAnnotations() map[string]string { + if x != nil { + return x.Annotations + } + return nil +} + +func (x *RunPodSandboxHookRequest) GetCgroupParent() string { + if x != nil { + return x.CgroupParent + } + return "" +} + +func (x *RunPodSandboxHookRequest) GetOverhead() *LinuxContainerResources { + if x != nil { + return x.Overhead + } + return nil +} + +func (x *RunPodSandboxHookRequest) GetResources() *LinuxContainerResources { + if x != nil { + return x.Resources + } + return nil +} + +// RunPodSandboxHookResponse is RuntimeHookServer's response to RunPodSandboxHookRequest. +// RuntimeManager will merge RunPodSandboxHookResponse and RunPodSandboxRequest to generate a +// RunPodSandboxRequest to containerd(dockerd). +type RunPodSandboxHookResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // RuntimeHookServer may inject additional labels/annotations to PodSandboxRequest to be send to + // backend contaienrd/dockerd + Labels map[string]string `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Annotations map[string]string `protobuf:"bytes,2,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // RuntimeHookSever may modify cgroup_parent to construct customized cgroup topology. + CgroupParent string `protobuf:"bytes,3,opt,name=cgroup_parent,json=cgroupParent,proto3" json:"cgroup_parent,omitempty"` + // RuntimeHookServer may modify the linux resource config. + // Optional resources represents the sum of container resources for this sandbox + Resources *LinuxContainerResources `protobuf:"bytes,4,opt,name=resources,proto3" json:"resources,omitempty"` +} + +func (x *RunPodSandboxHookResponse) Reset() { + *x = RunPodSandboxHookResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RunPodSandboxHookResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RunPodSandboxHookResponse) ProtoMessage() {} + +func (x *RunPodSandboxHookResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RunPodSandboxHookResponse.ProtoReflect.Descriptor instead. +func (*RunPodSandboxHookResponse) Descriptor() ([]byte, []int) { + return file_api_proto_rawDescGZIP(), []int{2} +} + +func (x *RunPodSandboxHookResponse) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +func (x *RunPodSandboxHookResponse) GetAnnotations() map[string]string { + if x != nil { + return x.Annotations + } + return nil +} + +func (x *RunPodSandboxHookResponse) GetCgroupParent() string { + if x != nil { + return x.CgroupParent + } + return "" +} + +func (x *RunPodSandboxHookResponse) GetResources() *LinuxContainerResources { + if x != nil { + return x.Resources + } + return nil +} + +// LinuxContainerResources specifies Linux specific configuration for +// resources. +type LinuxContainerResources struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // CPU CFS (Completely Fair Scheduler) period. Default: 0 (not specified). + CpuPeriod int64 `protobuf:"varint,1,opt,name=cpu_period,json=cpuPeriod,proto3" json:"cpu_period,omitempty"` + // CPU CFS (Completely Fair Scheduler) quota. Default: 0 (not specified). + CpuQuota int64 `protobuf:"varint,2,opt,name=cpu_quota,json=cpuQuota,proto3" json:"cpu_quota,omitempty"` + // CPU shares (relative weight vs. other containers). Default: 0 (not specified). + CpuShares int64 `protobuf:"varint,3,opt,name=cpu_shares,json=cpuShares,proto3" json:"cpu_shares,omitempty"` + // Memory limit in bytes. Default: 0 (not specified). + MemoryLimitInBytes int64 `protobuf:"varint,4,opt,name=memory_limit_in_bytes,json=memoryLimitInBytes,proto3" json:"memory_limit_in_bytes,omitempty"` + // OOMScoreAdj adjusts the oom-killer score. Default: 0 (not specified). + OomScoreAdj int64 `protobuf:"varint,5,opt,name=oom_score_adj,json=oomScoreAdj,proto3" json:"oom_score_adj,omitempty"` + // CpusetCpus constrains the allowed set of logical CPUs. Default: "" (not specified). + CpusetCpus string `protobuf:"bytes,6,opt,name=cpuset_cpus,json=cpusetCpus,proto3" json:"cpuset_cpus,omitempty"` + // CpusetMems constrains the allowed set of memory nodes. Default: "" (not specified). + CpusetMems string `protobuf:"bytes,7,opt,name=cpuset_mems,json=cpusetMems,proto3" json:"cpuset_mems,omitempty"` + // List of HugepageLimits to limit the HugeTLB usage of container per page size. Default: nil (not specified). + HugepageLimits []*HugepageLimit `protobuf:"bytes,8,rep,name=hugepage_limits,json=hugepageLimits,proto3" json:"hugepage_limits,omitempty"` + // Unified resources for cgroup v2. Default: nil (not specified). + // Each key/value in the map refers to the cgroup v2. + // e.g. "memory.max": "6937202688" or "io.weight": "default 100". + Unified map[string]string `protobuf:"bytes,9,rep,name=unified,proto3" json:"unified,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Memory swap limit in bytes. Default 0 (not specified). + MemorySwapLimitInBytes int64 `protobuf:"varint,10,opt,name=memory_swap_limit_in_bytes,json=memorySwapLimitInBytes,proto3" json:"memory_swap_limit_in_bytes,omitempty"` +} + +func (x *LinuxContainerResources) Reset() { + *x = LinuxContainerResources{} + if protoimpl.UnsafeEnabled { + mi := &file_api_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinuxContainerResources) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinuxContainerResources) ProtoMessage() {} + +func (x *LinuxContainerResources) ProtoReflect() protoreflect.Message { + mi := &file_api_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LinuxContainerResources.ProtoReflect.Descriptor instead. +func (*LinuxContainerResources) Descriptor() ([]byte, []int) { + return file_api_proto_rawDescGZIP(), []int{3} +} + +func (x *LinuxContainerResources) GetCpuPeriod() int64 { + if x != nil { + return x.CpuPeriod + } + return 0 +} + +func (x *LinuxContainerResources) GetCpuQuota() int64 { + if x != nil { + return x.CpuQuota + } + return 0 +} + +func (x *LinuxContainerResources) GetCpuShares() int64 { + if x != nil { + return x.CpuShares + } + return 0 +} + +func (x *LinuxContainerResources) GetMemoryLimitInBytes() int64 { + if x != nil { + return x.MemoryLimitInBytes + } + return 0 +} + +func (x *LinuxContainerResources) GetOomScoreAdj() int64 { + if x != nil { + return x.OomScoreAdj + } + return 0 +} + +func (x *LinuxContainerResources) GetCpusetCpus() string { + if x != nil { + return x.CpusetCpus + } + return "" +} + +func (x *LinuxContainerResources) GetCpusetMems() string { + if x != nil { + return x.CpusetMems + } + return "" +} + +func (x *LinuxContainerResources) GetHugepageLimits() []*HugepageLimit { + if x != nil { + return x.HugepageLimits + } + return nil +} + +func (x *LinuxContainerResources) GetUnified() map[string]string { + if x != nil { + return x.Unified + } + return nil +} + +func (x *LinuxContainerResources) GetMemorySwapLimitInBytes() int64 { + if x != nil { + return x.MemorySwapLimitInBytes + } + return 0 +} + +// HugepageLimit corresponds to the file`hugetlb..limit_in_byte` in container level cgroup. +// For example, `PageSize=1GB`, `Limit=1073741824` means setting `1073741824` bytes to hugetlb.1GB.limit_in_bytes. +type HugepageLimit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The value of PageSize has the format B (2MB, 1GB), + // and must match the of the corresponding control file found in `hugetlb..limit_in_bytes`. + // The values of are intended to be parsed using base 1024("1KB" = 1024, "1MB" = 1048576, etc). + PageSize string `protobuf:"bytes,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + // limit in bytes of hugepagesize HugeTLB usage. + Limit uint64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` +} + +func (x *HugepageLimit) Reset() { + *x = HugepageLimit{} + if protoimpl.UnsafeEnabled { + mi := &file_api_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HugepageLimit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HugepageLimit) ProtoMessage() {} + +func (x *HugepageLimit) ProtoReflect() protoreflect.Message { + mi := &file_api_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HugepageLimit.ProtoReflect.Descriptor instead. +func (*HugepageLimit) Descriptor() ([]byte, []int) { + return file_api_proto_rawDescGZIP(), []int{4} +} + +func (x *HugepageLimit) GetPageSize() string { + if x != nil { + return x.PageSize + } + return "" +} + +func (x *HugepageLimit) GetLimit() uint64 { + if x != nil { + return x.Limit + } + return 0 +} + +type ContainerMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Name of the container. Same as the container name in the PodSpec. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Attempt number of creating the container. Default: 0. + Attempt uint32 `protobuf:"varint,2,opt,name=attempt,proto3" json:"attempt,omitempty"` +} + +func (x *ContainerMetadata) Reset() { + *x = ContainerMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_api_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ContainerMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContainerMetadata) ProtoMessage() {} + +func (x *ContainerMetadata) ProtoReflect() protoreflect.Message { + mi := &file_api_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ContainerMetadata.ProtoReflect.Descriptor instead. +func (*ContainerMetadata) Descriptor() ([]byte, []int) { + return file_api_proto_rawDescGZIP(), []int{5} +} + +func (x *ContainerMetadata) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ContainerMetadata) GetAttempt() uint32 { + if x != nil { + return x.Attempt + } + return 0 +} + +// ContainerResourceHookRequest is sent to RuntimeHookServer before/after container related operations including +// pre-container-start, post-container-create, pre-container-resource-update, post-container-stop. +type ContainerResourceHookRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PodMeta *PodSandboxMetadata `protobuf:"bytes,1,opt,name=pod_meta,json=podMeta,proto3" json:"pod_meta,omitempty"` + ContainerMata *ContainerMetadata `protobuf:"bytes,2,opt,name=container_mata,json=containerMata,proto3" json:"container_mata,omitempty"` + // container related annotations + ContainerAnnotations map[string]string `protobuf:"bytes,3,rep,name=container_annotations,json=containerAnnotations,proto3" json:"container_annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + ContainerResources *LinuxContainerResources `protobuf:"bytes,4,opt,name=container_resources,json=containerResources,proto3" json:"container_resources,omitempty"` + PodResources *LinuxContainerResources `protobuf:"bytes,5,opt,name=pod_resources,json=podResources,proto3" json:"pod_resources,omitempty"` // TODO: add the error info from containerd/dockerd +} + +func (x *ContainerResourceHookRequest) Reset() { + *x = ContainerResourceHookRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ContainerResourceHookRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContainerResourceHookRequest) ProtoMessage() {} + +func (x *ContainerResourceHookRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ContainerResourceHookRequest.ProtoReflect.Descriptor instead. +func (*ContainerResourceHookRequest) Descriptor() ([]byte, []int) { + return file_api_proto_rawDescGZIP(), []int{6} +} + +func (x *ContainerResourceHookRequest) GetPodMeta() *PodSandboxMetadata { + if x != nil { + return x.PodMeta + } + return nil +} + +func (x *ContainerResourceHookRequest) GetContainerMata() *ContainerMetadata { + if x != nil { + return x.ContainerMata + } + return nil +} + +func (x *ContainerResourceHookRequest) GetContainerAnnotations() map[string]string { + if x != nil { + return x.ContainerAnnotations + } + return nil +} + +func (x *ContainerResourceHookRequest) GetContainerResources() *LinuxContainerResources { + if x != nil { + return x.ContainerResources + } + return nil +} + +func (x *ContainerResourceHookRequest) GetPodResources() *LinuxContainerResources { + if x != nil { + return x.PodResources + } + return nil +} + +// ContainerResourceHookResponse is RuntimeHookServer's response to ContainerResourceHookRequest. +// RuntimeManager will merge ContainerResourceHookResponse and Pre hookType Request to generate a +// RunPodSandboxRequest to containerd(dockerd). +type ContainerResourceHookResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ContainerAnnotations map[string]string `protobuf:"bytes,1,rep,name=container_annotations,json=containerAnnotations,proto3" json:"container_annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + ContainerResources *LinuxContainerResources `protobuf:"bytes,2,opt,name=container_resources,json=containerResources,proto3" json:"container_resources,omitempty"` +} + +func (x *ContainerResourceHookResponse) Reset() { + *x = ContainerResourceHookResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ContainerResourceHookResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContainerResourceHookResponse) ProtoMessage() {} + +func (x *ContainerResourceHookResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ContainerResourceHookResponse.ProtoReflect.Descriptor instead. +func (*ContainerResourceHookResponse) Descriptor() ([]byte, []int) { + return file_api_proto_rawDescGZIP(), []int{7} +} + +func (x *ContainerResourceHookResponse) GetContainerAnnotations() map[string]string { + if x != nil { + return x.ContainerAnnotations + } + return nil +} + +func (x *ContainerResourceHookResponse) GetContainerResources() *LinuxContainerResources { + if x != nil { + return x.ContainerResources + } + return nil +} + +var File_api_proto protoreflect.FileDescriptor + +var file_api_proto_rawDesc = []byte{ + 0x0a, 0x09, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x72, 0x75, 0x6e, + 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x22, 0x72, 0x0a, + 0x12, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x74, 0x74, 0x65, 0x6d, + 0x70, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x61, 0x74, 0x74, 0x65, 0x6d, 0x70, + 0x74, 0x22, 0xe3, 0x04, 0x0a, 0x18, 0x52, 0x75, 0x6e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, + 0x62, 0x6f, 0x78, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, + 0x0a, 0x08, 0x70, 0x6f, 0x64, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x24, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x07, 0x70, 0x6f, 0x64, 0x4d, 0x65, 0x74, 0x61, 0x12, + 0x27, 0x0a, 0x0f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, + 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, + 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x4e, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, + 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, + 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x50, + 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x5d, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, + 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x52, 0x75, 0x6e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x48, 0x6f, + 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x45, 0x0a, 0x08, + 0x6f, 0x76, 0x65, 0x72, 0x68, 0x65, 0x61, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, + 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x08, 0x6f, 0x76, 0x65, 0x72, 0x68, + 0x65, 0x61, 0x64, 0x12, 0x47, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x43, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x1a, 0x39, 0x0a, 0x0b, + 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3e, 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xb5, 0x03, 0x0a, 0x19, 0x52, 0x75, 0x6e, 0x50, + 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x50, 0x6f, 0x64, 0x53, + 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, + 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x5e, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x72, 0x75, + 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, + 0x75, 0x6e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x48, 0x6f, 0x6f, 0x6b, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x47, 0x0a, 0x09, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, + 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, + 0x3e, 0x0a, 0x10, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, + 0xa1, 0x04, 0x0a, 0x17, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x63, + 0x70, 0x75, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x09, 0x63, 0x70, 0x75, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x70, + 0x75, 0x5f, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x63, + 0x70, 0x75, 0x51, 0x75, 0x6f, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x70, 0x75, 0x5f, 0x73, + 0x68, 0x61, 0x72, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x70, 0x75, + 0x53, 0x68, 0x61, 0x72, 0x65, 0x73, 0x12, 0x31, 0x0a, 0x15, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, + 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x5f, 0x69, 0x6e, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x12, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x4c, 0x69, 0x6d, + 0x69, 0x74, 0x49, 0x6e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x6f, 0x6f, 0x6d, + 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x64, 0x6a, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x0b, 0x6f, 0x6f, 0x6d, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x41, 0x64, 0x6a, 0x12, 0x1f, 0x0a, + 0x0b, 0x63, 0x70, 0x75, 0x73, 0x65, 0x74, 0x5f, 0x63, 0x70, 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x63, 0x70, 0x75, 0x73, 0x65, 0x74, 0x43, 0x70, 0x75, 0x73, 0x12, 0x1f, + 0x0a, 0x0b, 0x63, 0x70, 0x75, 0x73, 0x65, 0x74, 0x5f, 0x6d, 0x65, 0x6d, 0x73, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x70, 0x75, 0x73, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x73, 0x12, + 0x48, 0x0a, 0x0f, 0x68, 0x75, 0x67, 0x65, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, + 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x75, 0x67, 0x65, + 0x70, 0x61, 0x67, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x0e, 0x68, 0x75, 0x67, 0x65, 0x70, + 0x61, 0x67, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x50, 0x0a, 0x07, 0x75, 0x6e, 0x69, + 0x66, 0x69, 0x65, 0x64, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x72, 0x75, 0x6e, + 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, + 0x6e, 0x75, 0x78, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x55, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x07, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x3a, 0x0a, 0x1a, 0x6d, + 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x5f, 0x73, 0x77, 0x61, 0x70, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x5f, 0x69, 0x6e, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x16, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x53, 0x77, 0x61, 0x70, 0x4c, 0x69, 0x6d, 0x69, 0x74, + 0x49, 0x6e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x1a, 0x3a, 0x0a, 0x0c, 0x55, 0x6e, 0x69, 0x66, 0x69, + 0x65, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x22, 0x42, 0x0a, 0x0d, 0x48, 0x75, 0x67, 0x65, 0x70, 0x61, 0x67, 0x65, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x41, 0x0a, 0x11, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x61, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x07, 0x61, 0x74, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x22, 0x9f, 0x04, 0x0a, 0x1c, 0x43, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x08, 0x70, + 0x6f, 0x64, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x52, 0x07, 0x70, 0x6f, 0x64, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x4a, 0x0a, 0x0e, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x6d, 0x61, 0x74, 0x61, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x4d, 0x61, 0x74, 0x61, 0x12, 0x7d, 0x0a, 0x15, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x48, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, + 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x48, 0x6f, 0x6f, 0x6b, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x14, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x41, 0x6e, 0x6e, 0x6f, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x5a, 0x0a, 0x13, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x43, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, + 0x12, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x12, 0x4e, 0x0a, 0x0d, 0x70, 0x6f, 0x64, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x72, 0x75, 0x6e, + 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, + 0x6e, 0x75, 0x78, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x0c, 0x70, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x1a, 0x47, 0x0a, 0x19, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc4, 0x02, 0x0a, + 0x1d, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7e, + 0x0a, 0x15, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x6e, 0x6e, 0x6f, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x49, 0x2e, + 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x14, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x5a, + 0x0a, 0x13, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x72, 0x75, + 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, + 0x69, 0x6e, 0x75, 0x78, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x12, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x1a, 0x47, 0x0a, 0x19, 0x43, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x32, 0x83, 0x05, 0x0a, 0x12, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x48, + 0x6f, 0x6f, 0x6b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x71, 0x0a, 0x14, 0x50, 0x72, + 0x65, 0x52, 0x75, 0x6e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x48, 0x6f, + 0x6f, 0x6b, 0x12, 0x2a, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, + 0x62, 0x6f, 0x78, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, + 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x48, + 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7a, 0x0a, + 0x15, 0x50, 0x72, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x48, 0x6f, 0x6f, 0x6b, 0x12, 0x2e, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7b, 0x0a, 0x16, 0x50, 0x6f, 0x73, + 0x74, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x48, + 0x6f, 0x6f, 0x6b, 0x12, 0x2e, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7a, 0x0a, 0x15, 0x50, 0x6f, 0x73, 0x74, 0x53, 0x74, + 0x6f, 0x70, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x48, 0x6f, 0x6f, 0x6b, 0x12, + 0x2e, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2f, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x84, 0x01, 0x0a, 0x1f, 0x50, 0x72, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x73, 0x48, 0x6f, 0x6f, 0x6b, 0x12, 0x2e, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x3d, 0x5a, 0x3b, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x6f, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, + 0x74, 0x6f, 0x72, 0x2d, 0x73, 0x68, 0x2f, 0x6b, 0x6f, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, + 0x6f, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2f, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_api_proto_rawDescOnce sync.Once + file_api_proto_rawDescData = file_api_proto_rawDesc +) + +func file_api_proto_rawDescGZIP() []byte { + file_api_proto_rawDescOnce.Do(func() { + file_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_proto_rawDescData) + }) + return file_api_proto_rawDescData +} + +var file_api_proto_msgTypes = make([]protoimpl.MessageInfo, 15) +var file_api_proto_goTypes = []interface{}{ + (*PodSandboxMetadata)(nil), // 0: runtime.v1alpha1.PodSandboxMetadata + (*RunPodSandboxHookRequest)(nil), // 1: runtime.v1alpha1.RunPodSandboxHookRequest + (*RunPodSandboxHookResponse)(nil), // 2: runtime.v1alpha1.RunPodSandboxHookResponse + (*LinuxContainerResources)(nil), // 3: runtime.v1alpha1.LinuxContainerResources + (*HugepageLimit)(nil), // 4: runtime.v1alpha1.HugepageLimit + (*ContainerMetadata)(nil), // 5: runtime.v1alpha1.ContainerMetadata + (*ContainerResourceHookRequest)(nil), // 6: runtime.v1alpha1.ContainerResourceHookRequest + (*ContainerResourceHookResponse)(nil), // 7: runtime.v1alpha1.ContainerResourceHookResponse + nil, // 8: runtime.v1alpha1.RunPodSandboxHookRequest.LabelsEntry + nil, // 9: runtime.v1alpha1.RunPodSandboxHookRequest.AnnotationsEntry + nil, // 10: runtime.v1alpha1.RunPodSandboxHookResponse.LabelsEntry + nil, // 11: runtime.v1alpha1.RunPodSandboxHookResponse.AnnotationsEntry + nil, // 12: runtime.v1alpha1.LinuxContainerResources.UnifiedEntry + nil, // 13: runtime.v1alpha1.ContainerResourceHookRequest.ContainerAnnotationsEntry + nil, // 14: runtime.v1alpha1.ContainerResourceHookResponse.ContainerAnnotationsEntry +} +var file_api_proto_depIdxs = []int32{ + 0, // 0: runtime.v1alpha1.RunPodSandboxHookRequest.pod_meta:type_name -> runtime.v1alpha1.PodSandboxMetadata + 8, // 1: runtime.v1alpha1.RunPodSandboxHookRequest.labels:type_name -> runtime.v1alpha1.RunPodSandboxHookRequest.LabelsEntry + 9, // 2: runtime.v1alpha1.RunPodSandboxHookRequest.annotations:type_name -> runtime.v1alpha1.RunPodSandboxHookRequest.AnnotationsEntry + 3, // 3: runtime.v1alpha1.RunPodSandboxHookRequest.overhead:type_name -> runtime.v1alpha1.LinuxContainerResources + 3, // 4: runtime.v1alpha1.RunPodSandboxHookRequest.resources:type_name -> runtime.v1alpha1.LinuxContainerResources + 10, // 5: runtime.v1alpha1.RunPodSandboxHookResponse.labels:type_name -> runtime.v1alpha1.RunPodSandboxHookResponse.LabelsEntry + 11, // 6: runtime.v1alpha1.RunPodSandboxHookResponse.annotations:type_name -> runtime.v1alpha1.RunPodSandboxHookResponse.AnnotationsEntry + 3, // 7: runtime.v1alpha1.RunPodSandboxHookResponse.resources:type_name -> runtime.v1alpha1.LinuxContainerResources + 4, // 8: runtime.v1alpha1.LinuxContainerResources.hugepage_limits:type_name -> runtime.v1alpha1.HugepageLimit + 12, // 9: runtime.v1alpha1.LinuxContainerResources.unified:type_name -> runtime.v1alpha1.LinuxContainerResources.UnifiedEntry + 0, // 10: runtime.v1alpha1.ContainerResourceHookRequest.pod_meta:type_name -> runtime.v1alpha1.PodSandboxMetadata + 5, // 11: runtime.v1alpha1.ContainerResourceHookRequest.container_mata:type_name -> runtime.v1alpha1.ContainerMetadata + 13, // 12: runtime.v1alpha1.ContainerResourceHookRequest.container_annotations:type_name -> runtime.v1alpha1.ContainerResourceHookRequest.ContainerAnnotationsEntry + 3, // 13: runtime.v1alpha1.ContainerResourceHookRequest.container_resources:type_name -> runtime.v1alpha1.LinuxContainerResources + 3, // 14: runtime.v1alpha1.ContainerResourceHookRequest.pod_resources:type_name -> runtime.v1alpha1.LinuxContainerResources + 14, // 15: runtime.v1alpha1.ContainerResourceHookResponse.container_annotations:type_name -> runtime.v1alpha1.ContainerResourceHookResponse.ContainerAnnotationsEntry + 3, // 16: runtime.v1alpha1.ContainerResourceHookResponse.container_resources:type_name -> runtime.v1alpha1.LinuxContainerResources + 1, // 17: runtime.v1alpha1.RuntimeHookService.PreRunPodSandboxHook:input_type -> runtime.v1alpha1.RunPodSandboxHookRequest + 6, // 18: runtime.v1alpha1.RuntimeHookService.PreStartContainerHook:input_type -> runtime.v1alpha1.ContainerResourceHookRequest + 6, // 19: runtime.v1alpha1.RuntimeHookService.PostStartContainerHook:input_type -> runtime.v1alpha1.ContainerResourceHookRequest + 6, // 20: runtime.v1alpha1.RuntimeHookService.PostStopContainerHook:input_type -> runtime.v1alpha1.ContainerResourceHookRequest + 6, // 21: runtime.v1alpha1.RuntimeHookService.PreUpdateContainerResourcesHook:input_type -> runtime.v1alpha1.ContainerResourceHookRequest + 2, // 22: runtime.v1alpha1.RuntimeHookService.PreRunPodSandboxHook:output_type -> runtime.v1alpha1.RunPodSandboxHookResponse + 7, // 23: runtime.v1alpha1.RuntimeHookService.PreStartContainerHook:output_type -> runtime.v1alpha1.ContainerResourceHookResponse + 7, // 24: runtime.v1alpha1.RuntimeHookService.PostStartContainerHook:output_type -> runtime.v1alpha1.ContainerResourceHookResponse + 7, // 25: runtime.v1alpha1.RuntimeHookService.PostStopContainerHook:output_type -> runtime.v1alpha1.ContainerResourceHookResponse + 7, // 26: runtime.v1alpha1.RuntimeHookService.PreUpdateContainerResourcesHook:output_type -> runtime.v1alpha1.ContainerResourceHookResponse + 22, // [22:27] is the sub-list for method output_type + 17, // [17:22] is the sub-list for method input_type + 17, // [17:17] is the sub-list for extension type_name + 17, // [17:17] is the sub-list for extension extendee + 0, // [0:17] is the sub-list for field type_name +} + +func init() { file_api_proto_init() } +func file_api_proto_init() { + if File_api_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PodSandboxMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RunPodSandboxHookRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RunPodSandboxHookResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinuxContainerResources); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HugepageLimit); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ContainerMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ContainerResourceHookRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ContainerResourceHookResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_proto_rawDesc, + NumEnums: 0, + NumMessages: 15, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_api_proto_goTypes, + DependencyIndexes: file_api_proto_depIdxs, + MessageInfos: file_api_proto_msgTypes, + }.Build() + File_api_proto = out.File + file_api_proto_rawDesc = nil + file_api_proto_goTypes = nil + file_api_proto_depIdxs = nil +} diff --git a/apis/runtime/v1alpha1/api.proto b/apis/runtime/v1alpha1/api.proto new file mode 100644 index 000000000..98d69ddb6 --- /dev/null +++ b/apis/runtime/v1alpha1/api.proto @@ -0,0 +1,156 @@ +/* +Copyright 2022 The Koordinator 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. +*/ + +// To regenerate api.pb.go run scripts/generate_runtime.sh +syntax = "proto3"; + +package runtime.v1alpha1; +option go_package = "github.com/koordinator-sh/koordinator/apis/runtime/v1alpha1"; + + +// PodSandboxMetadata holds all necessary information for sandbox. +message PodSandboxMetadata { + // Pod name of the sandbox. Same as the pod name in the Pod ObjectMeta. + string name = 1; + // Pod UID of the sandbox. Same as the pod UID in the Pod ObjectMeta. + string uid = 2; + // Pod namespace of the sandbox. Same as the pod namespace in the Pod ObjectMeta. + string namespace = 3; + // Attempt number of creating the sandbox. Default: 0. + uint32 attempt = 4; +} + +// RunPodSandboxHookRequest is sent to RuntimeHookServer before pod creating request transferred to +// backend containerd or dockerd. This Request is generated basing on CRI's RunPodSandboxRequest, including pod +// Meta, Resources, Annotations .e.g and RuntimeHookServer should ensure correct operations basing on +// this request. +message RunPodSandboxHookRequest { + // Metadata of the sandbox. This information will uniquely identify the sandbox. + PodSandboxMetadata pod_meta = 1; + // Named runtime to use for podSandbox. + string runtime_handler = 2; + // Labels/Annotations are key-value pairs that may be used. + map labels = 3; + map annotations = 4; + // Parent cgroup of the pod sandbox. + string cgroup_parent = 5; + // Optional overhead represents the overheads associated with this sandbox, + // same as LinuxPodSandboxConfig.overhead under CRI scenario + LinuxContainerResources overhead = 6; + // Optional resources represents the sum of container resources for this sandbox + // same as LinuxPodSandboxConfig.resources under CRI scenario + LinuxContainerResources resources = 7; +} + +// RunPodSandboxHookResponse is RuntimeHookServer's response to RunPodSandboxHookRequest. +// RuntimeManager will merge RunPodSandboxHookResponse and RunPodSandboxRequest to generate a +// RunPodSandboxRequest to containerd(dockerd). +message RunPodSandboxHookResponse { + // RuntimeHookServer may inject additional labels/annotations to PodSandboxRequest to be send to + // backend contaienrd/dockerd + map labels = 1; + map annotations = 2; + // RuntimeHookSever may modify cgroup_parent to construct customized cgroup topology. + string cgroup_parent = 3; + // RuntimeHookServer may modify the linux resource config. + // Optional resources represents the sum of container resources for this sandbox + LinuxContainerResources resources = 4; +} + +// LinuxContainerResources specifies Linux specific configuration for +// resources. +message LinuxContainerResources { + // CPU CFS (Completely Fair Scheduler) period. Default: 0 (not specified). + int64 cpu_period = 1; + // CPU CFS (Completely Fair Scheduler) quota. Default: 0 (not specified). + int64 cpu_quota = 2; + // CPU shares (relative weight vs. other containers). Default: 0 (not specified). + int64 cpu_shares = 3; + // Memory limit in bytes. Default: 0 (not specified). + int64 memory_limit_in_bytes = 4; + // OOMScoreAdj adjusts the oom-killer score. Default: 0 (not specified). + int64 oom_score_adj = 5; + // CpusetCpus constrains the allowed set of logical CPUs. Default: "" (not specified). + string cpuset_cpus = 6; + // CpusetMems constrains the allowed set of memory nodes. Default: "" (not specified). + string cpuset_mems = 7; + // List of HugepageLimits to limit the HugeTLB usage of container per page size. Default: nil (not specified). + repeated HugepageLimit hugepage_limits = 8; + // Unified resources for cgroup v2. Default: nil (not specified). + // Each key/value in the map refers to the cgroup v2. + // e.g. "memory.max": "6937202688" or "io.weight": "default 100". + map unified = 9; + // Memory swap limit in bytes. Default 0 (not specified). + int64 memory_swap_limit_in_bytes = 10; +} + +// HugepageLimit corresponds to the file`hugetlb..limit_in_byte` in container level cgroup. +// For example, `PageSize=1GB`, `Limit=1073741824` means setting `1073741824` bytes to hugetlb.1GB.limit_in_bytes. +message HugepageLimit { + // The value of PageSize has the format B (2MB, 1GB), + // and must match the of the corresponding control file found in `hugetlb..limit_in_bytes`. + // The values of are intended to be parsed using base 1024("1KB" = 1024, "1MB" = 1048576, etc). + string page_size = 1; + // limit in bytes of hugepagesize HugeTLB usage. + uint64 limit = 2; +} + +message ContainerMetadata { + // Name of the container. Same as the container name in the PodSpec. + string name = 1; + // Attempt number of creating the container. Default: 0. + uint32 attempt = 2; +} + +// ContainerResourceHookRequest is sent to RuntimeHookServer before/after container related operations including +// pre-container-start, post-container-create, pre-container-resource-update, post-container-stop. +message ContainerResourceHookRequest { + PodSandboxMetadata pod_meta = 1; + ContainerMetadata container_mata = 2; + // container related annotations + map container_annotations = 3; + LinuxContainerResources container_resources = 4; + LinuxContainerResources pod_resources = 5; + // TODO: add the error info from containerd/dockerd +} + +// ContainerResourceHookResponse is RuntimeHookServer's response to ContainerResourceHookRequest. +// RuntimeManager will merge ContainerResourceHookResponse and Pre hookType Request to generate a +// RunPodSandboxRequest to containerd(dockerd). +message ContainerResourceHookResponse { + map container_annotations = 1; + LinuxContainerResources container_resources = 2; +} + +// Runtime service defines the public APIs for talk between RuntimeHookServer and RuntimeManager +service RuntimeHookService { + // PreRunPodSandboxHook calls RuntimeHookServer before pod creating, and would merge RunPodSandboxHookResponse + // and Original RunPodSandboxRequest generating a new RunPodSandboxRequest to transfer to backend runtime engine. + // RuntimeHookServer should ensure the correct operations basing on RunPodSandboxHookRequest. + rpc PreRunPodSandboxHook(RunPodSandboxHookRequest) returns (RunPodSandboxHookResponse) {} + // PreStartContainerHook calls RuntimeHookServer before container starting, RuntimeHookServer could do some + // resource adjustments before container launching. + rpc PreStartContainerHook(ContainerResourceHookRequest) returns (ContainerResourceHookResponse) {} + // PostStartContainerHook calls RuntimeHookServer after container starting. RuntimeHookServer could do resource + // set checking after container launch. + rpc PostStartContainerHook(ContainerResourceHookRequest) returns (ContainerResourceHookResponse) {} + // PostStopContainerHook calls RuntimeHookServer after container stop. RuntimeHookServer could do resource setting + // garbage collection. + rpc PostStopContainerHook(ContainerResourceHookRequest) returns (ContainerResourceHookResponse) {} + // PreUpdateContainerResourcesHook calls RuntimeHookServer before container resource update to keep resource policy + // consistent + rpc PreUpdateContainerResourcesHook(ContainerResourceHookRequest) returns (ContainerResourceHookResponse) {} +} diff --git a/apis/runtime/v1alpha1/api_grpc.pb.go b/apis/runtime/v1alpha1/api_grpc.pb.go new file mode 100644 index 000000000..1ed15531d --- /dev/null +++ b/apis/runtime/v1alpha1/api_grpc.pb.go @@ -0,0 +1,271 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.17.3 +// source: api.proto + +package v1alpha1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// RuntimeHookServiceClient is the client API for RuntimeHookService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type RuntimeHookServiceClient interface { + // PreRunPodSandboxHook calls RuntimeHookServer before pod creating, and would merge RunPodSandboxHookResponse + // and Original RunPodSandboxRequest generating a new RunPodSandboxRequest to transfer to backend runtime engine. + // RuntimeHookServer should ensure the correct operations basing on RunPodSandboxHookRequest. + PreRunPodSandboxHook(ctx context.Context, in *RunPodSandboxHookRequest, opts ...grpc.CallOption) (*RunPodSandboxHookResponse, error) + // PreStartContainerHook calls RuntimeHookServer before container starting, RuntimeHookServer could do some + // resource adjustments before container launching. + PreStartContainerHook(ctx context.Context, in *ContainerResourceHookRequest, opts ...grpc.CallOption) (*ContainerResourceHookResponse, error) + // PostStartContainerHook calls RuntimeHookServer after container starting. RuntimeHookServer could do resource + // set checking after container launch. + PostStartContainerHook(ctx context.Context, in *ContainerResourceHookRequest, opts ...grpc.CallOption) (*ContainerResourceHookResponse, error) + // PostStopContainerHook calls RuntimeHookServer after container stop. RuntimeHookServer could do resource setting + // garbage collection. + PostStopContainerHook(ctx context.Context, in *ContainerResourceHookRequest, opts ...grpc.CallOption) (*ContainerResourceHookResponse, error) + // PreUpdateContainerResourcesHook calls RuntimeHookServer before container resource update to keep resource policy + // consistent + PreUpdateContainerResourcesHook(ctx context.Context, in *ContainerResourceHookRequest, opts ...grpc.CallOption) (*ContainerResourceHookResponse, error) +} + +type runtimeHookServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewRuntimeHookServiceClient(cc grpc.ClientConnInterface) RuntimeHookServiceClient { + return &runtimeHookServiceClient{cc} +} + +func (c *runtimeHookServiceClient) PreRunPodSandboxHook(ctx context.Context, in *RunPodSandboxHookRequest, opts ...grpc.CallOption) (*RunPodSandboxHookResponse, error) { + out := new(RunPodSandboxHookResponse) + err := c.cc.Invoke(ctx, "/runtime.v1alpha1.RuntimeHookService/PreRunPodSandboxHook", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeHookServiceClient) PreStartContainerHook(ctx context.Context, in *ContainerResourceHookRequest, opts ...grpc.CallOption) (*ContainerResourceHookResponse, error) { + out := new(ContainerResourceHookResponse) + err := c.cc.Invoke(ctx, "/runtime.v1alpha1.RuntimeHookService/PreStartContainerHook", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeHookServiceClient) PostStartContainerHook(ctx context.Context, in *ContainerResourceHookRequest, opts ...grpc.CallOption) (*ContainerResourceHookResponse, error) { + out := new(ContainerResourceHookResponse) + err := c.cc.Invoke(ctx, "/runtime.v1alpha1.RuntimeHookService/PostStartContainerHook", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeHookServiceClient) PostStopContainerHook(ctx context.Context, in *ContainerResourceHookRequest, opts ...grpc.CallOption) (*ContainerResourceHookResponse, error) { + out := new(ContainerResourceHookResponse) + err := c.cc.Invoke(ctx, "/runtime.v1alpha1.RuntimeHookService/PostStopContainerHook", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeHookServiceClient) PreUpdateContainerResourcesHook(ctx context.Context, in *ContainerResourceHookRequest, opts ...grpc.CallOption) (*ContainerResourceHookResponse, error) { + out := new(ContainerResourceHookResponse) + err := c.cc.Invoke(ctx, "/runtime.v1alpha1.RuntimeHookService/PreUpdateContainerResourcesHook", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// RuntimeHookServiceServer is the server API for RuntimeHookService service. +// All implementations must embed UnimplementedRuntimeHookServiceServer +// for forward compatibility +type RuntimeHookServiceServer interface { + // PreRunPodSandboxHook calls RuntimeHookServer before pod creating, and would merge RunPodSandboxHookResponse + // and Original RunPodSandboxRequest generating a new RunPodSandboxRequest to transfer to backend runtime engine. + // RuntimeHookServer should ensure the correct operations basing on RunPodSandboxHookRequest. + PreRunPodSandboxHook(context.Context, *RunPodSandboxHookRequest) (*RunPodSandboxHookResponse, error) + // PreStartContainerHook calls RuntimeHookServer before container starting, RuntimeHookServer could do some + // resource adjustments before container launching. + PreStartContainerHook(context.Context, *ContainerResourceHookRequest) (*ContainerResourceHookResponse, error) + // PostStartContainerHook calls RuntimeHookServer after container starting. RuntimeHookServer could do resource + // set checking after container launch. + PostStartContainerHook(context.Context, *ContainerResourceHookRequest) (*ContainerResourceHookResponse, error) + // PostStopContainerHook calls RuntimeHookServer after container stop. RuntimeHookServer could do resource setting + // garbage collection. + PostStopContainerHook(context.Context, *ContainerResourceHookRequest) (*ContainerResourceHookResponse, error) + // PreUpdateContainerResourcesHook calls RuntimeHookServer before container resource update to keep resource policy + // consistent + PreUpdateContainerResourcesHook(context.Context, *ContainerResourceHookRequest) (*ContainerResourceHookResponse, error) + mustEmbedUnimplementedRuntimeHookServiceServer() +} + +// UnimplementedRuntimeHookServiceServer must be embedded to have forward compatible implementations. +type UnimplementedRuntimeHookServiceServer struct { +} + +func (UnimplementedRuntimeHookServiceServer) PreRunPodSandboxHook(context.Context, *RunPodSandboxHookRequest) (*RunPodSandboxHookResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PreRunPodSandboxHook not implemented") +} +func (UnimplementedRuntimeHookServiceServer) PreStartContainerHook(context.Context, *ContainerResourceHookRequest) (*ContainerResourceHookResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PreStartContainerHook not implemented") +} +func (UnimplementedRuntimeHookServiceServer) PostStartContainerHook(context.Context, *ContainerResourceHookRequest) (*ContainerResourceHookResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PostStartContainerHook not implemented") +} +func (UnimplementedRuntimeHookServiceServer) PostStopContainerHook(context.Context, *ContainerResourceHookRequest) (*ContainerResourceHookResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PostStopContainerHook not implemented") +} +func (UnimplementedRuntimeHookServiceServer) PreUpdateContainerResourcesHook(context.Context, *ContainerResourceHookRequest) (*ContainerResourceHookResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PreUpdateContainerResourcesHook not implemented") +} +func (UnimplementedRuntimeHookServiceServer) mustEmbedUnimplementedRuntimeHookServiceServer() {} + +// UnsafeRuntimeHookServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to RuntimeHookServiceServer will +// result in compilation errors. +type UnsafeRuntimeHookServiceServer interface { + mustEmbedUnimplementedRuntimeHookServiceServer() +} + +func RegisterRuntimeHookServiceServer(s grpc.ServiceRegistrar, srv RuntimeHookServiceServer) { + s.RegisterService(&RuntimeHookService_ServiceDesc, srv) +} + +func _RuntimeHookService_PreRunPodSandboxHook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RunPodSandboxHookRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeHookServiceServer).PreRunPodSandboxHook(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/runtime.v1alpha1.RuntimeHookService/PreRunPodSandboxHook", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeHookServiceServer).PreRunPodSandboxHook(ctx, req.(*RunPodSandboxHookRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RuntimeHookService_PreStartContainerHook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ContainerResourceHookRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeHookServiceServer).PreStartContainerHook(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/runtime.v1alpha1.RuntimeHookService/PreStartContainerHook", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeHookServiceServer).PreStartContainerHook(ctx, req.(*ContainerResourceHookRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RuntimeHookService_PostStartContainerHook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ContainerResourceHookRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeHookServiceServer).PostStartContainerHook(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/runtime.v1alpha1.RuntimeHookService/PostStartContainerHook", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeHookServiceServer).PostStartContainerHook(ctx, req.(*ContainerResourceHookRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RuntimeHookService_PostStopContainerHook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ContainerResourceHookRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeHookServiceServer).PostStopContainerHook(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/runtime.v1alpha1.RuntimeHookService/PostStopContainerHook", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeHookServiceServer).PostStopContainerHook(ctx, req.(*ContainerResourceHookRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RuntimeHookService_PreUpdateContainerResourcesHook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ContainerResourceHookRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeHookServiceServer).PreUpdateContainerResourcesHook(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/runtime.v1alpha1.RuntimeHookService/PreUpdateContainerResourcesHook", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeHookServiceServer).PreUpdateContainerResourcesHook(ctx, req.(*ContainerResourceHookRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// RuntimeHookService_ServiceDesc is the grpc.ServiceDesc for RuntimeHookService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var RuntimeHookService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "runtime.v1alpha1.RuntimeHookService", + HandlerType: (*RuntimeHookServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "PreRunPodSandboxHook", + Handler: _RuntimeHookService_PreRunPodSandboxHook_Handler, + }, + { + MethodName: "PreStartContainerHook", + Handler: _RuntimeHookService_PreStartContainerHook_Handler, + }, + { + MethodName: "PostStartContainerHook", + Handler: _RuntimeHookService_PostStartContainerHook_Handler, + }, + { + MethodName: "PostStopContainerHook", + Handler: _RuntimeHookService_PostStopContainerHook_Handler, + }, + { + MethodName: "PreUpdateContainerResourcesHook", + Handler: _RuntimeHookService_PreUpdateContainerResourcesHook_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api.proto", +} diff --git a/go.mod b/go.mod index 43e07dc08..c60b9399f 100644 --- a/go.mod +++ b/go.mod @@ -17,6 +17,7 @@ require ( go.uber.org/atomic v1.7.0 golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac google.golang.org/grpc v1.38.0 + google.golang.org/protobuf v1.26.0 gorm.io/driver/sqlite v1.3.1 gorm.io/gorm v1.23.3 k8s.io/api v0.22.6 @@ -120,7 +121,6 @@ require ( gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect - google.golang.org/protobuf v1.26.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect diff --git a/scripts/generate_runtime.sh b/scripts/generate_runtime.sh new file mode 100644 index 000000000..5ab35974e --- /dev/null +++ b/scripts/generate_runtime.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +#Copyright 2022 The Koordinator 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. + +set -o errexit +set -o nounset +set -o pipefail + +KOORDINATOR_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. +KOORDINATOR_RUNTIME_ROOT="${KOORDINATOR_ROOT}/apis/runtime" + +runtime_versions=("v1alpha1") + +function generate_code() { + RUNTIME_API_VERSION="$1" + KOORDINATOR_RUNTIME_PATH="${KOORDINATOR_RUNTIME_ROOT}/${RUNTIME_API_VERSION}" + + protoc \ + --proto_path="${KOORDINATOR_RUNTIME_PATH}" \ + --go_opt=paths=source_relative \ + --go_out="${KOORDINATOR_RUNTIME_PATH}" \ + --go-grpc_opt=paths=source_relative \ + --go-grpc_out="${KOORDINATOR_RUNTIME_PATH}" \ + "api.proto" +} + +for v in "${runtime_versions[@]}"; do + generate_code "${v}" +done \ No newline at end of file