From f0edc31d325ad6a8c489df5ed9d4fb8f8cbef353 Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Wed, 21 May 2025 18:20:35 +0300 Subject: [PATCH 01/20] Makefile: don't assume/hardcode proto location. Neither assume that we have a single proto definition nor hardcode proto file locations for post-processing actions based on such an assumption. Signed-off-by: Krisztian Litkey --- Makefile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index a7ce65c1..d9e3372a 100644 --- a/Makefile +++ b/Makefile @@ -80,10 +80,15 @@ FORCE: # build-proto: check-protoc install-ttrpc-plugin install-wasm-plugin install-protoc-dependencies - for src in $(PROTO_SOURCES); do \ - $(PROTO_COMPILE) $$src; \ + $(Q)for src in $(PROTO_SOURCES); do \ + echo "Proto-compiling $$src..."; \ + $(PROTO_COMPILE) $$src || exit 1; \ + ttrpc=$$(dirname $$src)/api_ttrpc.pb.go && \ + if [ -f "$$ttrpc" ]; then \ + echo "Patching $$ttrpc..."; \ + sed -i '1s;^;//go:build !wasip1\n\n;' $$ttrpc; \ + fi; \ done - sed -i '1s;^;//go:build !wasip1\n\n;' pkg/api/api_ttrpc.pb.go .PHONY: build-proto-dockerized build-proto-dockerized: From 0201135ef45ac685e7ffab67555abcc42748d0cd Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Wed, 24 Sep 2025 17:11:50 +0300 Subject: [PATCH 02/20] api: move v1alpha1 API revision to pkg/api/v1alpha1. Move the current wire API revision from pkg/api to pkg/api/v1alpha1. Make importing from the original location an effective alias of importing from the new one. Signed-off-by: Krisztian Litkey --- .github/workflows/ci.yml | 2 +- Makefile | 12 + hack/gen-pkg-alias/gen-pkg-alias.go | 295 +++ hack/gen-pkg-alias/go.mod | 10 + hack/gen-pkg-alias/go.sum | 8 + hack/license-header | 15 + pkg/api/api-v1alpha1-wasm.go | 261 +++ pkg/api/api-v1alpha1.go | 275 +++ pkg/api/doc.go | 3 + pkg/api/{ => v1alpha1}/adjustment.go | 2 +- pkg/api/{ => v1alpha1}/api.pb.go | 2296 +++++++++++----------- pkg/api/{ => v1alpha1}/api.proto | 2 +- pkg/api/{ => v1alpha1}/api_host.pb.go | 4 +- pkg/api/{ => v1alpha1}/api_options.pb.go | 4 +- pkg/api/{ => v1alpha1}/api_plugin.pb.go | 4 +- pkg/api/{ => v1alpha1}/api_service.pb.go | 4 +- pkg/api/{ => v1alpha1}/api_ttrpc.pb.go | 4 +- pkg/api/{ => v1alpha1}/api_vtproto.pb.go | 4 +- pkg/api/{ => v1alpha1}/container.go | 2 +- pkg/api/{ => v1alpha1}/device.go | 2 +- pkg/api/v1alpha1/doc.go | 17 + pkg/api/{ => v1alpha1}/env.go | 2 +- pkg/api/{ => v1alpha1}/event.go | 2 +- pkg/api/{ => v1alpha1}/helpers.go | 2 +- pkg/api/{ => v1alpha1}/hooks.go | 2 +- pkg/api/{ => v1alpha1}/ioprio.go | 2 +- pkg/api/{ => v1alpha1}/mount.go | 2 +- pkg/api/{ => v1alpha1}/namespace.go | 2 +- pkg/api/{ => v1alpha1}/optional.go | 2 +- pkg/api/{ => v1alpha1}/owners.go | 2 +- pkg/api/{ => v1alpha1}/owners_test.go | 2 +- pkg/api/{ => v1alpha1}/plugin.go | 2 +- pkg/api/{ => v1alpha1}/resources.go | 2 +- pkg/api/{ => v1alpha1}/seccomp.go | 2 +- pkg/api/{ => v1alpha1}/strip.go | 2 +- pkg/api/{ => v1alpha1}/timeouts.go | 2 +- pkg/api/{ => v1alpha1}/update.go | 2 +- pkg/api/{ => v1alpha1}/validate.go | 2 +- 38 files changed, 2079 insertions(+), 1181 deletions(-) create mode 100644 hack/gen-pkg-alias/gen-pkg-alias.go create mode 100644 hack/gen-pkg-alias/go.mod create mode 100644 hack/gen-pkg-alias/go.sum create mode 100644 hack/license-header create mode 100644 pkg/api/api-v1alpha1-wasm.go create mode 100644 pkg/api/api-v1alpha1.go rename pkg/api/{ => v1alpha1}/adjustment.go (99%) rename pkg/api/{ => v1alpha1}/api.pb.go (65%) rename pkg/api/{ => v1alpha1}/api.proto (99%) rename pkg/api/{ => v1alpha1}/api_host.pb.go (99%) rename pkg/api/{ => v1alpha1}/api_options.pb.go (96%) rename pkg/api/{ => v1alpha1}/api_plugin.pb.go (99%) rename pkg/api/{ => v1alpha1}/api_service.pb.go (98%) rename pkg/api/{ => v1alpha1}/api_ttrpc.pb.go (99%) rename pkg/api/{ => v1alpha1}/api_vtproto.pb.go (99%) rename pkg/api/{ => v1alpha1}/container.go (98%) rename pkg/api/{ => v1alpha1}/device.go (99%) create mode 100644 pkg/api/v1alpha1/doc.go rename pkg/api/{ => v1alpha1}/env.go (98%) rename pkg/api/{ => v1alpha1}/event.go (99%) rename pkg/api/{ => v1alpha1}/helpers.go (99%) rename pkg/api/{ => v1alpha1}/hooks.go (99%) rename pkg/api/{ => v1alpha1}/ioprio.go (99%) rename pkg/api/{ => v1alpha1}/mount.go (99%) rename pkg/api/{ => v1alpha1}/namespace.go (98%) rename pkg/api/{ => v1alpha1}/optional.go (99%) rename pkg/api/{ => v1alpha1}/owners.go (99%) rename pkg/api/{ => v1alpha1}/owners_test.go (99%) rename pkg/api/{ => v1alpha1}/plugin.go (99%) rename pkg/api/{ => v1alpha1}/resources.go (99%) rename pkg/api/{ => v1alpha1}/seccomp.go (99%) rename pkg/api/{ => v1alpha1}/strip.go (99%) rename pkg/api/{ => v1alpha1}/timeouts.go (98%) rename pkg/api/{ => v1alpha1}/update.go (99%) rename pkg/api/{ => v1alpha1}/validate.go (99%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b56bcf39..da84c836 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,7 +58,7 @@ jobs: - name: Force regeneration of protobuf files on build run: | - touch pkg/api/api.proto + touch pkg/api/*/api.proto - run: | make all diff --git a/Makefile b/Makefile index d9e3372a..a2fc8b61 100644 --- a/Makefile +++ b/Makefile @@ -73,6 +73,8 @@ allclean: clean clean-cache test: test-gopkgs +generate: generate-golang + FORCE: # @@ -184,6 +186,16 @@ validate-repo-no-changes: exit 1; \ } +# +# golang generation targets +# + +generate-golang: pkg/api/api-v1alpha1.go pkg/api/api-v1alpha1-wasm.go + +pkg/api/api-v1alpha1.go pkg/api/api-v1alpha1-wasm.go: pkg/api/v1alpha1/api.proto pkg/api/doc.go + $(Q)echo "Regenerating $@..."; \ + $(GO_CMD) generate ./pkg/api + # # targets for installing dependencies # diff --git a/hack/gen-pkg-alias/gen-pkg-alias.go b/hack/gen-pkg-alias/gen-pkg-alias.go new file mode 100644 index 00000000..678b9efe --- /dev/null +++ b/hack/gen-pkg-alias/gen-pkg-alias.go @@ -0,0 +1,295 @@ +/* + 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 main + +import ( + "flag" + "fmt" + "go/types" + "log" + "os" + "path/filepath" + "strings" + + "golang.org/x/tools/go/packages" +) + +type Aliasen struct { + SrcPath string + SrcName string + DstName string + DstFile string + Out *os.File + BuildFlags []string + License string + Filtered []string + Constants []string + Variables []string + Types []string + Functions []string + Command []string +} + +func (a *Aliasen) Collect(src, dst *packages.Package) { + if src == nil { + return + } + + names := src.Types.Scope().Names() + if len(names) == 0 { + return + } + + conflicts := []string{} + + for _, name := range names { + obj := src.Types.Scope().Lookup(name) + if obj == nil || !obj.Exported() { + continue + } + + if o := dst.Types.Scope().Lookup(name); o != nil { + if a.Filtered != nil { + fmt.Fprintf(os.Stderr, + "skipping %s: filtering existing/conflicting name...\n", name) + a.Filtered = append(a.Filtered, name) + continue + } + conflicts = append(conflicts, name) + } + + switch obj.(type) { + case *types.Const: + a.Constants = append(a.Constants, name) + case *types.Var: + a.Variables = append(a.Variables, name) + case *types.TypeName: + a.Types = append(a.Types, name) + case *types.Func: + a.Functions = append(a.Functions, name) + } + } + + if len(conflicts) > 0 { + for _, name := range conflicts { + fmt.Fprintf(os.Stderr, "error: conflicting name %s already defined\n", name) + } + os.Exit(1) + } +} + +func (a *Aliasen) Emit() { + if len(a.Types)+len(a.Functions)+len(a.Constants)+len(a.Variables) == 0 { + return + } + + if a.Out == nil { + f, err := os.OpenFile(a.DstFile, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0o0644) + if err != nil { + log.Fatalf("failed to open file %s: %v", a.DstFile, err) + } + a.Out = f + defer f.Close() + } + + a.EmitHeader() + a.EmitBlock(a.Constants, "aliased constants", "const") + a.EmitBlock(a.Variables, "aliased variables", "var") + a.EmitBlock(a.Types, "aliased types", "type") + a.EmitBlock(a.Functions, "aliased functions", "var") + a.EmitBlock(a.Filtered, "filtered conflicting names", "// filtered due to conflicts") +} + +func (a *Aliasen) EmitHeader() { + if len(a.BuildFlags) > 0 { + for _, f := range a.BuildFlags { + a.emit("//go:build %s\n", f) + } + a.emit("\n") + } + + if a.License != "" { + a.emit("%s\n", a.License) + } + a.emit("// Code generated by %s. DO NOT EDIT.\n", filepath.Base(a.Command[0])) + a.emit("\n") + a.emit("//nolint:revive\n") + a.emit("package %s\n", a.DstName) + a.emit("\n") + a.emit("import (\n") + a.emit(" \"%s\"\n", a.SrcPath) + a.emit(")\n") +} + +func (a *Aliasen) EmitBlock(names []string, kind, keyword string) { + if len(names) == 0 { + return + } + + a.emit("\n") + + comment := "" + if strings.HasPrefix(keyword, "//") { + comment = "// " + } + max := maxLen(names) + a.emit("// %s from %s\n", kind, a.SrcPath) + a.emit("%s (\n", keyword) + for _, n := range names { + a.emit("%s %-*s = %s.%s\n", comment, max, n, a.SrcName, n) + } + a.emit("%s)\n", comment) +} + +func (a *Aliasen) emit(format string, args ...interface{}) { + if _, err := fmt.Fprintf(a.Out, format, args...); err != nil { + log.Fatalf("failed to write %s: %v\n", a.DstFile, err) + } +} + +func maxLen(strings []string) int { + max := 0 + for _, s := range strings { + if len(s) > max { + max = len(s) + } + } + return max +} + +func main() { + var ( + srcDir = flag.String("src", "", "source package path") + dstDir = flag.String("dst", "", "destination package path") + output = flag.String("out", "", "output file name") + bFlags = flag.String("build-flags", "", "build flags to pass to go/packages") + licFile = flag.String("license", "", "file to read license header from") + remove = flag.Bool("remove", false, "remove output before loading destination package") + filter = flag.Bool("filter-conflicting", false, "filter conflicting names") + license = "" + ) + + flag.StringVar(srcDir, "s", "", "source package path") + flag.StringVar(dstDir, "d", "", "destination package path") + flag.StringVar(output, "o", "", "output file name") + flag.StringVar(bFlags, "b", "", "build flags to pass to go/packages") + flag.StringVar(licFile, "l", "", "file to read license header from") + flag.BoolVar(remove, "rm", false, "remove output before loading destination package") + flag.BoolVar(filter, "f", false, "filter conflicting names") + + if err := flag.CommandLine.Parse(os.Args[1:]); err != nil { + log.Fatalf("invalid command line: %v\n", err) + } + + if *srcDir == "" { + fmt.Fprintf(os.Stderr, "missing source package\n") + flag.CommandLine.Usage() + os.Exit(1) + } + if *dstDir == "" { + fmt.Fprintf(os.Stderr, "missing destination package\n") + flag.CommandLine.Usage() + os.Exit(1) + } + + if *output == "" { + *output = "-" + } + if *output != "-" { + if filepath.Base(*output) != *output { + log.Fatalf("output file name has directory prefix\n") + } + if filepath.Ext(*output) != ".go" { + *output += ".go" + } + + if *remove { + if err := os.Remove(filepath.Join(*dstDir, *output)); err != nil { + if !os.IsNotExist(err) { + log.Fatalf("failed to remove output file %s: %v\n", *output, err) + } + } + } + } + + if *licFile != "" { + l, err := os.ReadFile(*licFile) + if err != nil { + log.Fatalf("failed to read license header file %s: %v\n", *licFile, err) + } + license = string(l) + } + + cfg := &packages.Config{ + Mode: packages.NeedName | + packages.NeedTypes | + packages.NeedTypesInfo | + packages.NeedImports | + packages.NeedDeps, + Tests: false, + } + + src, err := packages.Load(cfg, *srcDir) + if err != nil { + log.Fatalf("failed to load source package %s: %v", *srcDir, err) + } + if packages.PrintErrors(src) > 0 { + os.Exit(1) + } + if len(src) != 1 { + fmt.Fprintf(os.Stderr, "expecting 1 source package, got %d\n", len(src)) + } + + dst, err := packages.Load(cfg, *dstDir) + if err != nil { + log.Fatalf("failed to load destination package %s: %v", *dstDir, err) + } + if packages.PrintErrors(dst) > 0 { + fmt.Fprintf(os.Stderr, "printed dst errors...\n") + os.Exit(1) + } + if len(dst) != 1 { + fmt.Fprintf(os.Stderr, "expecting 1 destination package, got %d\n", len(dst)) + } + + a := &Aliasen{ + DstName: dst[0].Name, + DstFile: *output, + License: license, + Command: os.Args, + } + + if *filter { + a.Filtered = []string{} + } + + if *bFlags != "" { + a.BuildFlags = strings.Split(*bFlags, ",") + } + + if *output == "-" { + a.Out = os.Stdout + } else { + a.DstFile = filepath.Join(*dstDir, *output) + } + + a.SrcPath = src[0].PkgPath + a.SrcName = src[0].Name + + a.Collect(src[0], dst[0]) + a.Emit() +} diff --git a/hack/gen-pkg-alias/go.mod b/hack/gen-pkg-alias/go.mod new file mode 100644 index 00000000..3f5b74f2 --- /dev/null +++ b/hack/gen-pkg-alias/go.mod @@ -0,0 +1,10 @@ +module github.com/klihub/hack/gen-pkg-alias + +go 1.24.0 + +require golang.org/x/tools v0.37.0 + +require ( + golang.org/x/mod v0.28.0 // indirect + golang.org/x/sync v0.17.0 // indirect +) diff --git a/hack/gen-pkg-alias/go.sum b/hack/gen-pkg-alias/go.sum new file mode 100644 index 00000000..1fa55e6d --- /dev/null +++ b/hack/gen-pkg-alias/go.sum @@ -0,0 +1,8 @@ +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +golang.org/x/mod v0.28.0 h1:gQBtGhjxykdjY9YhZpSlZIsbnaE2+PgjfLWUQTnoZ1U= +golang.org/x/mod v0.28.0/go.mod h1:yfB/L0NOf/kmEbXjzCPOx1iK1fRutOydrCMsqRhEBxI= +golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug= +golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= +golang.org/x/tools v0.37.0 h1:DVSRzp7FwePZW356yEAChSdNcQo6Nsp+fex1SUW09lE= +golang.org/x/tools v0.37.0/go.mod h1:MBN5QPQtLMHVdvsbtarmTNukZDdgwdwlO5qGacAzF0w= diff --git a/hack/license-header b/hack/license-header new file mode 100644 index 00000000..c073fa4a --- /dev/null +++ b/hack/license-header @@ -0,0 +1,15 @@ +/* + 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. +*/ diff --git a/pkg/api/api-v1alpha1-wasm.go b/pkg/api/api-v1alpha1-wasm.go new file mode 100644 index 00000000..db1734d0 --- /dev/null +++ b/pkg/api/api-v1alpha1-wasm.go @@ -0,0 +1,261 @@ +//go:build wasip1 + +/* + 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. +*/ + +// Code generated by gen-pkg-alias. DO NOT EDIT. + +//nolint:revive +package api + +import ( + "github.com/containerd/nri/pkg/api/v1alpha1" +) + +// aliased constants from github.com/containerd/nri/pkg/api/v1alpha1 +const ( + ContainerState_CONTAINER_CREATED = v1alpha1.ContainerState_CONTAINER_CREATED + ContainerState_CONTAINER_PAUSED = v1alpha1.ContainerState_CONTAINER_PAUSED + ContainerState_CONTAINER_RUNNING = v1alpha1.ContainerState_CONTAINER_RUNNING + ContainerState_CONTAINER_STOPPED = v1alpha1.ContainerState_CONTAINER_STOPPED + ContainerState_CONTAINER_UNKNOWN = v1alpha1.ContainerState_CONTAINER_UNKNOWN + DefaultPluginRegistrationTimeout = v1alpha1.DefaultPluginRegistrationTimeout + DefaultPluginRequestTimeout = v1alpha1.DefaultPluginRequestTimeout + DefaultSocketPath = v1alpha1.DefaultSocketPath + Event_CREATE_CONTAINER = v1alpha1.Event_CREATE_CONTAINER + Event_LAST = v1alpha1.Event_LAST + Event_POST_CREATE_CONTAINER = v1alpha1.Event_POST_CREATE_CONTAINER + Event_POST_START_CONTAINER = v1alpha1.Event_POST_START_CONTAINER + Event_POST_UPDATE_CONTAINER = v1alpha1.Event_POST_UPDATE_CONTAINER + Event_POST_UPDATE_POD_SANDBOX = v1alpha1.Event_POST_UPDATE_POD_SANDBOX + Event_REMOVE_CONTAINER = v1alpha1.Event_REMOVE_CONTAINER + Event_REMOVE_POD_SANDBOX = v1alpha1.Event_REMOVE_POD_SANDBOX + Event_RUN_POD_SANDBOX = v1alpha1.Event_RUN_POD_SANDBOX + Event_START_CONTAINER = v1alpha1.Event_START_CONTAINER + Event_STOP_CONTAINER = v1alpha1.Event_STOP_CONTAINER + Event_STOP_POD_SANDBOX = v1alpha1.Event_STOP_POD_SANDBOX + Event_UNKNOWN = v1alpha1.Event_UNKNOWN + Event_UPDATE_CONTAINER = v1alpha1.Event_UPDATE_CONTAINER + Event_UPDATE_POD_SANDBOX = v1alpha1.Event_UPDATE_POD_SANDBOX + Event_VALIDATE_CONTAINER_ADJUSTMENT = v1alpha1.Event_VALIDATE_CONTAINER_ADJUSTMENT + Field_Annotations = v1alpha1.Field_Annotations + Field_Args = v1alpha1.Field_Args + Field_BlockioClass = v1alpha1.Field_BlockioClass + Field_CPUPeriod = v1alpha1.Field_CPUPeriod + Field_CPUQuota = v1alpha1.Field_CPUQuota + Field_CPURealtimePeriod = v1alpha1.Field_CPURealtimePeriod + Field_CPURealtimeRuntime = v1alpha1.Field_CPURealtimeRuntime + Field_CPUSetCPUs = v1alpha1.Field_CPUSetCPUs + Field_CPUSetMems = v1alpha1.Field_CPUSetMems + Field_CPUShares = v1alpha1.Field_CPUShares + Field_CdiDevices = v1alpha1.Field_CdiDevices + Field_CgroupsPath = v1alpha1.Field_CgroupsPath + Field_CgroupsUnified = v1alpha1.Field_CgroupsUnified + Field_Devices = v1alpha1.Field_Devices + Field_Env = v1alpha1.Field_Env + Field_HugepageLimits = v1alpha1.Field_HugepageLimits + Field_IoPriority = v1alpha1.Field_IoPriority + Field_MemDisableOomKiller = v1alpha1.Field_MemDisableOomKiller + Field_MemKernelLimit = v1alpha1.Field_MemKernelLimit + Field_MemLimit = v1alpha1.Field_MemLimit + Field_MemReservation = v1alpha1.Field_MemReservation + Field_MemSwapLimit = v1alpha1.Field_MemSwapLimit + Field_MemSwappiness = v1alpha1.Field_MemSwappiness + Field_MemTCPLimit = v1alpha1.Field_MemTCPLimit + Field_MemUseHierarchy = v1alpha1.Field_MemUseHierarchy + Field_Mounts = v1alpha1.Field_Mounts + Field_Namespace = v1alpha1.Field_Namespace + Field_None = v1alpha1.Field_None + Field_OciHooks = v1alpha1.Field_OciHooks + Field_OomScoreAdj = v1alpha1.Field_OomScoreAdj + Field_PidsLimit = v1alpha1.Field_PidsLimit + Field_RdtClass = v1alpha1.Field_RdtClass + Field_Rlimits = v1alpha1.Field_Rlimits + Field_SeccompPolicy = v1alpha1.Field_SeccompPolicy + IOPrioClass_IOPRIO_CLASS_BE = v1alpha1.IOPrioClass_IOPRIO_CLASS_BE + IOPrioClass_IOPRIO_CLASS_IDLE = v1alpha1.IOPrioClass_IOPRIO_CLASS_IDLE + IOPrioClass_IOPRIO_CLASS_NONE = v1alpha1.IOPrioClass_IOPRIO_CLASS_NONE + IOPrioClass_IOPRIO_CLASS_RT = v1alpha1.IOPrioClass_IOPRIO_CLASS_RT + LogRequest_LEVEL_DEBUG = v1alpha1.LogRequest_LEVEL_DEBUG + LogRequest_LEVEL_ERROR = v1alpha1.LogRequest_LEVEL_ERROR + LogRequest_LEVEL_INFO = v1alpha1.LogRequest_LEVEL_INFO + LogRequest_LEVEL_UNSPECIFIED = v1alpha1.LogRequest_LEVEL_UNSPECIFIED + LogRequest_LEVEL_WARN = v1alpha1.LogRequest_LEVEL_WARN + PluginIdxEnvVar = v1alpha1.PluginIdxEnvVar + PluginNameEnvVar = v1alpha1.PluginNameEnvVar + PluginPluginAPIVersion = v1alpha1.PluginPluginAPIVersion + PluginSocketEnvVar = v1alpha1.PluginSocketEnvVar + SELinuxRelabel = v1alpha1.SELinuxRelabel + SecurityProfile_LOCALHOST = v1alpha1.SecurityProfile_LOCALHOST + SecurityProfile_RUNTIME_DEFAULT = v1alpha1.SecurityProfile_RUNTIME_DEFAULT + SecurityProfile_UNCONFINED = v1alpha1.SecurityProfile_UNCONFINED + ValidEvents = v1alpha1.ValidEvents +) + +// aliased variables from github.com/containerd/nri/pkg/api/v1alpha1 +var ( + ContainerState_name = v1alpha1.ContainerState_name + ContainerState_value = v1alpha1.ContainerState_value + ErrIntOverflow = v1alpha1.ErrIntOverflow + ErrInvalidLength = v1alpha1.ErrInvalidLength + ErrUnexpectedEndOfGroup = v1alpha1.ErrUnexpectedEndOfGroup + Event_name = v1alpha1.Event_name + Event_value = v1alpha1.Event_value + Field_name = v1alpha1.Field_name + Field_value = v1alpha1.Field_value + File_pkg_api_v1alpha1_api_proto = v1alpha1.File_pkg_api_v1alpha1_api_proto + IOPrioClass_name = v1alpha1.IOPrioClass_name + IOPrioClass_value = v1alpha1.IOPrioClass_value + LogRequest_Level_name = v1alpha1.LogRequest_Level_name + LogRequest_Level_value = v1alpha1.LogRequest_Level_value + SecurityProfile_ProfileType_name = v1alpha1.SecurityProfile_ProfileType_name + SecurityProfile_ProfileType_value = v1alpha1.SecurityProfile_ProfileType_value +) + +// aliased types from github.com/containerd/nri/pkg/api/v1alpha1 +type ( + CDIDevice = v1alpha1.CDIDevice + CompoundFieldOwners = v1alpha1.CompoundFieldOwners + ConfigureRequest = v1alpha1.ConfigureRequest + ConfigureResponse = v1alpha1.ConfigureResponse + Container = v1alpha1.Container + ContainerAdjustment = v1alpha1.ContainerAdjustment + ContainerEviction = v1alpha1.ContainerEviction + ContainerState = v1alpha1.ContainerState + ContainerUpdate = v1alpha1.ContainerUpdate + CreateContainerRequest = v1alpha1.CreateContainerRequest + CreateContainerResponse = v1alpha1.CreateContainerResponse + Empty = v1alpha1.Empty + Event = v1alpha1.Event + EventMask = v1alpha1.EventMask + Field = v1alpha1.Field + FieldOwners = v1alpha1.FieldOwners + Hook = v1alpha1.Hook + Hooks = v1alpha1.Hooks + HostFunctions = v1alpha1.HostFunctions + HugepageLimit = v1alpha1.HugepageLimit + IOPrioClass = v1alpha1.IOPrioClass + KeyValue = v1alpha1.KeyValue + LinuxCPU = v1alpha1.LinuxCPU + LinuxContainer = v1alpha1.LinuxContainer + LinuxContainerAdjustment = v1alpha1.LinuxContainerAdjustment + LinuxContainerUpdate = v1alpha1.LinuxContainerUpdate + LinuxDevice = v1alpha1.LinuxDevice + LinuxDeviceCgroup = v1alpha1.LinuxDeviceCgroup + LinuxIOPriority = v1alpha1.LinuxIOPriority + LinuxMemory = v1alpha1.LinuxMemory + LinuxNamespace = v1alpha1.LinuxNamespace + LinuxPids = v1alpha1.LinuxPids + LinuxPodSandbox = v1alpha1.LinuxPodSandbox + LinuxResources = v1alpha1.LinuxResources + LinuxSeccomp = v1alpha1.LinuxSeccomp + LinuxSeccompArg = v1alpha1.LinuxSeccompArg + LinuxSyscall = v1alpha1.LinuxSyscall + LogRequest = v1alpha1.LogRequest + LogRequest_Level = v1alpha1.LogRequest_Level + Mount = v1alpha1.Mount + OptionalBool = v1alpha1.OptionalBool + OptionalFileMode = v1alpha1.OptionalFileMode + OptionalInt = v1alpha1.OptionalInt + OptionalInt32 = v1alpha1.OptionalInt32 + OptionalInt64 = v1alpha1.OptionalInt64 + OptionalString = v1alpha1.OptionalString + OptionalUInt32 = v1alpha1.OptionalUInt32 + OptionalUInt64 = v1alpha1.OptionalUInt64 + OwningPlugins = v1alpha1.OwningPlugins + POSIXRlimit = v1alpha1.POSIXRlimit + Plugin = v1alpha1.Plugin + PluginInstance = v1alpha1.PluginInstance + PodSandbox = v1alpha1.PodSandbox + PostCreateContainerRequest = v1alpha1.PostCreateContainerRequest + PostCreateContainerResponse = v1alpha1.PostCreateContainerResponse + PostStartContainerRequest = v1alpha1.PostStartContainerRequest + PostStartContainerResponse = v1alpha1.PostStartContainerResponse + PostUpdateContainerRequest = v1alpha1.PostUpdateContainerRequest + PostUpdateContainerResponse = v1alpha1.PostUpdateContainerResponse + PostUpdatePodSandboxRequest = v1alpha1.PostUpdatePodSandboxRequest + PostUpdatePodSandboxResponse = v1alpha1.PostUpdatePodSandboxResponse + RegisterPluginRequest = v1alpha1.RegisterPluginRequest + RemoveContainerRequest = v1alpha1.RemoveContainerRequest + RemoveContainerResponse = v1alpha1.RemoveContainerResponse + RemovePodSandboxRequest = v1alpha1.RemovePodSandboxRequest + RemovePodSandboxResponse = v1alpha1.RemovePodSandboxResponse + RunPodSandboxRequest = v1alpha1.RunPodSandboxRequest + RunPodSandboxResponse = v1alpha1.RunPodSandboxResponse + SecurityProfile = v1alpha1.SecurityProfile + SecurityProfile_ProfileType = v1alpha1.SecurityProfile_ProfileType + ShutdownRequest = v1alpha1.ShutdownRequest + ShutdownResponse = v1alpha1.ShutdownResponse + StartContainerRequest = v1alpha1.StartContainerRequest + StartContainerResponse = v1alpha1.StartContainerResponse + StateChangeEvent = v1alpha1.StateChangeEvent + StateChangeResponse = v1alpha1.StateChangeResponse + StopContainerRequest = v1alpha1.StopContainerRequest + StopContainerResponse = v1alpha1.StopContainerResponse + StopPodSandboxRequest = v1alpha1.StopPodSandboxRequest + StopPodSandboxResponse = v1alpha1.StopPodSandboxResponse + SynchronizeRequest = v1alpha1.SynchronizeRequest + SynchronizeResponse = v1alpha1.SynchronizeResponse + UpdateContainerRequest = v1alpha1.UpdateContainerRequest + UpdateContainerResponse = v1alpha1.UpdateContainerResponse + UpdateContainersRequest = v1alpha1.UpdateContainersRequest + UpdateContainersResponse = v1alpha1.UpdateContainersResponse + UpdatePodSandboxRequest = v1alpha1.UpdatePodSandboxRequest + UpdatePodSandboxResponse = v1alpha1.UpdatePodSandboxResponse + User = v1alpha1.User + ValidateContainerAdjustmentRequest = v1alpha1.ValidateContainerAdjustmentRequest + ValidateContainerAdjustmentResponse = v1alpha1.ValidateContainerAdjustmentResponse +) + +// aliased functions from github.com/containerd/nri/pkg/api/v1alpha1 +var ( + Bool = v1alpha1.Bool + CheckPluginIndex = v1alpha1.CheckPluginIndex + ClearRemovalMarker = v1alpha1.ClearRemovalMarker + DupStringMap = v1alpha1.DupStringMap + DupStringSlice = v1alpha1.DupStringSlice + FileMode = v1alpha1.FileMode + FromOCIEnv = v1alpha1.FromOCIEnv + FromOCIHookSlice = v1alpha1.FromOCIHookSlice + FromOCIHooks = v1alpha1.FromOCIHooks + FromOCIIOPriorityClass = v1alpha1.FromOCIIOPriorityClass + FromOCILinuxDevices = v1alpha1.FromOCILinuxDevices + FromOCILinuxIOPriority = v1alpha1.FromOCILinuxIOPriority + FromOCILinuxNamespaces = v1alpha1.FromOCILinuxNamespaces + FromOCILinuxResources = v1alpha1.FromOCILinuxResources + FromOCILinuxSeccomp = v1alpha1.FromOCILinuxSeccomp + FromOCILinuxSeccompArgs = v1alpha1.FromOCILinuxSeccompArgs + FromOCILinuxSyscalls = v1alpha1.FromOCILinuxSyscalls + FromOCIMounts = v1alpha1.FromOCIMounts + Int = v1alpha1.Int + Int32 = v1alpha1.Int32 + Int64 = v1alpha1.Int64 + IsMarkedForRemoval = v1alpha1.IsMarkedForRemoval + MarkForRemoval = v1alpha1.MarkForRemoval + MustParseEventMask = v1alpha1.MustParseEventMask + NewCompoundFieldOwners = v1alpha1.NewCompoundFieldOwners + NewFieldOwners = v1alpha1.NewFieldOwners + NewHostFunctions = v1alpha1.NewHostFunctions + NewOwningPlugins = v1alpha1.NewOwningPlugins + ParseEventMask = v1alpha1.ParseEventMask + ParsePluginName = v1alpha1.ParsePluginName + RegisterPlugin = v1alpha1.RegisterPlugin + String = v1alpha1.String + ToOCILinuxSeccompArgs = v1alpha1.ToOCILinuxSeccompArgs + ToOCILinuxSyscalls = v1alpha1.ToOCILinuxSyscalls + UInt32 = v1alpha1.UInt32 + UInt64 = v1alpha1.UInt64 +) diff --git a/pkg/api/api-v1alpha1.go b/pkg/api/api-v1alpha1.go new file mode 100644 index 00000000..ed5d0e25 --- /dev/null +++ b/pkg/api/api-v1alpha1.go @@ -0,0 +1,275 @@ +//go:build !wasip1 + +/* + 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. +*/ + +// Code generated by gen-pkg-alias. DO NOT EDIT. + +//nolint:revive +package api + +import ( + "github.com/containerd/nri/pkg/api/v1alpha1" +) + +// aliased constants from github.com/containerd/nri/pkg/api/v1alpha1 +const ( + ContainerState_CONTAINER_CREATED = v1alpha1.ContainerState_CONTAINER_CREATED + ContainerState_CONTAINER_PAUSED = v1alpha1.ContainerState_CONTAINER_PAUSED + ContainerState_CONTAINER_RUNNING = v1alpha1.ContainerState_CONTAINER_RUNNING + ContainerState_CONTAINER_STOPPED = v1alpha1.ContainerState_CONTAINER_STOPPED + ContainerState_CONTAINER_UNKNOWN = v1alpha1.ContainerState_CONTAINER_UNKNOWN + DefaultPluginRegistrationTimeout = v1alpha1.DefaultPluginRegistrationTimeout + DefaultPluginRequestTimeout = v1alpha1.DefaultPluginRequestTimeout + DefaultSocketPath = v1alpha1.DefaultSocketPath + Event_CREATE_CONTAINER = v1alpha1.Event_CREATE_CONTAINER + Event_LAST = v1alpha1.Event_LAST + Event_POST_CREATE_CONTAINER = v1alpha1.Event_POST_CREATE_CONTAINER + Event_POST_START_CONTAINER = v1alpha1.Event_POST_START_CONTAINER + Event_POST_UPDATE_CONTAINER = v1alpha1.Event_POST_UPDATE_CONTAINER + Event_POST_UPDATE_POD_SANDBOX = v1alpha1.Event_POST_UPDATE_POD_SANDBOX + Event_REMOVE_CONTAINER = v1alpha1.Event_REMOVE_CONTAINER + Event_REMOVE_POD_SANDBOX = v1alpha1.Event_REMOVE_POD_SANDBOX + Event_RUN_POD_SANDBOX = v1alpha1.Event_RUN_POD_SANDBOX + Event_START_CONTAINER = v1alpha1.Event_START_CONTAINER + Event_STOP_CONTAINER = v1alpha1.Event_STOP_CONTAINER + Event_STOP_POD_SANDBOX = v1alpha1.Event_STOP_POD_SANDBOX + Event_UNKNOWN = v1alpha1.Event_UNKNOWN + Event_UPDATE_CONTAINER = v1alpha1.Event_UPDATE_CONTAINER + Event_UPDATE_POD_SANDBOX = v1alpha1.Event_UPDATE_POD_SANDBOX + Event_VALIDATE_CONTAINER_ADJUSTMENT = v1alpha1.Event_VALIDATE_CONTAINER_ADJUSTMENT + Field_Annotations = v1alpha1.Field_Annotations + Field_Args = v1alpha1.Field_Args + Field_BlockioClass = v1alpha1.Field_BlockioClass + Field_CPUPeriod = v1alpha1.Field_CPUPeriod + Field_CPUQuota = v1alpha1.Field_CPUQuota + Field_CPURealtimePeriod = v1alpha1.Field_CPURealtimePeriod + Field_CPURealtimeRuntime = v1alpha1.Field_CPURealtimeRuntime + Field_CPUSetCPUs = v1alpha1.Field_CPUSetCPUs + Field_CPUSetMems = v1alpha1.Field_CPUSetMems + Field_CPUShares = v1alpha1.Field_CPUShares + Field_CdiDevices = v1alpha1.Field_CdiDevices + Field_CgroupsPath = v1alpha1.Field_CgroupsPath + Field_CgroupsUnified = v1alpha1.Field_CgroupsUnified + Field_Devices = v1alpha1.Field_Devices + Field_Env = v1alpha1.Field_Env + Field_HugepageLimits = v1alpha1.Field_HugepageLimits + Field_IoPriority = v1alpha1.Field_IoPriority + Field_MemDisableOomKiller = v1alpha1.Field_MemDisableOomKiller + Field_MemKernelLimit = v1alpha1.Field_MemKernelLimit + Field_MemLimit = v1alpha1.Field_MemLimit + Field_MemReservation = v1alpha1.Field_MemReservation + Field_MemSwapLimit = v1alpha1.Field_MemSwapLimit + Field_MemSwappiness = v1alpha1.Field_MemSwappiness + Field_MemTCPLimit = v1alpha1.Field_MemTCPLimit + Field_MemUseHierarchy = v1alpha1.Field_MemUseHierarchy + Field_Mounts = v1alpha1.Field_Mounts + Field_Namespace = v1alpha1.Field_Namespace + Field_None = v1alpha1.Field_None + Field_OciHooks = v1alpha1.Field_OciHooks + Field_OomScoreAdj = v1alpha1.Field_OomScoreAdj + Field_PidsLimit = v1alpha1.Field_PidsLimit + Field_RdtClass = v1alpha1.Field_RdtClass + Field_Rlimits = v1alpha1.Field_Rlimits + Field_SeccompPolicy = v1alpha1.Field_SeccompPolicy + IOPrioClass_IOPRIO_CLASS_BE = v1alpha1.IOPrioClass_IOPRIO_CLASS_BE + IOPrioClass_IOPRIO_CLASS_IDLE = v1alpha1.IOPrioClass_IOPRIO_CLASS_IDLE + IOPrioClass_IOPRIO_CLASS_NONE = v1alpha1.IOPrioClass_IOPRIO_CLASS_NONE + IOPrioClass_IOPRIO_CLASS_RT = v1alpha1.IOPrioClass_IOPRIO_CLASS_RT + LogRequest_LEVEL_DEBUG = v1alpha1.LogRequest_LEVEL_DEBUG + LogRequest_LEVEL_ERROR = v1alpha1.LogRequest_LEVEL_ERROR + LogRequest_LEVEL_INFO = v1alpha1.LogRequest_LEVEL_INFO + LogRequest_LEVEL_UNSPECIFIED = v1alpha1.LogRequest_LEVEL_UNSPECIFIED + LogRequest_LEVEL_WARN = v1alpha1.LogRequest_LEVEL_WARN + PluginIdxEnvVar = v1alpha1.PluginIdxEnvVar + PluginNameEnvVar = v1alpha1.PluginNameEnvVar + PluginPluginAPIVersion = v1alpha1.PluginPluginAPIVersion + PluginSocketEnvVar = v1alpha1.PluginSocketEnvVar + SELinuxRelabel = v1alpha1.SELinuxRelabel + SecurityProfile_LOCALHOST = v1alpha1.SecurityProfile_LOCALHOST + SecurityProfile_RUNTIME_DEFAULT = v1alpha1.SecurityProfile_RUNTIME_DEFAULT + SecurityProfile_UNCONFINED = v1alpha1.SecurityProfile_UNCONFINED + ValidEvents = v1alpha1.ValidEvents +) + +// aliased variables from github.com/containerd/nri/pkg/api/v1alpha1 +var ( + ContainerState_name = v1alpha1.ContainerState_name + ContainerState_value = v1alpha1.ContainerState_value + ErrIntOverflow = v1alpha1.ErrIntOverflow + ErrInvalidLength = v1alpha1.ErrInvalidLength + ErrUnexpectedEndOfGroup = v1alpha1.ErrUnexpectedEndOfGroup + Event_name = v1alpha1.Event_name + Event_value = v1alpha1.Event_value + Field_name = v1alpha1.Field_name + Field_value = v1alpha1.Field_value + File_pkg_api_v1alpha1_api_proto = v1alpha1.File_pkg_api_v1alpha1_api_proto + IOPrioClass_name = v1alpha1.IOPrioClass_name + IOPrioClass_value = v1alpha1.IOPrioClass_value + LogRequest_Level_name = v1alpha1.LogRequest_Level_name + LogRequest_Level_value = v1alpha1.LogRequest_Level_value + SecurityProfile_ProfileType_name = v1alpha1.SecurityProfile_ProfileType_name + SecurityProfile_ProfileType_value = v1alpha1.SecurityProfile_ProfileType_value +) + +// aliased types from github.com/containerd/nri/pkg/api/v1alpha1 +type ( + CDIDevice = v1alpha1.CDIDevice + CompoundFieldOwners = v1alpha1.CompoundFieldOwners + ConfigureRequest = v1alpha1.ConfigureRequest + ConfigureResponse = v1alpha1.ConfigureResponse + Container = v1alpha1.Container + ContainerAdjustment = v1alpha1.ContainerAdjustment + ContainerEviction = v1alpha1.ContainerEviction + ContainerState = v1alpha1.ContainerState + ContainerUpdate = v1alpha1.ContainerUpdate + CreateContainerRequest = v1alpha1.CreateContainerRequest + CreateContainerResponse = v1alpha1.CreateContainerResponse + Empty = v1alpha1.Empty + Event = v1alpha1.Event + EventMask = v1alpha1.EventMask + Field = v1alpha1.Field + FieldOwners = v1alpha1.FieldOwners + Hook = v1alpha1.Hook + Hooks = v1alpha1.Hooks + HostFunctions = v1alpha1.HostFunctions + HostFunctionsService = v1alpha1.HostFunctionsService + HugepageLimit = v1alpha1.HugepageLimit + IOPrioClass = v1alpha1.IOPrioClass + KeyValue = v1alpha1.KeyValue + LinuxCPU = v1alpha1.LinuxCPU + LinuxContainer = v1alpha1.LinuxContainer + LinuxContainerAdjustment = v1alpha1.LinuxContainerAdjustment + LinuxContainerUpdate = v1alpha1.LinuxContainerUpdate + LinuxDevice = v1alpha1.LinuxDevice + LinuxDeviceCgroup = v1alpha1.LinuxDeviceCgroup + LinuxIOPriority = v1alpha1.LinuxIOPriority + LinuxMemory = v1alpha1.LinuxMemory + LinuxNamespace = v1alpha1.LinuxNamespace + LinuxPids = v1alpha1.LinuxPids + LinuxPodSandbox = v1alpha1.LinuxPodSandbox + LinuxResources = v1alpha1.LinuxResources + LinuxSeccomp = v1alpha1.LinuxSeccomp + LinuxSeccompArg = v1alpha1.LinuxSeccompArg + LinuxSyscall = v1alpha1.LinuxSyscall + LogRequest = v1alpha1.LogRequest + LogRequest_Level = v1alpha1.LogRequest_Level + Mount = v1alpha1.Mount + OptionalBool = v1alpha1.OptionalBool + OptionalFileMode = v1alpha1.OptionalFileMode + OptionalInt = v1alpha1.OptionalInt + OptionalInt32 = v1alpha1.OptionalInt32 + OptionalInt64 = v1alpha1.OptionalInt64 + OptionalString = v1alpha1.OptionalString + OptionalUInt32 = v1alpha1.OptionalUInt32 + OptionalUInt64 = v1alpha1.OptionalUInt64 + OwningPlugins = v1alpha1.OwningPlugins + POSIXRlimit = v1alpha1.POSIXRlimit + Plugin = v1alpha1.Plugin + PluginInstance = v1alpha1.PluginInstance + PluginPlugin = v1alpha1.PluginPlugin + PluginService = v1alpha1.PluginService + PodSandbox = v1alpha1.PodSandbox + PostCreateContainerRequest = v1alpha1.PostCreateContainerRequest + PostCreateContainerResponse = v1alpha1.PostCreateContainerResponse + PostStartContainerRequest = v1alpha1.PostStartContainerRequest + PostStartContainerResponse = v1alpha1.PostStartContainerResponse + PostUpdateContainerRequest = v1alpha1.PostUpdateContainerRequest + PostUpdateContainerResponse = v1alpha1.PostUpdateContainerResponse + PostUpdatePodSandboxRequest = v1alpha1.PostUpdatePodSandboxRequest + PostUpdatePodSandboxResponse = v1alpha1.PostUpdatePodSandboxResponse + RegisterPluginRequest = v1alpha1.RegisterPluginRequest + RemoveContainerRequest = v1alpha1.RemoveContainerRequest + RemoveContainerResponse = v1alpha1.RemoveContainerResponse + RemovePodSandboxRequest = v1alpha1.RemovePodSandboxRequest + RemovePodSandboxResponse = v1alpha1.RemovePodSandboxResponse + RunPodSandboxRequest = v1alpha1.RunPodSandboxRequest + RunPodSandboxResponse = v1alpha1.RunPodSandboxResponse + RuntimeService = v1alpha1.RuntimeService + SecurityProfile = v1alpha1.SecurityProfile + SecurityProfile_ProfileType = v1alpha1.SecurityProfile_ProfileType + ShutdownRequest = v1alpha1.ShutdownRequest + ShutdownResponse = v1alpha1.ShutdownResponse + StartContainerRequest = v1alpha1.StartContainerRequest + StartContainerResponse = v1alpha1.StartContainerResponse + StateChangeEvent = v1alpha1.StateChangeEvent + StateChangeResponse = v1alpha1.StateChangeResponse + StopContainerRequest = v1alpha1.StopContainerRequest + StopContainerResponse = v1alpha1.StopContainerResponse + StopPodSandboxRequest = v1alpha1.StopPodSandboxRequest + StopPodSandboxResponse = v1alpha1.StopPodSandboxResponse + SynchronizeRequest = v1alpha1.SynchronizeRequest + SynchronizeResponse = v1alpha1.SynchronizeResponse + UpdateContainerRequest = v1alpha1.UpdateContainerRequest + UpdateContainerResponse = v1alpha1.UpdateContainerResponse + UpdateContainersRequest = v1alpha1.UpdateContainersRequest + UpdateContainersResponse = v1alpha1.UpdateContainersResponse + UpdatePodSandboxRequest = v1alpha1.UpdatePodSandboxRequest + UpdatePodSandboxResponse = v1alpha1.UpdatePodSandboxResponse + User = v1alpha1.User + ValidateContainerAdjustmentRequest = v1alpha1.ValidateContainerAdjustmentRequest + ValidateContainerAdjustmentResponse = v1alpha1.ValidateContainerAdjustmentResponse + WazeroConfig = v1alpha1.WazeroConfig + WazeroNewRuntime = v1alpha1.WazeroNewRuntime +) + +// aliased functions from github.com/containerd/nri/pkg/api/v1alpha1 +var ( + Bool = v1alpha1.Bool + CheckPluginIndex = v1alpha1.CheckPluginIndex + ClearRemovalMarker = v1alpha1.ClearRemovalMarker + DefaultWazeroRuntime = v1alpha1.DefaultWazeroRuntime + DupStringMap = v1alpha1.DupStringMap + DupStringSlice = v1alpha1.DupStringSlice + FileMode = v1alpha1.FileMode + FromOCIEnv = v1alpha1.FromOCIEnv + FromOCIHookSlice = v1alpha1.FromOCIHookSlice + FromOCIHooks = v1alpha1.FromOCIHooks + FromOCIIOPriorityClass = v1alpha1.FromOCIIOPriorityClass + FromOCILinuxDevices = v1alpha1.FromOCILinuxDevices + FromOCILinuxIOPriority = v1alpha1.FromOCILinuxIOPriority + FromOCILinuxNamespaces = v1alpha1.FromOCILinuxNamespaces + FromOCILinuxResources = v1alpha1.FromOCILinuxResources + FromOCILinuxSeccomp = v1alpha1.FromOCILinuxSeccomp + FromOCILinuxSeccompArgs = v1alpha1.FromOCILinuxSeccompArgs + FromOCILinuxSyscalls = v1alpha1.FromOCILinuxSyscalls + FromOCIMounts = v1alpha1.FromOCIMounts + Int = v1alpha1.Int + Int32 = v1alpha1.Int32 + Int64 = v1alpha1.Int64 + IsMarkedForRemoval = v1alpha1.IsMarkedForRemoval + MarkForRemoval = v1alpha1.MarkForRemoval + MustParseEventMask = v1alpha1.MustParseEventMask + NewCompoundFieldOwners = v1alpha1.NewCompoundFieldOwners + NewFieldOwners = v1alpha1.NewFieldOwners + NewHostFunctionsClient = v1alpha1.NewHostFunctionsClient + NewOwningPlugins = v1alpha1.NewOwningPlugins + NewPluginClient = v1alpha1.NewPluginClient + NewPluginPlugin = v1alpha1.NewPluginPlugin + NewRuntimeClient = v1alpha1.NewRuntimeClient + ParseEventMask = v1alpha1.ParseEventMask + ParsePluginName = v1alpha1.ParsePluginName + RegisterHostFunctionsService = v1alpha1.RegisterHostFunctionsService + RegisterPluginService = v1alpha1.RegisterPluginService + RegisterRuntimeService = v1alpha1.RegisterRuntimeService + String = v1alpha1.String + ToOCILinuxSeccompArgs = v1alpha1.ToOCILinuxSeccompArgs + ToOCILinuxSyscalls = v1alpha1.ToOCILinuxSyscalls + UInt32 = v1alpha1.UInt32 + UInt64 = v1alpha1.UInt64 + WazeroModuleConfig = v1alpha1.WazeroModuleConfig + WazeroRuntime = v1alpha1.WazeroRuntime +) diff --git a/pkg/api/doc.go b/pkg/api/doc.go index 2413d025..d5fcbb47 100644 --- a/pkg/api/doc.go +++ b/pkg/api/doc.go @@ -14,4 +14,7 @@ limitations under the License. */ +//go:generate go build -C ../../hack/gen-pkg-alias +//go:generate ../../hack/gen-pkg-alias/gen-pkg-alias -src ../../pkg/api/v1alpha1 -dst ../../pkg/api -rm -out api-v1alpha1.go -b !wasip1 -l ../../hack/license-header +//go:generate env GOOS=wasip1 GOARCH=wasm ../../hack/gen-pkg-alias/gen-pkg-alias -src ../../pkg/api/v1alpha1 -dst ../../pkg/api -rm -out api-v1alpha1-wasm.go -b wasip1 -l ../../hack/license-header package api diff --git a/pkg/api/adjustment.go b/pkg/api/v1alpha1/adjustment.go similarity index 99% rename from pkg/api/adjustment.go rename to pkg/api/v1alpha1/adjustment.go index 3dfdbaac..46571d3a 100644 --- a/pkg/api/adjustment.go +++ b/pkg/api/v1alpha1/adjustment.go @@ -14,7 +14,7 @@ limitations under the License. */ -package api +package v1alpha1 import "slices" diff --git a/pkg/api/api.pb.go b/pkg/api/v1alpha1/api.pb.go similarity index 65% rename from pkg/api/api.pb.go rename to pkg/api/v1alpha1/api.pb.go index d5df16e2..cf2b5a64 100644 --- a/pkg/api/api.pb.go +++ b/pkg/api/v1alpha1/api.pb.go @@ -17,9 +17,9 @@ // versions: // protoc-gen-go v1.34.1 // protoc v3.20.1 -// source: pkg/api/api.proto +// source: pkg/api/v1alpha1/api.proto -package api +package v1alpha1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -108,11 +108,11 @@ func (x Event) String() string { } func (Event) Descriptor() protoreflect.EnumDescriptor { - return file_pkg_api_api_proto_enumTypes[0].Descriptor() + return file_pkg_api_v1alpha1_api_proto_enumTypes[0].Descriptor() } func (Event) Type() protoreflect.EnumType { - return &file_pkg_api_api_proto_enumTypes[0] + return &file_pkg_api_v1alpha1_api_proto_enumTypes[0] } func (x Event) Number() protoreflect.EnumNumber { @@ -121,7 +121,7 @@ func (x Event) Number() protoreflect.EnumNumber { // Deprecated: Use Event.Descriptor instead. func (Event) EnumDescriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{0} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{0} } // Possible container states. @@ -164,11 +164,11 @@ func (x ContainerState) String() string { } func (ContainerState) Descriptor() protoreflect.EnumDescriptor { - return file_pkg_api_api_proto_enumTypes[1].Descriptor() + return file_pkg_api_v1alpha1_api_proto_enumTypes[1].Descriptor() } func (ContainerState) Type() protoreflect.EnumType { - return &file_pkg_api_api_proto_enumTypes[1] + return &file_pkg_api_v1alpha1_api_proto_enumTypes[1] } func (x ContainerState) Number() protoreflect.EnumNumber { @@ -177,7 +177,7 @@ func (x ContainerState) Number() protoreflect.EnumNumber { // Deprecated: Use ContainerState.Descriptor instead. func (ContainerState) EnumDescriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{1} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{1} } type IOPrioClass int32 @@ -216,11 +216,11 @@ func (x IOPrioClass) String() string { } func (IOPrioClass) Descriptor() protoreflect.EnumDescriptor { - return file_pkg_api_api_proto_enumTypes[2].Descriptor() + return file_pkg_api_v1alpha1_api_proto_enumTypes[2].Descriptor() } func (IOPrioClass) Type() protoreflect.EnumType { - return &file_pkg_api_api_proto_enumTypes[2] + return &file_pkg_api_v1alpha1_api_proto_enumTypes[2] } func (x IOPrioClass) Number() protoreflect.EnumNumber { @@ -229,7 +229,7 @@ func (x IOPrioClass) Number() protoreflect.EnumNumber { // Deprecated: Use IOPrioClass.Descriptor instead. func (IOPrioClass) EnumDescriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{2} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{2} } // Field enumerates all fields that can be adjusted by plugins. @@ -359,11 +359,11 @@ func (x Field) String() string { } func (Field) Descriptor() protoreflect.EnumDescriptor { - return file_pkg_api_api_proto_enumTypes[3].Descriptor() + return file_pkg_api_v1alpha1_api_proto_enumTypes[3].Descriptor() } func (Field) Type() protoreflect.EnumType { - return &file_pkg_api_api_proto_enumTypes[3] + return &file_pkg_api_v1alpha1_api_proto_enumTypes[3] } func (x Field) Number() protoreflect.EnumNumber { @@ -372,7 +372,7 @@ func (x Field) Number() protoreflect.EnumNumber { // Deprecated: Use Field.Descriptor instead. func (Field) EnumDescriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{3} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{3} } type LogRequest_Level int32 @@ -414,11 +414,11 @@ func (x LogRequest_Level) String() string { } func (LogRequest_Level) Descriptor() protoreflect.EnumDescriptor { - return file_pkg_api_api_proto_enumTypes[4].Descriptor() + return file_pkg_api_v1alpha1_api_proto_enumTypes[4].Descriptor() } func (LogRequest_Level) Type() protoreflect.EnumType { - return &file_pkg_api_api_proto_enumTypes[4] + return &file_pkg_api_v1alpha1_api_proto_enumTypes[4] } func (x LogRequest_Level) Number() protoreflect.EnumNumber { @@ -427,7 +427,7 @@ func (x LogRequest_Level) Number() protoreflect.EnumNumber { // Deprecated: Use LogRequest_Level.Descriptor instead. func (LogRequest_Level) EnumDescriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{3, 0} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{3, 0} } type SecurityProfile_ProfileType int32 @@ -463,11 +463,11 @@ func (x SecurityProfile_ProfileType) String() string { } func (SecurityProfile_ProfileType) Descriptor() protoreflect.EnumDescriptor { - return file_pkg_api_api_proto_enumTypes[5].Descriptor() + return file_pkg_api_v1alpha1_api_proto_enumTypes[5].Descriptor() } func (SecurityProfile_ProfileType) Type() protoreflect.EnumType { - return &file_pkg_api_api_proto_enumTypes[5] + return &file_pkg_api_v1alpha1_api_proto_enumTypes[5] } func (x SecurityProfile_ProfileType) Number() protoreflect.EnumNumber { @@ -476,7 +476,7 @@ func (x SecurityProfile_ProfileType) Number() protoreflect.EnumNumber { // Deprecated: Use SecurityProfile_ProfileType.Descriptor instead. func (SecurityProfile_ProfileType) EnumDescriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{37, 0} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{37, 0} } type RegisterPluginRequest struct { @@ -493,7 +493,7 @@ type RegisterPluginRequest struct { func (x *RegisterPluginRequest) Reset() { *x = RegisterPluginRequest{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[0] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -506,7 +506,7 @@ func (x *RegisterPluginRequest) String() string { func (*RegisterPluginRequest) ProtoMessage() {} func (x *RegisterPluginRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[0] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -519,7 +519,7 @@ func (x *RegisterPluginRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RegisterPluginRequest.ProtoReflect.Descriptor instead. func (*RegisterPluginRequest) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{0} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{0} } func (x *RegisterPluginRequest) GetPluginName() string { @@ -550,7 +550,7 @@ type UpdateContainersRequest struct { func (x *UpdateContainersRequest) Reset() { *x = UpdateContainersRequest{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[1] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -563,7 +563,7 @@ func (x *UpdateContainersRequest) String() string { func (*UpdateContainersRequest) ProtoMessage() {} func (x *UpdateContainersRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[1] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -576,7 +576,7 @@ func (x *UpdateContainersRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateContainersRequest.ProtoReflect.Descriptor instead. func (*UpdateContainersRequest) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{1} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{1} } func (x *UpdateContainersRequest) GetUpdate() []*ContainerUpdate { @@ -605,7 +605,7 @@ type UpdateContainersResponse struct { func (x *UpdateContainersResponse) Reset() { *x = UpdateContainersResponse{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[2] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -618,7 +618,7 @@ func (x *UpdateContainersResponse) String() string { func (*UpdateContainersResponse) ProtoMessage() {} func (x *UpdateContainersResponse) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[2] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -631,7 +631,7 @@ func (x *UpdateContainersResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateContainersResponse.ProtoReflect.Descriptor instead. func (*UpdateContainersResponse) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{2} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{2} } func (x *UpdateContainersResponse) GetFailed() []*ContainerUpdate { @@ -653,7 +653,7 @@ type LogRequest struct { func (x *LogRequest) Reset() { *x = LogRequest{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[3] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -666,7 +666,7 @@ func (x *LogRequest) String() string { func (*LogRequest) ProtoMessage() {} func (x *LogRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[3] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -679,7 +679,7 @@ func (x *LogRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use LogRequest.ProtoReflect.Descriptor instead. func (*LogRequest) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{3} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{3} } func (x *LogRequest) GetMsg() string { @@ -716,7 +716,7 @@ type ConfigureRequest struct { func (x *ConfigureRequest) Reset() { *x = ConfigureRequest{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[4] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -729,7 +729,7 @@ func (x *ConfigureRequest) String() string { func (*ConfigureRequest) ProtoMessage() {} func (x *ConfigureRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[4] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -742,7 +742,7 @@ func (x *ConfigureRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ConfigureRequest.ProtoReflect.Descriptor instead. func (*ConfigureRequest) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{4} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{4} } func (x *ConfigureRequest) GetConfig() string { @@ -793,7 +793,7 @@ type ConfigureResponse struct { func (x *ConfigureResponse) Reset() { *x = ConfigureResponse{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[5] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -806,7 +806,7 @@ func (x *ConfigureResponse) String() string { func (*ConfigureResponse) ProtoMessage() {} func (x *ConfigureResponse) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[5] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -819,7 +819,7 @@ func (x *ConfigureResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ConfigureResponse.ProtoReflect.Descriptor instead. func (*ConfigureResponse) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{5} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{5} } func (x *ConfigureResponse) GetEvents() int32 { @@ -845,7 +845,7 @@ type SynchronizeRequest struct { func (x *SynchronizeRequest) Reset() { *x = SynchronizeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[6] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -858,7 +858,7 @@ func (x *SynchronizeRequest) String() string { func (*SynchronizeRequest) ProtoMessage() {} func (x *SynchronizeRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[6] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -871,7 +871,7 @@ func (x *SynchronizeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SynchronizeRequest.ProtoReflect.Descriptor instead. func (*SynchronizeRequest) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{6} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{6} } func (x *SynchronizeRequest) GetPods() []*PodSandbox { @@ -909,7 +909,7 @@ type SynchronizeResponse struct { func (x *SynchronizeResponse) Reset() { *x = SynchronizeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[7] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -922,7 +922,7 @@ func (x *SynchronizeResponse) String() string { func (*SynchronizeResponse) ProtoMessage() {} func (x *SynchronizeResponse) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[7] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -935,7 +935,7 @@ func (x *SynchronizeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SynchronizeResponse.ProtoReflect.Descriptor instead. func (*SynchronizeResponse) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{7} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{7} } func (x *SynchronizeResponse) GetUpdate() []*ContainerUpdate { @@ -966,7 +966,7 @@ type CreateContainerRequest struct { func (x *CreateContainerRequest) Reset() { *x = CreateContainerRequest{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[8] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -979,7 +979,7 @@ func (x *CreateContainerRequest) String() string { func (*CreateContainerRequest) ProtoMessage() {} func (x *CreateContainerRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[8] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -992,7 +992,7 @@ func (x *CreateContainerRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateContainerRequest.ProtoReflect.Descriptor instead. func (*CreateContainerRequest) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{8} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{8} } func (x *CreateContainerRequest) GetPod() *PodSandbox { @@ -1025,7 +1025,7 @@ type CreateContainerResponse struct { func (x *CreateContainerResponse) Reset() { *x = CreateContainerResponse{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[9] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1038,7 +1038,7 @@ func (x *CreateContainerResponse) String() string { func (*CreateContainerResponse) ProtoMessage() {} func (x *CreateContainerResponse) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[9] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1051,7 +1051,7 @@ func (x *CreateContainerResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateContainerResponse.ProtoReflect.Descriptor instead. func (*CreateContainerResponse) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{9} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{9} } func (x *CreateContainerResponse) GetAdjust() *ContainerAdjustment { @@ -1091,7 +1091,7 @@ type UpdateContainerRequest struct { func (x *UpdateContainerRequest) Reset() { *x = UpdateContainerRequest{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[10] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1104,7 +1104,7 @@ func (x *UpdateContainerRequest) String() string { func (*UpdateContainerRequest) ProtoMessage() {} func (x *UpdateContainerRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[10] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1117,7 +1117,7 @@ func (x *UpdateContainerRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateContainerRequest.ProtoReflect.Descriptor instead. func (*UpdateContainerRequest) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{10} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{10} } func (x *UpdateContainerRequest) GetPod() *PodSandbox { @@ -1155,7 +1155,7 @@ type UpdateContainerResponse struct { func (x *UpdateContainerResponse) Reset() { *x = UpdateContainerResponse{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[11] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1168,7 +1168,7 @@ func (x *UpdateContainerResponse) String() string { func (*UpdateContainerResponse) ProtoMessage() {} func (x *UpdateContainerResponse) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[11] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1181,7 +1181,7 @@ func (x *UpdateContainerResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateContainerResponse.ProtoReflect.Descriptor instead. func (*UpdateContainerResponse) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{11} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{11} } func (x *UpdateContainerResponse) GetUpdate() []*ContainerUpdate { @@ -1212,7 +1212,7 @@ type StopContainerRequest struct { func (x *StopContainerRequest) Reset() { *x = StopContainerRequest{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[12] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1225,7 +1225,7 @@ func (x *StopContainerRequest) String() string { func (*StopContainerRequest) ProtoMessage() {} func (x *StopContainerRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[12] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1238,7 +1238,7 @@ func (x *StopContainerRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StopContainerRequest.ProtoReflect.Descriptor instead. func (*StopContainerRequest) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{12} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{12} } func (x *StopContainerRequest) GetPod() *PodSandbox { @@ -1267,7 +1267,7 @@ type StopContainerResponse struct { func (x *StopContainerResponse) Reset() { *x = StopContainerResponse{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[13] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1280,7 +1280,7 @@ func (x *StopContainerResponse) String() string { func (*StopContainerResponse) ProtoMessage() {} func (x *StopContainerResponse) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[13] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1293,7 +1293,7 @@ func (x *StopContainerResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StopContainerResponse.ProtoReflect.Descriptor instead. func (*StopContainerResponse) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{13} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{13} } func (x *StopContainerResponse) GetUpdate() []*ContainerUpdate { @@ -1319,7 +1319,7 @@ type UpdatePodSandboxRequest struct { func (x *UpdatePodSandboxRequest) Reset() { *x = UpdatePodSandboxRequest{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[14] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1332,7 +1332,7 @@ func (x *UpdatePodSandboxRequest) String() string { func (*UpdatePodSandboxRequest) ProtoMessage() {} func (x *UpdatePodSandboxRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[14] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1345,7 +1345,7 @@ func (x *UpdatePodSandboxRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdatePodSandboxRequest.ProtoReflect.Descriptor instead. func (*UpdatePodSandboxRequest) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{14} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{14} } func (x *UpdatePodSandboxRequest) GetPod() *PodSandbox { @@ -1378,7 +1378,7 @@ type UpdatePodSandboxResponse struct { func (x *UpdatePodSandboxResponse) Reset() { *x = UpdatePodSandboxResponse{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[15] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1391,7 +1391,7 @@ func (x *UpdatePodSandboxResponse) String() string { func (*UpdatePodSandboxResponse) ProtoMessage() {} func (x *UpdatePodSandboxResponse) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[15] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1404,7 +1404,7 @@ func (x *UpdatePodSandboxResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdatePodSandboxResponse.ProtoReflect.Descriptor instead. func (*UpdatePodSandboxResponse) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{15} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{15} } type StateChangeEvent struct { @@ -1425,7 +1425,7 @@ type StateChangeEvent struct { func (x *StateChangeEvent) Reset() { *x = StateChangeEvent{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[16] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1438,7 +1438,7 @@ func (x *StateChangeEvent) String() string { func (*StateChangeEvent) ProtoMessage() {} func (x *StateChangeEvent) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[16] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1451,7 +1451,7 @@ func (x *StateChangeEvent) ProtoReflect() protoreflect.Message { // Deprecated: Use StateChangeEvent.ProtoReflect.Descriptor instead. func (*StateChangeEvent) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{16} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{16} } func (x *StateChangeEvent) GetEvent() Event { @@ -1497,7 +1497,7 @@ type ValidateContainerAdjustmentRequest struct { func (x *ValidateContainerAdjustmentRequest) Reset() { *x = ValidateContainerAdjustmentRequest{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[17] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1510,7 +1510,7 @@ func (x *ValidateContainerAdjustmentRequest) String() string { func (*ValidateContainerAdjustmentRequest) ProtoMessage() {} func (x *ValidateContainerAdjustmentRequest) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[17] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1523,7 +1523,7 @@ func (x *ValidateContainerAdjustmentRequest) ProtoReflect() protoreflect.Message // Deprecated: Use ValidateContainerAdjustmentRequest.ProtoReflect.Descriptor instead. func (*ValidateContainerAdjustmentRequest) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{17} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{17} } func (x *ValidateContainerAdjustmentRequest) GetPod() *PodSandbox { @@ -1580,7 +1580,7 @@ type PluginInstance struct { func (x *PluginInstance) Reset() { *x = PluginInstance{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[18] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1593,7 +1593,7 @@ func (x *PluginInstance) String() string { func (*PluginInstance) ProtoMessage() {} func (x *PluginInstance) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[18] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1606,7 +1606,7 @@ func (x *PluginInstance) ProtoReflect() protoreflect.Message { // Deprecated: Use PluginInstance.ProtoReflect.Descriptor instead. func (*PluginInstance) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{18} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{18} } func (x *PluginInstance) GetName() string { @@ -1635,7 +1635,7 @@ type ValidateContainerAdjustmentResponse struct { func (x *ValidateContainerAdjustmentResponse) Reset() { *x = ValidateContainerAdjustmentResponse{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[19] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1648,7 +1648,7 @@ func (x *ValidateContainerAdjustmentResponse) String() string { func (*ValidateContainerAdjustmentResponse) ProtoMessage() {} func (x *ValidateContainerAdjustmentResponse) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[19] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1661,7 +1661,7 @@ func (x *ValidateContainerAdjustmentResponse) ProtoReflect() protoreflect.Messag // Deprecated: Use ValidateContainerAdjustmentResponse.ProtoReflect.Descriptor instead. func (*ValidateContainerAdjustmentResponse) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{19} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{19} } func (x *ValidateContainerAdjustmentResponse) GetReject() bool { @@ -1688,7 +1688,7 @@ type Empty struct { func (x *Empty) Reset() { *x = Empty{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[20] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1701,7 +1701,7 @@ func (x *Empty) String() string { func (*Empty) ProtoMessage() {} func (x *Empty) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[20] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1714,7 +1714,7 @@ func (x *Empty) ProtoReflect() protoreflect.Message { // Deprecated: Use Empty.ProtoReflect.Descriptor instead. func (*Empty) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{20} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{20} } // Pod metadata that is considered relevant for a plugin. @@ -1738,7 +1738,7 @@ type PodSandbox struct { func (x *PodSandbox) Reset() { *x = PodSandbox{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[21] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1751,7 +1751,7 @@ func (x *PodSandbox) String() string { func (*PodSandbox) ProtoMessage() {} func (x *PodSandbox) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[21] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1764,7 +1764,7 @@ func (x *PodSandbox) ProtoReflect() protoreflect.Message { // Deprecated: Use PodSandbox.ProtoReflect.Descriptor instead. func (*PodSandbox) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{21} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{21} } func (x *PodSandbox) GetId() string { @@ -1854,7 +1854,7 @@ type LinuxPodSandbox struct { func (x *LinuxPodSandbox) Reset() { *x = LinuxPodSandbox{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[22] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1867,7 +1867,7 @@ func (x *LinuxPodSandbox) String() string { func (*LinuxPodSandbox) ProtoMessage() {} func (x *LinuxPodSandbox) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[22] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1880,7 +1880,7 @@ func (x *LinuxPodSandbox) ProtoReflect() protoreflect.Message { // Deprecated: Use LinuxPodSandbox.ProtoReflect.Descriptor instead. func (*LinuxPodSandbox) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{22} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{22} } func (x *LinuxPodSandbox) GetPodOverhead() *LinuxResources { @@ -1957,7 +1957,7 @@ type Container struct { func (x *Container) Reset() { *x = Container{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[23] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1970,7 +1970,7 @@ func (x *Container) String() string { func (*Container) ProtoMessage() {} func (x *Container) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[23] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1983,7 +1983,7 @@ func (x *Container) ProtoReflect() protoreflect.Message { // Deprecated: Use Container.ProtoReflect.Descriptor instead. func (*Container) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{23} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{23} } func (x *Container) GetId() string { @@ -2148,7 +2148,7 @@ type Mount struct { func (x *Mount) Reset() { *x = Mount{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[24] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2161,7 +2161,7 @@ func (x *Mount) String() string { func (*Mount) ProtoMessage() {} func (x *Mount) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[24] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2174,7 +2174,7 @@ func (x *Mount) ProtoReflect() protoreflect.Message { // Deprecated: Use Mount.ProtoReflect.Descriptor instead. func (*Mount) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{24} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{24} } func (x *Mount) GetDestination() string { @@ -2222,7 +2222,7 @@ type Hooks struct { func (x *Hooks) Reset() { *x = Hooks{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[25] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2235,7 +2235,7 @@ func (x *Hooks) String() string { func (*Hooks) ProtoMessage() {} func (x *Hooks) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[25] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2248,7 +2248,7 @@ func (x *Hooks) ProtoReflect() protoreflect.Message { // Deprecated: Use Hooks.ProtoReflect.Descriptor instead. func (*Hooks) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{25} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{25} } func (x *Hooks) GetPrestart() []*Hook { @@ -2308,7 +2308,7 @@ type Hook struct { func (x *Hook) Reset() { *x = Hook{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[26] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2321,7 +2321,7 @@ func (x *Hook) String() string { func (*Hook) ProtoMessage() {} func (x *Hook) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[26] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2334,7 +2334,7 @@ func (x *Hook) ProtoReflect() protoreflect.Message { // Deprecated: Use Hook.ProtoReflect.Descriptor instead. func (*Hook) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{26} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{26} } func (x *Hook) GetPath() string { @@ -2384,7 +2384,7 @@ type LinuxContainer struct { func (x *LinuxContainer) Reset() { *x = LinuxContainer{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[27] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2397,7 +2397,7 @@ func (x *LinuxContainer) String() string { func (*LinuxContainer) ProtoMessage() {} func (x *LinuxContainer) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[27] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2410,7 +2410,7 @@ func (x *LinuxContainer) ProtoReflect() protoreflect.Message { // Deprecated: Use LinuxContainer.ProtoReflect.Descriptor instead. func (*LinuxContainer) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{27} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{27} } func (x *LinuxContainer) GetNamespaces() []*LinuxNamespace { @@ -2482,7 +2482,7 @@ type LinuxNamespace struct { func (x *LinuxNamespace) Reset() { *x = LinuxNamespace{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[28] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2495,7 +2495,7 @@ func (x *LinuxNamespace) String() string { func (*LinuxNamespace) ProtoMessage() {} func (x *LinuxNamespace) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[28] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2508,7 +2508,7 @@ func (x *LinuxNamespace) ProtoReflect() protoreflect.Message { // Deprecated: Use LinuxNamespace.ProtoReflect.Descriptor instead. func (*LinuxNamespace) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{28} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{28} } func (x *LinuxNamespace) GetType() string { @@ -2543,7 +2543,7 @@ type LinuxDevice struct { func (x *LinuxDevice) Reset() { *x = LinuxDevice{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[29] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2556,7 +2556,7 @@ func (x *LinuxDevice) String() string { func (*LinuxDevice) ProtoMessage() {} func (x *LinuxDevice) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[29] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2569,7 +2569,7 @@ func (x *LinuxDevice) ProtoReflect() protoreflect.Message { // Deprecated: Use LinuxDevice.ProtoReflect.Descriptor instead. func (*LinuxDevice) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{29} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{29} } func (x *LinuxDevice) GetPath() string { @@ -2637,7 +2637,7 @@ type LinuxDeviceCgroup struct { func (x *LinuxDeviceCgroup) Reset() { *x = LinuxDeviceCgroup{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[30] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2650,7 +2650,7 @@ func (x *LinuxDeviceCgroup) String() string { func (*LinuxDeviceCgroup) ProtoMessage() {} func (x *LinuxDeviceCgroup) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[30] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2663,7 +2663,7 @@ func (x *LinuxDeviceCgroup) ProtoReflect() protoreflect.Message { // Deprecated: Use LinuxDeviceCgroup.ProtoReflect.Descriptor instead. func (*LinuxDeviceCgroup) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{30} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{30} } func (x *LinuxDeviceCgroup) GetAllow() bool { @@ -2713,7 +2713,7 @@ type CDIDevice struct { func (x *CDIDevice) Reset() { *x = CDIDevice{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[31] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2726,7 +2726,7 @@ func (x *CDIDevice) String() string { func (*CDIDevice) ProtoMessage() {} func (x *CDIDevice) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[31] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2739,7 +2739,7 @@ func (x *CDIDevice) ProtoReflect() protoreflect.Message { // Deprecated: Use CDIDevice.ProtoReflect.Descriptor instead. func (*CDIDevice) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{31} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{31} } func (x *CDIDevice) GetName() string { @@ -2763,7 +2763,7 @@ type User struct { func (x *User) Reset() { *x = User{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[32] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2776,7 +2776,7 @@ func (x *User) String() string { func (*User) ProtoMessage() {} func (x *User) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[32] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2789,7 +2789,7 @@ func (x *User) ProtoReflect() protoreflect.Message { // Deprecated: Use User.ProtoReflect.Descriptor instead. func (*User) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{32} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{32} } func (x *User) GetUid() uint32 { @@ -2832,7 +2832,7 @@ type LinuxResources struct { func (x *LinuxResources) Reset() { *x = LinuxResources{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[33] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2845,7 +2845,7 @@ func (x *LinuxResources) String() string { func (*LinuxResources) ProtoMessage() {} func (x *LinuxResources) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[33] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2858,7 +2858,7 @@ func (x *LinuxResources) ProtoReflect() protoreflect.Message { // Deprecated: Use LinuxResources.ProtoReflect.Descriptor instead. func (*LinuxResources) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{33} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{33} } func (x *LinuxResources) GetMemory() *LinuxMemory { @@ -2936,7 +2936,7 @@ type LinuxMemory struct { func (x *LinuxMemory) Reset() { *x = LinuxMemory{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[34] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2949,7 +2949,7 @@ func (x *LinuxMemory) String() string { func (*LinuxMemory) ProtoMessage() {} func (x *LinuxMemory) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[34] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2962,7 +2962,7 @@ func (x *LinuxMemory) ProtoReflect() protoreflect.Message { // Deprecated: Use LinuxMemory.ProtoReflect.Descriptor instead. func (*LinuxMemory) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{34} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{34} } func (x *LinuxMemory) GetLimit() *OptionalInt64 { @@ -3039,7 +3039,7 @@ type LinuxCPU struct { func (x *LinuxCPU) Reset() { *x = LinuxCPU{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[35] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3052,7 +3052,7 @@ func (x *LinuxCPU) String() string { func (*LinuxCPU) ProtoMessage() {} func (x *LinuxCPU) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[35] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3065,7 +3065,7 @@ func (x *LinuxCPU) ProtoReflect() protoreflect.Message { // Deprecated: Use LinuxCPU.ProtoReflect.Descriptor instead. func (*LinuxCPU) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{35} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{35} } func (x *LinuxCPU) GetShares() *OptionalUInt64 { @@ -3130,7 +3130,7 @@ type HugepageLimit struct { func (x *HugepageLimit) Reset() { *x = HugepageLimit{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[36] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3143,7 +3143,7 @@ func (x *HugepageLimit) String() string { func (*HugepageLimit) ProtoMessage() {} func (x *HugepageLimit) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[36] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3156,7 +3156,7 @@ func (x *HugepageLimit) ProtoReflect() protoreflect.Message { // Deprecated: Use HugepageLimit.ProtoReflect.Descriptor instead. func (*HugepageLimit) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{36} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{36} } func (x *HugepageLimit) GetPageSize() string { @@ -3186,7 +3186,7 @@ type SecurityProfile struct { func (x *SecurityProfile) Reset() { *x = SecurityProfile{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[37] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3199,7 +3199,7 @@ func (x *SecurityProfile) String() string { func (*SecurityProfile) ProtoMessage() {} func (x *SecurityProfile) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[37] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3212,7 +3212,7 @@ func (x *SecurityProfile) ProtoReflect() protoreflect.Message { // Deprecated: Use SecurityProfile.ProtoReflect.Descriptor instead. func (*SecurityProfile) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{37} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{37} } func (x *SecurityProfile) GetProfileType() SecurityProfile_ProfileType { @@ -3243,7 +3243,7 @@ type POSIXRlimit struct { func (x *POSIXRlimit) Reset() { *x = POSIXRlimit{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[38] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3256,7 +3256,7 @@ func (x *POSIXRlimit) String() string { func (*POSIXRlimit) ProtoMessage() {} func (x *POSIXRlimit) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[38] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3269,7 +3269,7 @@ func (x *POSIXRlimit) ProtoReflect() protoreflect.Message { // Deprecated: Use POSIXRlimit.ProtoReflect.Descriptor instead. func (*POSIXRlimit) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{38} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{38} } func (x *POSIXRlimit) GetType() string { @@ -3305,7 +3305,7 @@ type LinuxPids struct { func (x *LinuxPids) Reset() { *x = LinuxPids{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[39] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3318,7 +3318,7 @@ func (x *LinuxPids) String() string { func (*LinuxPids) ProtoMessage() {} func (x *LinuxPids) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[39] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[39] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3331,7 +3331,7 @@ func (x *LinuxPids) ProtoReflect() protoreflect.Message { // Deprecated: Use LinuxPids.ProtoReflect.Descriptor instead. func (*LinuxPids) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{39} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{39} } func (x *LinuxPids) GetLimit() int64 { @@ -3355,7 +3355,7 @@ type LinuxIOPriority struct { func (x *LinuxIOPriority) Reset() { *x = LinuxIOPriority{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[40] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3368,7 +3368,7 @@ func (x *LinuxIOPriority) String() string { func (*LinuxIOPriority) ProtoMessage() {} func (x *LinuxIOPriority) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[40] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[40] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3381,7 +3381,7 @@ func (x *LinuxIOPriority) ProtoReflect() protoreflect.Message { // Deprecated: Use LinuxIOPriority.ProtoReflect.Descriptor instead. func (*LinuxIOPriority) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{40} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{40} } func (x *LinuxIOPriority) GetClass() IOPrioClass { @@ -3417,7 +3417,7 @@ type ContainerAdjustment struct { func (x *ContainerAdjustment) Reset() { *x = ContainerAdjustment{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[41] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3430,7 +3430,7 @@ func (x *ContainerAdjustment) String() string { func (*ContainerAdjustment) ProtoMessage() {} func (x *ContainerAdjustment) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[41] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[41] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3443,7 +3443,7 @@ func (x *ContainerAdjustment) ProtoReflect() protoreflect.Message { // Deprecated: Use ContainerAdjustment.ProtoReflect.Descriptor instead. func (*ContainerAdjustment) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{41} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{41} } func (x *ContainerAdjustment) GetAnnotations() map[string]string { @@ -3520,7 +3520,7 @@ type LinuxContainerAdjustment struct { func (x *LinuxContainerAdjustment) Reset() { *x = LinuxContainerAdjustment{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[42] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3533,7 +3533,7 @@ func (x *LinuxContainerAdjustment) String() string { func (*LinuxContainerAdjustment) ProtoMessage() {} func (x *LinuxContainerAdjustment) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[42] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[42] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3546,7 +3546,7 @@ func (x *LinuxContainerAdjustment) ProtoReflect() protoreflect.Message { // Deprecated: Use LinuxContainerAdjustment.ProtoReflect.Descriptor instead. func (*LinuxContainerAdjustment) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{42} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{42} } func (x *LinuxContainerAdjustment) GetDevices() []*LinuxDevice { @@ -3615,7 +3615,7 @@ type LinuxSeccomp struct { func (x *LinuxSeccomp) Reset() { *x = LinuxSeccomp{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[43] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3628,7 +3628,7 @@ func (x *LinuxSeccomp) String() string { func (*LinuxSeccomp) ProtoMessage() {} func (x *LinuxSeccomp) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[43] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[43] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3641,7 +3641,7 @@ func (x *LinuxSeccomp) ProtoReflect() protoreflect.Message { // Deprecated: Use LinuxSeccomp.ProtoReflect.Descriptor instead. func (*LinuxSeccomp) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{43} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{43} } func (x *LinuxSeccomp) GetDefaultAction() string { @@ -3707,7 +3707,7 @@ type LinuxSyscall struct { func (x *LinuxSyscall) Reset() { *x = LinuxSyscall{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[44] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3720,7 +3720,7 @@ func (x *LinuxSyscall) String() string { func (*LinuxSyscall) ProtoMessage() {} func (x *LinuxSyscall) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[44] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[44] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3733,7 +3733,7 @@ func (x *LinuxSyscall) ProtoReflect() protoreflect.Message { // Deprecated: Use LinuxSyscall.ProtoReflect.Descriptor instead. func (*LinuxSyscall) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{44} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{44} } func (x *LinuxSyscall) GetNames() []string { @@ -3778,7 +3778,7 @@ type LinuxSeccompArg struct { func (x *LinuxSeccompArg) Reset() { *x = LinuxSeccompArg{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[45] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3791,7 +3791,7 @@ func (x *LinuxSeccompArg) String() string { func (*LinuxSeccompArg) ProtoMessage() {} func (x *LinuxSeccompArg) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[45] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[45] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3804,7 +3804,7 @@ func (x *LinuxSeccompArg) ProtoReflect() protoreflect.Message { // Deprecated: Use LinuxSeccompArg.ProtoReflect.Descriptor instead. func (*LinuxSeccompArg) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{45} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{45} } func (x *LinuxSeccompArg) GetIndex() uint32 { @@ -3849,7 +3849,7 @@ type ContainerUpdate struct { func (x *ContainerUpdate) Reset() { *x = ContainerUpdate{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[46] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3862,7 +3862,7 @@ func (x *ContainerUpdate) String() string { func (*ContainerUpdate) ProtoMessage() {} func (x *ContainerUpdate) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[46] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[46] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3875,7 +3875,7 @@ func (x *ContainerUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use ContainerUpdate.ProtoReflect.Descriptor instead. func (*ContainerUpdate) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{46} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{46} } func (x *ContainerUpdate) GetContainerId() string { @@ -3911,7 +3911,7 @@ type LinuxContainerUpdate struct { func (x *LinuxContainerUpdate) Reset() { *x = LinuxContainerUpdate{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[47] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3924,7 +3924,7 @@ func (x *LinuxContainerUpdate) String() string { func (*LinuxContainerUpdate) ProtoMessage() {} func (x *LinuxContainerUpdate) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[47] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[47] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3937,7 +3937,7 @@ func (x *LinuxContainerUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use LinuxContainerUpdate.ProtoReflect.Descriptor instead. func (*LinuxContainerUpdate) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{47} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{47} } func (x *LinuxContainerUpdate) GetResources() *LinuxResources { @@ -3962,7 +3962,7 @@ type ContainerEviction struct { func (x *ContainerEviction) Reset() { *x = ContainerEviction{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[48] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3975,7 +3975,7 @@ func (x *ContainerEviction) String() string { func (*ContainerEviction) ProtoMessage() {} func (x *ContainerEviction) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[48] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[48] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3988,7 +3988,7 @@ func (x *ContainerEviction) ProtoReflect() protoreflect.Message { // Deprecated: Use ContainerEviction.ProtoReflect.Descriptor instead. func (*ContainerEviction) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{48} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{48} } func (x *ContainerEviction) GetContainerId() string { @@ -4018,7 +4018,7 @@ type KeyValue struct { func (x *KeyValue) Reset() { *x = KeyValue{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[49] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4031,7 +4031,7 @@ func (x *KeyValue) String() string { func (*KeyValue) ProtoMessage() {} func (x *KeyValue) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[49] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[49] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4044,7 +4044,7 @@ func (x *KeyValue) ProtoReflect() protoreflect.Message { // Deprecated: Use KeyValue.ProtoReflect.Descriptor instead. func (*KeyValue) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{49} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{49} } func (x *KeyValue) GetKey() string { @@ -4073,7 +4073,7 @@ type OptionalString struct { func (x *OptionalString) Reset() { *x = OptionalString{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[50] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[50] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4086,7 +4086,7 @@ func (x *OptionalString) String() string { func (*OptionalString) ProtoMessage() {} func (x *OptionalString) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[50] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[50] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4099,7 +4099,7 @@ func (x *OptionalString) ProtoReflect() protoreflect.Message { // Deprecated: Use OptionalString.ProtoReflect.Descriptor instead. func (*OptionalString) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{50} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{50} } func (x *OptionalString) GetValue() string { @@ -4121,7 +4121,7 @@ type OptionalInt struct { func (x *OptionalInt) Reset() { *x = OptionalInt{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[51] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[51] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4134,7 +4134,7 @@ func (x *OptionalInt) String() string { func (*OptionalInt) ProtoMessage() {} func (x *OptionalInt) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[51] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[51] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4147,7 +4147,7 @@ func (x *OptionalInt) ProtoReflect() protoreflect.Message { // Deprecated: Use OptionalInt.ProtoReflect.Descriptor instead. func (*OptionalInt) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{51} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{51} } func (x *OptionalInt) GetValue() int64 { @@ -4169,7 +4169,7 @@ type OptionalInt32 struct { func (x *OptionalInt32) Reset() { *x = OptionalInt32{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[52] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[52] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4182,7 +4182,7 @@ func (x *OptionalInt32) String() string { func (*OptionalInt32) ProtoMessage() {} func (x *OptionalInt32) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[52] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[52] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4195,7 +4195,7 @@ func (x *OptionalInt32) ProtoReflect() protoreflect.Message { // Deprecated: Use OptionalInt32.ProtoReflect.Descriptor instead. func (*OptionalInt32) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{52} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{52} } func (x *OptionalInt32) GetValue() int32 { @@ -4217,7 +4217,7 @@ type OptionalUInt32 struct { func (x *OptionalUInt32) Reset() { *x = OptionalUInt32{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[53] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[53] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4230,7 +4230,7 @@ func (x *OptionalUInt32) String() string { func (*OptionalUInt32) ProtoMessage() {} func (x *OptionalUInt32) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[53] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[53] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4243,7 +4243,7 @@ func (x *OptionalUInt32) ProtoReflect() protoreflect.Message { // Deprecated: Use OptionalUInt32.ProtoReflect.Descriptor instead. func (*OptionalUInt32) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{53} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{53} } func (x *OptionalUInt32) GetValue() uint32 { @@ -4265,7 +4265,7 @@ type OptionalInt64 struct { func (x *OptionalInt64) Reset() { *x = OptionalInt64{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[54] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[54] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4278,7 +4278,7 @@ func (x *OptionalInt64) String() string { func (*OptionalInt64) ProtoMessage() {} func (x *OptionalInt64) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[54] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[54] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4291,7 +4291,7 @@ func (x *OptionalInt64) ProtoReflect() protoreflect.Message { // Deprecated: Use OptionalInt64.ProtoReflect.Descriptor instead. func (*OptionalInt64) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{54} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{54} } func (x *OptionalInt64) GetValue() int64 { @@ -4313,7 +4313,7 @@ type OptionalUInt64 struct { func (x *OptionalUInt64) Reset() { *x = OptionalUInt64{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[55] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[55] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4326,7 +4326,7 @@ func (x *OptionalUInt64) String() string { func (*OptionalUInt64) ProtoMessage() {} func (x *OptionalUInt64) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[55] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[55] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4339,7 +4339,7 @@ func (x *OptionalUInt64) ProtoReflect() protoreflect.Message { // Deprecated: Use OptionalUInt64.ProtoReflect.Descriptor instead. func (*OptionalUInt64) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{55} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{55} } func (x *OptionalUInt64) GetValue() uint64 { @@ -4361,7 +4361,7 @@ type OptionalBool struct { func (x *OptionalBool) Reset() { *x = OptionalBool{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[56] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[56] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4374,7 +4374,7 @@ func (x *OptionalBool) String() string { func (*OptionalBool) ProtoMessage() {} func (x *OptionalBool) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[56] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[56] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4387,7 +4387,7 @@ func (x *OptionalBool) ProtoReflect() protoreflect.Message { // Deprecated: Use OptionalBool.ProtoReflect.Descriptor instead. func (*OptionalBool) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{56} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{56} } func (x *OptionalBool) GetValue() bool { @@ -4409,7 +4409,7 @@ type OptionalFileMode struct { func (x *OptionalFileMode) Reset() { *x = OptionalFileMode{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[57] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[57] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4422,7 +4422,7 @@ func (x *OptionalFileMode) String() string { func (*OptionalFileMode) ProtoMessage() {} func (x *OptionalFileMode) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[57] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[57] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4435,7 +4435,7 @@ func (x *OptionalFileMode) ProtoReflect() protoreflect.Message { // Deprecated: Use OptionalFileMode.ProtoReflect.Descriptor instead. func (*OptionalFileMode) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{57} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{57} } func (x *OptionalFileMode) GetValue() uint32 { @@ -4462,7 +4462,7 @@ type CompoundFieldOwners struct { func (x *CompoundFieldOwners) Reset() { *x = CompoundFieldOwners{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[58] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[58] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4475,7 +4475,7 @@ func (x *CompoundFieldOwners) String() string { func (*CompoundFieldOwners) ProtoMessage() {} func (x *CompoundFieldOwners) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[58] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[58] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4488,7 +4488,7 @@ func (x *CompoundFieldOwners) ProtoReflect() protoreflect.Message { // Deprecated: Use CompoundFieldOwners.ProtoReflect.Descriptor instead. func (*CompoundFieldOwners) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{58} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{58} } func (x *CompoundFieldOwners) GetOwners() map[string]string { @@ -4517,7 +4517,7 @@ type FieldOwners struct { func (x *FieldOwners) Reset() { *x = FieldOwners{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[59] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[59] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4530,7 +4530,7 @@ func (x *FieldOwners) String() string { func (*FieldOwners) ProtoMessage() {} func (x *FieldOwners) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[59] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[59] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4543,7 +4543,7 @@ func (x *FieldOwners) ProtoReflect() protoreflect.Message { // Deprecated: Use FieldOwners.ProtoReflect.Descriptor instead. func (*FieldOwners) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{59} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{59} } func (x *FieldOwners) GetSimple() map[int32]string { @@ -4574,7 +4574,7 @@ type OwningPlugins struct { func (x *OwningPlugins) Reset() { *x = OwningPlugins{} if protoimpl.UnsafeEnabled { - mi := &file_pkg_api_api_proto_msgTypes[60] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[60] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4587,7 +4587,7 @@ func (x *OwningPlugins) String() string { func (*OwningPlugins) ProtoMessage() {} func (x *OwningPlugins) ProtoReflect() protoreflect.Message { - mi := &file_pkg_api_api_proto_msgTypes[60] + mi := &file_pkg_api_v1alpha1_api_proto_msgTypes[60] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4600,7 +4600,7 @@ func (x *OwningPlugins) ProtoReflect() protoreflect.Message { // Deprecated: Use OwningPlugins.ProtoReflect.Descriptor instead. func (*OwningPlugins) Descriptor() ([]byte, []int) { - return file_pkg_api_api_proto_rawDescGZIP(), []int{60} + return file_pkg_api_v1alpha1_api_proto_rawDescGZIP(), []int{60} } func (x *OwningPlugins) GetOwners() map[string]*FieldOwners { @@ -4610,928 +4610,930 @@ func (x *OwningPlugins) GetOwners() map[string]*FieldOwners { return nil } -var File_pkg_api_api_proto protoreflect.FileDescriptor - -var file_pkg_api_api_proto_rawDesc = []byte{ - 0x0a, 0x11, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x22, 0x57, 0x0a, 0x15, 0x52, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x69, 0x64, - 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x49, - 0x64, 0x78, 0x22, 0x97, 0x01, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, - 0x0a, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, - 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x3d, 0x0a, - 0x05, 0x65, 0x76, 0x69, 0x63, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6e, - 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x45, 0x76, 0x69, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x65, 0x76, 0x69, 0x63, 0x74, 0x22, 0x59, 0x0a, 0x18, +var File_pkg_api_v1alpha1_api_proto protoreflect.FileDescriptor + +var file_pkg_api_v1alpha1_api_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x6e, 0x72, + 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x22, 0x57, 0x0a, 0x15, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x49, 0x64, 0x78, 0x22, 0x97, 0x01, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x66, 0x61, 0x69, 0x6c, - 0x65, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, + 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x06, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x3d, 0x0a, 0x05, 0x65, 0x76, 0x69, 0x63, 0x74, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x45, 0x76, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, + 0x65, 0x76, 0x69, 0x63, 0x74, 0x22, 0x59, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, + 0x22, 0xbe, 0x01, 0x0a, 0x0a, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, + 0x67, 0x12, 0x3c, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x26, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x2e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x22, + 0x60, 0x0a, 0x05, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x15, 0x0a, 0x11, 0x4c, 0x45, 0x56, 0x45, + 0x4c, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x0f, 0x0a, 0x0b, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x44, 0x45, 0x42, 0x55, 0x47, 0x10, 0x01, + 0x12, 0x0e, 0x0a, 0x0a, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x02, + 0x12, 0x0e, 0x0a, 0x0a, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x57, 0x41, 0x52, 0x4e, 0x10, 0x03, + 0x12, 0x0f, 0x0a, 0x0b, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, + 0x04, 0x22, 0xd2, 0x01, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x21, + 0x0a, 0x0c, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x75, 0x6e, 0x74, + 0x69, 0x6d, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x31, 0x0a, 0x14, 0x72, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, + 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x13, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x27, 0x0a, + 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54, + 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0x2b, 0x0a, 0x11, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x73, 0x22, 0x9f, 0x01, 0x0a, 0x12, 0x53, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, + 0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x34, 0x0a, 0x04, 0x70, 0x6f, + 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, - 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x22, 0xbe, 0x01, 0x0a, 0x0a, 0x4c, 0x6f, 0x67, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x3c, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, - 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, - 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, - 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, - 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x60, 0x0a, 0x05, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, - 0x15, 0x0a, 0x11, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, - 0x44, 0x45, 0x42, 0x55, 0x47, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x4c, 0x45, 0x56, 0x45, 0x4c, - 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x4c, 0x45, 0x56, 0x45, 0x4c, - 0x5f, 0x57, 0x41, 0x52, 0x4e, 0x10, 0x03, 0x12, 0x0f, 0x0a, 0x0b, 0x4c, 0x45, 0x56, 0x45, 0x4c, - 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x04, 0x22, 0xd2, 0x01, 0x0a, 0x10, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, - 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x75, 0x6e, - 0x74, 0x69, 0x6d, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x75, 0x6e, 0x74, - 0x69, 0x6d, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x31, 0x0a, 0x14, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x13, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, - 0x65, 0x6f, 0x75, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, - 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0x2b, 0x0a, - 0x11, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x9f, 0x01, 0x0a, 0x12, 0x53, - 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x34, 0x0a, 0x04, 0x70, 0x6f, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x20, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, - 0x78, 0x52, 0x04, 0x70, 0x6f, 0x64, 0x73, 0x12, 0x3f, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x72, - 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0a, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x6f, 0x72, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x6d, 0x6f, 0x72, 0x65, 0x22, 0x68, 0x0a, 0x13, - 0x53, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x04, 0x70, 0x6f, 0x64, 0x73, + 0x12, 0x3f, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x04, 0x6d, 0x6f, 0x72, 0x65, 0x22, 0x68, 0x0a, 0x13, 0x53, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, + 0x6e, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x06, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, + 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x52, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, + 0x6f, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x6d, 0x6f, 0x72, 0x65, 0x22, + 0x8b, 0x01, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x03, 0x70, 0x6f, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, + 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, + 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x03, 0x70, 0x6f, 0x64, 0x12, 0x3d, + 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x22, 0xda, 0x01, + 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x06, 0x61, 0x64, 0x6a, + 0x75, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6e, 0x72, 0x69, 0x2e, + 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, + 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, + 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x52, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x3d, 0x0a, 0x05, 0x65, + 0x76, 0x69, 0x63, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6e, 0x72, 0x69, + 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x45, 0x76, 0x69, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x65, 0x76, 0x69, 0x63, 0x74, 0x22, 0xda, 0x01, 0x0a, 0x16, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x03, 0x70, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, + 0x64, 0x62, 0x6f, 0x78, 0x52, 0x03, 0x70, 0x6f, 0x64, 0x12, 0x3d, 0x0a, 0x09, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, + 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x09, 0x63, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x4d, 0x0a, 0x0f, 0x6c, 0x69, 0x6e, 0x75, + 0x78, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x0e, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x97, 0x01, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x06, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x6f, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x04, 0x6d, 0x6f, 0x72, 0x65, 0x22, 0x8b, 0x01, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x32, 0x0a, 0x03, 0x70, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, - 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, - 0x52, 0x03, 0x70, 0x6f, 0x64, 0x12, 0x3d, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, - 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x22, 0xda, 0x01, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x41, 0x0a, 0x06, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x29, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x61, 0x64, 0x6a, - 0x75, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x06, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x12, 0x3d, 0x0a, 0x05, 0x65, 0x76, 0x69, 0x63, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x74, 0x65, 0x12, 0x3d, 0x0a, 0x05, 0x65, 0x76, 0x69, 0x63, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x45, 0x76, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x65, 0x76, 0x69, 0x63, - 0x74, 0x22, 0xda, 0x01, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x03, - 0x70, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x72, 0x69, 0x2e, - 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x03, 0x70, 0x6f, 0x64, - 0x12, 0x3d, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, - 0x4d, 0x0a, 0x0f, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, - 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x0e, - 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x97, - 0x01, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x72, 0x69, - 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x52, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x3d, 0x0a, 0x05, 0x65, 0x76, 0x69, - 0x63, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, - 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x45, 0x76, 0x69, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x05, 0x65, 0x76, 0x69, 0x63, 0x74, 0x22, 0x89, 0x01, 0x0a, 0x14, 0x53, 0x74, 0x6f, - 0x70, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0x89, 0x01, 0x0a, 0x14, 0x53, 0x74, 0x6f, 0x70, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x03, 0x70, 0x6f, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, + 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, + 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x03, 0x70, 0x6f, 0x64, 0x12, 0x3d, + 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x22, 0x56, 0x0a, + 0x15, 0x53, 0x74, 0x6f, 0x70, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x06, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0xfc, 0x01, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x03, 0x70, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, - 0x52, 0x03, 0x70, 0x6f, 0x64, 0x12, 0x3d, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, - 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x22, 0x56, 0x0a, 0x15, 0x53, 0x74, 0x6f, 0x70, 0x43, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, - 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, - 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x52, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0xfc, 0x01, 0x0a, - 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, - 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x03, 0x70, 0x6f, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x64, - 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x03, 0x70, 0x6f, 0x64, 0x12, 0x5e, 0x0a, 0x18, - 0x6f, 0x76, 0x65, 0x72, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x5f, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, + 0x52, 0x03, 0x70, 0x6f, 0x64, 0x12, 0x5e, 0x0a, 0x18, 0x6f, 0x76, 0x65, 0x72, 0x68, 0x65, 0x61, + 0x64, 0x5f, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, + 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, + 0x69, 0x6e, 0x75, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x16, 0x6f, + 0x76, 0x65, 0x72, 0x68, 0x65, 0x61, 0x64, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x4d, 0x0a, 0x0f, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x5f, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x73, 0x52, 0x16, 0x6f, 0x76, 0x65, 0x72, 0x68, 0x65, 0x61, 0x64, 0x4c, 0x69, - 0x6e, 0x75, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x4d, 0x0a, 0x0f, - 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, - 0x75, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x0e, 0x6c, 0x69, 0x6e, - 0x75, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x1a, 0x0a, 0x18, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xb8, 0x01, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x31, 0x0a, 0x05, - 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x6e, 0x72, - 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x12, - 0x32, 0x0a, 0x03, 0x70, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, - 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x03, - 0x70, 0x6f, 0x64, 0x12, 0x3d, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x22, 0x96, 0x03, 0x0a, 0x22, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x43, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x6d, 0x65, - 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x03, 0x70, 0x6f, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6f, - 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x03, 0x70, 0x6f, 0x64, 0x12, 0x3d, 0x0a, - 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1f, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x41, 0x0a, 0x06, - 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6e, - 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x6a, - 0x75, 0x73, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x12, - 0x3d, 0x0a, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x25, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x72, 0x63, 0x65, 0x73, 0x52, 0x0e, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x73, 0x22, 0x1a, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, + 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0xb8, 0x01, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x31, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x32, 0x0a, 0x03, 0x70, 0x6f, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x64, + 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x03, 0x70, 0x6f, 0x64, 0x12, 0x3d, 0x0a, 0x09, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1f, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x3b, - 0x0a, 0x06, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, + 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x22, 0x96, 0x03, 0x0a, 0x22, + 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x32, 0x0a, 0x03, 0x70, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x20, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, + 0x78, 0x52, 0x03, 0x70, 0x6f, 0x64, 0x12, 0x3d, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x72, 0x69, 0x2e, + 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x41, 0x0a, 0x06, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x6d, 0x65, 0x6e, 0x74, + 0x52, 0x06, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, + 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, + 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x3b, 0x0a, 0x06, 0x6f, 0x77, 0x6e, 0x65, 0x72, + 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, + 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, + 0x77, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x06, 0x6f, 0x77, + 0x6e, 0x65, 0x72, 0x73, 0x12, 0x3e, 0x0a, 0x07, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x18, + 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x07, 0x70, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x73, 0x22, 0x3a, 0x0a, 0x0e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x49, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x22, 0x55, 0x0a, 0x23, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6a, 0x65, 0x63, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x12, + 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x22, 0x80, 0x04, 0x0a, 0x0a, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x12, 0x44, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x05, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x64, 0x53, 0x61, + 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x53, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x77, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x73, 0x52, 0x06, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x3e, 0x0a, 0x07, 0x70, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, - 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, - 0x63, 0x65, 0x52, 0x07, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x22, 0x3a, 0x0a, 0x0e, 0x50, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x55, 0x0a, 0x23, 0x56, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x6a, 0x75, - 0x73, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, - 0x0a, 0x06, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, - 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0x07, - 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x80, 0x04, 0x0a, 0x0a, 0x50, 0x6f, 0x64, 0x53, - 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, - 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, - 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x44, 0x0a, 0x06, 0x6c, 0x61, - 0x62, 0x65, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6e, 0x72, 0x69, - 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x4c, 0x61, 0x62, - 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, - 0x12, 0x53, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x64, - 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 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, 0x27, 0x0a, 0x0f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, - 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, - 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x3b, - 0x0a, 0x05, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, + 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, 0x27, + 0x0a, 0x0f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, + 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, + 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x05, 0x6c, 0x69, 0x6e, 0x75, 0x78, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, + 0x6e, 0x75, 0x78, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x05, 0x6c, + 0x69, 0x6e, 0x75, 0x78, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x03, 0x70, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x70, 0x73, 0x18, 0x0a, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x03, 0x69, 0x70, 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, 0xf7, 0x02, 0x0a, 0x0f, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x50, 0x6f, 0x64, + 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x12, 0x47, 0x0a, 0x0c, 0x70, 0x6f, 0x64, 0x5f, 0x6f, + 0x76, 0x65, 0x72, 0x68, 0x65, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, - 0x64, 0x62, 0x6f, 0x78, 0x52, 0x05, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x12, 0x10, 0x0a, 0x03, 0x70, - 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x70, 0x69, 0x64, 0x12, 0x10, 0x0a, - 0x03, 0x69, 0x70, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x69, 0x70, 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, 0xf7, 0x02, 0x0a, 0x0f, 0x4c, - 0x69, 0x6e, 0x75, 0x78, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x12, 0x47, - 0x0a, 0x0c, 0x70, 0x6f, 0x64, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x68, 0x65, 0x61, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, - 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x0b, 0x70, 0x6f, 0x64, 0x4f, - 0x76, 0x65, 0x72, 0x68, 0x65, 0x61, 0x64, 0x12, 0x49, 0x0a, 0x0d, 0x70, 0x6f, 0x64, 0x5f, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, - 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x73, 0x52, 0x0c, 0x70, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 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, 0x21, 0x0a, 0x0c, 0x63, 0x67, 0x72, 0x6f, 0x75, - 0x70, 0x73, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x50, 0x61, 0x74, 0x68, 0x12, 0x44, 0x0a, 0x0a, 0x6e, 0x61, - 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, - 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x4e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x52, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, - 0x12, 0x42, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x73, 0x22, 0xf8, 0x07, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x70, 0x6f, 0x64, 0x5f, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, - 0x78, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x6f, 0x64, 0x53, - 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3a, 0x0a, 0x05, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x6e, 0x72, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x52, 0x0b, 0x70, 0x6f, 0x64, 0x4f, 0x76, 0x65, 0x72, 0x68, 0x65, 0x61, 0x64, + 0x12, 0x49, 0x0a, 0x0d, 0x70, 0x6f, 0x64, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, + 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, + 0x69, 0x6e, 0x75, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x0c, 0x70, + 0x6f, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 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, 0x21, 0x0a, 0x0c, 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x5f, 0x70, 0x61, 0x74, 0x68, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x50, + 0x61, 0x74, 0x68, 0x12, 0x44, 0x0a, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, + 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, + 0x69, 0x6e, 0x75, 0x78, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x0a, 0x6e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x09, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, + 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x73, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0xf8, 0x07, + 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x70, + 0x6f, 0x64, 0x5f, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x49, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3a, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x12, 0x43, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x2b, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, + 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x52, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x43, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, - 0x6c, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, - 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x52, 0x0a, - 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 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, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x04, 0x61, 0x72, 0x67, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x08, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x12, 0x33, 0x0a, 0x06, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, - 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, - 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x06, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x31, 0x0a, 0x05, - 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x72, + 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 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, 0x12, 0x0a, 0x04, 0x61, 0x72, + 0x67, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x12, 0x10, + 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x65, 0x6e, 0x76, + 0x12, 0x33, 0x0a, 0x06, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x06, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x31, 0x0a, 0x05, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, + 0x73, 0x52, 0x05, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x12, 0x3a, 0x0a, 0x05, 0x6c, 0x69, 0x6e, 0x75, + 0x78, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, + 0x67, 0x2e, 0x61, 0x70, 0x69, 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, 0x05, 0x6c, + 0x69, 0x6e, 0x75, 0x78, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x03, 0x70, 0x69, 0x64, 0x12, 0x3b, 0x0a, 0x07, 0x72, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, + 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, + 0x4f, 0x53, 0x49, 0x58, 0x52, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x07, 0x72, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, + 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, + 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x41, + 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x5f, 0x61, 0x74, + 0x18, 0x10, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, + 0x41, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, + 0x11, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x65, 0x78, 0x69, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, + 0x23, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, + 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, + 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x43, + 0x44, 0x49, 0x5f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1f, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x44, 0x49, 0x44, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x52, 0x0a, 0x43, 0x44, 0x49, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x2e, 0x0a, + 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x52, 0x05, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x12, - 0x3a, 0x0a, 0x05, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, - 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 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, 0x05, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x12, 0x10, 0x0a, 0x03, 0x70, - 0x69, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x70, 0x69, 0x64, 0x12, 0x3b, 0x0a, - 0x07, 0x72, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, - 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x4f, 0x53, 0x49, 0x58, 0x52, 0x6c, 0x69, 0x6d, 0x69, - 0x74, 0x52, 0x07, 0x72, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, - 0x72, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, - 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x69, 0x6e, 0x69, - 0x73, 0x68, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x66, - 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x78, 0x69, - 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x65, 0x78, - 0x69, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x13, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x43, 0x44, 0x49, 0x5f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, - 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, - 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, - 0x44, 0x49, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x0a, 0x43, 0x44, 0x49, 0x44, 0x65, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x12, 0x2e, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x15, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, - 0x75, 0x73, 0x65, 0x72, 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, - 0x6f, 0x0a, 0x05, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, - 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, - 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, - 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x22, 0x80, 0x03, 0x0a, 0x05, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x12, 0x36, 0x0a, 0x08, 0x70, 0x72, - 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, - 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x08, 0x70, 0x72, 0x65, 0x73, 0x74, 0x61, - 0x72, 0x74, 0x12, 0x41, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x75, 0x6e, - 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x72, 0x69, - 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x75, - 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x45, 0x0a, 0x10, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x0f, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x43, 0x0a, 0x0f, - 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, - 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, + 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 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, 0x6f, 0x0a, 0x05, 0x4d, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x80, 0x03, 0x0a, 0x05, 0x48, 0x6f, + 0x6f, 0x6b, 0x73, 0x12, 0x36, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x6f, 0x6f, - 0x6b, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x12, 0x38, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x74, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x05, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, - 0x52, 0x09, 0x70, 0x6f, 0x73, 0x74, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x36, 0x0a, 0x08, 0x70, - 0x6f, 0x73, 0x74, 0x73, 0x74, 0x6f, 0x70, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x6b, 0x52, 0x08, 0x70, 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x41, 0x0a, 0x0e, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x52, + 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x45, + 0x0a, 0x10, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, + 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x43, 0x0a, 0x0f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x63, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x09, 0x70, 0x6f, + 0x73, 0x74, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x73, - 0x74, 0x6f, 0x70, 0x22, 0x7d, 0x0a, 0x04, 0x48, 0x6f, 0x6f, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x70, - 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, - 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x61, - 0x72, 0x67, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x03, 0x65, 0x6e, 0x76, 0x12, 0x3b, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, - 0x75, 0x74, 0x22, 0xa4, 0x04, 0x0a, 0x0e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x43, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x44, 0x0a, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, - 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, - 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x12, 0x3b, 0x0a, 0x07, 0x64, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6e, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x09, 0x70, 0x6f, 0x73, 0x74, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x12, 0x36, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x73, 0x74, 0x6f, 0x70, + 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x6f, + 0x6f, 0x6b, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x73, 0x74, 0x6f, 0x70, 0x22, 0x7d, 0x0a, 0x04, + 0x48, 0x6f, 0x6f, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x12, 0x10, 0x0a, 0x03, + 0x65, 0x6e, 0x76, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x12, 0x3b, + 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x21, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, + 0x6e, 0x74, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0xa4, 0x04, 0x0a, 0x0e, + 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x44, + 0x0a, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x4e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x73, 0x12, 0x3b, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, + 0x75, 0x78, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x73, 0x12, 0x42, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, + 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x45, 0x0a, 0x0d, 0x6f, 0x6f, 0x6d, 0x5f, 0x73, 0x63, 0x6f, + 0x72, 0x65, 0x5f, 0x61, 0x64, 0x6a, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, - 0x07, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, - 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x73, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x45, 0x0a, 0x0d, - 0x6f, 0x6f, 0x6d, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x64, 0x6a, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x52, + 0x0b, 0x6f, 0x6f, 0x6d, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x41, 0x64, 0x6a, 0x12, 0x21, 0x0a, 0x0c, + 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x50, 0x61, 0x74, 0x68, 0x12, + 0x46, 0x0a, 0x0b, 0x69, 0x6f, 0x5f, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, + 0x78, 0x49, 0x4f, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x69, 0x6f, 0x50, + 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x4e, 0x0a, 0x0f, 0x73, 0x65, 0x63, 0x63, 0x6f, + 0x6d, 0x70, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x25, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, + 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x0e, 0x73, 0x65, 0x63, 0x63, 0x6f, 0x6d, 0x70, + 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x49, 0x0a, 0x0e, 0x73, 0x65, 0x63, 0x63, 0x6f, + 0x6d, 0x70, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x22, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x53, 0x65, 0x63, 0x63, + 0x6f, 0x6d, 0x70, 0x52, 0x0d, 0x73, 0x65, 0x63, 0x63, 0x6f, 0x6d, 0x70, 0x50, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x22, 0x38, 0x0a, 0x0e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x4e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x96, 0x02, 0x0a, + 0x0b, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, + 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x69, + 0x6e, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, + 0x12, 0x43, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x52, 0x0b, 0x6f, 0x6f, 0x6d, 0x53, 0x63, 0x6f, 0x72, 0x65, - 0x41, 0x64, 0x6a, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x5f, 0x70, - 0x61, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x67, 0x72, 0x6f, 0x75, - 0x70, 0x73, 0x50, 0x61, 0x74, 0x68, 0x12, 0x46, 0x0a, 0x0b, 0x69, 0x6f, 0x5f, 0x70, 0x72, 0x69, - 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x72, - 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x49, 0x4f, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, - 0x74, 0x79, 0x52, 0x0a, 0x69, 0x6f, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x4e, - 0x0a, 0x0f, 0x73, 0x65, 0x63, 0x63, 0x6f, 0x6d, 0x70, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, - 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, - 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, - 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x0e, - 0x73, 0x65, 0x63, 0x63, 0x6f, 0x6d, 0x70, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x49, - 0x0a, 0x0e, 0x73, 0x65, 0x63, 0x63, 0x6f, 0x6d, 0x70, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, - 0x6e, 0x75, 0x78, 0x53, 0x65, 0x63, 0x63, 0x6f, 0x6d, 0x70, 0x52, 0x0d, 0x73, 0x65, 0x63, 0x63, - 0x6f, 0x6d, 0x70, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x38, 0x0a, 0x0e, 0x4c, 0x69, 0x6e, - 0x75, 0x78, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, - 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, - 0x61, 0x74, 0x68, 0x22, 0x96, 0x02, 0x0a, 0x0b, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x44, 0x65, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6d, - 0x61, 0x6a, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6d, 0x61, 0x6a, 0x6f, - 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x12, 0x43, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, - 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6e, 0x72, 0x69, + 0x6e, 0x61, 0x6c, 0x46, 0x69, 0x6c, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x08, 0x66, 0x69, 0x6c, + 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x36, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x61, 0x6c, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x36, 0x0a, + 0x03, 0x67, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x46, 0x69, 0x6c, 0x65, 0x4d, 0x6f, - 0x64, 0x65, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x36, 0x0a, 0x03, - 0x75, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, - 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x52, - 0x03, 0x75, 0x69, 0x64, 0x12, 0x36, 0x0a, 0x03, 0x67, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, - 0x6c, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x52, 0x03, 0x67, 0x69, 0x64, 0x22, 0xcb, 0x01, 0x0a, - 0x11, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x43, 0x67, 0x72, 0x6f, - 0x75, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x05, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x39, 0x0a, 0x05, - 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x72, - 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x36, 0x34, - 0x52, 0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x12, 0x39, 0x0a, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x05, 0x6d, 0x69, 0x6e, - 0x6f, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x1f, 0x0a, 0x09, 0x43, 0x44, - 0x49, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x53, 0x0a, 0x04, 0x55, - 0x73, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x03, 0x67, 0x69, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x64, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x67, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0d, - 0x52, 0x0e, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x47, 0x69, 0x64, 0x73, - 0x22, 0xda, 0x04, 0x0a, 0x0e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, + 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, + 0x52, 0x03, 0x67, 0x69, 0x64, 0x22, 0xcb, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x44, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x43, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x61, + 0x6c, 0x6c, 0x6f, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x61, 0x6c, 0x6c, 0x6f, + 0x77, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x39, 0x0a, 0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, + 0x12, 0x39, 0x0a, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, + 0x6e, 0x74, 0x36, 0x34, 0x52, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x61, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x22, 0x1f, 0x0a, 0x09, 0x43, 0x44, 0x49, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x53, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, + 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x10, + 0x0a, 0x03, 0x67, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x67, 0x69, 0x64, + 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x67, + 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x0e, 0x61, 0x64, 0x64, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x47, 0x69, 0x64, 0x73, 0x22, 0xda, 0x04, 0x0a, 0x0e, 0x4c, 0x69, + 0x6e, 0x75, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x06, + 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6e, + 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x52, + 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x30, 0x0a, 0x03, 0x63, 0x70, 0x75, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, + 0x78, 0x43, 0x50, 0x55, 0x52, 0x03, 0x63, 0x70, 0x75, 0x12, 0x4c, 0x0a, 0x0f, 0x68, 0x75, 0x67, + 0x65, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, + 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, 0x49, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x69, 0x6f, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, + 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6f, 0x43, 0x6c, 0x61, + 0x73, 0x73, 0x12, 0x41, 0x0a, 0x09, 0x72, 0x64, 0x74, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x08, 0x72, 0x64, 0x74, + 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x4b, 0x0a, 0x07, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, + 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, + 0x6e, 0x75, 0x78, 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, 0x41, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x07, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, - 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x30, - 0x0a, 0x03, 0x63, 0x70, 0x75, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, 0x72, - 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x43, 0x50, 0x55, 0x52, 0x03, 0x63, 0x70, 0x75, - 0x12, 0x4c, 0x0a, 0x0f, 0x68, 0x75, 0x67, 0x65, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x6c, 0x69, 0x6d, - 0x69, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, - 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 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, 0x49, - 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6f, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, + 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x43, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x07, 0x64, 0x65, + 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x33, 0x0a, 0x04, 0x70, 0x69, 0x64, 0x73, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, + 0x50, 0x69, 0x64, 0x73, 0x52, 0x04, 0x70, 0x69, 0x64, 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, 0xaa, 0x04, 0x0a, 0x0b, 0x4c, 0x69, 0x6e, 0x75, 0x78, + 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x39, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0c, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x69, 0x6f, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x41, 0x0a, 0x09, 0x72, 0x64, 0x74, - 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, - 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x52, 0x08, 0x72, 0x64, 0x74, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x4b, 0x0a, 0x07, - 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, - 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 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, 0x41, 0x0a, 0x07, 0x64, 0x65, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6e, 0x72, 0x69, - 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x43, 0x67, 0x72, - 0x6f, 0x75, 0x70, 0x52, 0x07, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x33, 0x0a, 0x04, - 0x70, 0x69, 0x64, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x72, 0x69, - 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x50, 0x69, 0x64, 0x73, 0x52, 0x04, 0x70, 0x69, 0x64, - 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, 0xaa, 0x04, - 0x0a, 0x0b, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x39, 0x0a, - 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, - 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x36, - 0x34, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x45, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x65, - 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, - 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, - 0x36, 0x34, 0x52, 0x0b, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x37, 0x0a, 0x04, 0x73, 0x77, 0x61, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, + 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x12, 0x45, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x0b, 0x72, 0x65, 0x73, + 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x04, 0x73, 0x77, 0x61, 0x70, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x04, 0x73, 0x77, 0x61, + 0x70, 0x12, 0x3b, 0x0a, 0x06, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, + 0x6c, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x06, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x12, 0x42, + 0x0a, 0x0a, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x5f, 0x74, 0x63, 0x70, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x09, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x54, + 0x63, 0x70, 0x12, 0x44, 0x0a, 0x0a, 0x73, 0x77, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x65, 0x73, 0x73, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x0a, 0x73, 0x77, + 0x61, 0x70, 0x70, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x12, 0x50, 0x0a, 0x12, 0x64, 0x69, 0x73, 0x61, + 0x62, 0x6c, 0x65, 0x5f, 0x6f, 0x6f, 0x6d, 0x5f, 0x6b, 0x69, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x61, 0x6c, 0x42, 0x6f, 0x6f, 0x6c, 0x52, 0x10, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, + 0x65, 0x4f, 0x6f, 0x6d, 0x4b, 0x69, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x47, 0x0a, 0x0d, 0x75, 0x73, + 0x65, 0x5f, 0x68, 0x69, 0x65, 0x72, 0x61, 0x72, 0x63, 0x68, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x22, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, + 0x6c, 0x42, 0x6f, 0x6f, 0x6c, 0x52, 0x0c, 0x75, 0x73, 0x65, 0x48, 0x69, 0x65, 0x72, 0x61, 0x72, + 0x63, 0x68, 0x79, 0x22, 0x88, 0x03, 0x0a, 0x08, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x43, 0x50, 0x55, + 0x12, 0x3c, 0x0a, 0x06, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, + 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x06, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x12, 0x39, + 0x0a, 0x05, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, - 0x36, 0x34, 0x52, 0x04, 0x73, 0x77, 0x61, 0x70, 0x12, 0x3b, 0x0a, 0x06, 0x6b, 0x65, 0x72, 0x6e, - 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, - 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x06, 0x6b, - 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x12, 0x42, 0x0a, 0x0a, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x5f, - 0x74, 0x63, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, + 0x36, 0x34, 0x52, 0x05, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x12, 0x3c, 0x0a, 0x06, 0x70, 0x65, 0x72, + 0x69, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x09, - 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x54, 0x63, 0x70, 0x12, 0x44, 0x0a, 0x0a, 0x73, 0x77, 0x61, - 0x70, 0x70, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, - 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x55, 0x49, 0x6e, - 0x74, 0x36, 0x34, 0x52, 0x0a, 0x73, 0x77, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x12, - 0x50, 0x0a, 0x12, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6f, 0x6f, 0x6d, 0x5f, 0x6b, - 0x69, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6e, 0x72, - 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x42, 0x6f, 0x6f, 0x6c, 0x52, - 0x10, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x6f, 0x6d, 0x4b, 0x69, 0x6c, 0x6c, 0x65, - 0x72, 0x12, 0x47, 0x0a, 0x0d, 0x75, 0x73, 0x65, 0x5f, 0x68, 0x69, 0x65, 0x72, 0x61, 0x72, 0x63, - 0x68, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, - 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x42, 0x6f, 0x6f, 0x6c, 0x52, 0x0c, 0x75, 0x73, - 0x65, 0x48, 0x69, 0x65, 0x72, 0x61, 0x72, 0x63, 0x68, 0x79, 0x22, 0x88, 0x03, 0x0a, 0x08, 0x4c, - 0x69, 0x6e, 0x75, 0x78, 0x43, 0x50, 0x55, 0x12, 0x3c, 0x0a, 0x06, 0x73, 0x68, 0x61, 0x72, 0x65, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, - 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x06, 0x73, - 0x68, 0x61, 0x72, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x05, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x05, 0x71, 0x75, 0x6f, 0x74, 0x61, - 0x12, 0x3c, 0x0a, 0x06, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, + 0x06, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x4e, 0x0a, 0x10, 0x72, 0x65, 0x61, 0x6c, 0x74, + 0x69, 0x6d, 0x65, 0x5f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, + 0x6c, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x0f, 0x72, 0x65, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x65, + 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x4d, 0x0a, 0x0f, 0x72, 0x65, 0x61, 0x6c, 0x74, + 0x69, 0x6d, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, - 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x06, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x4e, - 0x0a, 0x10, 0x72, 0x65, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x72, 0x75, 0x6e, 0x74, 0x69, - 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, - 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x0f, 0x72, - 0x65, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x65, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x4d, - 0x0a, 0x0f, 0x72, 0x65, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, - 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, - 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x0e, 0x72, - 0x65, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x65, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x12, 0x0a, - 0x04, 0x63, 0x70, 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x70, 0x75, - 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6d, 0x65, 0x6d, 0x73, 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, 0xcf, 0x01, 0x0a, 0x0f, 0x53, 0x65, - 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x54, 0x0a, - 0x0c, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x31, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, - 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, - 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, - 0x5f, 0x72, 0x65, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6c, 0x6f, 0x63, 0x61, - 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x66, 0x22, 0x41, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x66, - 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x55, 0x4e, 0x54, 0x49, - 0x4d, 0x45, 0x5f, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, - 0x55, 0x4e, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, - 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x48, 0x4f, 0x53, 0x54, 0x10, 0x02, 0x22, 0x49, 0x0a, 0x0b, 0x50, - 0x4f, 0x53, 0x49, 0x58, 0x52, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x68, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x68, 0x61, - 0x72, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x66, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x04, 0x73, 0x6f, 0x66, 0x74, 0x22, 0x21, 0x0a, 0x09, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x50, - 0x69, 0x64, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x66, 0x0a, 0x0f, 0x4c, 0x69, 0x6e, - 0x75, 0x78, 0x49, 0x4f, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x37, 0x0a, 0x05, - 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x6e, 0x72, - 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x49, 0x4f, 0x50, 0x72, 0x69, 0x6f, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x52, 0x05, - 0x63, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, - 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, - 0x79, 0x22, 0xa6, 0x04, 0x0a, 0x13, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x41, - 0x64, 0x6a, 0x75, 0x73, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x5c, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, - 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, - 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x41, - 0x64, 0x6a, 0x75, 0x73, 0x74, 0x6d, 0x65, 0x6e, 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, 0x33, 0x0a, 0x06, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, - 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, - 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x06, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x30, 0x0a, 0x03, - 0x65, 0x6e, 0x76, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, 0x72, 0x69, 0x2e, + 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x0e, 0x72, 0x65, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x65, + 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x70, 0x75, 0x73, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x70, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, + 0x6d, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x73, 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, 0xcf, 0x01, 0x0a, 0x0f, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x54, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, + 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x31, 0x2e, 0x6e, + 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x66, + 0x69, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x0b, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, + 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x52, 0x65, + 0x66, 0x22, 0x41, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x5f, 0x44, 0x45, 0x46, 0x41, + 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x55, 0x4e, 0x43, 0x4f, 0x4e, 0x46, 0x49, + 0x4e, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x48, 0x4f, + 0x53, 0x54, 0x10, 0x02, 0x22, 0x49, 0x0a, 0x0b, 0x50, 0x4f, 0x53, 0x49, 0x58, 0x52, 0x6c, 0x69, + 0x6d, 0x69, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x72, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x68, 0x61, 0x72, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, + 0x6f, 0x66, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x6f, 0x66, 0x74, 0x22, + 0x21, 0x0a, 0x09, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x50, 0x69, 0x64, 0x73, 0x12, 0x14, 0x0a, 0x05, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x22, 0x66, 0x0a, 0x0f, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x49, 0x4f, 0x50, 0x72, 0x69, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x37, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x4f, 0x50, 0x72, + 0x69, 0x6f, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x52, 0x05, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x1a, + 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0xa6, 0x04, 0x0a, 0x13, 0x43, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x6d, 0x65, + 0x6e, 0x74, 0x12, 0x5c, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, + 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x6d, 0x65, + 0x6e, 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, 0x33, 0x0a, 0x06, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x06, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x30, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x12, 0x31, 0x0a, 0x05, 0x68, 0x6f, 0x6f, 0x6b, 0x73, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x6f, + 0x6f, 0x6b, 0x73, 0x52, 0x05, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x12, 0x44, 0x0a, 0x05, 0x6c, 0x69, + 0x6e, 0x75, 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x12, 0x31, - 0x0a, 0x05, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, - 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x52, 0x05, 0x68, 0x6f, 0x6f, 0x6b, - 0x73, 0x12, 0x44, 0x0a, 0x05, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2e, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x43, 0x6f, 0x6e, + 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x41, + 0x64, 0x6a, 0x75, 0x73, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x05, 0x6c, 0x69, 0x6e, 0x75, 0x78, + 0x12, 0x3b, 0x0a, 0x07, 0x72, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x21, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x4f, 0x53, 0x49, 0x58, 0x52, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x52, 0x07, 0x72, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x40, 0x0a, + 0x0b, 0x43, 0x44, 0x49, 0x5f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x44, 0x49, 0x44, 0x65, 0x76, + 0x69, 0x63, 0x65, 0x52, 0x0a, 0x43, 0x44, 0x49, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, + 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x61, + 0x72, 0x67, 0x73, 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, 0xde, 0x03, 0x0a, 0x18, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x6d, 0x65, 0x6e, 0x74, - 0x52, 0x05, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x12, 0x3b, 0x0a, 0x07, 0x72, 0x6c, 0x69, 0x6d, 0x69, - 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, - 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x50, 0x4f, 0x53, 0x49, 0x58, 0x52, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x07, 0x72, 0x6c, 0x69, - 0x6d, 0x69, 0x74, 0x73, 0x12, 0x40, 0x0a, 0x0b, 0x43, 0x44, 0x49, 0x5f, 0x64, 0x65, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x72, 0x69, 0x2e, - 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x43, 0x44, 0x49, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x0a, 0x43, 0x44, 0x49, 0x44, - 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x09, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 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, 0xde, 0x03, 0x0a, 0x18, 0x4c, - 0x69, 0x6e, 0x75, 0x78, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x6a, - 0x75, 0x73, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x3b, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, - 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x64, 0x65, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, - 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, - 0x69, 0x6e, 0x75, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x09, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x67, 0x72, 0x6f, - 0x75, 0x70, 0x73, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x50, 0x61, 0x74, 0x68, 0x12, 0x45, 0x0a, 0x0d, 0x6f, - 0x6f, 0x6d, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x64, 0x6a, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x52, 0x0b, 0x6f, 0x6f, 0x6d, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x41, - 0x64, 0x6a, 0x12, 0x46, 0x0a, 0x0b, 0x69, 0x6f, 0x5f, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, - 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, - 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, - 0x69, 0x6e, 0x75, 0x78, 0x49, 0x4f, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x52, 0x0a, - 0x69, 0x6f, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x49, 0x0a, 0x0e, 0x73, 0x65, - 0x63, 0x63, 0x6f, 0x6d, 0x70, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x53, - 0x65, 0x63, 0x63, 0x6f, 0x6d, 0x70, 0x52, 0x0d, 0x73, 0x65, 0x63, 0x63, 0x6f, 0x6d, 0x70, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x44, 0x0a, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, - 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, - 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x22, 0xce, 0x02, 0x0a, 0x0c, - 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x53, 0x65, 0x63, 0x63, 0x6f, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0e, - 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x41, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x49, 0x0a, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x65, - 0x72, 0x72, 0x6e, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, - 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, - 0x52, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x45, 0x72, 0x72, 0x6e, 0x6f, 0x12, 0x24, - 0x0a, 0x0d, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, - 0x75, 0x72, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x18, 0x04, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x6c, 0x69, - 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0c, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x50, 0x61, 0x74, 0x68, 0x12, - 0x2b, 0x0a, 0x11, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x5f, 0x6d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6c, 0x69, 0x73, 0x74, - 0x65, 0x6e, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x3e, 0x0a, 0x08, - 0x73, 0x79, 0x73, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, - 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x53, 0x79, 0x73, 0x63, 0x61, - 0x6c, 0x6c, 0x52, 0x08, 0x73, 0x79, 0x73, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x22, 0xba, 0x01, 0x0a, - 0x0c, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x53, 0x79, 0x73, 0x63, 0x61, 0x6c, 0x6c, 0x12, 0x14, 0x0a, - 0x05, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x6e, 0x61, - 0x6d, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x0a, 0x09, 0x65, - 0x72, 0x72, 0x6e, 0x6f, 0x5f, 0x72, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, - 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x55, 0x49, - 0x6e, 0x74, 0x33, 0x32, 0x52, 0x08, 0x65, 0x72, 0x72, 0x6e, 0x6f, 0x52, 0x65, 0x74, 0x12, 0x39, - 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, - 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x53, 0x65, 0x63, 0x63, 0x6f, 0x6d, 0x70, - 0x41, 0x72, 0x67, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x22, 0x6a, 0x0a, 0x0f, 0x4c, 0x69, 0x6e, - 0x75, 0x78, 0x53, 0x65, 0x63, 0x63, 0x6f, 0x6d, 0x70, 0x41, 0x72, 0x67, 0x12, 0x14, 0x0a, 0x05, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x5f, 0x74, 0x77, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x54, 0x77, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x6f, 0x70, 0x22, 0x9d, 0x01, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x40, 0x0a, 0x05, - 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6e, 0x72, - 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x05, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x12, 0x25, - 0x0a, 0x0e, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x46, 0x61, - 0x69, 0x6c, 0x75, 0x72, 0x65, 0x22, 0x5a, 0x0a, 0x14, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x43, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x42, 0x0a, - 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x12, 0x3b, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x21, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x44, 0x65, + 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x42, 0x0a, + 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x73, 0x22, 0x4e, 0x0a, 0x11, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x45, 0x76, - 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, - 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, - 0x6e, 0x22, 0x32, 0x0a, 0x08, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 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, 0x22, 0x26, 0x0a, 0x0e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, - 0x6c, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x23, 0x0a, - 0x0b, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x22, 0x25, 0x0a, 0x0d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, - 0x74, 0x33, 0x32, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x26, 0x0a, 0x0e, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x12, 0x14, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x22, 0x25, 0x0a, 0x0d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, - 0x36, 0x34, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x26, 0x0a, 0x0e, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x61, 0x6c, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x22, 0x24, 0x0a, 0x0c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x42, 0x6f, 0x6f, 0x6c, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x28, 0x0a, 0x10, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x61, 0x6c, 0x46, 0x69, 0x6c, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x22, 0x9f, 0x01, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x46, 0x69, 0x65, - 0x6c, 0x64, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x4d, 0x0a, 0x06, 0x6f, 0x77, 0x6e, 0x65, - 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, - 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x77, 0x6e, - 0x65, 0x72, 0x73, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x06, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4f, 0x77, 0x6e, 0x65, 0x72, - 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, 0x0b, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x77, 0x6e, 0x65, - 0x72, 0x73, 0x12, 0x45, 0x0a, 0x06, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, - 0x77, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x06, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x4b, 0x0a, 0x08, 0x63, 0x6f, 0x6d, - 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x6e, 0x72, + 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x5f, 0x70, 0x61, 0x74, + 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, + 0x50, 0x61, 0x74, 0x68, 0x12, 0x45, 0x0a, 0x0d, 0x6f, 0x6f, 0x6d, 0x5f, 0x73, 0x63, 0x6f, 0x72, + 0x65, 0x5f, 0x61, 0x64, 0x6a, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x43, - 0x6f, 0x6d, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x63, 0x6f, - 0x6d, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x1a, 0x39, 0x0a, 0x0b, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 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, 0x66, 0x0a, 0x0d, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x3f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, - 0x75, 0x6e, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xb6, 0x01, 0x0a, 0x0d, 0x4f, 0x77, - 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x12, 0x47, 0x0a, 0x06, 0x6f, - 0x77, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x6e, 0x72, + 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x52, 0x0b, + 0x6f, 0x6f, 0x6d, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x41, 0x64, 0x6a, 0x12, 0x46, 0x0a, 0x0b, 0x69, + 0x6f, 0x5f, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x25, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x49, 0x4f, 0x50, + 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x69, 0x6f, 0x50, 0x72, 0x69, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x12, 0x49, 0x0a, 0x0e, 0x73, 0x65, 0x63, 0x63, 0x6f, 0x6d, 0x70, 0x5f, 0x70, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6e, 0x72, + 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x53, 0x65, 0x63, 0x63, 0x6f, 0x6d, 0x70, 0x52, + 0x0d, 0x73, 0x65, 0x63, 0x63, 0x6f, 0x6d, 0x70, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x44, + 0x0a, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x4e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x73, 0x22, 0xce, 0x02, 0x0a, 0x0c, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x53, 0x65, + 0x63, 0x63, 0x6f, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x5f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x49, 0x0a, 0x0d, + 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x65, 0x72, 0x72, 0x6e, 0x6f, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x61, 0x6c, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x52, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, + 0x6c, 0x74, 0x45, 0x72, 0x72, 0x6e, 0x6f, 0x12, 0x24, 0x0a, 0x0d, 0x61, 0x72, 0x63, 0x68, 0x69, + 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, + 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x14, 0x0a, + 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x66, 0x6c, + 0x61, 0x67, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x5f, + 0x70, 0x61, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6c, 0x69, 0x73, 0x74, + 0x65, 0x6e, 0x65, 0x72, 0x50, 0x61, 0x74, 0x68, 0x12, 0x2b, 0x0a, 0x11, 0x6c, 0x69, 0x73, 0x74, + 0x65, 0x6e, 0x65, 0x72, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x10, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x3e, 0x0a, 0x08, 0x73, 0x79, 0x73, 0x63, 0x61, 0x6c, 0x6c, + 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, + 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, + 0x69, 0x6e, 0x75, 0x78, 0x53, 0x79, 0x73, 0x63, 0x61, 0x6c, 0x6c, 0x52, 0x08, 0x73, 0x79, 0x73, + 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x22, 0xba, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x53, + 0x79, 0x73, 0x63, 0x61, 0x6c, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x0a, 0x09, 0x65, 0x72, 0x72, 0x6e, 0x6f, 0x5f, 0x72, 0x65, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, + 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x52, 0x08, 0x65, + 0x72, 0x72, 0x6e, 0x6f, 0x52, 0x65, 0x74, 0x12, 0x39, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, + 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, + 0x75, 0x78, 0x53, 0x65, 0x63, 0x63, 0x6f, 0x6d, 0x70, 0x41, 0x72, 0x67, 0x52, 0x04, 0x61, 0x72, + 0x67, 0x73, 0x22, 0x6a, 0x0a, 0x0f, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x53, 0x65, 0x63, 0x63, 0x6f, + 0x6d, 0x70, 0x41, 0x72, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x74, 0x77, 0x6f, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x54, 0x77, 0x6f, 0x12, 0x0e, + 0x0a, 0x02, 0x6f, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x6f, 0x70, 0x22, 0x9d, + 0x01, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x40, 0x0a, 0x05, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, + 0x78, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x52, 0x05, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x12, 0x25, 0x0a, 0x0e, 0x69, 0x67, 0x6e, 0x6f, 0x72, + 0x65, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0d, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x22, 0x5a, + 0x0a, 0x14, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x42, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, + 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, + 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x4e, 0x0a, 0x11, 0x43, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x45, 0x76, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0x32, 0x0a, 0x08, 0x4b, 0x65, + 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 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, 0x22, 0x26, + 0x0a, 0x0e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x23, 0x0a, 0x0b, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x25, 0x0a, 0x0d, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x22, 0x26, 0x0a, 0x0e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x55, 0x49, + 0x6e, 0x74, 0x33, 0x32, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x25, 0x0a, 0x0d, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x22, 0x26, 0x0a, 0x0e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x55, 0x49, 0x6e, + 0x74, 0x36, 0x34, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x24, 0x0a, 0x0c, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x42, 0x6f, 0x6f, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, + 0x28, 0x0a, 0x10, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x46, 0x69, 0x6c, 0x65, 0x4d, + 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x9f, 0x01, 0x0a, 0x13, 0x43, 0x6f, + 0x6d, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x77, 0x6e, 0x65, 0x72, + 0x73, 0x12, 0x4d, 0x0a, 0x06, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x35, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x75, 0x6e, + 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x4f, 0x77, 0x6e, + 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, + 0x1a, 0x39, 0x0a, 0x0b, 0x4f, 0x77, 0x6e, 0x65, 0x72, 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, 0x0b, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x45, 0x0a, 0x06, 0x73, + 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x4f, 0x77, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, - 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6f, 0x77, - 0x6e, 0x65, 0x72, 0x73, 0x1a, 0x5c, 0x0a, 0x0b, 0x4f, 0x77, 0x6e, 0x65, 0x72, 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, 0x37, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x61, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x53, + 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x73, 0x69, 0x6d, 0x70, + 0x6c, 0x65, 0x12, 0x4b, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, - 0x64, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, - 0x38, 0x01, 0x2a, 0xf4, 0x02, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x0b, 0x0a, 0x07, - 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x55, 0x4e, - 0x5f, 0x50, 0x4f, 0x44, 0x5f, 0x53, 0x41, 0x4e, 0x44, 0x42, 0x4f, 0x58, 0x10, 0x01, 0x12, 0x14, - 0x0a, 0x10, 0x53, 0x54, 0x4f, 0x50, 0x5f, 0x50, 0x4f, 0x44, 0x5f, 0x53, 0x41, 0x4e, 0x44, 0x42, - 0x4f, 0x58, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x5f, 0x50, - 0x4f, 0x44, 0x5f, 0x53, 0x41, 0x4e, 0x44, 0x42, 0x4f, 0x58, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, - 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, - 0x10, 0x04, 0x12, 0x19, 0x0a, 0x15, 0x50, 0x4f, 0x53, 0x54, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, - 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x10, 0x05, 0x12, 0x13, 0x0a, - 0x0f, 0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, - 0x10, 0x06, 0x12, 0x18, 0x0a, 0x14, 0x50, 0x4f, 0x53, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x52, 0x54, - 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x10, 0x07, 0x12, 0x14, 0x0a, 0x10, - 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, - 0x10, 0x08, 0x12, 0x19, 0x0a, 0x15, 0x50, 0x4f, 0x53, 0x54, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, - 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x10, 0x09, 0x12, 0x12, 0x0a, - 0x0e, 0x53, 0x54, 0x4f, 0x50, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x10, - 0x0a, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x54, - 0x41, 0x49, 0x4e, 0x45, 0x52, 0x10, 0x0b, 0x12, 0x16, 0x0a, 0x12, 0x55, 0x50, 0x44, 0x41, 0x54, - 0x45, 0x5f, 0x50, 0x4f, 0x44, 0x5f, 0x53, 0x41, 0x4e, 0x44, 0x42, 0x4f, 0x58, 0x10, 0x0c, 0x12, - 0x1b, 0x0a, 0x17, 0x50, 0x4f, 0x53, 0x54, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x50, - 0x4f, 0x44, 0x5f, 0x53, 0x41, 0x4e, 0x44, 0x42, 0x4f, 0x58, 0x10, 0x0d, 0x12, 0x21, 0x0a, 0x1d, - 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, - 0x45, 0x52, 0x5f, 0x41, 0x44, 0x4a, 0x55, 0x53, 0x54, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x0e, 0x12, - 0x08, 0x0a, 0x04, 0x4c, 0x41, 0x53, 0x54, 0x10, 0x0f, 0x2a, 0x82, 0x01, 0x0a, 0x0e, 0x43, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x15, 0x0a, 0x11, - 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, - 0x4e, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, - 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x43, 0x4f, - 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x50, 0x41, 0x55, 0x53, 0x45, 0x44, 0x10, 0x02, - 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x52, 0x55, - 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4e, 0x54, 0x41, - 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x4f, 0x50, 0x50, 0x45, 0x44, 0x10, 0x04, 0x2a, 0x65, - 0x0a, 0x0b, 0x49, 0x4f, 0x50, 0x72, 0x69, 0x6f, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x15, 0x0a, - 0x11, 0x49, 0x4f, 0x50, 0x52, 0x49, 0x4f, 0x5f, 0x43, 0x4c, 0x41, 0x53, 0x53, 0x5f, 0x4e, 0x4f, - 0x4e, 0x45, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x49, 0x4f, 0x50, 0x52, 0x49, 0x4f, 0x5f, 0x43, - 0x4c, 0x41, 0x53, 0x53, 0x5f, 0x52, 0x54, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x49, 0x4f, 0x50, - 0x52, 0x49, 0x4f, 0x5f, 0x43, 0x4c, 0x41, 0x53, 0x53, 0x5f, 0x42, 0x45, 0x10, 0x02, 0x12, 0x15, - 0x0a, 0x11, 0x49, 0x4f, 0x50, 0x52, 0x49, 0x4f, 0x5f, 0x43, 0x4c, 0x41, 0x53, 0x53, 0x5f, 0x49, - 0x44, 0x4c, 0x45, 0x10, 0x03, 0x2a, 0xb9, 0x04, 0x0a, 0x05, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, - 0x08, 0x0a, 0x04, 0x4e, 0x6f, 0x6e, 0x65, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x6e, 0x6e, - 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x6f, - 0x75, 0x6e, 0x74, 0x73, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x4f, 0x63, 0x69, 0x48, 0x6f, 0x6f, - 0x6b, 0x73, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x10, - 0x04, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x64, 0x69, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x10, - 0x05, 0x12, 0x07, 0x0a, 0x03, 0x45, 0x6e, 0x76, 0x10, 0x06, 0x12, 0x08, 0x0a, 0x04, 0x41, 0x72, - 0x67, 0x73, 0x10, 0x07, 0x12, 0x0c, 0x0a, 0x08, 0x4d, 0x65, 0x6d, 0x4c, 0x69, 0x6d, 0x69, 0x74, - 0x10, 0x08, 0x12, 0x12, 0x0a, 0x0e, 0x4d, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x10, 0x09, 0x12, 0x10, 0x0a, 0x0c, 0x4d, 0x65, 0x6d, 0x53, 0x77, 0x61, - 0x70, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x10, 0x0a, 0x12, 0x12, 0x0a, 0x0e, 0x4d, 0x65, 0x6d, 0x4b, - 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x10, 0x0b, 0x12, 0x0f, 0x0a, 0x0b, - 0x4d, 0x65, 0x6d, 0x54, 0x43, 0x50, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x10, 0x0c, 0x12, 0x11, 0x0a, - 0x0d, 0x4d, 0x65, 0x6d, 0x53, 0x77, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x10, 0x0d, - 0x12, 0x17, 0x0a, 0x13, 0x4d, 0x65, 0x6d, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x6f, - 0x6d, 0x4b, 0x69, 0x6c, 0x6c, 0x65, 0x72, 0x10, 0x0e, 0x12, 0x13, 0x0a, 0x0f, 0x4d, 0x65, 0x6d, - 0x55, 0x73, 0x65, 0x48, 0x69, 0x65, 0x72, 0x61, 0x72, 0x63, 0x68, 0x79, 0x10, 0x0f, 0x12, 0x0d, - 0x0a, 0x09, 0x43, 0x50, 0x55, 0x53, 0x68, 0x61, 0x72, 0x65, 0x73, 0x10, 0x10, 0x12, 0x0c, 0x0a, - 0x08, 0x43, 0x50, 0x55, 0x51, 0x75, 0x6f, 0x74, 0x61, 0x10, 0x11, 0x12, 0x0d, 0x0a, 0x09, 0x43, - 0x50, 0x55, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x10, 0x12, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x50, - 0x55, 0x52, 0x65, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x65, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, - 0x10, 0x13, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x50, 0x55, 0x52, 0x65, 0x61, 0x6c, 0x74, 0x69, 0x6d, - 0x65, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x10, 0x14, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x50, 0x55, - 0x53, 0x65, 0x74, 0x43, 0x50, 0x55, 0x73, 0x10, 0x15, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x50, 0x55, - 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x73, 0x10, 0x16, 0x12, 0x0d, 0x0a, 0x09, 0x50, 0x69, 0x64, - 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x10, 0x17, 0x12, 0x12, 0x0a, 0x0e, 0x48, 0x75, 0x67, 0x65, - 0x70, 0x61, 0x67, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x10, 0x18, 0x12, 0x10, 0x0a, 0x0c, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6f, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x10, 0x19, 0x12, 0x0c, - 0x0a, 0x08, 0x52, 0x64, 0x74, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x10, 0x1a, 0x12, 0x12, 0x0a, 0x0e, - 0x43, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x55, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x10, 0x1b, - 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x50, 0x61, 0x74, 0x68, 0x10, - 0x1c, 0x12, 0x0f, 0x0a, 0x0b, 0x4f, 0x6f, 0x6d, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x41, 0x64, 0x6a, - 0x10, 0x1d, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x10, 0x1e, 0x12, - 0x0e, 0x0a, 0x0a, 0x49, 0x6f, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x10, 0x1f, 0x12, - 0x11, 0x0a, 0x0d, 0x53, 0x65, 0x63, 0x63, 0x6f, 0x6d, 0x70, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x10, 0x20, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x10, - 0x21, 0x32, 0xd8, 0x01, 0x0a, 0x07, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x5a, 0x0a, - 0x0e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, - 0x2b, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6e, + 0x64, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x75, 0x6e, 0x64, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x1a, + 0x39, 0x0a, 0x0b, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 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, 0x66, 0x0a, 0x0d, 0x43, 0x6f, + 0x6d, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x3f, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x71, 0x0a, 0x10, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x2d, 0x2e, + 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x22, 0xb6, 0x01, 0x0a, 0x0d, 0x4f, 0x77, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x73, 0x12, 0x47, 0x0a, 0x06, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x77, 0x6e, 0x69, + 0x6e, 0x67, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x1a, 0x5c, 0x0a, + 0x0b, 0x4f, 0x77, 0x6e, 0x65, 0x72, 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, 0x37, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x6e, - 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xb6, 0x07, 0x0a, - 0x06, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x5c, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x75, 0x72, 0x65, 0x12, 0x26, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6e, - 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, 0x0b, 0x53, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, - 0x6e, 0x69, 0x7a, 0x65, 0x12, 0x28, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, - 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, - 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x08, 0x53, 0x68, 0x75, - 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x12, 0x1b, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x2a, 0xf4, 0x02, 0x0a, 0x05, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, + 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x55, 0x4e, 0x5f, 0x50, 0x4f, 0x44, 0x5f, 0x53, 0x41, + 0x4e, 0x44, 0x42, 0x4f, 0x58, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x4f, 0x50, 0x5f, + 0x50, 0x4f, 0x44, 0x5f, 0x53, 0x41, 0x4e, 0x44, 0x42, 0x4f, 0x58, 0x10, 0x02, 0x12, 0x16, 0x0a, + 0x12, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x5f, 0x50, 0x4f, 0x44, 0x5f, 0x53, 0x41, 0x4e, 0x44, + 0x42, 0x4f, 0x58, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x5f, + 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x10, 0x04, 0x12, 0x19, 0x0a, 0x15, 0x50, + 0x4f, 0x53, 0x54, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x41, + 0x49, 0x4e, 0x45, 0x52, 0x10, 0x05, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, + 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x10, 0x06, 0x12, 0x18, 0x0a, 0x14, 0x50, + 0x4f, 0x53, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, + 0x4e, 0x45, 0x52, 0x10, 0x07, 0x12, 0x14, 0x0a, 0x10, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, + 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x10, 0x08, 0x12, 0x19, 0x0a, 0x15, 0x50, + 0x4f, 0x53, 0x54, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x41, + 0x49, 0x4e, 0x45, 0x52, 0x10, 0x09, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x54, 0x4f, 0x50, 0x5f, 0x43, + 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x10, 0x0a, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x45, + 0x4d, 0x4f, 0x56, 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x10, 0x0b, + 0x12, 0x16, 0x0a, 0x12, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x50, 0x4f, 0x44, 0x5f, 0x53, + 0x41, 0x4e, 0x44, 0x42, 0x4f, 0x58, 0x10, 0x0c, 0x12, 0x1b, 0x0a, 0x17, 0x50, 0x4f, 0x53, 0x54, + 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x50, 0x4f, 0x44, 0x5f, 0x53, 0x41, 0x4e, 0x44, + 0x42, 0x4f, 0x58, 0x10, 0x0d, 0x12, 0x21, 0x0a, 0x1d, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, + 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x41, 0x44, 0x4a, 0x55, + 0x53, 0x54, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x0e, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x41, 0x53, 0x54, + 0x10, 0x0f, 0x2a, 0x82, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, + 0x45, 0x52, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, + 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, + 0x44, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, + 0x5f, 0x50, 0x41, 0x55, 0x53, 0x45, 0x44, 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4e, + 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x03, + 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x53, 0x54, + 0x4f, 0x50, 0x50, 0x45, 0x44, 0x10, 0x04, 0x2a, 0x65, 0x0a, 0x0b, 0x49, 0x4f, 0x50, 0x72, 0x69, + 0x6f, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x15, 0x0a, 0x11, 0x49, 0x4f, 0x50, 0x52, 0x49, 0x4f, + 0x5f, 0x43, 0x4c, 0x41, 0x53, 0x53, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x13, 0x0a, + 0x0f, 0x49, 0x4f, 0x50, 0x52, 0x49, 0x4f, 0x5f, 0x43, 0x4c, 0x41, 0x53, 0x53, 0x5f, 0x52, 0x54, + 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x49, 0x4f, 0x50, 0x52, 0x49, 0x4f, 0x5f, 0x43, 0x4c, 0x41, + 0x53, 0x53, 0x5f, 0x42, 0x45, 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x49, 0x4f, 0x50, 0x52, 0x49, + 0x4f, 0x5f, 0x43, 0x4c, 0x41, 0x53, 0x53, 0x5f, 0x49, 0x44, 0x4c, 0x45, 0x10, 0x03, 0x2a, 0xb9, + 0x04, 0x0a, 0x05, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x6f, 0x6e, 0x65, + 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x10, 0x02, 0x12, + 0x0c, 0x0a, 0x08, 0x4f, 0x63, 0x69, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x10, 0x03, 0x12, 0x0b, 0x0a, + 0x07, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x10, 0x04, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x64, + 0x69, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x10, 0x05, 0x12, 0x07, 0x0a, 0x03, 0x45, 0x6e, + 0x76, 0x10, 0x06, 0x12, 0x08, 0x0a, 0x04, 0x41, 0x72, 0x67, 0x73, 0x10, 0x07, 0x12, 0x0c, 0x0a, + 0x08, 0x4d, 0x65, 0x6d, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x10, 0x08, 0x12, 0x12, 0x0a, 0x0e, 0x4d, + 0x65, 0x6d, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x10, 0x09, 0x12, + 0x10, 0x0a, 0x0c, 0x4d, 0x65, 0x6d, 0x53, 0x77, 0x61, 0x70, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x10, + 0x0a, 0x12, 0x12, 0x0a, 0x0e, 0x4d, 0x65, 0x6d, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x4c, 0x69, + 0x6d, 0x69, 0x74, 0x10, 0x0b, 0x12, 0x0f, 0x0a, 0x0b, 0x4d, 0x65, 0x6d, 0x54, 0x43, 0x50, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x10, 0x0c, 0x12, 0x11, 0x0a, 0x0d, 0x4d, 0x65, 0x6d, 0x53, 0x77, 0x61, + 0x70, 0x70, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x10, 0x0d, 0x12, 0x17, 0x0a, 0x13, 0x4d, 0x65, 0x6d, + 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x6f, 0x6d, 0x4b, 0x69, 0x6c, 0x6c, 0x65, 0x72, + 0x10, 0x0e, 0x12, 0x13, 0x0a, 0x0f, 0x4d, 0x65, 0x6d, 0x55, 0x73, 0x65, 0x48, 0x69, 0x65, 0x72, + 0x61, 0x72, 0x63, 0x68, 0x79, 0x10, 0x0f, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x50, 0x55, 0x53, 0x68, + 0x61, 0x72, 0x65, 0x73, 0x10, 0x10, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x50, 0x55, 0x51, 0x75, 0x6f, + 0x74, 0x61, 0x10, 0x11, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x50, 0x55, 0x50, 0x65, 0x72, 0x69, 0x6f, + 0x64, 0x10, 0x12, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x50, 0x55, 0x52, 0x65, 0x61, 0x6c, 0x74, 0x69, + 0x6d, 0x65, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x10, 0x13, 0x12, 0x15, 0x0a, 0x11, 0x43, + 0x50, 0x55, 0x52, 0x65, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x65, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, + 0x10, 0x14, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x50, 0x55, 0x53, 0x65, 0x74, 0x43, 0x50, 0x55, 0x73, + 0x10, 0x15, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x50, 0x55, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x73, + 0x10, 0x16, 0x12, 0x0d, 0x0a, 0x09, 0x50, 0x69, 0x64, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x10, + 0x17, 0x12, 0x12, 0x0a, 0x0e, 0x48, 0x75, 0x67, 0x65, 0x70, 0x61, 0x67, 0x65, 0x4c, 0x69, 0x6d, + 0x69, 0x74, 0x73, 0x10, 0x18, 0x12, 0x10, 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6f, + 0x43, 0x6c, 0x61, 0x73, 0x73, 0x10, 0x19, 0x12, 0x0c, 0x0a, 0x08, 0x52, 0x64, 0x74, 0x43, 0x6c, + 0x61, 0x73, 0x73, 0x10, 0x1a, 0x12, 0x12, 0x0a, 0x0e, 0x43, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, + 0x55, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x10, 0x1b, 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x73, 0x50, 0x61, 0x74, 0x68, 0x10, 0x1c, 0x12, 0x0f, 0x0a, 0x0b, 0x4f, 0x6f, + 0x6d, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x41, 0x64, 0x6a, 0x10, 0x1d, 0x12, 0x0b, 0x0a, 0x07, 0x52, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x10, 0x1e, 0x12, 0x0e, 0x0a, 0x0a, 0x49, 0x6f, 0x50, 0x72, + 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x10, 0x1f, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x65, 0x63, 0x63, + 0x6f, 0x6d, 0x70, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x10, 0x20, 0x12, 0x0d, 0x0a, 0x09, 0x4e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x10, 0x21, 0x32, 0xd8, 0x01, 0x0a, 0x07, 0x52, + 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x5a, 0x0a, 0x0e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x2b, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, + 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x1a, 0x1b, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, - 0x6e, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x12, 0x2c, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2d, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x6e, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x12, 0x2c, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2d, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x68, 0x0a, 0x0d, 0x53, 0x74, 0x6f, 0x70, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x12, 0x2a, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x43, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6e, - 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x71, 0x0a, 0x10, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x12, 0x2d, 0x2e, + 0x74, 0x79, 0x12, 0x71, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x2d, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xb6, 0x07, 0x0a, 0x06, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x12, 0x5c, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x12, 0x26, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x53, 0x61, - 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x6e, - 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, - 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x0b, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x26, 0x2e, 0x6e, 0x72, - 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x1a, 0x1b, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x12, 0x92, 0x01, 0x0a, 0x1b, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x6d, 0x65, 0x6e, 0x74, - 0x12, 0x38, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, - 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x6d, - 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x6e, 0x72, 0x69, - 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x57, 0x0a, 0x0d, 0x48, 0x6f, 0x73, 0x74, 0x46, 0x75, 0x6e, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x46, 0x0a, 0x03, 0x4c, 0x6f, 0x67, 0x12, 0x20, 0x2e, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, + 0x0a, 0x0b, 0x53, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x65, 0x12, 0x28, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1b, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x42, 0x27, - 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x6e, 0x72, 0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, - 0x61, 0x70, 0x69, 0x3b, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, + 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, + 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x44, 0x0a, 0x08, 0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x12, 0x1b, + 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1b, 0x2e, 0x6e, 0x72, + 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x6e, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x2c, 0x2e, 0x6e, 0x72, + 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x6e, 0x72, 0x69, 0x2e, + 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6e, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x2c, 0x2e, 0x6e, 0x72, + 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x6e, 0x72, 0x69, 0x2e, + 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, 0x0a, 0x0d, 0x53, 0x74, 0x6f, 0x70, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x2a, 0x2e, 0x6e, 0x72, 0x69, 0x2e, + 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x6f, + 0x70, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x71, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x53, + 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x12, 0x2d, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x0b, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x12, 0x26, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x1b, 0x2e, 0x6e, + 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x92, 0x01, 0x0a, 0x1b, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x41, + 0x64, 0x6a, 0x75, 0x73, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x38, 0x2e, 0x6e, 0x72, 0x69, 0x2e, + 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x6a, 0x75, + 0x73, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x57, + 0x0a, 0x0d, 0x48, 0x6f, 0x73, 0x74, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x46, 0x0a, 0x03, 0x4c, 0x6f, 0x67, 0x12, 0x20, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x6f, + 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, + 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x42, 0x35, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, + 0x2f, 0x6e, 0x72, 0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_pkg_api_api_proto_rawDescOnce sync.Once - file_pkg_api_api_proto_rawDescData = file_pkg_api_api_proto_rawDesc + file_pkg_api_v1alpha1_api_proto_rawDescOnce sync.Once + file_pkg_api_v1alpha1_api_proto_rawDescData = file_pkg_api_v1alpha1_api_proto_rawDesc ) -func file_pkg_api_api_proto_rawDescGZIP() []byte { - file_pkg_api_api_proto_rawDescOnce.Do(func() { - file_pkg_api_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_api_api_proto_rawDescData) +func file_pkg_api_v1alpha1_api_proto_rawDescGZIP() []byte { + file_pkg_api_v1alpha1_api_proto_rawDescOnce.Do(func() { + file_pkg_api_v1alpha1_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_api_v1alpha1_api_proto_rawDescData) }) - return file_pkg_api_api_proto_rawDescData + return file_pkg_api_v1alpha1_api_proto_rawDescData } -var file_pkg_api_api_proto_enumTypes = make([]protoimpl.EnumInfo, 6) -var file_pkg_api_api_proto_msgTypes = make([]protoimpl.MessageInfo, 71) -var file_pkg_api_api_proto_goTypes = []interface{}{ +var file_pkg_api_v1alpha1_api_proto_enumTypes = make([]protoimpl.EnumInfo, 6) +var file_pkg_api_v1alpha1_api_proto_msgTypes = make([]protoimpl.MessageInfo, 71) +var file_pkg_api_v1alpha1_api_proto_goTypes = []interface{}{ (Event)(0), // 0: nri.pkg.api.v1alpha1.Event (ContainerState)(0), // 1: nri.pkg.api.v1alpha1.ContainerState (IOPrioClass)(0), // 2: nri.pkg.api.v1alpha1.IOPrioClass @@ -5610,7 +5612,7 @@ var file_pkg_api_api_proto_goTypes = []interface{}{ nil, // 75: nri.pkg.api.v1alpha1.FieldOwners.CompoundEntry nil, // 76: nri.pkg.api.v1alpha1.OwningPlugins.OwnersEntry } -var file_pkg_api_api_proto_depIdxs = []int32{ +var file_pkg_api_v1alpha1_api_proto_depIdxs = []int32{ 52, // 0: nri.pkg.api.v1alpha1.UpdateContainersRequest.update:type_name -> nri.pkg.api.v1alpha1.ContainerUpdate 54, // 1: nri.pkg.api.v1alpha1.UpdateContainersRequest.evict:type_name -> nri.pkg.api.v1alpha1.ContainerEviction 52, // 2: nri.pkg.api.v1alpha1.UpdateContainersResponse.failed:type_name -> nri.pkg.api.v1alpha1.ContainerUpdate @@ -5757,13 +5759,13 @@ var file_pkg_api_api_proto_depIdxs = []int32{ 0, // [0:115] is the sub-list for field type_name } -func init() { file_pkg_api_api_proto_init() } -func file_pkg_api_api_proto_init() { - if File_pkg_api_api_proto != nil { +func init() { file_pkg_api_v1alpha1_api_proto_init() } +func file_pkg_api_v1alpha1_api_proto_init() { + if File_pkg_api_v1alpha1_api_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_pkg_api_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RegisterPluginRequest); i { case 0: return &v.state @@ -5775,7 +5777,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateContainersRequest); i { case 0: return &v.state @@ -5787,7 +5789,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateContainersResponse); i { case 0: return &v.state @@ -5799,7 +5801,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LogRequest); i { case 0: return &v.state @@ -5811,7 +5813,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ConfigureRequest); i { case 0: return &v.state @@ -5823,7 +5825,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ConfigureResponse); i { case 0: return &v.state @@ -5835,7 +5837,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SynchronizeRequest); i { case 0: return &v.state @@ -5847,7 +5849,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SynchronizeResponse); i { case 0: return &v.state @@ -5859,7 +5861,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateContainerRequest); i { case 0: return &v.state @@ -5871,7 +5873,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateContainerResponse); i { case 0: return &v.state @@ -5883,7 +5885,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateContainerRequest); i { case 0: return &v.state @@ -5895,7 +5897,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateContainerResponse); i { case 0: return &v.state @@ -5907,7 +5909,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StopContainerRequest); i { case 0: return &v.state @@ -5919,7 +5921,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StopContainerResponse); i { case 0: return &v.state @@ -5931,7 +5933,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdatePodSandboxRequest); i { case 0: return &v.state @@ -5943,7 +5945,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdatePodSandboxResponse); i { case 0: return &v.state @@ -5955,7 +5957,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StateChangeEvent); i { case 0: return &v.state @@ -5967,7 +5969,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ValidateContainerAdjustmentRequest); i { case 0: return &v.state @@ -5979,7 +5981,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PluginInstance); i { case 0: return &v.state @@ -5991,7 +5993,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ValidateContainerAdjustmentResponse); i { case 0: return &v.state @@ -6003,7 +6005,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Empty); i { case 0: return &v.state @@ -6015,7 +6017,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PodSandbox); i { case 0: return &v.state @@ -6027,7 +6029,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LinuxPodSandbox); i { case 0: return &v.state @@ -6039,7 +6041,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Container); i { case 0: return &v.state @@ -6051,7 +6053,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Mount); i { case 0: return &v.state @@ -6063,7 +6065,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Hooks); i { case 0: return &v.state @@ -6075,7 +6077,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Hook); i { case 0: return &v.state @@ -6087,7 +6089,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LinuxContainer); i { case 0: return &v.state @@ -6099,7 +6101,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LinuxNamespace); i { case 0: return &v.state @@ -6111,7 +6113,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LinuxDevice); i { case 0: return &v.state @@ -6123,7 +6125,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LinuxDeviceCgroup); i { case 0: return &v.state @@ -6135,7 +6137,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CDIDevice); i { case 0: return &v.state @@ -6147,7 +6149,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*User); i { case 0: return &v.state @@ -6159,7 +6161,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LinuxResources); i { case 0: return &v.state @@ -6171,7 +6173,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LinuxMemory); i { case 0: return &v.state @@ -6183,7 +6185,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LinuxCPU); i { case 0: return &v.state @@ -6195,7 +6197,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*HugepageLimit); i { case 0: return &v.state @@ -6207,7 +6209,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SecurityProfile); i { case 0: return &v.state @@ -6219,7 +6221,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*POSIXRlimit); i { case 0: return &v.state @@ -6231,7 +6233,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LinuxPids); i { case 0: return &v.state @@ -6243,7 +6245,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LinuxIOPriority); i { case 0: return &v.state @@ -6255,7 +6257,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ContainerAdjustment); i { case 0: return &v.state @@ -6267,7 +6269,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LinuxContainerAdjustment); i { case 0: return &v.state @@ -6279,7 +6281,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LinuxSeccomp); i { case 0: return &v.state @@ -6291,7 +6293,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LinuxSyscall); i { case 0: return &v.state @@ -6303,7 +6305,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LinuxSeccompArg); i { case 0: return &v.state @@ -6315,7 +6317,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ContainerUpdate); i { case 0: return &v.state @@ -6327,7 +6329,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LinuxContainerUpdate); i { case 0: return &v.state @@ -6339,7 +6341,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ContainerEviction); i { case 0: return &v.state @@ -6351,7 +6353,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*KeyValue); i { case 0: return &v.state @@ -6363,7 +6365,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OptionalString); i { case 0: return &v.state @@ -6375,7 +6377,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OptionalInt); i { case 0: return &v.state @@ -6387,7 +6389,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OptionalInt32); i { case 0: return &v.state @@ -6399,7 +6401,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OptionalUInt32); i { case 0: return &v.state @@ -6411,7 +6413,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OptionalInt64); i { case 0: return &v.state @@ -6423,7 +6425,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OptionalUInt64); i { case 0: return &v.state @@ -6435,7 +6437,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OptionalBool); i { case 0: return &v.state @@ -6447,7 +6449,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OptionalFileMode); i { case 0: return &v.state @@ -6459,7 +6461,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CompoundFieldOwners); i { case 0: return &v.state @@ -6471,7 +6473,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FieldOwners); i { case 0: return &v.state @@ -6483,7 +6485,7 @@ func file_pkg_api_api_proto_init() { return nil } } - file_pkg_api_api_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { + file_pkg_api_v1alpha1_api_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OwningPlugins); i { case 0: return &v.state @@ -6500,19 +6502,19 @@ func file_pkg_api_api_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_pkg_api_api_proto_rawDesc, + RawDescriptor: file_pkg_api_v1alpha1_api_proto_rawDesc, NumEnums: 6, NumMessages: 71, NumExtensions: 0, NumServices: 3, }, - GoTypes: file_pkg_api_api_proto_goTypes, - DependencyIndexes: file_pkg_api_api_proto_depIdxs, - EnumInfos: file_pkg_api_api_proto_enumTypes, - MessageInfos: file_pkg_api_api_proto_msgTypes, + GoTypes: file_pkg_api_v1alpha1_api_proto_goTypes, + DependencyIndexes: file_pkg_api_v1alpha1_api_proto_depIdxs, + EnumInfos: file_pkg_api_v1alpha1_api_proto_enumTypes, + MessageInfos: file_pkg_api_v1alpha1_api_proto_msgTypes, }.Build() - File_pkg_api_api_proto = out.File - file_pkg_api_api_proto_rawDesc = nil - file_pkg_api_api_proto_goTypes = nil - file_pkg_api_api_proto_depIdxs = nil + File_pkg_api_v1alpha1_api_proto = out.File + file_pkg_api_v1alpha1_api_proto_rawDesc = nil + file_pkg_api_v1alpha1_api_proto_goTypes = nil + file_pkg_api_v1alpha1_api_proto_depIdxs = nil } diff --git a/pkg/api/api.proto b/pkg/api/v1alpha1/api.proto similarity index 99% rename from pkg/api/api.proto rename to pkg/api/v1alpha1/api.proto index 211db7cc..d29724b1 100644 --- a/pkg/api/api.proto +++ b/pkg/api/v1alpha1/api.proto @@ -18,7 +18,7 @@ syntax = "proto3"; package nri.pkg.api.v1alpha1; -option go_package = "github.com/containerd/nri/pkg/api;api"; +option go_package = "github.com/containerd/nri/pkg/api/v1alpha1;v1alpha1"; // Runtime service is the public API runtimes expose for NRI plugins. // On this interface RPC requests are initiated by the plugin. This diff --git a/pkg/api/api_host.pb.go b/pkg/api/v1alpha1/api_host.pb.go similarity index 99% rename from pkg/api/api_host.pb.go rename to pkg/api/v1alpha1/api_host.pb.go index a2f901ea..688890d7 100644 --- a/pkg/api/api_host.pb.go +++ b/pkg/api/v1alpha1/api_host.pb.go @@ -19,9 +19,9 @@ // versions: // protoc-gen-go-plugin v0.1.0 // protoc v3.20.1 -// source: pkg/api/api.proto +// source: pkg/api/v1alpha1/api.proto -package api +package v1alpha1 import ( context "context" diff --git a/pkg/api/api_options.pb.go b/pkg/api/v1alpha1/api_options.pb.go similarity index 96% rename from pkg/api/api_options.pb.go rename to pkg/api/v1alpha1/api_options.pb.go index cb2507e3..f9f76061 100644 --- a/pkg/api/api_options.pb.go +++ b/pkg/api/v1alpha1/api_options.pb.go @@ -19,9 +19,9 @@ // versions: // protoc-gen-go-plugin v0.1.0 // protoc v3.20.1 -// source: pkg/api/api.proto +// source: pkg/api/v1alpha1/api.proto -package api +package v1alpha1 import ( context "context" diff --git a/pkg/api/api_plugin.pb.go b/pkg/api/v1alpha1/api_plugin.pb.go similarity index 99% rename from pkg/api/api_plugin.pb.go rename to pkg/api/v1alpha1/api_plugin.pb.go index ebc93eb3..d9d2f90d 100644 --- a/pkg/api/api_plugin.pb.go +++ b/pkg/api/v1alpha1/api_plugin.pb.go @@ -19,9 +19,9 @@ // versions: // protoc-gen-go-plugin v0.1.0 // protoc v3.20.1 -// source: pkg/api/api.proto +// source: pkg/api/v1alpha1/api.proto -package api +package v1alpha1 import ( context "context" diff --git a/pkg/api/api_service.pb.go b/pkg/api/v1alpha1/api_service.pb.go similarity index 98% rename from pkg/api/api_service.pb.go rename to pkg/api/v1alpha1/api_service.pb.go index df50eeb5..1c11423b 100644 --- a/pkg/api/api_service.pb.go +++ b/pkg/api/v1alpha1/api_service.pb.go @@ -17,9 +17,9 @@ // versions: // protoc-gen-go-plugin v0.1.0 // protoc v3.20.1 -// source: pkg/api/api.proto +// source: pkg/api/v1alpha1/api.proto -package api +package v1alpha1 import ( context "context" diff --git a/pkg/api/api_ttrpc.pb.go b/pkg/api/v1alpha1/api_ttrpc.pb.go similarity index 99% rename from pkg/api/api_ttrpc.pb.go rename to pkg/api/v1alpha1/api_ttrpc.pb.go index 94cb404b..0e91be30 100644 --- a/pkg/api/api_ttrpc.pb.go +++ b/pkg/api/v1alpha1/api_ttrpc.pb.go @@ -1,8 +1,8 @@ //go:build !wasip1 // Code generated by protoc-gen-go-ttrpc. DO NOT EDIT. -// source: pkg/api/api.proto -package api +// source: pkg/api/v1alpha1/api.proto +package v1alpha1 import ( context "context" diff --git a/pkg/api/api_vtproto.pb.go b/pkg/api/v1alpha1/api_vtproto.pb.go similarity index 99% rename from pkg/api/api_vtproto.pb.go rename to pkg/api/v1alpha1/api_vtproto.pb.go index 125f1a80..778c650f 100644 --- a/pkg/api/api_vtproto.pb.go +++ b/pkg/api/v1alpha1/api_vtproto.pb.go @@ -17,9 +17,9 @@ // versions: // protoc-gen-go-plugin v0.1.0 // protoc v3.20.1 -// source: pkg/api/api.proto +// source: pkg/api/v1alpha1/api.proto -package api +package v1alpha1 import ( fmt "fmt" diff --git a/pkg/api/container.go b/pkg/api/v1alpha1/container.go similarity index 98% rename from pkg/api/container.go rename to pkg/api/v1alpha1/container.go index 69e1248e..54767938 100644 --- a/pkg/api/container.go +++ b/pkg/api/v1alpha1/container.go @@ -14,7 +14,7 @@ limitations under the License. */ -package api +package v1alpha1 import "time" diff --git a/pkg/api/device.go b/pkg/api/v1alpha1/device.go similarity index 99% rename from pkg/api/device.go rename to pkg/api/v1alpha1/device.go index c7307b16..3fe07979 100644 --- a/pkg/api/device.go +++ b/pkg/api/v1alpha1/device.go @@ -14,7 +14,7 @@ limitations under the License. */ -package api +package v1alpha1 import ( rspec "github.com/opencontainers/runtime-spec/specs-go" diff --git a/pkg/api/v1alpha1/doc.go b/pkg/api/v1alpha1/doc.go new file mode 100644 index 00000000..cb4d2a02 --- /dev/null +++ b/pkg/api/v1alpha1/doc.go @@ -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 v1alpha1 diff --git a/pkg/api/env.go b/pkg/api/v1alpha1/env.go similarity index 98% rename from pkg/api/env.go rename to pkg/api/v1alpha1/env.go index 0f6e711d..3c643238 100644 --- a/pkg/api/env.go +++ b/pkg/api/v1alpha1/env.go @@ -14,7 +14,7 @@ limitations under the License. */ -package api +package v1alpha1 import ( "strings" diff --git a/pkg/api/event.go b/pkg/api/v1alpha1/event.go similarity index 99% rename from pkg/api/event.go rename to pkg/api/v1alpha1/event.go index 05720184..ff492b1d 100644 --- a/pkg/api/event.go +++ b/pkg/api/v1alpha1/event.go @@ -14,7 +14,7 @@ limitations under the License. */ -package api +package v1alpha1 import ( "fmt" diff --git a/pkg/api/helpers.go b/pkg/api/v1alpha1/helpers.go similarity index 99% rename from pkg/api/helpers.go rename to pkg/api/v1alpha1/helpers.go index 5b8a8337..98978693 100644 --- a/pkg/api/helpers.go +++ b/pkg/api/v1alpha1/helpers.go @@ -14,7 +14,7 @@ limitations under the License. */ -package api +package v1alpha1 // DupStringSlice creates a copy of a string slice. func DupStringSlice(in []string) []string { diff --git a/pkg/api/hooks.go b/pkg/api/v1alpha1/hooks.go similarity index 99% rename from pkg/api/hooks.go rename to pkg/api/v1alpha1/hooks.go index 47dd96ea..7201af04 100644 --- a/pkg/api/hooks.go +++ b/pkg/api/v1alpha1/hooks.go @@ -14,7 +14,7 @@ limitations under the License. */ -package api +package v1alpha1 import ( rspec "github.com/opencontainers/runtime-spec/specs-go" diff --git a/pkg/api/ioprio.go b/pkg/api/v1alpha1/ioprio.go similarity index 99% rename from pkg/api/ioprio.go rename to pkg/api/v1alpha1/ioprio.go index 04a1da39..b5b1f16a 100644 --- a/pkg/api/ioprio.go +++ b/pkg/api/v1alpha1/ioprio.go @@ -14,7 +14,7 @@ limitations under the License. */ -package api +package v1alpha1 import ( rspec "github.com/opencontainers/runtime-spec/specs-go" diff --git a/pkg/api/mount.go b/pkg/api/v1alpha1/mount.go similarity index 99% rename from pkg/api/mount.go rename to pkg/api/v1alpha1/mount.go index e35bf5b3..83d77f8f 100644 --- a/pkg/api/mount.go +++ b/pkg/api/v1alpha1/mount.go @@ -14,7 +14,7 @@ limitations under the License. */ -package api +package v1alpha1 import ( "sort" diff --git a/pkg/api/namespace.go b/pkg/api/v1alpha1/namespace.go similarity index 98% rename from pkg/api/namespace.go rename to pkg/api/v1alpha1/namespace.go index 659a07d9..ce9073b5 100644 --- a/pkg/api/namespace.go +++ b/pkg/api/v1alpha1/namespace.go @@ -14,7 +14,7 @@ limitations under the License. */ -package api +package v1alpha1 import ( rspec "github.com/opencontainers/runtime-spec/specs-go" diff --git a/pkg/api/optional.go b/pkg/api/v1alpha1/optional.go similarity index 99% rename from pkg/api/optional.go rename to pkg/api/v1alpha1/optional.go index c8020f45..8b2d210b 100644 --- a/pkg/api/optional.go +++ b/pkg/api/v1alpha1/optional.go @@ -14,7 +14,7 @@ limitations under the License. */ -package api +package v1alpha1 import ( "os" diff --git a/pkg/api/owners.go b/pkg/api/v1alpha1/owners.go similarity index 99% rename from pkg/api/owners.go rename to pkg/api/v1alpha1/owners.go index 63f2d9b1..4e2b1be6 100644 --- a/pkg/api/owners.go +++ b/pkg/api/v1alpha1/owners.go @@ -17,7 +17,7 @@ // TODO: Add comments to exported methods and functions. // //nolint:revive // exported symbols should have comments -package api +package v1alpha1 import ( "fmt" diff --git a/pkg/api/owners_test.go b/pkg/api/v1alpha1/owners_test.go similarity index 99% rename from pkg/api/owners_test.go rename to pkg/api/v1alpha1/owners_test.go index 939274af..009cfa26 100644 --- a/pkg/api/owners_test.go +++ b/pkg/api/v1alpha1/owners_test.go @@ -14,7 +14,7 @@ limitations under the License. */ -package api_test +package v1alpha1_test import ( "testing" diff --git a/pkg/api/plugin.go b/pkg/api/v1alpha1/plugin.go similarity index 99% rename from pkg/api/plugin.go rename to pkg/api/v1alpha1/plugin.go index 7eaf8920..855d53c8 100644 --- a/pkg/api/plugin.go +++ b/pkg/api/v1alpha1/plugin.go @@ -14,7 +14,7 @@ limitations under the License. */ -package api +package v1alpha1 import ( "fmt" diff --git a/pkg/api/resources.go b/pkg/api/v1alpha1/resources.go similarity index 99% rename from pkg/api/resources.go rename to pkg/api/v1alpha1/resources.go index d208bd97..166fc3b1 100644 --- a/pkg/api/resources.go +++ b/pkg/api/v1alpha1/resources.go @@ -16,7 +16,7 @@ limitations under the License. */ -package api +package v1alpha1 import ( rspec "github.com/opencontainers/runtime-spec/specs-go" diff --git a/pkg/api/seccomp.go b/pkg/api/v1alpha1/seccomp.go similarity index 99% rename from pkg/api/seccomp.go rename to pkg/api/v1alpha1/seccomp.go index 4db2dfcb..91338e67 100644 --- a/pkg/api/seccomp.go +++ b/pkg/api/v1alpha1/seccomp.go @@ -14,7 +14,7 @@ limitations under the License. */ -package api +package v1alpha1 import ( rspec "github.com/opencontainers/runtime-spec/specs-go" diff --git a/pkg/api/strip.go b/pkg/api/v1alpha1/strip.go similarity index 99% rename from pkg/api/strip.go rename to pkg/api/v1alpha1/strip.go index 116a4687..b3658a61 100644 --- a/pkg/api/strip.go +++ b/pkg/api/v1alpha1/strip.go @@ -14,7 +14,7 @@ limitations under the License. */ -package api +package v1alpha1 // // Notes: diff --git a/pkg/api/timeouts.go b/pkg/api/v1alpha1/timeouts.go similarity index 98% rename from pkg/api/timeouts.go rename to pkg/api/v1alpha1/timeouts.go index 3d056ae5..5e31dd43 100644 --- a/pkg/api/timeouts.go +++ b/pkg/api/v1alpha1/timeouts.go @@ -14,7 +14,7 @@ limitations under the License. */ -package api +package v1alpha1 import ( "time" diff --git a/pkg/api/update.go b/pkg/api/v1alpha1/update.go similarity index 99% rename from pkg/api/update.go rename to pkg/api/v1alpha1/update.go index 04ac3925..27eeb50f 100644 --- a/pkg/api/update.go +++ b/pkg/api/v1alpha1/update.go @@ -14,7 +14,7 @@ limitations under the License. */ -package api +package v1alpha1 //nolint // SetContainerId sets the id of the container to update. diff --git a/pkg/api/validate.go b/pkg/api/v1alpha1/validate.go similarity index 99% rename from pkg/api/validate.go rename to pkg/api/v1alpha1/validate.go index 6a702761..82c6d219 100644 --- a/pkg/api/validate.go +++ b/pkg/api/v1alpha1/validate.go @@ -14,7 +14,7 @@ limitations under the License. */ -package api +package v1alpha1 import ( "fmt" From ef2823060db92ee51bc92dc0413f742e7dc8de29 Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Wed, 17 Sep 2025 16:46:36 +0300 Subject: [PATCH 03/20] api: add v1beta1 wire protocol revision. Clone v1alpha1 as a starting point of v1beta1. Add dedicated RPC calls for requests we used to handle all in v1alpha1 with StateChange tagged with Event's to tell them apart. Remove now unused StateChange. Likewise, replace usage of Empty as a response type with dedicated per RPC call reponses. Remove now unused Empty. Update Shutdown to allow passing a string which describes the reason for the shutdown of the plugin. Signed-off-by: Krisztian Litkey --- pkg/api/v1beta1/adjustment.go | 381 + pkg/api/v1beta1/api.pb.go | 7808 ++++++++++++ pkg/api/v1beta1/api.proto | 767 ++ pkg/api/v1beta1/api_host.pb.go | 1337 ++ pkg/api/v1beta1/api_options.pb.go | 62 + pkg/api/v1beta1/api_plugin.pb.go | 480 + pkg/api/v1beta1/api_service.pb.go | 108 + pkg/api/v1beta1/api_ttrpc.pb.go | 390 + pkg/api/v1beta1/api_vtproto.pb.go | 18664 ++++++++++++++++++++++++++++ pkg/api/v1beta1/container.go | 46 + pkg/api/v1beta1/device.go | 89 + pkg/api/v1beta1/doc.go | 17 + pkg/api/v1beta1/env.go | 60 + pkg/api/v1beta1/event.go | 152 + pkg/api/v1beta1/helpers.go | 71 + pkg/api/v1beta1/hooks.go | 103 + pkg/api/v1beta1/ioprio.go | 63 + pkg/api/v1beta1/mount.go | 88 + pkg/api/v1beta1/namespace.go | 38 + pkg/api/v1beta1/optional.go | 341 + pkg/api/v1beta1/owners.go | 752 ++ pkg/api/v1beta1/owners_test.go | 115 + pkg/api/v1beta1/plugin.go | 59 + pkg/api/v1beta1/resources.go | 203 + pkg/api/v1beta1/seccomp.go | 124 + pkg/api/v1beta1/strip.go | 343 + pkg/api/v1beta1/timeouts.go | 28 + pkg/api/v1beta1/update.go | 199 + pkg/api/v1beta1/validate.go | 69 + 29 files changed, 32957 insertions(+) create mode 100644 pkg/api/v1beta1/adjustment.go create mode 100644 pkg/api/v1beta1/api.pb.go create mode 100644 pkg/api/v1beta1/api.proto create mode 100644 pkg/api/v1beta1/api_host.pb.go create mode 100644 pkg/api/v1beta1/api_options.pb.go create mode 100644 pkg/api/v1beta1/api_plugin.pb.go create mode 100644 pkg/api/v1beta1/api_service.pb.go create mode 100644 pkg/api/v1beta1/api_ttrpc.pb.go create mode 100644 pkg/api/v1beta1/api_vtproto.pb.go create mode 100644 pkg/api/v1beta1/container.go create mode 100644 pkg/api/v1beta1/device.go create mode 100644 pkg/api/v1beta1/doc.go create mode 100644 pkg/api/v1beta1/env.go create mode 100644 pkg/api/v1beta1/event.go create mode 100644 pkg/api/v1beta1/helpers.go create mode 100644 pkg/api/v1beta1/hooks.go create mode 100644 pkg/api/v1beta1/ioprio.go create mode 100644 pkg/api/v1beta1/mount.go create mode 100644 pkg/api/v1beta1/namespace.go create mode 100644 pkg/api/v1beta1/optional.go create mode 100644 pkg/api/v1beta1/owners.go create mode 100644 pkg/api/v1beta1/owners_test.go create mode 100644 pkg/api/v1beta1/plugin.go create mode 100644 pkg/api/v1beta1/resources.go create mode 100644 pkg/api/v1beta1/seccomp.go create mode 100644 pkg/api/v1beta1/strip.go create mode 100644 pkg/api/v1beta1/timeouts.go create mode 100644 pkg/api/v1beta1/update.go create mode 100644 pkg/api/v1beta1/validate.go diff --git a/pkg/api/v1beta1/adjustment.go b/pkg/api/v1beta1/adjustment.go new file mode 100644 index 00000000..03ad3880 --- /dev/null +++ b/pkg/api/v1beta1/adjustment.go @@ -0,0 +1,381 @@ +/* + 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 v1beta1 + +import "slices" + +// +// Notes: +// Adjustment of metadata that is stored in maps (labels and annotations) +// currently assumes that a single plugin will never do an add prior to a +// delete for any key. IOW, it is always assumed that if both a deletion +// and an addition/setting was recorded for a key then the final desired +// state is the addition. This seems like a reasonably safe assumption. A +// removal is usually done only to protect against triggering the conflict +// in the runtime when a plugin intends to touch a key which is known to +// have been put there or already modified by another plugin. +// +// An alternative without this implicit ordering assumption would be to +// store the adjustment for such data as a sequence of add/del operations +// in a slice. At the moment that does not seem to be necessary. +// + +// AddAnnotation records the addition of the annotation key=value. +func (a *ContainerAdjustment) AddAnnotation(key, value string) { + a.initAnnotations() + a.Annotations[key] = value +} + +// RemoveAnnotation records the removal of the annotation for the given key. +// Normally it is an error for a plugin to try and alter an annotation +// touched by another plugin. However, this is not an error if the plugin +// removes that annotation prior to touching it. +func (a *ContainerAdjustment) RemoveAnnotation(key string) { + a.initAnnotations() + a.Annotations[MarkForRemoval(key)] = "" +} + +// AddMount records the addition of a mount to a container. +func (a *ContainerAdjustment) AddMount(m *Mount) { + a.Mounts = append(a.Mounts, m) // TODO: should we dup m here ? +} + +// RemoveMount records the removal of a mount from a container. +// Normally it is an error for a plugin to try and alter a mount +// touched by another plugin. However, this is not an error if the +// plugin removes that mount prior to touching it. +func (a *ContainerAdjustment) RemoveMount(ContainerPath string) { + a.Mounts = append(a.Mounts, &Mount{ + Destination: MarkForRemoval(ContainerPath), + }) +} + +// AddEnv records the addition of an environment variable to a container. +func (a *ContainerAdjustment) AddEnv(key, value string) { + a.Env = append(a.Env, &KeyValue{ + Key: key, + Value: value, + }) +} + +// RemoveEnv records the removal of an environment variable from a container. +// Normally it is an error for a plugin to try and alter an environment +// variable touched by another container. However, this is not an error if +// the plugin removes that variable prior to touching it. +func (a *ContainerAdjustment) RemoveEnv(key string) { + a.Env = append(a.Env, &KeyValue{ + Key: MarkForRemoval(key), + }) +} + +// SetArgs overrides the container command with the given arguments. +func (a *ContainerAdjustment) SetArgs(args []string) { + a.Args = slices.Clone(args) +} + +// UpdateArgs overrides the container command with the given arguments. +// It won't fail if another plugin has already set the command line. +func (a *ContainerAdjustment) UpdateArgs(args []string) { + a.Args = append([]string{""}, args...) +} + +// AddHooks records the addition of the given hooks to a container. +func (a *ContainerAdjustment) AddHooks(h *Hooks) { + a.initHooks() + if h.Prestart != nil { + a.Hooks.Prestart = append(a.Hooks.Prestart, h.Prestart...) + } + if h.CreateRuntime != nil { + a.Hooks.CreateRuntime = append(a.Hooks.CreateRuntime, h.CreateRuntime...) + } + if h.CreateContainer != nil { + a.Hooks.CreateContainer = append(a.Hooks.CreateContainer, h.CreateContainer...) + } + if h.StartContainer != nil { + a.Hooks.StartContainer = append(a.Hooks.StartContainer, h.StartContainer...) + } + if h.Poststart != nil { + a.Hooks.Poststart = append(a.Hooks.Poststart, h.Poststart...) + } + if h.Poststop != nil { + a.Hooks.Poststop = append(a.Hooks.Poststop, h.Poststop...) + } +} + +// AddRlimit records the addition of rlimit (POSIX resource limits) to a container. +func (a *ContainerAdjustment) AddRlimit(typ string, hard, soft uint64) { + a.initRlimits() + a.Rlimits = append(a.Rlimits, &POSIXRlimit{ + Type: typ, + Hard: hard, + Soft: soft, + }) +} + +// AddDevice records the addition of the given device to a container. +func (a *ContainerAdjustment) AddDevice(d *LinuxDevice) { + a.initLinux() + a.Linux.Devices = append(a.Linux.Devices, d) // TODO: should we dup d here ? +} + +// RemoveDevice records the removal of a device from a container. +// Normally it is an error for a plugin to try and alter an device +// touched by another container. However, this is not an error if +// the plugin removes that device prior to touching it. +func (a *ContainerAdjustment) RemoveDevice(path string) { + a.initLinux() + a.Linux.Devices = append(a.Linux.Devices, &LinuxDevice{ + Path: MarkForRemoval(path), + }) +} + +// AddCDIDevice records the addition of the given CDI device to a container. +func (a *ContainerAdjustment) AddCDIDevice(d *CDIDevice) { + a.CDIDevices = append(a.CDIDevices, d) // TODO: should we dup d here ? +} + +// AddOrReplaceNamespace records the addition or replacement of the given namespace to a container. +func (a *ContainerAdjustment) AddOrReplaceNamespace(n *LinuxNamespace) { + a.initLinuxNamespaces() + a.Linux.Namespaces = append(a.Linux.Namespaces, n) // TODO: should we dup n here ? +} + +// RemoveNamespace records the removal of the given namespace from a container. +func (a *ContainerAdjustment) RemoveNamespace(n *LinuxNamespace) { + a.initLinuxNamespaces() + a.Linux.Namespaces = append(a.Linux.Namespaces, &LinuxNamespace{ + Type: MarkForRemoval(n.Type), + }) +} + +// SetLinuxMemoryLimit records setting the memory limit for a container. +func (a *ContainerAdjustment) SetLinuxMemoryLimit(value int64) { + a.initLinuxResourcesMemory() + a.Linux.Resources.Memory.Limit = Int64(value) +} + +// SetLinuxMemoryReservation records setting the memory reservation for a container. +func (a *ContainerAdjustment) SetLinuxMemoryReservation(value int64) { + a.initLinuxResourcesMemory() + a.Linux.Resources.Memory.Reservation = Int64(value) +} + +// SetLinuxMemorySwap records records setting the memory swap limit for a container. +func (a *ContainerAdjustment) SetLinuxMemorySwap(value int64) { + a.initLinuxResourcesMemory() + a.Linux.Resources.Memory.Swap = Int64(value) +} + +// SetLinuxMemoryKernel records setting the memory kernel limit for a container. +func (a *ContainerAdjustment) SetLinuxMemoryKernel(value int64) { + a.initLinuxResourcesMemory() + a.Linux.Resources.Memory.Kernel = Int64(value) +} + +// SetLinuxMemoryKernelTCP records setting the memory kernel TCP limit for a container. +func (a *ContainerAdjustment) SetLinuxMemoryKernelTCP(value int64) { + a.initLinuxResourcesMemory() + a.Linux.Resources.Memory.KernelTcp = Int64(value) +} + +// SetLinuxMemorySwappiness records setting the memory swappiness for a container. +func (a *ContainerAdjustment) SetLinuxMemorySwappiness(value uint64) { + a.initLinuxResourcesMemory() + a.Linux.Resources.Memory.Swappiness = UInt64(value) +} + +// SetLinuxMemoryDisableOomKiller records disabling the OOM killer for a container. +func (a *ContainerAdjustment) SetLinuxMemoryDisableOomKiller() { + a.initLinuxResourcesMemory() + a.Linux.Resources.Memory.DisableOomKiller = Bool(true) +} + +// SetLinuxMemoryUseHierarchy records enabling hierarchical memory accounting for a container. +func (a *ContainerAdjustment) SetLinuxMemoryUseHierarchy() { + a.initLinuxResourcesMemory() + a.Linux.Resources.Memory.UseHierarchy = Bool(true) +} + +// SetLinuxCPUShares records setting the scheduler's CPU shares for a container. +func (a *ContainerAdjustment) SetLinuxCPUShares(value uint64) { + a.initLinuxResourcesCPU() + a.Linux.Resources.Cpu.Shares = UInt64(value) +} + +// SetLinuxCPUQuota records setting the scheduler's CPU quota for a container. +func (a *ContainerAdjustment) SetLinuxCPUQuota(value int64) { + a.initLinuxResourcesCPU() + a.Linux.Resources.Cpu.Quota = Int64(value) +} + +// SetLinuxCPUPeriod records setting the scheduler's CPU period for a container. +func (a *ContainerAdjustment) SetLinuxCPUPeriod(value int64) { + a.initLinuxResourcesCPU() + a.Linux.Resources.Cpu.Period = UInt64(value) +} + +// SetLinuxCPURealtimeRuntime records setting the scheduler's realtime runtime for a container. +func (a *ContainerAdjustment) SetLinuxCPURealtimeRuntime(value int64) { + a.initLinuxResourcesCPU() + a.Linux.Resources.Cpu.RealtimeRuntime = Int64(value) +} + +// SetLinuxCPURealtimePeriod records setting the scheduler's realtime period for a container. +func (a *ContainerAdjustment) SetLinuxCPURealtimePeriod(value uint64) { + a.initLinuxResourcesCPU() + a.Linux.Resources.Cpu.RealtimePeriod = UInt64(value) +} + +// SetLinuxCPUSetCPUs records setting the cpuset CPUs for a container. +func (a *ContainerAdjustment) SetLinuxCPUSetCPUs(value string) { + a.initLinuxResourcesCPU() + a.Linux.Resources.Cpu.Cpus = value +} + +// SetLinuxCPUSetMems records setting the cpuset memory for a container. +func (a *ContainerAdjustment) SetLinuxCPUSetMems(value string) { + a.initLinuxResourcesCPU() + a.Linux.Resources.Cpu.Mems = value +} + +// SetLinuxPidLimits records setting the pid max number for a container. +func (a *ContainerAdjustment) SetLinuxPidLimits(value int64) { + a.initLinuxResourcesPids() + a.Linux.Resources.Pids.Limit = value +} + +// AddLinuxHugepageLimit records adding a hugepage limit for a container. +func (a *ContainerAdjustment) AddLinuxHugepageLimit(pageSize string, value uint64) { + a.initLinuxResources() + a.Linux.Resources.HugepageLimits = append(a.Linux.Resources.HugepageLimits, + &HugepageLimit{ + PageSize: pageSize, + Limit: value, + }) +} + +// SetLinuxBlockIOClass records setting the Block I/O class for a container. +func (a *ContainerAdjustment) SetLinuxBlockIOClass(value string) { + a.initLinuxResources() + a.Linux.Resources.BlockioClass = String(value) +} + +// SetLinuxRDTClass records setting the RDT class for a container. +func (a *ContainerAdjustment) SetLinuxRDTClass(value string) { + a.initLinuxResources() + a.Linux.Resources.RdtClass = String(value) +} + +// AddLinuxUnified sets a cgroupv2 unified resource. +func (a *ContainerAdjustment) AddLinuxUnified(key, value string) { + a.initLinuxResourcesUnified() + a.Linux.Resources.Unified[key] = value +} + +// SetLinuxCgroupsPath records setting the cgroups path for a container. +func (a *ContainerAdjustment) SetLinuxCgroupsPath(value string) { + a.initLinux() + a.Linux.CgroupsPath = value +} + +// SetLinuxOomScoreAdj records setting the kernel's Out-Of-Memory (OOM) killer score for a container. +func (a *ContainerAdjustment) SetLinuxOomScoreAdj(value *int) { + a.initLinux() + a.Linux.OomScoreAdj = Int(value) // using Int(value) from ./options.go to optionally allocate a pointer to normalized copy of value +} + +// SetLinuxIOPriority records setting the I/O priority for a container. +func (a *ContainerAdjustment) SetLinuxIOPriority(ioprio *LinuxIOPriority) { + a.initLinux() + a.Linux.IoPriority = ioprio +} + +// SetLinuxSeccompPolicy overrides the container seccomp policy with the given arguments. +func (a *ContainerAdjustment) SetLinuxSeccompPolicy(seccomp *LinuxSeccomp) { + a.initLinux() + a.Linux.SeccompPolicy = seccomp +} + +// +// Initializing a container adjustment and container update. +// + +func (a *ContainerAdjustment) initAnnotations() { + if a.Annotations == nil { + a.Annotations = make(map[string]string) + } +} + +func (a *ContainerAdjustment) initHooks() { + if a.Hooks == nil { + a.Hooks = &Hooks{} + } +} + +func (a *ContainerAdjustment) initRlimits() { + if a.Rlimits == nil { + a.Rlimits = []*POSIXRlimit{} + } +} + +func (a *ContainerAdjustment) initLinux() { + if a.Linux == nil { + a.Linux = &LinuxContainerAdjustment{} + } +} + +func (a *ContainerAdjustment) initLinuxNamespaces() { + a.initLinux() + if a.Linux.Namespaces == nil { + a.Linux.Namespaces = []*LinuxNamespace{} + } +} + +func (a *ContainerAdjustment) initLinuxResources() { + a.initLinux() + if a.Linux.Resources == nil { + a.Linux.Resources = &LinuxResources{} + } +} + +func (a *ContainerAdjustment) initLinuxResourcesMemory() { + a.initLinuxResources() + if a.Linux.Resources.Memory == nil { + a.Linux.Resources.Memory = &LinuxMemory{} + } +} + +func (a *ContainerAdjustment) initLinuxResourcesCPU() { + a.initLinuxResources() + if a.Linux.Resources.Cpu == nil { + a.Linux.Resources.Cpu = &LinuxCPU{} + } +} + +func (a *ContainerAdjustment) initLinuxResourcesPids() { + a.initLinuxResources() + if a.Linux.Resources.Pids == nil { + a.Linux.Resources.Pids = &LinuxPids{} + } +} + +func (a *ContainerAdjustment) initLinuxResourcesUnified() { + a.initLinuxResources() + if a.Linux.Resources.Unified == nil { + a.Linux.Resources.Unified = make(map[string]string) + } +} diff --git a/pkg/api/v1beta1/api.pb.go b/pkg/api/v1beta1/api.pb.go new file mode 100644 index 00000000..cc410925 --- /dev/null +++ b/pkg/api/v1beta1/api.pb.go @@ -0,0 +1,7808 @@ +// +//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. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.1 +// protoc v3.20.1 +// source: pkg/api/v1beta1/api.proto + +package v1beta1 + +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) +) + +// Events that plugins can subscribe to in ConfigureResponse. +type Event int32 + +const ( + Event_UNKNOWN Event = 0 + Event_RUN_POD_SANDBOX Event = 1 + Event_STOP_POD_SANDBOX Event = 2 + Event_REMOVE_POD_SANDBOX Event = 3 + Event_CREATE_CONTAINER Event = 4 + Event_POST_CREATE_CONTAINER Event = 5 + Event_START_CONTAINER Event = 6 + Event_POST_START_CONTAINER Event = 7 + Event_UPDATE_CONTAINER Event = 8 + Event_POST_UPDATE_CONTAINER Event = 9 + Event_STOP_CONTAINER Event = 10 + Event_REMOVE_CONTAINER Event = 11 + Event_UPDATE_POD_SANDBOX Event = 12 + Event_POST_UPDATE_POD_SANDBOX Event = 13 + Event_VALIDATE_CONTAINER_ADJUSTMENT Event = 14 + Event_LAST Event = 15 +) + +// Enum value maps for Event. +var ( + Event_name = map[int32]string{ + 0: "UNKNOWN", + 1: "RUN_POD_SANDBOX", + 2: "STOP_POD_SANDBOX", + 3: "REMOVE_POD_SANDBOX", + 4: "CREATE_CONTAINER", + 5: "POST_CREATE_CONTAINER", + 6: "START_CONTAINER", + 7: "POST_START_CONTAINER", + 8: "UPDATE_CONTAINER", + 9: "POST_UPDATE_CONTAINER", + 10: "STOP_CONTAINER", + 11: "REMOVE_CONTAINER", + 12: "UPDATE_POD_SANDBOX", + 13: "POST_UPDATE_POD_SANDBOX", + 14: "VALIDATE_CONTAINER_ADJUSTMENT", + 15: "LAST", + } + Event_value = map[string]int32{ + "UNKNOWN": 0, + "RUN_POD_SANDBOX": 1, + "STOP_POD_SANDBOX": 2, + "REMOVE_POD_SANDBOX": 3, + "CREATE_CONTAINER": 4, + "POST_CREATE_CONTAINER": 5, + "START_CONTAINER": 6, + "POST_START_CONTAINER": 7, + "UPDATE_CONTAINER": 8, + "POST_UPDATE_CONTAINER": 9, + "STOP_CONTAINER": 10, + "REMOVE_CONTAINER": 11, + "UPDATE_POD_SANDBOX": 12, + "POST_UPDATE_POD_SANDBOX": 13, + "VALIDATE_CONTAINER_ADJUSTMENT": 14, + "LAST": 15, + } +) + +func (x Event) Enum() *Event { + p := new(Event) + *p = x + return p +} + +func (x Event) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Event) Descriptor() protoreflect.EnumDescriptor { + return file_pkg_api_v1beta1_api_proto_enumTypes[0].Descriptor() +} + +func (Event) Type() protoreflect.EnumType { + return &file_pkg_api_v1beta1_api_proto_enumTypes[0] +} + +func (x Event) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Event.Descriptor instead. +func (Event) EnumDescriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{0} +} + +// Possible container states. +type ContainerState int32 + +const ( + ContainerState_CONTAINER_UNKNOWN ContainerState = 0 + ContainerState_CONTAINER_CREATED ContainerState = 1 + ContainerState_CONTAINER_PAUSED ContainerState = 2 // is this useful/necessary ? + ContainerState_CONTAINER_RUNNING ContainerState = 3 + ContainerState_CONTAINER_STOPPED ContainerState = 4 +) + +// Enum value maps for ContainerState. +var ( + ContainerState_name = map[int32]string{ + 0: "CONTAINER_UNKNOWN", + 1: "CONTAINER_CREATED", + 2: "CONTAINER_PAUSED", + 3: "CONTAINER_RUNNING", + 4: "CONTAINER_STOPPED", + } + ContainerState_value = map[string]int32{ + "CONTAINER_UNKNOWN": 0, + "CONTAINER_CREATED": 1, + "CONTAINER_PAUSED": 2, + "CONTAINER_RUNNING": 3, + "CONTAINER_STOPPED": 4, + } +) + +func (x ContainerState) Enum() *ContainerState { + p := new(ContainerState) + *p = x + return p +} + +func (x ContainerState) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ContainerState) Descriptor() protoreflect.EnumDescriptor { + return file_pkg_api_v1beta1_api_proto_enumTypes[1].Descriptor() +} + +func (ContainerState) Type() protoreflect.EnumType { + return &file_pkg_api_v1beta1_api_proto_enumTypes[1] +} + +func (x ContainerState) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ContainerState.Descriptor instead. +func (ContainerState) EnumDescriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{1} +} + +type IOPrioClass int32 + +const ( + IOPrioClass_IOPRIO_CLASS_NONE IOPrioClass = 0 + IOPrioClass_IOPRIO_CLASS_RT IOPrioClass = 1 + IOPrioClass_IOPRIO_CLASS_BE IOPrioClass = 2 + IOPrioClass_IOPRIO_CLASS_IDLE IOPrioClass = 3 +) + +// Enum value maps for IOPrioClass. +var ( + IOPrioClass_name = map[int32]string{ + 0: "IOPRIO_CLASS_NONE", + 1: "IOPRIO_CLASS_RT", + 2: "IOPRIO_CLASS_BE", + 3: "IOPRIO_CLASS_IDLE", + } + IOPrioClass_value = map[string]int32{ + "IOPRIO_CLASS_NONE": 0, + "IOPRIO_CLASS_RT": 1, + "IOPRIO_CLASS_BE": 2, + "IOPRIO_CLASS_IDLE": 3, + } +) + +func (x IOPrioClass) Enum() *IOPrioClass { + p := new(IOPrioClass) + *p = x + return p +} + +func (x IOPrioClass) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (IOPrioClass) Descriptor() protoreflect.EnumDescriptor { + return file_pkg_api_v1beta1_api_proto_enumTypes[2].Descriptor() +} + +func (IOPrioClass) Type() protoreflect.EnumType { + return &file_pkg_api_v1beta1_api_proto_enumTypes[2] +} + +func (x IOPrioClass) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use IOPrioClass.Descriptor instead. +func (IOPrioClass) EnumDescriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{2} +} + +// Field enumerates all fields that can be adjusted by plugins. +type Field int32 + +const ( + Field_None Field = 0 + Field_Annotations Field = 1 + Field_Mounts Field = 2 + Field_OciHooks Field = 3 + Field_Devices Field = 4 + Field_CdiDevices Field = 5 + Field_Env Field = 6 + Field_Args Field = 7 + Field_MemLimit Field = 8 + Field_MemReservation Field = 9 + Field_MemSwapLimit Field = 10 + Field_MemKernelLimit Field = 11 + Field_MemTCPLimit Field = 12 + Field_MemSwappiness Field = 13 + Field_MemDisableOomKiller Field = 14 + Field_MemUseHierarchy Field = 15 + Field_CPUShares Field = 16 + Field_CPUQuota Field = 17 + Field_CPUPeriod Field = 18 + Field_CPURealtimeRuntime Field = 19 + Field_CPURealtimePeriod Field = 20 + Field_CPUSetCPUs Field = 21 + Field_CPUSetMems Field = 22 + Field_PidsLimit Field = 23 + Field_HugepageLimits Field = 24 + Field_BlockioClass Field = 25 + Field_RdtClass Field = 26 + Field_CgroupsUnified Field = 27 + Field_CgroupsPath Field = 28 + Field_OomScoreAdj Field = 29 + Field_Rlimits Field = 30 + Field_IoPriority Field = 31 + Field_SeccompPolicy Field = 32 + Field_Namespace Field = 33 +) + +// Enum value maps for Field. +var ( + Field_name = map[int32]string{ + 0: "None", + 1: "Annotations", + 2: "Mounts", + 3: "OciHooks", + 4: "Devices", + 5: "CdiDevices", + 6: "Env", + 7: "Args", + 8: "MemLimit", + 9: "MemReservation", + 10: "MemSwapLimit", + 11: "MemKernelLimit", + 12: "MemTCPLimit", + 13: "MemSwappiness", + 14: "MemDisableOomKiller", + 15: "MemUseHierarchy", + 16: "CPUShares", + 17: "CPUQuota", + 18: "CPUPeriod", + 19: "CPURealtimeRuntime", + 20: "CPURealtimePeriod", + 21: "CPUSetCPUs", + 22: "CPUSetMems", + 23: "PidsLimit", + 24: "HugepageLimits", + 25: "BlockioClass", + 26: "RdtClass", + 27: "CgroupsUnified", + 28: "CgroupsPath", + 29: "OomScoreAdj", + 30: "Rlimits", + 31: "IoPriority", + 32: "SeccompPolicy", + 33: "Namespace", + } + Field_value = map[string]int32{ + "None": 0, + "Annotations": 1, + "Mounts": 2, + "OciHooks": 3, + "Devices": 4, + "CdiDevices": 5, + "Env": 6, + "Args": 7, + "MemLimit": 8, + "MemReservation": 9, + "MemSwapLimit": 10, + "MemKernelLimit": 11, + "MemTCPLimit": 12, + "MemSwappiness": 13, + "MemDisableOomKiller": 14, + "MemUseHierarchy": 15, + "CPUShares": 16, + "CPUQuota": 17, + "CPUPeriod": 18, + "CPURealtimeRuntime": 19, + "CPURealtimePeriod": 20, + "CPUSetCPUs": 21, + "CPUSetMems": 22, + "PidsLimit": 23, + "HugepageLimits": 24, + "BlockioClass": 25, + "RdtClass": 26, + "CgroupsUnified": 27, + "CgroupsPath": 28, + "OomScoreAdj": 29, + "Rlimits": 30, + "IoPriority": 31, + "SeccompPolicy": 32, + "Namespace": 33, + } +) + +func (x Field) Enum() *Field { + p := new(Field) + *p = x + return p +} + +func (x Field) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Field) Descriptor() protoreflect.EnumDescriptor { + return file_pkg_api_v1beta1_api_proto_enumTypes[3].Descriptor() +} + +func (Field) Type() protoreflect.EnumType { + return &file_pkg_api_v1beta1_api_proto_enumTypes[3] +} + +func (x Field) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Field.Descriptor instead. +func (Field) EnumDescriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{3} +} + +type LogRequest_Level int32 + +const ( + LogRequest_LEVEL_UNSPECIFIED LogRequest_Level = 0 + LogRequest_LEVEL_DEBUG LogRequest_Level = 1 + LogRequest_LEVEL_INFO LogRequest_Level = 2 + LogRequest_LEVEL_WARN LogRequest_Level = 3 + LogRequest_LEVEL_ERROR LogRequest_Level = 4 +) + +// Enum value maps for LogRequest_Level. +var ( + LogRequest_Level_name = map[int32]string{ + 0: "LEVEL_UNSPECIFIED", + 1: "LEVEL_DEBUG", + 2: "LEVEL_INFO", + 3: "LEVEL_WARN", + 4: "LEVEL_ERROR", + } + LogRequest_Level_value = map[string]int32{ + "LEVEL_UNSPECIFIED": 0, + "LEVEL_DEBUG": 1, + "LEVEL_INFO": 2, + "LEVEL_WARN": 3, + "LEVEL_ERROR": 4, + } +) + +func (x LogRequest_Level) Enum() *LogRequest_Level { + p := new(LogRequest_Level) + *p = x + return p +} + +func (x LogRequest_Level) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (LogRequest_Level) Descriptor() protoreflect.EnumDescriptor { + return file_pkg_api_v1beta1_api_proto_enumTypes[4].Descriptor() +} + +func (LogRequest_Level) Type() protoreflect.EnumType { + return &file_pkg_api_v1beta1_api_proto_enumTypes[4] +} + +func (x LogRequest_Level) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use LogRequest_Level.Descriptor instead. +func (LogRequest_Level) EnumDescriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{4, 0} +} + +type SecurityProfile_ProfileType int32 + +const ( + SecurityProfile_RUNTIME_DEFAULT SecurityProfile_ProfileType = 0 + SecurityProfile_UNCONFINED SecurityProfile_ProfileType = 1 + SecurityProfile_LOCALHOST SecurityProfile_ProfileType = 2 +) + +// Enum value maps for SecurityProfile_ProfileType. +var ( + SecurityProfile_ProfileType_name = map[int32]string{ + 0: "RUNTIME_DEFAULT", + 1: "UNCONFINED", + 2: "LOCALHOST", + } + SecurityProfile_ProfileType_value = map[string]int32{ + "RUNTIME_DEFAULT": 0, + "UNCONFINED": 1, + "LOCALHOST": 2, + } +) + +func (x SecurityProfile_ProfileType) Enum() *SecurityProfile_ProfileType { + p := new(SecurityProfile_ProfileType) + *p = x + return p +} + +func (x SecurityProfile_ProfileType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SecurityProfile_ProfileType) Descriptor() protoreflect.EnumDescriptor { + return file_pkg_api_v1beta1_api_proto_enumTypes[5].Descriptor() +} + +func (SecurityProfile_ProfileType) Type() protoreflect.EnumType { + return &file_pkg_api_v1beta1_api_proto_enumTypes[5] +} + +func (x SecurityProfile_ProfileType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SecurityProfile_ProfileType.Descriptor instead. +func (SecurityProfile_ProfileType) EnumDescriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{57, 0} +} + +type RegisterPluginRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Name of the plugin to register. + PluginName string `protobuf:"bytes,1,opt,name=plugin_name,json=pluginName,proto3" json:"plugin_name,omitempty"` + // Plugin invocation index. Plugins are called in ascending index order. + PluginIdx string `protobuf:"bytes,2,opt,name=plugin_idx,json=pluginIdx,proto3" json:"plugin_idx,omitempty"` +} + +func (x *RegisterPluginRequest) Reset() { + *x = RegisterPluginRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegisterPluginRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterPluginRequest) ProtoMessage() {} + +func (x *RegisterPluginRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_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 RegisterPluginRequest.ProtoReflect.Descriptor instead. +func (*RegisterPluginRequest) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{0} +} + +func (x *RegisterPluginRequest) GetPluginName() string { + if x != nil { + return x.PluginName + } + return "" +} + +func (x *RegisterPluginRequest) GetPluginIdx() string { + if x != nil { + return x.PluginIdx + } + return "" +} + +type RegisterPluginResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *RegisterPluginResponse) Reset() { + *x = RegisterPluginResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegisterPluginResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegisterPluginResponse) ProtoMessage() {} + +func (x *RegisterPluginResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_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 RegisterPluginResponse.ProtoReflect.Descriptor instead. +func (*RegisterPluginResponse) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{1} +} + +type UpdateContainersRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // List of containers to update. + Update []*ContainerUpdate `protobuf:"bytes,1,rep,name=update,proto3" json:"update,omitempty"` + // List of containers to evict. + Evict []*ContainerEviction `protobuf:"bytes,2,rep,name=evict,proto3" json:"evict,omitempty"` +} + +func (x *UpdateContainersRequest) Reset() { + *x = UpdateContainersRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateContainersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateContainersRequest) ProtoMessage() {} + +func (x *UpdateContainersRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_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 UpdateContainersRequest.ProtoReflect.Descriptor instead. +func (*UpdateContainersRequest) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{2} +} + +func (x *UpdateContainersRequest) GetUpdate() []*ContainerUpdate { + if x != nil { + return x.Update + } + return nil +} + +func (x *UpdateContainersRequest) GetEvict() []*ContainerEviction { + if x != nil { + return x.Evict + } + return nil +} + +type UpdateContainersResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Containers that the runtime failed to update. + Failed []*ContainerUpdate `protobuf:"bytes,1,rep,name=failed,proto3" json:"failed,omitempty"` +} + +func (x *UpdateContainersResponse) Reset() { + *x = UpdateContainersResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateContainersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateContainersResponse) ProtoMessage() {} + +func (x *UpdateContainersResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_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 UpdateContainersResponse.ProtoReflect.Descriptor instead. +func (*UpdateContainersResponse) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{3} +} + +func (x *UpdateContainersResponse) GetFailed() []*ContainerUpdate { + if x != nil { + return x.Failed + } + return nil +} + +type LogRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` + Level LogRequest_Level `protobuf:"varint,2,opt,name=level,proto3,enum=nri.pkg.api.v1beta1.LogRequest_Level" json:"level,omitempty"` +} + +func (x *LogRequest) Reset() { + *x = LogRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LogRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LogRequest) ProtoMessage() {} + +func (x *LogRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_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 LogRequest.ProtoReflect.Descriptor instead. +func (*LogRequest) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{4} +} + +func (x *LogRequest) GetMsg() string { + if x != nil { + return x.Msg + } + return "" +} + +func (x *LogRequest) GetLevel() LogRequest_Level { + if x != nil { + return x.Level + } + return LogRequest_LEVEL_UNSPECIFIED +} + +type LogResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *LogResponse) Reset() { + *x = LogResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LogResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LogResponse) ProtoMessage() {} + +func (x *LogResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_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 LogResponse.ProtoReflect.Descriptor instead. +func (*LogResponse) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{5} +} + +type ConfigureRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Any plugin-specific data, if present among the NRI configuration. + Config string `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` + // Name of the runtime NRI is running in. + RuntimeName string `protobuf:"bytes,2,opt,name=runtime_name,json=runtimeName,proto3" json:"runtime_name,omitempty"` + // Version of the runtime NRI is running in. + RuntimeVersion string `protobuf:"bytes,3,opt,name=runtime_version,json=runtimeVersion,proto3" json:"runtime_version,omitempty"` + // Configured registration timeout in milliseconds. + RegistrationTimeout int64 `protobuf:"varint,4,opt,name=registration_timeout,json=registrationTimeout,proto3" json:"registration_timeout,omitempty"` + // Configured request processing timeout in milliseconds. + RequestTimeout int64 `protobuf:"varint,5,opt,name=request_timeout,json=requestTimeout,proto3" json:"request_timeout,omitempty"` +} + +func (x *ConfigureRequest) Reset() { + *x = ConfigureRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfigureRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfigureRequest) ProtoMessage() {} + +func (x *ConfigureRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_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 ConfigureRequest.ProtoReflect.Descriptor instead. +func (*ConfigureRequest) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{6} +} + +func (x *ConfigureRequest) GetConfig() string { + if x != nil { + return x.Config + } + return "" +} + +func (x *ConfigureRequest) GetRuntimeName() string { + if x != nil { + return x.RuntimeName + } + return "" +} + +func (x *ConfigureRequest) GetRuntimeVersion() string { + if x != nil { + return x.RuntimeVersion + } + return "" +} + +func (x *ConfigureRequest) GetRegistrationTimeout() int64 { + if x != nil { + return x.RegistrationTimeout + } + return 0 +} + +func (x *ConfigureRequest) GetRequestTimeout() int64 { + if x != nil { + return x.RequestTimeout + } + return 0 +} + +type ConfigureResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Events to subscribe the plugin for. Each bit set corresponds to an + // enumerated Event. + Events int32 `protobuf:"varint,2,opt,name=events,proto3" json:"events,omitempty"` +} + +func (x *ConfigureResponse) Reset() { + *x = ConfigureResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfigureResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfigureResponse) ProtoMessage() {} + +func (x *ConfigureResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_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 ConfigureResponse.ProtoReflect.Descriptor instead. +func (*ConfigureResponse) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{7} +} + +func (x *ConfigureResponse) GetEvents() int32 { + if x != nil { + return x.Events + } + return 0 +} + +type SynchronizeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Pods known to the runtime. + Pods []*PodSandbox `protobuf:"bytes,1,rep,name=pods,proto3" json:"pods,omitempty"` + // Containers known to the runtime. + Containers []*Container `protobuf:"bytes,2,rep,name=containers,proto3" json:"containers,omitempty"` + // Whether there are more pods and containers to follow. + More bool `protobuf:"varint,3,opt,name=more,proto3" json:"more,omitempty"` +} + +func (x *SynchronizeRequest) Reset() { + *x = SynchronizeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SynchronizeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SynchronizeRequest) ProtoMessage() {} + +func (x *SynchronizeRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[8] + 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 SynchronizeRequest.ProtoReflect.Descriptor instead. +func (*SynchronizeRequest) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{8} +} + +func (x *SynchronizeRequest) GetPods() []*PodSandbox { + if x != nil { + return x.Pods + } + return nil +} + +func (x *SynchronizeRequest) GetContainers() []*Container { + if x != nil { + return x.Containers + } + return nil +} + +func (x *SynchronizeRequest) GetMore() bool { + if x != nil { + return x.More + } + return false +} + +type SynchronizeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Updates to containers requested by the plugin. + Update []*ContainerUpdate `protobuf:"bytes,1,rep,name=update,proto3" json:"update,omitempty"` + // Whether the client is able to handle more advertised pods and containers. + More bool `protobuf:"varint,2,opt,name=more,proto3" json:"more,omitempty"` +} + +func (x *SynchronizeResponse) Reset() { + *x = SynchronizeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SynchronizeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SynchronizeResponse) ProtoMessage() {} + +func (x *SynchronizeResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[9] + 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 SynchronizeResponse.ProtoReflect.Descriptor instead. +func (*SynchronizeResponse) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{9} +} + +func (x *SynchronizeResponse) GetUpdate() []*ContainerUpdate { + if x != nil { + return x.Update + } + return nil +} + +func (x *SynchronizeResponse) GetMore() bool { + if x != nil { + return x.More + } + return false +} + +type ShutdownRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Reason for the shutdown, if any. + Reason string `protobuf:"bytes,1,opt,name=reason,proto3" json:"reason,omitempty"` +} + +func (x *ShutdownRequest) Reset() { + *x = ShutdownRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShutdownRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShutdownRequest) ProtoMessage() {} + +func (x *ShutdownRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[10] + 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 ShutdownRequest.ProtoReflect.Descriptor instead. +func (*ShutdownRequest) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{10} +} + +func (x *ShutdownRequest) GetReason() string { + if x != nil { + return x.Reason + } + return "" +} + +type ShutdownResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ShutdownResponse) Reset() { + *x = ShutdownResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShutdownResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShutdownResponse) ProtoMessage() {} + +func (x *ShutdownResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[11] + 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 ShutdownResponse.ProtoReflect.Descriptor instead. +func (*ShutdownResponse) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{11} +} + +type RunPodSandboxRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Pod being started. + Pod *PodSandbox `protobuf:"bytes,1,opt,name=pod,proto3" json:"pod,omitempty"` +} + +func (x *RunPodSandboxRequest) Reset() { + *x = RunPodSandboxRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RunPodSandboxRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RunPodSandboxRequest) ProtoMessage() {} + +func (x *RunPodSandboxRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[12] + 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 RunPodSandboxRequest.ProtoReflect.Descriptor instead. +func (*RunPodSandboxRequest) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{12} +} + +func (x *RunPodSandboxRequest) GetPod() *PodSandbox { + if x != nil { + return x.Pod + } + return nil +} + +type RunPodSandboxResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *RunPodSandboxResponse) Reset() { + *x = RunPodSandboxResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RunPodSandboxResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RunPodSandboxResponse) ProtoMessage() {} + +func (x *RunPodSandboxResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[13] + 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 RunPodSandboxResponse.ProtoReflect.Descriptor instead. +func (*RunPodSandboxResponse) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{13} +} + +type UpdatePodSandboxRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Pod being updated. + Pod *PodSandbox `protobuf:"bytes,1,opt,name=pod,proto3" json:"pod,omitempty"` + // Overhead associated with this pod. + OverheadLinuxResources *LinuxResources `protobuf:"bytes,2,opt,name=overhead_linux_resources,json=overheadLinuxResources,proto3" json:"overhead_linux_resources,omitempty"` + // Sum of container resources for this pod. + LinuxResources *LinuxResources `protobuf:"bytes,3,opt,name=linux_resources,json=linuxResources,proto3" json:"linux_resources,omitempty"` +} + +func (x *UpdatePodSandboxRequest) Reset() { + *x = UpdatePodSandboxRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdatePodSandboxRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdatePodSandboxRequest) ProtoMessage() {} + +func (x *UpdatePodSandboxRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[14] + 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 UpdatePodSandboxRequest.ProtoReflect.Descriptor instead. +func (*UpdatePodSandboxRequest) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{14} +} + +func (x *UpdatePodSandboxRequest) GetPod() *PodSandbox { + if x != nil { + return x.Pod + } + return nil +} + +func (x *UpdatePodSandboxRequest) GetOverheadLinuxResources() *LinuxResources { + if x != nil { + return x.OverheadLinuxResources + } + return nil +} + +func (x *UpdatePodSandboxRequest) GetLinuxResources() *LinuxResources { + if x != nil { + return x.LinuxResources + } + return nil +} + +type UpdatePodSandboxResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UpdatePodSandboxResponse) Reset() { + *x = UpdatePodSandboxResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdatePodSandboxResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdatePodSandboxResponse) ProtoMessage() {} + +func (x *UpdatePodSandboxResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[15] + 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 UpdatePodSandboxResponse.ProtoReflect.Descriptor instead. +func (*UpdatePodSandboxResponse) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{15} +} + +type PostUpdatePodSandboxRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Pod updated. + Pod *PodSandbox `protobuf:"bytes,1,opt,name=pod,proto3" json:"pod,omitempty"` +} + +func (x *PostUpdatePodSandboxRequest) Reset() { + *x = PostUpdatePodSandboxRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PostUpdatePodSandboxRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PostUpdatePodSandboxRequest) ProtoMessage() {} + +func (x *PostUpdatePodSandboxRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[16] + 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 PostUpdatePodSandboxRequest.ProtoReflect.Descriptor instead. +func (*PostUpdatePodSandboxRequest) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{16} +} + +func (x *PostUpdatePodSandboxRequest) GetPod() *PodSandbox { + if x != nil { + return x.Pod + } + return nil +} + +type PostUpdatePodSandboxResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *PostUpdatePodSandboxResponse) Reset() { + *x = PostUpdatePodSandboxResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PostUpdatePodSandboxResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PostUpdatePodSandboxResponse) ProtoMessage() {} + +func (x *PostUpdatePodSandboxResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[17] + 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 PostUpdatePodSandboxResponse.ProtoReflect.Descriptor instead. +func (*PostUpdatePodSandboxResponse) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{17} +} + +type StopPodSandboxRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Pod being stopped. + Pod *PodSandbox `protobuf:"bytes,1,opt,name=pod,proto3" json:"pod,omitempty"` +} + +func (x *StopPodSandboxRequest) Reset() { + *x = StopPodSandboxRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StopPodSandboxRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StopPodSandboxRequest) ProtoMessage() {} + +func (x *StopPodSandboxRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[18] + 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 StopPodSandboxRequest.ProtoReflect.Descriptor instead. +func (*StopPodSandboxRequest) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{18} +} + +func (x *StopPodSandboxRequest) GetPod() *PodSandbox { + if x != nil { + return x.Pod + } + return nil +} + +type StopPodSandboxResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *StopPodSandboxResponse) Reset() { + *x = StopPodSandboxResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StopPodSandboxResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StopPodSandboxResponse) ProtoMessage() {} + +func (x *StopPodSandboxResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[19] + 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 StopPodSandboxResponse.ProtoReflect.Descriptor instead. +func (*StopPodSandboxResponse) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{19} +} + +type RemovePodSandboxRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Pod being removed. + Pod *PodSandbox `protobuf:"bytes,1,opt,name=pod,proto3" json:"pod,omitempty"` +} + +func (x *RemovePodSandboxRequest) Reset() { + *x = RemovePodSandboxRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemovePodSandboxRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemovePodSandboxRequest) ProtoMessage() {} + +func (x *RemovePodSandboxRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[20] + 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 RemovePodSandboxRequest.ProtoReflect.Descriptor instead. +func (*RemovePodSandboxRequest) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{20} +} + +func (x *RemovePodSandboxRequest) GetPod() *PodSandbox { + if x != nil { + return x.Pod + } + return nil +} + +type RemovePodSandboxResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *RemovePodSandboxResponse) Reset() { + *x = RemovePodSandboxResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemovePodSandboxResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemovePodSandboxResponse) ProtoMessage() {} + +func (x *RemovePodSandboxResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[21] + 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 RemovePodSandboxResponse.ProtoReflect.Descriptor instead. +func (*RemovePodSandboxResponse) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{21} +} + +type CreateContainerRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Pod of container being created. + Pod *PodSandbox `protobuf:"bytes,1,opt,name=pod,proto3" json:"pod,omitempty"` + // Container being created. + Container *Container `protobuf:"bytes,2,opt,name=container,proto3" json:"container,omitempty"` +} + +func (x *CreateContainerRequest) Reset() { + *x = CreateContainerRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateContainerRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateContainerRequest) ProtoMessage() {} + +func (x *CreateContainerRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[22] + 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 CreateContainerRequest.ProtoReflect.Descriptor instead. +func (*CreateContainerRequest) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{22} +} + +func (x *CreateContainerRequest) GetPod() *PodSandbox { + if x != nil { + return x.Pod + } + return nil +} + +func (x *CreateContainerRequest) GetContainer() *Container { + if x != nil { + return x.Container + } + return nil +} + +type CreateContainerResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Requested adjustments to container being created. + Adjust *ContainerAdjustment `protobuf:"bytes,1,opt,name=adjust,proto3" json:"adjust,omitempty"` + // Requested updates to other existing containers. + Update []*ContainerUpdate `protobuf:"bytes,2,rep,name=update,proto3" json:"update,omitempty"` + // Requested eviction of existing containers. + Evict []*ContainerEviction `protobuf:"bytes,3,rep,name=evict,proto3" json:"evict,omitempty"` +} + +func (x *CreateContainerResponse) Reset() { + *x = CreateContainerResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateContainerResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateContainerResponse) ProtoMessage() {} + +func (x *CreateContainerResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[23] + 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 CreateContainerResponse.ProtoReflect.Descriptor instead. +func (*CreateContainerResponse) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{23} +} + +func (x *CreateContainerResponse) GetAdjust() *ContainerAdjustment { + if x != nil { + return x.Adjust + } + return nil +} + +func (x *CreateContainerResponse) GetUpdate() []*ContainerUpdate { + if x != nil { + return x.Update + } + return nil +} + +func (x *CreateContainerResponse) GetEvict() []*ContainerEviction { + if x != nil { + return x.Evict + } + return nil +} + +type PostCreateContainerRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Pod of container created. + Pod *PodSandbox `protobuf:"bytes,1,opt,name=pod,proto3" json:"pod,omitempty"` + // Container created. + Container *Container `protobuf:"bytes,2,opt,name=container,proto3" json:"container,omitempty"` +} + +func (x *PostCreateContainerRequest) Reset() { + *x = PostCreateContainerRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PostCreateContainerRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PostCreateContainerRequest) ProtoMessage() {} + +func (x *PostCreateContainerRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[24] + 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 PostCreateContainerRequest.ProtoReflect.Descriptor instead. +func (*PostCreateContainerRequest) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{24} +} + +func (x *PostCreateContainerRequest) GetPod() *PodSandbox { + if x != nil { + return x.Pod + } + return nil +} + +func (x *PostCreateContainerRequest) GetContainer() *Container { + if x != nil { + return x.Container + } + return nil +} + +type PostCreateContainerResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *PostCreateContainerResponse) Reset() { + *x = PostCreateContainerResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PostCreateContainerResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PostCreateContainerResponse) ProtoMessage() {} + +func (x *PostCreateContainerResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[25] + 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 PostCreateContainerResponse.ProtoReflect.Descriptor instead. +func (*PostCreateContainerResponse) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{25} +} + +type StartContainerRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Pod of container being started. + Pod *PodSandbox `protobuf:"bytes,1,opt,name=pod,proto3" json:"pod,omitempty"` + // Container being started. + Container *Container `protobuf:"bytes,2,opt,name=container,proto3" json:"container,omitempty"` +} + +func (x *StartContainerRequest) Reset() { + *x = StartContainerRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StartContainerRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StartContainerRequest) ProtoMessage() {} + +func (x *StartContainerRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[26] + 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 StartContainerRequest.ProtoReflect.Descriptor instead. +func (*StartContainerRequest) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{26} +} + +func (x *StartContainerRequest) GetPod() *PodSandbox { + if x != nil { + return x.Pod + } + return nil +} + +func (x *StartContainerRequest) GetContainer() *Container { + if x != nil { + return x.Container + } + return nil +} + +type StartContainerResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *StartContainerResponse) Reset() { + *x = StartContainerResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StartContainerResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StartContainerResponse) ProtoMessage() {} + +func (x *StartContainerResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[27] + 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 StartContainerResponse.ProtoReflect.Descriptor instead. +func (*StartContainerResponse) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{27} +} + +type PostStartContainerRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Pod of container started. + Pod *PodSandbox `protobuf:"bytes,1,opt,name=pod,proto3" json:"pod,omitempty"` + // Container started. + Container *Container `protobuf:"bytes,2,opt,name=container,proto3" json:"container,omitempty"` +} + +func (x *PostStartContainerRequest) Reset() { + *x = PostStartContainerRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PostStartContainerRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PostStartContainerRequest) ProtoMessage() {} + +func (x *PostStartContainerRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[28] + 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 PostStartContainerRequest.ProtoReflect.Descriptor instead. +func (*PostStartContainerRequest) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{28} +} + +func (x *PostStartContainerRequest) GetPod() *PodSandbox { + if x != nil { + return x.Pod + } + return nil +} + +func (x *PostStartContainerRequest) GetContainer() *Container { + if x != nil { + return x.Container + } + return nil +} + +type PostStartContainerResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *PostStartContainerResponse) Reset() { + *x = PostStartContainerResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PostStartContainerResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PostStartContainerResponse) ProtoMessage() {} + +func (x *PostStartContainerResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[29] + 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 PostStartContainerResponse.ProtoReflect.Descriptor instead. +func (*PostStartContainerResponse) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{29} +} + +type UpdateContainerRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Pod of container being updated. + Pod *PodSandbox `protobuf:"bytes,1,opt,name=pod,proto3" json:"pod,omitempty"` + // Container being updated. + Container *Container `protobuf:"bytes,2,opt,name=container,proto3" json:"container,omitempty"` + // Resources to update. + LinuxResources *LinuxResources `protobuf:"bytes,3,opt,name=linux_resources,json=linuxResources,proto3" json:"linux_resources,omitempty"` +} + +func (x *UpdateContainerRequest) Reset() { + *x = UpdateContainerRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateContainerRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateContainerRequest) ProtoMessage() {} + +func (x *UpdateContainerRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[30] + 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 UpdateContainerRequest.ProtoReflect.Descriptor instead. +func (*UpdateContainerRequest) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{30} +} + +func (x *UpdateContainerRequest) GetPod() *PodSandbox { + if x != nil { + return x.Pod + } + return nil +} + +func (x *UpdateContainerRequest) GetContainer() *Container { + if x != nil { + return x.Container + } + return nil +} + +func (x *UpdateContainerRequest) GetLinuxResources() *LinuxResources { + if x != nil { + return x.LinuxResources + } + return nil +} + +type UpdateContainerResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Requested updates to containers. + Update []*ContainerUpdate `protobuf:"bytes,1,rep,name=update,proto3" json:"update,omitempty"` + // Requested eviction of containers. + Evict []*ContainerEviction `protobuf:"bytes,2,rep,name=evict,proto3" json:"evict,omitempty"` +} + +func (x *UpdateContainerResponse) Reset() { + *x = UpdateContainerResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateContainerResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateContainerResponse) ProtoMessage() {} + +func (x *UpdateContainerResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[31] + 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 UpdateContainerResponse.ProtoReflect.Descriptor instead. +func (*UpdateContainerResponse) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{31} +} + +func (x *UpdateContainerResponse) GetUpdate() []*ContainerUpdate { + if x != nil { + return x.Update + } + return nil +} + +func (x *UpdateContainerResponse) GetEvict() []*ContainerEviction { + if x != nil { + return x.Evict + } + return nil +} + +type PostUpdateContainerRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Pod of container updated. + Pod *PodSandbox `protobuf:"bytes,1,opt,name=pod,proto3" json:"pod,omitempty"` + // Container updated. + Container *Container `protobuf:"bytes,2,opt,name=container,proto3" json:"container,omitempty"` +} + +func (x *PostUpdateContainerRequest) Reset() { + *x = PostUpdateContainerRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PostUpdateContainerRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PostUpdateContainerRequest) ProtoMessage() {} + +func (x *PostUpdateContainerRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[32] + 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 PostUpdateContainerRequest.ProtoReflect.Descriptor instead. +func (*PostUpdateContainerRequest) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{32} +} + +func (x *PostUpdateContainerRequest) GetPod() *PodSandbox { + if x != nil { + return x.Pod + } + return nil +} + +func (x *PostUpdateContainerRequest) GetContainer() *Container { + if x != nil { + return x.Container + } + return nil +} + +type PostUpdateContainerResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *PostUpdateContainerResponse) Reset() { + *x = PostUpdateContainerResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PostUpdateContainerResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PostUpdateContainerResponse) ProtoMessage() {} + +func (x *PostUpdateContainerResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[33] + 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 PostUpdateContainerResponse.ProtoReflect.Descriptor instead. +func (*PostUpdateContainerResponse) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{33} +} + +type StopContainerRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Pod of container being stopped. + Pod *PodSandbox `protobuf:"bytes,1,opt,name=pod,proto3" json:"pod,omitempty"` + // Container being stopped. + Container *Container `protobuf:"bytes,2,opt,name=container,proto3" json:"container,omitempty"` +} + +func (x *StopContainerRequest) Reset() { + *x = StopContainerRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StopContainerRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StopContainerRequest) ProtoMessage() {} + +func (x *StopContainerRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[34] + 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 StopContainerRequest.ProtoReflect.Descriptor instead. +func (*StopContainerRequest) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{34} +} + +func (x *StopContainerRequest) GetPod() *PodSandbox { + if x != nil { + return x.Pod + } + return nil +} + +func (x *StopContainerRequest) GetContainer() *Container { + if x != nil { + return x.Container + } + return nil +} + +type StopContainerResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Requested updates to containers. + Update []*ContainerUpdate `protobuf:"bytes,1,rep,name=update,proto3" json:"update,omitempty"` +} + +func (x *StopContainerResponse) Reset() { + *x = StopContainerResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StopContainerResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StopContainerResponse) ProtoMessage() {} + +func (x *StopContainerResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[35] + 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 StopContainerResponse.ProtoReflect.Descriptor instead. +func (*StopContainerResponse) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{35} +} + +func (x *StopContainerResponse) GetUpdate() []*ContainerUpdate { + if x != nil { + return x.Update + } + return nil +} + +type RemoveContainerRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Pod of container removed. + Pod *PodSandbox `protobuf:"bytes,1,opt,name=pod,proto3" json:"pod,omitempty"` + // Container removed. + Container *Container `protobuf:"bytes,2,opt,name=container,proto3" json:"container,omitempty"` +} + +func (x *RemoveContainerRequest) Reset() { + *x = RemoveContainerRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveContainerRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveContainerRequest) ProtoMessage() {} + +func (x *RemoveContainerRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[36] + 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 RemoveContainerRequest.ProtoReflect.Descriptor instead. +func (*RemoveContainerRequest) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{36} +} + +func (x *RemoveContainerRequest) GetPod() *PodSandbox { + if x != nil { + return x.Pod + } + return nil +} + +func (x *RemoveContainerRequest) GetContainer() *Container { + if x != nil { + return x.Container + } + return nil +} + +type RemoveContainerResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *RemoveContainerResponse) Reset() { + *x = RemoveContainerResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveContainerResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveContainerResponse) ProtoMessage() {} + +func (x *RemoveContainerResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[37] + 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 RemoveContainerResponse.ProtoReflect.Descriptor instead. +func (*RemoveContainerResponse) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{37} +} + +type ValidateContainerAdjustmentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Pod of container being adjusted. + Pod *PodSandbox `protobuf:"bytes,1,opt,name=pod,proto3" json:"pod,omitempty"` + // Container being adjusted in its pristine state. + Container *Container `protobuf:"bytes,2,opt,name=container,proto3" json:"container,omitempty"` + // Pending container adjustments. + Adjust *ContainerAdjustment `protobuf:"bytes,3,opt,name=adjust,proto3" json:"adjust,omitempty"` + // Pending updates to other containers. + Update []*ContainerUpdate `protobuf:"bytes,4,rep,name=update,proto3" json:"update,omitempty"` + // Plugins that made the adjustments and updates. + Owners *OwningPlugins `protobuf:"bytes,5,opt,name=owners,proto3" json:"owners,omitempty"` + // Plugins consulted for adjustments and updates. + Plugins []*PluginInstance `protobuf:"bytes,6,rep,name=plugins,proto3" json:"plugins,omitempty"` +} + +func (x *ValidateContainerAdjustmentRequest) Reset() { + *x = ValidateContainerAdjustmentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidateContainerAdjustmentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateContainerAdjustmentRequest) ProtoMessage() {} + +func (x *ValidateContainerAdjustmentRequest) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[38] + 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 ValidateContainerAdjustmentRequest.ProtoReflect.Descriptor instead. +func (*ValidateContainerAdjustmentRequest) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{38} +} + +func (x *ValidateContainerAdjustmentRequest) GetPod() *PodSandbox { + if x != nil { + return x.Pod + } + return nil +} + +func (x *ValidateContainerAdjustmentRequest) GetContainer() *Container { + if x != nil { + return x.Container + } + return nil +} + +func (x *ValidateContainerAdjustmentRequest) GetAdjust() *ContainerAdjustment { + if x != nil { + return x.Adjust + } + return nil +} + +func (x *ValidateContainerAdjustmentRequest) GetUpdate() []*ContainerUpdate { + if x != nil { + return x.Update + } + return nil +} + +func (x *ValidateContainerAdjustmentRequest) GetOwners() *OwningPlugins { + if x != nil { + return x.Owners + } + return nil +} + +func (x *ValidateContainerAdjustmentRequest) GetPlugins() []*PluginInstance { + if x != nil { + return x.Plugins + } + return nil +} + +type PluginInstance struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Index string `protobuf:"bytes,2,opt,name=index,proto3" json:"index,omitempty"` +} + +func (x *PluginInstance) Reset() { + *x = PluginInstance{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PluginInstance) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PluginInstance) ProtoMessage() {} + +func (x *PluginInstance) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[39] + 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 PluginInstance.ProtoReflect.Descriptor instead. +func (*PluginInstance) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{39} +} + +func (x *PluginInstance) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *PluginInstance) GetIndex() string { + if x != nil { + return x.Index + } + return "" +} + +type ValidateContainerAdjustmentResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Reject bool `protobuf:"varint,1,opt,name=reject,proto3" json:"reject,omitempty"` + Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"` +} + +func (x *ValidateContainerAdjustmentResponse) Reset() { + *x = ValidateContainerAdjustmentResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidateContainerAdjustmentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidateContainerAdjustmentResponse) ProtoMessage() {} + +func (x *ValidateContainerAdjustmentResponse) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[40] + 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 ValidateContainerAdjustmentResponse.ProtoReflect.Descriptor instead. +func (*ValidateContainerAdjustmentResponse) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{40} +} + +func (x *ValidateContainerAdjustmentResponse) GetReject() bool { + if x != nil { + return x.Reject + } + return false +} + +func (x *ValidateContainerAdjustmentResponse) GetReason() string { + if x != nil { + return x.Reason + } + return "" +} + +// Pod metadata that is considered relevant for a plugin. +type PodSandbox struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Uid string `protobuf:"bytes,3,opt,name=uid,proto3" json:"uid,omitempty"` + Namespace string `protobuf:"bytes,4,opt,name=namespace,proto3" json:"namespace,omitempty"` + Labels map[string]string `protobuf:"bytes,5,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,6,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + RuntimeHandler string `protobuf:"bytes,7,opt,name=runtime_handler,json=runtimeHandler,proto3" json:"runtime_handler,omitempty"` + Linux *LinuxPodSandbox `protobuf:"bytes,8,opt,name=linux,proto3" json:"linux,omitempty"` + Pid uint32 `protobuf:"varint,9,opt,name=pid,proto3" json:"pid,omitempty"` // for NRI v1 emulation + Ips []string `protobuf:"bytes,10,rep,name=ips,proto3" json:"ips,omitempty"` +} + +func (x *PodSandbox) Reset() { + *x = PodSandbox{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PodSandbox) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PodSandbox) ProtoMessage() {} + +func (x *PodSandbox) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[41] + 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 PodSandbox.ProtoReflect.Descriptor instead. +func (*PodSandbox) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{41} +} + +func (x *PodSandbox) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *PodSandbox) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *PodSandbox) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +func (x *PodSandbox) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *PodSandbox) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +func (x *PodSandbox) GetAnnotations() map[string]string { + if x != nil { + return x.Annotations + } + return nil +} + +func (x *PodSandbox) GetRuntimeHandler() string { + if x != nil { + return x.RuntimeHandler + } + return "" +} + +func (x *PodSandbox) GetLinux() *LinuxPodSandbox { + if x != nil { + return x.Linux + } + return nil +} + +func (x *PodSandbox) GetPid() uint32 { + if x != nil { + return x.Pid + } + return 0 +} + +func (x *PodSandbox) GetIps() []string { + if x != nil { + return x.Ips + } + return nil +} + +// PodSandbox linux-specific metadata +type LinuxPodSandbox struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PodOverhead *LinuxResources `protobuf:"bytes,1,opt,name=pod_overhead,json=podOverhead,proto3" json:"pod_overhead,omitempty"` + PodResources *LinuxResources `protobuf:"bytes,2,opt,name=pod_resources,json=podResources,proto3" json:"pod_resources,omitempty"` + CgroupParent string `protobuf:"bytes,3,opt,name=cgroup_parent,json=cgroupParent,proto3" json:"cgroup_parent,omitempty"` + CgroupsPath string `protobuf:"bytes,4,opt,name=cgroups_path,json=cgroupsPath,proto3" json:"cgroups_path,omitempty"` // for NRI v1 emulation + Namespaces []*LinuxNamespace `protobuf:"bytes,5,rep,name=namespaces,proto3" json:"namespaces,omitempty"` // for NRI v1 emulation + Resources *LinuxResources `protobuf:"bytes,6,opt,name=resources,proto3" json:"resources,omitempty"` // for NRI v1 emulation +} + +func (x *LinuxPodSandbox) Reset() { + *x = LinuxPodSandbox{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinuxPodSandbox) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinuxPodSandbox) ProtoMessage() {} + +func (x *LinuxPodSandbox) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[42] + 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 LinuxPodSandbox.ProtoReflect.Descriptor instead. +func (*LinuxPodSandbox) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{42} +} + +func (x *LinuxPodSandbox) GetPodOverhead() *LinuxResources { + if x != nil { + return x.PodOverhead + } + return nil +} + +func (x *LinuxPodSandbox) GetPodResources() *LinuxResources { + if x != nil { + return x.PodResources + } + return nil +} + +func (x *LinuxPodSandbox) GetCgroupParent() string { + if x != nil { + return x.CgroupParent + } + return "" +} + +func (x *LinuxPodSandbox) GetCgroupsPath() string { + if x != nil { + return x.CgroupsPath + } + return "" +} + +func (x *LinuxPodSandbox) GetNamespaces() []*LinuxNamespace { + if x != nil { + return x.Namespaces + } + return nil +} + +func (x *LinuxPodSandbox) GetResources() *LinuxResources { + if x != nil { + return x.Resources + } + return nil +} + +// Container metadata that is considered relevant for a plugin. +type Container struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + PodSandboxId string `protobuf:"bytes,2,opt,name=pod_sandbox_id,json=podSandboxId,proto3" json:"pod_sandbox_id,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + State ContainerState `protobuf:"varint,4,opt,name=state,proto3,enum=nri.pkg.api.v1beta1.ContainerState" json:"state,omitempty"` + Labels map[string]string `protobuf:"bytes,5,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,6,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Args []string `protobuf:"bytes,7,rep,name=args,proto3" json:"args,omitempty"` + Env []string `protobuf:"bytes,8,rep,name=env,proto3" json:"env,omitempty"` + Mounts []*Mount `protobuf:"bytes,9,rep,name=mounts,proto3" json:"mounts,omitempty"` + Hooks *Hooks `protobuf:"bytes,10,opt,name=hooks,proto3" json:"hooks,omitempty"` + Linux *LinuxContainer `protobuf:"bytes,11,opt,name=linux,proto3" json:"linux,omitempty"` + Pid uint32 `protobuf:"varint,12,opt,name=pid,proto3" json:"pid,omitempty"` // for NRI v1 emulation + Rlimits []*POSIXRlimit `protobuf:"bytes,13,rep,name=rlimits,proto3" json:"rlimits,omitempty"` + CreatedAt int64 `protobuf:"varint,14,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + StartedAt int64 `protobuf:"varint,15,opt,name=started_at,json=startedAt,proto3" json:"started_at,omitempty"` + FinishedAt int64 `protobuf:"varint,16,opt,name=finished_at,json=finishedAt,proto3" json:"finished_at,omitempty"` + ExitCode int32 `protobuf:"varint,17,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"` + StatusReason string `protobuf:"bytes,18,opt,name=status_reason,json=statusReason,proto3" json:"status_reason,omitempty"` + StatusMessage string `protobuf:"bytes,19,opt,name=status_message,json=statusMessage,proto3" json:"status_message,omitempty"` + CDIDevices []*CDIDevice `protobuf:"bytes,20,rep,name=CDI_devices,json=CDIDevices,proto3" json:"CDI_devices,omitempty"` + User *User `protobuf:"bytes,21,opt,name=user,proto3" json:"user,omitempty"` +} + +func (x *Container) Reset() { + *x = Container{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Container) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Container) ProtoMessage() {} + +func (x *Container) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[43] + 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 Container.ProtoReflect.Descriptor instead. +func (*Container) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{43} +} + +func (x *Container) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Container) GetPodSandboxId() string { + if x != nil { + return x.PodSandboxId + } + return "" +} + +func (x *Container) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Container) GetState() ContainerState { + if x != nil { + return x.State + } + return ContainerState_CONTAINER_UNKNOWN +} + +func (x *Container) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +func (x *Container) GetAnnotations() map[string]string { + if x != nil { + return x.Annotations + } + return nil +} + +func (x *Container) GetArgs() []string { + if x != nil { + return x.Args + } + return nil +} + +func (x *Container) GetEnv() []string { + if x != nil { + return x.Env + } + return nil +} + +func (x *Container) GetMounts() []*Mount { + if x != nil { + return x.Mounts + } + return nil +} + +func (x *Container) GetHooks() *Hooks { + if x != nil { + return x.Hooks + } + return nil +} + +func (x *Container) GetLinux() *LinuxContainer { + if x != nil { + return x.Linux + } + return nil +} + +func (x *Container) GetPid() uint32 { + if x != nil { + return x.Pid + } + return 0 +} + +func (x *Container) GetRlimits() []*POSIXRlimit { + if x != nil { + return x.Rlimits + } + return nil +} + +func (x *Container) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *Container) GetStartedAt() int64 { + if x != nil { + return x.StartedAt + } + return 0 +} + +func (x *Container) GetFinishedAt() int64 { + if x != nil { + return x.FinishedAt + } + return 0 +} + +func (x *Container) GetExitCode() int32 { + if x != nil { + return x.ExitCode + } + return 0 +} + +func (x *Container) GetStatusReason() string { + if x != nil { + return x.StatusReason + } + return "" +} + +func (x *Container) GetStatusMessage() string { + if x != nil { + return x.StatusMessage + } + return "" +} + +func (x *Container) GetCDIDevices() []*CDIDevice { + if x != nil { + return x.CDIDevices + } + return nil +} + +func (x *Container) GetUser() *User { + if x != nil { + return x.User + } + return nil +} + +// A container mount. +type Mount struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Destination string `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"` + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Source string `protobuf:"bytes,3,opt,name=source,proto3" json:"source,omitempty"` + Options []string `protobuf:"bytes,4,rep,name=options,proto3" json:"options,omitempty"` +} + +func (x *Mount) Reset() { + *x = Mount{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Mount) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Mount) ProtoMessage() {} + +func (x *Mount) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[44] + 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 Mount.ProtoReflect.Descriptor instead. +func (*Mount) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{44} +} + +func (x *Mount) GetDestination() string { + if x != nil { + return x.Destination + } + return "" +} + +func (x *Mount) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Mount) GetSource() string { + if x != nil { + return x.Source + } + return "" +} + +func (x *Mount) GetOptions() []string { + if x != nil { + return x.Options + } + return nil +} + +// Container OCI hooks. +type Hooks struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Prestart []*Hook `protobuf:"bytes,1,rep,name=prestart,proto3" json:"prestart,omitempty"` + CreateRuntime []*Hook `protobuf:"bytes,2,rep,name=create_runtime,json=createRuntime,proto3" json:"create_runtime,omitempty"` + CreateContainer []*Hook `protobuf:"bytes,3,rep,name=create_container,json=createContainer,proto3" json:"create_container,omitempty"` + StartContainer []*Hook `protobuf:"bytes,4,rep,name=start_container,json=startContainer,proto3" json:"start_container,omitempty"` + Poststart []*Hook `protobuf:"bytes,5,rep,name=poststart,proto3" json:"poststart,omitempty"` + Poststop []*Hook `protobuf:"bytes,6,rep,name=poststop,proto3" json:"poststop,omitempty"` +} + +func (x *Hooks) Reset() { + *x = Hooks{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Hooks) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Hooks) ProtoMessage() {} + +func (x *Hooks) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[45] + 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 Hooks.ProtoReflect.Descriptor instead. +func (*Hooks) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{45} +} + +func (x *Hooks) GetPrestart() []*Hook { + if x != nil { + return x.Prestart + } + return nil +} + +func (x *Hooks) GetCreateRuntime() []*Hook { + if x != nil { + return x.CreateRuntime + } + return nil +} + +func (x *Hooks) GetCreateContainer() []*Hook { + if x != nil { + return x.CreateContainer + } + return nil +} + +func (x *Hooks) GetStartContainer() []*Hook { + if x != nil { + return x.StartContainer + } + return nil +} + +func (x *Hooks) GetPoststart() []*Hook { + if x != nil { + return x.Poststart + } + return nil +} + +func (x *Hooks) GetPoststop() []*Hook { + if x != nil { + return x.Poststop + } + return nil +} + +// One OCI hook. +type Hook struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + Args []string `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"` + Env []string `protobuf:"bytes,3,rep,name=env,proto3" json:"env,omitempty"` + Timeout *OptionalInt `protobuf:"bytes,4,opt,name=timeout,proto3" json:"timeout,omitempty"` +} + +func (x *Hook) Reset() { + *x = Hook{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[46] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Hook) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Hook) ProtoMessage() {} + +func (x *Hook) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[46] + 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 Hook.ProtoReflect.Descriptor instead. +func (*Hook) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{46} +} + +func (x *Hook) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *Hook) GetArgs() []string { + if x != nil { + return x.Args + } + return nil +} + +func (x *Hook) GetEnv() []string { + if x != nil { + return x.Env + } + return nil +} + +func (x *Hook) GetTimeout() *OptionalInt { + if x != nil { + return x.Timeout + } + return nil +} + +// Container (linux) metadata. +type LinuxContainer struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Namespaces []*LinuxNamespace `protobuf:"bytes,1,rep,name=namespaces,proto3" json:"namespaces,omitempty"` + Devices []*LinuxDevice `protobuf:"bytes,2,rep,name=devices,proto3" json:"devices,omitempty"` + Resources *LinuxResources `protobuf:"bytes,3,opt,name=resources,proto3" json:"resources,omitempty"` + OomScoreAdj *OptionalInt `protobuf:"bytes,4,opt,name=oom_score_adj,json=oomScoreAdj,proto3" json:"oom_score_adj,omitempty"` + CgroupsPath string `protobuf:"bytes,5,opt,name=cgroups_path,json=cgroupsPath,proto3" json:"cgroups_path,omitempty"` + IoPriority *LinuxIOPriority `protobuf:"bytes,6,opt,name=io_priority,json=ioPriority,proto3" json:"io_priority,omitempty"` + SeccompProfile *SecurityProfile `protobuf:"bytes,7,opt,name=seccomp_profile,json=seccompProfile,proto3" json:"seccomp_profile,omitempty"` + SeccompPolicy *LinuxSeccomp `protobuf:"bytes,8,opt,name=seccomp_policy,json=seccompPolicy,proto3" json:"seccomp_policy,omitempty"` +} + +func (x *LinuxContainer) Reset() { + *x = LinuxContainer{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[47] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinuxContainer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinuxContainer) ProtoMessage() {} + +func (x *LinuxContainer) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[47] + 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 LinuxContainer.ProtoReflect.Descriptor instead. +func (*LinuxContainer) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{47} +} + +func (x *LinuxContainer) GetNamespaces() []*LinuxNamespace { + if x != nil { + return x.Namespaces + } + return nil +} + +func (x *LinuxContainer) GetDevices() []*LinuxDevice { + if x != nil { + return x.Devices + } + return nil +} + +func (x *LinuxContainer) GetResources() *LinuxResources { + if x != nil { + return x.Resources + } + return nil +} + +func (x *LinuxContainer) GetOomScoreAdj() *OptionalInt { + if x != nil { + return x.OomScoreAdj + } + return nil +} + +func (x *LinuxContainer) GetCgroupsPath() string { + if x != nil { + return x.CgroupsPath + } + return "" +} + +func (x *LinuxContainer) GetIoPriority() *LinuxIOPriority { + if x != nil { + return x.IoPriority + } + return nil +} + +func (x *LinuxContainer) GetSeccompProfile() *SecurityProfile { + if x != nil { + return x.SeccompProfile + } + return nil +} + +func (x *LinuxContainer) GetSeccompPolicy() *LinuxSeccomp { + if x != nil { + return x.SeccompPolicy + } + return nil +} + +// A linux namespace. +type LinuxNamespace struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` +} + +func (x *LinuxNamespace) Reset() { + *x = LinuxNamespace{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[48] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinuxNamespace) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinuxNamespace) ProtoMessage() {} + +func (x *LinuxNamespace) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[48] + 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 LinuxNamespace.ProtoReflect.Descriptor instead. +func (*LinuxNamespace) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{48} +} + +func (x *LinuxNamespace) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *LinuxNamespace) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +// A container (linux) device. +type LinuxDevice struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Major int64 `protobuf:"varint,3,opt,name=major,proto3" json:"major,omitempty"` + Minor int64 `protobuf:"varint,4,opt,name=minor,proto3" json:"minor,omitempty"` + FileMode *OptionalFileMode `protobuf:"bytes,5,opt,name=file_mode,json=fileMode,proto3" json:"file_mode,omitempty"` + Uid *OptionalUInt32 `protobuf:"bytes,6,opt,name=uid,proto3" json:"uid,omitempty"` + Gid *OptionalUInt32 `protobuf:"bytes,7,opt,name=gid,proto3" json:"gid,omitempty"` +} + +func (x *LinuxDevice) Reset() { + *x = LinuxDevice{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[49] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinuxDevice) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinuxDevice) ProtoMessage() {} + +func (x *LinuxDevice) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[49] + 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 LinuxDevice.ProtoReflect.Descriptor instead. +func (*LinuxDevice) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{49} +} + +func (x *LinuxDevice) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *LinuxDevice) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *LinuxDevice) GetMajor() int64 { + if x != nil { + return x.Major + } + return 0 +} + +func (x *LinuxDevice) GetMinor() int64 { + if x != nil { + return x.Minor + } + return 0 +} + +func (x *LinuxDevice) GetFileMode() *OptionalFileMode { + if x != nil { + return x.FileMode + } + return nil +} + +func (x *LinuxDevice) GetUid() *OptionalUInt32 { + if x != nil { + return x.Uid + } + return nil +} + +func (x *LinuxDevice) GetGid() *OptionalUInt32 { + if x != nil { + return x.Gid + } + return nil +} + +// A linux device cgroup controller rule. +type LinuxDeviceCgroup struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Allow bool `protobuf:"varint,1,opt,name=allow,proto3" json:"allow,omitempty"` + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Major *OptionalInt64 `protobuf:"bytes,3,opt,name=major,proto3" json:"major,omitempty"` + Minor *OptionalInt64 `protobuf:"bytes,4,opt,name=minor,proto3" json:"minor,omitempty"` + Access string `protobuf:"bytes,5,opt,name=access,proto3" json:"access,omitempty"` +} + +func (x *LinuxDeviceCgroup) Reset() { + *x = LinuxDeviceCgroup{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[50] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinuxDeviceCgroup) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinuxDeviceCgroup) ProtoMessage() {} + +func (x *LinuxDeviceCgroup) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[50] + 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 LinuxDeviceCgroup.ProtoReflect.Descriptor instead. +func (*LinuxDeviceCgroup) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{50} +} + +func (x *LinuxDeviceCgroup) GetAllow() bool { + if x != nil { + return x.Allow + } + return false +} + +func (x *LinuxDeviceCgroup) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *LinuxDeviceCgroup) GetMajor() *OptionalInt64 { + if x != nil { + return x.Major + } + return nil +} + +func (x *LinuxDeviceCgroup) GetMinor() *OptionalInt64 { + if x != nil { + return x.Minor + } + return nil +} + +func (x *LinuxDeviceCgroup) GetAccess() string { + if x != nil { + return x.Access + } + return "" +} + +// A CDI device reference. +type CDIDevice struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *CDIDevice) Reset() { + *x = CDIDevice{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[51] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CDIDevice) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CDIDevice) ProtoMessage() {} + +func (x *CDIDevice) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[51] + 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 CDIDevice.ProtoReflect.Descriptor instead. +func (*CDIDevice) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{51} +} + +func (x *CDIDevice) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// User and group IDs for the container. +type User struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uid uint32 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` + Gid uint32 `protobuf:"varint,2,opt,name=gid,proto3" json:"gid,omitempty"` + AdditionalGids []uint32 `protobuf:"varint,3,rep,packed,name=additional_gids,json=additionalGids,proto3" json:"additional_gids,omitempty"` +} + +func (x *User) Reset() { + *x = User{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[52] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *User) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*User) ProtoMessage() {} + +func (x *User) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[52] + 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 User.ProtoReflect.Descriptor instead. +func (*User) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{52} +} + +func (x *User) GetUid() uint32 { + if x != nil { + return x.Uid + } + return 0 +} + +func (x *User) GetGid() uint32 { + if x != nil { + return x.Gid + } + return 0 +} + +func (x *User) GetAdditionalGids() []uint32 { + if x != nil { + return x.AdditionalGids + } + return nil +} + +// Container (linux) resources. +type LinuxResources struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Memory *LinuxMemory `protobuf:"bytes,1,opt,name=memory,proto3" json:"memory,omitempty"` + Cpu *LinuxCPU `protobuf:"bytes,2,opt,name=cpu,proto3" json:"cpu,omitempty"` + HugepageLimits []*HugepageLimit `protobuf:"bytes,3,rep,name=hugepage_limits,json=hugepageLimits,proto3" json:"hugepage_limits,omitempty"` + BlockioClass *OptionalString `protobuf:"bytes,4,opt,name=blockio_class,json=blockioClass,proto3" json:"blockio_class,omitempty"` + RdtClass *OptionalString `protobuf:"bytes,5,opt,name=rdt_class,json=rdtClass,proto3" json:"rdt_class,omitempty"` + Unified map[string]string `protobuf:"bytes,6,rep,name=unified,proto3" json:"unified,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Devices []*LinuxDeviceCgroup `protobuf:"bytes,7,rep,name=devices,proto3" json:"devices,omitempty"` // for NRI v1 emulation + Pids *LinuxPids `protobuf:"bytes,8,opt,name=pids,proto3" json:"pids,omitempty"` +} + +func (x *LinuxResources) Reset() { + *x = LinuxResources{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[53] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinuxResources) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinuxResources) ProtoMessage() {} + +func (x *LinuxResources) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[53] + 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 LinuxResources.ProtoReflect.Descriptor instead. +func (*LinuxResources) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{53} +} + +func (x *LinuxResources) GetMemory() *LinuxMemory { + if x != nil { + return x.Memory + } + return nil +} + +func (x *LinuxResources) GetCpu() *LinuxCPU { + if x != nil { + return x.Cpu + } + return nil +} + +func (x *LinuxResources) GetHugepageLimits() []*HugepageLimit { + if x != nil { + return x.HugepageLimits + } + return nil +} + +func (x *LinuxResources) GetBlockioClass() *OptionalString { + if x != nil { + return x.BlockioClass + } + return nil +} + +func (x *LinuxResources) GetRdtClass() *OptionalString { + if x != nil { + return x.RdtClass + } + return nil +} + +func (x *LinuxResources) GetUnified() map[string]string { + if x != nil { + return x.Unified + } + return nil +} + +func (x *LinuxResources) GetDevices() []*LinuxDeviceCgroup { + if x != nil { + return x.Devices + } + return nil +} + +func (x *LinuxResources) GetPids() *LinuxPids { + if x != nil { + return x.Pids + } + return nil +} + +// Memory-related parts of (linux) resources. +type LinuxMemory struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Limit *OptionalInt64 `protobuf:"bytes,1,opt,name=limit,proto3" json:"limit,omitempty"` + Reservation *OptionalInt64 `protobuf:"bytes,2,opt,name=reservation,proto3" json:"reservation,omitempty"` + Swap *OptionalInt64 `protobuf:"bytes,3,opt,name=swap,proto3" json:"swap,omitempty"` + Kernel *OptionalInt64 `protobuf:"bytes,4,opt,name=kernel,proto3" json:"kernel,omitempty"` + KernelTcp *OptionalInt64 `protobuf:"bytes,5,opt,name=kernel_tcp,json=kernelTcp,proto3" json:"kernel_tcp,omitempty"` + Swappiness *OptionalUInt64 `protobuf:"bytes,6,opt,name=swappiness,proto3" json:"swappiness,omitempty"` + DisableOomKiller *OptionalBool `protobuf:"bytes,7,opt,name=disable_oom_killer,json=disableOomKiller,proto3" json:"disable_oom_killer,omitempty"` + UseHierarchy *OptionalBool `protobuf:"bytes,8,opt,name=use_hierarchy,json=useHierarchy,proto3" json:"use_hierarchy,omitempty"` +} + +func (x *LinuxMemory) Reset() { + *x = LinuxMemory{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[54] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinuxMemory) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinuxMemory) ProtoMessage() {} + +func (x *LinuxMemory) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[54] + 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 LinuxMemory.ProtoReflect.Descriptor instead. +func (*LinuxMemory) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{54} +} + +func (x *LinuxMemory) GetLimit() *OptionalInt64 { + if x != nil { + return x.Limit + } + return nil +} + +func (x *LinuxMemory) GetReservation() *OptionalInt64 { + if x != nil { + return x.Reservation + } + return nil +} + +func (x *LinuxMemory) GetSwap() *OptionalInt64 { + if x != nil { + return x.Swap + } + return nil +} + +func (x *LinuxMemory) GetKernel() *OptionalInt64 { + if x != nil { + return x.Kernel + } + return nil +} + +func (x *LinuxMemory) GetKernelTcp() *OptionalInt64 { + if x != nil { + return x.KernelTcp + } + return nil +} + +func (x *LinuxMemory) GetSwappiness() *OptionalUInt64 { + if x != nil { + return x.Swappiness + } + return nil +} + +func (x *LinuxMemory) GetDisableOomKiller() *OptionalBool { + if x != nil { + return x.DisableOomKiller + } + return nil +} + +func (x *LinuxMemory) GetUseHierarchy() *OptionalBool { + if x != nil { + return x.UseHierarchy + } + return nil +} + +// CPU-related parts of (linux) resources. +type LinuxCPU struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Shares *OptionalUInt64 `protobuf:"bytes,1,opt,name=shares,proto3" json:"shares,omitempty"` + Quota *OptionalInt64 `protobuf:"bytes,2,opt,name=quota,proto3" json:"quota,omitempty"` + Period *OptionalUInt64 `protobuf:"bytes,3,opt,name=period,proto3" json:"period,omitempty"` + RealtimeRuntime *OptionalInt64 `protobuf:"bytes,4,opt,name=realtime_runtime,json=realtimeRuntime,proto3" json:"realtime_runtime,omitempty"` + RealtimePeriod *OptionalUInt64 `protobuf:"bytes,5,opt,name=realtime_period,json=realtimePeriod,proto3" json:"realtime_period,omitempty"` + Cpus string `protobuf:"bytes,6,opt,name=cpus,proto3" json:"cpus,omitempty"` + Mems string `protobuf:"bytes,7,opt,name=mems,proto3" json:"mems,omitempty"` +} + +func (x *LinuxCPU) Reset() { + *x = LinuxCPU{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[55] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinuxCPU) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinuxCPU) ProtoMessage() {} + +func (x *LinuxCPU) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[55] + 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 LinuxCPU.ProtoReflect.Descriptor instead. +func (*LinuxCPU) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{55} +} + +func (x *LinuxCPU) GetShares() *OptionalUInt64 { + if x != nil { + return x.Shares + } + return nil +} + +func (x *LinuxCPU) GetQuota() *OptionalInt64 { + if x != nil { + return x.Quota + } + return nil +} + +func (x *LinuxCPU) GetPeriod() *OptionalUInt64 { + if x != nil { + return x.Period + } + return nil +} + +func (x *LinuxCPU) GetRealtimeRuntime() *OptionalInt64 { + if x != nil { + return x.RealtimeRuntime + } + return nil +} + +func (x *LinuxCPU) GetRealtimePeriod() *OptionalUInt64 { + if x != nil { + return x.RealtimePeriod + } + return nil +} + +func (x *LinuxCPU) GetCpus() string { + if x != nil { + return x.Cpus + } + return "" +} + +func (x *LinuxCPU) GetMems() string { + if x != nil { + return x.Mems + } + return "" +} + +// Container huge page limit. +type HugepageLimit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PageSize string `protobuf:"bytes,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + Limit uint64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` +} + +func (x *HugepageLimit) Reset() { + *x = HugepageLimit{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[56] + 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_pkg_api_v1beta1_api_proto_msgTypes[56] + 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_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{56} +} + +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 +} + +// SecurityProfile for container. +type SecurityProfile struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProfileType SecurityProfile_ProfileType `protobuf:"varint,1,opt,name=profile_type,json=profileType,proto3,enum=nri.pkg.api.v1beta1.SecurityProfile_ProfileType" json:"profile_type,omitempty"` + LocalhostRef string `protobuf:"bytes,2,opt,name=localhost_ref,json=localhostRef,proto3" json:"localhost_ref,omitempty"` +} + +func (x *SecurityProfile) Reset() { + *x = SecurityProfile{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[57] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SecurityProfile) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SecurityProfile) ProtoMessage() {} + +func (x *SecurityProfile) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[57] + 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 SecurityProfile.ProtoReflect.Descriptor instead. +func (*SecurityProfile) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{57} +} + +func (x *SecurityProfile) GetProfileType() SecurityProfile_ProfileType { + if x != nil { + return x.ProfileType + } + return SecurityProfile_RUNTIME_DEFAULT +} + +func (x *SecurityProfile) GetLocalhostRef() string { + if x != nil { + return x.LocalhostRef + } + return "" +} + +// Container rlimits +type POSIXRlimit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Hard uint64 `protobuf:"varint,2,opt,name=hard,proto3" json:"hard,omitempty"` + Soft uint64 `protobuf:"varint,3,opt,name=soft,proto3" json:"soft,omitempty"` +} + +func (x *POSIXRlimit) Reset() { + *x = POSIXRlimit{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[58] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *POSIXRlimit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*POSIXRlimit) ProtoMessage() {} + +func (x *POSIXRlimit) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[58] + 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 POSIXRlimit.ProtoReflect.Descriptor instead. +func (*POSIXRlimit) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{58} +} + +func (x *POSIXRlimit) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *POSIXRlimit) GetHard() uint64 { + if x != nil { + return x.Hard + } + return 0 +} + +func (x *POSIXRlimit) GetSoft() uint64 { + if x != nil { + return x.Soft + } + return 0 +} + +// Pids-related parts of (linux) resources. +type LinuxPids struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Limit int64 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"` +} + +func (x *LinuxPids) Reset() { + *x = LinuxPids{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[59] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinuxPids) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinuxPids) ProtoMessage() {} + +func (x *LinuxPids) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[59] + 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 LinuxPids.ProtoReflect.Descriptor instead. +func (*LinuxPids) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{59} +} + +func (x *LinuxPids) GetLimit() int64 { + if x != nil { + return x.Limit + } + return 0 +} + +type LinuxIOPriority struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Scheduling class of the IO priority. + Class IOPrioClass `protobuf:"varint,1,opt,name=class,proto3,enum=nri.pkg.api.v1beta1.IOPrioClass" json:"class,omitempty"` + // The value of the IO priority. + Priority int32 `protobuf:"varint,2,opt,name=priority,proto3" json:"priority,omitempty"` +} + +func (x *LinuxIOPriority) Reset() { + *x = LinuxIOPriority{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[60] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinuxIOPriority) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinuxIOPriority) ProtoMessage() {} + +func (x *LinuxIOPriority) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[60] + 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 LinuxIOPriority.ProtoReflect.Descriptor instead. +func (*LinuxIOPriority) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{60} +} + +func (x *LinuxIOPriority) GetClass() IOPrioClass { + if x != nil { + return x.Class + } + return IOPrioClass_IOPRIO_CLASS_NONE +} + +func (x *LinuxIOPriority) GetPriority() int32 { + if x != nil { + return x.Priority + } + return 0 +} + +// Requested adjustments to a container being created. +type ContainerAdjustment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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"` + Mounts []*Mount `protobuf:"bytes,3,rep,name=mounts,proto3" json:"mounts,omitempty"` + Env []*KeyValue `protobuf:"bytes,4,rep,name=env,proto3" json:"env,omitempty"` + Hooks *Hooks `protobuf:"bytes,5,opt,name=hooks,proto3" json:"hooks,omitempty"` + Linux *LinuxContainerAdjustment `protobuf:"bytes,6,opt,name=linux,proto3" json:"linux,omitempty"` + Rlimits []*POSIXRlimit `protobuf:"bytes,7,rep,name=rlimits,proto3" json:"rlimits,omitempty"` + CDIDevices []*CDIDevice `protobuf:"bytes,8,rep,name=CDI_devices,json=CDIDevices,proto3" json:"CDI_devices,omitempty"` + Args []string `protobuf:"bytes,9,rep,name=args,proto3" json:"args,omitempty"` +} + +func (x *ContainerAdjustment) Reset() { + *x = ContainerAdjustment{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[61] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ContainerAdjustment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContainerAdjustment) ProtoMessage() {} + +func (x *ContainerAdjustment) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[61] + 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 ContainerAdjustment.ProtoReflect.Descriptor instead. +func (*ContainerAdjustment) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{61} +} + +func (x *ContainerAdjustment) GetAnnotations() map[string]string { + if x != nil { + return x.Annotations + } + return nil +} + +func (x *ContainerAdjustment) GetMounts() []*Mount { + if x != nil { + return x.Mounts + } + return nil +} + +func (x *ContainerAdjustment) GetEnv() []*KeyValue { + if x != nil { + return x.Env + } + return nil +} + +func (x *ContainerAdjustment) GetHooks() *Hooks { + if x != nil { + return x.Hooks + } + return nil +} + +func (x *ContainerAdjustment) GetLinux() *LinuxContainerAdjustment { + if x != nil { + return x.Linux + } + return nil +} + +func (x *ContainerAdjustment) GetRlimits() []*POSIXRlimit { + if x != nil { + return x.Rlimits + } + return nil +} + +func (x *ContainerAdjustment) GetCDIDevices() []*CDIDevice { + if x != nil { + return x.CDIDevices + } + return nil +} + +func (x *ContainerAdjustment) GetArgs() []string { + if x != nil { + return x.Args + } + return nil +} + +// Adjustments to (linux) resources. +type LinuxContainerAdjustment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Devices []*LinuxDevice `protobuf:"bytes,1,rep,name=devices,proto3" json:"devices,omitempty"` + Resources *LinuxResources `protobuf:"bytes,2,opt,name=resources,proto3" json:"resources,omitempty"` + CgroupsPath string `protobuf:"bytes,3,opt,name=cgroups_path,json=cgroupsPath,proto3" json:"cgroups_path,omitempty"` + OomScoreAdj *OptionalInt `protobuf:"bytes,4,opt,name=oom_score_adj,json=oomScoreAdj,proto3" json:"oom_score_adj,omitempty"` + IoPriority *LinuxIOPriority `protobuf:"bytes,5,opt,name=io_priority,json=ioPriority,proto3" json:"io_priority,omitempty"` + SeccompPolicy *LinuxSeccomp `protobuf:"bytes,6,opt,name=seccomp_policy,json=seccompPolicy,proto3" json:"seccomp_policy,omitempty"` + Namespaces []*LinuxNamespace `protobuf:"bytes,7,rep,name=namespaces,proto3" json:"namespaces,omitempty"` +} + +func (x *LinuxContainerAdjustment) Reset() { + *x = LinuxContainerAdjustment{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[62] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinuxContainerAdjustment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinuxContainerAdjustment) ProtoMessage() {} + +func (x *LinuxContainerAdjustment) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[62] + 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 LinuxContainerAdjustment.ProtoReflect.Descriptor instead. +func (*LinuxContainerAdjustment) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{62} +} + +func (x *LinuxContainerAdjustment) GetDevices() []*LinuxDevice { + if x != nil { + return x.Devices + } + return nil +} + +func (x *LinuxContainerAdjustment) GetResources() *LinuxResources { + if x != nil { + return x.Resources + } + return nil +} + +func (x *LinuxContainerAdjustment) GetCgroupsPath() string { + if x != nil { + return x.CgroupsPath + } + return "" +} + +func (x *LinuxContainerAdjustment) GetOomScoreAdj() *OptionalInt { + if x != nil { + return x.OomScoreAdj + } + return nil +} + +func (x *LinuxContainerAdjustment) GetIoPriority() *LinuxIOPriority { + if x != nil { + return x.IoPriority + } + return nil +} + +func (x *LinuxContainerAdjustment) GetSeccompPolicy() *LinuxSeccomp { + if x != nil { + return x.SeccompPolicy + } + return nil +} + +func (x *LinuxContainerAdjustment) GetNamespaces() []*LinuxNamespace { + if x != nil { + return x.Namespaces + } + return nil +} + +type LinuxSeccomp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DefaultAction string `protobuf:"bytes,1,opt,name=default_action,json=defaultAction,proto3" json:"default_action,omitempty"` + DefaultErrno *OptionalUInt32 `protobuf:"bytes,2,opt,name=default_errno,json=defaultErrno,proto3" json:"default_errno,omitempty"` + Architectures []string `protobuf:"bytes,3,rep,name=architectures,proto3" json:"architectures,omitempty"` + Flags []string `protobuf:"bytes,4,rep,name=flags,proto3" json:"flags,omitempty"` + ListenerPath string `protobuf:"bytes,5,opt,name=listener_path,json=listenerPath,proto3" json:"listener_path,omitempty"` + ListenerMetadata string `protobuf:"bytes,6,opt,name=listener_metadata,json=listenerMetadata,proto3" json:"listener_metadata,omitempty"` + Syscalls []*LinuxSyscall `protobuf:"bytes,7,rep,name=syscalls,proto3" json:"syscalls,omitempty"` +} + +func (x *LinuxSeccomp) Reset() { + *x = LinuxSeccomp{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[63] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinuxSeccomp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinuxSeccomp) ProtoMessage() {} + +func (x *LinuxSeccomp) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[63] + 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 LinuxSeccomp.ProtoReflect.Descriptor instead. +func (*LinuxSeccomp) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{63} +} + +func (x *LinuxSeccomp) GetDefaultAction() string { + if x != nil { + return x.DefaultAction + } + return "" +} + +func (x *LinuxSeccomp) GetDefaultErrno() *OptionalUInt32 { + if x != nil { + return x.DefaultErrno + } + return nil +} + +func (x *LinuxSeccomp) GetArchitectures() []string { + if x != nil { + return x.Architectures + } + return nil +} + +func (x *LinuxSeccomp) GetFlags() []string { + if x != nil { + return x.Flags + } + return nil +} + +func (x *LinuxSeccomp) GetListenerPath() string { + if x != nil { + return x.ListenerPath + } + return "" +} + +func (x *LinuxSeccomp) GetListenerMetadata() string { + if x != nil { + return x.ListenerMetadata + } + return "" +} + +func (x *LinuxSeccomp) GetSyscalls() []*LinuxSyscall { + if x != nil { + return x.Syscalls + } + return nil +} + +type LinuxSyscall struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"` + Action string `protobuf:"bytes,2,opt,name=action,proto3" json:"action,omitempty"` + ErrnoRet *OptionalUInt32 `protobuf:"bytes,3,opt,name=errno_ret,json=errnoRet,proto3" json:"errno_ret,omitempty"` + Args []*LinuxSeccompArg `protobuf:"bytes,4,rep,name=args,proto3" json:"args,omitempty"` +} + +func (x *LinuxSyscall) Reset() { + *x = LinuxSyscall{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[64] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinuxSyscall) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinuxSyscall) ProtoMessage() {} + +func (x *LinuxSyscall) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[64] + 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 LinuxSyscall.ProtoReflect.Descriptor instead. +func (*LinuxSyscall) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{64} +} + +func (x *LinuxSyscall) GetNames() []string { + if x != nil { + return x.Names + } + return nil +} + +func (x *LinuxSyscall) GetAction() string { + if x != nil { + return x.Action + } + return "" +} + +func (x *LinuxSyscall) GetErrnoRet() *OptionalUInt32 { + if x != nil { + return x.ErrnoRet + } + return nil +} + +func (x *LinuxSyscall) GetArgs() []*LinuxSeccompArg { + if x != nil { + return x.Args + } + return nil +} + +type LinuxSeccompArg struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` + Value uint64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` + ValueTwo uint64 `protobuf:"varint,3,opt,name=value_two,json=valueTwo,proto3" json:"value_two,omitempty"` + Op string `protobuf:"bytes,4,opt,name=op,proto3" json:"op,omitempty"` +} + +func (x *LinuxSeccompArg) Reset() { + *x = LinuxSeccompArg{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[65] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinuxSeccompArg) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinuxSeccompArg) ProtoMessage() {} + +func (x *LinuxSeccompArg) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[65] + 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 LinuxSeccompArg.ProtoReflect.Descriptor instead. +func (*LinuxSeccompArg) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{65} +} + +func (x *LinuxSeccompArg) GetIndex() uint32 { + if x != nil { + return x.Index + } + return 0 +} + +func (x *LinuxSeccompArg) GetValue() uint64 { + if x != nil { + return x.Value + } + return 0 +} + +func (x *LinuxSeccompArg) GetValueTwo() uint64 { + if x != nil { + return x.ValueTwo + } + return 0 +} + +func (x *LinuxSeccompArg) GetOp() string { + if x != nil { + return x.Op + } + return "" +} + +// Requested update to an already created container. +type ContainerUpdate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` + Linux *LinuxContainerUpdate `protobuf:"bytes,2,opt,name=linux,proto3" json:"linux,omitempty"` + IgnoreFailure bool `protobuf:"varint,3,opt,name=ignore_failure,json=ignoreFailure,proto3" json:"ignore_failure,omitempty"` +} + +func (x *ContainerUpdate) Reset() { + *x = ContainerUpdate{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[66] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ContainerUpdate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContainerUpdate) ProtoMessage() {} + +func (x *ContainerUpdate) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[66] + 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 ContainerUpdate.ProtoReflect.Descriptor instead. +func (*ContainerUpdate) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{66} +} + +func (x *ContainerUpdate) GetContainerId() string { + if x != nil { + return x.ContainerId + } + return "" +} + +func (x *ContainerUpdate) GetLinux() *LinuxContainerUpdate { + if x != nil { + return x.Linux + } + return nil +} + +func (x *ContainerUpdate) GetIgnoreFailure() bool { + if x != nil { + return x.IgnoreFailure + } + return false +} + +// Updates to (linux) resources. +type LinuxContainerUpdate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Resources *LinuxResources `protobuf:"bytes,1,opt,name=resources,proto3" json:"resources,omitempty"` +} + +func (x *LinuxContainerUpdate) Reset() { + *x = LinuxContainerUpdate{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[67] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LinuxContainerUpdate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LinuxContainerUpdate) ProtoMessage() {} + +func (x *LinuxContainerUpdate) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[67] + 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 LinuxContainerUpdate.ProtoReflect.Descriptor instead. +func (*LinuxContainerUpdate) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{67} +} + +func (x *LinuxContainerUpdate) GetResources() *LinuxResources { + if x != nil { + return x.Resources + } + return nil +} + +// Request to evict (IOW unsolicitedly stop) a container. +type ContainerEviction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Container to evict. + ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` + // Human-readable reason for eviction. + Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"` +} + +func (x *ContainerEviction) Reset() { + *x = ContainerEviction{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[68] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ContainerEviction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContainerEviction) ProtoMessage() {} + +func (x *ContainerEviction) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[68] + 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 ContainerEviction.ProtoReflect.Descriptor instead. +func (*ContainerEviction) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{68} +} + +func (x *ContainerEviction) GetContainerId() string { + if x != nil { + return x.ContainerId + } + return "" +} + +func (x *ContainerEviction) GetReason() string { + if x != nil { + return x.Reason + } + return "" +} + +// KeyValue represents an environment variable. +type KeyValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *KeyValue) Reset() { + *x = KeyValue{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[69] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeyValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeyValue) ProtoMessage() {} + +func (x *KeyValue) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[69] + 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 KeyValue.ProtoReflect.Descriptor instead. +func (*KeyValue) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{69} +} + +func (x *KeyValue) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *KeyValue) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +// An optional string value. +type OptionalString struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *OptionalString) Reset() { + *x = OptionalString{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[70] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OptionalString) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OptionalString) ProtoMessage() {} + +func (x *OptionalString) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[70] + 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 OptionalString.ProtoReflect.Descriptor instead. +func (*OptionalString) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{70} +} + +func (x *OptionalString) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +// An optional signed integer value. +type OptionalInt struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *OptionalInt) Reset() { + *x = OptionalInt{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[71] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OptionalInt) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OptionalInt) ProtoMessage() {} + +func (x *OptionalInt) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[71] + 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 OptionalInt.ProtoReflect.Descriptor instead. +func (*OptionalInt) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{71} +} + +func (x *OptionalInt) GetValue() int64 { + if x != nil { + return x.Value + } + return 0 +} + +// An optional 32-bit signed integer value. +type OptionalInt32 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value int32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *OptionalInt32) Reset() { + *x = OptionalInt32{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[72] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OptionalInt32) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OptionalInt32) ProtoMessage() {} + +func (x *OptionalInt32) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[72] + 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 OptionalInt32.ProtoReflect.Descriptor instead. +func (*OptionalInt32) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{72} +} + +func (x *OptionalInt32) GetValue() int32 { + if x != nil { + return x.Value + } + return 0 +} + +// An optional 32-bit unsigned integer value. +type OptionalUInt32 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value uint32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *OptionalUInt32) Reset() { + *x = OptionalUInt32{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[73] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OptionalUInt32) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OptionalUInt32) ProtoMessage() {} + +func (x *OptionalUInt32) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[73] + 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 OptionalUInt32.ProtoReflect.Descriptor instead. +func (*OptionalUInt32) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{73} +} + +func (x *OptionalUInt32) GetValue() uint32 { + if x != nil { + return x.Value + } + return 0 +} + +// An optional 64-bit signed integer value. +type OptionalInt64 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *OptionalInt64) Reset() { + *x = OptionalInt64{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[74] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OptionalInt64) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OptionalInt64) ProtoMessage() {} + +func (x *OptionalInt64) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[74] + 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 OptionalInt64.ProtoReflect.Descriptor instead. +func (*OptionalInt64) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{74} +} + +func (x *OptionalInt64) GetValue() int64 { + if x != nil { + return x.Value + } + return 0 +} + +// An optional 64-bit unsigned integer value. +type OptionalUInt64 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value uint64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *OptionalUInt64) Reset() { + *x = OptionalUInt64{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[75] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OptionalUInt64) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OptionalUInt64) ProtoMessage() {} + +func (x *OptionalUInt64) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[75] + 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 OptionalUInt64.ProtoReflect.Descriptor instead. +func (*OptionalUInt64) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{75} +} + +func (x *OptionalUInt64) GetValue() uint64 { + if x != nil { + return x.Value + } + return 0 +} + +// An optional boolean value. +type OptionalBool struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value bool `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *OptionalBool) Reset() { + *x = OptionalBool{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[76] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OptionalBool) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OptionalBool) ProtoMessage() {} + +func (x *OptionalBool) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[76] + 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 OptionalBool.ProtoReflect.Descriptor instead. +func (*OptionalBool) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{76} +} + +func (x *OptionalBool) GetValue() bool { + if x != nil { + return x.Value + } + return false +} + +// An optional value of file permissions. +type OptionalFileMode struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value uint32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *OptionalFileMode) Reset() { + *x = OptionalFileMode{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[77] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OptionalFileMode) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OptionalFileMode) ProtoMessage() {} + +func (x *OptionalFileMode) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[77] + 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 OptionalFileMode.ProtoReflect.Descriptor instead. +func (*OptionalFileMode) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{77} +} + +func (x *OptionalFileMode) GetValue() uint32 { + if x != nil { + return x.Value + } + return 0 +} + +// CompoundFieldOwners tracks 'plugin ownership' of compound fields +// which can be adjusted entry by entry, typically maps or slices. +// It is used to track ownership for annotations, mounts, devices, +// environment variables, hugepage limits, etc. The key identifies +// the owned entry (annotation key, mount destination, device path, +// environment variable name, etc.). The value is the owning plugin. +type CompoundFieldOwners struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Owners map[string]string `protobuf:"bytes,1,rep,name=owners,proto3" json:"owners,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *CompoundFieldOwners) Reset() { + *x = CompoundFieldOwners{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[78] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CompoundFieldOwners) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CompoundFieldOwners) ProtoMessage() {} + +func (x *CompoundFieldOwners) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[78] + 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 CompoundFieldOwners.ProtoReflect.Descriptor instead. +func (*CompoundFieldOwners) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{78} +} + +func (x *CompoundFieldOwners) GetOwners() map[string]string { + if x != nil { + return x.Owners + } + return nil +} + +// FieldOwners tracks field 'plugin ownership' for a single container. +// Keys represent adjustable fields of a container. For simple fields, +// the value is the plugin that last modified the field. For compound +// fields, the value is a CompoundFieldOwners which provides tracking +// 'plugin ownership' per field for compound data, typically maps and +// slices. Field enum values are used to index both maps, using Key() +// to get the int32 for the Field. +type FieldOwners struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Simple map[int32]string `protobuf:"bytes,1,rep,name=simple,proto3" json:"simple,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Compound map[int32]*CompoundFieldOwners `protobuf:"bytes,2,rep,name=compound,proto3" json:"compound,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *FieldOwners) Reset() { + *x = FieldOwners{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[79] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FieldOwners) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FieldOwners) ProtoMessage() {} + +func (x *FieldOwners) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[79] + 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 FieldOwners.ProtoReflect.Descriptor instead. +func (*FieldOwners) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{79} +} + +func (x *FieldOwners) GetSimple() map[int32]string { + if x != nil { + return x.Simple + } + return nil +} + +func (x *FieldOwners) GetCompound() map[int32]*CompoundFieldOwners { + if x != nil { + return x.Compound + } + return nil +} + +// OwningPlugins tracks field 'plugin ownership' for multiple containers. +// The string keys are container IDs. The values are FieldOwners which +// track 'plugin ownership' per adjustable field for the container. +type OwningPlugins struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Owners map[string]*FieldOwners `protobuf:"bytes,1,rep,name=owners,proto3" json:"owners,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *OwningPlugins) Reset() { + *x = OwningPlugins{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[80] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OwningPlugins) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OwningPlugins) ProtoMessage() {} + +func (x *OwningPlugins) ProtoReflect() protoreflect.Message { + mi := &file_pkg_api_v1beta1_api_proto_msgTypes[80] + 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 OwningPlugins.ProtoReflect.Descriptor instead. +func (*OwningPlugins) Descriptor() ([]byte, []int) { + return file_pkg_api_v1beta1_api_proto_rawDescGZIP(), []int{80} +} + +func (x *OwningPlugins) GetOwners() map[string]*FieldOwners { + if x != nil { + return x.Owners + } + return nil +} + +var File_pkg_api_v1beta1_api_proto protoreflect.FileDescriptor + +var file_pkg_api_v1beta1_api_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2f, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x6e, 0x72, 0x69, + 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x22, 0x57, 0x0a, 0x15, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x49, 0x64, 0x78, 0x22, 0x18, 0x0a, 0x16, 0x52, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x95, 0x01, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x3c, 0x0a, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x3c, 0x0a, + 0x05, 0x65, 0x76, 0x69, 0x63, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6e, + 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x45, 0x76, 0x69, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x65, 0x76, 0x69, 0x63, 0x74, 0x22, 0x58, 0x0a, 0x18, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, + 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, + 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x06, 0x66, + 0x61, 0x69, 0x6c, 0x65, 0x64, 0x22, 0xbd, 0x01, 0x0a, 0x0a, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x3b, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x05, 0x6c, 0x65, + 0x76, 0x65, 0x6c, 0x22, 0x60, 0x0a, 0x05, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x15, 0x0a, 0x11, + 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x44, 0x45, 0x42, + 0x55, 0x47, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x49, 0x4e, + 0x46, 0x4f, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x57, 0x41, + 0x52, 0x4e, 0x10, 0x03, 0x12, 0x0f, 0x0a, 0x0b, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x45, 0x52, + 0x52, 0x4f, 0x52, 0x10, 0x04, 0x22, 0x0d, 0x0a, 0x0b, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xd2, 0x01, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, + 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5f, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, + 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x31, 0x0a, + 0x14, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x13, 0x72, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, + 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x6f, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0x2b, 0x0a, 0x11, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x9d, 0x01, 0x0a, 0x12, 0x53, 0x79, 0x6e, 0x63, 0x68, + 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x33, 0x0a, + 0x04, 0x70, 0x6f, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x72, + 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x04, 0x70, 0x6f, + 0x64, 0x73, 0x12, 0x3e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x04, 0x6d, 0x6f, 0x72, 0x65, 0x22, 0x67, 0x0a, 0x13, 0x53, 0x79, 0x6e, 0x63, 0x68, 0x72, + 0x6f, 0x6e, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, + 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x52, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, + 0x6f, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x6d, 0x6f, 0x72, 0x65, 0x22, + 0x29, 0x0a, 0x0f, 0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0x12, 0x0a, 0x10, 0x53, 0x68, + 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x49, + 0x0a, 0x14, 0x52, 0x75, 0x6e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x03, 0x70, 0x6f, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, + 0x64, 0x62, 0x6f, 0x78, 0x52, 0x03, 0x70, 0x6f, 0x64, 0x22, 0x17, 0x0a, 0x15, 0x52, 0x75, 0x6e, + 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0xf9, 0x01, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, + 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, + 0x0a, 0x03, 0x70, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x72, + 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x03, 0x70, 0x6f, + 0x64, 0x12, 0x5d, 0x0a, 0x18, 0x6f, 0x76, 0x65, 0x72, 0x68, 0x65, 0x61, 0x64, 0x5f, 0x6c, 0x69, + 0x6e, 0x75, 0x78, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x16, 0x6f, 0x76, 0x65, 0x72, 0x68, 0x65, + 0x61, 0x64, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, + 0x12, 0x4c, 0x0a, 0x0f, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, + 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x0e, + 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x1a, + 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, + 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x50, 0x0a, 0x1b, 0x50, 0x6f, + 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, + 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x03, 0x70, 0x6f, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x64, + 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x03, 0x70, 0x6f, 0x64, 0x22, 0x1e, 0x0a, 0x1c, + 0x50, 0x6f, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, + 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4a, 0x0a, 0x15, + 0x53, 0x74, 0x6f, 0x70, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x03, 0x70, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, + 0x62, 0x6f, 0x78, 0x52, 0x03, 0x70, 0x6f, 0x64, 0x22, 0x18, 0x0a, 0x16, 0x53, 0x74, 0x6f, 0x70, + 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x4c, 0x0a, 0x17, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x50, 0x6f, 0x64, 0x53, + 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, + 0x03, 0x70, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x72, 0x69, + 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x03, 0x70, 0x6f, 0x64, + 0x22, 0x1a, 0x0a, 0x18, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, + 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x89, 0x01, 0x0a, + 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x03, 0x70, 0x6f, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x64, 0x53, 0x61, + 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x03, 0x70, 0x6f, 0x64, 0x12, 0x3c, 0x0a, 0x09, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x09, 0x63, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x22, 0xd7, 0x01, 0x0a, 0x17, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x06, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x06, + 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x06, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x12, 0x3c, 0x0a, 0x05, 0x65, 0x76, 0x69, 0x63, 0x74, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x45, 0x76, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x65, 0x76, 0x69, + 0x63, 0x74, 0x22, 0x8d, 0x01, 0x0a, 0x1a, 0x50, 0x6f, 0x73, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x31, 0x0a, 0x03, 0x70, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, + 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, + 0x03, 0x70, 0x6f, 0x64, 0x12, 0x3c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, + 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x22, 0x1d, 0x0a, 0x1b, 0x50, 0x6f, 0x73, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x88, 0x01, 0x0a, 0x15, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x03, 0x70, + 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, + 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, + 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x03, 0x70, 0x6f, 0x64, 0x12, 0x3c, + 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1e, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x22, 0x18, 0x0a, 0x16, + 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8c, 0x01, 0x0a, 0x19, 0x50, 0x6f, 0x73, 0x74, 0x53, + 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x03, 0x70, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, + 0x6f, 0x78, 0x52, 0x03, 0x70, 0x6f, 0x64, 0x12, 0x3c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, 0x72, 0x69, + 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x22, 0x1c, 0x0a, 0x1a, 0x50, 0x6f, 0x73, 0x74, 0x53, 0x74, 0x61, + 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0xd7, 0x01, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, + 0x0a, 0x03, 0x70, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x72, + 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x03, 0x70, 0x6f, + 0x64, 0x12, 0x3c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, + 0x4c, 0x0a, 0x0f, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, + 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, + 0x69, 0x6e, 0x75, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x0e, 0x6c, + 0x69, 0x6e, 0x75, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x95, 0x01, + 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, + 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, + 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x3c, 0x0a, 0x05, 0x65, 0x76, 0x69, 0x63, 0x74, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x45, 0x76, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, + 0x65, 0x76, 0x69, 0x63, 0x74, 0x22, 0x8d, 0x01, 0x0a, 0x1a, 0x50, 0x6f, 0x73, 0x74, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x03, 0x70, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, + 0x6f, 0x78, 0x52, 0x03, 0x70, 0x6f, 0x64, 0x12, 0x3c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, 0x72, 0x69, + 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x22, 0x1d, 0x0a, 0x1b, 0x50, 0x6f, 0x73, 0x74, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x87, 0x01, 0x0a, 0x14, 0x53, 0x74, 0x6f, 0x70, 0x43, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, + 0x03, 0x70, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x72, 0x69, + 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x03, 0x70, 0x6f, 0x64, + 0x12, 0x3c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x22, 0x55, + 0x0a, 0x15, 0x53, 0x74, 0x6f, 0x70, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, + 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x06, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0x89, 0x01, 0x0a, 0x16, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x31, 0x0a, 0x03, 0x70, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, + 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x03, + 0x70, 0x6f, 0x64, 0x12, 0x3c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x22, 0x19, 0x0a, 0x17, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x90, 0x03, 0x0a, + 0x22, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x03, 0x70, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1f, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, + 0x78, 0x52, 0x03, 0x70, 0x6f, 0x64, 0x12, 0x3c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, 0x72, 0x69, 0x2e, + 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x12, 0x40, 0x0a, 0x06, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x06, + 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x06, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x12, 0x3a, 0x0a, 0x06, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x77, 0x6e, 0x69, 0x6e, + 0x67, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x06, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, + 0x12, 0x3d, 0x0a, 0x07, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x49, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x07, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x22, + 0x3a, 0x0a, 0x0e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x55, 0x0a, 0x23, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x06, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, + 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, + 0x6f, 0x6e, 0x22, 0xfd, 0x03, 0x0a, 0x0a, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, + 0x78, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x43, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, + 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x64, 0x53, + 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x52, 0x0a, 0x0b, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x30, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, + 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, 0x27, + 0x0a, 0x0f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, + 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, + 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x05, 0x6c, 0x69, 0x6e, 0x75, 0x78, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, + 0x75, 0x78, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x05, 0x6c, 0x69, + 0x6e, 0x75, 0x78, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x03, 0x70, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x70, 0x73, 0x18, 0x0a, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x03, 0x69, 0x70, 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, 0xf3, 0x02, 0x0a, 0x0f, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x50, 0x6f, 0x64, 0x53, + 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x12, 0x46, 0x0a, 0x0c, 0x70, 0x6f, 0x64, 0x5f, 0x6f, 0x76, + 0x65, 0x72, 0x68, 0x65, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, + 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x52, 0x0b, 0x70, 0x6f, 0x64, 0x4f, 0x76, 0x65, 0x72, 0x68, 0x65, 0x61, 0x64, 0x12, 0x48, + 0x0a, 0x0d, 0x70, 0x6f, 0x64, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, + 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x0c, 0x70, 0x6f, 0x64, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 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, 0x21, 0x0a, + 0x0c, 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x50, 0x61, 0x74, 0x68, + 0x12, 0x43, 0x0a, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x18, 0x05, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, + 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x73, 0x12, 0x41, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, + 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, + 0x69, 0x6e, 0x75, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x09, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0xef, 0x07, 0x0a, 0x09, 0x43, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x70, 0x6f, 0x64, 0x5f, 0x73, 0x61, + 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x70, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x39, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x42, 0x0a, 0x06, 0x6c, + 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6e, 0x72, + 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x4c, 0x61, 0x62, 0x65, + 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, + 0x51, 0x0a, 0x0b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 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, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x08, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x12, 0x32, 0x0a, 0x06, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, + 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, + 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x06, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x30, 0x0a, 0x05, + 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x72, + 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x52, 0x05, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x12, 0x39, + 0x0a, 0x05, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, + 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x52, 0x05, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, + 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x70, 0x69, 0x64, 0x12, 0x3a, 0x0a, 0x07, 0x72, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, + 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x50, 0x4f, 0x53, 0x49, 0x58, 0x52, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x07, + 0x72, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, + 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, + 0x64, 0x5f, 0x61, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x66, 0x69, 0x6e, 0x69, + 0x73, 0x68, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x63, + 0x6f, 0x64, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x65, 0x78, 0x69, 0x74, 0x43, + 0x6f, 0x64, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x72, 0x65, + 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, + 0x3f, 0x0a, 0x0b, 0x43, 0x44, 0x49, 0x5f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x14, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x44, 0x49, 0x44, 0x65, + 0x76, 0x69, 0x63, 0x65, 0x52, 0x0a, 0x43, 0x44, 0x49, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x12, 0x2d, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 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, 0x6f, 0x0a, 0x05, 0x4d, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xfa, 0x02, 0x0a, 0x05, + 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x12, 0x35, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, + 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x48, 0x6f, + 0x6f, 0x6b, 0x52, 0x08, 0x70, 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x40, 0x0a, 0x0e, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x52, + 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x44, + 0x0a, 0x10, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, + 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x48, + 0x6f, 0x6f, 0x6b, 0x52, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x0f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x43, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x74, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x72, + 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x09, 0x70, 0x6f, 0x73, 0x74, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x12, 0x35, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x73, 0x74, 0x6f, 0x70, 0x18, 0x06, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x08, + 0x70, 0x6f, 0x73, 0x74, 0x73, 0x74, 0x6f, 0x70, 0x22, 0x7c, 0x0a, 0x04, 0x48, 0x6f, 0x6f, 0x6b, + 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x70, 0x61, 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x12, 0x3a, 0x0a, 0x07, 0x74, 0x69, + 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x72, + 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x52, 0x07, 0x74, + 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0x9d, 0x04, 0x0a, 0x0e, 0x4c, 0x69, 0x6e, 0x75, 0x78, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x43, 0x0a, 0x0a, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, + 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x52, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x12, 0x3a, + 0x0a, 0x07, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x20, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x44, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x52, 0x07, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x41, 0x0a, 0x09, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, + 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x73, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x44, 0x0a, + 0x0d, 0x6f, 0x6f, 0x6d, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x5f, 0x61, 0x64, 0x6a, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x52, 0x0b, 0x6f, 0x6f, 0x6d, 0x53, 0x63, 0x6f, 0x72, 0x65, + 0x41, 0x64, 0x6a, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x5f, 0x70, + 0x61, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x73, 0x50, 0x61, 0x74, 0x68, 0x12, 0x45, 0x0a, 0x0b, 0x69, 0x6f, 0x5f, 0x70, 0x72, 0x69, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, + 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x49, 0x4f, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x52, 0x0a, 0x69, 0x6f, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x4d, 0x0a, + 0x0f, 0x73, 0x65, 0x63, 0x63, 0x6f, 0x6d, 0x70, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x63, + 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x0e, 0x73, 0x65, + 0x63, 0x63, 0x6f, 0x6d, 0x70, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x48, 0x0a, 0x0e, + 0x73, 0x65, 0x63, 0x63, 0x6f, 0x6d, 0x70, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, + 0x53, 0x65, 0x63, 0x63, 0x6f, 0x6d, 0x70, 0x52, 0x0d, 0x73, 0x65, 0x63, 0x63, 0x6f, 0x6d, 0x70, + 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x38, 0x0a, 0x0e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x4e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, + 0x22, 0x93, 0x02, 0x0a, 0x0b, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x70, 0x61, 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x61, 0x6a, 0x6f, + 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x12, 0x14, + 0x0a, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6d, + 0x69, 0x6e, 0x6f, 0x72, 0x12, 0x42, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6d, 0x6f, 0x64, + 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, + 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x46, 0x69, 0x6c, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x08, + 0x66, 0x69, 0x6c, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x35, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x61, 0x6c, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, + 0x35, 0x0a, 0x03, 0x67, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, + 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x55, 0x49, 0x6e, 0x74, 0x33, + 0x32, 0x52, 0x03, 0x67, 0x69, 0x64, 0x22, 0xc9, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x6e, 0x75, 0x78, + 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x43, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x14, 0x0a, 0x05, + 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x61, 0x6c, 0x6c, + 0x6f, 0x77, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x38, 0x0a, 0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x05, 0x6d, 0x61, 0x6a, 0x6f, 0x72, + 0x12, 0x38, 0x0a, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x22, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, + 0x74, 0x36, 0x34, 0x52, 0x05, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x22, 0x1f, 0x0a, 0x09, 0x43, 0x44, 0x49, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x22, 0x53, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, + 0x03, 0x67, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x67, 0x69, 0x64, 0x12, + 0x27, 0x0a, 0x0f, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x67, 0x69, + 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x0e, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x61, 0x6c, 0x47, 0x69, 0x64, 0x73, 0x22, 0xd2, 0x04, 0x0a, 0x0e, 0x4c, 0x69, 0x6e, + 0x75, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x06, 0x6d, + 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x72, + 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x52, 0x06, 0x6d, + 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x2f, 0x0a, 0x03, 0x63, 0x70, 0x75, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x43, 0x50, + 0x55, 0x52, 0x03, 0x63, 0x70, 0x75, 0x12, 0x4b, 0x0a, 0x0f, 0x68, 0x75, 0x67, 0x65, 0x70, 0x61, + 0x67, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x22, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 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, 0x48, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6f, 0x5f, 0x63, + 0x6c, 0x61, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x72, 0x69, + 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, + 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6f, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x40, 0x0a, + 0x09, 0x72, 0x64, 0x74, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x08, 0x72, 0x64, 0x74, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, + 0x4a, 0x0a, 0x07, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x30, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 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, 0x40, 0x0a, 0x07, 0x64, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6e, + 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x43, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x52, 0x07, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x32, 0x0a, + 0x04, 0x70, 0x69, 0x64, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, 0x72, + 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x50, 0x69, 0x64, 0x73, 0x52, 0x04, 0x70, 0x69, 0x64, + 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, 0xa2, 0x04, + 0x0a, 0x0b, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x38, 0x0a, + 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6e, + 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x36, 0x34, + 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x44, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x65, 0x72, + 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6e, + 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x36, 0x34, + 0x52, 0x0b, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x36, 0x0a, + 0x04, 0x73, 0x77, 0x61, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6e, 0x72, + 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, + 0x04, 0x73, 0x77, 0x61, 0x70, 0x12, 0x3a, 0x0a, 0x06, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x06, 0x6b, 0x65, 0x72, 0x6e, 0x65, + 0x6c, 0x12, 0x41, 0x0a, 0x0a, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x5f, 0x74, 0x63, 0x70, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x09, 0x6b, 0x65, 0x72, 0x6e, 0x65, + 0x6c, 0x54, 0x63, 0x70, 0x12, 0x43, 0x0a, 0x0a, 0x73, 0x77, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x65, + 0x73, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, + 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x0a, 0x73, + 0x77, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x12, 0x4f, 0x0a, 0x12, 0x64, 0x69, 0x73, + 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6f, 0x6f, 0x6d, 0x5f, 0x6b, 0x69, 0x6c, 0x6c, 0x65, 0x72, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x61, 0x6c, 0x42, 0x6f, 0x6f, 0x6c, 0x52, 0x10, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, + 0x65, 0x4f, 0x6f, 0x6d, 0x4b, 0x69, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x46, 0x0a, 0x0d, 0x75, 0x73, + 0x65, 0x5f, 0x68, 0x69, 0x65, 0x72, 0x61, 0x72, 0x63, 0x68, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x21, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, + 0x42, 0x6f, 0x6f, 0x6c, 0x52, 0x0c, 0x75, 0x73, 0x65, 0x48, 0x69, 0x65, 0x72, 0x61, 0x72, 0x63, + 0x68, 0x79, 0x22, 0x83, 0x03, 0x0a, 0x08, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x43, 0x50, 0x55, 0x12, + 0x3b, 0x0a, 0x06, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x55, 0x49, + 0x6e, 0x74, 0x36, 0x34, 0x52, 0x06, 0x73, 0x68, 0x61, 0x72, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x05, + 0x71, 0x75, 0x6f, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6e, 0x72, + 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, + 0x05, 0x71, 0x75, 0x6f, 0x74, 0x61, 0x12, 0x3b, 0x0a, 0x06, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x52, 0x06, 0x70, 0x65, 0x72, + 0x69, 0x6f, 0x64, 0x12, 0x4d, 0x0a, 0x10, 0x72, 0x65, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x65, 0x5f, + 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, + 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x36, + 0x34, 0x52, 0x0f, 0x72, 0x65, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x65, 0x52, 0x75, 0x6e, 0x74, 0x69, + 0x6d, 0x65, 0x12, 0x4c, 0x0a, 0x0f, 0x72, 0x65, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x70, + 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x72, + 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, + 0x52, 0x0e, 0x72, 0x65, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x65, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, + 0x12, 0x12, 0x0a, 0x04, 0x63, 0x70, 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x63, 0x70, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x73, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x73, 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, 0xce, 0x01, 0x0a, + 0x0f, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, + 0x12, 0x53, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x63, + 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, + 0x66, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, + 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, + 0x73, 0x74, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6c, 0x6f, + 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x66, 0x22, 0x41, 0x0a, 0x0b, 0x50, 0x72, + 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x55, 0x4e, + 0x54, 0x49, 0x4d, 0x45, 0x5f, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x0e, + 0x0a, 0x0a, 0x55, 0x4e, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0d, + 0x0a, 0x09, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x48, 0x4f, 0x53, 0x54, 0x10, 0x02, 0x22, 0x49, 0x0a, + 0x0b, 0x50, 0x4f, 0x53, 0x49, 0x58, 0x52, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x12, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, + 0x68, 0x61, 0x72, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x66, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x04, 0x73, 0x6f, 0x66, 0x74, 0x22, 0x21, 0x0a, 0x09, 0x4c, 0x69, 0x6e, 0x75, + 0x78, 0x50, 0x69, 0x64, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x65, 0x0a, 0x0f, 0x4c, + 0x69, 0x6e, 0x75, 0x78, 0x49, 0x4f, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x36, + 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, + 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x49, 0x4f, 0x50, 0x72, 0x69, 0x6f, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x52, + 0x05, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x22, 0x9f, 0x04, 0x0a, 0x13, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x5b, 0x0a, 0x0b, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x39, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x41, + 0x64, 0x6a, 0x75, 0x73, 0x74, 0x6d, 0x65, 0x6e, 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, 0x32, 0x0a, 0x06, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, + 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x06, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x2f, 0x0a, 0x03, 0x65, + 0x6e, 0x76, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, + 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4b, + 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x12, 0x30, 0x0a, 0x05, + 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6e, 0x72, + 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x52, 0x05, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x12, 0x43, + 0x0a, 0x05, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, + 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x05, 0x6c, 0x69, + 0x6e, 0x75, 0x78, 0x12, 0x3a, 0x0a, 0x07, 0x72, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x07, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x4f, 0x53, 0x49, 0x58, + 0x52, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x07, 0x72, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, + 0x3f, 0x0a, 0x0b, 0x43, 0x44, 0x49, 0x5f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x08, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x44, 0x49, 0x44, 0x65, + 0x76, 0x69, 0x63, 0x65, 0x52, 0x0a, 0x43, 0x44, 0x49, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, + 0x61, 0x72, 0x67, 0x73, 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, 0xd8, 0x03, 0x0a, 0x18, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x43, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x6d, 0x65, 0x6e, + 0x74, 0x12, 0x3a, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x44, 0x65, + 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x41, 0x0a, + 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, + 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x5f, 0x70, 0x61, 0x74, 0x68, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x50, + 0x61, 0x74, 0x68, 0x12, 0x44, 0x0a, 0x0d, 0x6f, 0x6f, 0x6d, 0x5f, 0x73, 0x63, 0x6f, 0x72, 0x65, + 0x5f, 0x61, 0x64, 0x6a, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x72, 0x69, + 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x52, 0x0b, 0x6f, 0x6f, + 0x6d, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x41, 0x64, 0x6a, 0x12, 0x45, 0x0a, 0x0b, 0x69, 0x6f, 0x5f, + 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, + 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x49, 0x4f, 0x50, 0x72, 0x69, 0x6f, + 0x72, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x69, 0x6f, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x12, 0x48, 0x0a, 0x0e, 0x73, 0x65, 0x63, 0x63, 0x6f, 0x6d, 0x70, 0x5f, 0x70, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, + 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, + 0x69, 0x6e, 0x75, 0x78, 0x53, 0x65, 0x63, 0x63, 0x6f, 0x6d, 0x70, 0x52, 0x0d, 0x73, 0x65, 0x63, + 0x63, 0x6f, 0x6d, 0x70, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x43, 0x0a, 0x0a, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, + 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x52, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x22, + 0xcc, 0x02, 0x0a, 0x0c, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x53, 0x65, 0x63, 0x63, 0x6f, 0x6d, 0x70, + 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x48, 0x0a, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, + 0x6c, 0x74, 0x5f, 0x65, 0x72, 0x72, 0x6e, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, + 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x55, 0x49, 0x6e, + 0x74, 0x33, 0x32, 0x52, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x45, 0x72, 0x72, 0x6e, + 0x6f, 0x12, 0x24, 0x0a, 0x0d, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, + 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, + 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x12, 0x23, 0x0a, + 0x0d, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x50, 0x61, + 0x74, 0x68, 0x12, 0x2b, 0x0a, 0x11, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x5f, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6c, + 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, + 0x3d, 0x0a, 0x08, 0x73, 0x79, 0x73, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x21, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x53, 0x79, 0x73, + 0x63, 0x61, 0x6c, 0x6c, 0x52, 0x08, 0x73, 0x79, 0x73, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x22, 0xb8, + 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x53, 0x79, 0x73, 0x63, 0x61, 0x6c, 0x6c, 0x12, + 0x14, 0x0a, 0x05, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, + 0x09, 0x65, 0x72, 0x72, 0x6e, 0x6f, 0x5f, 0x72, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x55, + 0x49, 0x6e, 0x74, 0x33, 0x32, 0x52, 0x08, 0x65, 0x72, 0x72, 0x6e, 0x6f, 0x52, 0x65, 0x74, 0x12, + 0x38, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x53, 0x65, 0x63, 0x63, 0x6f, 0x6d, 0x70, + 0x41, 0x72, 0x67, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x22, 0x6a, 0x0a, 0x0f, 0x4c, 0x69, 0x6e, + 0x75, 0x78, 0x53, 0x65, 0x63, 0x63, 0x6f, 0x6d, 0x70, 0x41, 0x72, 0x67, 0x12, 0x14, 0x0a, 0x05, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x69, 0x6e, 0x64, + 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x5f, 0x74, 0x77, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x54, 0x77, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x6f, 0x70, 0x22, 0x9c, 0x01, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x3f, 0x0a, 0x05, + 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x6e, 0x72, + 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x05, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x12, 0x25, 0x0a, + 0x0e, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x46, 0x61, 0x69, + 0x6c, 0x75, 0x72, 0x65, 0x22, 0x59, 0x0a, 0x14, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x43, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x41, 0x0a, 0x09, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x23, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x73, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, + 0x4e, 0x0a, 0x11, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x45, 0x76, 0x69, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, + 0x32, 0x0a, 0x08, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 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, 0x22, 0x26, 0x0a, 0x0e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x23, 0x0a, 0x0b, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x22, 0x25, 0x0a, 0x0d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x33, + 0x32, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x26, 0x0a, 0x0e, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x61, 0x6c, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, + 0x25, 0x0a, 0x0d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x74, 0x36, 0x34, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x26, 0x0a, 0x0e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x61, 0x6c, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x24, + 0x0a, 0x0c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x42, 0x6f, 0x6f, 0x6c, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x22, 0x28, 0x0a, 0x10, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, + 0x46, 0x69, 0x6c, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x9e, + 0x01, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x4c, 0x0a, 0x06, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, + 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, + 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6f, 0x77, + 0x6e, 0x65, 0x72, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4f, 0x77, 0x6e, 0x65, 0x72, 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, + 0xc1, 0x02, 0x0a, 0x0b, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x12, + 0x44, 0x0a, 0x06, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x2c, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x77, 0x6e, 0x65, 0x72, + 0x73, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x73, + 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x4a, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x75, 0x6e, + 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, + 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x46, 0x69, + 0x65, 0x6c, 0x64, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x75, + 0x6e, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x75, 0x6e, + 0x64, 0x1a, 0x39, 0x0a, 0x0b, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 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, 0x65, 0x0a, 0x0d, + 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x3e, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, + 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x46, 0x69, 0x65, + 0x6c, 0x64, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x22, 0xb4, 0x01, 0x0a, 0x0d, 0x4f, 0x77, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x73, 0x12, 0x46, 0x0a, 0x06, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4f, 0x77, 0x6e, 0x69, + 0x6e, 0x67, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x1a, 0x5b, 0x0a, + 0x0b, 0x4f, 0x77, 0x6e, 0x65, 0x72, 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, 0x36, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, + 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x73, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x2a, 0xf4, 0x02, 0x0a, 0x05, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, + 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x55, 0x4e, 0x5f, 0x50, 0x4f, 0x44, 0x5f, 0x53, 0x41, 0x4e, + 0x44, 0x42, 0x4f, 0x58, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x4f, 0x50, 0x5f, 0x50, + 0x4f, 0x44, 0x5f, 0x53, 0x41, 0x4e, 0x44, 0x42, 0x4f, 0x58, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, + 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x5f, 0x50, 0x4f, 0x44, 0x5f, 0x53, 0x41, 0x4e, 0x44, 0x42, + 0x4f, 0x58, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x5f, 0x43, + 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x10, 0x04, 0x12, 0x19, 0x0a, 0x15, 0x50, 0x4f, + 0x53, 0x54, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, + 0x4e, 0x45, 0x52, 0x10, 0x05, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, 0x43, + 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x10, 0x06, 0x12, 0x18, 0x0a, 0x14, 0x50, 0x4f, + 0x53, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, + 0x45, 0x52, 0x10, 0x07, 0x12, 0x14, 0x0a, 0x10, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x43, + 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x10, 0x08, 0x12, 0x19, 0x0a, 0x15, 0x50, 0x4f, + 0x53, 0x54, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, + 0x4e, 0x45, 0x52, 0x10, 0x09, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x54, 0x4f, 0x50, 0x5f, 0x43, 0x4f, + 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x10, 0x0a, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x45, 0x4d, + 0x4f, 0x56, 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x10, 0x0b, 0x12, + 0x16, 0x0a, 0x12, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x50, 0x4f, 0x44, 0x5f, 0x53, 0x41, + 0x4e, 0x44, 0x42, 0x4f, 0x58, 0x10, 0x0c, 0x12, 0x1b, 0x0a, 0x17, 0x50, 0x4f, 0x53, 0x54, 0x5f, + 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x50, 0x4f, 0x44, 0x5f, 0x53, 0x41, 0x4e, 0x44, 0x42, + 0x4f, 0x58, 0x10, 0x0d, 0x12, 0x21, 0x0a, 0x1d, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x45, + 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x41, 0x44, 0x4a, 0x55, 0x53, + 0x54, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x0e, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x41, 0x53, 0x54, 0x10, + 0x0f, 0x2a, 0x82, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, + 0x52, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x43, + 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x44, + 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, + 0x50, 0x41, 0x55, 0x53, 0x45, 0x44, 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4e, 0x54, + 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, + 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x4f, + 0x50, 0x50, 0x45, 0x44, 0x10, 0x04, 0x2a, 0x65, 0x0a, 0x0b, 0x49, 0x4f, 0x50, 0x72, 0x69, 0x6f, + 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x15, 0x0a, 0x11, 0x49, 0x4f, 0x50, 0x52, 0x49, 0x4f, 0x5f, + 0x43, 0x4c, 0x41, 0x53, 0x53, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, + 0x49, 0x4f, 0x50, 0x52, 0x49, 0x4f, 0x5f, 0x43, 0x4c, 0x41, 0x53, 0x53, 0x5f, 0x52, 0x54, 0x10, + 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x49, 0x4f, 0x50, 0x52, 0x49, 0x4f, 0x5f, 0x43, 0x4c, 0x41, 0x53, + 0x53, 0x5f, 0x42, 0x45, 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x49, 0x4f, 0x50, 0x52, 0x49, 0x4f, + 0x5f, 0x43, 0x4c, 0x41, 0x53, 0x53, 0x5f, 0x49, 0x44, 0x4c, 0x45, 0x10, 0x03, 0x2a, 0xb9, 0x04, + 0x0a, 0x05, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x6f, 0x6e, 0x65, 0x10, + 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x10, 0x02, 0x12, 0x0c, + 0x0a, 0x08, 0x4f, 0x63, 0x69, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, + 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x10, 0x04, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x64, 0x69, + 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x10, 0x05, 0x12, 0x07, 0x0a, 0x03, 0x45, 0x6e, 0x76, + 0x10, 0x06, 0x12, 0x08, 0x0a, 0x04, 0x41, 0x72, 0x67, 0x73, 0x10, 0x07, 0x12, 0x0c, 0x0a, 0x08, + 0x4d, 0x65, 0x6d, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x10, 0x08, 0x12, 0x12, 0x0a, 0x0e, 0x4d, 0x65, + 0x6d, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x10, 0x09, 0x12, 0x10, + 0x0a, 0x0c, 0x4d, 0x65, 0x6d, 0x53, 0x77, 0x61, 0x70, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x10, 0x0a, + 0x12, 0x12, 0x0a, 0x0e, 0x4d, 0x65, 0x6d, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x4c, 0x69, 0x6d, + 0x69, 0x74, 0x10, 0x0b, 0x12, 0x0f, 0x0a, 0x0b, 0x4d, 0x65, 0x6d, 0x54, 0x43, 0x50, 0x4c, 0x69, + 0x6d, 0x69, 0x74, 0x10, 0x0c, 0x12, 0x11, 0x0a, 0x0d, 0x4d, 0x65, 0x6d, 0x53, 0x77, 0x61, 0x70, + 0x70, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x10, 0x0d, 0x12, 0x17, 0x0a, 0x13, 0x4d, 0x65, 0x6d, 0x44, + 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x6f, 0x6d, 0x4b, 0x69, 0x6c, 0x6c, 0x65, 0x72, 0x10, + 0x0e, 0x12, 0x13, 0x0a, 0x0f, 0x4d, 0x65, 0x6d, 0x55, 0x73, 0x65, 0x48, 0x69, 0x65, 0x72, 0x61, + 0x72, 0x63, 0x68, 0x79, 0x10, 0x0f, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x50, 0x55, 0x53, 0x68, 0x61, + 0x72, 0x65, 0x73, 0x10, 0x10, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x50, 0x55, 0x51, 0x75, 0x6f, 0x74, + 0x61, 0x10, 0x11, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x50, 0x55, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, + 0x10, 0x12, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x50, 0x55, 0x52, 0x65, 0x61, 0x6c, 0x74, 0x69, 0x6d, + 0x65, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x10, 0x13, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x50, + 0x55, 0x52, 0x65, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x65, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x10, + 0x14, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x50, 0x55, 0x53, 0x65, 0x74, 0x43, 0x50, 0x55, 0x73, 0x10, + 0x15, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x50, 0x55, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x73, 0x10, + 0x16, 0x12, 0x0d, 0x0a, 0x09, 0x50, 0x69, 0x64, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x10, 0x17, + 0x12, 0x12, 0x0a, 0x0e, 0x48, 0x75, 0x67, 0x65, 0x70, 0x61, 0x67, 0x65, 0x4c, 0x69, 0x6d, 0x69, + 0x74, 0x73, 0x10, 0x18, 0x12, 0x10, 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6f, 0x43, + 0x6c, 0x61, 0x73, 0x73, 0x10, 0x19, 0x12, 0x0c, 0x0a, 0x08, 0x52, 0x64, 0x74, 0x43, 0x6c, 0x61, + 0x73, 0x73, 0x10, 0x1a, 0x12, 0x12, 0x0a, 0x0e, 0x43, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x55, + 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x10, 0x1b, 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x73, 0x50, 0x61, 0x74, 0x68, 0x10, 0x1c, 0x12, 0x0f, 0x0a, 0x0b, 0x4f, 0x6f, 0x6d, + 0x53, 0x63, 0x6f, 0x72, 0x65, 0x41, 0x64, 0x6a, 0x10, 0x1d, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x73, 0x10, 0x1e, 0x12, 0x0e, 0x0a, 0x0a, 0x49, 0x6f, 0x50, 0x72, 0x69, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x10, 0x1f, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x65, 0x63, 0x63, 0x6f, + 0x6d, 0x70, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x10, 0x20, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x10, 0x21, 0x32, 0xe5, 0x01, 0x0a, 0x07, 0x52, 0x75, + 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x69, 0x0a, 0x0e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, + 0x72, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x2a, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, + 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x6f, 0x0a, 0x10, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x73, 0x12, 0x2c, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x32, 0xec, 0x0e, 0x0a, 0x06, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x5a, 0x0a, 0x09, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x12, 0x25, 0x2e, 0x6e, 0x72, 0x69, 0x2e, + 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x26, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x60, 0x0a, 0x0b, 0x53, 0x79, 0x6e, 0x63, + 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x65, 0x12, 0x27, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, + 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x79, + 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x28, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, + 0x7a, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x08, 0x53, 0x68, + 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x12, 0x24, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x68, 0x75, + 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6e, + 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x66, 0x0a, 0x0d, 0x52, 0x75, 0x6e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, + 0x64, 0x62, 0x6f, 0x78, 0x12, 0x29, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x50, 0x6f, + 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2a, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, + 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6f, 0x0a, 0x10, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x12, + 0x2c, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x53, + 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, + 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, + 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7b, 0x0a, 0x14, + 0x50, 0x6f, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, + 0x64, 0x62, 0x6f, 0x78, 0x12, 0x30, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x73, + 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, + 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x69, 0x0a, 0x0e, 0x53, 0x74, 0x6f, + 0x70, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x12, 0x2a, 0x2e, 0x6e, 0x72, + 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, + 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x74, + 0x6f, 0x70, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6f, 0x0a, 0x10, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x50, 0x6f, + 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x12, 0x2c, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, + 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, + 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x6d, + 0x6f, 0x76, 0x65, 0x50, 0x6f, 0x64, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6c, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x2b, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, + 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x78, 0x0a, 0x13, 0x50, 0x6f, 0x73, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x2f, 0x2e, 0x6e, 0x72, 0x69, + 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x6e, 0x72, + 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x69, 0x0a, + 0x0e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, + 0x2a, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6e, 0x72, + 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x75, 0x0a, 0x12, 0x50, 0x6f, 0x73, 0x74, + 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x2e, + 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, + 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x6c, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x12, 0x2b, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2c, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x78, 0x0a, + 0x13, 0x50, 0x6f, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x12, 0x2f, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x6f, 0x73, 0x74, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x66, 0x0a, 0x0d, 0x53, 0x74, 0x6f, 0x70, 0x43, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x29, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, + 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, + 0x74, 0x6f, 0x70, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x43, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x6c, 0x0a, 0x0f, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x12, 0x2b, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2c, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x90, 0x01, + 0x0a, 0x1b, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x37, 0x2e, + 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, 0x6b, 0x67, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x41, 0x64, + 0x6a, 0x75, 0x73, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x32, 0x59, 0x0a, 0x0d, 0x48, 0x6f, 0x73, 0x74, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0x48, 0x0a, 0x03, 0x4c, 0x6f, 0x67, 0x12, 0x1f, 0x2e, 0x6e, 0x72, 0x69, 0x2e, 0x70, + 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, + 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6e, 0x72, 0x69, 0x2e, + 0x70, 0x6b, 0x67, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x33, 0x5a, 0x31, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x6e, 0x72, 0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_pkg_api_v1beta1_api_proto_rawDescOnce sync.Once + file_pkg_api_v1beta1_api_proto_rawDescData = file_pkg_api_v1beta1_api_proto_rawDesc +) + +func file_pkg_api_v1beta1_api_proto_rawDescGZIP() []byte { + file_pkg_api_v1beta1_api_proto_rawDescOnce.Do(func() { + file_pkg_api_v1beta1_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_api_v1beta1_api_proto_rawDescData) + }) + return file_pkg_api_v1beta1_api_proto_rawDescData +} + +var file_pkg_api_v1beta1_api_proto_enumTypes = make([]protoimpl.EnumInfo, 6) +var file_pkg_api_v1beta1_api_proto_msgTypes = make([]protoimpl.MessageInfo, 91) +var file_pkg_api_v1beta1_api_proto_goTypes = []interface{}{ + (Event)(0), // 0: nri.pkg.api.v1beta1.Event + (ContainerState)(0), // 1: nri.pkg.api.v1beta1.ContainerState + (IOPrioClass)(0), // 2: nri.pkg.api.v1beta1.IOPrioClass + (Field)(0), // 3: nri.pkg.api.v1beta1.Field + (LogRequest_Level)(0), // 4: nri.pkg.api.v1beta1.LogRequest.Level + (SecurityProfile_ProfileType)(0), // 5: nri.pkg.api.v1beta1.SecurityProfile.ProfileType + (*RegisterPluginRequest)(nil), // 6: nri.pkg.api.v1beta1.RegisterPluginRequest + (*RegisterPluginResponse)(nil), // 7: nri.pkg.api.v1beta1.RegisterPluginResponse + (*UpdateContainersRequest)(nil), // 8: nri.pkg.api.v1beta1.UpdateContainersRequest + (*UpdateContainersResponse)(nil), // 9: nri.pkg.api.v1beta1.UpdateContainersResponse + (*LogRequest)(nil), // 10: nri.pkg.api.v1beta1.LogRequest + (*LogResponse)(nil), // 11: nri.pkg.api.v1beta1.LogResponse + (*ConfigureRequest)(nil), // 12: nri.pkg.api.v1beta1.ConfigureRequest + (*ConfigureResponse)(nil), // 13: nri.pkg.api.v1beta1.ConfigureResponse + (*SynchronizeRequest)(nil), // 14: nri.pkg.api.v1beta1.SynchronizeRequest + (*SynchronizeResponse)(nil), // 15: nri.pkg.api.v1beta1.SynchronizeResponse + (*ShutdownRequest)(nil), // 16: nri.pkg.api.v1beta1.ShutdownRequest + (*ShutdownResponse)(nil), // 17: nri.pkg.api.v1beta1.ShutdownResponse + (*RunPodSandboxRequest)(nil), // 18: nri.pkg.api.v1beta1.RunPodSandboxRequest + (*RunPodSandboxResponse)(nil), // 19: nri.pkg.api.v1beta1.RunPodSandboxResponse + (*UpdatePodSandboxRequest)(nil), // 20: nri.pkg.api.v1beta1.UpdatePodSandboxRequest + (*UpdatePodSandboxResponse)(nil), // 21: nri.pkg.api.v1beta1.UpdatePodSandboxResponse + (*PostUpdatePodSandboxRequest)(nil), // 22: nri.pkg.api.v1beta1.PostUpdatePodSandboxRequest + (*PostUpdatePodSandboxResponse)(nil), // 23: nri.pkg.api.v1beta1.PostUpdatePodSandboxResponse + (*StopPodSandboxRequest)(nil), // 24: nri.pkg.api.v1beta1.StopPodSandboxRequest + (*StopPodSandboxResponse)(nil), // 25: nri.pkg.api.v1beta1.StopPodSandboxResponse + (*RemovePodSandboxRequest)(nil), // 26: nri.pkg.api.v1beta1.RemovePodSandboxRequest + (*RemovePodSandboxResponse)(nil), // 27: nri.pkg.api.v1beta1.RemovePodSandboxResponse + (*CreateContainerRequest)(nil), // 28: nri.pkg.api.v1beta1.CreateContainerRequest + (*CreateContainerResponse)(nil), // 29: nri.pkg.api.v1beta1.CreateContainerResponse + (*PostCreateContainerRequest)(nil), // 30: nri.pkg.api.v1beta1.PostCreateContainerRequest + (*PostCreateContainerResponse)(nil), // 31: nri.pkg.api.v1beta1.PostCreateContainerResponse + (*StartContainerRequest)(nil), // 32: nri.pkg.api.v1beta1.StartContainerRequest + (*StartContainerResponse)(nil), // 33: nri.pkg.api.v1beta1.StartContainerResponse + (*PostStartContainerRequest)(nil), // 34: nri.pkg.api.v1beta1.PostStartContainerRequest + (*PostStartContainerResponse)(nil), // 35: nri.pkg.api.v1beta1.PostStartContainerResponse + (*UpdateContainerRequest)(nil), // 36: nri.pkg.api.v1beta1.UpdateContainerRequest + (*UpdateContainerResponse)(nil), // 37: nri.pkg.api.v1beta1.UpdateContainerResponse + (*PostUpdateContainerRequest)(nil), // 38: nri.pkg.api.v1beta1.PostUpdateContainerRequest + (*PostUpdateContainerResponse)(nil), // 39: nri.pkg.api.v1beta1.PostUpdateContainerResponse + (*StopContainerRequest)(nil), // 40: nri.pkg.api.v1beta1.StopContainerRequest + (*StopContainerResponse)(nil), // 41: nri.pkg.api.v1beta1.StopContainerResponse + (*RemoveContainerRequest)(nil), // 42: nri.pkg.api.v1beta1.RemoveContainerRequest + (*RemoveContainerResponse)(nil), // 43: nri.pkg.api.v1beta1.RemoveContainerResponse + (*ValidateContainerAdjustmentRequest)(nil), // 44: nri.pkg.api.v1beta1.ValidateContainerAdjustmentRequest + (*PluginInstance)(nil), // 45: nri.pkg.api.v1beta1.PluginInstance + (*ValidateContainerAdjustmentResponse)(nil), // 46: nri.pkg.api.v1beta1.ValidateContainerAdjustmentResponse + (*PodSandbox)(nil), // 47: nri.pkg.api.v1beta1.PodSandbox + (*LinuxPodSandbox)(nil), // 48: nri.pkg.api.v1beta1.LinuxPodSandbox + (*Container)(nil), // 49: nri.pkg.api.v1beta1.Container + (*Mount)(nil), // 50: nri.pkg.api.v1beta1.Mount + (*Hooks)(nil), // 51: nri.pkg.api.v1beta1.Hooks + (*Hook)(nil), // 52: nri.pkg.api.v1beta1.Hook + (*LinuxContainer)(nil), // 53: nri.pkg.api.v1beta1.LinuxContainer + (*LinuxNamespace)(nil), // 54: nri.pkg.api.v1beta1.LinuxNamespace + (*LinuxDevice)(nil), // 55: nri.pkg.api.v1beta1.LinuxDevice + (*LinuxDeviceCgroup)(nil), // 56: nri.pkg.api.v1beta1.LinuxDeviceCgroup + (*CDIDevice)(nil), // 57: nri.pkg.api.v1beta1.CDIDevice + (*User)(nil), // 58: nri.pkg.api.v1beta1.User + (*LinuxResources)(nil), // 59: nri.pkg.api.v1beta1.LinuxResources + (*LinuxMemory)(nil), // 60: nri.pkg.api.v1beta1.LinuxMemory + (*LinuxCPU)(nil), // 61: nri.pkg.api.v1beta1.LinuxCPU + (*HugepageLimit)(nil), // 62: nri.pkg.api.v1beta1.HugepageLimit + (*SecurityProfile)(nil), // 63: nri.pkg.api.v1beta1.SecurityProfile + (*POSIXRlimit)(nil), // 64: nri.pkg.api.v1beta1.POSIXRlimit + (*LinuxPids)(nil), // 65: nri.pkg.api.v1beta1.LinuxPids + (*LinuxIOPriority)(nil), // 66: nri.pkg.api.v1beta1.LinuxIOPriority + (*ContainerAdjustment)(nil), // 67: nri.pkg.api.v1beta1.ContainerAdjustment + (*LinuxContainerAdjustment)(nil), // 68: nri.pkg.api.v1beta1.LinuxContainerAdjustment + (*LinuxSeccomp)(nil), // 69: nri.pkg.api.v1beta1.LinuxSeccomp + (*LinuxSyscall)(nil), // 70: nri.pkg.api.v1beta1.LinuxSyscall + (*LinuxSeccompArg)(nil), // 71: nri.pkg.api.v1beta1.LinuxSeccompArg + (*ContainerUpdate)(nil), // 72: nri.pkg.api.v1beta1.ContainerUpdate + (*LinuxContainerUpdate)(nil), // 73: nri.pkg.api.v1beta1.LinuxContainerUpdate + (*ContainerEviction)(nil), // 74: nri.pkg.api.v1beta1.ContainerEviction + (*KeyValue)(nil), // 75: nri.pkg.api.v1beta1.KeyValue + (*OptionalString)(nil), // 76: nri.pkg.api.v1beta1.OptionalString + (*OptionalInt)(nil), // 77: nri.pkg.api.v1beta1.OptionalInt + (*OptionalInt32)(nil), // 78: nri.pkg.api.v1beta1.OptionalInt32 + (*OptionalUInt32)(nil), // 79: nri.pkg.api.v1beta1.OptionalUInt32 + (*OptionalInt64)(nil), // 80: nri.pkg.api.v1beta1.OptionalInt64 + (*OptionalUInt64)(nil), // 81: nri.pkg.api.v1beta1.OptionalUInt64 + (*OptionalBool)(nil), // 82: nri.pkg.api.v1beta1.OptionalBool + (*OptionalFileMode)(nil), // 83: nri.pkg.api.v1beta1.OptionalFileMode + (*CompoundFieldOwners)(nil), // 84: nri.pkg.api.v1beta1.CompoundFieldOwners + (*FieldOwners)(nil), // 85: nri.pkg.api.v1beta1.FieldOwners + (*OwningPlugins)(nil), // 86: nri.pkg.api.v1beta1.OwningPlugins + nil, // 87: nri.pkg.api.v1beta1.PodSandbox.LabelsEntry + nil, // 88: nri.pkg.api.v1beta1.PodSandbox.AnnotationsEntry + nil, // 89: nri.pkg.api.v1beta1.Container.LabelsEntry + nil, // 90: nri.pkg.api.v1beta1.Container.AnnotationsEntry + nil, // 91: nri.pkg.api.v1beta1.LinuxResources.UnifiedEntry + nil, // 92: nri.pkg.api.v1beta1.ContainerAdjustment.AnnotationsEntry + nil, // 93: nri.pkg.api.v1beta1.CompoundFieldOwners.OwnersEntry + nil, // 94: nri.pkg.api.v1beta1.FieldOwners.SimpleEntry + nil, // 95: nri.pkg.api.v1beta1.FieldOwners.CompoundEntry + nil, // 96: nri.pkg.api.v1beta1.OwningPlugins.OwnersEntry +} +var file_pkg_api_v1beta1_api_proto_depIdxs = []int32{ + 72, // 0: nri.pkg.api.v1beta1.UpdateContainersRequest.update:type_name -> nri.pkg.api.v1beta1.ContainerUpdate + 74, // 1: nri.pkg.api.v1beta1.UpdateContainersRequest.evict:type_name -> nri.pkg.api.v1beta1.ContainerEviction + 72, // 2: nri.pkg.api.v1beta1.UpdateContainersResponse.failed:type_name -> nri.pkg.api.v1beta1.ContainerUpdate + 4, // 3: nri.pkg.api.v1beta1.LogRequest.level:type_name -> nri.pkg.api.v1beta1.LogRequest.Level + 47, // 4: nri.pkg.api.v1beta1.SynchronizeRequest.pods:type_name -> nri.pkg.api.v1beta1.PodSandbox + 49, // 5: nri.pkg.api.v1beta1.SynchronizeRequest.containers:type_name -> nri.pkg.api.v1beta1.Container + 72, // 6: nri.pkg.api.v1beta1.SynchronizeResponse.update:type_name -> nri.pkg.api.v1beta1.ContainerUpdate + 47, // 7: nri.pkg.api.v1beta1.RunPodSandboxRequest.pod:type_name -> nri.pkg.api.v1beta1.PodSandbox + 47, // 8: nri.pkg.api.v1beta1.UpdatePodSandboxRequest.pod:type_name -> nri.pkg.api.v1beta1.PodSandbox + 59, // 9: nri.pkg.api.v1beta1.UpdatePodSandboxRequest.overhead_linux_resources:type_name -> nri.pkg.api.v1beta1.LinuxResources + 59, // 10: nri.pkg.api.v1beta1.UpdatePodSandboxRequest.linux_resources:type_name -> nri.pkg.api.v1beta1.LinuxResources + 47, // 11: nri.pkg.api.v1beta1.PostUpdatePodSandboxRequest.pod:type_name -> nri.pkg.api.v1beta1.PodSandbox + 47, // 12: nri.pkg.api.v1beta1.StopPodSandboxRequest.pod:type_name -> nri.pkg.api.v1beta1.PodSandbox + 47, // 13: nri.pkg.api.v1beta1.RemovePodSandboxRequest.pod:type_name -> nri.pkg.api.v1beta1.PodSandbox + 47, // 14: nri.pkg.api.v1beta1.CreateContainerRequest.pod:type_name -> nri.pkg.api.v1beta1.PodSandbox + 49, // 15: nri.pkg.api.v1beta1.CreateContainerRequest.container:type_name -> nri.pkg.api.v1beta1.Container + 67, // 16: nri.pkg.api.v1beta1.CreateContainerResponse.adjust:type_name -> nri.pkg.api.v1beta1.ContainerAdjustment + 72, // 17: nri.pkg.api.v1beta1.CreateContainerResponse.update:type_name -> nri.pkg.api.v1beta1.ContainerUpdate + 74, // 18: nri.pkg.api.v1beta1.CreateContainerResponse.evict:type_name -> nri.pkg.api.v1beta1.ContainerEviction + 47, // 19: nri.pkg.api.v1beta1.PostCreateContainerRequest.pod:type_name -> nri.pkg.api.v1beta1.PodSandbox + 49, // 20: nri.pkg.api.v1beta1.PostCreateContainerRequest.container:type_name -> nri.pkg.api.v1beta1.Container + 47, // 21: nri.pkg.api.v1beta1.StartContainerRequest.pod:type_name -> nri.pkg.api.v1beta1.PodSandbox + 49, // 22: nri.pkg.api.v1beta1.StartContainerRequest.container:type_name -> nri.pkg.api.v1beta1.Container + 47, // 23: nri.pkg.api.v1beta1.PostStartContainerRequest.pod:type_name -> nri.pkg.api.v1beta1.PodSandbox + 49, // 24: nri.pkg.api.v1beta1.PostStartContainerRequest.container:type_name -> nri.pkg.api.v1beta1.Container + 47, // 25: nri.pkg.api.v1beta1.UpdateContainerRequest.pod:type_name -> nri.pkg.api.v1beta1.PodSandbox + 49, // 26: nri.pkg.api.v1beta1.UpdateContainerRequest.container:type_name -> nri.pkg.api.v1beta1.Container + 59, // 27: nri.pkg.api.v1beta1.UpdateContainerRequest.linux_resources:type_name -> nri.pkg.api.v1beta1.LinuxResources + 72, // 28: nri.pkg.api.v1beta1.UpdateContainerResponse.update:type_name -> nri.pkg.api.v1beta1.ContainerUpdate + 74, // 29: nri.pkg.api.v1beta1.UpdateContainerResponse.evict:type_name -> nri.pkg.api.v1beta1.ContainerEviction + 47, // 30: nri.pkg.api.v1beta1.PostUpdateContainerRequest.pod:type_name -> nri.pkg.api.v1beta1.PodSandbox + 49, // 31: nri.pkg.api.v1beta1.PostUpdateContainerRequest.container:type_name -> nri.pkg.api.v1beta1.Container + 47, // 32: nri.pkg.api.v1beta1.StopContainerRequest.pod:type_name -> nri.pkg.api.v1beta1.PodSandbox + 49, // 33: nri.pkg.api.v1beta1.StopContainerRequest.container:type_name -> nri.pkg.api.v1beta1.Container + 72, // 34: nri.pkg.api.v1beta1.StopContainerResponse.update:type_name -> nri.pkg.api.v1beta1.ContainerUpdate + 47, // 35: nri.pkg.api.v1beta1.RemoveContainerRequest.pod:type_name -> nri.pkg.api.v1beta1.PodSandbox + 49, // 36: nri.pkg.api.v1beta1.RemoveContainerRequest.container:type_name -> nri.pkg.api.v1beta1.Container + 47, // 37: nri.pkg.api.v1beta1.ValidateContainerAdjustmentRequest.pod:type_name -> nri.pkg.api.v1beta1.PodSandbox + 49, // 38: nri.pkg.api.v1beta1.ValidateContainerAdjustmentRequest.container:type_name -> nri.pkg.api.v1beta1.Container + 67, // 39: nri.pkg.api.v1beta1.ValidateContainerAdjustmentRequest.adjust:type_name -> nri.pkg.api.v1beta1.ContainerAdjustment + 72, // 40: nri.pkg.api.v1beta1.ValidateContainerAdjustmentRequest.update:type_name -> nri.pkg.api.v1beta1.ContainerUpdate + 86, // 41: nri.pkg.api.v1beta1.ValidateContainerAdjustmentRequest.owners:type_name -> nri.pkg.api.v1beta1.OwningPlugins + 45, // 42: nri.pkg.api.v1beta1.ValidateContainerAdjustmentRequest.plugins:type_name -> nri.pkg.api.v1beta1.PluginInstance + 87, // 43: nri.pkg.api.v1beta1.PodSandbox.labels:type_name -> nri.pkg.api.v1beta1.PodSandbox.LabelsEntry + 88, // 44: nri.pkg.api.v1beta1.PodSandbox.annotations:type_name -> nri.pkg.api.v1beta1.PodSandbox.AnnotationsEntry + 48, // 45: nri.pkg.api.v1beta1.PodSandbox.linux:type_name -> nri.pkg.api.v1beta1.LinuxPodSandbox + 59, // 46: nri.pkg.api.v1beta1.LinuxPodSandbox.pod_overhead:type_name -> nri.pkg.api.v1beta1.LinuxResources + 59, // 47: nri.pkg.api.v1beta1.LinuxPodSandbox.pod_resources:type_name -> nri.pkg.api.v1beta1.LinuxResources + 54, // 48: nri.pkg.api.v1beta1.LinuxPodSandbox.namespaces:type_name -> nri.pkg.api.v1beta1.LinuxNamespace + 59, // 49: nri.pkg.api.v1beta1.LinuxPodSandbox.resources:type_name -> nri.pkg.api.v1beta1.LinuxResources + 1, // 50: nri.pkg.api.v1beta1.Container.state:type_name -> nri.pkg.api.v1beta1.ContainerState + 89, // 51: nri.pkg.api.v1beta1.Container.labels:type_name -> nri.pkg.api.v1beta1.Container.LabelsEntry + 90, // 52: nri.pkg.api.v1beta1.Container.annotations:type_name -> nri.pkg.api.v1beta1.Container.AnnotationsEntry + 50, // 53: nri.pkg.api.v1beta1.Container.mounts:type_name -> nri.pkg.api.v1beta1.Mount + 51, // 54: nri.pkg.api.v1beta1.Container.hooks:type_name -> nri.pkg.api.v1beta1.Hooks + 53, // 55: nri.pkg.api.v1beta1.Container.linux:type_name -> nri.pkg.api.v1beta1.LinuxContainer + 64, // 56: nri.pkg.api.v1beta1.Container.rlimits:type_name -> nri.pkg.api.v1beta1.POSIXRlimit + 57, // 57: nri.pkg.api.v1beta1.Container.CDI_devices:type_name -> nri.pkg.api.v1beta1.CDIDevice + 58, // 58: nri.pkg.api.v1beta1.Container.user:type_name -> nri.pkg.api.v1beta1.User + 52, // 59: nri.pkg.api.v1beta1.Hooks.prestart:type_name -> nri.pkg.api.v1beta1.Hook + 52, // 60: nri.pkg.api.v1beta1.Hooks.create_runtime:type_name -> nri.pkg.api.v1beta1.Hook + 52, // 61: nri.pkg.api.v1beta1.Hooks.create_container:type_name -> nri.pkg.api.v1beta1.Hook + 52, // 62: nri.pkg.api.v1beta1.Hooks.start_container:type_name -> nri.pkg.api.v1beta1.Hook + 52, // 63: nri.pkg.api.v1beta1.Hooks.poststart:type_name -> nri.pkg.api.v1beta1.Hook + 52, // 64: nri.pkg.api.v1beta1.Hooks.poststop:type_name -> nri.pkg.api.v1beta1.Hook + 77, // 65: nri.pkg.api.v1beta1.Hook.timeout:type_name -> nri.pkg.api.v1beta1.OptionalInt + 54, // 66: nri.pkg.api.v1beta1.LinuxContainer.namespaces:type_name -> nri.pkg.api.v1beta1.LinuxNamespace + 55, // 67: nri.pkg.api.v1beta1.LinuxContainer.devices:type_name -> nri.pkg.api.v1beta1.LinuxDevice + 59, // 68: nri.pkg.api.v1beta1.LinuxContainer.resources:type_name -> nri.pkg.api.v1beta1.LinuxResources + 77, // 69: nri.pkg.api.v1beta1.LinuxContainer.oom_score_adj:type_name -> nri.pkg.api.v1beta1.OptionalInt + 66, // 70: nri.pkg.api.v1beta1.LinuxContainer.io_priority:type_name -> nri.pkg.api.v1beta1.LinuxIOPriority + 63, // 71: nri.pkg.api.v1beta1.LinuxContainer.seccomp_profile:type_name -> nri.pkg.api.v1beta1.SecurityProfile + 69, // 72: nri.pkg.api.v1beta1.LinuxContainer.seccomp_policy:type_name -> nri.pkg.api.v1beta1.LinuxSeccomp + 83, // 73: nri.pkg.api.v1beta1.LinuxDevice.file_mode:type_name -> nri.pkg.api.v1beta1.OptionalFileMode + 79, // 74: nri.pkg.api.v1beta1.LinuxDevice.uid:type_name -> nri.pkg.api.v1beta1.OptionalUInt32 + 79, // 75: nri.pkg.api.v1beta1.LinuxDevice.gid:type_name -> nri.pkg.api.v1beta1.OptionalUInt32 + 80, // 76: nri.pkg.api.v1beta1.LinuxDeviceCgroup.major:type_name -> nri.pkg.api.v1beta1.OptionalInt64 + 80, // 77: nri.pkg.api.v1beta1.LinuxDeviceCgroup.minor:type_name -> nri.pkg.api.v1beta1.OptionalInt64 + 60, // 78: nri.pkg.api.v1beta1.LinuxResources.memory:type_name -> nri.pkg.api.v1beta1.LinuxMemory + 61, // 79: nri.pkg.api.v1beta1.LinuxResources.cpu:type_name -> nri.pkg.api.v1beta1.LinuxCPU + 62, // 80: nri.pkg.api.v1beta1.LinuxResources.hugepage_limits:type_name -> nri.pkg.api.v1beta1.HugepageLimit + 76, // 81: nri.pkg.api.v1beta1.LinuxResources.blockio_class:type_name -> nri.pkg.api.v1beta1.OptionalString + 76, // 82: nri.pkg.api.v1beta1.LinuxResources.rdt_class:type_name -> nri.pkg.api.v1beta1.OptionalString + 91, // 83: nri.pkg.api.v1beta1.LinuxResources.unified:type_name -> nri.pkg.api.v1beta1.LinuxResources.UnifiedEntry + 56, // 84: nri.pkg.api.v1beta1.LinuxResources.devices:type_name -> nri.pkg.api.v1beta1.LinuxDeviceCgroup + 65, // 85: nri.pkg.api.v1beta1.LinuxResources.pids:type_name -> nri.pkg.api.v1beta1.LinuxPids + 80, // 86: nri.pkg.api.v1beta1.LinuxMemory.limit:type_name -> nri.pkg.api.v1beta1.OptionalInt64 + 80, // 87: nri.pkg.api.v1beta1.LinuxMemory.reservation:type_name -> nri.pkg.api.v1beta1.OptionalInt64 + 80, // 88: nri.pkg.api.v1beta1.LinuxMemory.swap:type_name -> nri.pkg.api.v1beta1.OptionalInt64 + 80, // 89: nri.pkg.api.v1beta1.LinuxMemory.kernel:type_name -> nri.pkg.api.v1beta1.OptionalInt64 + 80, // 90: nri.pkg.api.v1beta1.LinuxMemory.kernel_tcp:type_name -> nri.pkg.api.v1beta1.OptionalInt64 + 81, // 91: nri.pkg.api.v1beta1.LinuxMemory.swappiness:type_name -> nri.pkg.api.v1beta1.OptionalUInt64 + 82, // 92: nri.pkg.api.v1beta1.LinuxMemory.disable_oom_killer:type_name -> nri.pkg.api.v1beta1.OptionalBool + 82, // 93: nri.pkg.api.v1beta1.LinuxMemory.use_hierarchy:type_name -> nri.pkg.api.v1beta1.OptionalBool + 81, // 94: nri.pkg.api.v1beta1.LinuxCPU.shares:type_name -> nri.pkg.api.v1beta1.OptionalUInt64 + 80, // 95: nri.pkg.api.v1beta1.LinuxCPU.quota:type_name -> nri.pkg.api.v1beta1.OptionalInt64 + 81, // 96: nri.pkg.api.v1beta1.LinuxCPU.period:type_name -> nri.pkg.api.v1beta1.OptionalUInt64 + 80, // 97: nri.pkg.api.v1beta1.LinuxCPU.realtime_runtime:type_name -> nri.pkg.api.v1beta1.OptionalInt64 + 81, // 98: nri.pkg.api.v1beta1.LinuxCPU.realtime_period:type_name -> nri.pkg.api.v1beta1.OptionalUInt64 + 5, // 99: nri.pkg.api.v1beta1.SecurityProfile.profile_type:type_name -> nri.pkg.api.v1beta1.SecurityProfile.ProfileType + 2, // 100: nri.pkg.api.v1beta1.LinuxIOPriority.class:type_name -> nri.pkg.api.v1beta1.IOPrioClass + 92, // 101: nri.pkg.api.v1beta1.ContainerAdjustment.annotations:type_name -> nri.pkg.api.v1beta1.ContainerAdjustment.AnnotationsEntry + 50, // 102: nri.pkg.api.v1beta1.ContainerAdjustment.mounts:type_name -> nri.pkg.api.v1beta1.Mount + 75, // 103: nri.pkg.api.v1beta1.ContainerAdjustment.env:type_name -> nri.pkg.api.v1beta1.KeyValue + 51, // 104: nri.pkg.api.v1beta1.ContainerAdjustment.hooks:type_name -> nri.pkg.api.v1beta1.Hooks + 68, // 105: nri.pkg.api.v1beta1.ContainerAdjustment.linux:type_name -> nri.pkg.api.v1beta1.LinuxContainerAdjustment + 64, // 106: nri.pkg.api.v1beta1.ContainerAdjustment.rlimits:type_name -> nri.pkg.api.v1beta1.POSIXRlimit + 57, // 107: nri.pkg.api.v1beta1.ContainerAdjustment.CDI_devices:type_name -> nri.pkg.api.v1beta1.CDIDevice + 55, // 108: nri.pkg.api.v1beta1.LinuxContainerAdjustment.devices:type_name -> nri.pkg.api.v1beta1.LinuxDevice + 59, // 109: nri.pkg.api.v1beta1.LinuxContainerAdjustment.resources:type_name -> nri.pkg.api.v1beta1.LinuxResources + 77, // 110: nri.pkg.api.v1beta1.LinuxContainerAdjustment.oom_score_adj:type_name -> nri.pkg.api.v1beta1.OptionalInt + 66, // 111: nri.pkg.api.v1beta1.LinuxContainerAdjustment.io_priority:type_name -> nri.pkg.api.v1beta1.LinuxIOPriority + 69, // 112: nri.pkg.api.v1beta1.LinuxContainerAdjustment.seccomp_policy:type_name -> nri.pkg.api.v1beta1.LinuxSeccomp + 54, // 113: nri.pkg.api.v1beta1.LinuxContainerAdjustment.namespaces:type_name -> nri.pkg.api.v1beta1.LinuxNamespace + 79, // 114: nri.pkg.api.v1beta1.LinuxSeccomp.default_errno:type_name -> nri.pkg.api.v1beta1.OptionalUInt32 + 70, // 115: nri.pkg.api.v1beta1.LinuxSeccomp.syscalls:type_name -> nri.pkg.api.v1beta1.LinuxSyscall + 79, // 116: nri.pkg.api.v1beta1.LinuxSyscall.errno_ret:type_name -> nri.pkg.api.v1beta1.OptionalUInt32 + 71, // 117: nri.pkg.api.v1beta1.LinuxSyscall.args:type_name -> nri.pkg.api.v1beta1.LinuxSeccompArg + 73, // 118: nri.pkg.api.v1beta1.ContainerUpdate.linux:type_name -> nri.pkg.api.v1beta1.LinuxContainerUpdate + 59, // 119: nri.pkg.api.v1beta1.LinuxContainerUpdate.resources:type_name -> nri.pkg.api.v1beta1.LinuxResources + 93, // 120: nri.pkg.api.v1beta1.CompoundFieldOwners.owners:type_name -> nri.pkg.api.v1beta1.CompoundFieldOwners.OwnersEntry + 94, // 121: nri.pkg.api.v1beta1.FieldOwners.simple:type_name -> nri.pkg.api.v1beta1.FieldOwners.SimpleEntry + 95, // 122: nri.pkg.api.v1beta1.FieldOwners.compound:type_name -> nri.pkg.api.v1beta1.FieldOwners.CompoundEntry + 96, // 123: nri.pkg.api.v1beta1.OwningPlugins.owners:type_name -> nri.pkg.api.v1beta1.OwningPlugins.OwnersEntry + 84, // 124: nri.pkg.api.v1beta1.FieldOwners.CompoundEntry.value:type_name -> nri.pkg.api.v1beta1.CompoundFieldOwners + 85, // 125: nri.pkg.api.v1beta1.OwningPlugins.OwnersEntry.value:type_name -> nri.pkg.api.v1beta1.FieldOwners + 6, // 126: nri.pkg.api.v1beta1.Runtime.RegisterPlugin:input_type -> nri.pkg.api.v1beta1.RegisterPluginRequest + 8, // 127: nri.pkg.api.v1beta1.Runtime.UpdateContainers:input_type -> nri.pkg.api.v1beta1.UpdateContainersRequest + 12, // 128: nri.pkg.api.v1beta1.Plugin.Configure:input_type -> nri.pkg.api.v1beta1.ConfigureRequest + 14, // 129: nri.pkg.api.v1beta1.Plugin.Synchronize:input_type -> nri.pkg.api.v1beta1.SynchronizeRequest + 16, // 130: nri.pkg.api.v1beta1.Plugin.Shutdown:input_type -> nri.pkg.api.v1beta1.ShutdownRequest + 18, // 131: nri.pkg.api.v1beta1.Plugin.RunPodSandbox:input_type -> nri.pkg.api.v1beta1.RunPodSandboxRequest + 20, // 132: nri.pkg.api.v1beta1.Plugin.UpdatePodSandbox:input_type -> nri.pkg.api.v1beta1.UpdatePodSandboxRequest + 22, // 133: nri.pkg.api.v1beta1.Plugin.PostUpdatePodSandbox:input_type -> nri.pkg.api.v1beta1.PostUpdatePodSandboxRequest + 24, // 134: nri.pkg.api.v1beta1.Plugin.StopPodSandbox:input_type -> nri.pkg.api.v1beta1.StopPodSandboxRequest + 26, // 135: nri.pkg.api.v1beta1.Plugin.RemovePodSandbox:input_type -> nri.pkg.api.v1beta1.RemovePodSandboxRequest + 28, // 136: nri.pkg.api.v1beta1.Plugin.CreateContainer:input_type -> nri.pkg.api.v1beta1.CreateContainerRequest + 30, // 137: nri.pkg.api.v1beta1.Plugin.PostCreateContainer:input_type -> nri.pkg.api.v1beta1.PostCreateContainerRequest + 32, // 138: nri.pkg.api.v1beta1.Plugin.StartContainer:input_type -> nri.pkg.api.v1beta1.StartContainerRequest + 34, // 139: nri.pkg.api.v1beta1.Plugin.PostStartContainer:input_type -> nri.pkg.api.v1beta1.PostStartContainerRequest + 36, // 140: nri.pkg.api.v1beta1.Plugin.UpdateContainer:input_type -> nri.pkg.api.v1beta1.UpdateContainerRequest + 38, // 141: nri.pkg.api.v1beta1.Plugin.PostUpdateContainer:input_type -> nri.pkg.api.v1beta1.PostUpdateContainerRequest + 40, // 142: nri.pkg.api.v1beta1.Plugin.StopContainer:input_type -> nri.pkg.api.v1beta1.StopContainerRequest + 42, // 143: nri.pkg.api.v1beta1.Plugin.RemoveContainer:input_type -> nri.pkg.api.v1beta1.RemoveContainerRequest + 44, // 144: nri.pkg.api.v1beta1.Plugin.ValidateContainerAdjustment:input_type -> nri.pkg.api.v1beta1.ValidateContainerAdjustmentRequest + 10, // 145: nri.pkg.api.v1beta1.HostFunctions.Log:input_type -> nri.pkg.api.v1beta1.LogRequest + 7, // 146: nri.pkg.api.v1beta1.Runtime.RegisterPlugin:output_type -> nri.pkg.api.v1beta1.RegisterPluginResponse + 9, // 147: nri.pkg.api.v1beta1.Runtime.UpdateContainers:output_type -> nri.pkg.api.v1beta1.UpdateContainersResponse + 13, // 148: nri.pkg.api.v1beta1.Plugin.Configure:output_type -> nri.pkg.api.v1beta1.ConfigureResponse + 15, // 149: nri.pkg.api.v1beta1.Plugin.Synchronize:output_type -> nri.pkg.api.v1beta1.SynchronizeResponse + 17, // 150: nri.pkg.api.v1beta1.Plugin.Shutdown:output_type -> nri.pkg.api.v1beta1.ShutdownResponse + 19, // 151: nri.pkg.api.v1beta1.Plugin.RunPodSandbox:output_type -> nri.pkg.api.v1beta1.RunPodSandboxResponse + 21, // 152: nri.pkg.api.v1beta1.Plugin.UpdatePodSandbox:output_type -> nri.pkg.api.v1beta1.UpdatePodSandboxResponse + 23, // 153: nri.pkg.api.v1beta1.Plugin.PostUpdatePodSandbox:output_type -> nri.pkg.api.v1beta1.PostUpdatePodSandboxResponse + 25, // 154: nri.pkg.api.v1beta1.Plugin.StopPodSandbox:output_type -> nri.pkg.api.v1beta1.StopPodSandboxResponse + 27, // 155: nri.pkg.api.v1beta1.Plugin.RemovePodSandbox:output_type -> nri.pkg.api.v1beta1.RemovePodSandboxResponse + 29, // 156: nri.pkg.api.v1beta1.Plugin.CreateContainer:output_type -> nri.pkg.api.v1beta1.CreateContainerResponse + 31, // 157: nri.pkg.api.v1beta1.Plugin.PostCreateContainer:output_type -> nri.pkg.api.v1beta1.PostCreateContainerResponse + 33, // 158: nri.pkg.api.v1beta1.Plugin.StartContainer:output_type -> nri.pkg.api.v1beta1.StartContainerResponse + 35, // 159: nri.pkg.api.v1beta1.Plugin.PostStartContainer:output_type -> nri.pkg.api.v1beta1.PostStartContainerResponse + 37, // 160: nri.pkg.api.v1beta1.Plugin.UpdateContainer:output_type -> nri.pkg.api.v1beta1.UpdateContainerResponse + 39, // 161: nri.pkg.api.v1beta1.Plugin.PostUpdateContainer:output_type -> nri.pkg.api.v1beta1.PostUpdateContainerResponse + 41, // 162: nri.pkg.api.v1beta1.Plugin.StopContainer:output_type -> nri.pkg.api.v1beta1.StopContainerResponse + 43, // 163: nri.pkg.api.v1beta1.Plugin.RemoveContainer:output_type -> nri.pkg.api.v1beta1.RemoveContainerResponse + 46, // 164: nri.pkg.api.v1beta1.Plugin.ValidateContainerAdjustment:output_type -> nri.pkg.api.v1beta1.ValidateContainerAdjustmentResponse + 11, // 165: nri.pkg.api.v1beta1.HostFunctions.Log:output_type -> nri.pkg.api.v1beta1.LogResponse + 146, // [146:166] is the sub-list for method output_type + 126, // [126:146] is the sub-list for method input_type + 126, // [126:126] is the sub-list for extension type_name + 126, // [126:126] is the sub-list for extension extendee + 0, // [0:126] is the sub-list for field type_name +} + +func init() { file_pkg_api_v1beta1_api_proto_init() } +func file_pkg_api_v1beta1_api_proto_init() { + if File_pkg_api_v1beta1_api_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_pkg_api_v1beta1_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegisterPluginRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegisterPluginResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateContainersRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateContainersResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LogRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LogResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfigureRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfigureResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SynchronizeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SynchronizeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShutdownRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ShutdownResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RunPodSandboxRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RunPodSandboxResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdatePodSandboxRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdatePodSandboxResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PostUpdatePodSandboxRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PostUpdatePodSandboxResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StopPodSandboxRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StopPodSandboxResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemovePodSandboxRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemovePodSandboxResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateContainerRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateContainerResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PostCreateContainerRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PostCreateContainerResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StartContainerRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StartContainerResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PostStartContainerRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PostStartContainerResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateContainerRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateContainerResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PostUpdateContainerRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PostUpdateContainerResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StopContainerRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StopContainerResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveContainerRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveContainerResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidateContainerAdjustmentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PluginInstance); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ValidateContainerAdjustmentResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PodSandbox); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinuxPodSandbox); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Container); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Mount); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Hooks); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Hook); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinuxContainer); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinuxNamespace); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinuxDevice); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinuxDeviceCgroup); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CDIDevice); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*User); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinuxResources); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinuxMemory); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinuxCPU); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[56].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_pkg_api_v1beta1_api_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SecurityProfile); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*POSIXRlimit); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinuxPids); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinuxIOPriority); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ContainerAdjustment); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinuxContainerAdjustment); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[63].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinuxSeccomp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[64].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinuxSyscall); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[65].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinuxSeccompArg); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[66].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ContainerUpdate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[67].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LinuxContainerUpdate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[68].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ContainerEviction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[69].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeyValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[70].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OptionalString); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[71].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OptionalInt); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[72].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OptionalInt32); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[73].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OptionalUInt32); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[74].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OptionalInt64); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[75].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OptionalUInt64); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[76].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OptionalBool); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[77].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OptionalFileMode); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[78].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CompoundFieldOwners); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[79].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FieldOwners); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_api_v1beta1_api_proto_msgTypes[80].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OwningPlugins); 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_pkg_api_v1beta1_api_proto_rawDesc, + NumEnums: 6, + NumMessages: 91, + NumExtensions: 0, + NumServices: 3, + }, + GoTypes: file_pkg_api_v1beta1_api_proto_goTypes, + DependencyIndexes: file_pkg_api_v1beta1_api_proto_depIdxs, + EnumInfos: file_pkg_api_v1beta1_api_proto_enumTypes, + MessageInfos: file_pkg_api_v1beta1_api_proto_msgTypes, + }.Build() + File_pkg_api_v1beta1_api_proto = out.File + file_pkg_api_v1beta1_api_proto_rawDesc = nil + file_pkg_api_v1beta1_api_proto_goTypes = nil + file_pkg_api_v1beta1_api_proto_depIdxs = nil +} diff --git a/pkg/api/v1beta1/api.proto b/pkg/api/v1beta1/api.proto new file mode 100644 index 00000000..d018db46 --- /dev/null +++ b/pkg/api/v1beta1/api.proto @@ -0,0 +1,767 @@ +/* + 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 nri.pkg.api.v1beta1; + +option go_package = "github.com/containerd/nri/pkg/api/v1beta1;v1beta1"; + +// Runtime service is the public API runtimes expose for NRI plugins. +// On this interface RPC requests are initiated by the plugin. This +// only covers plugin registration and unsolicited container updates. +// The rest of the API is defined by the Plugin service. +service Runtime { + // RegisterPlugin registers the plugin with the runtime. + rpc RegisterPlugin(RegisterPluginRequest) returns (RegisterPluginResponse); + // UpdateContainers requests unsolicited updates to a set of containers. + rpc UpdateContainers(UpdateContainersRequest) returns (UpdateContainersResponse); +} + +message RegisterPluginRequest { + // Name of the plugin to register. + string plugin_name = 1; + // Plugin invocation index. Plugins are called in ascending index order. + string plugin_idx = 2; +} + +message RegisterPluginResponse {} + +message UpdateContainersRequest { + // List of containers to update. + repeated ContainerUpdate update = 1; + // List of containers to evict. + repeated ContainerEviction evict = 2; +} + +message UpdateContainersResponse { + // Containers that the runtime failed to update. + repeated ContainerUpdate failed = 1; +} + + +// +// Plugin is the API NRI uses to interact with plugins. It is used to +// - configure a plugin and subscribe it for lifecycle events +// - synchronize the state of a plugin with that of the runtime +// - hook a plugin into the lifecycle events of its interest +// +// During configuration the plugin tells the runtime which lifecycle events +// it wishes to get hooked into. Once configured, the plugin is synchronized +// with the runtime by receiving the list of pods and containers known to +// the runtime. The plugin can request changes to any of the containers in +// response. After initial synchronization the plugin starts receiving the +// events it subscribed for as they occur in the runtime. For container +// creation, update, and stop events, the plugin can request changes, both +// to the container that triggered the event or any other existing container +// in the runtime. +// +// For a subset of the container lifecycle events, NRI defines an additional +// Post-variant of the event. These variants are defined for CreateContainer, +// StartContainer, and UpdateContainer. For creation and update, these events +// can be used by plugins to discover the full extent of changes applied to +// the container, including any changes made by other active plugins. +// +// go:plugin type=plugin version=1 +service Plugin { + // Configure the plugin and get its event subscription. + rpc Configure(ConfigureRequest) returns (ConfigureResponse); + + // Synchronize the plugin with the state of the runtime. + rpc Synchronize(SynchronizeRequest) returns (SynchronizeResponse); + + // Shutdown a plugin (let it know the runtime is going down). + rpc Shutdown(ShutdownRequest) returns (ShutdownResponse); + + // RunPodSandbox relays the corresponding request to the plugin. + rpc RunPodSandbox(RunPodSandboxRequest) returns (RunPodSandboxResponse); + + // UpdatePodSandbox relays the corresponding request to the plugin. + rpc UpdatePodSandbox(UpdatePodSandboxRequest) returns (UpdatePodSandboxResponse); + + // PostUpdatePodSandbox relays the corresponding request to the plugin. + rpc PostUpdatePodSandbox(PostUpdatePodSandboxRequest) returns (PostUpdatePodSandboxResponse); + + // StopPodSandbox relays the corresponding request to the plugin. + rpc StopPodSandbox(StopPodSandboxRequest) returns (StopPodSandboxResponse); + + // RemovePodSandbox relays the corresponding request to the plugin. + rpc RemovePodSandbox(RemovePodSandboxRequest) returns (RemovePodSandboxResponse); + + // CreateContainer relays the corresponding request to the plugin. In + // response, the plugin can adjust the container being created, and + // update other containers in the runtime. Container adjustment can + // alter labels, annotations, mounts, devices, environment variables, + // OCI hooks, and assigned container resources. Updates can alter + // assigned container resources. + rpc CreateContainer(CreateContainerRequest) returns (CreateContainerResponse); + + // PostCreateContainer relays the corresponding request to the plugin. + rpc PostCreateContainer(PostCreateContainerRequest) returns (PostCreateContainerResponse); + + // StartContainer relays the corresponding request to the plugin. + rpc StartContainer(StartContainerRequest) returns (StartContainerResponse); + + // PostStartContainer relays the corresponding request to the plugin. + rpc PostStartContainer(PostStartContainerRequest) returns (PostStartContainerResponse); + + // UpdateContainer relays the corresponding request to the plugin. + // The plugin can alter how the container is updated and request updates + // to additional containers in the runtime. + rpc UpdateContainer(UpdateContainerRequest) returns (UpdateContainerResponse); + + // PostUpdateContainer relays the corresponding request to the plugin. + rpc PostUpdateContainer(PostUpdateContainerRequest) returns (PostUpdateContainerResponse); + + // StopContainer relays the corresponding request to the plugin. The plugin + // can update any of the remaining containers in the runtime in response. + rpc StopContainer(StopContainerRequest) returns (StopContainerResponse); + + // RemoveContainer relays the corresponding request to the plugin. + rpc RemoveContainer(RemoveContainerRequest) returns (RemoveContainerResponse); + + // ValidateContainerAdjustment relays a container adjustment validation request + // to the plugin. Container creation will fail the plugin rejects the adjustments. + rpc ValidateContainerAdjustment(ValidateContainerAdjustmentRequest) returns (ValidateContainerAdjustmentResponse); +} + +// go:plugin type=host +service HostFunctions { + // Log displays a log message + rpc Log(LogRequest) returns (LogResponse); +} + +message LogRequest { + string msg = 1; + + enum Level { + LEVEL_UNSPECIFIED = 0; + LEVEL_DEBUG = 1; + LEVEL_INFO = 2; + LEVEL_WARN = 3; + LEVEL_ERROR = 4; + } + Level level = 2; +} + +message LogResponse {} + +message ConfigureRequest { + // Any plugin-specific data, if present among the NRI configuration. + string config = 1; + // Name of the runtime NRI is running in. + string runtime_name = 2; + // Version of the runtime NRI is running in. + string runtime_version = 3; + // Configured registration timeout in milliseconds. + int64 registration_timeout = 4; + // Configured request processing timeout in milliseconds. + int64 request_timeout = 5; +} + +message ConfigureResponse { + // Events to subscribe the plugin for. Each bit set corresponds to an + // enumerated Event. + int32 events = 2; +} + +message SynchronizeRequest { + // Pods known to the runtime. + repeated PodSandbox pods = 1; + // Containers known to the runtime. + repeated Container containers = 2; + // Whether there are more pods and containers to follow. + bool more = 3; +} + +message SynchronizeResponse { + // Updates to containers requested by the plugin. + repeated ContainerUpdate update = 1; + // Whether the client is able to handle more advertised pods and containers. + bool more = 2; +} + +message ShutdownRequest { + // Reason for the shutdown, if any. + string reason = 1; +} + +message ShutdownResponse {} + +message RunPodSandboxRequest { + // Pod being started. + PodSandbox pod = 1; +} + +message RunPodSandboxResponse {} + +message UpdatePodSandboxRequest { + // Pod being updated. + PodSandbox pod = 1; + // Overhead associated with this pod. + LinuxResources overhead_linux_resources = 2; + // Sum of container resources for this pod. + LinuxResources linux_resources = 3; +} + +message UpdatePodSandboxResponse {} + +message PostUpdatePodSandboxRequest { + // Pod updated. + PodSandbox pod = 1; +} + +message PostUpdatePodSandboxResponse {} + +message StopPodSandboxRequest { + // Pod being stopped. + PodSandbox pod = 1; +} + +message StopPodSandboxResponse {} + +message RemovePodSandboxRequest { + // Pod being removed. + PodSandbox pod = 1; +} + +message RemovePodSandboxResponse {} + +message CreateContainerRequest { + // Pod of container being created. + PodSandbox pod = 1; + // Container being created. + Container container = 2; +} + +message CreateContainerResponse { + // Requested adjustments to container being created. + ContainerAdjustment adjust = 1; + // Requested updates to other existing containers. + repeated ContainerUpdate update = 2; + // Requested eviction of existing containers. + repeated ContainerEviction evict = 3; +} + +message PostCreateContainerRequest { + // Pod of container created. + PodSandbox pod = 1; + // Container created. + Container container = 2; +} + +message PostCreateContainerResponse {} + +message StartContainerRequest { + // Pod of container being started. + PodSandbox pod = 1; + // Container being started. + Container container = 2; +} + +message StartContainerResponse {} + +message PostStartContainerRequest { + // Pod of container started. + PodSandbox pod = 1; + // Container started. + Container container = 2; +} + +message PostStartContainerResponse {} + +message UpdateContainerRequest { + // Pod of container being updated. + PodSandbox pod = 1; + // Container being updated. + Container container = 2; + // Resources to update. + LinuxResources linux_resources = 3; +} + +message UpdateContainerResponse { + // Requested updates to containers. + repeated ContainerUpdate update = 1; + // Requested eviction of containers. + repeated ContainerEviction evict = 2; +} + +message PostUpdateContainerRequest { + // Pod of container updated. + PodSandbox pod = 1; + // Container updated. + Container container = 2; +} + +message PostUpdateContainerResponse {} + +message StopContainerRequest { + // Pod of container being stopped. + PodSandbox pod = 1; + // Container being stopped. + Container container = 2; +} + +message StopContainerResponse { + // Requested updates to containers. + repeated ContainerUpdate update = 1; +} + +message RemoveContainerRequest { + // Pod of container removed. + PodSandbox pod = 1; + // Container removed. + Container container = 2; +} + +message RemoveContainerResponse {} + +message ValidateContainerAdjustmentRequest { + // Pod of container being adjusted. + PodSandbox pod = 1; + // Container being adjusted in its pristine state. + Container container = 2; + // Pending container adjustments. + ContainerAdjustment adjust = 3; + // Pending updates to other containers. + repeated ContainerUpdate update = 4; + // Plugins that made the adjustments and updates. + OwningPlugins owners = 5; + // Plugins consulted for adjustments and updates. + repeated PluginInstance plugins = 6; +} + +message PluginInstance { + string name = 1; + string index = 2; +} + +message ValidateContainerAdjustmentResponse { + bool reject = 1; + string reason = 2; +} + +// Events that plugins can subscribe to in ConfigureResponse. +enum Event { + UNKNOWN = 0; + RUN_POD_SANDBOX = 1; + STOP_POD_SANDBOX = 2; + REMOVE_POD_SANDBOX = 3; + CREATE_CONTAINER = 4; + POST_CREATE_CONTAINER = 5; + START_CONTAINER = 6; + POST_START_CONTAINER = 7; + UPDATE_CONTAINER = 8; + POST_UPDATE_CONTAINER = 9; + STOP_CONTAINER = 10; + REMOVE_CONTAINER = 11; + UPDATE_POD_SANDBOX = 12; + POST_UPDATE_POD_SANDBOX = 13; + VALIDATE_CONTAINER_ADJUSTMENT = 14; + LAST = 15; +} + +// Pod metadata that is considered relevant for a plugin. +message PodSandbox { + string id = 1; + string name = 2; + string uid = 3; + string namespace = 4; + map labels = 5; + map annotations = 6; + string runtime_handler = 7; + LinuxPodSandbox linux = 8; + uint32 pid = 9; // for NRI v1 emulation + repeated string ips = 10; +} + +// PodSandbox linux-specific metadata +message LinuxPodSandbox { + LinuxResources pod_overhead = 1; + LinuxResources pod_resources = 2; + string cgroup_parent = 3; + string cgroups_path = 4; // for NRI v1 emulation + repeated LinuxNamespace namespaces = 5; // for NRI v1 emulation + LinuxResources resources = 6; // for NRI v1 emulation +} + +// Container metadata that is considered relevant for a plugin. +message Container { + string id = 1; + string pod_sandbox_id = 2; + string name = 3; + ContainerState state = 4; + map labels = 5; + map annotations = 6; + repeated string args = 7; + repeated string env = 8; + repeated Mount mounts = 9; + Hooks hooks = 10; + LinuxContainer linux = 11; + uint32 pid = 12; // for NRI v1 emulation + repeated POSIXRlimit rlimits = 13; + int64 created_at = 14; + int64 started_at = 15; + int64 finished_at = 16; + int32 exit_code = 17; + string status_reason = 18; + string status_message = 19; + repeated CDIDevice CDI_devices = 20; + User user = 21; +} + +// Possible container states. +enum ContainerState { + CONTAINER_UNKNOWN = 0; + CONTAINER_CREATED = 1; + CONTAINER_PAUSED = 2; // is this useful/necessary ? + CONTAINER_RUNNING = 3; + CONTAINER_STOPPED = 4; +} + +// A container mount. +message Mount { + string destination = 1; + string type = 2; + string source = 3; + repeated string options = 4; +} + +// Container OCI hooks. +message Hooks { + repeated Hook prestart = 1; + repeated Hook create_runtime = 2; + repeated Hook create_container = 3; + repeated Hook start_container = 4; + repeated Hook poststart = 5; + repeated Hook poststop = 6; +} + +// One OCI hook. +message Hook { + string path = 1; + repeated string args = 2; + repeated string env = 3; + OptionalInt timeout = 4; +} + +// Container (linux) metadata. +message LinuxContainer { + repeated LinuxNamespace namespaces = 1; + repeated LinuxDevice devices = 2; + LinuxResources resources = 3; + OptionalInt oom_score_adj = 4; + string cgroups_path = 5; + LinuxIOPriority io_priority = 6; + SecurityProfile seccomp_profile = 7; + LinuxSeccomp seccomp_policy = 8; +} + +// A linux namespace. +message LinuxNamespace { + string type = 1; + string path = 2; +} + +// A container (linux) device. +message LinuxDevice { + string path = 1; + string type = 2; + int64 major = 3; + int64 minor = 4; + OptionalFileMode file_mode = 5; + OptionalUInt32 uid = 6; + OptionalUInt32 gid = 7; +} + +// A linux device cgroup controller rule. +message LinuxDeviceCgroup { + bool allow = 1; + string type = 2; + OptionalInt64 major = 3; + OptionalInt64 minor = 4; + string access = 5; +} + +// A CDI device reference. +message CDIDevice { + string name = 1; +} + +// User and group IDs for the container. +message User { + uint32 uid = 1; + uint32 gid = 2; + repeated uint32 additional_gids = 3; +} + +// Container (linux) resources. +message LinuxResources { + LinuxMemory memory = 1; + LinuxCPU cpu = 2; + repeated HugepageLimit hugepage_limits = 3; + OptionalString blockio_class = 4; + OptionalString rdt_class = 5; + map unified = 6; + repeated LinuxDeviceCgroup devices = 7; // for NRI v1 emulation + LinuxPids pids = 8; +} + +// Memory-related parts of (linux) resources. +message LinuxMemory { + OptionalInt64 limit = 1; + OptionalInt64 reservation = 2; + OptionalInt64 swap = 3; + OptionalInt64 kernel = 4; + OptionalInt64 kernel_tcp = 5; + OptionalUInt64 swappiness = 6; + OptionalBool disable_oom_killer = 7; + OptionalBool use_hierarchy = 8; +} + +// CPU-related parts of (linux) resources. +message LinuxCPU { + OptionalUInt64 shares = 1; + OptionalInt64 quota = 2; + OptionalUInt64 period = 3; + OptionalInt64 realtime_runtime = 4; + OptionalUInt64 realtime_period = 5; + string cpus = 6; + string mems = 7; +} + +// Container huge page limit. +message HugepageLimit { + string page_size = 1; + uint64 limit = 2; +} + +// SecurityProfile for container. +message SecurityProfile { + enum ProfileType { + RUNTIME_DEFAULT = 0; + UNCONFINED = 1; + LOCALHOST = 2; + } + ProfileType profile_type = 1; + string localhost_ref = 2; +} + +// Container rlimits +message POSIXRlimit { + string type = 1; + uint64 hard = 2; + uint64 soft = 3; +} + +// Pids-related parts of (linux) resources. +message LinuxPids { + int64 limit = 1; +} + +message LinuxIOPriority { + // Scheduling class of the IO priority. + IOPrioClass class = 1; + // The value of the IO priority. + int32 priority = 2; +} + +enum IOPrioClass { + IOPRIO_CLASS_NONE = 0; + IOPRIO_CLASS_RT = 1; + IOPRIO_CLASS_BE = 2; + IOPRIO_CLASS_IDLE = 3; +} + +// Requested adjustments to a container being created. +message ContainerAdjustment { + map annotations = 2; + repeated Mount mounts = 3; + repeated KeyValue env = 4; + Hooks hooks = 5; + LinuxContainerAdjustment linux = 6; + repeated POSIXRlimit rlimits = 7; + repeated CDIDevice CDI_devices = 8; + repeated string args = 9; +} + +// Adjustments to (linux) resources. +message LinuxContainerAdjustment { + repeated LinuxDevice devices = 1; + LinuxResources resources = 2; + string cgroups_path = 3; + OptionalInt oom_score_adj = 4; + LinuxIOPriority io_priority = 5; + LinuxSeccomp seccomp_policy = 6; + repeated LinuxNamespace namespaces = 7; +} + +message LinuxSeccomp { + string default_action = 1; + OptionalUInt32 default_errno = 2; + repeated string architectures = 3; + repeated string flags = 4; + string listener_path = 5; + string listener_metadata = 6; + repeated LinuxSyscall syscalls = 7; +} + +message LinuxSyscall { + repeated string names = 1; + string action = 2; + OptionalUInt32 errno_ret = 3; + repeated LinuxSeccompArg args = 4; +} + +message LinuxSeccompArg { + uint32 index = 1; + uint64 value = 2; + uint64 value_two = 3; + string op = 4; +} + +// Requested update to an already created container. +message ContainerUpdate { + string container_id = 1; + LinuxContainerUpdate linux = 2; + bool ignore_failure = 3; +} + +// Updates to (linux) resources. +message LinuxContainerUpdate { + LinuxResources resources = 1; +} + +// Request to evict (IOW unsolicitedly stop) a container. +message ContainerEviction { + // Container to evict. + string container_id = 1; + // Human-readable reason for eviction. + string reason = 2; +} + +// KeyValue represents an environment variable. +message KeyValue { + string key = 1; + string value = 2; +} + +// An optional string value. +message OptionalString { + string value = 1; +} + +// An optional signed integer value. +message OptionalInt { + int64 value = 1; +} + +// An optional 32-bit signed integer value. +message OptionalInt32 { + int32 value = 1; +} + +// An optional 32-bit unsigned integer value. +message OptionalUInt32 { + uint32 value = 1; +} + +// An optional 64-bit signed integer value. +message OptionalInt64 { + int64 value = 1; +} + +// An optional 64-bit unsigned integer value. +message OptionalUInt64 { + uint64 value = 1; +} + +// An optional boolean value. +message OptionalBool { + bool value = 1; +} + +// An optional value of file permissions. +message OptionalFileMode { + uint32 value = 1; +} + +// CompoundFieldOwners tracks 'plugin ownership' of compound fields +// which can be adjusted entry by entry, typically maps or slices. +// It is used to track ownership for annotations, mounts, devices, +// environment variables, hugepage limits, etc. The key identifies +// the owned entry (annotation key, mount destination, device path, +// environment variable name, etc.). The value is the owning plugin. +message CompoundFieldOwners { + map owners = 1; +} + +// FieldOwners tracks field 'plugin ownership' for a single container. +// Keys represent adjustable fields of a container. For simple fields, +// the value is the plugin that last modified the field. For compound +// fields, the value is a CompoundFieldOwners which provides tracking +// 'plugin ownership' per field for compound data, typically maps and +// slices. Field enum values are used to index both maps, using Key() +// to get the int32 for the Field. +message FieldOwners { + map simple = 1; + map compound = 2; +} + +// OwningPlugins tracks field 'plugin ownership' for multiple containers. +// The string keys are container IDs. The values are FieldOwners which +// track 'plugin ownership' per adjustable field for the container. +message OwningPlugins { + map owners = 1; +} + +// Field enumerates all fields that can be adjusted by plugins. +enum Field { + None = 0; + Annotations = 1; + Mounts = 2; + OciHooks = 3; + Devices = 4; + CdiDevices = 5; + Env = 6; + Args = 7; + MemLimit = 8; + MemReservation = 9; + MemSwapLimit = 10; + MemKernelLimit = 11; + MemTCPLimit = 12; + MemSwappiness = 13; + MemDisableOomKiller = 14; + MemUseHierarchy = 15; + CPUShares = 16; + CPUQuota = 17; + CPUPeriod = 18; + CPURealtimeRuntime = 19; + CPURealtimePeriod = 20; + CPUSetCPUs = 21; + CPUSetMems = 22; + PidsLimit = 23; + HugepageLimits = 24; + BlockioClass = 25; + RdtClass = 26; + CgroupsUnified = 27; + CgroupsPath = 28; + OomScoreAdj = 29; + Rlimits = 30; + IoPriority = 31; + SeccompPolicy = 32; + Namespace = 33; +} diff --git a/pkg/api/v1beta1/api_host.pb.go b/pkg/api/v1beta1/api_host.pb.go new file mode 100644 index 00000000..2e64290e --- /dev/null +++ b/pkg/api/v1beta1/api_host.pb.go @@ -0,0 +1,1337 @@ +//go:build !wasip1 + +// +//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. + +// Code generated by protoc-gen-go-plugin. DO NOT EDIT. +// versions: +// protoc-gen-go-plugin v0.1.0 +// protoc v3.20.1 +// source: pkg/api/v1beta1/api.proto + +package v1beta1 + +import ( + context "context" + errors "errors" + fmt "fmt" + wasm "github.com/knqyf263/go-plugin/wasm" + wazero "github.com/tetratelabs/wazero" + api "github.com/tetratelabs/wazero/api" + sys "github.com/tetratelabs/wazero/sys" + os "os" +) + +const ( + i32 = api.ValueTypeI32 + i64 = api.ValueTypeI64 +) + +type _hostFunctions struct { + HostFunctions +} + +// Instantiate a Go-defined module named "env" that exports host functions. +func (h _hostFunctions) Instantiate(ctx context.Context, r wazero.Runtime) error { + envBuilder := r.NewHostModuleBuilder("env") + + envBuilder.NewFunctionBuilder(). + WithGoModuleFunction(api.GoModuleFunc(h._Log), []api.ValueType{i32, i32}, []api.ValueType{i64}). + WithParameterNames("offset", "size"). + Export("log") + + _, err := envBuilder.Instantiate(ctx) + return err +} + +// Log displays a log message + +func (h _hostFunctions) _Log(ctx context.Context, m api.Module, stack []uint64) { + offset, size := uint32(stack[0]), uint32(stack[1]) + buf, err := wasm.ReadMemory(m.Memory(), offset, size) + if err != nil { + panic(err) + } + request := new(LogRequest) + err = request.UnmarshalVT(buf) + if err != nil { + panic(err) + } + resp, err := h.Log(ctx, request) + if err != nil { + panic(err) + } + buf, err = resp.MarshalVT() + if err != nil { + panic(err) + } + ptr, err := wasm.WriteMemory(ctx, m, buf) + if err != nil { + panic(err) + } + ptrLen := (ptr << uint64(32)) | uint64(len(buf)) + stack[0] = ptrLen +} + +const PluginPluginAPIVersion = 1 + +type PluginPlugin struct { + newRuntime func(context.Context) (wazero.Runtime, error) + moduleConfig wazero.ModuleConfig +} + +func NewPluginPlugin(ctx context.Context, opts ...wazeroConfigOption) (*PluginPlugin, error) { + o := &WazeroConfig{ + newRuntime: DefaultWazeroRuntime(), + moduleConfig: wazero.NewModuleConfig().WithStartFunctions("_initialize"), + } + + for _, opt := range opts { + opt(o) + } + + return &PluginPlugin{ + newRuntime: o.newRuntime, + moduleConfig: o.moduleConfig, + }, nil +} + +type plugin interface { + Close(ctx context.Context) error + Plugin +} + +func (p *PluginPlugin) Load(ctx context.Context, pluginPath string, hostFunctions HostFunctions) (plugin, error) { + b, err := os.ReadFile(pluginPath) + if err != nil { + return nil, err + } + + // Create a new runtime so that multiple modules will not conflict + r, err := p.newRuntime(ctx) + if err != nil { + return nil, err + } + + h := _hostFunctions{hostFunctions} + + if err := h.Instantiate(ctx, r); err != nil { + return nil, err + } + + // Compile the WebAssembly module using the default configuration. + code, err := r.CompileModule(ctx, b) + if err != nil { + return nil, err + } + + // InstantiateModule runs the "_start" function, WASI's "main". + module, err := r.InstantiateModule(ctx, code, p.moduleConfig) + if err != nil { + // Note: Most compilers do not exit the module after running "_start", + // unless there was an Error. This allows you to call exported functions. + if exitErr, ok := err.(*sys.ExitError); ok && exitErr.ExitCode() != 0 { + return nil, fmt.Errorf("unexpected exit_code: %d", exitErr.ExitCode()) + } else if !ok { + return nil, err + } + } + + // Compare API versions with the loading plugin + apiVersion := module.ExportedFunction("plugin_api_version") + if apiVersion == nil { + return nil, errors.New("plugin_api_version is not exported") + } + results, err := apiVersion.Call(ctx) + if err != nil { + return nil, err + } else if len(results) != 1 { + return nil, errors.New("invalid plugin_api_version signature") + } + if results[0] != PluginPluginAPIVersion { + return nil, fmt.Errorf("API version mismatch, host: %d, plugin: %d", PluginPluginAPIVersion, results[0]) + } + + configure := module.ExportedFunction("plugin_configure") + if configure == nil { + return nil, errors.New("plugin_configure is not exported") + } + synchronize := module.ExportedFunction("plugin_synchronize") + if synchronize == nil { + return nil, errors.New("plugin_synchronize is not exported") + } + shutdown := module.ExportedFunction("plugin_shutdown") + if shutdown == nil { + return nil, errors.New("plugin_shutdown is not exported") + } + runpodsandbox := module.ExportedFunction("plugin_run_pod_sandbox") + if runpodsandbox == nil { + return nil, errors.New("plugin_run_pod_sandbox is not exported") + } + updatepodsandbox := module.ExportedFunction("plugin_update_pod_sandbox") + if updatepodsandbox == nil { + return nil, errors.New("plugin_update_pod_sandbox is not exported") + } + postupdatepodsandbox := module.ExportedFunction("plugin_post_update_pod_sandbox") + if postupdatepodsandbox == nil { + return nil, errors.New("plugin_post_update_pod_sandbox is not exported") + } + stoppodsandbox := module.ExportedFunction("plugin_stop_pod_sandbox") + if stoppodsandbox == nil { + return nil, errors.New("plugin_stop_pod_sandbox is not exported") + } + removepodsandbox := module.ExportedFunction("plugin_remove_pod_sandbox") + if removepodsandbox == nil { + return nil, errors.New("plugin_remove_pod_sandbox is not exported") + } + createcontainer := module.ExportedFunction("plugin_create_container") + if createcontainer == nil { + return nil, errors.New("plugin_create_container is not exported") + } + postcreatecontainer := module.ExportedFunction("plugin_post_create_container") + if postcreatecontainer == nil { + return nil, errors.New("plugin_post_create_container is not exported") + } + startcontainer := module.ExportedFunction("plugin_start_container") + if startcontainer == nil { + return nil, errors.New("plugin_start_container is not exported") + } + poststartcontainer := module.ExportedFunction("plugin_post_start_container") + if poststartcontainer == nil { + return nil, errors.New("plugin_post_start_container is not exported") + } + updatecontainer := module.ExportedFunction("plugin_update_container") + if updatecontainer == nil { + return nil, errors.New("plugin_update_container is not exported") + } + postupdatecontainer := module.ExportedFunction("plugin_post_update_container") + if postupdatecontainer == nil { + return nil, errors.New("plugin_post_update_container is not exported") + } + stopcontainer := module.ExportedFunction("plugin_stop_container") + if stopcontainer == nil { + return nil, errors.New("plugin_stop_container is not exported") + } + removecontainer := module.ExportedFunction("plugin_remove_container") + if removecontainer == nil { + return nil, errors.New("plugin_remove_container is not exported") + } + validatecontaineradjustment := module.ExportedFunction("plugin_validate_container_adjustment") + if validatecontaineradjustment == nil { + return nil, errors.New("plugin_validate_container_adjustment is not exported") + } + + malloc := module.ExportedFunction("malloc") + if malloc == nil { + return nil, errors.New("malloc is not exported") + } + + free := module.ExportedFunction("free") + if free == nil { + return nil, errors.New("free is not exported") + } + return &pluginPlugin{ + runtime: r, + module: module, + malloc: malloc, + free: free, + configure: configure, + synchronize: synchronize, + shutdown: shutdown, + runpodsandbox: runpodsandbox, + updatepodsandbox: updatepodsandbox, + postupdatepodsandbox: postupdatepodsandbox, + stoppodsandbox: stoppodsandbox, + removepodsandbox: removepodsandbox, + createcontainer: createcontainer, + postcreatecontainer: postcreatecontainer, + startcontainer: startcontainer, + poststartcontainer: poststartcontainer, + updatecontainer: updatecontainer, + postupdatecontainer: postupdatecontainer, + stopcontainer: stopcontainer, + removecontainer: removecontainer, + validatecontaineradjustment: validatecontaineradjustment, + }, nil +} + +func (p *pluginPlugin) Close(ctx context.Context) (err error) { + if r := p.runtime; r != nil { + r.Close(ctx) + } + return +} + +type pluginPlugin struct { + runtime wazero.Runtime + module api.Module + malloc api.Function + free api.Function + configure api.Function + synchronize api.Function + shutdown api.Function + runpodsandbox api.Function + updatepodsandbox api.Function + postupdatepodsandbox api.Function + stoppodsandbox api.Function + removepodsandbox api.Function + createcontainer api.Function + postcreatecontainer api.Function + startcontainer api.Function + poststartcontainer api.Function + updatecontainer api.Function + postupdatecontainer api.Function + stopcontainer api.Function + removecontainer api.Function + validatecontaineradjustment api.Function +} + +func (p *pluginPlugin) Configure(ctx context.Context, request *ConfigureRequest) (*ConfigureResponse, error) { + data, err := request.MarshalVT() + if err != nil { + return nil, err + } + dataSize := uint64(len(data)) + + var dataPtr uint64 + // If the input data is not empty, we must allocate the in-Wasm memory to store it, and pass to the plugin. + if dataSize != 0 { + results, err := p.malloc.Call(ctx, dataSize) + if err != nil { + return nil, err + } + dataPtr = results[0] + // This pointer is managed by the Wasm module, which is unaware of external usage. + // So, we have to free it when finished + defer p.free.Call(ctx, dataPtr) + + // The pointer is a linear memory offset, which is where we write the name. + if !p.module.Memory().Write(uint32(dataPtr), data) { + return nil, fmt.Errorf("Memory.Write(%d, %d) out of range of memory size %d", dataPtr, dataSize, p.module.Memory().Size()) + } + } + + ptrSize, err := p.configure.Call(ctx, dataPtr, dataSize) + if err != nil { + return nil, err + } + + resPtr := uint32(ptrSize[0] >> 32) + resSize := uint32(ptrSize[0]) + var isErrResponse bool + if (resSize & (1 << 31)) > 0 { + isErrResponse = true + resSize &^= (1 << 31) + } + + // We don't need the memory after deserialization: make sure it is freed. + if resPtr != 0 { + defer p.free.Call(ctx, uint64(resPtr)) + } + + // The pointer is a linear memory offset, which is where we write the name. + bytes, ok := p.module.Memory().Read(resPtr, resSize) + if !ok { + return nil, fmt.Errorf("Memory.Read(%d, %d) out of range of memory size %d", + resPtr, resSize, p.module.Memory().Size()) + } + + if isErrResponse { + return nil, errors.New(string(bytes)) + } + + response := new(ConfigureResponse) + if err = response.UnmarshalVT(bytes); err != nil { + return nil, err + } + + return response, nil +} +func (p *pluginPlugin) Synchronize(ctx context.Context, request *SynchronizeRequest) (*SynchronizeResponse, error) { + data, err := request.MarshalVT() + if err != nil { + return nil, err + } + dataSize := uint64(len(data)) + + var dataPtr uint64 + // If the input data is not empty, we must allocate the in-Wasm memory to store it, and pass to the plugin. + if dataSize != 0 { + results, err := p.malloc.Call(ctx, dataSize) + if err != nil { + return nil, err + } + dataPtr = results[0] + // This pointer is managed by the Wasm module, which is unaware of external usage. + // So, we have to free it when finished + defer p.free.Call(ctx, dataPtr) + + // The pointer is a linear memory offset, which is where we write the name. + if !p.module.Memory().Write(uint32(dataPtr), data) { + return nil, fmt.Errorf("Memory.Write(%d, %d) out of range of memory size %d", dataPtr, dataSize, p.module.Memory().Size()) + } + } + + ptrSize, err := p.synchronize.Call(ctx, dataPtr, dataSize) + if err != nil { + return nil, err + } + + resPtr := uint32(ptrSize[0] >> 32) + resSize := uint32(ptrSize[0]) + var isErrResponse bool + if (resSize & (1 << 31)) > 0 { + isErrResponse = true + resSize &^= (1 << 31) + } + + // We don't need the memory after deserialization: make sure it is freed. + if resPtr != 0 { + defer p.free.Call(ctx, uint64(resPtr)) + } + + // The pointer is a linear memory offset, which is where we write the name. + bytes, ok := p.module.Memory().Read(resPtr, resSize) + if !ok { + return nil, fmt.Errorf("Memory.Read(%d, %d) out of range of memory size %d", + resPtr, resSize, p.module.Memory().Size()) + } + + if isErrResponse { + return nil, errors.New(string(bytes)) + } + + response := new(SynchronizeResponse) + if err = response.UnmarshalVT(bytes); err != nil { + return nil, err + } + + return response, nil +} +func (p *pluginPlugin) Shutdown(ctx context.Context, request *ShutdownRequest) (*ShutdownResponse, error) { + data, err := request.MarshalVT() + if err != nil { + return nil, err + } + dataSize := uint64(len(data)) + + var dataPtr uint64 + // If the input data is not empty, we must allocate the in-Wasm memory to store it, and pass to the plugin. + if dataSize != 0 { + results, err := p.malloc.Call(ctx, dataSize) + if err != nil { + return nil, err + } + dataPtr = results[0] + // This pointer is managed by the Wasm module, which is unaware of external usage. + // So, we have to free it when finished + defer p.free.Call(ctx, dataPtr) + + // The pointer is a linear memory offset, which is where we write the name. + if !p.module.Memory().Write(uint32(dataPtr), data) { + return nil, fmt.Errorf("Memory.Write(%d, %d) out of range of memory size %d", dataPtr, dataSize, p.module.Memory().Size()) + } + } + + ptrSize, err := p.shutdown.Call(ctx, dataPtr, dataSize) + if err != nil { + return nil, err + } + + resPtr := uint32(ptrSize[0] >> 32) + resSize := uint32(ptrSize[0]) + var isErrResponse bool + if (resSize & (1 << 31)) > 0 { + isErrResponse = true + resSize &^= (1 << 31) + } + + // We don't need the memory after deserialization: make sure it is freed. + if resPtr != 0 { + defer p.free.Call(ctx, uint64(resPtr)) + } + + // The pointer is a linear memory offset, which is where we write the name. + bytes, ok := p.module.Memory().Read(resPtr, resSize) + if !ok { + return nil, fmt.Errorf("Memory.Read(%d, %d) out of range of memory size %d", + resPtr, resSize, p.module.Memory().Size()) + } + + if isErrResponse { + return nil, errors.New(string(bytes)) + } + + response := new(ShutdownResponse) + if err = response.UnmarshalVT(bytes); err != nil { + return nil, err + } + + return response, nil +} +func (p *pluginPlugin) RunPodSandbox(ctx context.Context, request *RunPodSandboxRequest) (*RunPodSandboxResponse, error) { + data, err := request.MarshalVT() + if err != nil { + return nil, err + } + dataSize := uint64(len(data)) + + var dataPtr uint64 + // If the input data is not empty, we must allocate the in-Wasm memory to store it, and pass to the plugin. + if dataSize != 0 { + results, err := p.malloc.Call(ctx, dataSize) + if err != nil { + return nil, err + } + dataPtr = results[0] + // This pointer is managed by the Wasm module, which is unaware of external usage. + // So, we have to free it when finished + defer p.free.Call(ctx, dataPtr) + + // The pointer is a linear memory offset, which is where we write the name. + if !p.module.Memory().Write(uint32(dataPtr), data) { + return nil, fmt.Errorf("Memory.Write(%d, %d) out of range of memory size %d", dataPtr, dataSize, p.module.Memory().Size()) + } + } + + ptrSize, err := p.runpodsandbox.Call(ctx, dataPtr, dataSize) + if err != nil { + return nil, err + } + + resPtr := uint32(ptrSize[0] >> 32) + resSize := uint32(ptrSize[0]) + var isErrResponse bool + if (resSize & (1 << 31)) > 0 { + isErrResponse = true + resSize &^= (1 << 31) + } + + // We don't need the memory after deserialization: make sure it is freed. + if resPtr != 0 { + defer p.free.Call(ctx, uint64(resPtr)) + } + + // The pointer is a linear memory offset, which is where we write the name. + bytes, ok := p.module.Memory().Read(resPtr, resSize) + if !ok { + return nil, fmt.Errorf("Memory.Read(%d, %d) out of range of memory size %d", + resPtr, resSize, p.module.Memory().Size()) + } + + if isErrResponse { + return nil, errors.New(string(bytes)) + } + + response := new(RunPodSandboxResponse) + if err = response.UnmarshalVT(bytes); err != nil { + return nil, err + } + + return response, nil +} +func (p *pluginPlugin) UpdatePodSandbox(ctx context.Context, request *UpdatePodSandboxRequest) (*UpdatePodSandboxResponse, error) { + data, err := request.MarshalVT() + if err != nil { + return nil, err + } + dataSize := uint64(len(data)) + + var dataPtr uint64 + // If the input data is not empty, we must allocate the in-Wasm memory to store it, and pass to the plugin. + if dataSize != 0 { + results, err := p.malloc.Call(ctx, dataSize) + if err != nil { + return nil, err + } + dataPtr = results[0] + // This pointer is managed by the Wasm module, which is unaware of external usage. + // So, we have to free it when finished + defer p.free.Call(ctx, dataPtr) + + // The pointer is a linear memory offset, which is where we write the name. + if !p.module.Memory().Write(uint32(dataPtr), data) { + return nil, fmt.Errorf("Memory.Write(%d, %d) out of range of memory size %d", dataPtr, dataSize, p.module.Memory().Size()) + } + } + + ptrSize, err := p.updatepodsandbox.Call(ctx, dataPtr, dataSize) + if err != nil { + return nil, err + } + + resPtr := uint32(ptrSize[0] >> 32) + resSize := uint32(ptrSize[0]) + var isErrResponse bool + if (resSize & (1 << 31)) > 0 { + isErrResponse = true + resSize &^= (1 << 31) + } + + // We don't need the memory after deserialization: make sure it is freed. + if resPtr != 0 { + defer p.free.Call(ctx, uint64(resPtr)) + } + + // The pointer is a linear memory offset, which is where we write the name. + bytes, ok := p.module.Memory().Read(resPtr, resSize) + if !ok { + return nil, fmt.Errorf("Memory.Read(%d, %d) out of range of memory size %d", + resPtr, resSize, p.module.Memory().Size()) + } + + if isErrResponse { + return nil, errors.New(string(bytes)) + } + + response := new(UpdatePodSandboxResponse) + if err = response.UnmarshalVT(bytes); err != nil { + return nil, err + } + + return response, nil +} +func (p *pluginPlugin) PostUpdatePodSandbox(ctx context.Context, request *PostUpdatePodSandboxRequest) (*PostUpdatePodSandboxResponse, error) { + data, err := request.MarshalVT() + if err != nil { + return nil, err + } + dataSize := uint64(len(data)) + + var dataPtr uint64 + // If the input data is not empty, we must allocate the in-Wasm memory to store it, and pass to the plugin. + if dataSize != 0 { + results, err := p.malloc.Call(ctx, dataSize) + if err != nil { + return nil, err + } + dataPtr = results[0] + // This pointer is managed by the Wasm module, which is unaware of external usage. + // So, we have to free it when finished + defer p.free.Call(ctx, dataPtr) + + // The pointer is a linear memory offset, which is where we write the name. + if !p.module.Memory().Write(uint32(dataPtr), data) { + return nil, fmt.Errorf("Memory.Write(%d, %d) out of range of memory size %d", dataPtr, dataSize, p.module.Memory().Size()) + } + } + + ptrSize, err := p.postupdatepodsandbox.Call(ctx, dataPtr, dataSize) + if err != nil { + return nil, err + } + + resPtr := uint32(ptrSize[0] >> 32) + resSize := uint32(ptrSize[0]) + var isErrResponse bool + if (resSize & (1 << 31)) > 0 { + isErrResponse = true + resSize &^= (1 << 31) + } + + // We don't need the memory after deserialization: make sure it is freed. + if resPtr != 0 { + defer p.free.Call(ctx, uint64(resPtr)) + } + + // The pointer is a linear memory offset, which is where we write the name. + bytes, ok := p.module.Memory().Read(resPtr, resSize) + if !ok { + return nil, fmt.Errorf("Memory.Read(%d, %d) out of range of memory size %d", + resPtr, resSize, p.module.Memory().Size()) + } + + if isErrResponse { + return nil, errors.New(string(bytes)) + } + + response := new(PostUpdatePodSandboxResponse) + if err = response.UnmarshalVT(bytes); err != nil { + return nil, err + } + + return response, nil +} +func (p *pluginPlugin) StopPodSandbox(ctx context.Context, request *StopPodSandboxRequest) (*StopPodSandboxResponse, error) { + data, err := request.MarshalVT() + if err != nil { + return nil, err + } + dataSize := uint64(len(data)) + + var dataPtr uint64 + // If the input data is not empty, we must allocate the in-Wasm memory to store it, and pass to the plugin. + if dataSize != 0 { + results, err := p.malloc.Call(ctx, dataSize) + if err != nil { + return nil, err + } + dataPtr = results[0] + // This pointer is managed by the Wasm module, which is unaware of external usage. + // So, we have to free it when finished + defer p.free.Call(ctx, dataPtr) + + // The pointer is a linear memory offset, which is where we write the name. + if !p.module.Memory().Write(uint32(dataPtr), data) { + return nil, fmt.Errorf("Memory.Write(%d, %d) out of range of memory size %d", dataPtr, dataSize, p.module.Memory().Size()) + } + } + + ptrSize, err := p.stoppodsandbox.Call(ctx, dataPtr, dataSize) + if err != nil { + return nil, err + } + + resPtr := uint32(ptrSize[0] >> 32) + resSize := uint32(ptrSize[0]) + var isErrResponse bool + if (resSize & (1 << 31)) > 0 { + isErrResponse = true + resSize &^= (1 << 31) + } + + // We don't need the memory after deserialization: make sure it is freed. + if resPtr != 0 { + defer p.free.Call(ctx, uint64(resPtr)) + } + + // The pointer is a linear memory offset, which is where we write the name. + bytes, ok := p.module.Memory().Read(resPtr, resSize) + if !ok { + return nil, fmt.Errorf("Memory.Read(%d, %d) out of range of memory size %d", + resPtr, resSize, p.module.Memory().Size()) + } + + if isErrResponse { + return nil, errors.New(string(bytes)) + } + + response := new(StopPodSandboxResponse) + if err = response.UnmarshalVT(bytes); err != nil { + return nil, err + } + + return response, nil +} +func (p *pluginPlugin) RemovePodSandbox(ctx context.Context, request *RemovePodSandboxRequest) (*RemovePodSandboxResponse, error) { + data, err := request.MarshalVT() + if err != nil { + return nil, err + } + dataSize := uint64(len(data)) + + var dataPtr uint64 + // If the input data is not empty, we must allocate the in-Wasm memory to store it, and pass to the plugin. + if dataSize != 0 { + results, err := p.malloc.Call(ctx, dataSize) + if err != nil { + return nil, err + } + dataPtr = results[0] + // This pointer is managed by the Wasm module, which is unaware of external usage. + // So, we have to free it when finished + defer p.free.Call(ctx, dataPtr) + + // The pointer is a linear memory offset, which is where we write the name. + if !p.module.Memory().Write(uint32(dataPtr), data) { + return nil, fmt.Errorf("Memory.Write(%d, %d) out of range of memory size %d", dataPtr, dataSize, p.module.Memory().Size()) + } + } + + ptrSize, err := p.removepodsandbox.Call(ctx, dataPtr, dataSize) + if err != nil { + return nil, err + } + + resPtr := uint32(ptrSize[0] >> 32) + resSize := uint32(ptrSize[0]) + var isErrResponse bool + if (resSize & (1 << 31)) > 0 { + isErrResponse = true + resSize &^= (1 << 31) + } + + // We don't need the memory after deserialization: make sure it is freed. + if resPtr != 0 { + defer p.free.Call(ctx, uint64(resPtr)) + } + + // The pointer is a linear memory offset, which is where we write the name. + bytes, ok := p.module.Memory().Read(resPtr, resSize) + if !ok { + return nil, fmt.Errorf("Memory.Read(%d, %d) out of range of memory size %d", + resPtr, resSize, p.module.Memory().Size()) + } + + if isErrResponse { + return nil, errors.New(string(bytes)) + } + + response := new(RemovePodSandboxResponse) + if err = response.UnmarshalVT(bytes); err != nil { + return nil, err + } + + return response, nil +} +func (p *pluginPlugin) CreateContainer(ctx context.Context, request *CreateContainerRequest) (*CreateContainerResponse, error) { + data, err := request.MarshalVT() + if err != nil { + return nil, err + } + dataSize := uint64(len(data)) + + var dataPtr uint64 + // If the input data is not empty, we must allocate the in-Wasm memory to store it, and pass to the plugin. + if dataSize != 0 { + results, err := p.malloc.Call(ctx, dataSize) + if err != nil { + return nil, err + } + dataPtr = results[0] + // This pointer is managed by the Wasm module, which is unaware of external usage. + // So, we have to free it when finished + defer p.free.Call(ctx, dataPtr) + + // The pointer is a linear memory offset, which is where we write the name. + if !p.module.Memory().Write(uint32(dataPtr), data) { + return nil, fmt.Errorf("Memory.Write(%d, %d) out of range of memory size %d", dataPtr, dataSize, p.module.Memory().Size()) + } + } + + ptrSize, err := p.createcontainer.Call(ctx, dataPtr, dataSize) + if err != nil { + return nil, err + } + + resPtr := uint32(ptrSize[0] >> 32) + resSize := uint32(ptrSize[0]) + var isErrResponse bool + if (resSize & (1 << 31)) > 0 { + isErrResponse = true + resSize &^= (1 << 31) + } + + // We don't need the memory after deserialization: make sure it is freed. + if resPtr != 0 { + defer p.free.Call(ctx, uint64(resPtr)) + } + + // The pointer is a linear memory offset, which is where we write the name. + bytes, ok := p.module.Memory().Read(resPtr, resSize) + if !ok { + return nil, fmt.Errorf("Memory.Read(%d, %d) out of range of memory size %d", + resPtr, resSize, p.module.Memory().Size()) + } + + if isErrResponse { + return nil, errors.New(string(bytes)) + } + + response := new(CreateContainerResponse) + if err = response.UnmarshalVT(bytes); err != nil { + return nil, err + } + + return response, nil +} +func (p *pluginPlugin) PostCreateContainer(ctx context.Context, request *PostCreateContainerRequest) (*PostCreateContainerResponse, error) { + data, err := request.MarshalVT() + if err != nil { + return nil, err + } + dataSize := uint64(len(data)) + + var dataPtr uint64 + // If the input data is not empty, we must allocate the in-Wasm memory to store it, and pass to the plugin. + if dataSize != 0 { + results, err := p.malloc.Call(ctx, dataSize) + if err != nil { + return nil, err + } + dataPtr = results[0] + // This pointer is managed by the Wasm module, which is unaware of external usage. + // So, we have to free it when finished + defer p.free.Call(ctx, dataPtr) + + // The pointer is a linear memory offset, which is where we write the name. + if !p.module.Memory().Write(uint32(dataPtr), data) { + return nil, fmt.Errorf("Memory.Write(%d, %d) out of range of memory size %d", dataPtr, dataSize, p.module.Memory().Size()) + } + } + + ptrSize, err := p.postcreatecontainer.Call(ctx, dataPtr, dataSize) + if err != nil { + return nil, err + } + + resPtr := uint32(ptrSize[0] >> 32) + resSize := uint32(ptrSize[0]) + var isErrResponse bool + if (resSize & (1 << 31)) > 0 { + isErrResponse = true + resSize &^= (1 << 31) + } + + // We don't need the memory after deserialization: make sure it is freed. + if resPtr != 0 { + defer p.free.Call(ctx, uint64(resPtr)) + } + + // The pointer is a linear memory offset, which is where we write the name. + bytes, ok := p.module.Memory().Read(resPtr, resSize) + if !ok { + return nil, fmt.Errorf("Memory.Read(%d, %d) out of range of memory size %d", + resPtr, resSize, p.module.Memory().Size()) + } + + if isErrResponse { + return nil, errors.New(string(bytes)) + } + + response := new(PostCreateContainerResponse) + if err = response.UnmarshalVT(bytes); err != nil { + return nil, err + } + + return response, nil +} +func (p *pluginPlugin) StartContainer(ctx context.Context, request *StartContainerRequest) (*StartContainerResponse, error) { + data, err := request.MarshalVT() + if err != nil { + return nil, err + } + dataSize := uint64(len(data)) + + var dataPtr uint64 + // If the input data is not empty, we must allocate the in-Wasm memory to store it, and pass to the plugin. + if dataSize != 0 { + results, err := p.malloc.Call(ctx, dataSize) + if err != nil { + return nil, err + } + dataPtr = results[0] + // This pointer is managed by the Wasm module, which is unaware of external usage. + // So, we have to free it when finished + defer p.free.Call(ctx, dataPtr) + + // The pointer is a linear memory offset, which is where we write the name. + if !p.module.Memory().Write(uint32(dataPtr), data) { + return nil, fmt.Errorf("Memory.Write(%d, %d) out of range of memory size %d", dataPtr, dataSize, p.module.Memory().Size()) + } + } + + ptrSize, err := p.startcontainer.Call(ctx, dataPtr, dataSize) + if err != nil { + return nil, err + } + + resPtr := uint32(ptrSize[0] >> 32) + resSize := uint32(ptrSize[0]) + var isErrResponse bool + if (resSize & (1 << 31)) > 0 { + isErrResponse = true + resSize &^= (1 << 31) + } + + // We don't need the memory after deserialization: make sure it is freed. + if resPtr != 0 { + defer p.free.Call(ctx, uint64(resPtr)) + } + + // The pointer is a linear memory offset, which is where we write the name. + bytes, ok := p.module.Memory().Read(resPtr, resSize) + if !ok { + return nil, fmt.Errorf("Memory.Read(%d, %d) out of range of memory size %d", + resPtr, resSize, p.module.Memory().Size()) + } + + if isErrResponse { + return nil, errors.New(string(bytes)) + } + + response := new(StartContainerResponse) + if err = response.UnmarshalVT(bytes); err != nil { + return nil, err + } + + return response, nil +} +func (p *pluginPlugin) PostStartContainer(ctx context.Context, request *PostStartContainerRequest) (*PostStartContainerResponse, error) { + data, err := request.MarshalVT() + if err != nil { + return nil, err + } + dataSize := uint64(len(data)) + + var dataPtr uint64 + // If the input data is not empty, we must allocate the in-Wasm memory to store it, and pass to the plugin. + if dataSize != 0 { + results, err := p.malloc.Call(ctx, dataSize) + if err != nil { + return nil, err + } + dataPtr = results[0] + // This pointer is managed by the Wasm module, which is unaware of external usage. + // So, we have to free it when finished + defer p.free.Call(ctx, dataPtr) + + // The pointer is a linear memory offset, which is where we write the name. + if !p.module.Memory().Write(uint32(dataPtr), data) { + return nil, fmt.Errorf("Memory.Write(%d, %d) out of range of memory size %d", dataPtr, dataSize, p.module.Memory().Size()) + } + } + + ptrSize, err := p.poststartcontainer.Call(ctx, dataPtr, dataSize) + if err != nil { + return nil, err + } + + resPtr := uint32(ptrSize[0] >> 32) + resSize := uint32(ptrSize[0]) + var isErrResponse bool + if (resSize & (1 << 31)) > 0 { + isErrResponse = true + resSize &^= (1 << 31) + } + + // We don't need the memory after deserialization: make sure it is freed. + if resPtr != 0 { + defer p.free.Call(ctx, uint64(resPtr)) + } + + // The pointer is a linear memory offset, which is where we write the name. + bytes, ok := p.module.Memory().Read(resPtr, resSize) + if !ok { + return nil, fmt.Errorf("Memory.Read(%d, %d) out of range of memory size %d", + resPtr, resSize, p.module.Memory().Size()) + } + + if isErrResponse { + return nil, errors.New(string(bytes)) + } + + response := new(PostStartContainerResponse) + if err = response.UnmarshalVT(bytes); err != nil { + return nil, err + } + + return response, nil +} +func (p *pluginPlugin) UpdateContainer(ctx context.Context, request *UpdateContainerRequest) (*UpdateContainerResponse, error) { + data, err := request.MarshalVT() + if err != nil { + return nil, err + } + dataSize := uint64(len(data)) + + var dataPtr uint64 + // If the input data is not empty, we must allocate the in-Wasm memory to store it, and pass to the plugin. + if dataSize != 0 { + results, err := p.malloc.Call(ctx, dataSize) + if err != nil { + return nil, err + } + dataPtr = results[0] + // This pointer is managed by the Wasm module, which is unaware of external usage. + // So, we have to free it when finished + defer p.free.Call(ctx, dataPtr) + + // The pointer is a linear memory offset, which is where we write the name. + if !p.module.Memory().Write(uint32(dataPtr), data) { + return nil, fmt.Errorf("Memory.Write(%d, %d) out of range of memory size %d", dataPtr, dataSize, p.module.Memory().Size()) + } + } + + ptrSize, err := p.updatecontainer.Call(ctx, dataPtr, dataSize) + if err != nil { + return nil, err + } + + resPtr := uint32(ptrSize[0] >> 32) + resSize := uint32(ptrSize[0]) + var isErrResponse bool + if (resSize & (1 << 31)) > 0 { + isErrResponse = true + resSize &^= (1 << 31) + } + + // We don't need the memory after deserialization: make sure it is freed. + if resPtr != 0 { + defer p.free.Call(ctx, uint64(resPtr)) + } + + // The pointer is a linear memory offset, which is where we write the name. + bytes, ok := p.module.Memory().Read(resPtr, resSize) + if !ok { + return nil, fmt.Errorf("Memory.Read(%d, %d) out of range of memory size %d", + resPtr, resSize, p.module.Memory().Size()) + } + + if isErrResponse { + return nil, errors.New(string(bytes)) + } + + response := new(UpdateContainerResponse) + if err = response.UnmarshalVT(bytes); err != nil { + return nil, err + } + + return response, nil +} +func (p *pluginPlugin) PostUpdateContainer(ctx context.Context, request *PostUpdateContainerRequest) (*PostUpdateContainerResponse, error) { + data, err := request.MarshalVT() + if err != nil { + return nil, err + } + dataSize := uint64(len(data)) + + var dataPtr uint64 + // If the input data is not empty, we must allocate the in-Wasm memory to store it, and pass to the plugin. + if dataSize != 0 { + results, err := p.malloc.Call(ctx, dataSize) + if err != nil { + return nil, err + } + dataPtr = results[0] + // This pointer is managed by the Wasm module, which is unaware of external usage. + // So, we have to free it when finished + defer p.free.Call(ctx, dataPtr) + + // The pointer is a linear memory offset, which is where we write the name. + if !p.module.Memory().Write(uint32(dataPtr), data) { + return nil, fmt.Errorf("Memory.Write(%d, %d) out of range of memory size %d", dataPtr, dataSize, p.module.Memory().Size()) + } + } + + ptrSize, err := p.postupdatecontainer.Call(ctx, dataPtr, dataSize) + if err != nil { + return nil, err + } + + resPtr := uint32(ptrSize[0] >> 32) + resSize := uint32(ptrSize[0]) + var isErrResponse bool + if (resSize & (1 << 31)) > 0 { + isErrResponse = true + resSize &^= (1 << 31) + } + + // We don't need the memory after deserialization: make sure it is freed. + if resPtr != 0 { + defer p.free.Call(ctx, uint64(resPtr)) + } + + // The pointer is a linear memory offset, which is where we write the name. + bytes, ok := p.module.Memory().Read(resPtr, resSize) + if !ok { + return nil, fmt.Errorf("Memory.Read(%d, %d) out of range of memory size %d", + resPtr, resSize, p.module.Memory().Size()) + } + + if isErrResponse { + return nil, errors.New(string(bytes)) + } + + response := new(PostUpdateContainerResponse) + if err = response.UnmarshalVT(bytes); err != nil { + return nil, err + } + + return response, nil +} +func (p *pluginPlugin) StopContainer(ctx context.Context, request *StopContainerRequest) (*StopContainerResponse, error) { + data, err := request.MarshalVT() + if err != nil { + return nil, err + } + dataSize := uint64(len(data)) + + var dataPtr uint64 + // If the input data is not empty, we must allocate the in-Wasm memory to store it, and pass to the plugin. + if dataSize != 0 { + results, err := p.malloc.Call(ctx, dataSize) + if err != nil { + return nil, err + } + dataPtr = results[0] + // This pointer is managed by the Wasm module, which is unaware of external usage. + // So, we have to free it when finished + defer p.free.Call(ctx, dataPtr) + + // The pointer is a linear memory offset, which is where we write the name. + if !p.module.Memory().Write(uint32(dataPtr), data) { + return nil, fmt.Errorf("Memory.Write(%d, %d) out of range of memory size %d", dataPtr, dataSize, p.module.Memory().Size()) + } + } + + ptrSize, err := p.stopcontainer.Call(ctx, dataPtr, dataSize) + if err != nil { + return nil, err + } + + resPtr := uint32(ptrSize[0] >> 32) + resSize := uint32(ptrSize[0]) + var isErrResponse bool + if (resSize & (1 << 31)) > 0 { + isErrResponse = true + resSize &^= (1 << 31) + } + + // We don't need the memory after deserialization: make sure it is freed. + if resPtr != 0 { + defer p.free.Call(ctx, uint64(resPtr)) + } + + // The pointer is a linear memory offset, which is where we write the name. + bytes, ok := p.module.Memory().Read(resPtr, resSize) + if !ok { + return nil, fmt.Errorf("Memory.Read(%d, %d) out of range of memory size %d", + resPtr, resSize, p.module.Memory().Size()) + } + + if isErrResponse { + return nil, errors.New(string(bytes)) + } + + response := new(StopContainerResponse) + if err = response.UnmarshalVT(bytes); err != nil { + return nil, err + } + + return response, nil +} +func (p *pluginPlugin) RemoveContainer(ctx context.Context, request *RemoveContainerRequest) (*RemoveContainerResponse, error) { + data, err := request.MarshalVT() + if err != nil { + return nil, err + } + dataSize := uint64(len(data)) + + var dataPtr uint64 + // If the input data is not empty, we must allocate the in-Wasm memory to store it, and pass to the plugin. + if dataSize != 0 { + results, err := p.malloc.Call(ctx, dataSize) + if err != nil { + return nil, err + } + dataPtr = results[0] + // This pointer is managed by the Wasm module, which is unaware of external usage. + // So, we have to free it when finished + defer p.free.Call(ctx, dataPtr) + + // The pointer is a linear memory offset, which is where we write the name. + if !p.module.Memory().Write(uint32(dataPtr), data) { + return nil, fmt.Errorf("Memory.Write(%d, %d) out of range of memory size %d", dataPtr, dataSize, p.module.Memory().Size()) + } + } + + ptrSize, err := p.removecontainer.Call(ctx, dataPtr, dataSize) + if err != nil { + return nil, err + } + + resPtr := uint32(ptrSize[0] >> 32) + resSize := uint32(ptrSize[0]) + var isErrResponse bool + if (resSize & (1 << 31)) > 0 { + isErrResponse = true + resSize &^= (1 << 31) + } + + // We don't need the memory after deserialization: make sure it is freed. + if resPtr != 0 { + defer p.free.Call(ctx, uint64(resPtr)) + } + + // The pointer is a linear memory offset, which is where we write the name. + bytes, ok := p.module.Memory().Read(resPtr, resSize) + if !ok { + return nil, fmt.Errorf("Memory.Read(%d, %d) out of range of memory size %d", + resPtr, resSize, p.module.Memory().Size()) + } + + if isErrResponse { + return nil, errors.New(string(bytes)) + } + + response := new(RemoveContainerResponse) + if err = response.UnmarshalVT(bytes); err != nil { + return nil, err + } + + return response, nil +} +func (p *pluginPlugin) ValidateContainerAdjustment(ctx context.Context, request *ValidateContainerAdjustmentRequest) (*ValidateContainerAdjustmentResponse, error) { + data, err := request.MarshalVT() + if err != nil { + return nil, err + } + dataSize := uint64(len(data)) + + var dataPtr uint64 + // If the input data is not empty, we must allocate the in-Wasm memory to store it, and pass to the plugin. + if dataSize != 0 { + results, err := p.malloc.Call(ctx, dataSize) + if err != nil { + return nil, err + } + dataPtr = results[0] + // This pointer is managed by the Wasm module, which is unaware of external usage. + // So, we have to free it when finished + defer p.free.Call(ctx, dataPtr) + + // The pointer is a linear memory offset, which is where we write the name. + if !p.module.Memory().Write(uint32(dataPtr), data) { + return nil, fmt.Errorf("Memory.Write(%d, %d) out of range of memory size %d", dataPtr, dataSize, p.module.Memory().Size()) + } + } + + ptrSize, err := p.validatecontaineradjustment.Call(ctx, dataPtr, dataSize) + if err != nil { + return nil, err + } + + resPtr := uint32(ptrSize[0] >> 32) + resSize := uint32(ptrSize[0]) + var isErrResponse bool + if (resSize & (1 << 31)) > 0 { + isErrResponse = true + resSize &^= (1 << 31) + } + + // We don't need the memory after deserialization: make sure it is freed. + if resPtr != 0 { + defer p.free.Call(ctx, uint64(resPtr)) + } + + // The pointer is a linear memory offset, which is where we write the name. + bytes, ok := p.module.Memory().Read(resPtr, resSize) + if !ok { + return nil, fmt.Errorf("Memory.Read(%d, %d) out of range of memory size %d", + resPtr, resSize, p.module.Memory().Size()) + } + + if isErrResponse { + return nil, errors.New(string(bytes)) + } + + response := new(ValidateContainerAdjustmentResponse) + if err = response.UnmarshalVT(bytes); err != nil { + return nil, err + } + + return response, nil +} diff --git a/pkg/api/v1beta1/api_options.pb.go b/pkg/api/v1beta1/api_options.pb.go new file mode 100644 index 00000000..3f2cb0bd --- /dev/null +++ b/pkg/api/v1beta1/api_options.pb.go @@ -0,0 +1,62 @@ +//go:build !wasip1 + +// +//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. + +// Code generated by protoc-gen-go-plugin. DO NOT EDIT. +// versions: +// protoc-gen-go-plugin v0.1.0 +// protoc v3.20.1 +// source: pkg/api/v1beta1/api.proto + +package v1beta1 + +import ( + context "context" + wazero "github.com/tetratelabs/wazero" + wasi_snapshot_preview1 "github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1" +) + +type wazeroConfigOption func(plugin *WazeroConfig) + +type WazeroNewRuntime func(context.Context) (wazero.Runtime, error) + +type WazeroConfig struct { + newRuntime func(context.Context) (wazero.Runtime, error) + moduleConfig wazero.ModuleConfig +} + +func WazeroRuntime(newRuntime WazeroNewRuntime) wazeroConfigOption { + return func(h *WazeroConfig) { + h.newRuntime = newRuntime + } +} + +func DefaultWazeroRuntime() WazeroNewRuntime { + return func(ctx context.Context) (wazero.Runtime, error) { + r := wazero.NewRuntime(ctx) + if _, err := wasi_snapshot_preview1.Instantiate(ctx, r); err != nil { + return nil, err + } + + return r, nil + } +} + +func WazeroModuleConfig(moduleConfig wazero.ModuleConfig) wazeroConfigOption { + return func(h *WazeroConfig) { + h.moduleConfig = moduleConfig + } +} diff --git a/pkg/api/v1beta1/api_plugin.pb.go b/pkg/api/v1beta1/api_plugin.pb.go new file mode 100644 index 00000000..6942d122 --- /dev/null +++ b/pkg/api/v1beta1/api_plugin.pb.go @@ -0,0 +1,480 @@ +//go:build wasip1 + +// +//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. + +// Code generated by protoc-gen-go-plugin. DO NOT EDIT. +// versions: +// protoc-gen-go-plugin v0.1.0 +// protoc v3.20.1 +// source: pkg/api/v1beta1/api.proto + +package v1beta1 + +import ( + context "context" + wasm "github.com/knqyf263/go-plugin/wasm" + _ "unsafe" +) + +const PluginPluginAPIVersion = 1 + +//go:wasmexport plugin_api_version +func _plugin_api_version() uint64 { + return PluginPluginAPIVersion +} + +var plugin Plugin + +func RegisterPlugin(p Plugin) { + plugin = p +} + +//go:wasmexport plugin_configure +func _plugin_configure(ptr, size uint32) uint64 { + b := wasm.PtrToByte(ptr, size) + req := new(ConfigureRequest) + if err := req.UnmarshalVT(b); err != nil { + return 0 + } + response, err := plugin.Configure(context.Background(), req) + if err != nil { + ptr, size = wasm.ByteToPtr([]byte(err.Error())) + return (uint64(ptr) << uint64(32)) | uint64(size) | + // Indicate that this is the error string by setting the 32-th bit, assuming that + // no data exceeds 31-bit size (2 GiB). + (1 << 31) + } + + b, err = response.MarshalVT() + if err != nil { + return 0 + } + ptr, size = wasm.ByteToPtr(b) + return (uint64(ptr) << uint64(32)) | uint64(size) +} + +//go:wasmexport plugin_synchronize +func _plugin_synchronize(ptr, size uint32) uint64 { + b := wasm.PtrToByte(ptr, size) + req := new(SynchronizeRequest) + if err := req.UnmarshalVT(b); err != nil { + return 0 + } + response, err := plugin.Synchronize(context.Background(), req) + if err != nil { + ptr, size = wasm.ByteToPtr([]byte(err.Error())) + return (uint64(ptr) << uint64(32)) | uint64(size) | + // Indicate that this is the error string by setting the 32-th bit, assuming that + // no data exceeds 31-bit size (2 GiB). + (1 << 31) + } + + b, err = response.MarshalVT() + if err != nil { + return 0 + } + ptr, size = wasm.ByteToPtr(b) + return (uint64(ptr) << uint64(32)) | uint64(size) +} + +//go:wasmexport plugin_shutdown +func _plugin_shutdown(ptr, size uint32) uint64 { + b := wasm.PtrToByte(ptr, size) + req := new(ShutdownRequest) + if err := req.UnmarshalVT(b); err != nil { + return 0 + } + response, err := plugin.Shutdown(context.Background(), req) + if err != nil { + ptr, size = wasm.ByteToPtr([]byte(err.Error())) + return (uint64(ptr) << uint64(32)) | uint64(size) | + // Indicate that this is the error string by setting the 32-th bit, assuming that + // no data exceeds 31-bit size (2 GiB). + (1 << 31) + } + + b, err = response.MarshalVT() + if err != nil { + return 0 + } + ptr, size = wasm.ByteToPtr(b) + return (uint64(ptr) << uint64(32)) | uint64(size) +} + +//go:wasmexport plugin_run_pod_sandbox +func _plugin_run_pod_sandbox(ptr, size uint32) uint64 { + b := wasm.PtrToByte(ptr, size) + req := new(RunPodSandboxRequest) + if err := req.UnmarshalVT(b); err != nil { + return 0 + } + response, err := plugin.RunPodSandbox(context.Background(), req) + if err != nil { + ptr, size = wasm.ByteToPtr([]byte(err.Error())) + return (uint64(ptr) << uint64(32)) | uint64(size) | + // Indicate that this is the error string by setting the 32-th bit, assuming that + // no data exceeds 31-bit size (2 GiB). + (1 << 31) + } + + b, err = response.MarshalVT() + if err != nil { + return 0 + } + ptr, size = wasm.ByteToPtr(b) + return (uint64(ptr) << uint64(32)) | uint64(size) +} + +//go:wasmexport plugin_update_pod_sandbox +func _plugin_update_pod_sandbox(ptr, size uint32) uint64 { + b := wasm.PtrToByte(ptr, size) + req := new(UpdatePodSandboxRequest) + if err := req.UnmarshalVT(b); err != nil { + return 0 + } + response, err := plugin.UpdatePodSandbox(context.Background(), req) + if err != nil { + ptr, size = wasm.ByteToPtr([]byte(err.Error())) + return (uint64(ptr) << uint64(32)) | uint64(size) | + // Indicate that this is the error string by setting the 32-th bit, assuming that + // no data exceeds 31-bit size (2 GiB). + (1 << 31) + } + + b, err = response.MarshalVT() + if err != nil { + return 0 + } + ptr, size = wasm.ByteToPtr(b) + return (uint64(ptr) << uint64(32)) | uint64(size) +} + +//go:wasmexport plugin_post_update_pod_sandbox +func _plugin_post_update_pod_sandbox(ptr, size uint32) uint64 { + b := wasm.PtrToByte(ptr, size) + req := new(PostUpdatePodSandboxRequest) + if err := req.UnmarshalVT(b); err != nil { + return 0 + } + response, err := plugin.PostUpdatePodSandbox(context.Background(), req) + if err != nil { + ptr, size = wasm.ByteToPtr([]byte(err.Error())) + return (uint64(ptr) << uint64(32)) | uint64(size) | + // Indicate that this is the error string by setting the 32-th bit, assuming that + // no data exceeds 31-bit size (2 GiB). + (1 << 31) + } + + b, err = response.MarshalVT() + if err != nil { + return 0 + } + ptr, size = wasm.ByteToPtr(b) + return (uint64(ptr) << uint64(32)) | uint64(size) +} + +//go:wasmexport plugin_stop_pod_sandbox +func _plugin_stop_pod_sandbox(ptr, size uint32) uint64 { + b := wasm.PtrToByte(ptr, size) + req := new(StopPodSandboxRequest) + if err := req.UnmarshalVT(b); err != nil { + return 0 + } + response, err := plugin.StopPodSandbox(context.Background(), req) + if err != nil { + ptr, size = wasm.ByteToPtr([]byte(err.Error())) + return (uint64(ptr) << uint64(32)) | uint64(size) | + // Indicate that this is the error string by setting the 32-th bit, assuming that + // no data exceeds 31-bit size (2 GiB). + (1 << 31) + } + + b, err = response.MarshalVT() + if err != nil { + return 0 + } + ptr, size = wasm.ByteToPtr(b) + return (uint64(ptr) << uint64(32)) | uint64(size) +} + +//go:wasmexport plugin_remove_pod_sandbox +func _plugin_remove_pod_sandbox(ptr, size uint32) uint64 { + b := wasm.PtrToByte(ptr, size) + req := new(RemovePodSandboxRequest) + if err := req.UnmarshalVT(b); err != nil { + return 0 + } + response, err := plugin.RemovePodSandbox(context.Background(), req) + if err != nil { + ptr, size = wasm.ByteToPtr([]byte(err.Error())) + return (uint64(ptr) << uint64(32)) | uint64(size) | + // Indicate that this is the error string by setting the 32-th bit, assuming that + // no data exceeds 31-bit size (2 GiB). + (1 << 31) + } + + b, err = response.MarshalVT() + if err != nil { + return 0 + } + ptr, size = wasm.ByteToPtr(b) + return (uint64(ptr) << uint64(32)) | uint64(size) +} + +//go:wasmexport plugin_create_container +func _plugin_create_container(ptr, size uint32) uint64 { + b := wasm.PtrToByte(ptr, size) + req := new(CreateContainerRequest) + if err := req.UnmarshalVT(b); err != nil { + return 0 + } + response, err := plugin.CreateContainer(context.Background(), req) + if err != nil { + ptr, size = wasm.ByteToPtr([]byte(err.Error())) + return (uint64(ptr) << uint64(32)) | uint64(size) | + // Indicate that this is the error string by setting the 32-th bit, assuming that + // no data exceeds 31-bit size (2 GiB). + (1 << 31) + } + + b, err = response.MarshalVT() + if err != nil { + return 0 + } + ptr, size = wasm.ByteToPtr(b) + return (uint64(ptr) << uint64(32)) | uint64(size) +} + +//go:wasmexport plugin_post_create_container +func _plugin_post_create_container(ptr, size uint32) uint64 { + b := wasm.PtrToByte(ptr, size) + req := new(PostCreateContainerRequest) + if err := req.UnmarshalVT(b); err != nil { + return 0 + } + response, err := plugin.PostCreateContainer(context.Background(), req) + if err != nil { + ptr, size = wasm.ByteToPtr([]byte(err.Error())) + return (uint64(ptr) << uint64(32)) | uint64(size) | + // Indicate that this is the error string by setting the 32-th bit, assuming that + // no data exceeds 31-bit size (2 GiB). + (1 << 31) + } + + b, err = response.MarshalVT() + if err != nil { + return 0 + } + ptr, size = wasm.ByteToPtr(b) + return (uint64(ptr) << uint64(32)) | uint64(size) +} + +//go:wasmexport plugin_start_container +func _plugin_start_container(ptr, size uint32) uint64 { + b := wasm.PtrToByte(ptr, size) + req := new(StartContainerRequest) + if err := req.UnmarshalVT(b); err != nil { + return 0 + } + response, err := plugin.StartContainer(context.Background(), req) + if err != nil { + ptr, size = wasm.ByteToPtr([]byte(err.Error())) + return (uint64(ptr) << uint64(32)) | uint64(size) | + // Indicate that this is the error string by setting the 32-th bit, assuming that + // no data exceeds 31-bit size (2 GiB). + (1 << 31) + } + + b, err = response.MarshalVT() + if err != nil { + return 0 + } + ptr, size = wasm.ByteToPtr(b) + return (uint64(ptr) << uint64(32)) | uint64(size) +} + +//go:wasmexport plugin_post_start_container +func _plugin_post_start_container(ptr, size uint32) uint64 { + b := wasm.PtrToByte(ptr, size) + req := new(PostStartContainerRequest) + if err := req.UnmarshalVT(b); err != nil { + return 0 + } + response, err := plugin.PostStartContainer(context.Background(), req) + if err != nil { + ptr, size = wasm.ByteToPtr([]byte(err.Error())) + return (uint64(ptr) << uint64(32)) | uint64(size) | + // Indicate that this is the error string by setting the 32-th bit, assuming that + // no data exceeds 31-bit size (2 GiB). + (1 << 31) + } + + b, err = response.MarshalVT() + if err != nil { + return 0 + } + ptr, size = wasm.ByteToPtr(b) + return (uint64(ptr) << uint64(32)) | uint64(size) +} + +//go:wasmexport plugin_update_container +func _plugin_update_container(ptr, size uint32) uint64 { + b := wasm.PtrToByte(ptr, size) + req := new(UpdateContainerRequest) + if err := req.UnmarshalVT(b); err != nil { + return 0 + } + response, err := plugin.UpdateContainer(context.Background(), req) + if err != nil { + ptr, size = wasm.ByteToPtr([]byte(err.Error())) + return (uint64(ptr) << uint64(32)) | uint64(size) | + // Indicate that this is the error string by setting the 32-th bit, assuming that + // no data exceeds 31-bit size (2 GiB). + (1 << 31) + } + + b, err = response.MarshalVT() + if err != nil { + return 0 + } + ptr, size = wasm.ByteToPtr(b) + return (uint64(ptr) << uint64(32)) | uint64(size) +} + +//go:wasmexport plugin_post_update_container +func _plugin_post_update_container(ptr, size uint32) uint64 { + b := wasm.PtrToByte(ptr, size) + req := new(PostUpdateContainerRequest) + if err := req.UnmarshalVT(b); err != nil { + return 0 + } + response, err := plugin.PostUpdateContainer(context.Background(), req) + if err != nil { + ptr, size = wasm.ByteToPtr([]byte(err.Error())) + return (uint64(ptr) << uint64(32)) | uint64(size) | + // Indicate that this is the error string by setting the 32-th bit, assuming that + // no data exceeds 31-bit size (2 GiB). + (1 << 31) + } + + b, err = response.MarshalVT() + if err != nil { + return 0 + } + ptr, size = wasm.ByteToPtr(b) + return (uint64(ptr) << uint64(32)) | uint64(size) +} + +//go:wasmexport plugin_stop_container +func _plugin_stop_container(ptr, size uint32) uint64 { + b := wasm.PtrToByte(ptr, size) + req := new(StopContainerRequest) + if err := req.UnmarshalVT(b); err != nil { + return 0 + } + response, err := plugin.StopContainer(context.Background(), req) + if err != nil { + ptr, size = wasm.ByteToPtr([]byte(err.Error())) + return (uint64(ptr) << uint64(32)) | uint64(size) | + // Indicate that this is the error string by setting the 32-th bit, assuming that + // no data exceeds 31-bit size (2 GiB). + (1 << 31) + } + + b, err = response.MarshalVT() + if err != nil { + return 0 + } + ptr, size = wasm.ByteToPtr(b) + return (uint64(ptr) << uint64(32)) | uint64(size) +} + +//go:wasmexport plugin_remove_container +func _plugin_remove_container(ptr, size uint32) uint64 { + b := wasm.PtrToByte(ptr, size) + req := new(RemoveContainerRequest) + if err := req.UnmarshalVT(b); err != nil { + return 0 + } + response, err := plugin.RemoveContainer(context.Background(), req) + if err != nil { + ptr, size = wasm.ByteToPtr([]byte(err.Error())) + return (uint64(ptr) << uint64(32)) | uint64(size) | + // Indicate that this is the error string by setting the 32-th bit, assuming that + // no data exceeds 31-bit size (2 GiB). + (1 << 31) + } + + b, err = response.MarshalVT() + if err != nil { + return 0 + } + ptr, size = wasm.ByteToPtr(b) + return (uint64(ptr) << uint64(32)) | uint64(size) +} + +//go:wasmexport plugin_validate_container_adjustment +func _plugin_validate_container_adjustment(ptr, size uint32) uint64 { + b := wasm.PtrToByte(ptr, size) + req := new(ValidateContainerAdjustmentRequest) + if err := req.UnmarshalVT(b); err != nil { + return 0 + } + response, err := plugin.ValidateContainerAdjustment(context.Background(), req) + if err != nil { + ptr, size = wasm.ByteToPtr([]byte(err.Error())) + return (uint64(ptr) << uint64(32)) | uint64(size) | + // Indicate that this is the error string by setting the 32-th bit, assuming that + // no data exceeds 31-bit size (2 GiB). + (1 << 31) + } + + b, err = response.MarshalVT() + if err != nil { + return 0 + } + ptr, size = wasm.ByteToPtr(b) + return (uint64(ptr) << uint64(32)) | uint64(size) +} + +type hostFunctions struct{} + +func NewHostFunctions() HostFunctions { + return hostFunctions{} +} + +//go:wasmimport env log +func _log(ptr uint32, size uint32) uint64 + +func (h hostFunctions) Log(ctx context.Context, request *LogRequest) (*LogResponse, error) { + buf, err := request.MarshalVT() + if err != nil { + return nil, err + } + ptr, size := wasm.ByteToPtr(buf) + ptrSize := _log(ptr, size) + wasm.Free(ptr) + + ptr = uint32(ptrSize >> 32) + size = uint32(ptrSize) + buf = wasm.PtrToByte(ptr, size) + + response := new(LogResponse) + if err = response.UnmarshalVT(buf); err != nil { + return nil, err + } + return response, nil +} diff --git a/pkg/api/v1beta1/api_service.pb.go b/pkg/api/v1beta1/api_service.pb.go new file mode 100644 index 00000000..551f0ab9 --- /dev/null +++ b/pkg/api/v1beta1/api_service.pb.go @@ -0,0 +1,108 @@ +// +//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. + +// Code generated by protoc-gen-go-plugin. DO NOT EDIT. +// versions: +// protoc-gen-go-plugin v0.1.0 +// protoc v3.20.1 +// source: pkg/api/v1beta1/api.proto + +package v1beta1 + +import ( + context "context" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +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) +) + +// Plugin is the API NRI uses to interact with plugins. It is used to +// - configure a plugin and subscribe it for lifecycle events +// - synchronize the state of a plugin with that of the runtime +// - hook a plugin into the lifecycle events of its interest +// +// During configuration the plugin tells the runtime which lifecycle events +// it wishes to get hooked into. Once configured, the plugin is synchronized +// with the runtime by receiving the list of pods and containers known to +// the runtime. The plugin can request changes to any of the containers in +// response. After initial synchronization the plugin starts receiving the +// events it subscribed for as they occur in the runtime. For container +// creation, update, and stop events, the plugin can request changes, both +// to the container that triggered the event or any other existing container +// in the runtime. +// +// For a subset of the container lifecycle events, NRI defines an additional +// Post-variant of the event. These variants are defined for CreateContainer, +// StartContainer, and UpdateContainer. For creation and update, these events +// can be used by plugins to discover the full extent of changes applied to +// the container, including any changes made by other active plugins. +// +// go:plugin type=plugin version=1 +type Plugin interface { + // Configure the plugin and get its event subscription. + Configure(context.Context, *ConfigureRequest) (*ConfigureResponse, error) + // Synchronize the plugin with the state of the runtime. + Synchronize(context.Context, *SynchronizeRequest) (*SynchronizeResponse, error) + // Shutdown a plugin (let it know the runtime is going down). + Shutdown(context.Context, *ShutdownRequest) (*ShutdownResponse, error) + // RunPodSandbox relays the corresponding request to the plugin. + RunPodSandbox(context.Context, *RunPodSandboxRequest) (*RunPodSandboxResponse, error) + // UpdatePodSandbox relays the corresponding request to the plugin. + UpdatePodSandbox(context.Context, *UpdatePodSandboxRequest) (*UpdatePodSandboxResponse, error) + // PostUpdatePodSandbox relays the corresponding request to the plugin. + PostUpdatePodSandbox(context.Context, *PostUpdatePodSandboxRequest) (*PostUpdatePodSandboxResponse, error) + // StopPodSandbox relays the corresponding request to the plugin. + StopPodSandbox(context.Context, *StopPodSandboxRequest) (*StopPodSandboxResponse, error) + // RemovePodSandbox relays the corresponding request to the plugin. + RemovePodSandbox(context.Context, *RemovePodSandboxRequest) (*RemovePodSandboxResponse, error) + // CreateContainer relays the corresponding request to the plugin. In + // response, the plugin can adjust the container being created, and + // update other containers in the runtime. Container adjustment can + // alter labels, annotations, mounts, devices, environment variables, + // OCI hooks, and assigned container resources. Updates can alter + // assigned container resources. + CreateContainer(context.Context, *CreateContainerRequest) (*CreateContainerResponse, error) + // PostCreateContainer relays the corresponding request to the plugin. + PostCreateContainer(context.Context, *PostCreateContainerRequest) (*PostCreateContainerResponse, error) + // StartContainer relays the corresponding request to the plugin. + StartContainer(context.Context, *StartContainerRequest) (*StartContainerResponse, error) + // PostStartContainer relays the corresponding request to the plugin. + PostStartContainer(context.Context, *PostStartContainerRequest) (*PostStartContainerResponse, error) + // UpdateContainer relays the corresponding request to the plugin. + // The plugin can alter how the container is updated and request updates + // to additional containers in the runtime. + UpdateContainer(context.Context, *UpdateContainerRequest) (*UpdateContainerResponse, error) + // PostUpdateContainer relays the corresponding request to the plugin. + PostUpdateContainer(context.Context, *PostUpdateContainerRequest) (*PostUpdateContainerResponse, error) + // StopContainer relays the corresponding request to the plugin. The plugin + // can update any of the remaining containers in the runtime in response. + StopContainer(context.Context, *StopContainerRequest) (*StopContainerResponse, error) + // RemoveContainer relays the corresponding request to the plugin. + RemoveContainer(context.Context, *RemoveContainerRequest) (*RemoveContainerResponse, error) + // ValidateContainerAdjustment relays a container adjustment validation request + // to the plugin. Container creation will fail the plugin rejects the adjustments. + ValidateContainerAdjustment(context.Context, *ValidateContainerAdjustmentRequest) (*ValidateContainerAdjustmentResponse, error) +} + +// go:plugin type=host +type HostFunctions interface { + // Log displays a log message + Log(context.Context, *LogRequest) (*LogResponse, error) +} diff --git a/pkg/api/v1beta1/api_ttrpc.pb.go b/pkg/api/v1beta1/api_ttrpc.pb.go new file mode 100644 index 00000000..681e1cdf --- /dev/null +++ b/pkg/api/v1beta1/api_ttrpc.pb.go @@ -0,0 +1,390 @@ +//go:build !wasip1 + +// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT. +// source: pkg/api/v1beta1/api.proto +package v1beta1 + +import ( + context "context" + ttrpc "github.com/containerd/ttrpc" +) + +type RuntimeService interface { + RegisterPlugin(context.Context, *RegisterPluginRequest) (*RegisterPluginResponse, error) + UpdateContainers(context.Context, *UpdateContainersRequest) (*UpdateContainersResponse, error) +} + +func RegisterRuntimeService(srv *ttrpc.Server, svc RuntimeService) { + srv.RegisterService("nri.pkg.api.v1beta1.Runtime", &ttrpc.ServiceDesc{ + Methods: map[string]ttrpc.Method{ + "RegisterPlugin": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req RegisterPluginRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.RegisterPlugin(ctx, &req) + }, + "UpdateContainers": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req UpdateContainersRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.UpdateContainers(ctx, &req) + }, + }, + }) +} + +type runtimeClient struct { + client *ttrpc.Client +} + +func NewRuntimeClient(client *ttrpc.Client) RuntimeService { + return &runtimeClient{ + client: client, + } +} + +func (c *runtimeClient) RegisterPlugin(ctx context.Context, req *RegisterPluginRequest) (*RegisterPluginResponse, error) { + var resp RegisterPluginResponse + if err := c.client.Call(ctx, "nri.pkg.api.v1beta1.Runtime", "RegisterPlugin", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *runtimeClient) UpdateContainers(ctx context.Context, req *UpdateContainersRequest) (*UpdateContainersResponse, error) { + var resp UpdateContainersResponse + if err := c.client.Call(ctx, "nri.pkg.api.v1beta1.Runtime", "UpdateContainers", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +type PluginService interface { + Configure(context.Context, *ConfigureRequest) (*ConfigureResponse, error) + Synchronize(context.Context, *SynchronizeRequest) (*SynchronizeResponse, error) + Shutdown(context.Context, *ShutdownRequest) (*ShutdownResponse, error) + RunPodSandbox(context.Context, *RunPodSandboxRequest) (*RunPodSandboxResponse, error) + UpdatePodSandbox(context.Context, *UpdatePodSandboxRequest) (*UpdatePodSandboxResponse, error) + PostUpdatePodSandbox(context.Context, *PostUpdatePodSandboxRequest) (*PostUpdatePodSandboxResponse, error) + StopPodSandbox(context.Context, *StopPodSandboxRequest) (*StopPodSandboxResponse, error) + RemovePodSandbox(context.Context, *RemovePodSandboxRequest) (*RemovePodSandboxResponse, error) + CreateContainer(context.Context, *CreateContainerRequest) (*CreateContainerResponse, error) + PostCreateContainer(context.Context, *PostCreateContainerRequest) (*PostCreateContainerResponse, error) + StartContainer(context.Context, *StartContainerRequest) (*StartContainerResponse, error) + PostStartContainer(context.Context, *PostStartContainerRequest) (*PostStartContainerResponse, error) + UpdateContainer(context.Context, *UpdateContainerRequest) (*UpdateContainerResponse, error) + PostUpdateContainer(context.Context, *PostUpdateContainerRequest) (*PostUpdateContainerResponse, error) + StopContainer(context.Context, *StopContainerRequest) (*StopContainerResponse, error) + RemoveContainer(context.Context, *RemoveContainerRequest) (*RemoveContainerResponse, error) + ValidateContainerAdjustment(context.Context, *ValidateContainerAdjustmentRequest) (*ValidateContainerAdjustmentResponse, error) +} + +func RegisterPluginService(srv *ttrpc.Server, svc PluginService) { + srv.RegisterService("nri.pkg.api.v1beta1.Plugin", &ttrpc.ServiceDesc{ + Methods: map[string]ttrpc.Method{ + "Configure": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req ConfigureRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.Configure(ctx, &req) + }, + "Synchronize": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req SynchronizeRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.Synchronize(ctx, &req) + }, + "Shutdown": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req ShutdownRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.Shutdown(ctx, &req) + }, + "RunPodSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req RunPodSandboxRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.RunPodSandbox(ctx, &req) + }, + "UpdatePodSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req UpdatePodSandboxRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.UpdatePodSandbox(ctx, &req) + }, + "PostUpdatePodSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req PostUpdatePodSandboxRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.PostUpdatePodSandbox(ctx, &req) + }, + "StopPodSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req StopPodSandboxRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.StopPodSandbox(ctx, &req) + }, + "RemovePodSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req RemovePodSandboxRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.RemovePodSandbox(ctx, &req) + }, + "CreateContainer": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req CreateContainerRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.CreateContainer(ctx, &req) + }, + "PostCreateContainer": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req PostCreateContainerRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.PostCreateContainer(ctx, &req) + }, + "StartContainer": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req StartContainerRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.StartContainer(ctx, &req) + }, + "PostStartContainer": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req PostStartContainerRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.PostStartContainer(ctx, &req) + }, + "UpdateContainer": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req UpdateContainerRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.UpdateContainer(ctx, &req) + }, + "PostUpdateContainer": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req PostUpdateContainerRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.PostUpdateContainer(ctx, &req) + }, + "StopContainer": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req StopContainerRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.StopContainer(ctx, &req) + }, + "RemoveContainer": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req RemoveContainerRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.RemoveContainer(ctx, &req) + }, + "ValidateContainerAdjustment": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req ValidateContainerAdjustmentRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.ValidateContainerAdjustment(ctx, &req) + }, + }, + }) +} + +type pluginClient struct { + client *ttrpc.Client +} + +func NewPluginClient(client *ttrpc.Client) PluginService { + return &pluginClient{ + client: client, + } +} + +func (c *pluginClient) Configure(ctx context.Context, req *ConfigureRequest) (*ConfigureResponse, error) { + var resp ConfigureResponse + if err := c.client.Call(ctx, "nri.pkg.api.v1beta1.Plugin", "Configure", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *pluginClient) Synchronize(ctx context.Context, req *SynchronizeRequest) (*SynchronizeResponse, error) { + var resp SynchronizeResponse + if err := c.client.Call(ctx, "nri.pkg.api.v1beta1.Plugin", "Synchronize", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *pluginClient) Shutdown(ctx context.Context, req *ShutdownRequest) (*ShutdownResponse, error) { + var resp ShutdownResponse + if err := c.client.Call(ctx, "nri.pkg.api.v1beta1.Plugin", "Shutdown", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *pluginClient) RunPodSandbox(ctx context.Context, req *RunPodSandboxRequest) (*RunPodSandboxResponse, error) { + var resp RunPodSandboxResponse + if err := c.client.Call(ctx, "nri.pkg.api.v1beta1.Plugin", "RunPodSandbox", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *pluginClient) UpdatePodSandbox(ctx context.Context, req *UpdatePodSandboxRequest) (*UpdatePodSandboxResponse, error) { + var resp UpdatePodSandboxResponse + if err := c.client.Call(ctx, "nri.pkg.api.v1beta1.Plugin", "UpdatePodSandbox", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *pluginClient) PostUpdatePodSandbox(ctx context.Context, req *PostUpdatePodSandboxRequest) (*PostUpdatePodSandboxResponse, error) { + var resp PostUpdatePodSandboxResponse + if err := c.client.Call(ctx, "nri.pkg.api.v1beta1.Plugin", "PostUpdatePodSandbox", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *pluginClient) StopPodSandbox(ctx context.Context, req *StopPodSandboxRequest) (*StopPodSandboxResponse, error) { + var resp StopPodSandboxResponse + if err := c.client.Call(ctx, "nri.pkg.api.v1beta1.Plugin", "StopPodSandbox", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *pluginClient) RemovePodSandbox(ctx context.Context, req *RemovePodSandboxRequest) (*RemovePodSandboxResponse, error) { + var resp RemovePodSandboxResponse + if err := c.client.Call(ctx, "nri.pkg.api.v1beta1.Plugin", "RemovePodSandbox", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *pluginClient) CreateContainer(ctx context.Context, req *CreateContainerRequest) (*CreateContainerResponse, error) { + var resp CreateContainerResponse + if err := c.client.Call(ctx, "nri.pkg.api.v1beta1.Plugin", "CreateContainer", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *pluginClient) PostCreateContainer(ctx context.Context, req *PostCreateContainerRequest) (*PostCreateContainerResponse, error) { + var resp PostCreateContainerResponse + if err := c.client.Call(ctx, "nri.pkg.api.v1beta1.Plugin", "PostCreateContainer", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *pluginClient) StartContainer(ctx context.Context, req *StartContainerRequest) (*StartContainerResponse, error) { + var resp StartContainerResponse + if err := c.client.Call(ctx, "nri.pkg.api.v1beta1.Plugin", "StartContainer", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *pluginClient) PostStartContainer(ctx context.Context, req *PostStartContainerRequest) (*PostStartContainerResponse, error) { + var resp PostStartContainerResponse + if err := c.client.Call(ctx, "nri.pkg.api.v1beta1.Plugin", "PostStartContainer", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *pluginClient) UpdateContainer(ctx context.Context, req *UpdateContainerRequest) (*UpdateContainerResponse, error) { + var resp UpdateContainerResponse + if err := c.client.Call(ctx, "nri.pkg.api.v1beta1.Plugin", "UpdateContainer", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *pluginClient) PostUpdateContainer(ctx context.Context, req *PostUpdateContainerRequest) (*PostUpdateContainerResponse, error) { + var resp PostUpdateContainerResponse + if err := c.client.Call(ctx, "nri.pkg.api.v1beta1.Plugin", "PostUpdateContainer", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *pluginClient) StopContainer(ctx context.Context, req *StopContainerRequest) (*StopContainerResponse, error) { + var resp StopContainerResponse + if err := c.client.Call(ctx, "nri.pkg.api.v1beta1.Plugin", "StopContainer", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *pluginClient) RemoveContainer(ctx context.Context, req *RemoveContainerRequest) (*RemoveContainerResponse, error) { + var resp RemoveContainerResponse + if err := c.client.Call(ctx, "nri.pkg.api.v1beta1.Plugin", "RemoveContainer", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *pluginClient) ValidateContainerAdjustment(ctx context.Context, req *ValidateContainerAdjustmentRequest) (*ValidateContainerAdjustmentResponse, error) { + var resp ValidateContainerAdjustmentResponse + if err := c.client.Call(ctx, "nri.pkg.api.v1beta1.Plugin", "ValidateContainerAdjustment", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +type HostFunctionsService interface { + Log(context.Context, *LogRequest) (*LogResponse, error) +} + +func RegisterHostFunctionsService(srv *ttrpc.Server, svc HostFunctionsService) { + srv.RegisterService("nri.pkg.api.v1beta1.HostFunctions", &ttrpc.ServiceDesc{ + Methods: map[string]ttrpc.Method{ + "Log": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req LogRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.Log(ctx, &req) + }, + }, + }) +} + +type hostfunctionsClient struct { + client *ttrpc.Client +} + +func NewHostFunctionsClient(client *ttrpc.Client) HostFunctionsService { + return &hostfunctionsClient{ + client: client, + } +} + +func (c *hostfunctionsClient) Log(ctx context.Context, req *LogRequest) (*LogResponse, error) { + var resp LogResponse + if err := c.client.Call(ctx, "nri.pkg.api.v1beta1.HostFunctions", "Log", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} diff --git a/pkg/api/v1beta1/api_vtproto.pb.go b/pkg/api/v1beta1/api_vtproto.pb.go new file mode 100644 index 00000000..28d56a2e --- /dev/null +++ b/pkg/api/v1beta1/api_vtproto.pb.go @@ -0,0 +1,18664 @@ +// +//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. + +// Code generated by protoc-gen-go-plugin. DO NOT EDIT. +// versions: +// protoc-gen-go-plugin v0.1.0 +// protoc v3.20.1 +// source: pkg/api/v1beta1/api.proto + +package v1beta1 + +import ( + fmt "fmt" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + io "io" + bits "math/bits" +) + +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) +) + +func (m *RegisterPluginRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RegisterPluginRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *RegisterPluginRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.PluginIdx) > 0 { + i -= len(m.PluginIdx) + copy(dAtA[i:], m.PluginIdx) + i = encodeVarint(dAtA, i, uint64(len(m.PluginIdx))) + i-- + dAtA[i] = 0x12 + } + if len(m.PluginName) > 0 { + i -= len(m.PluginName) + copy(dAtA[i:], m.PluginName) + i = encodeVarint(dAtA, i, uint64(len(m.PluginName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RegisterPluginResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RegisterPluginResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *RegisterPluginResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + return len(dAtA) - i, nil +} + +func (m *UpdateContainersRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UpdateContainersRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UpdateContainersRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Evict) > 0 { + for iNdEx := len(m.Evict) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Evict[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Update) > 0 { + for iNdEx := len(m.Update) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Update[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *UpdateContainersResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UpdateContainersResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UpdateContainersResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Failed) > 0 { + for iNdEx := len(m.Failed) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Failed[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *LogRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LogRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LogRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Level != 0 { + i = encodeVarint(dAtA, i, uint64(m.Level)) + i-- + dAtA[i] = 0x10 + } + if len(m.Msg) > 0 { + i -= len(m.Msg) + copy(dAtA[i:], m.Msg) + i = encodeVarint(dAtA, i, uint64(len(m.Msg))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LogResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LogResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LogResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + return len(dAtA) - i, nil +} + +func (m *ConfigureRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ConfigureRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ConfigureRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.RequestTimeout != 0 { + i = encodeVarint(dAtA, i, uint64(m.RequestTimeout)) + i-- + dAtA[i] = 0x28 + } + if m.RegistrationTimeout != 0 { + i = encodeVarint(dAtA, i, uint64(m.RegistrationTimeout)) + i-- + dAtA[i] = 0x20 + } + if len(m.RuntimeVersion) > 0 { + i -= len(m.RuntimeVersion) + copy(dAtA[i:], m.RuntimeVersion) + i = encodeVarint(dAtA, i, uint64(len(m.RuntimeVersion))) + i-- + dAtA[i] = 0x1a + } + if len(m.RuntimeName) > 0 { + i -= len(m.RuntimeName) + copy(dAtA[i:], m.RuntimeName) + i = encodeVarint(dAtA, i, uint64(len(m.RuntimeName))) + i-- + dAtA[i] = 0x12 + } + if len(m.Config) > 0 { + i -= len(m.Config) + copy(dAtA[i:], m.Config) + i = encodeVarint(dAtA, i, uint64(len(m.Config))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ConfigureResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ConfigureResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ConfigureResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Events != 0 { + i = encodeVarint(dAtA, i, uint64(m.Events)) + i-- + dAtA[i] = 0x10 + } + return len(dAtA) - i, nil +} + +func (m *SynchronizeRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SynchronizeRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *SynchronizeRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.More { + i-- + if m.More { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if len(m.Containers) > 0 { + for iNdEx := len(m.Containers) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Containers[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Pods) > 0 { + for iNdEx := len(m.Pods) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Pods[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *SynchronizeResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SynchronizeResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *SynchronizeResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.More { + i-- + if m.More { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.Update) > 0 { + for iNdEx := len(m.Update) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Update[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *ShutdownRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ShutdownRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ShutdownRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Reason) > 0 { + i -= len(m.Reason) + copy(dAtA[i:], m.Reason) + i = encodeVarint(dAtA, i, uint64(len(m.Reason))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ShutdownResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ShutdownResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ShutdownResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + return len(dAtA) - i, nil +} + +func (m *RunPodSandboxRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RunPodSandboxRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *RunPodSandboxRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Pod != nil { + size, err := m.Pod.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RunPodSandboxResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RunPodSandboxResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *RunPodSandboxResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + return len(dAtA) - i, nil +} + +func (m *UpdatePodSandboxRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UpdatePodSandboxRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UpdatePodSandboxRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.LinuxResources != nil { + size, err := m.LinuxResources.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + if m.OverheadLinuxResources != nil { + size, err := m.OverheadLinuxResources.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.Pod != nil { + size, err := m.Pod.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UpdatePodSandboxResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UpdatePodSandboxResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UpdatePodSandboxResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + return len(dAtA) - i, nil +} + +func (m *PostUpdatePodSandboxRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PostUpdatePodSandboxRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *PostUpdatePodSandboxRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Pod != nil { + size, err := m.Pod.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PostUpdatePodSandboxResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PostUpdatePodSandboxResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *PostUpdatePodSandboxResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + return len(dAtA) - i, nil +} + +func (m *StopPodSandboxRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StopPodSandboxRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *StopPodSandboxRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Pod != nil { + size, err := m.Pod.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *StopPodSandboxResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StopPodSandboxResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *StopPodSandboxResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + return len(dAtA) - i, nil +} + +func (m *RemovePodSandboxRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RemovePodSandboxRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *RemovePodSandboxRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Pod != nil { + size, err := m.Pod.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RemovePodSandboxResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RemovePodSandboxResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *RemovePodSandboxResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + return len(dAtA) - i, nil +} + +func (m *CreateContainerRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CreateContainerRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *CreateContainerRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Container != nil { + size, err := m.Container.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.Pod != nil { + size, err := m.Pod.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CreateContainerResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CreateContainerResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *CreateContainerResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Evict) > 0 { + for iNdEx := len(m.Evict) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Evict[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + } + if len(m.Update) > 0 { + for iNdEx := len(m.Update) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Update[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + } + if m.Adjust != nil { + size, err := m.Adjust.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PostCreateContainerRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PostCreateContainerRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *PostCreateContainerRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Container != nil { + size, err := m.Container.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.Pod != nil { + size, err := m.Pod.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PostCreateContainerResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PostCreateContainerResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *PostCreateContainerResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + return len(dAtA) - i, nil +} + +func (m *StartContainerRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StartContainerRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *StartContainerRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Container != nil { + size, err := m.Container.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.Pod != nil { + size, err := m.Pod.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *StartContainerResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StartContainerResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *StartContainerResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + return len(dAtA) - i, nil +} + +func (m *PostStartContainerRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PostStartContainerRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *PostStartContainerRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Container != nil { + size, err := m.Container.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.Pod != nil { + size, err := m.Pod.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PostStartContainerResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PostStartContainerResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *PostStartContainerResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + return len(dAtA) - i, nil +} + +func (m *UpdateContainerRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UpdateContainerRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UpdateContainerRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.LinuxResources != nil { + size, err := m.LinuxResources.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + if m.Container != nil { + size, err := m.Container.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.Pod != nil { + size, err := m.Pod.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UpdateContainerResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UpdateContainerResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *UpdateContainerResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Evict) > 0 { + for iNdEx := len(m.Evict) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Evict[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Update) > 0 { + for iNdEx := len(m.Update) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Update[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *PostUpdateContainerRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PostUpdateContainerRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *PostUpdateContainerRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Container != nil { + size, err := m.Container.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.Pod != nil { + size, err := m.Pod.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PostUpdateContainerResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PostUpdateContainerResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *PostUpdateContainerResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + return len(dAtA) - i, nil +} + +func (m *StopContainerRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StopContainerRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *StopContainerRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Container != nil { + size, err := m.Container.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.Pod != nil { + size, err := m.Pod.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *StopContainerResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StopContainerResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *StopContainerResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Update) > 0 { + for iNdEx := len(m.Update) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Update[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *RemoveContainerRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RemoveContainerRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *RemoveContainerRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Container != nil { + size, err := m.Container.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.Pod != nil { + size, err := m.Pod.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RemoveContainerResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RemoveContainerResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *RemoveContainerResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + return len(dAtA) - i, nil +} + +func (m *ValidateContainerAdjustmentRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ValidateContainerAdjustmentRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ValidateContainerAdjustmentRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Plugins) > 0 { + for iNdEx := len(m.Plugins) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Plugins[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } + } + if m.Owners != nil { + size, err := m.Owners.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + if len(m.Update) > 0 { + for iNdEx := len(m.Update) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Update[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + } + if m.Adjust != nil { + size, err := m.Adjust.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + if m.Container != nil { + size, err := m.Container.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.Pod != nil { + size, err := m.Pod.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PluginInstance) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PluginInstance) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *PluginInstance) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Index) > 0 { + i -= len(m.Index) + copy(dAtA[i:], m.Index) + i = encodeVarint(dAtA, i, uint64(len(m.Index))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ValidateContainerAdjustmentResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ValidateContainerAdjustmentResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ValidateContainerAdjustmentResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Reason) > 0 { + i -= len(m.Reason) + copy(dAtA[i:], m.Reason) + i = encodeVarint(dAtA, i, uint64(len(m.Reason))) + i-- + dAtA[i] = 0x12 + } + if m.Reject { + i-- + if m.Reject { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *PodSandbox) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PodSandbox) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *PodSandbox) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Ips) > 0 { + for iNdEx := len(m.Ips) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Ips[iNdEx]) + copy(dAtA[i:], m.Ips[iNdEx]) + i = encodeVarint(dAtA, i, uint64(len(m.Ips[iNdEx]))) + i-- + dAtA[i] = 0x52 + } + } + if m.Pid != 0 { + i = encodeVarint(dAtA, i, uint64(m.Pid)) + i-- + dAtA[i] = 0x48 + } + if m.Linux != nil { + size, err := m.Linux.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x42 + } + if len(m.RuntimeHandler) > 0 { + i -= len(m.RuntimeHandler) + copy(dAtA[i:], m.RuntimeHandler) + i = encodeVarint(dAtA, i, uint64(len(m.RuntimeHandler))) + i-- + dAtA[i] = 0x3a + } + if len(m.Annotations) > 0 { + for k := range m.Annotations { + v := m.Annotations[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x32 + } + } + if len(m.Labels) > 0 { + for k := range m.Labels { + v := m.Labels[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a + } + } + if len(m.Namespace) > 0 { + i -= len(m.Namespace) + copy(dAtA[i:], m.Namespace) + i = encodeVarint(dAtA, i, uint64(len(m.Namespace))) + i-- + dAtA[i] = 0x22 + } + if len(m.Uid) > 0 { + i -= len(m.Uid) + copy(dAtA[i:], m.Uid) + i = encodeVarint(dAtA, i, uint64(len(m.Uid))) + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarint(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LinuxPodSandbox) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LinuxPodSandbox) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LinuxPodSandbox) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Resources != nil { + size, err := m.Resources.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } + if len(m.Namespaces) > 0 { + for iNdEx := len(m.Namespaces) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Namespaces[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + } + if len(m.CgroupsPath) > 0 { + i -= len(m.CgroupsPath) + copy(dAtA[i:], m.CgroupsPath) + i = encodeVarint(dAtA, i, uint64(len(m.CgroupsPath))) + i-- + dAtA[i] = 0x22 + } + if len(m.CgroupParent) > 0 { + i -= len(m.CgroupParent) + copy(dAtA[i:], m.CgroupParent) + i = encodeVarint(dAtA, i, uint64(len(m.CgroupParent))) + i-- + dAtA[i] = 0x1a + } + if m.PodResources != nil { + size, err := m.PodResources.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.PodOverhead != nil { + size, err := m.PodOverhead.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Container) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Container) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Container) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.User != nil { + size, err := m.User.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } + if len(m.CDIDevices) > 0 { + for iNdEx := len(m.CDIDevices) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.CDIDevices[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + } + if len(m.StatusMessage) > 0 { + i -= len(m.StatusMessage) + copy(dAtA[i:], m.StatusMessage) + i = encodeVarint(dAtA, i, uint64(len(m.StatusMessage))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + } + if len(m.StatusReason) > 0 { + i -= len(m.StatusReason) + copy(dAtA[i:], m.StatusReason) + i = encodeVarint(dAtA, i, uint64(len(m.StatusReason))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } + if m.ExitCode != 0 { + i = encodeVarint(dAtA, i, uint64(m.ExitCode)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x88 + } + if m.FinishedAt != 0 { + i = encodeVarint(dAtA, i, uint64(m.FinishedAt)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + } + if m.StartedAt != 0 { + i = encodeVarint(dAtA, i, uint64(m.StartedAt)) + i-- + dAtA[i] = 0x78 + } + if m.CreatedAt != 0 { + i = encodeVarint(dAtA, i, uint64(m.CreatedAt)) + i-- + dAtA[i] = 0x70 + } + if len(m.Rlimits) > 0 { + for iNdEx := len(m.Rlimits) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Rlimits[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x6a + } + } + if m.Pid != 0 { + i = encodeVarint(dAtA, i, uint64(m.Pid)) + i-- + dAtA[i] = 0x60 + } + if m.Linux != nil { + size, err := m.Linux.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x5a + } + if m.Hooks != nil { + size, err := m.Hooks.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x52 + } + if len(m.Mounts) > 0 { + for iNdEx := len(m.Mounts) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Mounts[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x4a + } + } + if len(m.Env) > 0 { + for iNdEx := len(m.Env) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Env[iNdEx]) + copy(dAtA[i:], m.Env[iNdEx]) + i = encodeVarint(dAtA, i, uint64(len(m.Env[iNdEx]))) + i-- + dAtA[i] = 0x42 + } + } + if len(m.Args) > 0 { + for iNdEx := len(m.Args) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Args[iNdEx]) + copy(dAtA[i:], m.Args[iNdEx]) + i = encodeVarint(dAtA, i, uint64(len(m.Args[iNdEx]))) + i-- + dAtA[i] = 0x3a + } + } + if len(m.Annotations) > 0 { + for k := range m.Annotations { + v := m.Annotations[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x32 + } + } + if len(m.Labels) > 0 { + for k := range m.Labels { + v := m.Labels[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a + } + } + if m.State != 0 { + i = encodeVarint(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x20 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x1a + } + if len(m.PodSandboxId) > 0 { + i -= len(m.PodSandboxId) + copy(dAtA[i:], m.PodSandboxId) + i = encodeVarint(dAtA, i, uint64(len(m.PodSandboxId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarint(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Mount) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Mount) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Mount) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Options) > 0 { + for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Options[iNdEx]) + copy(dAtA[i:], m.Options[iNdEx]) + i = encodeVarint(dAtA, i, uint64(len(m.Options[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.Source) > 0 { + i -= len(m.Source) + copy(dAtA[i:], m.Source) + i = encodeVarint(dAtA, i, uint64(len(m.Source))) + i-- + dAtA[i] = 0x1a + } + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarint(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0x12 + } + if len(m.Destination) > 0 { + i -= len(m.Destination) + copy(dAtA[i:], m.Destination) + i = encodeVarint(dAtA, i, uint64(len(m.Destination))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Hooks) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Hooks) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Hooks) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Poststop) > 0 { + for iNdEx := len(m.Poststop) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Poststop[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } + } + if len(m.Poststart) > 0 { + for iNdEx := len(m.Poststart) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Poststart[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + } + if len(m.StartContainer) > 0 { + for iNdEx := len(m.StartContainer) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.StartContainer[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + } + if len(m.CreateContainer) > 0 { + for iNdEx := len(m.CreateContainer) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.CreateContainer[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + } + if len(m.CreateRuntime) > 0 { + for iNdEx := len(m.CreateRuntime) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.CreateRuntime[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Prestart) > 0 { + for iNdEx := len(m.Prestart) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Prestart[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Hook) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Hook) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *Hook) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Timeout != nil { + size, err := m.Timeout.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + if len(m.Env) > 0 { + for iNdEx := len(m.Env) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Env[iNdEx]) + copy(dAtA[i:], m.Env[iNdEx]) + i = encodeVarint(dAtA, i, uint64(len(m.Env[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.Args) > 0 { + for iNdEx := len(m.Args) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Args[iNdEx]) + copy(dAtA[i:], m.Args[iNdEx]) + i = encodeVarint(dAtA, i, uint64(len(m.Args[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarint(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LinuxContainer) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LinuxContainer) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LinuxContainer) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.SeccompPolicy != nil { + size, err := m.SeccompPolicy.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x42 + } + if m.SeccompProfile != nil { + size, err := m.SeccompProfile.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x3a + } + if m.IoPriority != nil { + size, err := m.IoPriority.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } + if len(m.CgroupsPath) > 0 { + i -= len(m.CgroupsPath) + copy(dAtA[i:], m.CgroupsPath) + i = encodeVarint(dAtA, i, uint64(len(m.CgroupsPath))) + i-- + dAtA[i] = 0x2a + } + if m.OomScoreAdj != nil { + size, err := m.OomScoreAdj.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + if m.Resources != nil { + size, err := m.Resources.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + if len(m.Devices) > 0 { + for iNdEx := len(m.Devices) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Devices[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Namespaces) > 0 { + for iNdEx := len(m.Namespaces) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Namespaces[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *LinuxNamespace) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LinuxNamespace) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LinuxNamespace) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarint(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0x12 + } + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarint(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LinuxDevice) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LinuxDevice) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LinuxDevice) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Gid != nil { + size, err := m.Gid.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x3a + } + if m.Uid != nil { + size, err := m.Uid.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } + if m.FileMode != nil { + size, err := m.FileMode.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + if m.Minor != 0 { + i = encodeVarint(dAtA, i, uint64(m.Minor)) + i-- + dAtA[i] = 0x20 + } + if m.Major != 0 { + i = encodeVarint(dAtA, i, uint64(m.Major)) + i-- + dAtA[i] = 0x18 + } + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarint(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0x12 + } + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarint(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LinuxDeviceCgroup) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LinuxDeviceCgroup) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LinuxDeviceCgroup) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Access) > 0 { + i -= len(m.Access) + copy(dAtA[i:], m.Access) + i = encodeVarint(dAtA, i, uint64(len(m.Access))) + i-- + dAtA[i] = 0x2a + } + if m.Minor != nil { + size, err := m.Minor.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + if m.Major != nil { + size, err := m.Major.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarint(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0x12 + } + if m.Allow { + i-- + if m.Allow { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *CDIDevice) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CDIDevice) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *CDIDevice) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *User) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *User) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *User) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.AdditionalGids) > 0 { + var pksize2 int + for _, num := range m.AdditionalGids { + pksize2 += sov(uint64(num)) + } + i -= pksize2 + j1 := i + for _, num := range m.AdditionalGids { + for num >= 1<<7 { + dAtA[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA[j1] = uint8(num) + j1++ + } + i = encodeVarint(dAtA, i, uint64(pksize2)) + i-- + dAtA[i] = 0x1a + } + if m.Gid != 0 { + i = encodeVarint(dAtA, i, uint64(m.Gid)) + i-- + dAtA[i] = 0x10 + } + if m.Uid != 0 { + i = encodeVarint(dAtA, i, uint64(m.Uid)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *LinuxResources) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LinuxResources) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LinuxResources) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Pids != nil { + size, err := m.Pids.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x42 + } + if len(m.Devices) > 0 { + for iNdEx := len(m.Devices) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Devices[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x3a + } + } + if len(m.Unified) > 0 { + for k := range m.Unified { + v := m.Unified[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x32 + } + } + if m.RdtClass != nil { + size, err := m.RdtClass.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + if m.BlockioClass != nil { + size, err := m.BlockioClass.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + if len(m.HugepageLimits) > 0 { + for iNdEx := len(m.HugepageLimits) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.HugepageLimits[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + } + if m.Cpu != nil { + size, err := m.Cpu.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.Memory != nil { + size, err := m.Memory.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LinuxMemory) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LinuxMemory) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LinuxMemory) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.UseHierarchy != nil { + size, err := m.UseHierarchy.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x42 + } + if m.DisableOomKiller != nil { + size, err := m.DisableOomKiller.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x3a + } + if m.Swappiness != nil { + size, err := m.Swappiness.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } + if m.KernelTcp != nil { + size, err := m.KernelTcp.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + if m.Kernel != nil { + size, err := m.Kernel.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + if m.Swap != nil { + size, err := m.Swap.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + if m.Reservation != nil { + size, err := m.Reservation.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.Limit != nil { + size, err := m.Limit.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LinuxCPU) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LinuxCPU) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LinuxCPU) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Mems) > 0 { + i -= len(m.Mems) + copy(dAtA[i:], m.Mems) + i = encodeVarint(dAtA, i, uint64(len(m.Mems))) + i-- + dAtA[i] = 0x3a + } + if len(m.Cpus) > 0 { + i -= len(m.Cpus) + copy(dAtA[i:], m.Cpus) + i = encodeVarint(dAtA, i, uint64(len(m.Cpus))) + i-- + dAtA[i] = 0x32 + } + if m.RealtimePeriod != nil { + size, err := m.RealtimePeriod.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + if m.RealtimeRuntime != nil { + size, err := m.RealtimeRuntime.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + if m.Period != nil { + size, err := m.Period.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + if m.Quota != nil { + size, err := m.Quota.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.Shares != nil { + size, err := m.Shares.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *HugepageLimit) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HugepageLimit) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *HugepageLimit) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Limit != 0 { + i = encodeVarint(dAtA, i, uint64(m.Limit)) + i-- + dAtA[i] = 0x10 + } + if len(m.PageSize) > 0 { + i -= len(m.PageSize) + copy(dAtA[i:], m.PageSize) + i = encodeVarint(dAtA, i, uint64(len(m.PageSize))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SecurityProfile) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SecurityProfile) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *SecurityProfile) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.LocalhostRef) > 0 { + i -= len(m.LocalhostRef) + copy(dAtA[i:], m.LocalhostRef) + i = encodeVarint(dAtA, i, uint64(len(m.LocalhostRef))) + i-- + dAtA[i] = 0x12 + } + if m.ProfileType != 0 { + i = encodeVarint(dAtA, i, uint64(m.ProfileType)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *POSIXRlimit) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *POSIXRlimit) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *POSIXRlimit) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Soft != 0 { + i = encodeVarint(dAtA, i, uint64(m.Soft)) + i-- + dAtA[i] = 0x18 + } + if m.Hard != 0 { + i = encodeVarint(dAtA, i, uint64(m.Hard)) + i-- + dAtA[i] = 0x10 + } + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarint(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LinuxPids) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LinuxPids) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LinuxPids) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Limit != 0 { + i = encodeVarint(dAtA, i, uint64(m.Limit)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *LinuxIOPriority) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LinuxIOPriority) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LinuxIOPriority) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Priority != 0 { + i = encodeVarint(dAtA, i, uint64(m.Priority)) + i-- + dAtA[i] = 0x10 + } + if m.Class != 0 { + i = encodeVarint(dAtA, i, uint64(m.Class)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ContainerAdjustment) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ContainerAdjustment) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ContainerAdjustment) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Args) > 0 { + for iNdEx := len(m.Args) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Args[iNdEx]) + copy(dAtA[i:], m.Args[iNdEx]) + i = encodeVarint(dAtA, i, uint64(len(m.Args[iNdEx]))) + i-- + dAtA[i] = 0x4a + } + } + if len(m.CDIDevices) > 0 { + for iNdEx := len(m.CDIDevices) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.CDIDevices[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x42 + } + } + if len(m.Rlimits) > 0 { + for iNdEx := len(m.Rlimits) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Rlimits[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x3a + } + } + if m.Linux != nil { + size, err := m.Linux.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } + if m.Hooks != nil { + size, err := m.Hooks.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + if len(m.Env) > 0 { + for iNdEx := len(m.Env) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Env[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + } + if len(m.Mounts) > 0 { + for iNdEx := len(m.Mounts) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Mounts[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + } + if len(m.Annotations) > 0 { + for k := range m.Annotations { + v := m.Annotations[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + return len(dAtA) - i, nil +} + +func (m *LinuxContainerAdjustment) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LinuxContainerAdjustment) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LinuxContainerAdjustment) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Namespaces) > 0 { + for iNdEx := len(m.Namespaces) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Namespaces[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x3a + } + } + if m.SeccompPolicy != nil { + size, err := m.SeccompPolicy.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } + if m.IoPriority != nil { + size, err := m.IoPriority.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a + } + if m.OomScoreAdj != nil { + size, err := m.OomScoreAdj.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + if len(m.CgroupsPath) > 0 { + i -= len(m.CgroupsPath) + copy(dAtA[i:], m.CgroupsPath) + i = encodeVarint(dAtA, i, uint64(len(m.CgroupsPath))) + i-- + dAtA[i] = 0x1a + } + if m.Resources != nil { + size, err := m.Resources.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if len(m.Devices) > 0 { + for iNdEx := len(m.Devices) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Devices[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *LinuxSeccomp) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LinuxSeccomp) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LinuxSeccomp) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Syscalls) > 0 { + for iNdEx := len(m.Syscalls) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Syscalls[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x3a + } + } + if len(m.ListenerMetadata) > 0 { + i -= len(m.ListenerMetadata) + copy(dAtA[i:], m.ListenerMetadata) + i = encodeVarint(dAtA, i, uint64(len(m.ListenerMetadata))) + i-- + dAtA[i] = 0x32 + } + if len(m.ListenerPath) > 0 { + i -= len(m.ListenerPath) + copy(dAtA[i:], m.ListenerPath) + i = encodeVarint(dAtA, i, uint64(len(m.ListenerPath))) + i-- + dAtA[i] = 0x2a + } + if len(m.Flags) > 0 { + for iNdEx := len(m.Flags) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Flags[iNdEx]) + copy(dAtA[i:], m.Flags[iNdEx]) + i = encodeVarint(dAtA, i, uint64(len(m.Flags[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.Architectures) > 0 { + for iNdEx := len(m.Architectures) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Architectures[iNdEx]) + copy(dAtA[i:], m.Architectures[iNdEx]) + i = encodeVarint(dAtA, i, uint64(len(m.Architectures[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if m.DefaultErrno != nil { + size, err := m.DefaultErrno.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if len(m.DefaultAction) > 0 { + i -= len(m.DefaultAction) + copy(dAtA[i:], m.DefaultAction) + i = encodeVarint(dAtA, i, uint64(len(m.DefaultAction))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LinuxSyscall) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LinuxSyscall) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LinuxSyscall) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Args) > 0 { + for iNdEx := len(m.Args) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Args[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 + } + } + if m.ErrnoRet != nil { + size, err := m.ErrnoRet.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + if len(m.Action) > 0 { + i -= len(m.Action) + copy(dAtA[i:], m.Action) + i = encodeVarint(dAtA, i, uint64(len(m.Action))) + i-- + dAtA[i] = 0x12 + } + if len(m.Names) > 0 { + for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Names[iNdEx]) + copy(dAtA[i:], m.Names[iNdEx]) + i = encodeVarint(dAtA, i, uint64(len(m.Names[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *LinuxSeccompArg) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LinuxSeccompArg) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LinuxSeccompArg) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Op) > 0 { + i -= len(m.Op) + copy(dAtA[i:], m.Op) + i = encodeVarint(dAtA, i, uint64(len(m.Op))) + i-- + dAtA[i] = 0x22 + } + if m.ValueTwo != 0 { + i = encodeVarint(dAtA, i, uint64(m.ValueTwo)) + i-- + dAtA[i] = 0x18 + } + if m.Value != 0 { + i = encodeVarint(dAtA, i, uint64(m.Value)) + i-- + dAtA[i] = 0x10 + } + if m.Index != 0 { + i = encodeVarint(dAtA, i, uint64(m.Index)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ContainerUpdate) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ContainerUpdate) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ContainerUpdate) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.IgnoreFailure { + i-- + if m.IgnoreFailure { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.Linux != nil { + size, err := m.Linux.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if len(m.ContainerId) > 0 { + i -= len(m.ContainerId) + copy(dAtA[i:], m.ContainerId) + i = encodeVarint(dAtA, i, uint64(len(m.ContainerId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LinuxContainerUpdate) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LinuxContainerUpdate) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *LinuxContainerUpdate) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Resources != nil { + size, err := m.Resources.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ContainerEviction) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ContainerEviction) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ContainerEviction) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Reason) > 0 { + i -= len(m.Reason) + copy(dAtA[i:], m.Reason) + i = encodeVarint(dAtA, i, uint64(len(m.Reason))) + i-- + dAtA[i] = 0x12 + } + if len(m.ContainerId) > 0 { + i -= len(m.ContainerId) + copy(dAtA[i:], m.ContainerId) + i = encodeVarint(dAtA, i, uint64(len(m.ContainerId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *KeyValue) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *KeyValue) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *KeyValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarint(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarint(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *OptionalString) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OptionalString) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *OptionalString) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarint(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *OptionalInt) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OptionalInt) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *OptionalInt) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Value != 0 { + i = encodeVarint(dAtA, i, uint64(m.Value)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *OptionalInt32) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OptionalInt32) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *OptionalInt32) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Value != 0 { + i = encodeVarint(dAtA, i, uint64(m.Value)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *OptionalUInt32) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OptionalUInt32) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *OptionalUInt32) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Value != 0 { + i = encodeVarint(dAtA, i, uint64(m.Value)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *OptionalInt64) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OptionalInt64) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *OptionalInt64) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Value != 0 { + i = encodeVarint(dAtA, i, uint64(m.Value)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *OptionalUInt64) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OptionalUInt64) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *OptionalUInt64) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Value != 0 { + i = encodeVarint(dAtA, i, uint64(m.Value)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *OptionalBool) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OptionalBool) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *OptionalBool) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Value { + i-- + if m.Value { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *OptionalFileMode) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OptionalFileMode) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *OptionalFileMode) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.Value != 0 { + i = encodeVarint(dAtA, i, uint64(m.Value)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *CompoundFieldOwners) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CompoundFieldOwners) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *CompoundFieldOwners) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Owners) > 0 { + for k := range m.Owners { + v := m.Owners[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *FieldOwners) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FieldOwners) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *FieldOwners) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Compound) > 0 { + for k := range m.Compound { + v := m.Compound[k] + baseI := i + size, err := v.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + i = encodeVarint(dAtA, i, uint64(k)) + i-- + dAtA[i] = 0x8 + i = encodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Simple) > 0 { + for k := range m.Simple { + v := m.Simple[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarint(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i = encodeVarint(dAtA, i, uint64(k)) + i-- + dAtA[i] = 0x8 + i = encodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *OwningPlugins) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OwningPlugins) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *OwningPlugins) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Owners) > 0 { + for k := range m.Owners { + v := m.Owners[k] + baseI := i + size, err := v.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarint(dAtA []byte, offset int, v uint64) int { + offset -= sov(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *RegisterPluginRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PluginName) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.PluginIdx) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *RegisterPluginResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += len(m.unknownFields) + return n +} + +func (m *UpdateContainersRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Update) > 0 { + for _, e := range m.Update { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + if len(m.Evict) > 0 { + for _, e := range m.Evict { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *UpdateContainersResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Failed) > 0 { + for _, e := range m.Failed { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *LogRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Msg) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if m.Level != 0 { + n += 1 + sov(uint64(m.Level)) + } + n += len(m.unknownFields) + return n +} + +func (m *LogResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += len(m.unknownFields) + return n +} + +func (m *ConfigureRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Config) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.RuntimeName) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.RuntimeVersion) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if m.RegistrationTimeout != 0 { + n += 1 + sov(uint64(m.RegistrationTimeout)) + } + if m.RequestTimeout != 0 { + n += 1 + sov(uint64(m.RequestTimeout)) + } + n += len(m.unknownFields) + return n +} + +func (m *ConfigureResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Events != 0 { + n += 1 + sov(uint64(m.Events)) + } + n += len(m.unknownFields) + return n +} + +func (m *SynchronizeRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Pods) > 0 { + for _, e := range m.Pods { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + if len(m.Containers) > 0 { + for _, e := range m.Containers { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + if m.More { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *SynchronizeResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Update) > 0 { + for _, e := range m.Update { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + if m.More { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *ShutdownRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Reason) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *ShutdownResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += len(m.unknownFields) + return n +} + +func (m *RunPodSandboxRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pod != nil { + l = m.Pod.SizeVT() + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *RunPodSandboxResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += len(m.unknownFields) + return n +} + +func (m *UpdatePodSandboxRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pod != nil { + l = m.Pod.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.OverheadLinuxResources != nil { + l = m.OverheadLinuxResources.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.LinuxResources != nil { + l = m.LinuxResources.SizeVT() + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *UpdatePodSandboxResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += len(m.unknownFields) + return n +} + +func (m *PostUpdatePodSandboxRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pod != nil { + l = m.Pod.SizeVT() + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *PostUpdatePodSandboxResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += len(m.unknownFields) + return n +} + +func (m *StopPodSandboxRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pod != nil { + l = m.Pod.SizeVT() + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *StopPodSandboxResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += len(m.unknownFields) + return n +} + +func (m *RemovePodSandboxRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pod != nil { + l = m.Pod.SizeVT() + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *RemovePodSandboxResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += len(m.unknownFields) + return n +} + +func (m *CreateContainerRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pod != nil { + l = m.Pod.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.Container != nil { + l = m.Container.SizeVT() + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *CreateContainerResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Adjust != nil { + l = m.Adjust.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if len(m.Update) > 0 { + for _, e := range m.Update { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + if len(m.Evict) > 0 { + for _, e := range m.Evict { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *PostCreateContainerRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pod != nil { + l = m.Pod.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.Container != nil { + l = m.Container.SizeVT() + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *PostCreateContainerResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += len(m.unknownFields) + return n +} + +func (m *StartContainerRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pod != nil { + l = m.Pod.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.Container != nil { + l = m.Container.SizeVT() + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *StartContainerResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += len(m.unknownFields) + return n +} + +func (m *PostStartContainerRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pod != nil { + l = m.Pod.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.Container != nil { + l = m.Container.SizeVT() + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *PostStartContainerResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += len(m.unknownFields) + return n +} + +func (m *UpdateContainerRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pod != nil { + l = m.Pod.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.Container != nil { + l = m.Container.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.LinuxResources != nil { + l = m.LinuxResources.SizeVT() + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *UpdateContainerResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Update) > 0 { + for _, e := range m.Update { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + if len(m.Evict) > 0 { + for _, e := range m.Evict { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *PostUpdateContainerRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pod != nil { + l = m.Pod.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.Container != nil { + l = m.Container.SizeVT() + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *PostUpdateContainerResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += len(m.unknownFields) + return n +} + +func (m *StopContainerRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pod != nil { + l = m.Pod.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.Container != nil { + l = m.Container.SizeVT() + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *StopContainerResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Update) > 0 { + for _, e := range m.Update { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *RemoveContainerRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pod != nil { + l = m.Pod.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.Container != nil { + l = m.Container.SizeVT() + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *RemoveContainerResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += len(m.unknownFields) + return n +} + +func (m *ValidateContainerAdjustmentRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pod != nil { + l = m.Pod.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.Container != nil { + l = m.Container.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.Adjust != nil { + l = m.Adjust.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if len(m.Update) > 0 { + for _, e := range m.Update { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + if m.Owners != nil { + l = m.Owners.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if len(m.Plugins) > 0 { + for _, e := range m.Plugins { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *PluginInstance) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.Index) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *ValidateContainerAdjustmentResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Reject { + n += 2 + } + l = len(m.Reason) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *PodSandbox) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.Uid) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.Namespace) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if len(m.Labels) > 0 { + for k, v := range m.Labels { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + 1 + len(v) + sov(uint64(len(v))) + n += mapEntrySize + 1 + sov(uint64(mapEntrySize)) + } + } + if len(m.Annotations) > 0 { + for k, v := range m.Annotations { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + 1 + len(v) + sov(uint64(len(v))) + n += mapEntrySize + 1 + sov(uint64(mapEntrySize)) + } + } + l = len(m.RuntimeHandler) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if m.Linux != nil { + l = m.Linux.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.Pid != 0 { + n += 1 + sov(uint64(m.Pid)) + } + if len(m.Ips) > 0 { + for _, s := range m.Ips { + l = len(s) + n += 1 + l + sov(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *LinuxPodSandbox) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PodOverhead != nil { + l = m.PodOverhead.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.PodResources != nil { + l = m.PodResources.SizeVT() + n += 1 + l + sov(uint64(l)) + } + l = len(m.CgroupParent) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.CgroupsPath) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if len(m.Namespaces) > 0 { + for _, e := range m.Namespaces { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + if m.Resources != nil { + l = m.Resources.SizeVT() + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *Container) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.PodSandboxId) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if m.State != 0 { + n += 1 + sov(uint64(m.State)) + } + if len(m.Labels) > 0 { + for k, v := range m.Labels { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + 1 + len(v) + sov(uint64(len(v))) + n += mapEntrySize + 1 + sov(uint64(mapEntrySize)) + } + } + if len(m.Annotations) > 0 { + for k, v := range m.Annotations { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + 1 + len(v) + sov(uint64(len(v))) + n += mapEntrySize + 1 + sov(uint64(mapEntrySize)) + } + } + if len(m.Args) > 0 { + for _, s := range m.Args { + l = len(s) + n += 1 + l + sov(uint64(l)) + } + } + if len(m.Env) > 0 { + for _, s := range m.Env { + l = len(s) + n += 1 + l + sov(uint64(l)) + } + } + if len(m.Mounts) > 0 { + for _, e := range m.Mounts { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + if m.Hooks != nil { + l = m.Hooks.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.Linux != nil { + l = m.Linux.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.Pid != 0 { + n += 1 + sov(uint64(m.Pid)) + } + if len(m.Rlimits) > 0 { + for _, e := range m.Rlimits { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + if m.CreatedAt != 0 { + n += 1 + sov(uint64(m.CreatedAt)) + } + if m.StartedAt != 0 { + n += 1 + sov(uint64(m.StartedAt)) + } + if m.FinishedAt != 0 { + n += 2 + sov(uint64(m.FinishedAt)) + } + if m.ExitCode != 0 { + n += 2 + sov(uint64(m.ExitCode)) + } + l = len(m.StatusReason) + if l > 0 { + n += 2 + l + sov(uint64(l)) + } + l = len(m.StatusMessage) + if l > 0 { + n += 2 + l + sov(uint64(l)) + } + if len(m.CDIDevices) > 0 { + for _, e := range m.CDIDevices { + l = e.SizeVT() + n += 2 + l + sov(uint64(l)) + } + } + if m.User != nil { + l = m.User.SizeVT() + n += 2 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *Mount) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Destination) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.Type) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.Source) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if len(m.Options) > 0 { + for _, s := range m.Options { + l = len(s) + n += 1 + l + sov(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *Hooks) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Prestart) > 0 { + for _, e := range m.Prestart { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + if len(m.CreateRuntime) > 0 { + for _, e := range m.CreateRuntime { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + if len(m.CreateContainer) > 0 { + for _, e := range m.CreateContainer { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + if len(m.StartContainer) > 0 { + for _, e := range m.StartContainer { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + if len(m.Poststart) > 0 { + for _, e := range m.Poststart { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + if len(m.Poststop) > 0 { + for _, e := range m.Poststop { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *Hook) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Path) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if len(m.Args) > 0 { + for _, s := range m.Args { + l = len(s) + n += 1 + l + sov(uint64(l)) + } + } + if len(m.Env) > 0 { + for _, s := range m.Env { + l = len(s) + n += 1 + l + sov(uint64(l)) + } + } + if m.Timeout != nil { + l = m.Timeout.SizeVT() + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *LinuxContainer) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Namespaces) > 0 { + for _, e := range m.Namespaces { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + if len(m.Devices) > 0 { + for _, e := range m.Devices { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + if m.Resources != nil { + l = m.Resources.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.OomScoreAdj != nil { + l = m.OomScoreAdj.SizeVT() + n += 1 + l + sov(uint64(l)) + } + l = len(m.CgroupsPath) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if m.IoPriority != nil { + l = m.IoPriority.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.SeccompProfile != nil { + l = m.SeccompProfile.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.SeccompPolicy != nil { + l = m.SeccompPolicy.SizeVT() + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *LinuxNamespace) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Type) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.Path) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *LinuxDevice) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Path) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.Type) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if m.Major != 0 { + n += 1 + sov(uint64(m.Major)) + } + if m.Minor != 0 { + n += 1 + sov(uint64(m.Minor)) + } + if m.FileMode != nil { + l = m.FileMode.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.Uid != nil { + l = m.Uid.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.Gid != nil { + l = m.Gid.SizeVT() + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *LinuxDeviceCgroup) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Allow { + n += 2 + } + l = len(m.Type) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if m.Major != nil { + l = m.Major.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.Minor != nil { + l = m.Minor.SizeVT() + n += 1 + l + sov(uint64(l)) + } + l = len(m.Access) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *CDIDevice) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *User) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Uid != 0 { + n += 1 + sov(uint64(m.Uid)) + } + if m.Gid != 0 { + n += 1 + sov(uint64(m.Gid)) + } + if len(m.AdditionalGids) > 0 { + l = 0 + for _, e := range m.AdditionalGids { + l += sov(uint64(e)) + } + n += 1 + sov(uint64(l)) + l + } + n += len(m.unknownFields) + return n +} + +func (m *LinuxResources) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Memory != nil { + l = m.Memory.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.Cpu != nil { + l = m.Cpu.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if len(m.HugepageLimits) > 0 { + for _, e := range m.HugepageLimits { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + if m.BlockioClass != nil { + l = m.BlockioClass.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.RdtClass != nil { + l = m.RdtClass.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if len(m.Unified) > 0 { + for k, v := range m.Unified { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + 1 + len(v) + sov(uint64(len(v))) + n += mapEntrySize + 1 + sov(uint64(mapEntrySize)) + } + } + if len(m.Devices) > 0 { + for _, e := range m.Devices { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + if m.Pids != nil { + l = m.Pids.SizeVT() + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *LinuxMemory) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Limit != nil { + l = m.Limit.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.Reservation != nil { + l = m.Reservation.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.Swap != nil { + l = m.Swap.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.Kernel != nil { + l = m.Kernel.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.KernelTcp != nil { + l = m.KernelTcp.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.Swappiness != nil { + l = m.Swappiness.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.DisableOomKiller != nil { + l = m.DisableOomKiller.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.UseHierarchy != nil { + l = m.UseHierarchy.SizeVT() + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *LinuxCPU) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Shares != nil { + l = m.Shares.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.Quota != nil { + l = m.Quota.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.Period != nil { + l = m.Period.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.RealtimeRuntime != nil { + l = m.RealtimeRuntime.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.RealtimePeriod != nil { + l = m.RealtimePeriod.SizeVT() + n += 1 + l + sov(uint64(l)) + } + l = len(m.Cpus) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.Mems) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *HugepageLimit) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PageSize) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if m.Limit != 0 { + n += 1 + sov(uint64(m.Limit)) + } + n += len(m.unknownFields) + return n +} + +func (m *SecurityProfile) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProfileType != 0 { + n += 1 + sov(uint64(m.ProfileType)) + } + l = len(m.LocalhostRef) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *POSIXRlimit) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Type) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if m.Hard != 0 { + n += 1 + sov(uint64(m.Hard)) + } + if m.Soft != 0 { + n += 1 + sov(uint64(m.Soft)) + } + n += len(m.unknownFields) + return n +} + +func (m *LinuxPids) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Limit != 0 { + n += 1 + sov(uint64(m.Limit)) + } + n += len(m.unknownFields) + return n +} + +func (m *LinuxIOPriority) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Class != 0 { + n += 1 + sov(uint64(m.Class)) + } + if m.Priority != 0 { + n += 1 + sov(uint64(m.Priority)) + } + n += len(m.unknownFields) + return n +} + +func (m *ContainerAdjustment) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Annotations) > 0 { + for k, v := range m.Annotations { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + 1 + len(v) + sov(uint64(len(v))) + n += mapEntrySize + 1 + sov(uint64(mapEntrySize)) + } + } + if len(m.Mounts) > 0 { + for _, e := range m.Mounts { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + if len(m.Env) > 0 { + for _, e := range m.Env { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + if m.Hooks != nil { + l = m.Hooks.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.Linux != nil { + l = m.Linux.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if len(m.Rlimits) > 0 { + for _, e := range m.Rlimits { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + if len(m.CDIDevices) > 0 { + for _, e := range m.CDIDevices { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + if len(m.Args) > 0 { + for _, s := range m.Args { + l = len(s) + n += 1 + l + sov(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *LinuxContainerAdjustment) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Devices) > 0 { + for _, e := range m.Devices { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + if m.Resources != nil { + l = m.Resources.SizeVT() + n += 1 + l + sov(uint64(l)) + } + l = len(m.CgroupsPath) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if m.OomScoreAdj != nil { + l = m.OomScoreAdj.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.IoPriority != nil { + l = m.IoPriority.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.SeccompPolicy != nil { + l = m.SeccompPolicy.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if len(m.Namespaces) > 0 { + for _, e := range m.Namespaces { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *LinuxSeccomp) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DefaultAction) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if m.DefaultErrno != nil { + l = m.DefaultErrno.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if len(m.Architectures) > 0 { + for _, s := range m.Architectures { + l = len(s) + n += 1 + l + sov(uint64(l)) + } + } + if len(m.Flags) > 0 { + for _, s := range m.Flags { + l = len(s) + n += 1 + l + sov(uint64(l)) + } + } + l = len(m.ListenerPath) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.ListenerMetadata) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if len(m.Syscalls) > 0 { + for _, e := range m.Syscalls { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *LinuxSyscall) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Names) > 0 { + for _, s := range m.Names { + l = len(s) + n += 1 + l + sov(uint64(l)) + } + } + l = len(m.Action) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if m.ErrnoRet != nil { + l = m.ErrnoRet.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if len(m.Args) > 0 { + for _, e := range m.Args { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *LinuxSeccompArg) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Index != 0 { + n += 1 + sov(uint64(m.Index)) + } + if m.Value != 0 { + n += 1 + sov(uint64(m.Value)) + } + if m.ValueTwo != 0 { + n += 1 + sov(uint64(m.ValueTwo)) + } + l = len(m.Op) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *ContainerUpdate) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ContainerId) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if m.Linux != nil { + l = m.Linux.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.IgnoreFailure { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *LinuxContainerUpdate) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Resources != nil { + l = m.Resources.SizeVT() + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *ContainerEviction) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ContainerId) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.Reason) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *KeyValue) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *OptionalString) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Value) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *OptionalInt) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Value != 0 { + n += 1 + sov(uint64(m.Value)) + } + n += len(m.unknownFields) + return n +} + +func (m *OptionalInt32) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Value != 0 { + n += 1 + sov(uint64(m.Value)) + } + n += len(m.unknownFields) + return n +} + +func (m *OptionalUInt32) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Value != 0 { + n += 1 + sov(uint64(m.Value)) + } + n += len(m.unknownFields) + return n +} + +func (m *OptionalInt64) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Value != 0 { + n += 1 + sov(uint64(m.Value)) + } + n += len(m.unknownFields) + return n +} + +func (m *OptionalUInt64) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Value != 0 { + n += 1 + sov(uint64(m.Value)) + } + n += len(m.unknownFields) + return n +} + +func (m *OptionalBool) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Value { + n += 2 + } + n += len(m.unknownFields) + return n +} + +func (m *OptionalFileMode) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Value != 0 { + n += 1 + sov(uint64(m.Value)) + } + n += len(m.unknownFields) + return n +} + +func (m *CompoundFieldOwners) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Owners) > 0 { + for k, v := range m.Owners { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + 1 + len(v) + sov(uint64(len(v))) + n += mapEntrySize + 1 + sov(uint64(mapEntrySize)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *FieldOwners) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Simple) > 0 { + for k, v := range m.Simple { + _ = k + _ = v + mapEntrySize := 1 + sov(uint64(k)) + 1 + len(v) + sov(uint64(len(v))) + n += mapEntrySize + 1 + sov(uint64(mapEntrySize)) + } + } + if len(m.Compound) > 0 { + for k, v := range m.Compound { + _ = k + _ = v + l = 0 + if v != nil { + l = v.SizeVT() + } + l += 1 + sov(uint64(l)) + mapEntrySize := 1 + sov(uint64(k)) + l + n += mapEntrySize + 1 + sov(uint64(mapEntrySize)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *OwningPlugins) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Owners) > 0 { + for k, v := range m.Owners { + _ = k + _ = v + l = 0 + if v != nil { + l = v.SizeVT() + } + l += 1 + sov(uint64(l)) + mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + l + n += mapEntrySize + 1 + sov(uint64(mapEntrySize)) + } + } + n += len(m.unknownFields) + return n +} + +func sov(x uint64) (n int) { + return (bits.Len64(x|1) + 6) / 7 +} +func soz(x uint64) (n int) { + return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *RegisterPluginRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RegisterPluginRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RegisterPluginRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PluginName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PluginName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PluginIdx", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PluginIdx = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RegisterPluginResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RegisterPluginResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RegisterPluginResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UpdateContainersRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UpdateContainersRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpdateContainersRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Update", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Update = append(m.Update, &ContainerUpdate{}) + if err := m.Update[len(m.Update)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Evict", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Evict = append(m.Evict, &ContainerEviction{}) + if err := m.Evict[len(m.Evict)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UpdateContainersResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UpdateContainersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpdateContainersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Failed", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Failed = append(m.Failed, &ContainerUpdate{}) + if err := m.Failed[len(m.Failed)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LogRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LogRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LogRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Msg = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Level", wireType) + } + m.Level = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Level |= LogRequest_Level(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LogResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LogResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LogResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConfigureRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ConfigureRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConfigureRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Config = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RuntimeName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RuntimeName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RuntimeVersion", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RuntimeVersion = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RegistrationTimeout", wireType) + } + m.RegistrationTimeout = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RegistrationTimeout |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RequestTimeout", wireType) + } + m.RequestTimeout = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RequestTimeout |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConfigureResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ConfigureResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConfigureResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + } + m.Events = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Events |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SynchronizeRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SynchronizeRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SynchronizeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pods", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Pods = append(m.Pods, &PodSandbox{}) + if err := m.Pods[len(m.Pods)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Containers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Containers = append(m.Containers, &Container{}) + if err := m.Containers[len(m.Containers)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field More", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.More = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SynchronizeResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SynchronizeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SynchronizeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Update", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Update = append(m.Update, &ContainerUpdate{}) + if err := m.Update[len(m.Update)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field More", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.More = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ShutdownRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ShutdownRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ShutdownRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Reason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ShutdownResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ShutdownResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ShutdownResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RunPodSandboxRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RunPodSandboxRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RunPodSandboxRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pod == nil { + m.Pod = &PodSandbox{} + } + if err := m.Pod.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RunPodSandboxResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RunPodSandboxResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RunPodSandboxResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UpdatePodSandboxRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UpdatePodSandboxRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpdatePodSandboxRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pod == nil { + m.Pod = &PodSandbox{} + } + if err := m.Pod.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OverheadLinuxResources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.OverheadLinuxResources == nil { + m.OverheadLinuxResources = &LinuxResources{} + } + if err := m.OverheadLinuxResources.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LinuxResources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.LinuxResources == nil { + m.LinuxResources = &LinuxResources{} + } + if err := m.LinuxResources.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UpdatePodSandboxResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UpdatePodSandboxResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpdatePodSandboxResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PostUpdatePodSandboxRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PostUpdatePodSandboxRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PostUpdatePodSandboxRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pod == nil { + m.Pod = &PodSandbox{} + } + if err := m.Pod.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PostUpdatePodSandboxResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PostUpdatePodSandboxResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PostUpdatePodSandboxResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StopPodSandboxRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StopPodSandboxRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StopPodSandboxRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pod == nil { + m.Pod = &PodSandbox{} + } + if err := m.Pod.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StopPodSandboxResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StopPodSandboxResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StopPodSandboxResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RemovePodSandboxRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RemovePodSandboxRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RemovePodSandboxRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pod == nil { + m.Pod = &PodSandbox{} + } + if err := m.Pod.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RemovePodSandboxResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RemovePodSandboxResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RemovePodSandboxResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CreateContainerRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CreateContainerRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CreateContainerRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pod == nil { + m.Pod = &PodSandbox{} + } + if err := m.Pod.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Container == nil { + m.Container = &Container{} + } + if err := m.Container.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CreateContainerResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CreateContainerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CreateContainerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Adjust", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Adjust == nil { + m.Adjust = &ContainerAdjustment{} + } + if err := m.Adjust.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Update", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Update = append(m.Update, &ContainerUpdate{}) + if err := m.Update[len(m.Update)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Evict", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Evict = append(m.Evict, &ContainerEviction{}) + if err := m.Evict[len(m.Evict)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PostCreateContainerRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PostCreateContainerRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PostCreateContainerRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pod == nil { + m.Pod = &PodSandbox{} + } + if err := m.Pod.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Container == nil { + m.Container = &Container{} + } + if err := m.Container.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PostCreateContainerResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PostCreateContainerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PostCreateContainerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StartContainerRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StartContainerRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StartContainerRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pod == nil { + m.Pod = &PodSandbox{} + } + if err := m.Pod.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Container == nil { + m.Container = &Container{} + } + if err := m.Container.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StartContainerResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StartContainerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StartContainerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PostStartContainerRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PostStartContainerRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PostStartContainerRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pod == nil { + m.Pod = &PodSandbox{} + } + if err := m.Pod.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Container == nil { + m.Container = &Container{} + } + if err := m.Container.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PostStartContainerResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PostStartContainerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PostStartContainerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UpdateContainerRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UpdateContainerRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpdateContainerRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pod == nil { + m.Pod = &PodSandbox{} + } + if err := m.Pod.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Container == nil { + m.Container = &Container{} + } + if err := m.Container.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LinuxResources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.LinuxResources == nil { + m.LinuxResources = &LinuxResources{} + } + if err := m.LinuxResources.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *UpdateContainerResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UpdateContainerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UpdateContainerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Update", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Update = append(m.Update, &ContainerUpdate{}) + if err := m.Update[len(m.Update)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Evict", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Evict = append(m.Evict, &ContainerEviction{}) + if err := m.Evict[len(m.Evict)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PostUpdateContainerRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PostUpdateContainerRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PostUpdateContainerRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pod == nil { + m.Pod = &PodSandbox{} + } + if err := m.Pod.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Container == nil { + m.Container = &Container{} + } + if err := m.Container.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PostUpdateContainerResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PostUpdateContainerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PostUpdateContainerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StopContainerRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StopContainerRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StopContainerRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pod == nil { + m.Pod = &PodSandbox{} + } + if err := m.Pod.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Container == nil { + m.Container = &Container{} + } + if err := m.Container.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StopContainerResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StopContainerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StopContainerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Update", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Update = append(m.Update, &ContainerUpdate{}) + if err := m.Update[len(m.Update)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RemoveContainerRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RemoveContainerRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RemoveContainerRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pod == nil { + m.Pod = &PodSandbox{} + } + if err := m.Pod.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Container == nil { + m.Container = &Container{} + } + if err := m.Container.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RemoveContainerResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RemoveContainerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RemoveContainerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidateContainerAdjustmentRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ValidateContainerAdjustmentRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidateContainerAdjustmentRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pod == nil { + m.Pod = &PodSandbox{} + } + if err := m.Pod.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Container == nil { + m.Container = &Container{} + } + if err := m.Container.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Adjust", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Adjust == nil { + m.Adjust = &ContainerAdjustment{} + } + if err := m.Adjust.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Update", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Update = append(m.Update, &ContainerUpdate{}) + if err := m.Update[len(m.Update)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owners", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Owners == nil { + m.Owners = &OwningPlugins{} + } + if err := m.Owners.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Plugins", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Plugins = append(m.Plugins, &PluginInstance{}) + if err := m.Plugins[len(m.Plugins)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PluginInstance) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PluginInstance: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PluginInstance: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Index = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidateContainerAdjustmentResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ValidateContainerAdjustmentResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidateContainerAdjustmentResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Reject", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Reject = bool(v != 0) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Reason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodSandbox) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PodSandbox: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodSandbox: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Uid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Uid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Namespace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Labels == nil { + m.Labels = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLength + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLength + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Labels[mapkey] = mapvalue + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Annotations == nil { + m.Annotations = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLength + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLength + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Annotations[mapkey] = mapvalue + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RuntimeHandler", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RuntimeHandler = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Linux", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Linux == nil { + m.Linux = &LinuxPodSandbox{} + } + if err := m.Linux.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Pid", wireType) + } + m.Pid = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Pid |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ips", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ips = append(m.Ips, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LinuxPodSandbox) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LinuxPodSandbox: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LinuxPodSandbox: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PodOverhead", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PodOverhead == nil { + m.PodOverhead = &LinuxResources{} + } + if err := m.PodOverhead.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PodResources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PodResources == nil { + m.PodResources = &LinuxResources{} + } + if err := m.PodResources.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CgroupParent", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CgroupParent = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CgroupsPath", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CgroupsPath = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Namespaces", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Namespaces = append(m.Namespaces, &LinuxNamespace{}) + if err := m.Namespaces[len(m.Namespaces)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Resources == nil { + m.Resources = &LinuxResources{} + } + if err := m.Resources.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Container) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Container: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Container: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PodSandboxId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PodSandboxId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + } + m.State = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.State |= ContainerState(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Labels == nil { + m.Labels = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLength + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLength + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Labels[mapkey] = mapvalue + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Annotations == nil { + m.Annotations = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLength + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLength + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Annotations[mapkey] = mapvalue + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Args", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Args = append(m.Args, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Env", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Env = append(m.Env, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Mounts", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Mounts = append(m.Mounts, &Mount{}) + if err := m.Mounts[len(m.Mounts)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hooks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Hooks == nil { + m.Hooks = &Hooks{} + } + if err := m.Hooks.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Linux", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Linux == nil { + m.Linux = &LinuxContainer{} + } + if err := m.Linux.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Pid", wireType) + } + m.Pid = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Pid |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rlimits", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rlimits = append(m.Rlimits, &POSIXRlimit{}) + if err := m.Rlimits[len(m.Rlimits)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) + } + m.CreatedAt = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CreatedAt |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartedAt", wireType) + } + m.StartedAt = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartedAt |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FinishedAt", wireType) + } + m.FinishedAt = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FinishedAt |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 17: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExitCode", wireType) + } + m.ExitCode = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExitCode |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StatusReason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StatusReason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StatusMessage", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StatusMessage = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CDIDevices", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CDIDevices = append(m.CDIDevices, &CDIDevice{}) + if err := m.CDIDevices[len(m.CDIDevices)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 21: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.User == nil { + m.User = &User{} + } + if err := m.User.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Mount) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Mount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Mount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Destination", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Destination = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Source = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Options = append(m.Options, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Hooks) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Hooks: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Hooks: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prestart", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Prestart = append(m.Prestart, &Hook{}) + if err := m.Prestart[len(m.Prestart)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreateRuntime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CreateRuntime = append(m.CreateRuntime, &Hook{}) + if err := m.CreateRuntime[len(m.CreateRuntime)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreateContainer", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CreateContainer = append(m.CreateContainer, &Hook{}) + if err := m.CreateContainer[len(m.CreateContainer)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StartContainer", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StartContainer = append(m.StartContainer, &Hook{}) + if err := m.StartContainer[len(m.StartContainer)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Poststart", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Poststart = append(m.Poststart, &Hook{}) + if err := m.Poststart[len(m.Poststart)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Poststop", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Poststop = append(m.Poststop, &Hook{}) + if err := m.Poststop[len(m.Poststop)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Hook) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Hook: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Hook: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Args", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Args = append(m.Args, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Env", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Env = append(m.Env, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Timeout == nil { + m.Timeout = &OptionalInt{} + } + if err := m.Timeout.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LinuxContainer) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LinuxContainer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LinuxContainer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Namespaces", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Namespaces = append(m.Namespaces, &LinuxNamespace{}) + if err := m.Namespaces[len(m.Namespaces)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Devices = append(m.Devices, &LinuxDevice{}) + if err := m.Devices[len(m.Devices)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Resources == nil { + m.Resources = &LinuxResources{} + } + if err := m.Resources.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OomScoreAdj", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.OomScoreAdj == nil { + m.OomScoreAdj = &OptionalInt{} + } + if err := m.OomScoreAdj.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CgroupsPath", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CgroupsPath = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IoPriority", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.IoPriority == nil { + m.IoPriority = &LinuxIOPriority{} + } + if err := m.IoPriority.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SeccompProfile", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SeccompProfile == nil { + m.SeccompProfile = &SecurityProfile{} + } + if err := m.SeccompProfile.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SeccompPolicy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SeccompPolicy == nil { + m.SeccompPolicy = &LinuxSeccomp{} + } + if err := m.SeccompPolicy.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LinuxNamespace) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LinuxNamespace: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LinuxNamespace: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LinuxDevice) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LinuxDevice: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LinuxDevice: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Major", wireType) + } + m.Major = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Major |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Minor", wireType) + } + m.Minor = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Minor |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FileMode", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.FileMode == nil { + m.FileMode = &OptionalFileMode{} + } + if err := m.FileMode.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Uid", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Uid == nil { + m.Uid = &OptionalUInt32{} + } + if err := m.Uid.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Gid", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Gid == nil { + m.Gid = &OptionalUInt32{} + } + if err := m.Gid.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LinuxDeviceCgroup) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LinuxDeviceCgroup: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LinuxDeviceCgroup: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Allow", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Allow = bool(v != 0) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Major", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Major == nil { + m.Major = &OptionalInt64{} + } + if err := m.Major.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Minor", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Minor == nil { + m.Minor = &OptionalInt64{} + } + if err := m.Minor.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Access", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Access = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CDIDevice) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CDIDevice: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CDIDevice: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *User) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: User: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: User: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Uid", wireType) + } + m.Uid = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Uid |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Gid", wireType) + } + m.Gid = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Gid |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType == 0 { + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AdditionalGids = append(m.AdditionalGids, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.AdditionalGids) == 0 { + m.AdditionalGids = make([]uint32, 0, elementCount) + } + for iNdEx < postIndex { + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AdditionalGids = append(m.AdditionalGids, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field AdditionalGids", wireType) + } + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LinuxResources) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LinuxResources: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LinuxResources: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Memory", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Memory == nil { + m.Memory = &LinuxMemory{} + } + if err := m.Memory.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cpu", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Cpu == nil { + m.Cpu = &LinuxCPU{} + } + if err := m.Cpu.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HugepageLimits", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HugepageLimits = append(m.HugepageLimits, &HugepageLimit{}) + if err := m.HugepageLimits[len(m.HugepageLimits)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockioClass", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BlockioClass == nil { + m.BlockioClass = &OptionalString{} + } + if err := m.BlockioClass.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RdtClass", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RdtClass == nil { + m.RdtClass = &OptionalString{} + } + if err := m.RdtClass.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Unified", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Unified == nil { + m.Unified = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLength + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLength + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Unified[mapkey] = mapvalue + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Devices = append(m.Devices, &LinuxDeviceCgroup{}) + if err := m.Devices[len(m.Devices)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pids", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pids == nil { + m.Pids = &LinuxPids{} + } + if err := m.Pids.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LinuxMemory) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LinuxMemory: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LinuxMemory: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Limit == nil { + m.Limit = &OptionalInt64{} + } + if err := m.Limit.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reservation", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Reservation == nil { + m.Reservation = &OptionalInt64{} + } + if err := m.Reservation.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Swap", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Swap == nil { + m.Swap = &OptionalInt64{} + } + if err := m.Swap.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kernel", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Kernel == nil { + m.Kernel = &OptionalInt64{} + } + if err := m.Kernel.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KernelTcp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.KernelTcp == nil { + m.KernelTcp = &OptionalInt64{} + } + if err := m.KernelTcp.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Swappiness", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Swappiness == nil { + m.Swappiness = &OptionalUInt64{} + } + if err := m.Swappiness.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DisableOomKiller", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DisableOomKiller == nil { + m.DisableOomKiller = &OptionalBool{} + } + if err := m.DisableOomKiller.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UseHierarchy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.UseHierarchy == nil { + m.UseHierarchy = &OptionalBool{} + } + if err := m.UseHierarchy.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LinuxCPU) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LinuxCPU: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LinuxCPU: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Shares", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Shares == nil { + m.Shares = &OptionalUInt64{} + } + if err := m.Shares.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Quota", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Quota == nil { + m.Quota = &OptionalInt64{} + } + if err := m.Quota.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Period", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Period == nil { + m.Period = &OptionalUInt64{} + } + if err := m.Period.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RealtimeRuntime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RealtimeRuntime == nil { + m.RealtimeRuntime = &OptionalInt64{} + } + if err := m.RealtimeRuntime.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RealtimePeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RealtimePeriod == nil { + m.RealtimePeriod = &OptionalUInt64{} + } + if err := m.RealtimePeriod.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cpus", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Cpus = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Mems", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Mems = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HugepageLimit) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HugepageLimit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HugepageLimit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PageSize", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PageSize = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + } + m.Limit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Limit |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SecurityProfile) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SecurityProfile: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SecurityProfile: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProfileType", wireType) + } + m.ProfileType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProfileType |= SecurityProfile_ProfileType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LocalhostRef", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LocalhostRef = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *POSIXRlimit) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: POSIXRlimit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: POSIXRlimit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Hard", wireType) + } + m.Hard = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Hard |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Soft", wireType) + } + m.Soft = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Soft |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LinuxPids) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LinuxPids: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LinuxPids: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + } + m.Limit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Limit |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LinuxIOPriority) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LinuxIOPriority: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LinuxIOPriority: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Class", wireType) + } + m.Class = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Class |= IOPrioClass(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) + } + m.Priority = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Priority |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ContainerAdjustment) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ContainerAdjustment: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ContainerAdjustment: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Annotations == nil { + m.Annotations = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLength + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLength + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Annotations[mapkey] = mapvalue + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Mounts", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Mounts = append(m.Mounts, &Mount{}) + if err := m.Mounts[len(m.Mounts)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Env", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Env = append(m.Env, &KeyValue{}) + if err := m.Env[len(m.Env)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hooks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Hooks == nil { + m.Hooks = &Hooks{} + } + if err := m.Hooks.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Linux", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Linux == nil { + m.Linux = &LinuxContainerAdjustment{} + } + if err := m.Linux.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rlimits", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rlimits = append(m.Rlimits, &POSIXRlimit{}) + if err := m.Rlimits[len(m.Rlimits)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CDIDevices", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CDIDevices = append(m.CDIDevices, &CDIDevice{}) + if err := m.CDIDevices[len(m.CDIDevices)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Args", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Args = append(m.Args, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LinuxContainerAdjustment) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LinuxContainerAdjustment: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LinuxContainerAdjustment: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Devices = append(m.Devices, &LinuxDevice{}) + if err := m.Devices[len(m.Devices)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Resources == nil { + m.Resources = &LinuxResources{} + } + if err := m.Resources.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CgroupsPath", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CgroupsPath = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OomScoreAdj", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.OomScoreAdj == nil { + m.OomScoreAdj = &OptionalInt{} + } + if err := m.OomScoreAdj.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IoPriority", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.IoPriority == nil { + m.IoPriority = &LinuxIOPriority{} + } + if err := m.IoPriority.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SeccompPolicy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SeccompPolicy == nil { + m.SeccompPolicy = &LinuxSeccomp{} + } + if err := m.SeccompPolicy.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Namespaces", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Namespaces = append(m.Namespaces, &LinuxNamespace{}) + if err := m.Namespaces[len(m.Namespaces)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LinuxSeccomp) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LinuxSeccomp: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LinuxSeccomp: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultAction", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DefaultAction = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultErrno", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DefaultErrno == nil { + m.DefaultErrno = &OptionalUInt32{} + } + if err := m.DefaultErrno.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Architectures", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Architectures = append(m.Architectures, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Flags", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Flags = append(m.Flags, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListenerPath", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ListenerPath = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListenerMetadata", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ListenerMetadata = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Syscalls", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Syscalls = append(m.Syscalls, &LinuxSyscall{}) + if err := m.Syscalls[len(m.Syscalls)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LinuxSyscall) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LinuxSyscall: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LinuxSyscall: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Names", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Names = append(m.Names, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Action = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ErrnoRet", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ErrnoRet == nil { + m.ErrnoRet = &OptionalUInt32{} + } + if err := m.ErrnoRet.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Args", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Args = append(m.Args, &LinuxSeccompArg{}) + if err := m.Args[len(m.Args)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LinuxSeccompArg) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LinuxSeccompArg: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LinuxSeccompArg: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + m.Index = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Index |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + m.Value = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Value |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ValueTwo", wireType) + } + m.ValueTwo = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ValueTwo |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Op", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Op = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ContainerUpdate) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ContainerUpdate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ContainerUpdate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContainerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Linux", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Linux == nil { + m.Linux = &LinuxContainerUpdate{} + } + if err := m.Linux.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IgnoreFailure", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IgnoreFailure = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LinuxContainerUpdate) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LinuxContainerUpdate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LinuxContainerUpdate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Resources == nil { + m.Resources = &LinuxResources{} + } + if err := m.Resources.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ContainerEviction) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ContainerEviction: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ContainerEviction: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContainerId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Reason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *KeyValue) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: KeyValue: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: KeyValue: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OptionalString) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: OptionalString: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OptionalString: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OptionalInt) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: OptionalInt: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OptionalInt: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + m.Value = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Value |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OptionalInt32) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: OptionalInt32: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OptionalInt32: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + m.Value = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Value |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OptionalUInt32) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: OptionalUInt32: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OptionalUInt32: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + m.Value = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Value |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OptionalInt64) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: OptionalInt64: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OptionalInt64: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + m.Value = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Value |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OptionalUInt64) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: OptionalUInt64: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OptionalUInt64: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + m.Value = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Value |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OptionalBool) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: OptionalBool: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OptionalBool: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Value = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OptionalFileMode) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: OptionalFileMode: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OptionalFileMode: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + m.Value = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Value |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CompoundFieldOwners) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CompoundFieldOwners: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CompoundFieldOwners: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owners", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Owners == nil { + m.Owners = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLength + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLength + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Owners[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FieldOwners) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FieldOwners: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FieldOwners: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Simple", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Simple == nil { + m.Simple = make(map[int32]string) + } + var mapkey int32 + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapkey |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLength + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLength + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Simple[mapkey] = mapvalue + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Compound", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Compound == nil { + m.Compound = make(map[int32]*CompoundFieldOwners) + } + var mapkey int32 + var mapvalue *CompoundFieldOwners + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapkey |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLength + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLength + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &CompoundFieldOwners{} + if err := mapvalue.UnmarshalVT(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Compound[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OwningPlugins) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: OwningPlugins: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OwningPlugins: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owners", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Owners == nil { + m.Owners = make(map[string]*FieldOwners) + } + var mapkey string + var mapvalue *FieldOwners + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLength + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLength + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &FieldOwners{} + if err := mapvalue.UnmarshalVT(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Owners[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} + +func skip(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflow + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflow + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflow + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLength + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroup + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLength + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflow = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") +) diff --git a/pkg/api/v1beta1/container.go b/pkg/api/v1beta1/container.go new file mode 100644 index 00000000..048ae7ac --- /dev/null +++ b/pkg/api/v1beta1/container.go @@ -0,0 +1,46 @@ +/* + 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 v1beta1 + +import "time" + +// GetCreatedAtTime returns the time the container was created at as time.Time. +func (x *Container) GetCreatedAtTime() time.Time { + t := time.Time{} + if x != nil { + return t.Add(time.Duration(x.CreatedAt) * time.Nanosecond) + } + return t +} + +// GetStartedAtTime returns the time the container was started at as time.Time. +func (x *Container) GetStartedAtTime() time.Time { + t := time.Time{} + if x != nil { + return t.Add(time.Duration(x.StartedAt) * time.Nanosecond) + } + return t +} + +// GetFinishedAtTime returns the time the container was finished at as time.Time. +func (x *Container) GetFinishedAtTime() time.Time { + t := time.Time{} + if x != nil { + return t.Add(time.Duration(x.FinishedAt) * time.Nanosecond) + } + return t +} diff --git a/pkg/api/v1beta1/device.go b/pkg/api/v1beta1/device.go new file mode 100644 index 00000000..2a2ecc9e --- /dev/null +++ b/pkg/api/v1beta1/device.go @@ -0,0 +1,89 @@ +/* + 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 v1beta1 + +import ( + rspec "github.com/opencontainers/runtime-spec/specs-go" +) + +// FromOCILinuxDevices returns a device slice from an OCI runtime Spec. +func FromOCILinuxDevices(o []rspec.LinuxDevice) []*LinuxDevice { + var devices []*LinuxDevice + for _, d := range o { + devices = append(devices, &LinuxDevice{ + Path: d.Path, + Type: d.Type, + Major: d.Major, + Minor: d.Minor, + FileMode: FileMode(d.FileMode), + Uid: UInt32(d.UID), + Gid: UInt32(d.GID), + }) + } + return devices +} + +// ToOCI returns the linux devices for an OCI runtime Spec. +func (d *LinuxDevice) ToOCI() rspec.LinuxDevice { + if d == nil { + return rspec.LinuxDevice{} + } + + return rspec.LinuxDevice{ + Path: d.Path, + Type: d.Type, + Major: d.Major, + Minor: d.Minor, + FileMode: d.FileMode.Get(), + UID: d.Uid.Get(), + GID: d.Gid.Get(), + } +} + +// AccessString returns an OCI access string for the device. +func (d *LinuxDevice) AccessString() string { + r, w, m := "r", "w", "" + + if mode := d.FileMode.Get(); mode != nil { + perm := mode.Perm() + if (perm & 0444) != 0 { + r = "r" + } + if (perm & 0222) != 0 { + w = "w" + } + } + if d.Type == "b" { + m = "m" + } + + return r + w + m +} + +// Cmp returns true if the devices are equal. +func (d *LinuxDevice) Cmp(v *LinuxDevice) bool { + if v == nil { + return false + } + return d.Major != v.Major || d.Minor != v.Minor +} + +// IsMarkedForRemoval checks if a LinuxDevice is marked for removal. +func (d *LinuxDevice) IsMarkedForRemoval() (string, bool) { + key, marked := IsMarkedForRemoval(d.Path) + return key, marked +} diff --git a/pkg/api/v1beta1/doc.go b/pkg/api/v1beta1/doc.go new file mode 100644 index 00000000..1d933af4 --- /dev/null +++ b/pkg/api/v1beta1/doc.go @@ -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 v1beta1 diff --git a/pkg/api/v1beta1/env.go b/pkg/api/v1beta1/env.go new file mode 100644 index 00000000..9c64957c --- /dev/null +++ b/pkg/api/v1beta1/env.go @@ -0,0 +1,60 @@ +/* + 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 v1beta1 + +import ( + "strings" +) + +// ToOCI returns an OCI Env entry for the KeyValue. +func (e *KeyValue) ToOCI() string { + return e.Key + "=" + e.Value +} + +// FromOCIEnv returns KeyValues from an OCI runtime Spec environment. +func FromOCIEnv(in []string) []*KeyValue { + if in == nil { + return nil + } + out := []*KeyValue{} + for _, keyval := range in { + var key, val string + split := strings.SplitN(keyval, "=", 2) + switch len(split) { + case 0: + continue + case 1: + key = split[0] + case 2: + key = split[0] + val = split[1] + default: + val = strings.Join(split[1:], "=") + } + out = append(out, &KeyValue{ + Key: key, + Value: val, + }) + } + return out +} + +// IsMarkedForRemoval checks if an environment variable is marked for removal. +func (e *KeyValue) IsMarkedForRemoval() (string, bool) { + key, marked := IsMarkedForRemoval(e.Key) + return key, marked +} diff --git a/pkg/api/v1beta1/event.go b/pkg/api/v1beta1/event.go new file mode 100644 index 00000000..6d4e607f --- /dev/null +++ b/pkg/api/v1beta1/event.go @@ -0,0 +1,152 @@ +/* + 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 v1beta1 + +import ( + "fmt" + "strings" +) + +const ( + // ValidEvents is the event mask of all valid events. + ValidEvents = EventMask((1 << (Event_LAST - 1)) - 1) +) + +// EventMask corresponds to a set of enumerated Events. +type EventMask int32 + +// ParseEventMask parses a string representation into an EventMask. +func ParseEventMask(events ...string) (EventMask, error) { + var mask EventMask + + bits := map[string]Event{ + "runpodsandbox": Event_RUN_POD_SANDBOX, + "updatepodsandbox": Event_UPDATE_POD_SANDBOX, + "postupdatepodsandbox": Event_POST_UPDATE_POD_SANDBOX, + "stoppodsandbox": Event_STOP_POD_SANDBOX, + "removepodsandbox": Event_REMOVE_POD_SANDBOX, + "createcontainer": Event_CREATE_CONTAINER, + "postcreatecontainer": Event_POST_CREATE_CONTAINER, + "startcontainer": Event_START_CONTAINER, + "poststartcontainer": Event_POST_START_CONTAINER, + "updatecontainer": Event_UPDATE_CONTAINER, + "postupdatecontainer": Event_POST_UPDATE_CONTAINER, + "stopcontainer": Event_STOP_CONTAINER, + "removecontainer": Event_REMOVE_CONTAINER, + "validatecontaineradjustment": Event_VALIDATE_CONTAINER_ADJUSTMENT, + } + + for _, event := range events { + lcEvents := strings.ToLower(event) + for _, name := range strings.Split(lcEvents, ",") { + switch name { + case "all": + mask |= ValidEvents + continue + case "pod", "podsandbox": + for name, bit := range bits { + if strings.Contains(name, "pod") { + mask.Set(bit) + } + } + continue + case "container": + for name, bit := range bits { + if strings.Contains(name, "container") { + mask.Set(bit) + } + } + continue + } + + bit, ok := bits[strings.TrimSpace(name)] + if !ok { + return 0, fmt.Errorf("unknown event %q", name) + } + mask.Set(bit) + } + } + + return mask, nil +} + +// MustParseEventMask parses the given events, panic()ing on errors. +func MustParseEventMask(events ...string) EventMask { + mask, err := ParseEventMask(events...) + if err != nil { + panic(fmt.Sprintf("failed to parse events %s", strings.Join(events, " "))) + } + return mask +} + +// PrettyString returns a human-readable string representation of an EventMask. +func (m *EventMask) PrettyString() string { + names := map[Event]string{ + Event_RUN_POD_SANDBOX: "RunPodSandbox", + Event_UPDATE_POD_SANDBOX: "UpdatePodSandbox", + Event_POST_UPDATE_POD_SANDBOX: "PostUpdatePodSandbox", + Event_STOP_POD_SANDBOX: "StopPodSandbox", + Event_REMOVE_POD_SANDBOX: "RemovePodSandbox", + Event_CREATE_CONTAINER: "CreateContainer", + Event_POST_CREATE_CONTAINER: "PostCreateContainer", + Event_START_CONTAINER: "StartContainer", + Event_POST_START_CONTAINER: "PostStartContainer", + Event_UPDATE_CONTAINER: "UpdateContainer", + Event_POST_UPDATE_CONTAINER: "PostUpdateContainer", + Event_STOP_CONTAINER: "StopContainer", + Event_REMOVE_CONTAINER: "RemoveContainer", + Event_VALIDATE_CONTAINER_ADJUSTMENT: "ValidateContainerAdjustment", + } + + mask := *m + events, sep := "", "" + + for bit := Event_UNKNOWN + 1; bit <= Event_LAST; bit++ { + if mask.IsSet(bit) { + events += sep + names[bit] + sep = "," + mask.Clear(bit) + } + } + + if mask != 0 { + events += sep + fmt.Sprintf("unknown(0x%x)", mask) + } + + return events +} + +// Set sets the given Events in the mask. +func (m *EventMask) Set(events ...Event) *EventMask { + for _, e := range events { + *m |= (1 << (e - 1)) + } + return m +} + +// Clear clears the given Events in the mask. +func (m *EventMask) Clear(events ...Event) *EventMask { + for _, e := range events { + *m &^= (1 << (e - 1)) + } + return m +} + +// IsSet check if the given Event is set in the mask. +func (m *EventMask) IsSet(e Event) bool { + return *m&(1<<(e-1)) != 0 +} diff --git a/pkg/api/v1beta1/helpers.go b/pkg/api/v1beta1/helpers.go new file mode 100644 index 00000000..432aa0b7 --- /dev/null +++ b/pkg/api/v1beta1/helpers.go @@ -0,0 +1,71 @@ +/* + 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 v1beta1 + +// DupStringSlice creates a copy of a string slice. +func DupStringSlice(in []string) []string { + if in == nil { + return nil + } + out := make([]string, len(in)) + copy(out, in) + return out +} + +// DupStringMap creates a copy of a map with string keys and values. +func DupStringMap(in map[string]string) map[string]string { + if in == nil { + return nil + } + out := map[string]string{} + for k, v := range in { + out[k] = v + } + return out +} + +// IsMarkedForRemoval checks if a key is marked for removal. +// +// The key can be an annotation name, a mount container path, a device path, +// a namespace type, or an environment variable name. +// These are all marked for removal in adjustments by preceding +// their corresponding key with a '-'. +func IsMarkedForRemoval(key string) (string, bool) { + if key == "" { + return "", false + } + if key[0] != '-' { + return key, false + } + return key[1:], true +} + +// MarkForRemoval returns a key marked for removal. +func MarkForRemoval(key string) string { + return "-" + key +} + +// ClearRemovalMarker returns a key cleared from any removal marker. +func ClearRemovalMarker(key string) string { + if key == "" { + return "" + } + if key[0] == '-' { + return key[1:] + } + return key +} diff --git a/pkg/api/v1beta1/hooks.go b/pkg/api/v1beta1/hooks.go new file mode 100644 index 00000000..1a1ad967 --- /dev/null +++ b/pkg/api/v1beta1/hooks.go @@ -0,0 +1,103 @@ +/* + 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 v1beta1 + +import ( + rspec "github.com/opencontainers/runtime-spec/specs-go" +) + +// Append appends the given hooks to the existing ones. +func (hooks *Hooks) Append(h *Hooks) *Hooks { + if h == nil { + return hooks + } + hooks.Prestart = append(hooks.Prestart, h.Prestart...) + hooks.CreateRuntime = append(hooks.CreateRuntime, h.CreateRuntime...) + hooks.CreateContainer = append(hooks.CreateContainer, h.CreateContainer...) + hooks.StartContainer = append(hooks.StartContainer, h.StartContainer...) + hooks.Poststart = append(hooks.Poststart, h.Poststart...) + hooks.Poststop = append(hooks.Poststop, h.Poststop...) + + return hooks +} + +// Hooks returns itself it any of its hooks is set. Otherwise it returns nil. +func (hooks *Hooks) Hooks() *Hooks { + if hooks == nil { + return nil + } + + if len(hooks.Prestart) > 0 { + return hooks + } + if len(hooks.CreateRuntime) > 0 { + return hooks + } + if len(hooks.CreateContainer) > 0 { + return hooks + } + if len(hooks.StartContainer) > 0 { + return hooks + } + if len(hooks.Poststart) > 0 { + return hooks + } + if len(hooks.Poststop) > 0 { + return hooks + } + + return nil +} + +// ToOCI returns the hook for an OCI runtime Spec. +func (h *Hook) ToOCI() rspec.Hook { + return rspec.Hook{ + Path: h.Path, + Args: DupStringSlice(h.Args), + Env: DupStringSlice(h.Env), + Timeout: h.Timeout.Get(), + } +} + +// FromOCIHooks returns hooks from an OCI runtime Spec. +func FromOCIHooks(o *rspec.Hooks) *Hooks { + if o == nil { + return nil + } + return &Hooks{ + Prestart: FromOCIHookSlice(o.Prestart), + CreateRuntime: FromOCIHookSlice(o.CreateRuntime), + CreateContainer: FromOCIHookSlice(o.CreateContainer), + StartContainer: FromOCIHookSlice(o.StartContainer), + Poststart: FromOCIHookSlice(o.Poststart), + Poststop: FromOCIHookSlice(o.Poststop), + } +} + +// FromOCIHookSlice returns a hook slice from an OCI runtime Spec. +func FromOCIHookSlice(o []rspec.Hook) []*Hook { + var hooks []*Hook + for _, h := range o { + hooks = append(hooks, &Hook{ + Path: h.Path, + Args: DupStringSlice(h.Args), + Env: DupStringSlice(h.Env), + Timeout: Int(h.Timeout), + }) + } + return hooks +} diff --git a/pkg/api/v1beta1/ioprio.go b/pkg/api/v1beta1/ioprio.go new file mode 100644 index 00000000..6204e239 --- /dev/null +++ b/pkg/api/v1beta1/ioprio.go @@ -0,0 +1,63 @@ +/* + 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 v1beta1 + +import ( + rspec "github.com/opencontainers/runtime-spec/specs-go" +) + +// FromOCILinuxIOPriority returns a LinuxIOPriority corresponding to the +// OCI LinuxIOPriority. +func FromOCILinuxIOPriority(o *rspec.LinuxIOPriority) *LinuxIOPriority { + if o == nil { + return nil + } + + ioprio := &LinuxIOPriority{ + Class: FromOCIIOPriorityClass(o.Class), + Priority: int32(o.Priority), + } + + return ioprio +} + +// ToOCI returns the OCI LinuxIOPriority corresponding to the LinuxIOPriority. +func (ioprio *LinuxIOPriority) ToOCI() *rspec.LinuxIOPriority { + if ioprio == nil { + return nil + } + + return &rspec.LinuxIOPriority{ + Class: ioprio.Class.ToOCI(), + Priority: int(ioprio.Priority), + } +} + +// FromOCIIOPriorityClass returns the IOPrioClass corresponding the the given +// OCI IOPriorityClass. +func FromOCIIOPriorityClass(o rspec.IOPriorityClass) IOPrioClass { + return IOPrioClass(IOPrioClass_value[string(o)]) +} + +// ToOCI returns the OCI IOPriorityClass corresponding to the given +// IOPrioClass. +func (c IOPrioClass) ToOCI() rspec.IOPriorityClass { + if c == IOPrioClass_IOPRIO_CLASS_NONE { + return rspec.IOPriorityClass("") + } + return rspec.IOPriorityClass(IOPrioClass_name[int32(c)]) +} diff --git a/pkg/api/v1beta1/mount.go b/pkg/api/v1beta1/mount.go new file mode 100644 index 00000000..28523a36 --- /dev/null +++ b/pkg/api/v1beta1/mount.go @@ -0,0 +1,88 @@ +/* + 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 v1beta1 + +import ( + "sort" + + rspec "github.com/opencontainers/runtime-spec/specs-go" +) + +const ( + // SELinuxRelabel is a Mount pseudo-option to request relabeling. + SELinuxRelabel = "relabel" +) + +// FromOCIMounts returns a Mount slice for an OCI runtime Spec. +func FromOCIMounts(o []rspec.Mount) []*Mount { + var mounts []*Mount + for _, m := range o { + mounts = append(mounts, &Mount{ + Destination: m.Destination, + Type: m.Type, + Source: m.Source, + Options: DupStringSlice(m.Options), + }) + } + return mounts +} + +// ToOCI returns a Mount for an OCI runtime Spec. +func (m *Mount) ToOCI(propagationQuery *string) rspec.Mount { + o := rspec.Mount{ + Destination: m.Destination, + Type: m.Type, + Source: m.Source, + } + for _, opt := range m.Options { + o.Options = append(o.Options, opt) + if propagationQuery != nil && (opt == "rprivate" || opt == "rshared" || opt == "rslave") { + *propagationQuery = opt + } + } + return o +} + +// Cmp returns true if the mounts are equal. +func (m *Mount) Cmp(v *Mount) bool { + if v == nil { + return false + } + if m.Destination != v.Destination || m.Type != v.Type || m.Source != v.Source || + len(m.Options) != len(v.Options) { + return false + } + + mOpts := make([]string, len(m.Options)) + vOpts := make([]string, len(m.Options)) + sort.Strings(mOpts) + sort.Strings(vOpts) + + for i, o := range mOpts { + if vOpts[i] != o { + return false + } + } + + return true +} + +// IsMarkedForRemoval checks if a Mount is marked for removal. +func (m *Mount) IsMarkedForRemoval() (string, bool) { + key, marked := IsMarkedForRemoval(m.Destination) + return key, marked +} diff --git a/pkg/api/v1beta1/namespace.go b/pkg/api/v1beta1/namespace.go new file mode 100644 index 00000000..7067f233 --- /dev/null +++ b/pkg/api/v1beta1/namespace.go @@ -0,0 +1,38 @@ +/* + 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 v1beta1 + +import ( + rspec "github.com/opencontainers/runtime-spec/specs-go" +) + +// FromOCILinuxNamespaces returns a namespace slice from an OCI runtime Spec. +func FromOCILinuxNamespaces(o []rspec.LinuxNamespace) []*LinuxNamespace { + var namespaces []*LinuxNamespace + for _, ns := range o { + namespaces = append(namespaces, &LinuxNamespace{ + Type: string(ns.Type), + Path: ns.Path, + }) + } + return namespaces +} + +// IsMarkedForRemoval checks if a LinuxNamespace is marked for removal. +func (n *LinuxNamespace) IsMarkedForRemoval() (string, bool) { + return IsMarkedForRemoval(n.Type) +} diff --git a/pkg/api/v1beta1/optional.go b/pkg/api/v1beta1/optional.go new file mode 100644 index 00000000..531738ea --- /dev/null +++ b/pkg/api/v1beta1/optional.go @@ -0,0 +1,341 @@ +/* + 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 v1beta1 + +import ( + "os" +) + +// +// XXX FIXME: +// +// The optional interface constructor should be updated/split up +// to avoid having to take an interface{} argument. Instead The +// optional types should have a +// - constructor taking the underlying native type +// - a Copy() function for copying them +// - a FromPointer constructor to create them from an optionally nil +// pointer to the underlying native type (to help constructing from +// structures that use a pointer to the native underlying type to +// denote optionality (OCI Spec mostly)) +// Creating from any other type should use one of these with any explicit +// cast for the argument as necessary. +// + +// String creates an Optional wrapper from its argument. +func String(v interface{}) *OptionalString { + var value string + + switch o := v.(type) { + case string: + value = o + case *string: + if o == nil { + return nil + } + value = *o + case *OptionalString: + if o == nil { + return nil + } + value = o.Value + default: + return nil + } + + return &OptionalString{ + Value: value, + } +} + +// Get returns nil if its value is unset or a pointer to the value itself. +func (o *OptionalString) Get() *string { + if o == nil { + return nil + } + v := o.Value + return &v +} + +// Int creates an Optional wrapper from its argument. +func Int(v interface{}) *OptionalInt { + var value int64 + + switch o := v.(type) { + case int: + value = int64(o) + case *int: + if o == nil { + return nil + } + value = int64(*o) + case *OptionalInt: + if o == nil { + return nil + } + value = o.Value + default: + return nil + } + + return &OptionalInt{ + Value: value, + } +} + +// Get returns nil if its value is unset or a pointer to the value itself. +func (o *OptionalInt) Get() *int { + if o == nil { + return nil + } + v := int(o.Value) + return &v +} + +// Int32 creates an Optional wrapper from its argument. +func Int32(v interface{}) *OptionalInt32 { + var value int32 + + switch o := v.(type) { + case int32: + value = o + case *int32: + if o == nil { + return nil + } + value = *o + case *OptionalInt32: + if o == nil { + return nil + } + value = o.Value + default: + return nil + } + + return &OptionalInt32{ + Value: value, + } +} + +// Get returns nil if its value is unset or a pointer to the value itself. +func (o *OptionalInt32) Get() *int32 { + if o == nil { + return nil + } + v := o.Value + return &v +} + +// UInt32 creates an Optional wrapper from its argument. +func UInt32(v interface{}) *OptionalUInt32 { + var value uint32 + + switch o := v.(type) { + case uint32: + value = o + case *uint32: + if o == nil { + return nil + } + value = *o + case *OptionalUInt32: + if o == nil { + return nil + } + value = o.Value + default: + return nil + } + + return &OptionalUInt32{ + Value: value, + } +} + +// Get returns nil if its value is unset or a pointer to the value itself. +func (o *OptionalUInt32) Get() *uint32 { + if o == nil { + return nil + } + v := o.Value + return &v +} + +// Int64 creates an Optional wrapper from its argument. +func Int64(v interface{}) *OptionalInt64 { + var value int64 + + switch o := v.(type) { + case int: + value = int64(o) + case uint: + value = int64(o) + case uint64: + value = int64(o) + case int64: + value = o + case *int64: + if o == nil { + return nil + } + value = *o + case *uint64: + if o == nil { + return nil + } + value = int64(*o) + case *OptionalInt64: + if o == nil { + return nil + } + value = o.Value + default: + return nil + } + + return &OptionalInt64{ + Value: value, + } +} + +// Get returns nil if its value is unset or a pointer to the value itself. +func (o *OptionalInt64) Get() *int64 { + if o == nil { + return nil + } + v := o.Value + return &v +} + +// UInt64 creates an Optional wrapper from its argument. +func UInt64(v interface{}) *OptionalUInt64 { + var value uint64 + + switch o := v.(type) { + case int: + value = uint64(o) + case uint: + value = uint64(o) + case int64: + value = uint64(o) + case uint64: + value = o + case *int64: + if o == nil { + return nil + } + value = uint64(*o) + case *uint64: + if o == nil { + return nil + } + value = *o + case *OptionalUInt64: + if o == nil { + return nil + } + value = o.Value + default: + return nil + } + + return &OptionalUInt64{ + Value: value, + } +} + +// Get returns nil if its value is unset or a pointer to the value itself. +func (o *OptionalUInt64) Get() *uint64 { + if o == nil { + return nil + } + v := o.Value + return &v +} + +// Bool creates an Optional wrapper from its argument. +func Bool(v interface{}) *OptionalBool { + var value bool + + switch o := v.(type) { + case bool: + value = o + case *bool: + if o == nil { + return nil + } + value = *o + case *OptionalBool: + if o == nil { + return nil + } + value = o.Value + default: + return nil + } + + return &OptionalBool{ + Value: value, + } +} + +// Get returns nil if its value is unset or a pointer to the value itself. +func (o *OptionalBool) Get() *bool { + if o == nil { + return nil + } + v := o.Value + return &v +} + +// FileMode creates an Optional wrapper from its argument. +func FileMode(v interface{}) *OptionalFileMode { + var value os.FileMode + + switch o := v.(type) { + case *os.FileMode: + if o == nil { + return nil + } + value = *o + case os.FileMode: + value = o + case *OptionalFileMode: + if o == nil { + return nil + } + value = os.FileMode(o.Value) + case uint32: + value = os.FileMode(o) + default: + return nil + } + + return &OptionalFileMode{ + Value: uint32(value), + } +} + +// Get returns nil if its value is unset or a pointer to the value itself. +func (o *OptionalFileMode) Get() *os.FileMode { + if o == nil { + return nil + } + v := os.FileMode(o.Value) + return &v +} diff --git a/pkg/api/v1beta1/owners.go b/pkg/api/v1beta1/owners.go new file mode 100644 index 00000000..15d72f5f --- /dev/null +++ b/pkg/api/v1beta1/owners.go @@ -0,0 +1,752 @@ +/* + 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. +*/ + +// TODO: Add comments to exported methods and functions. +// +//nolint:revive // exported symbols should have comments +package v1beta1 + +import ( + "fmt" + "strings" +) + +// +// Notes: +// OwningPlugins, FieldOwners and CompoundFieldOwners are not protected +// against concurrent access and therefore not goroutine safe. +// +// None of these functions are used by plugins directly. These are used by +// the runtime adaptation code to track container adjustments and updates +// requested by plugins, and to detect conflicting requests. +// + +func NewOwningPlugins() *OwningPlugins { + return &OwningPlugins{ + Owners: make(map[string]*FieldOwners), + } +} + +func (o *OwningPlugins) ClaimAnnotation(id, key, plugin string) error { + return o.mustOwnersFor(id).ClaimAnnotation(key, plugin) +} + +func (o *OwningPlugins) ClaimMount(id, destination, plugin string) error { + return o.mustOwnersFor(id).ClaimMount(destination, plugin) +} + +func (o *OwningPlugins) ClaimHooks(id, plugin string) error { + return o.mustOwnersFor(id).ClaimHooks(plugin) +} + +func (o *OwningPlugins) ClaimDevice(id, path, plugin string) error { + return o.mustOwnersFor(id).ClaimDevice(path, plugin) +} + +func (o *OwningPlugins) ClaimNamespace(id, typ, plugin string) error { + return o.mustOwnersFor(id).ClaimNamespace(typ, plugin) +} + +func (o *OwningPlugins) ClaimCdiDevice(id, name, plugin string) error { + return o.mustOwnersFor(id).ClaimCdiDevice(name, plugin) +} + +func (o *OwningPlugins) ClaimEnv(id, name, plugin string) error { + return o.mustOwnersFor(id).ClaimEnv(name, plugin) +} + +func (o *OwningPlugins) ClaimArgs(id, plugin string) error { + return o.mustOwnersFor(id).ClaimArgs(plugin) +} + +func (o *OwningPlugins) ClaimMemLimit(id, plugin string) error { + return o.mustOwnersFor(id).ClaimMemLimit(plugin) +} + +func (o *OwningPlugins) ClaimMemReservation(id, plugin string) error { + return o.mustOwnersFor(id).ClaimMemReservation(plugin) +} + +func (o *OwningPlugins) ClaimMemSwapLimit(id, plugin string) error { + return o.mustOwnersFor(id).ClaimMemSwapLimit(plugin) +} + +func (o *OwningPlugins) ClaimMemKernelLimit(id, plugin string) error { + return o.mustOwnersFor(id).ClaimMemKernelLimit(plugin) +} + +func (o *OwningPlugins) ClaimMemTCPLimit(id, plugin string) error { + return o.mustOwnersFor(id).ClaimMemTCPLimit(plugin) +} + +func (o *OwningPlugins) ClaimMemSwappiness(id, plugin string) error { + return o.mustOwnersFor(id).ClaimMemSwappiness(plugin) +} + +func (o *OwningPlugins) ClaimMemDisableOomKiller(id, plugin string) error { + return o.mustOwnersFor(id).ClaimMemDisableOomKiller(plugin) +} + +func (o *OwningPlugins) ClaimMemUseHierarchy(id, plugin string) error { + return o.mustOwnersFor(id).ClaimMemUseHierarchy(plugin) +} + +func (o *OwningPlugins) ClaimCPUShares(id, plugin string) error { + return o.mustOwnersFor(id).ClaimCPUShares(plugin) +} + +func (o *OwningPlugins) ClaimCPUQuota(id, plugin string) error { + return o.mustOwnersFor(id).ClaimCPUQuota(plugin) +} + +func (o *OwningPlugins) ClaimCPUPeriod(id, plugin string) error { + return o.mustOwnersFor(id).ClaimCPUPeriod(plugin) +} + +func (o *OwningPlugins) ClaimCPURealtimeRuntime(id, plugin string) error { + return o.mustOwnersFor(id).ClaimCPURealtimeRuntime(plugin) +} + +func (o *OwningPlugins) ClaimCPURealtimePeriod(id, plugin string) error { + return o.mustOwnersFor(id).ClaimCPURealtimePeriod(plugin) +} + +func (o *OwningPlugins) ClaimCPUSetCPUs(id, plugin string) error { + return o.mustOwnersFor(id).ClaimCPUSetCPUs(plugin) +} + +func (o *OwningPlugins) ClaimCPUSetMems(id, plugin string) error { + return o.mustOwnersFor(id).ClaimCPUSetMems(plugin) +} + +func (o *OwningPlugins) ClaimPidsLimit(id, plugin string) error { + return o.mustOwnersFor(id).ClaimPidsLimit(plugin) +} + +func (o *OwningPlugins) ClaimHugepageLimit(id, size, plugin string) error { + return o.mustOwnersFor(id).ClaimHugepageLimit(size, plugin) +} + +func (o *OwningPlugins) ClaimBlockioClass(id, plugin string) error { + return o.mustOwnersFor(id).ClaimBlockioClass(plugin) +} + +func (o *OwningPlugins) ClaimRdtClass(id, plugin string) error { + return o.mustOwnersFor(id).ClaimRdtClass(plugin) +} + +func (o *OwningPlugins) ClaimCgroupsUnified(id, key, plugin string) error { + return o.mustOwnersFor(id).ClaimCgroupsUnified(key, plugin) +} + +func (o *OwningPlugins) ClaimCgroupsPath(id, plugin string) error { + return o.mustOwnersFor(id).ClaimCgroupsPath(plugin) +} + +func (o *OwningPlugins) ClaimOomScoreAdj(id, plugin string) error { + return o.mustOwnersFor(id).ClaimOomScoreAdj(plugin) +} + +func (o *OwningPlugins) ClaimRlimit(id, typ, plugin string) error { + return o.mustOwnersFor(id).ClaimRlimit(typ, plugin) +} + +func (o *OwningPlugins) ClaimIOPriority(id, plugin string) error { + return o.mustOwnersFor(id).ClaimIOPriority(plugin) +} + +func (o *OwningPlugins) ClaimSeccompPolicy(id, plugin string) error { + return o.mustOwnersFor(id).ClaimSeccompPolicy(plugin) +} + +func (o *OwningPlugins) ClearAnnotation(id, key, plugin string) { + o.mustOwnersFor(id).ClearAnnotation(key, plugin) +} + +func (o *OwningPlugins) ClearMount(id, key, plugin string) { + o.mustOwnersFor(id).ClearMount(key, plugin) +} + +func (o *OwningPlugins) ClearDevice(id, key, plugin string) { + o.mustOwnersFor(id).ClearDevice(key, plugin) +} + +func (o *OwningPlugins) ClearEnv(id, key, plugin string) { + o.mustOwnersFor(id).ClearEnv(key, plugin) +} + +func (o *OwningPlugins) ClearArgs(id, plugin string) { + o.mustOwnersFor(id).ClearArgs(plugin) +} + +func (o *OwningPlugins) AnnotationOwner(id, key string) (string, bool) { + return o.ownersFor(id).compoundOwner(Field_Annotations.Key(), key) +} + +func (o *OwningPlugins) MountOwner(id, destination string) (string, bool) { + return o.ownersFor(id).compoundOwner(Field_Mounts.Key(), destination) +} + +func (o *OwningPlugins) HooksOwner(id string) (string, bool) { + return o.ownersFor(id).simpleOwner(Field_OciHooks.Key()) +} + +func (o *OwningPlugins) DeviceOwner(id, path string) (string, bool) { + return o.ownersFor(id).compoundOwner(Field_Devices.Key(), path) +} + +func (o *OwningPlugins) NamespaceOwner(id, path string) (string, bool) { + return o.ownersFor(id).compoundOwner(Field_Namespace.Key(), path) +} + +func (o *OwningPlugins) NamespaceOwners(id string) (map[string]string, bool) { + return o.ownersFor(id).compoundOwnerMap(Field_Namespace.Key()) +} + +func (o *OwningPlugins) EnvOwner(id, name string) (string, bool) { + return o.ownersFor(id).compoundOwner(Field_Env.Key(), name) +} + +func (o *OwningPlugins) ArgsOwner(id string) (string, bool) { + return o.ownersFor(id).simpleOwner(Field_Args.Key()) +} + +func (o *OwningPlugins) MemLimitOwner(id string) (string, bool) { + return o.ownersFor(id).simpleOwner(Field_MemLimit.Key()) +} + +func (o *OwningPlugins) MemReservationOwner(id string) (string, bool) { + return o.ownersFor(id).simpleOwner(Field_MemReservation.Key()) +} + +func (o *OwningPlugins) MemSwapLimitOwner(id string) (string, bool) { + return o.ownersFor(id).simpleOwner(Field_MemSwapLimit.Key()) +} + +func (o *OwningPlugins) MemKernelLimitOwner(id string) (string, bool) { + return o.ownersFor(id).simpleOwner(Field_MemKernelLimit.Key()) +} + +func (o *OwningPlugins) MemTCPLimitOwner(id string) (string, bool) { + return o.ownersFor(id).simpleOwner(Field_MemTCPLimit.Key()) +} + +func (o *OwningPlugins) MemSwappinessOwner(id string) (string, bool) { + return o.ownersFor(id).simpleOwner(Field_MemSwappiness.Key()) +} + +func (o *OwningPlugins) MemDisableOomKillerOwner(id string) (string, bool) { + return o.ownersFor(id).simpleOwner(Field_MemDisableOomKiller.Key()) +} + +func (o *OwningPlugins) MemUseHierarchyOwner(id string) (string, bool) { + return o.ownersFor(id).simpleOwner(Field_MemUseHierarchy.Key()) +} + +func (o *OwningPlugins) CPUSharesOwner(id string) (string, bool) { + return o.ownersFor(id).simpleOwner(Field_CPUShares.Key()) +} + +func (o *OwningPlugins) CPUQuotaOwner(id string) (string, bool) { + return o.ownersFor(id).simpleOwner(Field_CPUQuota.Key()) +} + +func (o *OwningPlugins) CPUPeriodOwner(id string) (string, bool) { + return o.ownersFor(id).simpleOwner(Field_CPUPeriod.Key()) +} + +func (o *OwningPlugins) CPURealtimeRuntimeOwner(id string) (string, bool) { + return o.ownersFor(id).simpleOwner(Field_CPURealtimeRuntime.Key()) +} + +func (o *OwningPlugins) CPURealtimePeriodOwner(id string) (string, bool) { + return o.ownersFor(id).simpleOwner(Field_CPURealtimePeriod.Key()) +} + +func (o *OwningPlugins) CPUSetCPUsOwner(id string) (string, bool) { + return o.ownersFor(id).simpleOwner(Field_CPUSetCPUs.Key()) +} + +func (o *OwningPlugins) CPUSetMemsOwner(id string) (string, bool) { + return o.ownersFor(id).simpleOwner(Field_CPUSetMems.Key()) +} + +func (o *OwningPlugins) PidsLimitOwner(id string) (string, bool) { + return o.ownersFor(id).simpleOwner(Field_PidsLimit.Key()) +} + +func (o *OwningPlugins) HugepageLimitOwner(id, size string) (string, bool) { + return o.ownersFor(id).compoundOwner(Field_HugepageLimits.Key(), size) +} + +func (o *OwningPlugins) BlockioClassOwner(id string) (string, bool) { + return o.ownersFor(id).simpleOwner(Field_BlockioClass.Key()) +} + +func (o *OwningPlugins) RdtClassOwner(id string) (string, bool) { + return o.ownersFor(id).simpleOwner(Field_RdtClass.Key()) +} + +func (o *OwningPlugins) CgroupsUnifiedOwner(id, key string) (string, bool) { + return o.ownersFor(id).compoundOwner(Field_CgroupsUnified.Key(), key) +} + +func (o *OwningPlugins) CgroupsPathOwner(id string) (string, bool) { + return o.ownersFor(id).simpleOwner(Field_CgroupsPath.Key()) +} + +func (o *OwningPlugins) OomScoreAdjOwner(id string) (string, bool) { + return o.ownersFor(id).simpleOwner(Field_OomScoreAdj.Key()) +} + +func (o *OwningPlugins) RlimitOwner(id, typ string) (string, bool) { + return o.ownersFor(id).compoundOwner(Field_Rlimits.Key(), typ) +} + +func (o *OwningPlugins) IOPriorityOwner(id string) (string, bool) { + return o.ownersFor(id).simpleOwner(Field_IoPriority.Key()) +} + +func (o *OwningPlugins) SeccompPolicyOwner(id string) (string, bool) { + return o.ownersFor(id).simpleOwner(Field_SeccompPolicy.Key()) +} + +func (o *OwningPlugins) mustOwnersFor(id string) *FieldOwners { + f, ok := o.Owners[id] + if !ok { + f = NewFieldOwners() + o.Owners[id] = f + } + return f +} + +func (o *OwningPlugins) ownersFor(id string) *FieldOwners { + f, ok := o.Owners[id] + if !ok { + return nil + } + return f +} + +func NewFieldOwners() *FieldOwners { + return &FieldOwners{ + Simple: make(map[int32]string), + Compound: make(map[int32]*CompoundFieldOwners), + } +} + +func (f *FieldOwners) IsCompoundConflict(field int32, key, plugin string) error { + m, ok := f.Compound[field] + if !ok { + f.Compound[field] = NewCompoundFieldOwners() + return nil + } + + other, claimed := m.Owners[key] + if !claimed { + return nil + } + + clearer, ok := IsMarkedForRemoval(other) + if ok { + if clearer == plugin { + return nil + } + other = clearer + } + + return f.Conflict(field, plugin, other, key) +} + +func (f *FieldOwners) IsSimpleConflict(field int32, plugin string) error { + other, claimed := f.Simple[field] + if !claimed { + return nil + } + + clearer, ok := IsMarkedForRemoval(other) + if ok { + if clearer == plugin { + return nil + } + other = clearer + } + + return f.Conflict(field, plugin, other) +} + +func (f *FieldOwners) claimCompound(field int32, entry, plugin string) error { + if err := f.IsCompoundConflict(field, entry, plugin); err != nil { + return err + } + + f.Compound[field].Owners[entry] = plugin + return nil +} + +func (f *FieldOwners) claimSimple(field int32, plugin string) error { + if err := f.IsSimpleConflict(field, plugin); err != nil { + return err + } + + f.Simple[field] = plugin + return nil +} + +func (f *FieldOwners) ClaimAnnotation(key, plugin string) error { + return f.claimCompound(Field_Annotations.Key(), key, plugin) +} + +func (f *FieldOwners) ClaimMount(destination, plugin string) error { + return f.claimCompound(Field_Mounts.Key(), destination, plugin) +} + +func (f *FieldOwners) ClaimHooks(plugin string) error { + plugins := plugin + + if current, ok := f.simpleOwner(Field_OciHooks.Key()); ok { + f.clearSimple(Field_OciHooks.Key(), plugin) + plugins = current + "," + plugin + } + + f.claimSimple(Field_OciHooks.Key(), plugins) + return nil +} + +func (f *FieldOwners) ClaimDevice(path, plugin string) error { + return f.claimCompound(Field_Devices.Key(), path, plugin) +} + +func (f *FieldOwners) ClaimCdiDevice(name, plugin string) error { + return f.claimCompound(Field_CdiDevices.Key(), name, plugin) +} + +func (f *FieldOwners) ClaimNamespace(typ, plugin string) error { + return f.claimCompound(Field_Namespace.Key(), typ, plugin) +} + +func (f *FieldOwners) ClaimEnv(name, plugin string) error { + return f.claimCompound(Field_Env.Key(), name, plugin) +} + +func (f *FieldOwners) ClaimArgs(plugin string) error { + return f.claimSimple(Field_Args.Key(), plugin) +} + +func (f *FieldOwners) ClaimMemLimit(plugin string) error { + return f.claimSimple(Field_MemLimit.Key(), plugin) +} + +func (f *FieldOwners) ClaimMemReservation(plugin string) error { + return f.claimSimple(Field_MemReservation.Key(), plugin) +} + +func (f *FieldOwners) ClaimMemSwapLimit(plugin string) error { + return f.claimSimple(Field_MemSwapLimit.Key(), plugin) +} + +func (f *FieldOwners) ClaimMemKernelLimit(plugin string) error { + return f.claimSimple(Field_MemKernelLimit.Key(), plugin) +} + +func (f *FieldOwners) ClaimMemTCPLimit(plugin string) error { + return f.claimSimple(Field_MemTCPLimit.Key(), plugin) +} + +func (f *FieldOwners) ClaimMemSwappiness(plugin string) error { + return f.claimSimple(Field_MemSwappiness.Key(), plugin) +} + +func (f *FieldOwners) ClaimMemDisableOomKiller(plugin string) error { + return f.claimSimple(Field_MemDisableOomKiller.Key(), plugin) +} + +func (f *FieldOwners) ClaimMemUseHierarchy(plugin string) error { + return f.claimSimple(Field_MemUseHierarchy.Key(), plugin) +} + +func (f *FieldOwners) ClaimCPUShares(plugin string) error { + return f.claimSimple(Field_CPUShares.Key(), plugin) +} + +func (f *FieldOwners) ClaimCPUQuota(plugin string) error { + return f.claimSimple(Field_CPUQuota.Key(), plugin) +} + +func (f *FieldOwners) ClaimCPUPeriod(plugin string) error { + return f.claimSimple(Field_CPUPeriod.Key(), plugin) +} + +func (f *FieldOwners) ClaimCPURealtimeRuntime(plugin string) error { + return f.claimSimple(Field_CPURealtimeRuntime.Key(), plugin) +} + +func (f *FieldOwners) ClaimCPURealtimePeriod(plugin string) error { + return f.claimSimple(Field_CPURealtimePeriod.Key(), plugin) +} + +func (f *FieldOwners) ClaimCPUSetCPUs(plugin string) error { + return f.claimSimple(Field_CPUSetCPUs.Key(), plugin) +} + +func (f *FieldOwners) ClaimCPUSetMems(plugin string) error { + return f.claimSimple(Field_CPUSetMems.Key(), plugin) +} + +func (f *FieldOwners) ClaimPidsLimit(plugin string) error { + return f.claimSimple(Field_PidsLimit.Key(), plugin) +} + +func (f *FieldOwners) ClaimHugepageLimit(size, plugin string) error { + return f.claimCompound(Field_HugepageLimits.Key(), size, plugin) +} + +func (f *FieldOwners) ClaimBlockioClass(plugin string) error { + return f.claimSimple(Field_BlockioClass.Key(), plugin) +} + +func (f *FieldOwners) ClaimRdtClass(plugin string) error { + return f.claimSimple(Field_RdtClass.Key(), plugin) +} + +func (f *FieldOwners) ClaimCgroupsUnified(key, plugin string) error { + return f.claimCompound(Field_CgroupsUnified.Key(), key, plugin) +} + +func (f *FieldOwners) ClaimCgroupsPath(plugin string) error { + return f.claimSimple(Field_CgroupsPath.Key(), plugin) +} + +func (f *FieldOwners) ClaimOomScoreAdj(plugin string) error { + return f.claimSimple(Field_OomScoreAdj.Key(), plugin) +} + +func (f *FieldOwners) ClaimRlimit(typ, plugin string) error { + return f.claimCompound(Field_Rlimits.Key(), typ, plugin) +} + +func (f *FieldOwners) ClaimIOPriority(plugin string) error { + return f.claimSimple(Field_IoPriority.Key(), plugin) +} + +func (f *FieldOwners) ClaimSeccompPolicy(plugin string) error { + return f.claimSimple(Field_SeccompPolicy.Key(), plugin) +} + +func (f *FieldOwners) clearCompound(field int32, key, plugin string) { + m, ok := f.Compound[field] + if !ok { + m = NewCompoundFieldOwners() + f.Compound[field] = m + } + + m.Owners[key] = MarkForRemoval(plugin) +} + +func (f *FieldOwners) clearSimple(field int32, plugin string) { + f.Simple[field] = MarkForRemoval(plugin) +} + +func (f *FieldOwners) ClearAnnotation(key, plugin string) { + f.clearCompound(Field_Annotations.Key(), key, plugin) +} + +func (f *FieldOwners) ClearMount(destination, plugin string) { + f.clearCompound(Field_Mounts.Key(), destination, plugin) +} + +func (f *FieldOwners) ClearDevice(path, plugin string) { + f.clearCompound(Field_Devices.Key(), path, plugin) +} + +func (f *FieldOwners) ClearEnv(name, plugin string) { + f.clearCompound(Field_Env.Key(), name, plugin) +} + +func (f *FieldOwners) ClearArgs(plugin string) { + f.clearSimple(Field_Args.Key(), plugin) +} + +func (f *FieldOwners) Conflict(field int32, plugin, other string, qualifiers ...string) error { + return fmt.Errorf("plugins %q and %q both tried to set %s", + plugin, other, qualify(field, qualifiers...)) +} + +func (f *FieldOwners) compoundOwnerMap(field int32) (map[string]string, bool) { + if f == nil { + return nil, false + } + + m, ok := f.Compound[field] + if !ok { + return nil, false + } + + return m.Owners, true +} + +func (f *FieldOwners) compoundOwner(field int32, key string) (string, bool) { + if f == nil { + return "", false + } + + m, ok := f.Compound[field] + if !ok { + return "", false + } + + plugin, ok := m.Owners[key] + return plugin, ok +} + +func (f *FieldOwners) simpleOwner(field int32) (string, bool) { + if f == nil { + return "", false + } + + plugin, ok := f.Simple[field] + return plugin, ok +} + +func (f *FieldOwners) AnnotationOwner(key string) (string, bool) { + return f.compoundOwner(Field_Annotations.Key(), key) +} + +func (f *FieldOwners) MountOwner(destination string) (string, bool) { + return f.compoundOwner(Field_Mounts.Key(), destination) +} + +func (f *FieldOwners) DeviceOwner(path string) (string, bool) { + return f.compoundOwner(Field_Devices.Key(), path) +} + +func (f *FieldOwners) NamespaceOwner(typ string) (string, bool) { + return f.compoundOwner(Field_Devices.Key(), typ) +} + +func (f *FieldOwners) EnvOwner(name string) (string, bool) { + return f.compoundOwner(Field_Env.Key(), name) +} + +func (f *FieldOwners) ArgsOwner() (string, bool) { + return f.simpleOwner(Field_Args.Key()) +} + +func (f *FieldOwners) MemLimitOwner() (string, bool) { + return f.simpleOwner(Field_MemLimit.Key()) +} + +func (f *FieldOwners) MemReservationOwner() (string, bool) { + return f.simpleOwner(Field_MemReservation.Key()) +} + +func (f *FieldOwners) MemSwapLimitOwner() (string, bool) { + return f.simpleOwner(Field_MemSwapLimit.Key()) +} + +func (f *FieldOwners) MemKernelLimitOwner() (string, bool) { + return f.simpleOwner(Field_MemKernelLimit.Key()) +} + +func (f *FieldOwners) MemTCPLimitOwner() (string, bool) { + return f.simpleOwner(Field_MemTCPLimit.Key()) +} + +func (f *FieldOwners) MemSwappinessOwner() (string, bool) { + return f.simpleOwner(Field_MemSwappiness.Key()) +} + +func (f *FieldOwners) MemDisableOomKillerOwner() (string, bool) { + return f.simpleOwner(Field_MemDisableOomKiller.Key()) +} + +func (f *FieldOwners) MemUseHierarchyOwner() (string, bool) { + return f.simpleOwner(Field_MemUseHierarchy.Key()) +} + +func (f *FieldOwners) CPUSharesOwner() (string, bool) { + return f.simpleOwner(Field_CPUShares.Key()) +} + +func (f *FieldOwners) CPUQuotaOwner() (string, bool) { + return f.simpleOwner(Field_CPUQuota.Key()) +} + +func (f *FieldOwners) CPUPeriodOwner() (string, bool) { + return f.simpleOwner(Field_CPUPeriod.Key()) +} + +func (f *FieldOwners) CPURealtimeRuntimeOwner() (string, bool) { + return f.simpleOwner(Field_CPURealtimeRuntime.Key()) +} + +func (f *FieldOwners) CPURealtimePeriodOwner() (string, bool) { + return f.simpleOwner(Field_CPURealtimePeriod.Key()) +} + +func (f *FieldOwners) CPUSetCPUsOwner() (string, bool) { + return f.simpleOwner(Field_CPUSetCPUs.Key()) +} + +func (f *FieldOwners) CPUSetMemsOwner() (string, bool) { + return f.simpleOwner(Field_CPUSetMems.Key()) +} + +func (f *FieldOwners) PidsLimitOwner() (string, bool) { + return f.simpleOwner(Field_PidsLimit.Key()) +} + +func (f *FieldOwners) HugepageLimitOwner(size string) (string, bool) { + return f.compoundOwner(Field_HugepageLimits.Key(), size) +} + +func (f *FieldOwners) BlockioClassOwner() (string, bool) { + return f.simpleOwner(Field_BlockioClass.Key()) +} + +func (f *FieldOwners) RdtClassOwner() (string, bool) { + return f.simpleOwner(Field_RdtClass.Key()) +} + +func (f *FieldOwners) CgroupsUnifiedOwner(key string) (string, bool) { + return f.compoundOwner(Field_CgroupsUnified.Key(), key) +} + +func (f *FieldOwners) CgroupsPathOwner() (string, bool) { + return f.simpleOwner(Field_CgroupsPath.Key()) +} + +func (f *FieldOwners) OomScoreAdjOwner() (string, bool) { + return f.simpleOwner(Field_OomScoreAdj.Key()) +} + +func (f *FieldOwners) RlimitOwner(typ string) (string, bool) { + return f.compoundOwner(Field_Rlimits.Key(), typ) +} + +func qualify(field int32, qualifiers ...string) string { + return Field(field).String() + " " + strings.Join(append([]string{}, qualifiers...), " ") +} + +func NewCompoundFieldOwners() *CompoundFieldOwners { + return &CompoundFieldOwners{ + Owners: make(map[string]string), + } +} + +func (f Field) Key() int32 { + return int32(f) +} diff --git a/pkg/api/v1beta1/owners_test.go b/pkg/api/v1beta1/owners_test.go new file mode 100644 index 00000000..c0eaa06d --- /dev/null +++ b/pkg/api/v1beta1/owners_test.go @@ -0,0 +1,115 @@ +/* + 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 v1beta1_test + +import ( + "testing" + + api "github.com/containerd/nri/pkg/api/v1beta1" + + "github.com/stretchr/testify/require" +) + +func TestSimpleClaims(t *testing.T) { + o := api.NewOwningPlugins() + + // claim hooks + err := o.ClaimHooks("ctr0", "test0") + require.NoError(t, err, "hooks") + + // claim memory limit + err = o.ClaimMemLimit("ctr0", "test0") + require.NoError(t, err, "memory limit") + + // claim memory limit of another container + err = o.ClaimMemLimit("ctr1", "test0") + require.NoError(t, err, "another memory limit") + + // claim memory limit of same container by another plugin + err = o.ClaimMemLimit("ctr0", "test1") + require.Error(t, err, "same memory limit by another plugin, should conflict") + + // claim CPU shares + err = o.ClaimCPUShares("ctr0", "test0") + require.NoError(t, err, "CPU shares") + + // claim CPU shares of another container + err = o.ClaimCPUShares("ctr1", "test0") + require.NoError(t, err, "other CPU shares") + + // claim CPU shares of same container by another plugin + err = o.ClaimCPUShares("ctr0", "test1") + require.Error(t, err, "same CPU shares by another plugin, should conflict") + + // claim args + err = o.ClaimArgs("ctr0", "test0") + require.NoError(t, err, "args") + + // claim same args by another plugin + err = o.ClaimArgs("ctr0", "test1") + require.Error(t, err, "same args by another plugin, should conflict") + + // clear args + o.ClearArgs("ctr0", "test1") + + // claim args after clearing + err = o.ClaimArgs("ctr0", "test1") + require.NoError(t, err, "try again same args, should not conflict") + + // clear args + o.ClearArgs("ctr0", "test1") + + // claim args by another plugin + err = o.ClaimArgs("ctr0", "test0") + require.Error(t, err, "try again same args by non-clearing plugin, should conflict") +} + +func TestCompoundClaims(t *testing.T) { + o := api.NewOwningPlugins() + + // claim environment variable + err := o.ClaimEnv("ctr0", "VAR0", "test0") + require.NoError(t, err, "env VAR0") + + // claim another environment variable + err = o.ClaimEnv("ctr0", "VAR1", "test0") + require.NoError(t, err, "env VAR1") + + // claim environment variable of another container + err = o.ClaimEnv("ctr1", "VAR0", "test1") + require.NoError(t, err, "env VAR0 of another container") + + // claim already claimed environment variable by another plugin + err = o.ClaimEnv("ctr0", "VAR1", "test1") + require.Error(t, err, "env VAR1 of same container by another plugin, should conflict") + + // clear environment variable + o.ClearEnv("ctr0", "VAR1", "test1") + + // claim same environment variable + err = o.ClaimEnv("ctr0", "VAR1", "test1") + require.NoError(t, err, "try again env VAR1, should not conflict") + + // clear again environment variable + o.ClearEnv("ctr0", "VAR1", "test0") + + // claim same environment variable by another plugin + err = o.ClaimEnv("ctr0", "VAR1", "test1") + require.Error(t, err, "try again env VAR1 by non-clearing plugin, should conflict") + + require.Equal(t, api.Field_Annotations.String(), "Annotations", "annotation field name") +} diff --git a/pkg/api/v1beta1/plugin.go b/pkg/api/v1beta1/plugin.go new file mode 100644 index 00000000..53cd4d1a --- /dev/null +++ b/pkg/api/v1beta1/plugin.go @@ -0,0 +1,59 @@ +/* + 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 v1beta1 + +import ( + "fmt" + "strings" +) + +const ( + // DefaultSocketPath is the default socket path for external plugins. + DefaultSocketPath = "/var/run/nri/nri.sock" + // PluginSocketEnvVar is used to inform plugins about pre-connected sockets. + PluginSocketEnvVar = "NRI_PLUGIN_SOCKET" + // PluginNameEnvVar is used to inform NRI-launched plugins about their name. + PluginNameEnvVar = "NRI_PLUGIN_NAME" + // PluginIdxEnvVar is used to inform NRI-launched plugins about their ID. + PluginIdxEnvVar = "NRI_PLUGIN_IDX" +) + +// ParsePluginName parses the (file)name of a plugin into an index and a base. +func ParsePluginName(name string) (string, string, error) { + split := strings.SplitN(name, "-", 2) + if len(split) < 2 { + return "", "", fmt.Errorf("invalid plugin name %q, idx-pluginname expected", name) + } + + if err := CheckPluginIndex(split[0]); err != nil { + return "", "", err + } + + return split[0], split[1], nil +} + +// CheckPluginIndex checks the validity of a plugin index. +func CheckPluginIndex(idx string) error { + if len(idx) != 2 { + return fmt.Errorf("invalid plugin index %q, must be 2 digits", idx) + } + //nolint:staticcheck // could apply De Morgan's law + if !('0' <= idx[0] && idx[0] <= '9') || !('0' <= idx[1] && idx[1] <= '9') { + return fmt.Errorf("invalid plugin index %q (not [0-9][0-9])", idx) + } + return nil +} diff --git a/pkg/api/v1beta1/resources.go b/pkg/api/v1beta1/resources.go new file mode 100644 index 00000000..64957b72 --- /dev/null +++ b/pkg/api/v1beta1/resources.go @@ -0,0 +1,203 @@ +//go:build !tinygo.wasm + +/* + 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 v1beta1 + +import ( + rspec "github.com/opencontainers/runtime-spec/specs-go" +) + +// FromOCILinuxResources returns resources from an OCI runtime Spec. +func FromOCILinuxResources(o *rspec.LinuxResources, _ map[string]string) *LinuxResources { + if o == nil { + return nil + } + l := &LinuxResources{} + if m := o.Memory; m != nil { + l.Memory = &LinuxMemory{ + Limit: Int64(m.Limit), + Reservation: Int64(m.Reservation), + Swap: Int64(m.Swap), + Kernel: Int64(m.Kernel), + KernelTcp: Int64(m.KernelTCP), + Swappiness: UInt64(m.Swappiness), + DisableOomKiller: Bool(m.DisableOOMKiller), + UseHierarchy: Bool(m.UseHierarchy), + } + } + if c := o.CPU; c != nil { + l.Cpu = &LinuxCPU{ + Shares: UInt64(c.Shares), + Quota: Int64(c.Quota), + Period: UInt64(c.Period), + RealtimeRuntime: Int64(c.RealtimeRuntime), + RealtimePeriod: UInt64(c.RealtimePeriod), + Cpus: c.Cpus, + Mems: c.Mems, + } + } + for _, h := range o.HugepageLimits { + l.HugepageLimits = append(l.HugepageLimits, &HugepageLimit{ + PageSize: h.Pagesize, + Limit: h.Limit, + }) + } + for _, d := range o.Devices { + l.Devices = append(l.Devices, &LinuxDeviceCgroup{ + Allow: d.Allow, + Type: d.Type, + Major: Int64(d.Major), + Minor: Int64(d.Minor), + Access: d.Access, + }) + } + if p := o.Pids; p != nil { + l.Pids = &LinuxPids{ + Limit: p.Limit, + } + } + if len(o.Unified) != 0 { + l.Unified = make(map[string]string) + for k, v := range o.Unified { + l.Unified[k] = v + } + } + return l +} + +// ToOCI returns resources for an OCI runtime Spec. +func (r *LinuxResources) ToOCI() *rspec.LinuxResources { + if r == nil { + return nil + } + o := &rspec.LinuxResources{ + CPU: &rspec.LinuxCPU{}, + Memory: &rspec.LinuxMemory{}, + } + if r.Memory != nil { + o.Memory = &rspec.LinuxMemory{ + Limit: r.Memory.Limit.Get(), + Reservation: r.Memory.Reservation.Get(), + Swap: r.Memory.Swap.Get(), + Kernel: r.Memory.Kernel.Get(), + KernelTCP: r.Memory.KernelTcp.Get(), + Swappiness: r.Memory.Swappiness.Get(), + DisableOOMKiller: r.Memory.DisableOomKiller.Get(), + UseHierarchy: r.Memory.UseHierarchy.Get(), + } + } + if r.Cpu != nil { + o.CPU = &rspec.LinuxCPU{ + Shares: r.Cpu.Shares.Get(), + Quota: r.Cpu.Quota.Get(), + Period: r.Cpu.Period.Get(), + RealtimeRuntime: r.Cpu.RealtimeRuntime.Get(), + RealtimePeriod: r.Cpu.RealtimePeriod.Get(), + Cpus: r.Cpu.Cpus, + Mems: r.Cpu.Mems, + } + } + for _, l := range r.HugepageLimits { + o.HugepageLimits = append(o.HugepageLimits, rspec.LinuxHugepageLimit{ + Pagesize: l.PageSize, + Limit: l.Limit, + }) + } + if len(r.Unified) != 0 { + o.Unified = make(map[string]string) + for k, v := range r.Unified { + o.Unified[k] = v + } + } + for _, d := range r.Devices { + o.Devices = append(o.Devices, rspec.LinuxDeviceCgroup{ + Allow: d.Allow, + Type: d.Type, + Major: d.Major.Get(), + Minor: d.Minor.Get(), + Access: d.Access, + }) + } + if r.Pids != nil { + o.Pids = &rspec.LinuxPids{ + Limit: r.Pids.Limit, + } + } + return o +} + +// Copy creates a copy of the resources. +func (r *LinuxResources) Copy() *LinuxResources { + if r == nil { + return nil + } + o := &LinuxResources{} + if r.Memory != nil { + o.Memory = &LinuxMemory{ + Limit: Int64(r.Memory.GetLimit()), + Reservation: Int64(r.Memory.GetReservation()), + Swap: Int64(r.Memory.GetSwap()), + Kernel: Int64(r.Memory.GetKernel()), + KernelTcp: Int64(r.Memory.GetKernelTcp()), + Swappiness: UInt64(r.Memory.GetSwappiness()), + DisableOomKiller: Bool(r.Memory.GetDisableOomKiller()), + UseHierarchy: Bool(r.Memory.GetUseHierarchy()), + } + } + if r.Cpu != nil { + o.Cpu = &LinuxCPU{ + Shares: UInt64(r.Cpu.GetShares()), + Quota: Int64(r.Cpu.GetQuota()), + Period: UInt64(r.Cpu.GetPeriod()), + RealtimeRuntime: Int64(r.Cpu.GetRealtimeRuntime()), + RealtimePeriod: UInt64(r.Cpu.GetRealtimePeriod()), + Cpus: r.Cpu.GetCpus(), + Mems: r.Cpu.GetMems(), + } + } + for _, l := range r.HugepageLimits { + o.HugepageLimits = append(o.HugepageLimits, &HugepageLimit{ + PageSize: l.PageSize, + Limit: l.Limit, + }) + } + if len(r.Unified) != 0 { + o.Unified = make(map[string]string) + for k, v := range r.Unified { + o.Unified[k] = v + } + } + if r.Pids != nil { + o.Pids = &LinuxPids{ + Limit: r.Pids.Limit, + } + } + o.BlockioClass = String(r.BlockioClass) + o.RdtClass = String(r.RdtClass) + for _, d := range r.Devices { + o.Devices = append(o.Devices, &LinuxDeviceCgroup{ + Allow: d.Allow, + Type: d.Type, + Access: d.Access, + Major: Int64(d.Major), + Minor: Int64(d.Minor), + }) + } + + return o +} diff --git a/pkg/api/v1beta1/seccomp.go b/pkg/api/v1beta1/seccomp.go new file mode 100644 index 00000000..092192d5 --- /dev/null +++ b/pkg/api/v1beta1/seccomp.go @@ -0,0 +1,124 @@ +/* + 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 v1beta1 + +import ( + rspec "github.com/opencontainers/runtime-spec/specs-go" +) + +// FromOCILinuxSeccomp converts an seccomp configuration from an OCI runtime spec. +func FromOCILinuxSeccomp(o *rspec.LinuxSeccomp) *LinuxSeccomp { + var errno *OptionalUInt32 + if o.DefaultErrnoRet != nil { + errno = &OptionalUInt32{Value: uint32(*o.DefaultErrnoRet)} + } + + arches := make([]string, len(o.Architectures)) + for i, arch := range o.Architectures { + arches[i] = string(arch) + } + + flags := make([]string, len(o.Flags)) + for i, flag := range o.Flags { + flags[i] = string(flag) + } + + return &LinuxSeccomp{ + DefaultAction: string(o.DefaultAction), + DefaultErrno: errno, + Architectures: arches, + Flags: flags, + ListenerPath: o.ListenerPath, + ListenerMetadata: o.ListenerMetadata, + Syscalls: FromOCILinuxSyscalls(o.Syscalls), + } +} + +// FromOCILinuxSyscalls converts seccomp syscalls configuration from an OCI runtime spec. +func FromOCILinuxSyscalls(o []rspec.LinuxSyscall) []*LinuxSyscall { + syscalls := make([]*LinuxSyscall, len(o)) + + for i, syscall := range o { + var errno *OptionalUInt32 + if syscall.ErrnoRet != nil { + errno = &OptionalUInt32{Value: uint32(*syscall.ErrnoRet)} + } + + syscalls[i] = &LinuxSyscall{ + Names: syscall.Names, + Action: string(syscall.Action), + ErrnoRet: errno, + Args: FromOCILinuxSeccompArgs(syscall.Args), + } + } + + return syscalls +} + +// FromOCILinuxSeccompArgs converts seccomp syscall args from an OCI runtime spec. +func FromOCILinuxSeccompArgs(o []rspec.LinuxSeccompArg) []*LinuxSeccompArg { + args := make([]*LinuxSeccompArg, len(o)) + + for i, arg := range o { + args[i] = &LinuxSeccompArg{ + Index: uint32(arg.Index), + Value: arg.Value, + ValueTwo: arg.ValueTwo, + Op: string(arg.Op), + } + } + + return args +} + +// ToOCILinuxSyscalls converts seccomp syscalls configuration to an OCI runtime spec. +func ToOCILinuxSyscalls(o []*LinuxSyscall) []rspec.LinuxSyscall { + syscalls := make([]rspec.LinuxSyscall, len(o)) + + for i, syscall := range o { + var errnoRet *uint + + if syscall.ErrnoRet != nil { + *errnoRet = uint(syscall.ErrnoRet.Value) + } + + syscalls[i] = rspec.LinuxSyscall{ + Names: syscall.Names, + Action: rspec.LinuxSeccompAction(syscall.Action), + ErrnoRet: errnoRet, + Args: ToOCILinuxSeccompArgs(syscall.Args), + } + } + + return syscalls +} + +// ToOCILinuxSeccompArgs converts seccomp syscall args to an OCI runtime spec. +func ToOCILinuxSeccompArgs(o []*LinuxSeccompArg) []rspec.LinuxSeccompArg { + args := make([]rspec.LinuxSeccompArg, len(o)) + + for i, arg := range o { + args[i] = rspec.LinuxSeccompArg{ + Index: uint(arg.Index), + Value: arg.Value, + ValueTwo: arg.ValueTwo, + Op: rspec.LinuxSeccompOperator(arg.Op), + } + } + + return args +} diff --git a/pkg/api/v1beta1/strip.go b/pkg/api/v1beta1/strip.go new file mode 100644 index 00000000..9960c108 --- /dev/null +++ b/pkg/api/v1beta1/strip.go @@ -0,0 +1,343 @@ +/* + 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 v1beta1 + +// +// Notes: +// These stripping functions are used in tests to compare values for +// semantic equality using go-cmp. They reduce their receiver to a +// unique canonical representation by replacing empty slices, maps, +// and struct type fields by nil. These are destructive (IOW might +// alter the receiver) and should only be used for testing. +// +// TODO(klihub): +// Starting with 1.36.6, we could use protobuf/proto.CloneOf() to +// create a deep copy before stripping. However, we can't update +// beyond 1.35.2 yet, before all supported release branches of our +// downstream dependencies have bumped their direct dependencies. + +// Strip empty fields from a container adjustment, reducing a fully empty +// one to nil. Strip allows comparison of two adjustments for semantic +// equality using go-cmp. +func (a *ContainerAdjustment) Strip() *ContainerAdjustment { + if a == nil { + return nil + } + + empty := true + + if len(a.Annotations) == 0 { + a.Annotations = nil + } else { + empty = false + } + if len(a.Mounts) == 0 { + a.Mounts = nil + } else { + empty = false + } + if len(a.Env) == 0 { + a.Env = nil + } else { + empty = false + } + if len(a.Rlimits) == 0 { + a.Rlimits = nil + } else { + empty = false + } + if len(a.CDIDevices) == 0 { + a.CDIDevices = nil + } else { + empty = false + } + if len(a.Args) == 0 { + a.Args = nil + } else { + empty = false + } + + if a.Hooks = a.Hooks.Strip(); a.Hooks != nil { + empty = false + } + if a.Linux = a.Linux.Strip(); a.Linux != nil { + empty = false + } + + if empty { + return nil + } + + return a +} + +// Strip empty fields from a linux container adjustment, reducing a fully +// empty one to nil. Strip allows comparison of two adjustments for semantic +// equality using go-cmp. +func (l *LinuxContainerAdjustment) Strip() *LinuxContainerAdjustment { + if l == nil { + return nil + } + + empty := true + + if len(l.Devices) == 0 { + l.Devices = nil + } else { + empty = false + } + + if l.Resources = l.Resources.Strip(); l.Resources != nil { + empty = false + } + + if l.CgroupsPath != "" { + empty = false + } + if l.OomScoreAdj != nil { + empty = false + } + + if empty { + return nil + } + + return l +} + +// Strip empty fields from Hooks, reducing a fully empty one to nil. Strip +// allows comparison of two Hooks for semantic equality using go-cmp. +func (h *Hooks) Strip() *Hooks { + if h == nil { + return nil + } + + empty := true + + if len(h.Prestart) == 0 { + h.Prestart = nil + } else { + empty = false + } + if len(h.CreateRuntime) == 0 { + h.CreateRuntime = nil + } else { + empty = false + } + if len(h.CreateContainer) == 0 { + h.CreateContainer = nil + } else { + empty = false + } + if len(h.StartContainer) == 0 { + h.StartContainer = nil + } else { + empty = false + } + if len(h.Poststart) == 0 { + h.Poststart = nil + } else { + empty = false + } + if len(h.Poststop) == 0 { + h.Poststop = nil + } else { + empty = false + } + + if empty { + return nil + } + + return h +} + +// Strip empty fields from a linux resources, reducing a fully empty one +// to nil. Strip allows comparison of two sets of resources for semantic +// equality using go-cmp. +func (r *LinuxResources) Strip() *LinuxResources { + if r == nil { + return nil + } + + empty := true + + if r.Memory = r.Memory.Strip(); r.Memory != nil { + empty = false + } + if r.Cpu = r.Cpu.Strip(); r.Cpu != nil { + empty = false + } + if len(r.HugepageLimits) == 0 { + r.HugepageLimits = nil + } else { + empty = false + } + + if r.BlockioClass != nil { + empty = false + } + if r.RdtClass != nil { + empty = false + } + if len(r.Unified) == 0 { + r.Unified = nil + } else { + empty = false + } + if len(r.Devices) == 0 { + r.Devices = nil + } else { + empty = false + } + if r.Pids != nil { + empty = false + } + + if empty { + return nil + } + + return r +} + +// Strip empty fields from linux CPU attributes, reducing a fully empty one +// to nil. Strip allows comparison of two sets of attributes for semantic +// equality using go-cmp. +func (c *LinuxCPU) Strip() *LinuxCPU { + if c == nil { + return nil + } + + empty := true //nolint:staticcheck // could merge conditional assignment below to variable definition + + if c.Shares != nil { + empty = false + } + if c.Quota != nil { + empty = false + } + if c.Period != nil { + empty = false + } + if c.RealtimeRuntime != nil { + empty = false + } + if c.RealtimePeriod != nil { + empty = false + } + if c.Cpus != "" { + empty = false + } + if c.Mems != "" { + empty = false + } + + if empty { + return nil + } + + return c +} + +// Strip empty fields from linux memory attributes, reducing a fully empty +// one to nil. Strip allows comparison of two sets of attributes for semantic +// equality using go-cmp. +func (m *LinuxMemory) Strip() *LinuxMemory { + if m == nil { + return nil + } + + empty := true //nolint:staticcheck // could merge conditional assignment below to variable definition + + if m.Limit != nil { + empty = false + } + if m.Reservation != nil { + empty = false + } + if m.Swap != nil { + empty = false + } + if m.Kernel != nil { + empty = false + } + if m.KernelTcp != nil { + empty = false + } + if m.Swappiness != nil { + empty = false + } + if m.DisableOomKiller != nil { + empty = false + } + if m.UseHierarchy != nil { + empty = false + } + + if empty { + return nil + } + + return m +} + +// Strip empty fields from a container update, reducing a fully empty one +// to nil. Strip allows comparison of two updates for semantic equality +// using go-cmp. +func (u *ContainerUpdate) Strip() *ContainerUpdate { + if u == nil { + return nil + } + + empty := true + + if u.Linux = u.Linux.Strip(); u.Linux != nil { + empty = false + } + + if u.IgnoreFailure { + empty = false + } + + if empty { + return nil + } + + return u +} + +// Strip empty fields from a linux container update, reducing a fully empty +// one to nil. Strip allows comparison of two updates for semantic equality +// using go-cmp. +func (l *LinuxContainerUpdate) Strip() *LinuxContainerUpdate { + if l == nil { + return nil + } + + empty := true + + if l.Resources = l.Resources.Strip(); l.Resources != nil { + empty = false + } + + if empty { + return nil + } + + return l +} diff --git a/pkg/api/v1beta1/timeouts.go b/pkg/api/v1beta1/timeouts.go new file mode 100644 index 00000000..84be9483 --- /dev/null +++ b/pkg/api/v1beta1/timeouts.go @@ -0,0 +1,28 @@ +/* + 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 v1beta1 + +import ( + "time" +) + +const ( + // DefaultPluginRegistrationTimeout is the default timeout for plugin registration. + DefaultPluginRegistrationTimeout = 5 * time.Second + // DefaultPluginRequestTimeout is the default timeout for plugins to handle a request. + DefaultPluginRequestTimeout = 2 * time.Second +) diff --git a/pkg/api/v1beta1/update.go b/pkg/api/v1beta1/update.go new file mode 100644 index 00000000..da73b560 --- /dev/null +++ b/pkg/api/v1beta1/update.go @@ -0,0 +1,199 @@ +/* + 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 v1beta1 + +//nolint +// SetContainerId sets the id of the container to update. +func (u *ContainerUpdate) SetContainerId(id string) { + u.ContainerId = id +} + +// SetLinuxMemoryLimit records setting the memory limit for a container. +func (u *ContainerUpdate) SetLinuxMemoryLimit(value int64) { + u.initLinuxResourcesMemory() + u.Linux.Resources.Memory.Limit = Int64(value) +} + +// SetLinuxMemoryReservation records setting the memory reservation for a container. +func (u *ContainerUpdate) SetLinuxMemoryReservation(value int64) { + u.initLinuxResourcesMemory() + u.Linux.Resources.Memory.Reservation = Int64(value) +} + +// SetLinuxMemorySwap records records setting the memory swap limit for a container. +func (u *ContainerUpdate) SetLinuxMemorySwap(value int64) { + u.initLinuxResourcesMemory() + u.Linux.Resources.Memory.Swap = Int64(value) +} + +// SetLinuxMemoryKernel records setting the memory kernel limit for a container. +func (u *ContainerUpdate) SetLinuxMemoryKernel(value int64) { + u.initLinuxResourcesMemory() + u.Linux.Resources.Memory.Kernel = Int64(value) +} + +// SetLinuxMemoryKernelTCP records setting the memory kernel TCP limit for a container. +func (u *ContainerUpdate) SetLinuxMemoryKernelTCP(value int64) { + u.initLinuxResourcesMemory() + u.Linux.Resources.Memory.KernelTcp = Int64(value) +} + +// SetLinuxMemorySwappiness records setting the memory swappiness for a container. +func (u *ContainerUpdate) SetLinuxMemorySwappiness(value uint64) { + u.initLinuxResourcesMemory() + u.Linux.Resources.Memory.Swappiness = UInt64(value) +} + +// SetLinuxMemoryDisableOomKiller records disabling the OOM killer for a container. +func (u *ContainerUpdate) SetLinuxMemoryDisableOomKiller() { + u.initLinuxResourcesMemory() + u.Linux.Resources.Memory.DisableOomKiller = Bool(true) +} + +// SetLinuxMemoryUseHierarchy records enabling hierarchical memory accounting for a container. +func (u *ContainerUpdate) SetLinuxMemoryUseHierarchy() { + u.initLinuxResourcesMemory() + u.Linux.Resources.Memory.UseHierarchy = Bool(true) +} + +// SetLinuxCPUShares records setting the scheduler's CPU shares for a container. +func (u *ContainerUpdate) SetLinuxCPUShares(value uint64) { + u.initLinuxResourcesCPU() + u.Linux.Resources.Cpu.Shares = UInt64(value) +} + +// SetLinuxCPUQuota records setting the scheduler's CPU quota for a container. +func (u *ContainerUpdate) SetLinuxCPUQuota(value int64) { + u.initLinuxResourcesCPU() + u.Linux.Resources.Cpu.Quota = Int64(value) +} + +// SetLinuxCPUPeriod records setting the scheduler's CPU period for a container. +func (u *ContainerUpdate) SetLinuxCPUPeriod(value int64) { + u.initLinuxResourcesCPU() + u.Linux.Resources.Cpu.Period = UInt64(value) +} + +// SetLinuxCPURealtimeRuntime records setting the scheduler's realtime runtime for a container. +func (u *ContainerUpdate) SetLinuxCPURealtimeRuntime(value int64) { + u.initLinuxResourcesCPU() + u.Linux.Resources.Cpu.RealtimeRuntime = Int64(value) +} + +// SetLinuxCPURealtimePeriod records setting the scheduler's realtime period for a container. +func (u *ContainerUpdate) SetLinuxCPURealtimePeriod(value uint64) { + u.initLinuxResourcesCPU() + u.Linux.Resources.Cpu.RealtimePeriod = UInt64(value) +} + +// SetLinuxCPUSetCPUs records setting the cpuset CPUs for a container. +func (u *ContainerUpdate) SetLinuxCPUSetCPUs(value string) { + u.initLinuxResourcesCPU() + u.Linux.Resources.Cpu.Cpus = value +} + +// SetLinuxCPUSetMems records setting the cpuset memory for a container. +func (u *ContainerUpdate) SetLinuxCPUSetMems(value string) { + u.initLinuxResourcesCPU() + u.Linux.Resources.Cpu.Mems = value +} + +// SetLinuxPidLimits records setting the pid max number for a container. +func (u *ContainerUpdate) SetLinuxPidLimits(value int64) { + u.initLinuxResourcesPids() + u.Linux.Resources.Pids.Limit = value +} + +// AddLinuxHugepageLimit records adding a hugepage limit for a container. +func (u *ContainerUpdate) AddLinuxHugepageLimit(pageSize string, value uint64) { + u.initLinuxResources() + u.Linux.Resources.HugepageLimits = append(u.Linux.Resources.HugepageLimits, + &HugepageLimit{ + PageSize: pageSize, + Limit: value, + }) +} + +// SetLinuxBlockIOClass records setting the Block I/O class for a container. +func (u *ContainerUpdate) SetLinuxBlockIOClass(value string) { + u.initLinuxResources() + u.Linux.Resources.BlockioClass = String(value) +} + +// SetLinuxRDTClass records setting the RDT class for a container. +func (u *ContainerUpdate) SetLinuxRDTClass(value string) { + u.initLinuxResources() + u.Linux.Resources.RdtClass = String(value) +} + +// AddLinuxUnified sets a cgroupv2 unified resource. +func (u *ContainerUpdate) AddLinuxUnified(key, value string) { + u.initLinuxResourcesUnified() + u.Linux.Resources.Unified[key] = value +} + +// SetIgnoreFailure marks an Update as ignored for failures. +// Such updates will not prevent the related container operation +// from succeeding if the update fails. +func (u *ContainerUpdate) SetIgnoreFailure() { + u.IgnoreFailure = true +} + +// +// Initializing a container update. +// + +func (u *ContainerUpdate) initLinux() { + if u.Linux == nil { + u.Linux = &LinuxContainerUpdate{} + } +} + +func (u *ContainerUpdate) initLinuxResources() { + u.initLinux() + if u.Linux.Resources == nil { + u.Linux.Resources = &LinuxResources{} + } +} + +func (u *ContainerUpdate) initLinuxResourcesMemory() { + u.initLinuxResources() + if u.Linux.Resources.Memory == nil { + u.Linux.Resources.Memory = &LinuxMemory{} + } +} + +func (u *ContainerUpdate) initLinuxResourcesCPU() { + u.initLinuxResources() + if u.Linux.Resources.Cpu == nil { + u.Linux.Resources.Cpu = &LinuxCPU{} + } +} + +func (u *ContainerUpdate) initLinuxResourcesUnified() { + u.initLinuxResources() + if u.Linux.Resources.Unified == nil { + u.Linux.Resources.Unified = make(map[string]string) + } +} + +func (u *ContainerUpdate) initLinuxResourcesPids() { + u.initLinuxResources() + if u.Linux.Resources.Pids == nil { + u.Linux.Resources.Pids = &LinuxPids{} + } +} diff --git a/pkg/api/v1beta1/validate.go b/pkg/api/v1beta1/validate.go new file mode 100644 index 00000000..d5da7e3b --- /dev/null +++ b/pkg/api/v1beta1/validate.go @@ -0,0 +1,69 @@ +/* + 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 v1beta1 + +import ( + "fmt" +) + +// AddPlugin records a plugin for the validation request. +func (v *ValidateContainerAdjustmentRequest) AddPlugin(name, index string) { + v.Plugins = append(v.Plugins, &PluginInstance{ + Name: name, + Index: index, + }) +} + +// AddResponse records the container adjustments and updates to validate from a CreateContainerResponse. +func (v *ValidateContainerAdjustmentRequest) AddResponse(rpl *CreateContainerResponse) { + v.Adjust = rpl.Adjust + v.Update = rpl.Update +} + +// AddOwners sets the owning plugins for the container adjustment request. +func (v *ValidateContainerAdjustmentRequest) AddOwners(owners *OwningPlugins) { + v.Owners = owners +} + +// ValidationResult returns the validation result as an error (non-nil if rejected). +func (v *ValidateContainerAdjustmentResponse) ValidationResult(plugin string) error { + if !v.Reject { + return nil + } + + reason := v.Reason + if reason == "" { + reason = "unknown rejection reason" + } + + return fmt.Errorf("validator %q rejected container adjustment, reason: %s", plugin, reason) +} + +// GetPluginMap returns a map of plugin name to PluginInstance. +func (v *ValidateContainerAdjustmentRequest) GetPluginMap() map[string]*PluginInstance { + if v == nil { + return nil + } + + plugins := make(map[string]*PluginInstance) + for _, p := range v.Plugins { + plugins[p.Name] = &PluginInstance{Name: p.Name} + plugins[p.Index+"-"+p.Name] = p + } + + return plugins +} From 1baf90e73fc645aa798824ad58352beea04471f7 Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Tue, 16 Sep 2025 15:55:44 +0300 Subject: [PATCH 04/20] adaptation: update to use v1beta1 API revision. Signed-off-by: Krisztian Litkey --- pkg/adaptation/adaptation.go | 145 +++++++++++---- pkg/adaptation/adaptation_suite_test.go | 2 +- pkg/adaptation/api.go | 51 +++--- pkg/adaptation/builtin/plugin.go | 133 ++++++++------ pkg/adaptation/plugin.go | 229 +++++++++++++++++++++--- pkg/adaptation/plugin_type.go | 135 ++++++++++++-- pkg/adaptation/result.go | 2 +- pkg/adaptation/suite_test.go | 2 +- 8 files changed, 536 insertions(+), 163 deletions(-) diff --git a/pkg/adaptation/adaptation.go b/pkg/adaptation/adaptation.go index 367c04e3..46785a7f 100644 --- a/pkg/adaptation/adaptation.go +++ b/pkg/adaptation/adaptation.go @@ -18,7 +18,6 @@ package adaptation import ( "context" - "errors" "fmt" "io/fs" "net" @@ -28,7 +27,7 @@ import ( "sync" "github.com/containerd/nri/pkg/adaptation/builtin" - "github.com/containerd/nri/pkg/api" + api "github.com/containerd/nri/pkg/api/v1beta1" "github.com/containerd/nri/pkg/log" validator "github.com/containerd/nri/plugins/default-validator/builtin" "github.com/containerd/ttrpc" @@ -227,9 +226,19 @@ func (r *Adaptation) Stop() { } // RunPodSandbox relays the corresponding CRI event to plugins. -func (r *Adaptation) RunPodSandbox(ctx context.Context, evt *StateChangeEvent) error { - evt.Event = Event_RUN_POD_SANDBOX - return r.StateChange(ctx, evt) +func (r *Adaptation) RunPodSandbox(ctx context.Context, req *RunPodSandboxRequest) error { + r.Lock() + defer r.Unlock() + defer r.removeClosedPlugins() + + for _, plugin := range r.plugins { + _, err := plugin.runPodSandbox(ctx, req) + if err != nil { + return err + } + } + + return nil } // UpdatePodSandbox relays the corresponding CRI request to plugins. @@ -249,21 +258,51 @@ func (r *Adaptation) UpdatePodSandbox(ctx context.Context, req *UpdatePodSandbox } // PostUpdatePodSandbox relays the corresponding CRI event to plugins. -func (r *Adaptation) PostUpdatePodSandbox(ctx context.Context, evt *StateChangeEvent) error { - evt.Event = Event_POST_UPDATE_POD_SANDBOX - return r.StateChange(ctx, evt) +func (r *Adaptation) PostUpdatePodSandbox(ctx context.Context, req *PostUpdatePodSandboxRequest) error { + r.Lock() + defer r.Unlock() + defer r.removeClosedPlugins() + + for _, plugin := range r.plugins { + _, err := plugin.postUpdatePodSandbox(ctx, req) + if err != nil { + return err + } + } + + return nil } // StopPodSandbox relays the corresponding CRI event to plugins. -func (r *Adaptation) StopPodSandbox(ctx context.Context, evt *StateChangeEvent) error { - evt.Event = Event_STOP_POD_SANDBOX - return r.StateChange(ctx, evt) +func (r *Adaptation) StopPodSandbox(ctx context.Context, req *StopPodSandboxRequest) error { + r.Lock() + defer r.Unlock() + defer r.removeClosedPlugins() + + for _, plugin := range r.plugins { + _, err := plugin.stopPodSandbox(ctx, req) + if err != nil { + return err + } + } + + return nil } // RemovePodSandbox relays the corresponding CRI event to plugins. -func (r *Adaptation) RemovePodSandbox(ctx context.Context, evt *StateChangeEvent) error { - evt.Event = Event_REMOVE_POD_SANDBOX - return r.StateChange(ctx, evt) +func (r *Adaptation) RemovePodSandbox(ctx context.Context, req *RemovePodSandboxRequest) error { + r.Lock() + defer r.Unlock() + defer r.removeClosedPlugins() + + for _, plugin := range r.plugins { + _, err := plugin.removePodSandbox(ctx, req) + if err != nil { + return err + } + } + + return nil } // CreateContainer relays the corresponding CRI request to plugins. @@ -302,21 +341,51 @@ func (r *Adaptation) CreateContainer(ctx context.Context, req *CreateContainerRe } // PostCreateContainer relays the corresponding CRI event to plugins. -func (r *Adaptation) PostCreateContainer(ctx context.Context, evt *StateChangeEvent) error { - evt.Event = Event_POST_CREATE_CONTAINER - return r.StateChange(ctx, evt) +func (r *Adaptation) PostCreateContainer(ctx context.Context, req *PostCreateContainerRequest) error { + r.Lock() + defer r.Unlock() + defer r.removeClosedPlugins() + + for _, plugin := range r.plugins { + _, err := plugin.postCreateContainer(ctx, req) + if err != nil { + return err + } + } + + return nil } // StartContainer relays the corresponding CRI event to plugins. -func (r *Adaptation) StartContainer(ctx context.Context, evt *StateChangeEvent) error { - evt.Event = Event_START_CONTAINER - return r.StateChange(ctx, evt) +func (r *Adaptation) StartContainer(ctx context.Context, req *StartContainerRequest) error { + r.Lock() + defer r.Unlock() + defer r.removeClosedPlugins() + + for _, plugin := range r.plugins { + _, err := plugin.startContainer(ctx, req) + if err != nil { + return err + } + } + + return nil } // PostStartContainer relays the corresponding CRI event to plugins. -func (r *Adaptation) PostStartContainer(ctx context.Context, evt *StateChangeEvent) error { - evt.Event = Event_POST_START_CONTAINER - return r.StateChange(ctx, evt) +func (r *Adaptation) PostStartContainer(ctx context.Context, req *PostStartContainerRequest) error { + r.Lock() + defer r.Unlock() + defer r.removeClosedPlugins() + + for _, plugin := range r.plugins { + _, err := plugin.postStartContainer(ctx, req) + if err != nil { + return err + } + } + + return nil } // UpdateContainer relays the corresponding CRI request to plugins. @@ -341,9 +410,19 @@ func (r *Adaptation) UpdateContainer(ctx context.Context, req *UpdateContainerRe } // PostUpdateContainer relays the corresponding CRI event to plugins. -func (r *Adaptation) PostUpdateContainer(ctx context.Context, evt *StateChangeEvent) error { - evt.Event = Event_POST_UPDATE_CONTAINER - return r.StateChange(ctx, evt) +func (r *Adaptation) PostUpdateContainer(ctx context.Context, req *PostUpdateContainerRequest) error { + r.Lock() + defer r.Unlock() + defer r.removeClosedPlugins() + + for _, plugin := range r.plugins { + _, err := plugin.postUpdateContainer(ctx, req) + if err != nil { + return err + } + } + + return nil } // StopContainer relays the corresponding CRI request to plugins. @@ -368,23 +447,13 @@ func (r *Adaptation) StopContainer(ctx context.Context, req *StopContainerReques } // RemoveContainer relays the corresponding CRI event to plugins. -func (r *Adaptation) RemoveContainer(ctx context.Context, evt *StateChangeEvent) error { - evt.Event = Event_REMOVE_CONTAINER - return r.StateChange(ctx, evt) -} - -// StateChange relays pod- or container events to plugins. -func (r *Adaptation) StateChange(ctx context.Context, evt *StateChangeEvent) error { - if evt.Event == Event_UNKNOWN { - return errors.New("invalid (unset) event in state change notification") - } - +func (r *Adaptation) RemoveContainer(ctx context.Context, req *RemoveContainerRequest) error { r.Lock() defer r.Unlock() defer r.removeClosedPlugins() for _, plugin := range r.plugins { - err := plugin.StateChange(ctx, evt) + _, err := plugin.removeContainer(ctx, req) if err != nil { return err } diff --git a/pkg/adaptation/adaptation_suite_test.go b/pkg/adaptation/adaptation_suite_test.go index 0c1cf82d..472d4bb9 100644 --- a/pkg/adaptation/adaptation_suite_test.go +++ b/pkg/adaptation/adaptation_suite_test.go @@ -35,7 +35,7 @@ import ( . "github.com/onsi/gomega" nri "github.com/containerd/nri/pkg/adaptation" - "github.com/containerd/nri/pkg/api" + api "github.com/containerd/nri/pkg/api/v1beta1" "github.com/containerd/nri/pkg/plugin" validator "github.com/containerd/nri/plugins/default-validator/builtin" rspec "github.com/opencontainers/runtime-spec/specs-go" diff --git a/pkg/adaptation/api.go b/pkg/adaptation/api.go index 1ffd11eb..1828393c 100644 --- a/pkg/adaptation/api.go +++ b/pkg/adaptation/api.go @@ -17,7 +17,7 @@ package adaptation import ( - "github.com/containerd/nri/pkg/api" + api "github.com/containerd/nri/pkg/api/v1beta1" ) // @@ -29,7 +29,7 @@ import ( //nolint:revive // revive thinks the comment is for the exported type below type ( RegisterPluginRequest = api.RegisterPluginRequest - RegisterPluginResponse = api.Empty + RegisterPluginResponse = api.RegisterPluginResponse UpdateContainersRequest = api.UpdateContainersRequest UpdateContainersResponse = api.UpdateContainersResponse @@ -38,35 +38,36 @@ type ( SynchronizeRequest = api.SynchronizeRequest SynchronizeResponse = api.SynchronizeResponse - ShutdownRequest = api.Empty - ShutdownResponse = api.Empty + ShutdownRequest = api.ShutdownRequest + ShutdownResponse = api.ShutdownResponse - CreateContainerRequest = api.CreateContainerRequest - CreateContainerResponse = api.CreateContainerResponse - UpdateContainerRequest = api.UpdateContainerRequest - UpdateContainerResponse = api.UpdateContainerResponse - StopContainerRequest = api.StopContainerRequest - StopContainerResponse = api.StopContainerResponse - - StateChangeEvent = api.StateChangeEvent - StateChangeResponse = api.StateChangeResponse RunPodSandboxRequest = api.RunPodSandboxRequest + RunPodSandboxResponse = api.RunPodSandboxResponse UpdatePodSandboxRequest = api.UpdatePodSandboxRequest UpdatePodSandboxResponse = api.UpdatePodSandboxResponse - StopPodSandboxRequest = api.StopPodSandboxRequest - RemovePodSandboxRequest = api.RemovePodSandboxRequest PostUpdatePodSandboxRequest = api.PostUpdatePodSandboxRequest PostUpdatePodSandboxResponse = api.PostUpdatePodSandboxResponse - StartContainerRequest = api.StartContainerRequest - StartContainerResponse = api.StartContainerResponse - RemoveContainerRequest = api.RemoveContainerRequest - RemoveContainerResponse = api.RemoveContainerResponse - PostCreateContainerRequest = api.PostCreateContainerRequest - PostCreateContainerResponse = api.PostCreateContainerResponse - PostStartContainerRequest = api.PostStartContainerRequest - PostStartContainerResponse = api.PostStartContainerResponse - PostUpdateContainerRequest = api.PostUpdateContainerRequest - PostUpdateContainerResponse = api.PostUpdateContainerResponse + StopPodSandboxRequest = api.StopPodSandboxRequest + StopPodSandboxResponse = api.StopPodSandboxResponse + RemovePodSandboxRequest = api.RemovePodSandboxRequest + RemovePodSandboxResponse = api.RemovePodSandboxResponse + + CreateContainerRequest = api.CreateContainerRequest + CreateContainerResponse = api.CreateContainerResponse + PostCreateContainerRequest = api.PostCreateContainerRequest + PostCreateContainerResponse = api.PostCreateContainerResponse + StartContainerRequest = api.StartContainerRequest + StartContainerResponse = api.StartContainerResponse + PostStartContainerRequest = api.PostStartContainerRequest + PostStartContainerResponse = api.PostStartContainerResponse + UpdateContainerRequest = api.UpdateContainerRequest + UpdateContainerResponse = api.UpdateContainerResponse + PostUpdateContainerRequest = api.PostUpdateContainerRequest + PostUpdateContainerResponse = api.PostUpdateContainerResponse + StopContainerRequest = api.StopContainerRequest + StopContainerResponse = api.StopContainerResponse + RemoveContainerRequest = api.RemoveContainerRequest + RemoveContainerResponse = api.RemoveContainerResponse ValidateContainerAdjustmentRequest = api.ValidateContainerAdjustmentRequest ValidateContainerAdjustmentResponse = api.ValidateContainerAdjustmentResponse diff --git a/pkg/adaptation/builtin/plugin.go b/pkg/adaptation/builtin/plugin.go index bc0c0058..d136ffb7 100644 --- a/pkg/adaptation/builtin/plugin.go +++ b/pkg/adaptation/builtin/plugin.go @@ -19,7 +19,7 @@ package builtin import ( "context" - "github.com/containerd/nri/pkg/api" + api "github.com/containerd/nri/pkg/api/v1beta1" ) // BuiltinPlugin implements the NRI API and runs in-process @@ -131,6 +131,46 @@ func (b *BuiltinPlugin) Shutdown(context.Context, *api.ShutdownRequest) (*api.Sh return &api.ShutdownResponse{}, nil } +// RunPodSandbox implements PluginService of the NRI API. +func (b *BuiltinPlugin) RunPodSandbox(ctx context.Context, req *api.RunPodSandboxRequest) (*api.RunPodSandboxResponse, error) { + if b.Handlers.RunPodSandbox != nil { + return &api.RunPodSandboxResponse{}, b.Handlers.RunPodSandbox(ctx, req) + } + return &api.RunPodSandboxResponse{}, nil +} + +// UpdatePodSandbox implements PluginService of the NRI API. +func (b *BuiltinPlugin) UpdatePodSandbox(ctx context.Context, req *api.UpdatePodSandboxRequest) (*api.UpdatePodSandboxResponse, error) { + if b.Handlers.UpdatePodSandbox != nil { + return b.Handlers.UpdatePodSandbox(ctx, req) + } + return &api.UpdatePodSandboxResponse{}, nil +} + +// PostUpdatePodSandbox is a handler for the PostUpdatePodSandbox event. +func (b *BuiltinPlugin) PostUpdatePodSandbox(ctx context.Context, req *api.PostUpdatePodSandboxRequest) (*api.PostUpdatePodSandboxResponse, error) { + if b.Handlers.PostUpdatePodSandbox != nil { + return &api.PostUpdatePodSandboxResponse{}, b.Handlers.PostUpdatePodSandbox(ctx, req) + } + return &api.PostUpdatePodSandboxResponse{}, nil +} + +// StopPodSandbox implements PluginService of the NRI API. +func (b *BuiltinPlugin) StopPodSandbox(ctx context.Context, req *api.StopPodSandboxRequest) (*api.StopPodSandboxResponse, error) { + if b.Handlers.StopPodSandbox != nil { + return &api.StopPodSandboxResponse{}, b.Handlers.StopPodSandbox(ctx, req) + } + return &api.StopPodSandboxResponse{}, nil +} + +// RemovePodSandbox implements PluginService of the NRI API. +func (b *BuiltinPlugin) RemovePodSandbox(ctx context.Context, req *api.RemovePodSandboxRequest) (*api.RemovePodSandboxResponse, error) { + if b.Handlers.RemovePodSandbox != nil { + return &api.RemovePodSandboxResponse{}, b.Handlers.RemovePodSandbox(ctx, req) + } + return &api.RemovePodSandboxResponse{}, nil +} + // CreateContainer implements PluginService of the NRI API. func (b *BuiltinPlugin) CreateContainer(ctx context.Context, req *api.CreateContainerRequest) (*api.CreateContainerResponse, error) { if b.Handlers.CreateContainer != nil { @@ -139,6 +179,30 @@ func (b *BuiltinPlugin) CreateContainer(ctx context.Context, req *api.CreateCont return &api.CreateContainerResponse{}, nil } +// PostCreateContainer implements PluginService of the NRI API. +func (b *BuiltinPlugin) PostCreateContainer(ctx context.Context, req *api.PostCreateContainerRequest) (*api.PostCreateContainerResponse, error) { + if b.Handlers.PostCreateContainer != nil { + return &api.PostCreateContainerResponse{}, b.Handlers.PostCreateContainer(ctx, req) + } + return &api.PostCreateContainerResponse{}, nil +} + +// StartContainer implements PluginService of the NRI API. +func (b *BuiltinPlugin) StartContainer(ctx context.Context, req *api.StartContainerRequest) (*api.StartContainerResponse, error) { + if b.Handlers.StartContainer != nil { + return &api.StartContainerResponse{}, b.Handlers.StartContainer(ctx, req) + } + return &api.StartContainerResponse{}, nil +} + +// PostStartContainer implements PluginService of the NRI API. +func (b *BuiltinPlugin) PostStartContainer(ctx context.Context, req *api.PostStartContainerRequest) (*api.PostStartContainerResponse, error) { + if b.Handlers.PostStartContainer != nil { + return &api.PostStartContainerResponse{}, b.Handlers.PostStartContainer(ctx, req) + } + return &api.PostStartContainerResponse{}, nil +} + // UpdateContainer implements PluginService of the NRI API. func (b *BuiltinPlugin) UpdateContainer(ctx context.Context, req *api.UpdateContainerRequest) (*api.UpdateContainerResponse, error) { if b.Handlers.UpdateContainer != nil { @@ -147,6 +211,14 @@ func (b *BuiltinPlugin) UpdateContainer(ctx context.Context, req *api.UpdateCont return &api.UpdateContainerResponse{}, nil } +// PostUpdateContainer implements PluginService of the NRI API. +func (b *BuiltinPlugin) PostUpdateContainer(ctx context.Context, req *api.PostUpdateContainerRequest) (*api.PostUpdateContainerResponse, error) { + if b.Handlers.PostUpdateContainer != nil { + return &api.PostUpdateContainerResponse{}, b.Handlers.PostUpdateContainer(ctx, req) + } + return &api.PostUpdateContainerResponse{}, nil +} + // StopContainer implements PluginService of the NRI API. func (b *BuiltinPlugin) StopContainer(ctx context.Context, req *api.StopContainerRequest) (*api.StopContainerResponse, error) { if b.Handlers.StopContainer != nil { @@ -155,61 +227,12 @@ func (b *BuiltinPlugin) StopContainer(ctx context.Context, req *api.StopContaine return &api.StopContainerResponse{}, nil } -// StateChange implements PluginService of the NRI API. -func (b *BuiltinPlugin) StateChange(ctx context.Context, evt *api.StateChangeEvent) (*api.StateChangeResponse, error) { - var err error - switch evt.Event { - case api.Event_RUN_POD_SANDBOX: - if b.Handlers.RunPodSandbox != nil { - err = b.Handlers.RunPodSandbox(ctx, evt) - } - case api.Event_STOP_POD_SANDBOX: - if b.Handlers.StopPodSandbox != nil { - err = b.Handlers.StopPodSandbox(ctx, evt) - } - case api.Event_REMOVE_POD_SANDBOX: - if b.Handlers.RemovePodSandbox != nil { - err = b.Handlers.RemovePodSandbox(ctx, evt) - } - case api.Event_POST_CREATE_CONTAINER: - if b.Handlers.PostCreateContainer != nil { - err = b.Handlers.PostCreateContainer(ctx, evt) - } - case api.Event_START_CONTAINER: - if b.Handlers.StartContainer != nil { - err = b.Handlers.StartContainer(ctx, evt) - } - case api.Event_POST_START_CONTAINER: - if b.Handlers.PostStartContainer != nil { - err = b.Handlers.PostStartContainer(ctx, evt) - } - case api.Event_POST_UPDATE_CONTAINER: - if b.Handlers.PostUpdateContainer != nil { - err = b.Handlers.PostUpdateContainer(ctx, evt) - } - case api.Event_REMOVE_CONTAINER: - if b.Handlers.RemoveContainer != nil { - err = b.Handlers.RemoveContainer(ctx, evt) - } - } - - return &api.StateChangeResponse{}, err -} - -// UpdatePodSandbox implements PluginService of the NRI API. -func (b *BuiltinPlugin) UpdatePodSandbox(ctx context.Context, req *api.UpdatePodSandboxRequest) (*api.UpdatePodSandboxResponse, error) { - if b.Handlers.UpdatePodSandbox != nil { - return b.Handlers.UpdatePodSandbox(ctx, req) - } - return &api.UpdatePodSandboxResponse{}, nil -} - -// PostUpdatePodSandbox is a handler for the PostUpdatePodSandbox event. -func (b *BuiltinPlugin) PostUpdatePodSandbox(ctx context.Context, req *api.PostUpdatePodSandboxRequest) error { - if b.Handlers.PostUpdatePodSandbox != nil { - return b.Handlers.PostUpdatePodSandbox(ctx, req) +// RemoveContainer implements PluginService of the NRI API. +func (b *BuiltinPlugin) RemoveContainer(ctx context.Context, req *api.RemoveContainerRequest) (*api.RemoveContainerResponse, error) { + if b.Handlers.RemoveContainer != nil { + return &api.RemoveContainerResponse{}, b.Handlers.RemoveContainer(ctx, req) } - return nil + return &api.RemoveContainerResponse{}, nil } // ValidateContainerAdjustment implements PluginService of the NRI API. diff --git a/pkg/adaptation/plugin.go b/pkg/adaptation/plugin.go index 80e5555b..ac6f3e8c 100644 --- a/pkg/adaptation/plugin.go +++ b/pkg/adaptation/plugin.go @@ -29,7 +29,7 @@ import ( "time" "github.com/containerd/nri/pkg/adaptation/builtin" - "github.com/containerd/nri/pkg/api" + api "github.com/containerd/nri/pkg/api/v1beta1" "github.com/containerd/nri/pkg/log" "github.com/containerd/nri/pkg/net" "github.com/containerd/nri/pkg/net/multiplex" @@ -592,6 +592,116 @@ func recalcObjsPerSyncMsg(pods, ctrs int, err error) (int, int, error) { return pods, ctrs, nil } +// Relay RunPodSandbox requests to the plugin. +func (p *plugin) runPodSandbox(ctx context.Context, req *RunPodSandboxRequest) (*RunPodSandboxResponse, error) { + if !p.events.IsSet(Event_RUN_POD_SANDBOX) { + return nil, nil + } + + ctx, cancel := context.WithTimeout(ctx, getPluginRequestTimeout()) + defer cancel() + + if _, err := p.impl.RunPodSandbox(ctx, req); err != nil { + if isFatalError(err) { + log.Errorf(ctx, "closing plugin %s, failed to handle RunPodSandbox event: %v", + p.name(), err) + p.close() + return nil, nil + } + return nil, err + } + + return &RunPodSandboxResponse{}, nil +} + +// Relay UpdatePodSandbox requests to the plugin. +func (p *plugin) updatePodSandbox(ctx context.Context, req *UpdatePodSandboxRequest) (*UpdatePodSandboxResponse, error) { + if !p.events.IsSet(Event_UPDATE_POD_SANDBOX) { + return nil, nil + } + + ctx, cancel := context.WithTimeout(ctx, getPluginRequestTimeout()) + defer cancel() + + if _, err := p.impl.UpdatePodSandbox(ctx, req); err != nil { + if isFatalError(err) { + log.Errorf(ctx, "closing plugin %s, failed to handle UpdatePodSandbox event: %v", + p.name(), err) + p.close() + return nil, nil + } + return nil, err + } + + return &UpdatePodSandboxResponse{}, nil +} + +// Relay PostUpdatePodSandbox requests to the plugin. +func (p *plugin) postUpdatePodSandbox(ctx context.Context, req *PostUpdatePodSandboxRequest) (*PostUpdatePodSandboxResponse, error) { + if !p.events.IsSet(Event_POST_UPDATE_POD_SANDBOX) { + return nil, nil + } + + ctx, cancel := context.WithTimeout(ctx, getPluginRequestTimeout()) + defer cancel() + + if _, err := p.impl.PostUpdatePodSandbox(ctx, req); err != nil { + if isFatalError(err) { + log.Errorf(ctx, "closing plugin %s, failed to handle PostUpdatePodSandbox event: %v", + p.name(), err) + p.close() + return nil, nil + } + return nil, err + } + + return &PostUpdatePodSandboxResponse{}, nil +} + +// Relay StopPodSandbox requests to the plugin. +func (p *plugin) stopPodSandbox(ctx context.Context, req *StopPodSandboxRequest) (*StopPodSandboxResponse, error) { + if !p.events.IsSet(Event_STOP_POD_SANDBOX) { + return nil, nil + } + + ctx, cancel := context.WithTimeout(ctx, getPluginRequestTimeout()) + defer cancel() + + if _, err := p.impl.StopPodSandbox(ctx, req); err != nil { + if isFatalError(err) { + log.Errorf(ctx, "closing plugin %s, failed to handle StopPodSandbox event: %v", + p.name(), err) + p.close() + return nil, nil + } + return nil, err + } + + return &StopPodSandboxResponse{}, nil +} + +// Relay RemovePodSandbox requests to the plugin. +func (p *plugin) removePodSandbox(ctx context.Context, req *RemovePodSandboxRequest) (*RemovePodSandboxResponse, error) { + if !p.events.IsSet(Event_REMOVE_POD_SANDBOX) { + return nil, nil + } + + ctx, cancel := context.WithTimeout(ctx, getPluginRequestTimeout()) + defer cancel() + + if _, err := p.impl.RemovePodSandbox(ctx, req); err != nil { + if isFatalError(err) { + log.Errorf(ctx, "closing plugin %s, failed to handle RemovePodSandbox event: %v", + p.name(), err) + p.close() + return nil, nil + } + return nil, err + } + + return &RemovePodSandboxResponse{}, nil +} + // Relay CreateContainer request to plugin. func (p *plugin) createContainer(ctx context.Context, req *CreateContainerRequest) (*CreateContainerResponse, error) { if !p.events.IsSet(Event_CREATE_CONTAINER) { @@ -615,6 +725,72 @@ func (p *plugin) createContainer(ctx context.Context, req *CreateContainerReques return rpl, nil } +// Relay PostCreateContainer requests to the plugin. +func (p *plugin) postCreateContainer(ctx context.Context, req *PostCreateContainerRequest) (*PostCreateContainerResponse, error) { + if !p.events.IsSet(Event_POST_CREATE_CONTAINER) { + return nil, nil + } + + ctx, cancel := context.WithTimeout(ctx, getPluginRequestTimeout()) + defer cancel() + + if _, err := p.impl.PostCreateContainer(ctx, req); err != nil { + if isFatalError(err) { + log.Errorf(ctx, "closing plugin %s, failed to handle PostCreateContainer event: %v", + p.name(), err) + p.close() + return nil, nil + } + return nil, err + } + + return &PostCreateContainerResponse{}, nil +} + +// Relay StartContainer requests to the plugin. +func (p *plugin) startContainer(ctx context.Context, req *StartContainerRequest) (*StartContainerResponse, error) { + if !p.events.IsSet(Event_START_CONTAINER) { + return nil, nil + } + + ctx, cancel := context.WithTimeout(ctx, getPluginRequestTimeout()) + defer cancel() + + if _, err := p.impl.StartContainer(ctx, req); err != nil { + if isFatalError(err) { + log.Errorf(ctx, "closing plugin %s, failed to handle StartContainer event: %v", + p.name(), err) + p.close() + return nil, nil + } + return nil, err + } + + return &StartContainerResponse{}, nil +} + +// Relay PostStartContainer requests to the plugin. +func (p *plugin) postStartContainer(ctx context.Context, req *PostStartContainerRequest) (*PostStartContainerResponse, error) { + if !p.events.IsSet(Event_POST_START_CONTAINER) { + return nil, nil + } + + ctx, cancel := context.WithTimeout(ctx, getPluginRequestTimeout()) + defer cancel() + + if _, err := p.impl.PostStartContainer(ctx, req); err != nil { + if isFatalError(err) { + log.Errorf(ctx, "closing plugin %s, failed to handle PostStartContainer event: %v", + p.name(), err) + p.close() + return nil, nil + } + return nil, err + } + + return &PostStartContainerResponse{}, nil +} + // Relay UpdateContainer request to plugin. func (p *plugin) updateContainer(ctx context.Context, req *UpdateContainerRequest) (*UpdateContainerResponse, error) { if !p.events.IsSet(Event_UPDATE_CONTAINER) { @@ -638,19 +814,18 @@ func (p *plugin) updateContainer(ctx context.Context, req *UpdateContainerReques return rpl, nil } -// Relay StopContainer request to the plugin. -func (p *plugin) stopContainer(ctx context.Context, req *StopContainerRequest) (rpl *StopContainerResponse, err error) { - if !p.events.IsSet(Event_STOP_CONTAINER) { +// Relay PostUpdateContainer requests to the plugin. +func (p *plugin) postUpdateContainer(ctx context.Context, req *PostUpdateContainerRequest) (*PostUpdateContainerResponse, error) { + if !p.events.IsSet(Event_POST_UPDATE_CONTAINER) { return nil, nil } ctx, cancel := context.WithTimeout(ctx, getPluginRequestTimeout()) defer cancel() - rpl, err = p.impl.StopContainer(ctx, req) - if err != nil { + if _, err := p.impl.PostUpdateContainer(ctx, req); err != nil { if isFatalError(err) { - log.Errorf(ctx, "closing plugin %s, failed to handle StopContainer request: %v", + log.Errorf(ctx, "closing plugin %s, failed to handle PostUpdateContainer event: %v", p.name(), err) p.close() return nil, nil @@ -658,50 +833,52 @@ func (p *plugin) stopContainer(ctx context.Context, req *StopContainerRequest) ( return nil, err } - return rpl, nil + return &PostUpdateContainerResponse{}, nil } -func (p *plugin) updatePodSandbox(ctx context.Context, req *UpdatePodSandboxRequest) (*UpdatePodSandboxResponse, error) { - if !p.events.IsSet(Event_UPDATE_POD_SANDBOX) { +// Relay StopContainer request to the plugin. +func (p *plugin) stopContainer(ctx context.Context, req *StopContainerRequest) (rpl *StopContainerResponse, err error) { + if !p.events.IsSet(Event_STOP_CONTAINER) { return nil, nil } ctx, cancel := context.WithTimeout(ctx, getPluginRequestTimeout()) defer cancel() - if _, err := p.impl.UpdatePodSandbox(ctx, req); err != nil { + rpl, err = p.impl.StopContainer(ctx, req) + if err != nil { if isFatalError(err) { - log.Errorf(ctx, "closing plugin %s, failed to handle event %d: %v", - p.name(), Event_UPDATE_POD_SANDBOX, err) + log.Errorf(ctx, "closing plugin %s, failed to handle StopContainer request: %v", + p.name(), err) p.close() return nil, nil } return nil, err } - return &UpdatePodSandboxResponse{}, nil + return rpl, nil } -// Relay other pod or container state change events to the plugin. -func (p *plugin) StateChange(ctx context.Context, evt *StateChangeEvent) (err error) { - if !p.events.IsSet(evt.Event) { - return nil +// Relay RemoveContainer requests to the plugin. +func (p *plugin) removeContainer(ctx context.Context, req *RemoveContainerRequest) (*RemoveContainerResponse, error) { + if !p.events.IsSet(Event_REMOVE_CONTAINER) { + return nil, nil } ctx, cancel := context.WithTimeout(ctx, getPluginRequestTimeout()) defer cancel() - if err = p.impl.StateChange(ctx, evt); err != nil { + if _, err := p.impl.RemoveContainer(ctx, req); err != nil { if isFatalError(err) { - log.Errorf(ctx, "closing plugin %s, failed to handle event %d: %v", - p.name(), evt.Event, err) + log.Errorf(ctx, "closing plugin %s, failed to handle RemoveContainer event: %v", + p.name(), err) p.close() - return nil + return nil, nil } - return err + return nil, err } - return nil + return &RemoveContainerResponse{}, nil } func (p *plugin) ValidateContainerAdjustment(ctx context.Context, req *ValidateContainerAdjustmentRequest) error { @@ -742,7 +919,7 @@ func isFatalError(err error) bool { // wasmHostFunctions implements the webassembly host functions type wasmHostFunctions struct{} -func (wasmHostFunctions) Log(ctx context.Context, request *api.LogRequest) (*api.Empty, error) { +func (wasmHostFunctions) Log(ctx context.Context, request *api.LogRequest) (*api.LogResponse, error) { switch request.GetLevel() { case api.LogRequest_LEVEL_INFO: log.Infof(ctx, request.GetMsg()) @@ -754,5 +931,5 @@ func (wasmHostFunctions) Log(ctx context.Context, request *api.LogRequest) (*api log.Debugf(ctx, request.GetMsg()) } - return &api.Empty{}, nil + return &api.LogResponse{}, nil } diff --git a/pkg/adaptation/plugin_type.go b/pkg/adaptation/plugin_type.go index 43390291..c0e09e59 100644 --- a/pkg/adaptation/plugin_type.go +++ b/pkg/adaptation/plugin_type.go @@ -20,7 +20,7 @@ import ( "context" "errors" - "github.com/containerd/nri/pkg/api" + api "github.com/containerd/nri/pkg/api/v1beta1" ) type pluginType struct { @@ -71,6 +71,71 @@ func (p *pluginType) Configure(ctx context.Context, req *ConfigureRequest) (*Con return nil, errUnknownImpl } +func (p *pluginType) RunPodSandbox(ctx context.Context, req *RunPodSandboxRequest) (*RunPodSandboxResponse, error) { + switch { + case p.ttrpcImpl != nil: + return p.ttrpcImpl.RunPodSandbox(ctx, req) + case p.builtinImpl != nil: + return p.builtinImpl.RunPodSandbox(ctx, req) + case p.wasmImpl != nil: + return p.wasmImpl.RunPodSandbox(ctx, req) + } + + return nil, errUnknownImpl +} + +func (p *pluginType) UpdatePodSandbox(ctx context.Context, req *UpdatePodSandboxRequest) (*UpdatePodSandboxResponse, error) { + switch { + case p.ttrpcImpl != nil: + return p.ttrpcImpl.UpdatePodSandbox(ctx, req) + case p.builtinImpl != nil: + return p.builtinImpl.UpdatePodSandbox(ctx, req) + case p.wasmImpl != nil: + return p.wasmImpl.UpdatePodSandbox(ctx, req) + } + + return nil, errUnknownImpl +} + +func (p *pluginType) PostUpdatePodSandbox(ctx context.Context, req *PostUpdatePodSandboxRequest) (*PostUpdatePodSandboxResponse, error) { + switch { + case p.ttrpcImpl != nil: + return p.ttrpcImpl.PostUpdatePodSandbox(ctx, req) + case p.builtinImpl != nil: + return p.builtinImpl.PostUpdatePodSandbox(ctx, req) + case p.wasmImpl != nil: + return p.wasmImpl.PostUpdatePodSandbox(ctx, req) + } + + return nil, errUnknownImpl +} + +func (p *pluginType) StopPodSandbox(ctx context.Context, req *StopPodSandboxRequest) (*StopPodSandboxResponse, error) { + switch { + case p.ttrpcImpl != nil: + return p.ttrpcImpl.StopPodSandbox(ctx, req) + case p.builtinImpl != nil: + return p.builtinImpl.StopPodSandbox(ctx, req) + case p.wasmImpl != nil: + return p.wasmImpl.StopPodSandbox(ctx, req) + } + + return nil, errUnknownImpl +} + +func (p *pluginType) RemovePodSandbox(ctx context.Context, req *RemovePodSandboxRequest) (*RemovePodSandboxResponse, error) { + switch { + case p.ttrpcImpl != nil: + return p.ttrpcImpl.RemovePodSandbox(ctx, req) + case p.builtinImpl != nil: + return p.builtinImpl.RemovePodSandbox(ctx, req) + case p.wasmImpl != nil: + return p.wasmImpl.RemovePodSandbox(ctx, req) + } + + return nil, errUnknownImpl +} + func (p *pluginType) CreateContainer(ctx context.Context, req *CreateContainerRequest) (*CreateContainerResponse, error) { switch { case p.ttrpcImpl != nil: @@ -84,6 +149,45 @@ func (p *pluginType) CreateContainer(ctx context.Context, req *CreateContainerRe return nil, errUnknownImpl } +func (p *pluginType) PostCreateContainer(ctx context.Context, req *PostCreateContainerRequest) (*PostCreateContainerResponse, error) { + switch { + case p.ttrpcImpl != nil: + return p.ttrpcImpl.PostCreateContainer(ctx, req) + case p.builtinImpl != nil: + return p.builtinImpl.PostCreateContainer(ctx, req) + case p.wasmImpl != nil: + return p.wasmImpl.PostCreateContainer(ctx, req) + } + + return nil, errUnknownImpl +} + +func (p *pluginType) StartContainer(ctx context.Context, req *StartContainerRequest) (*StartContainerResponse, error) { + switch { + case p.ttrpcImpl != nil: + return p.ttrpcImpl.StartContainer(ctx, req) + case p.builtinImpl != nil: + return p.builtinImpl.StartContainer(ctx, req) + case p.wasmImpl != nil: + return p.wasmImpl.StartContainer(ctx, req) + } + + return nil, errUnknownImpl +} + +func (p *pluginType) PostStartContainer(ctx context.Context, req *PostStartContainerRequest) (*PostStartContainerResponse, error) { + switch { + case p.ttrpcImpl != nil: + return p.ttrpcImpl.PostStartContainer(ctx, req) + case p.builtinImpl != nil: + return p.builtinImpl.PostStartContainer(ctx, req) + case p.wasmImpl != nil: + return p.wasmImpl.PostStartContainer(ctx, req) + } + + return nil, errUnknownImpl +} + func (p *pluginType) UpdateContainer(ctx context.Context, req *UpdateContainerRequest) (*UpdateContainerResponse, error) { switch { case p.ttrpcImpl != nil: @@ -97,44 +201,43 @@ func (p *pluginType) UpdateContainer(ctx context.Context, req *UpdateContainerRe return nil, errUnknownImpl } -func (p *pluginType) StopContainer(ctx context.Context, req *StopContainerRequest) (*StopContainerResponse, error) { +func (p *pluginType) PostUpdateContainer(ctx context.Context, req *PostUpdateContainerRequest) (*PostUpdateContainerResponse, error) { switch { case p.ttrpcImpl != nil: - return p.ttrpcImpl.StopContainer(ctx, req) + return p.ttrpcImpl.PostUpdateContainer(ctx, req) case p.builtinImpl != nil: - return p.builtinImpl.StopContainer(ctx, req) + return p.builtinImpl.PostUpdateContainer(ctx, req) case p.wasmImpl != nil: - return p.wasmImpl.StopContainer(ctx, req) + return p.wasmImpl.PostUpdateContainer(ctx, req) } return nil, errUnknownImpl } -func (p *pluginType) UpdatePodSandbox(ctx context.Context, req *UpdatePodSandboxRequest) (*UpdatePodSandboxResponse, error) { +func (p *pluginType) StopContainer(ctx context.Context, req *StopContainerRequest) (*StopContainerResponse, error) { switch { case p.ttrpcImpl != nil: - return p.ttrpcImpl.UpdatePodSandbox(ctx, req) + return p.ttrpcImpl.StopContainer(ctx, req) case p.builtinImpl != nil: - return p.builtinImpl.UpdatePodSandbox(ctx, req) + return p.builtinImpl.StopContainer(ctx, req) case p.wasmImpl != nil: - return p.wasmImpl.UpdatePodSandbox(ctx, req) + return p.wasmImpl.StopContainer(ctx, req) } return nil, errUnknownImpl } -func (p *pluginType) StateChange(ctx context.Context, req *StateChangeEvent) (err error) { +func (p *pluginType) RemoveContainer(ctx context.Context, req *RemoveContainerRequest) (*RemoveContainerResponse, error) { switch { case p.ttrpcImpl != nil: - _, err = p.ttrpcImpl.StateChange(ctx, req) + return p.ttrpcImpl.RemoveContainer(ctx, req) case p.builtinImpl != nil: - _, err = p.builtinImpl.StateChange(ctx, req) + return p.builtinImpl.RemoveContainer(ctx, req) case p.wasmImpl != nil: - _, err = p.wasmImpl.StateChange(ctx, req) - default: - err = errUnknownImpl + return p.wasmImpl.RemoveContainer(ctx, req) } - return err + + return nil, errUnknownImpl } func (p *pluginType) ValidateContainerAdjustment(ctx context.Context, req *ValidateContainerAdjustmentRequest) (*ValidateContainerAdjustmentResponse, error) { diff --git a/pkg/adaptation/result.go b/pkg/adaptation/result.go index 845a2ee4..daccff73 100644 --- a/pkg/adaptation/result.go +++ b/pkg/adaptation/result.go @@ -22,7 +22,7 @@ import ( "slices" "strings" - "github.com/containerd/nri/pkg/api" + api "github.com/containerd/nri/pkg/api/v1beta1" ) type result struct { diff --git a/pkg/adaptation/suite_test.go b/pkg/adaptation/suite_test.go index 88d8946e..cb4b973b 100644 --- a/pkg/adaptation/suite_test.go +++ b/pkg/adaptation/suite_test.go @@ -28,7 +28,7 @@ import ( "time" nri "github.com/containerd/nri/pkg/adaptation" - "github.com/containerd/nri/pkg/api" + api "github.com/containerd/nri/pkg/api/v1beta1" "github.com/sirupsen/logrus" "github.com/containerd/nri/pkg/stub" From 8799fdcf12819ecfba4ff396eb8f251bfd662b11 Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Thu, 25 Sep 2025 16:59:51 +0300 Subject: [PATCH 05/20] stub: move the current stub revision to pkg/stub/v1alpha1. Move the current stub revision to pkg/stub/v1alpha1. Make importing from the original location an effective alias of importing from the new one. Signed-off-by: Krisztian Litkey --- Makefile | 8 +++- pkg/stub/doc.go | 20 +++++++++ pkg/stub/stub-v1alpha1.go | 72 +++++++++++++++++++++++++++++++++ pkg/stub/{ => v1alpha1}/stub.go | 0 4 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 pkg/stub/doc.go create mode 100644 pkg/stub/stub-v1alpha1.go rename pkg/stub/{ => v1alpha1}/stub.go (100%) diff --git a/Makefile b/Makefile index a2fc8b61..a5f7adfe 100644 --- a/Makefile +++ b/Makefile @@ -190,12 +190,18 @@ validate-repo-no-changes: # golang generation targets # -generate-golang: pkg/api/api-v1alpha1.go pkg/api/api-v1alpha1-wasm.go +generate-golang: \ + pkg/api/api-v1alpha1.go pkg/api/api-v1alpha1-wasm.go \ + pkg/stub/stub-v1alpha1.go pkg/api/api-v1alpha1.go pkg/api/api-v1alpha1-wasm.go: pkg/api/v1alpha1/api.proto pkg/api/doc.go $(Q)echo "Regenerating $@..."; \ $(GO_CMD) generate ./pkg/api +pkg/stub/stub-v1alpha1.go: pkg/stub/doc.go + $(Q)echo "Regenerating $@..."; \ + $(GO_CMD) generate ./pkg/stub + # # targets for installing dependencies # diff --git a/pkg/stub/doc.go b/pkg/stub/doc.go new file mode 100644 index 00000000..9f5583be --- /dev/null +++ b/pkg/stub/doc.go @@ -0,0 +1,20 @@ +/* + 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. +*/ + +//go:generate go build -C ../../hack/gen-pkg-alias +//go:generate ../../hack/gen-pkg-alias/gen-pkg-alias -src ../../pkg/stub/v1alpha1 -dst ../../pkg/stub -rm -out stub-v1alpha1.go -l ../../hack/license-header + +package stub diff --git a/pkg/stub/stub-v1alpha1.go b/pkg/stub/stub-v1alpha1.go new file mode 100644 index 00000000..6890ac35 --- /dev/null +++ b/pkg/stub/stub-v1alpha1.go @@ -0,0 +1,72 @@ +/* + 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. +*/ + +// Code generated by gen-pkg-alias. DO NOT EDIT. + +//nolint:revive +package stub + +import ( + "github.com/containerd/nri/pkg/stub/v1alpha1" +) + +// aliased constants from github.com/containerd/nri/pkg/stub/v1alpha1 +const ( + DefaultRegistrationTimeout = stub.DefaultRegistrationTimeout + DefaultRequestTimeout = stub.DefaultRequestTimeout +) + +// aliased variables from github.com/containerd/nri/pkg/stub/v1alpha1 +var ( + ErrNoService = stub.ErrNoService +) + +// aliased types from github.com/containerd/nri/pkg/stub/v1alpha1 +type ( + ConfigureInterface = stub.ConfigureInterface + CreateContainerInterface = stub.CreateContainerInterface + EventMask = stub.EventMask + Option = stub.Option + Plugin = stub.Plugin + PostCreateContainerInterface = stub.PostCreateContainerInterface + PostStartContainerInterface = stub.PostStartContainerInterface + PostUpdateContainerInterface = stub.PostUpdateContainerInterface + PostUpdatePodInterface = stub.PostUpdatePodInterface + RemoveContainerInterface = stub.RemoveContainerInterface + RemovePodInterface = stub.RemovePodInterface + RunPodInterface = stub.RunPodInterface + ShutdownInterface = stub.ShutdownInterface + StartContainerInterface = stub.StartContainerInterface + StopContainerInterface = stub.StopContainerInterface + StopPodInterface = stub.StopPodInterface + Stub = stub.Stub + SynchronizeInterface = stub.SynchronizeInterface + UpdateContainerInterface = stub.UpdateContainerInterface + UpdatePodInterface = stub.UpdatePodInterface + ValidateContainerAdjustmentInterface = stub.ValidateContainerAdjustmentInterface +) + +// aliased functions from github.com/containerd/nri/pkg/stub/v1alpha1 +var ( + New = stub.New + WithConnection = stub.WithConnection + WithDialer = stub.WithDialer + WithOnClose = stub.WithOnClose + WithPluginIdx = stub.WithPluginIdx + WithPluginName = stub.WithPluginName + WithSocketPath = stub.WithSocketPath + WithTTRPCOptions = stub.WithTTRPCOptions +) diff --git a/pkg/stub/stub.go b/pkg/stub/v1alpha1/stub.go similarity index 100% rename from pkg/stub/stub.go rename to pkg/stub/v1alpha1/stub.go From 4a67377cfc2f2415ce162111d9705e27bd59283f Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Wed, 1 Oct 2025 21:53:39 +0300 Subject: [PATCH 06/20] stub: clone pkg/stub/v1alpha1 to v1beta1. Signed-off-by: Krisztian Litkey --- pkg/stub/v1beta1/stub.go | 965 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 965 insertions(+) create mode 100644 pkg/stub/v1beta1/stub.go diff --git a/pkg/stub/v1beta1/stub.go b/pkg/stub/v1beta1/stub.go new file mode 100644 index 00000000..1b68ec76 --- /dev/null +++ b/pkg/stub/v1beta1/stub.go @@ -0,0 +1,965 @@ +/* + 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 stub + +import ( + "context" + "errors" + "fmt" + stdnet "net" + "os" + "path/filepath" + "strconv" + "sync" + "time" + + api "github.com/containerd/nri/pkg/api/v1beta1" + nrilog "github.com/containerd/nri/pkg/log" + "github.com/containerd/nri/pkg/net" + "github.com/containerd/nri/pkg/net/multiplex" + "github.com/containerd/ttrpc" +) + +// Plugin can implement a number of interfaces related to Pod and Container +// lifecycle events. No any single such interface is mandatory, therefore the +// Plugin interface itself is empty. Plugins are required to implement at +// least one of these interfaces and this is verified during stub creation. +// Trying to create a stub for a plugin violating this requirement will fail +// with and error. +type Plugin interface{} + +// ConfigureInterface handles Configure API request. +type ConfigureInterface interface { + // Configure the plugin with the given NRI-supplied configuration. + // If a non-zero EventMask is returned, the plugin will be subscribed + // to the corresponding. + Configure(ctx context.Context, config, runtime, version string) (api.EventMask, error) +} + +// SynchronizeInterface handles Synchronize API requests. +type SynchronizeInterface interface { + // Synchronize the state of the plugin with the runtime. + // The plugin can request updates to containers in response. + Synchronize(context.Context, []*api.PodSandbox, []*api.Container) ([]*api.ContainerUpdate, error) +} + +// ShutdownInterface handles a Shutdown API request. +type ShutdownInterface interface { + // Shutdown notifies the plugin about the runtime shutting down. + Shutdown(context.Context) +} + +// RunPodInterface handles RunPodSandbox API events. +type RunPodInterface interface { + // RunPodSandbox relays a RunPodSandbox event to the plugin. + RunPodSandbox(context.Context, *api.PodSandbox) error +} + +// UpdatePodInterface handles UpdatePodSandbox API requests. +type UpdatePodInterface interface { + // UpdatePodSandbox relays an UpdatePodSandbox request to the plugin. + UpdatePodSandbox(context.Context, *api.PodSandbox, *api.LinuxResources, *api.LinuxResources) error +} + +// StopPodInterface handles StopPodSandbox API events. +type StopPodInterface interface { + // StopPodSandbox relays a StopPodSandbox event to the plugin. + StopPodSandbox(context.Context, *api.PodSandbox) error +} + +// RemovePodInterface handles RemovePodSandbox API events. +type RemovePodInterface interface { + // RemovePodSandbox relays a RemovePodSandbox event to the plugin. + RemovePodSandbox(context.Context, *api.PodSandbox) error +} + +// PostUpdatePodInterface handles PostUpdatePodSandbox API events. +type PostUpdatePodInterface interface { + // PostUpdatePodSandbox relays a PostUpdatePodSandbox event to the plugin. + PostUpdatePodSandbox(context.Context, *api.PodSandbox) error +} + +// CreateContainerInterface handles CreateContainer API requests. +type CreateContainerInterface interface { + // CreateContainer relays a CreateContainer request to the plugin. + // The plugin can request adjustments to the container being created + // and updates to other unstopped containers in response. + CreateContainer(context.Context, *api.PodSandbox, *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) +} + +// StartContainerInterface handles StartContainer API requests. +type StartContainerInterface interface { + // StartContainer relays a StartContainer event to the plugin. + StartContainer(context.Context, *api.PodSandbox, *api.Container) error +} + +// UpdateContainerInterface handles UpdateContainer API requests. +type UpdateContainerInterface interface { + // UpdateContainer relays an UpdateContainer request to the plugin. + // The plugin can request updates both to the container being updated + // (which then supersedes the original update) and to other unstopped + // containers in response. + UpdateContainer(context.Context, *api.PodSandbox, *api.Container, *api.LinuxResources) ([]*api.ContainerUpdate, error) +} + +// StopContainerInterface handles StopContainer API requests. +type StopContainerInterface interface { + // StopContainer relays a StopContainer request to the plugin. + // The plugin can request updates to unstopped containers in response. + StopContainer(context.Context, *api.PodSandbox, *api.Container) ([]*api.ContainerUpdate, error) +} + +// RemoveContainerInterface handles RemoveContainer API events. +type RemoveContainerInterface interface { + // RemoveContainer relays a RemoveContainer event to the plugin. + RemoveContainer(context.Context, *api.PodSandbox, *api.Container) error +} + +// PostCreateContainerInterface handles PostCreateContainer API events. +type PostCreateContainerInterface interface { + // PostCreateContainer relays a PostCreateContainer event to the plugin. + PostCreateContainer(context.Context, *api.PodSandbox, *api.Container) error +} + +// PostStartContainerInterface handles PostStartContainer API events. +type PostStartContainerInterface interface { + // PostStartContainer relays a PostStartContainer event to the plugin. + PostStartContainer(context.Context, *api.PodSandbox, *api.Container) error +} + +// PostUpdateContainerInterface handles PostUpdateContainer API events. +type PostUpdateContainerInterface interface { + // PostUpdateContainer relays a PostUpdateContainer event to the plugin. + PostUpdateContainer(context.Context, *api.PodSandbox, *api.Container) error +} + +// ValidateContainerAdjustmentInterface handles container adjustment validation. +type ValidateContainerAdjustmentInterface interface { + // ValidateContainerAdjustment validates the container adjustment. + ValidateContainerAdjustment(context.Context, *api.ValidateContainerAdjustmentRequest) error +} + +// Stub is the interface the stub provides for the plugin implementation. +type Stub interface { + // Run starts the plugin then waits for the plugin service to exit, either due to a + // critical error or an explicit call to Stop(). Once Run() returns, the plugin can be + // restarted by calling Run() or Start() again. + Run(context.Context) error + // Start the plugin. + Start(context.Context) error + // Stop the plugin. + Stop() + // Wait for the plugin to stop. + Wait() + + // UpdateContainer requests unsolicited updates to containers. + UpdateContainers([]*api.ContainerUpdate) ([]*api.ContainerUpdate, error) + + // RegistrationTimeout returns the registration timeout for the stub. + // This is the default timeout if the plugin has not been started or + // the timeout received in the Configure request otherwise. + RegistrationTimeout() time.Duration + + // RequestTimeout returns the request timeout for the stub. + // This is the default timeout if the plugin has not been started or + // the timeout received in the Configure request otherwise. + RequestTimeout() time.Duration +} + +const ( + // DefaultRegistrationTimeout is the default plugin registration timeout. + DefaultRegistrationTimeout = api.DefaultPluginRegistrationTimeout + // DefaultRequestTimeout is the default plugin request processing timeout. + DefaultRequestTimeout = api.DefaultPluginRequestTimeout +) + +var ( + // Logger for messages generated internally by the stub itself. + log = nrilog.Get() + + // Used instead of a nil Context in logging. + noCtx = context.TODO() + + // ErrNoService indicates that the stub has no runtime service/connection, + // for instance by UpdateContainers on a stub which has not been started. + ErrNoService = errors.New("stub: no service/connection") +) + +// EventMask holds a mask of events for plugin subscription. +type EventMask = api.EventMask + +// Option to apply to a plugin during its creation. +type Option func(*stub) error + +// WithOnClose sets a notification function to call if the ttRPC connection goes down. +func WithOnClose(onClose func()) Option { + return func(s *stub) error { + s.onClose = onClose + return nil + } +} + +// WithPluginName sets the name to use in plugin registration. +func WithPluginName(name string) Option { + return func(s *stub) error { + if s.name != "" { + return fmt.Errorf("plugin name already set (%q)", s.name) + } + s.name = name + return nil + } +} + +// WithPluginIdx sets the index to use in plugin registration. +func WithPluginIdx(idx string) Option { + return func(s *stub) error { + if s.idx != "" { + return fmt.Errorf("plugin ID already set (%q)", s.idx) + } + s.idx = idx + return nil + } +} + +// WithSocketPath sets the NRI socket path to connect to. +func WithSocketPath(path string) Option { + return func(s *stub) error { + s.socketPath = path + return nil + } +} + +// WithConnection sets an existing NRI connection to use. +func WithConnection(conn stdnet.Conn) Option { + return func(s *stub) error { + s.conn = conn + return nil + } +} + +// WithDialer sets the dialer to use. +func WithDialer(d func(string) (stdnet.Conn, error)) Option { + return func(s *stub) error { + s.dialer = d + return nil + } +} + +// WithTTRPCOptions sets extra client and server options to use for ttrpc . +func WithTTRPCOptions(clientOpts []ttrpc.ClientOpts, serverOpts []ttrpc.ServerOpt) Option { + return func(s *stub) error { + s.clientOpts = append(s.clientOpts, clientOpts...) + s.serverOpts = append(s.serverOpts, serverOpts...) + return nil + } +} + +// stub implements Stub. +type stub struct { + sync.Mutex + plugin interface{} + handlers handlers + events api.EventMask + name string + idx string + socketPath string + dialer func(string) (stdnet.Conn, error) + conn stdnet.Conn + onClose func() + serverOpts []ttrpc.ServerOpt + clientOpts []ttrpc.ClientOpts + rpcm multiplex.Mux + rpcl stdnet.Listener + rpcs *ttrpc.Server + rpcc *ttrpc.Client + runtime api.RuntimeService + started bool + doneC chan struct{} + srvErrC chan error + cfgErrC chan error + syncReq *api.SynchronizeRequest + + registrationTimeout time.Duration + requestTimeout time.Duration +} + +// Handlers for NRI plugin event and request. +type handlers struct { + Configure func(context.Context, string, string, string) (api.EventMask, error) + Synchronize func(context.Context, []*api.PodSandbox, []*api.Container) ([]*api.ContainerUpdate, error) + Shutdown func(context.Context) + RunPodSandbox func(context.Context, *api.PodSandbox) error + UpdatePodSandbox func(context.Context, *api.PodSandbox, *api.LinuxResources, *api.LinuxResources) error + PostUpdatePodSandbox func(context.Context, *api.PodSandbox) error + StopPodSandbox func(context.Context, *api.PodSandbox) error + RemovePodSandbox func(context.Context, *api.PodSandbox) error + CreateContainer func(context.Context, *api.PodSandbox, *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) + PostCreateContainer func(context.Context, *api.PodSandbox, *api.Container) error + StartContainer func(context.Context, *api.PodSandbox, *api.Container) error + PostStartContainer func(context.Context, *api.PodSandbox, *api.Container) error + UpdateContainer func(context.Context, *api.PodSandbox, *api.Container, *api.LinuxResources) ([]*api.ContainerUpdate, error) + PostUpdateContainer func(context.Context, *api.PodSandbox, *api.Container) error + StopContainer func(context.Context, *api.PodSandbox, *api.Container) ([]*api.ContainerUpdate, error) + RemoveContainer func(context.Context, *api.PodSandbox, *api.Container) error + ValidateContainerAdjustment func(context.Context, *api.ValidateContainerAdjustmentRequest) error +} + +// New creates a stub with the given plugin and options. +func New(p interface{}, opts ...Option) (Stub, error) { + stub := &stub{ + plugin: p, + name: os.Getenv(api.PluginNameEnvVar), + idx: os.Getenv(api.PluginIdxEnvVar), + socketPath: api.DefaultSocketPath, + dialer: func(p string) (stdnet.Conn, error) { return stdnet.Dial("unix", p) }, + + registrationTimeout: DefaultRegistrationTimeout, + requestTimeout: DefaultRequestTimeout, + } + + for _, o := range opts { + if err := o(stub); err != nil { + return nil, err + } + } + + if err := stub.setupHandlers(); err != nil { + return nil, err + } + + if err := stub.ensureIdentity(); err != nil { + return nil, err + } + + log.Infof(noCtx, "Created plugin %s (%s, handles %s)", stub.Name(), + filepath.Base(os.Args[0]), stub.events.PrettyString()) + + return stub, nil +} + +// Start event processing, register to NRI and wait for getting configured. +func (stub *stub) Start(ctx context.Context) (retErr error) { + stub.Lock() + defer stub.Unlock() + + if stub.isStarted() { + return fmt.Errorf("stub already started") + } + stub.doneC = make(chan struct{}) + + err := stub.connect() + if err != nil { + return err + } + + rpcm := multiplex.Multiplex(stub.conn) + defer func() { + if retErr != nil { + rpcm.Close() + stub.rpcm = nil + } + }() + + rpcl, err := rpcm.Listen(multiplex.PluginServiceConn) + if err != nil { + return err + } + defer func() { + if retErr != nil { + rpcl.Close() + stub.rpcl = nil + } + }() + + rpcs, err := ttrpc.NewServer(stub.serverOpts...) + if err != nil { + return fmt.Errorf("failed to create ttrpc server: %w", err) + } + defer func() { + if retErr != nil { + rpcs.Close() + stub.rpcs = nil + } + }() + + api.RegisterPluginService(rpcs, stub) + + conn, err := rpcm.Open(multiplex.RuntimeServiceConn) + if err != nil { + return fmt.Errorf("failed to multiplex ttrpc client connection: %w", err) + } + + clientOpts := []ttrpc.ClientOpts{ + ttrpc.WithOnClose(func() { + stub.connClosed() + }), + } + rpcc := ttrpc.NewClient(conn, append(clientOpts, stub.clientOpts...)...) + defer func() { + if retErr != nil { + rpcc.Close() + stub.rpcc = nil + } + }() + + stub.srvErrC = make(chan error, 1) + stub.cfgErrC = make(chan error, 1) + + go func(l stdnet.Listener, doneC chan struct{}, srvErrC chan error) { + srvErrC <- rpcs.Serve(ctx, l) + close(doneC) + }(rpcl, stub.doneC, stub.srvErrC) + + stub.rpcm = rpcm + stub.rpcl = rpcl + stub.rpcs = rpcs + stub.rpcc = rpcc + + stub.runtime = api.NewRuntimeClient(rpcc) + + if err = stub.register(ctx); err != nil { + stub.close() + return err + } + + if err = <-stub.cfgErrC; err != nil { + return err + } + + log.Infof(ctx, "Started plugin %s...", stub.Name()) + + stub.started = true + return nil +} + +// Stop the plugin. +func (stub *stub) Stop() { + log.Infof(noCtx, "Stopping plugin %s...", stub.Name()) + + stub.Lock() + defer stub.Unlock() + stub.close() +} + +// IsStarted returns true if the plugin has been started either by Start() or by Run(). +func (stub *stub) IsStarted() bool { + stub.Lock() + defer stub.Unlock() + return stub.isStarted() +} + +func (stub *stub) isStarted() bool { + return stub.started +} + +// reset stub to the status that can initiate a new +// NRI connection, the caller must hold lock. +func (stub *stub) close() { + if !stub.isStarted() { + return + } + + if stub.rpcl != nil { + stub.rpcl.Close() + } + if stub.rpcs != nil { + stub.rpcs.Close() + } + if stub.rpcc != nil { + stub.rpcc.Close() + } + if stub.rpcm != nil { + stub.rpcm.Close() + } + if stub.srvErrC != nil { + <-stub.doneC + } + + stub.started = false + stub.conn = nil + stub.syncReq = nil +} + +// Run the plugin. Start event processing then wait for an error or getting stopped. +func (stub *stub) Run(ctx context.Context) error { + var err error + + if err = stub.Start(ctx); err != nil { + return err + } + + err = <-stub.srvErrC + if err == ttrpc.ErrServerClosed { + log.Infof(noCtx, "ttrpc server closed %s : %v", stub.Name(), err) + } + + return err +} + +// Wait for the plugin to stop, should be called after Start() or Run(). +func (stub *stub) Wait() { + if stub.IsStarted() { + <-stub.doneC + } +} + +// Name returns the full indexed name of the plugin. +func (stub *stub) Name() string { + return stub.idx + "-" + stub.name +} + +func (stub *stub) RegistrationTimeout() time.Duration { + return stub.registrationTimeout +} + +func (stub *stub) RequestTimeout() time.Duration { + return stub.requestTimeout +} + +// Connect the plugin to NRI. +func (stub *stub) connect() error { + if stub.conn != nil { + log.Infof(noCtx, "Using given plugin connection...") + return nil + } + + if env := os.Getenv(api.PluginSocketEnvVar); env != "" { + log.Infof(noCtx, "Using connection %q from environment...", env) + + fd, err := strconv.Atoi(env) + if err != nil { + return fmt.Errorf("invalid socket in environment (%s=%q): %w", + api.PluginSocketEnvVar, env, err) + } + + stub.conn, err = net.NewFdConn(fd) + if err != nil { + return fmt.Errorf("invalid socket (%d) in environment: %w", fd, err) + } + + return nil + } + + conn, err := stub.dialer(stub.socketPath) + if err != nil { + return fmt.Errorf("failed to connect to NRI service: %w", err) + } + + stub.conn = conn + + return nil +} + +// Register the plugin with NRI. +func (stub *stub) register(ctx context.Context) error { + log.Infof(ctx, "Registering plugin %s...", stub.Name()) + + ctx, cancel := context.WithTimeout(ctx, stub.registrationTimeout) + defer cancel() + + req := &api.RegisterPluginRequest{ + PluginName: stub.name, + PluginIdx: stub.idx, + } + if _, err := stub.runtime.RegisterPlugin(ctx, req); err != nil { + return fmt.Errorf("failed to register with NRI/Runtime: %w", err) + } + + return nil +} + +// Handle a lost connection. +func (stub *stub) connClosed() { + stub.Lock() + stub.close() + stub.Unlock() + if stub.onClose != nil { + stub.onClose() + return + } +} + +// +// plugin event and request handlers +// + +// UpdateContainers requests unsolicited updates to containers. +func (stub *stub) UpdateContainers(update []*api.ContainerUpdate) ([]*api.ContainerUpdate, error) { + if stub.runtime == nil { + return nil, ErrNoService + } + + ctx := context.Background() + req := &api.UpdateContainersRequest{ + Update: update, + } + rpl, err := stub.runtime.UpdateContainers(ctx, req) + if rpl != nil { + return rpl.Failed, err + } + return nil, err +} + +// Configure the plugin. +func (stub *stub) Configure(ctx context.Context, req *api.ConfigureRequest) (rpl *api.ConfigureResponse, retErr error) { + var ( + events api.EventMask + err error + ) + + log.Infof(ctx, "Configuring plugin %s for runtime %s/%s...", stub.Name(), + req.RuntimeName, req.RuntimeVersion) + + stub.registrationTimeout = time.Duration(req.RegistrationTimeout * int64(time.Millisecond)) + stub.requestTimeout = time.Duration(req.RequestTimeout * int64(time.Millisecond)) + + defer func() { + stub.cfgErrC <- retErr + }() + + if handler := stub.handlers.Configure; handler == nil { + events = stub.events + } else { + events, err = handler(ctx, req.Config, req.RuntimeName, req.RuntimeVersion) + if err != nil { + log.Errorf(ctx, "Plugin configuration failed: %v", err) + return nil, err + } + + if events == 0 { + events = stub.events + } + + // Only allow plugins to subscribe to events they can handle. + if extra := events & ^stub.events; extra != 0 { + log.Errorf(ctx, "Plugin subscribed for unhandled events %s (0x%x)", + extra.PrettyString(), extra) + return nil, fmt.Errorf("internal error: unhandled events %s (0x%x)", + extra.PrettyString(), extra) + } + + log.Infof(ctx, "Subscribing plugin %s (%s) for events %s", stub.Name(), + filepath.Base(os.Args[0]), events.PrettyString()) + } + + return &api.ConfigureResponse{ + Events: int32(events), + }, nil +} + +// Synchronize the state of the plugin with the runtime. +func (stub *stub) Synchronize(ctx context.Context, req *api.SynchronizeRequest) (*api.SynchronizeResponse, error) { + handler := stub.handlers.Synchronize + if handler == nil { + return &api.SynchronizeResponse{More: req.More}, nil + } + + if req.More { + return stub.collectSync(req) + } + + return stub.deliverSync(ctx, req) +} + +func (stub *stub) collectSync(req *api.SynchronizeRequest) (*api.SynchronizeResponse, error) { + stub.Lock() + defer stub.Unlock() + + log.Debugf(noCtx, "collecting sync req with %d pods, %d containers...", + len(req.Pods), len(req.Containers)) + + if stub.syncReq == nil { + stub.syncReq = req + } else { + stub.syncReq.Pods = append(stub.syncReq.Pods, req.Pods...) + stub.syncReq.Containers = append(stub.syncReq.Containers, req.Containers...) + } + + return &api.SynchronizeResponse{More: req.More}, nil +} + +func (stub *stub) deliverSync(ctx context.Context, req *api.SynchronizeRequest) (*api.SynchronizeResponse, error) { + stub.Lock() + syncReq := stub.syncReq + stub.syncReq = nil + stub.Unlock() + + if syncReq == nil { + syncReq = req + } else { + syncReq.Pods = append(syncReq.Pods, req.Pods...) + syncReq.Containers = append(syncReq.Containers, req.Containers...) + } + + update, err := stub.handlers.Synchronize(ctx, syncReq.Pods, syncReq.Containers) + return &api.SynchronizeResponse{ + Update: update, + More: false, + }, err +} + +// Shutdown the plugin. +func (stub *stub) Shutdown(ctx context.Context, _ *api.ShutdownRequest) (*api.ShutdownResponse, error) { + handler := stub.handlers.Shutdown + if handler != nil { + handler(ctx) + } + return &api.ShutdownResponse{}, nil +} + +// RunPodSandbox request handler. +func (stub *stub) RunPodSandbox(ctx context.Context, req *api.RunPodSandboxRequest) (*api.RunPodSandboxResponse, error) { + if handler := stub.handlers.RunPodSandbox; handler != nil { + return &api.RunPodSandboxResponse{}, handler(ctx, req.Pod) + } + + return &api.RunPodSandboxResponse{}, nil +} + +// UpdatePodSandbox request handler. +func (stub *stub) UpdatePodSandbox(ctx context.Context, req *api.UpdatePodSandboxRequest) (*api.UpdatePodSandboxResponse, error) { + handler := stub.handlers.UpdatePodSandbox + if handler == nil { + return &api.UpdatePodSandboxResponse{}, nil + } + err := handler(ctx, req.Pod, req.OverheadLinuxResources, req.LinuxResources) + return &api.UpdatePodSandboxResponse{}, err +} + +// PostUpdatePodSandbox request handler. +func (stub *stub) PostUpdatePodSandbox(ctx context.Context, req *api.PostUpdatePodSandboxRequest) (*api.PostUpdatePodSandboxResponse, error) { + if handler := stub.handlers.PostUpdatePodSandbox; handler != nil { + return &api.PostUpdatePodSandboxResponse{}, handler(ctx, req.Pod) + } + + return &api.PostUpdatePodSandboxResponse{}, nil +} + +// StopPodSandbox request handler. +func (stub *stub) StopPodSandbox(ctx context.Context, req *api.StopPodSandboxRequest) (*api.StopPodSandboxResponse, error) { + if handler := stub.handlers.StopPodSandbox; handler != nil { + return &api.StopPodSandboxResponse{}, handler(ctx, req.Pod) + } + + return &api.StopPodSandboxResponse{}, nil +} + +// RemovePodSandbox request handler. +func (stub *stub) RemovePodSandbox(ctx context.Context, req *api.RemovePodSandboxRequest) (*api.RemovePodSandboxResponse, error) { + if handler := stub.handlers.RemovePodSandbox; handler != nil { + return &api.RemovePodSandboxResponse{}, handler(ctx, req.Pod) + } + + return &api.RemovePodSandboxResponse{}, nil +} + +// CreateContainer request handler. +func (stub *stub) CreateContainer(ctx context.Context, req *api.CreateContainerRequest) (*api.CreateContainerResponse, error) { + handler := stub.handlers.CreateContainer + if handler == nil { + return &api.CreateContainerResponse{}, nil + } + adjust, update, err := handler(ctx, req.Pod, req.Container) + return &api.CreateContainerResponse{ + Adjust: adjust, + Update: update, + }, err +} + +// PostCreateContainer request handler. +func (stub *stub) PostCreateContainer(ctx context.Context, req *api.PostCreateContainerRequest) (*api.PostCreateContainerResponse, error) { + if handler := stub.handlers.PostCreateContainer; handler != nil { + return &api.PostCreateContainerResponse{}, handler(ctx, req.Pod, req.Container) + } + + return &api.PostCreateContainerResponse{}, nil +} + +// StartContainer request handler. +func (stub *stub) StartContainer(ctx context.Context, req *api.StartContainerRequest) (*api.StartContainerResponse, error) { + if handler := stub.handlers.StartContainer; handler != nil { + return &api.StartContainerResponse{}, handler(ctx, req.Pod, req.Container) + } + + return &api.StartContainerResponse{}, nil +} + +// PostStartContainer request handler. +func (stub *stub) PostStartContainer(ctx context.Context, req *api.PostStartContainerRequest) (*api.PostStartContainerResponse, error) { + if handler := stub.handlers.PostStartContainer; handler != nil { + return &api.PostStartContainerResponse{}, handler(ctx, req.Pod, req.Container) + } + + return &api.PostStartContainerResponse{}, nil +} + +// UpdateContainer request handler. +func (stub *stub) UpdateContainer(ctx context.Context, req *api.UpdateContainerRequest) (*api.UpdateContainerResponse, error) { + handler := stub.handlers.UpdateContainer + if handler == nil { + return &api.UpdateContainerResponse{}, nil + } + update, err := handler(ctx, req.Pod, req.Container, req.LinuxResources) + return &api.UpdateContainerResponse{ + Update: update, + }, err +} + +// PostUpdateContainer request handler. +func (stub *stub) PostUpdateContainer(ctx context.Context, req *api.PostUpdateContainerRequest) (*api.PostUpdateContainerResponse, error) { + if handler := stub.handlers.PostUpdateContainer; handler != nil { + return &api.PostUpdateContainerResponse{}, handler(ctx, req.Pod, req.Container) + } + + return &api.PostUpdateContainerResponse{}, nil +} + +// StopContainer request handler. +func (stub *stub) StopContainer(ctx context.Context, req *api.StopContainerRequest) (*api.StopContainerResponse, error) { + handler := stub.handlers.StopContainer + if handler == nil { + return &api.StopContainerResponse{}, nil + } + update, err := handler(ctx, req.Pod, req.Container) + return &api.StopContainerResponse{ + Update: update, + }, err +} + +// RemoveContainer request handler. +func (stub *stub) RemoveContainer(ctx context.Context, req *api.RemoveContainerRequest) (*api.RemoveContainerResponse, error) { + if handler := stub.handlers.RemoveContainer; handler != nil { + return &api.RemoveContainerResponse{}, handler(ctx, req.Pod, req.Container) + } + + return &api.RemoveContainerResponse{}, nil +} + +func (stub *stub) ValidateContainerAdjustment(ctx context.Context, req *api.ValidateContainerAdjustmentRequest) (*api.ValidateContainerAdjustmentResponse, error) { + handler := stub.handlers.ValidateContainerAdjustment + if handler == nil { + return &api.ValidateContainerAdjustmentResponse{}, nil + } + + if err := handler(ctx, req); err != nil { + return &api.ValidateContainerAdjustmentResponse{ + Reject: true, + Reason: err.Error(), + }, nil + } + + return &api.ValidateContainerAdjustmentResponse{}, nil +} + +// ensureIdentity sets plugin index and name from the binary if those are unset. +func (stub *stub) ensureIdentity() error { + if stub.idx != "" && stub.name != "" { + return nil + } + + if stub.idx != "" { + stub.name = filepath.Base(os.Args[0]) + return nil + } + + idx, name, err := api.ParsePluginName(filepath.Base(os.Args[0])) + if err != nil { + return err + } + + stub.name = name + stub.idx = idx + + return nil +} + +// Set up event handlers and the subscription mask for the plugin. +func (stub *stub) setupHandlers() error { + if plugin, ok := stub.plugin.(ConfigureInterface); ok { + stub.handlers.Configure = plugin.Configure + } + if plugin, ok := stub.plugin.(SynchronizeInterface); ok { + stub.handlers.Synchronize = plugin.Synchronize + } + if plugin, ok := stub.plugin.(ShutdownInterface); ok { + stub.handlers.Shutdown = plugin.Shutdown + } + + if plugin, ok := stub.plugin.(RunPodInterface); ok { + stub.handlers.RunPodSandbox = plugin.RunPodSandbox + stub.events.Set(api.Event_RUN_POD_SANDBOX) + } + if plugin, ok := stub.plugin.(UpdatePodInterface); ok { + stub.handlers.UpdatePodSandbox = plugin.UpdatePodSandbox + stub.events.Set(api.Event_UPDATE_POD_SANDBOX) + } + if plugin, ok := stub.plugin.(StopPodInterface); ok { + stub.handlers.StopPodSandbox = plugin.StopPodSandbox + stub.events.Set(api.Event_STOP_POD_SANDBOX) + } + if plugin, ok := stub.plugin.(RemovePodInterface); ok { + stub.handlers.RemovePodSandbox = plugin.RemovePodSandbox + stub.events.Set(api.Event_REMOVE_POD_SANDBOX) + } + if plugin, ok := stub.plugin.(PostUpdatePodInterface); ok { + stub.handlers.PostUpdatePodSandbox = plugin.PostUpdatePodSandbox + stub.events.Set(api.Event_POST_UPDATE_POD_SANDBOX) + } + if plugin, ok := stub.plugin.(CreateContainerInterface); ok { + stub.handlers.CreateContainer = plugin.CreateContainer + stub.events.Set(api.Event_CREATE_CONTAINER) + } + if plugin, ok := stub.plugin.(StartContainerInterface); ok { + stub.handlers.StartContainer = plugin.StartContainer + stub.events.Set(api.Event_START_CONTAINER) + } + if plugin, ok := stub.plugin.(UpdateContainerInterface); ok { + stub.handlers.UpdateContainer = plugin.UpdateContainer + stub.events.Set(api.Event_UPDATE_CONTAINER) + } + if plugin, ok := stub.plugin.(StopContainerInterface); ok { + stub.handlers.StopContainer = plugin.StopContainer + stub.events.Set(api.Event_STOP_CONTAINER) + } + if plugin, ok := stub.plugin.(RemoveContainerInterface); ok { + stub.handlers.RemoveContainer = plugin.RemoveContainer + stub.events.Set(api.Event_REMOVE_CONTAINER) + } + if plugin, ok := stub.plugin.(PostCreateContainerInterface); ok { + stub.handlers.PostCreateContainer = plugin.PostCreateContainer + stub.events.Set(api.Event_POST_CREATE_CONTAINER) + } + if plugin, ok := stub.plugin.(PostStartContainerInterface); ok { + stub.handlers.PostStartContainer = plugin.PostStartContainer + stub.events.Set(api.Event_POST_START_CONTAINER) + } + if plugin, ok := stub.plugin.(PostUpdateContainerInterface); ok { + stub.handlers.PostUpdateContainer = plugin.PostUpdateContainer + stub.events.Set(api.Event_POST_UPDATE_CONTAINER) + } + if plugin, ok := stub.plugin.(ValidateContainerAdjustmentInterface); ok { + stub.handlers.ValidateContainerAdjustment = plugin.ValidateContainerAdjustment + stub.events.Set(api.Event_VALIDATE_CONTAINER_ADJUSTMENT) + } + + if stub.events == 0 { + return fmt.Errorf("internal error: plugin %T does not implement any NRI request handlers", + stub.plugin) + } + + return nil +} From 4ae59a84f6ebe2d35df178067ba7435182f2b79a Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Tue, 16 Sep 2025 16:19:52 +0300 Subject: [PATCH 07/20] adaptation: update tests to use v1beta1 API revision. Signed-off-by: Krisztian Litkey --- pkg/adaptation/suite_test.go | 64 +++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/pkg/adaptation/suite_test.go b/pkg/adaptation/suite_test.go index cb4b973b..bfd754f1 100644 --- a/pkg/adaptation/suite_test.go +++ b/pkg/adaptation/suite_test.go @@ -31,7 +31,7 @@ import ( api "github.com/containerd/nri/pkg/api/v1beta1" "github.com/sirupsen/logrus" - "github.com/containerd/nri/pkg/stub" + stub "github.com/containerd/nri/pkg/stub/v1beta1" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -231,10 +231,10 @@ func (m *mockRuntime) synchronize(ctx context.Context, cb nri.SyncCB) error { return err } -func (m *mockRuntime) RunPodSandbox(ctx context.Context, evt *api.StateChangeEvent) error { +func (m *mockRuntime) RunPodSandbox(ctx context.Context, req *api.RunPodSandboxRequest) error { b := m.runtime.BlockPluginSync() defer b.Unblock() - return m.runtime.RunPodSandbox(ctx, evt) + return m.runtime.RunPodSandbox(ctx, req) } func (m *mockRuntime) UpdatePodSandbox(ctx context.Context, req *api.UpdatePodSandboxRequest) (*api.UpdatePodSandboxResponse, error) { @@ -256,7 +256,7 @@ func (m *mockRuntime) UpdateContainer(ctx context.Context, req *api.UpdateContai } func (m *mockRuntime) startStopPodAndContainer(ctx context.Context, pod *api.PodSandbox, ctr *api.Container) error { - err := m.RunPodSandbox(ctx, &api.StateChangeEvent{ + err := m.RunPodSandbox(ctx, &api.RunPodSandboxRequest{ Pod: pod, }) if err != nil { @@ -272,7 +272,7 @@ func (m *mockRuntime) startStopPodAndContainer(ctx context.Context, pod *api.Pod return err } - err = m.runtime.PostUpdatePodSandbox(ctx, &api.StateChangeEvent{ + err = m.runtime.PostUpdatePodSandbox(ctx, &api.PostUpdatePodSandboxRequest{ Pod: pod, }) if err != nil { @@ -287,7 +287,7 @@ func (m *mockRuntime) startStopPodAndContainer(ctx context.Context, pod *api.Pod return err } - err = m.runtime.PostCreateContainer(ctx, &api.StateChangeEvent{ + err = m.runtime.PostCreateContainer(ctx, &api.PostCreateContainerRequest{ Pod: pod, Container: ctr, }) @@ -295,7 +295,7 @@ func (m *mockRuntime) startStopPodAndContainer(ctx context.Context, pod *api.Pod return err } - err = m.runtime.StartContainer(ctx, &api.StateChangeEvent{ + err = m.runtime.StartContainer(ctx, &api.StartContainerRequest{ Pod: pod, Container: ctr, }) @@ -303,7 +303,7 @@ func (m *mockRuntime) startStopPodAndContainer(ctx context.Context, pod *api.Pod return err } - err = m.runtime.PostStartContainer(ctx, &api.StateChangeEvent{ + err = m.runtime.PostStartContainer(ctx, &api.PostStartContainerRequest{ Pod: pod, Container: ctr, }) @@ -320,7 +320,7 @@ func (m *mockRuntime) startStopPodAndContainer(ctx context.Context, pod *api.Pod return err } - err = m.runtime.PostUpdateContainer(ctx, &api.StateChangeEvent{ + err = m.runtime.PostUpdateContainer(ctx, &api.PostUpdateContainerRequest{ Pod: pod, Container: ctr, }) @@ -336,7 +336,7 @@ func (m *mockRuntime) startStopPodAndContainer(ctx context.Context, pod *api.Pod return err } - err = m.runtime.RemoveContainer(ctx, &api.StateChangeEvent{ + err = m.runtime.RemoveContainer(ctx, &api.RemoveContainerRequest{ Pod: pod, Container: ctr, }) @@ -344,14 +344,14 @@ func (m *mockRuntime) startStopPodAndContainer(ctx context.Context, pod *api.Pod return err } - err = m.runtime.StopPodSandbox(ctx, &api.StateChangeEvent{ + err = m.runtime.StopPodSandbox(ctx, &api.StopPodSandboxRequest{ Pod: pod, }) if err != nil { return err } - err = m.runtime.RemovePodSandbox(ctx, &api.StateChangeEvent{ + err = m.runtime.RemovePodSandbox(ctx, &api.RemovePodSandboxRequest{ Pod: pod, }) if err != nil { @@ -378,11 +378,11 @@ type mockPlugin struct { pods map[string]*api.PodSandbox ctrs map[string]*api.Container - runPodSandbox func(*mockPlugin, *api.PodSandbox, *api.Container) error + runPodSandbox func(*mockPlugin, *api.PodSandbox) error updatePodSandbox func(*mockPlugin, *api.PodSandbox, *api.LinuxResources, *api.LinuxResources) error - postUpdatePodSandbox func(*mockPlugin, *api.PodSandbox, *api.Container) error - stopPodSandbox func(*mockPlugin, *api.PodSandbox, *api.Container) error - removePodSandbox func(*mockPlugin, *api.PodSandbox, *api.Container) error + postUpdatePodSandbox func(*mockPlugin, *api.PodSandbox) error + stopPodSandbox func(*mockPlugin, *api.PodSandbox) error + removePodSandbox func(*mockPlugin, *api.PodSandbox) error createContainer func(*mockPlugin, *api.PodSandbox, *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) postCreateContainer func(*mockPlugin, *api.PodSandbox, *api.Container) error startContainer func(*mockPlugin, *api.PodSandbox, *api.Container) error @@ -471,43 +471,43 @@ func (m *mockPlugin) Init(dir string) error { m.ctrs = make(map[string]*api.Container) if m.runPodSandbox == nil { - m.runPodSandbox = nopEvent + m.runPodSandbox = nopPodEvent } if m.updatePodSandbox == nil { m.updatePodSandbox = nopUpdatePodSandbox } if m.postUpdatePodSandbox == nil { - m.postUpdatePodSandbox = nopEvent + m.postUpdatePodSandbox = nopPodEvent } if m.stopPodSandbox == nil { - m.stopPodSandbox = nopEvent + m.stopPodSandbox = nopPodEvent } if m.removePodSandbox == nil { - m.removePodSandbox = nopEvent + m.removePodSandbox = nopPodEvent } if m.createContainer == nil { m.createContainer = nopCreateContainer } if m.postCreateContainer == nil { - m.postCreateContainer = nopEvent + m.postCreateContainer = nopContainerEvent } if m.startContainer == nil { - m.startContainer = nopEvent + m.startContainer = nopContainerEvent } if m.postStartContainer == nil { - m.postStartContainer = nopEvent + m.postStartContainer = nopContainerEvent } if m.updateContainer == nil { m.updateContainer = nopUpdateContainer } if m.postUpdateContainer == nil { - m.postUpdateContainer = nopEvent + m.postUpdateContainer = nopContainerEvent } if m.stopContainer == nil { m.stopContainer = nopStopContainer } if m.removeContainer == nil { - m.removeContainer = nopEvent + m.removeContainer = nopContainerEvent } return nil @@ -592,7 +592,7 @@ func (m *mockPlugin) Shutdown(_ context.Context) { func (m *mockPlugin) RunPodSandbox(_ context.Context, pod *api.PodSandbox) error { m.pods[pod.Id] = pod - err := m.runPodSandbox(m, pod, nil) + err := m.runPodSandbox(m, pod) m.q.Add(PodSandboxEvent(pod, RunPodSandbox)) return err } @@ -606,21 +606,21 @@ func (m *mockPlugin) UpdatePodSandbox(_ context.Context, pod *api.PodSandbox, ov func (m *mockPlugin) PostUpdatePodSandbox(_ context.Context, pod *api.PodSandbox) error { m.pods[pod.Id] = pod - err := m.postUpdatePodSandbox(m, pod, nil) + err := m.postUpdatePodSandbox(m, pod) m.q.Add(PodSandboxEvent(pod, PostUpdatePodSandbox)) return err } func (m *mockPlugin) StopPodSandbox(_ context.Context, pod *api.PodSandbox) error { m.pods[pod.Id] = pod - err := m.stopPodSandbox(m, pod, nil) + err := m.stopPodSandbox(m, pod) m.q.Add(PodSandboxEvent(pod, StopPodSandbox)) return err } func (m *mockPlugin) RemovePodSandbox(_ context.Context, pod *api.PodSandbox) error { delete(m.pods, pod.Id) - err := m.removePodSandbox(m, pod, nil) + err := m.removePodSandbox(m, pod) m.q.Add(PodSandboxEvent(pod, RemovePodSandbox)) return err } @@ -696,7 +696,11 @@ func (m *mockPlugin) ValidateContainerAdjustment(_ context.Context, req *api.Val return nil } -func nopEvent(*mockPlugin, *api.PodSandbox, *api.Container) error { +func nopPodEvent(*mockPlugin, *api.PodSandbox) error { + return nil +} + +func nopContainerEvent(*mockPlugin, *api.PodSandbox, *api.Container) error { return nil } From 14739f6681acc9a29aacdcef86805a3a459b12d5 Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Wed, 17 Sep 2025 17:04:44 +0300 Subject: [PATCH 08/20] plugins: update to use v1beta1 API revision. Signed-off-by: Krisztian Litkey --- pkg/plugin/annotations.go | 2 +- .../default-validator/default-validator.go | 2 +- .../default-validator_test.go | 2 +- plugins/device-injector/device-injector.go | 4 +- plugins/differ/nri-differ.go | 4 +- plugins/hook-injector/hook-injector.go | 4 +- plugins/logger/nri-logger.go | 4 +- .../network-device-injector.go | 4 +- plugins/network-logger/plugin.go | 4 +- plugins/template/plugin.go | 12 ++--- plugins/ulimit-adjuster/adjuster.go | 4 +- plugins/ulimit-adjuster/adjuster_test.go | 2 +- plugins/v010-adapter/v010-adapter.go | 4 +- plugins/wasm/plugin.go | 52 ++++--------------- 14 files changed, 37 insertions(+), 67 deletions(-) diff --git a/pkg/plugin/annotations.go b/pkg/plugin/annotations.go index 45160941..cdc413e6 100644 --- a/pkg/plugin/annotations.go +++ b/pkg/plugin/annotations.go @@ -17,7 +17,7 @@ package plugin import ( - "github.com/containerd/nri/pkg/api" + api "github.com/containerd/nri/pkg/api/v1beta1" ) const ( diff --git a/plugins/default-validator/default-validator.go b/plugins/default-validator/default-validator.go index f17689d1..5ff8e0e9 100644 --- a/plugins/default-validator/default-validator.go +++ b/plugins/default-validator/default-validator.go @@ -24,7 +24,7 @@ import ( "strconv" "strings" - "github.com/containerd/nri/pkg/api" + api "github.com/containerd/nri/pkg/api/v1beta1" "github.com/containerd/nri/pkg/log" "github.com/containerd/nri/pkg/plugin" yaml "gopkg.in/yaml.v3" diff --git a/plugins/default-validator/default-validator_test.go b/plugins/default-validator/default-validator_test.go index 315e0777..d8009fab 100644 --- a/plugins/default-validator/default-validator_test.go +++ b/plugins/default-validator/default-validator_test.go @@ -19,7 +19,7 @@ package validator import ( "testing" - "github.com/containerd/nri/pkg/api" + api "github.com/containerd/nri/pkg/api/v1beta1" "github.com/stretchr/testify/require" ) diff --git a/plugins/device-injector/device-injector.go b/plugins/device-injector/device-injector.go index 06b60016..9ad1aa31 100644 --- a/plugins/device-injector/device-injector.go +++ b/plugins/device-injector/device-injector.go @@ -26,8 +26,8 @@ import ( "github.com/sirupsen/logrus" "sigs.k8s.io/yaml" - "github.com/containerd/nri/pkg/api" - "github.com/containerd/nri/pkg/stub" + api "github.com/containerd/nri/pkg/api/v1beta1" + stub "github.com/containerd/nri/pkg/stub/v1beta1" ) const ( diff --git a/plugins/differ/nri-differ.go b/plugins/differ/nri-differ.go index 63b32831..3a05451f 100644 --- a/plugins/differ/nri-differ.go +++ b/plugins/differ/nri-differ.go @@ -31,8 +31,8 @@ import ( "github.com/sters/yaml-diff/yamldiff" "sigs.k8s.io/yaml" - "github.com/containerd/nri/pkg/api" - "github.com/containerd/nri/pkg/stub" + api "github.com/containerd/nri/pkg/api/v1beta1" + stub "github.com/containerd/nri/pkg/stub/v1beta1" ) type config struct { diff --git a/plugins/hook-injector/hook-injector.go b/plugins/hook-injector/hook-injector.go index c551c759..0c2fb458 100644 --- a/plugins/hook-injector/hook-injector.go +++ b/plugins/hook-injector/hook-injector.go @@ -28,8 +28,8 @@ import ( "github.com/sirupsen/logrus" "sigs.k8s.io/yaml" - "github.com/containerd/nri/pkg/api" - "github.com/containerd/nri/pkg/stub" + api "github.com/containerd/nri/pkg/api/v1beta1" + stub "github.com/containerd/nri/pkg/stub/v1beta1" ) var ( diff --git a/plugins/logger/nri-logger.go b/plugins/logger/nri-logger.go index fd6aec78..eedd4b5a 100644 --- a/plugins/logger/nri-logger.go +++ b/plugins/logger/nri-logger.go @@ -26,8 +26,8 @@ import ( "github.com/sirupsen/logrus" "sigs.k8s.io/yaml" - "github.com/containerd/nri/pkg/api" - "github.com/containerd/nri/pkg/stub" + api "github.com/containerd/nri/pkg/api/v1beta1" + stub "github.com/containerd/nri/pkg/stub/v1beta1" ) type config struct { diff --git a/plugins/network-device-injector/network-device-injector.go b/plugins/network-device-injector/network-device-injector.go index 9180d13d..7bb67755 100644 --- a/plugins/network-device-injector/network-device-injector.go +++ b/plugins/network-device-injector/network-device-injector.go @@ -30,8 +30,8 @@ import ( "github.com/vishvananda/netlink" "sigs.k8s.io/yaml" - "github.com/containerd/nri/pkg/api" - "github.com/containerd/nri/pkg/stub" + api "github.com/containerd/nri/pkg/api/v1beta1" + stub "github.com/containerd/nri/pkg/stub/v1beta1" ) const ( diff --git a/plugins/network-logger/plugin.go b/plugins/network-logger/plugin.go index 0140a00a..197fb2b6 100644 --- a/plugins/network-logger/plugin.go +++ b/plugins/network-logger/plugin.go @@ -23,8 +23,8 @@ import ( "github.com/sirupsen/logrus" - "github.com/containerd/nri/pkg/api" - "github.com/containerd/nri/pkg/stub" + api "github.com/containerd/nri/pkg/api/v1beta1" + stub "github.com/containerd/nri/pkg/stub/v1beta1" ) type plugin struct { diff --git a/plugins/template/plugin.go b/plugins/template/plugin.go index ec72a923..28e6d95f 100644 --- a/plugins/template/plugin.go +++ b/plugins/template/plugin.go @@ -25,8 +25,8 @@ import ( "github.com/sirupsen/logrus" "sigs.k8s.io/yaml" - "github.com/containerd/nri/pkg/api" - "github.com/containerd/nri/pkg/stub" + api "github.com/containerd/nri/pkg/api/v1beta1" + stub "github.com/containerd/nri/pkg/stub/v1beta1" ) type config struct { @@ -93,11 +93,11 @@ func (p *plugin) CreateContainer(_ context.Context, pod *api.PodSandbox, ctr *ap // has not been created yet, this is the lifecycle event which allows you // the largest set of changes to the container's configuration, including // some of the later immutable parameters. Take a look at the adjustment - // functions in pkg/api/adjustment.go to see the available controls. + // functions in pkg/api/v1beta1/adjustment.go to see the available controls. // // In addition to reconfiguring the container being created, you are also // allowed to update other existing containers. Take a look at the update - // functions in pkg/api/update.go to see the available controls. + // functions in pkg/api/v1beta1/update.go to see the available controls. // adjustment := &api.ContainerAdjustment{} @@ -127,7 +127,7 @@ func (p *plugin) UpdateContainer(_ context.Context, pod *api.PodSandbox, ctr *ap // // This is the container update request handler. You can make changes to // the container update before it is applied. Take a look at the functions - // in pkg/api/update.go to see the available controls. + // in pkg/api/v1beta1/update.go to see the available controls. // // In addition to altering the pending update itself, you are also allowed // to update other existing containers. @@ -149,7 +149,7 @@ func (p *plugin) StopContainer(_ context.Context, pod *api.PodSandbox, ctr *api. // // This is the container (post-)stop request handler. You can update any // of the remaining running containers. Take a look at the functions in - // pkg/api/update.go to see the available controls. + // pkg/api/v1beta1/update.go to see the available controls. // return []*api.ContainerUpdate{}, nil diff --git a/plugins/ulimit-adjuster/adjuster.go b/plugins/ulimit-adjuster/adjuster.go index 7ece2cdb..2195baf5 100644 --- a/plugins/ulimit-adjuster/adjuster.go +++ b/plugins/ulimit-adjuster/adjuster.go @@ -27,8 +27,8 @@ import ( "github.com/sirupsen/logrus" "sigs.k8s.io/yaml" - "github.com/containerd/nri/pkg/api" - "github.com/containerd/nri/pkg/stub" + api "github.com/containerd/nri/pkg/api/v1beta1" + stub "github.com/containerd/nri/pkg/stub/v1beta1" ) const ( diff --git a/plugins/ulimit-adjuster/adjuster_test.go b/plugins/ulimit-adjuster/adjuster_test.go index 2b576e5c..946bde22 100644 --- a/plugins/ulimit-adjuster/adjuster_test.go +++ b/plugins/ulimit-adjuster/adjuster_test.go @@ -22,7 +22,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/containerd/nri/pkg/api" + api "github.com/containerd/nri/pkg/api/v1beta1" ) func TestParseAnnotations(t *testing.T) { diff --git a/plugins/v010-adapter/v010-adapter.go b/plugins/v010-adapter/v010-adapter.go index f45f7124..411ec45e 100644 --- a/plugins/v010-adapter/v010-adapter.go +++ b/plugins/v010-adapter/v010-adapter.go @@ -24,8 +24,8 @@ import ( "github.com/sirupsen/logrus" "github.com/containerd/nri" - "github.com/containerd/nri/pkg/api" - "github.com/containerd/nri/pkg/stub" + api "github.com/containerd/nri/pkg/api/v1beta1" + stub "github.com/containerd/nri/pkg/stub/v1beta1" nriv1 "github.com/containerd/nri/types/v1" oci "github.com/opencontainers/runtime-spec/specs-go" ) diff --git a/plugins/wasm/plugin.go b/plugins/wasm/plugin.go index 1d339d41..d10dbd76 100644 --- a/plugins/wasm/plugin.go +++ b/plugins/wasm/plugin.go @@ -19,7 +19,7 @@ package main import ( "context" - api "github.com/containerd/nri/pkg/api" + api "github.com/containerd/nri/pkg/api/v1beta1" ) type plugin struct{} @@ -47,42 +47,12 @@ func (p *plugin) Synchronize(ctx context.Context, req *api.SynchronizeRequest) ( return nil, nil } -func (p *plugin) Shutdown(ctx context.Context, req *api.Empty) (*api.Empty, error) { +func (p *plugin) Shutdown(ctx context.Context, req *api.ShutdownRequest) (*api.ShutdownResponse, error) { log(ctx, "Got shutdown request") return nil, nil } -func (p *plugin) StateChange(ctx context.Context, req *api.StateChangeEvent) (*api.Empty, error) { - log(ctx, "Got state change request with event: "+req.GetEvent().String()) - - // Event_CREATE_CONTAINER, Event_UPDATE_CONTAINER and Event_STOP_CONTAINER - // are defined within the service protocol definition and therefore being - // called directly. - switch req.GetEvent() { - case api.Event_RUN_POD_SANDBOX: - return p.RunPodSandbox(ctx, req.GetPod()) - case api.Event_POST_UPDATE_POD_SANDBOX: - return p.PostUpdatePodSandbox(ctx, req.GetPod()) - case api.Event_STOP_POD_SANDBOX: - return p.StopPodSandbox(ctx, req.GetPod()) - case api.Event_REMOVE_POD_SANDBOX: - return p.RemovePodSandbox(ctx, req.GetPod()) - case api.Event_POST_CREATE_CONTAINER: - return p.PostCreateContainer(ctx, req.GetPod(), req.GetContainer()) - case api.Event_START_CONTAINER: - return p.StartContainer(ctx, req.GetPod(), req.GetContainer()) - case api.Event_POST_START_CONTAINER: - return p.PostStartContainer(ctx, req.GetPod(), req.GetContainer()) - case api.Event_POST_UPDATE_CONTAINER: - return p.PostUpdateContainer(ctx, req.GetPod(), req.GetContainer()) - case api.Event_REMOVE_CONTAINER: - return p.RemoveContainer(ctx, req.GetPod(), req.GetContainer()) - } - - return &api.Empty{}, nil -} - -func (p *plugin) RunPodSandbox(ctx context.Context, pod *api.PodSandbox) (*api.Empty, error) { +func (p *plugin) RunPodSandbox(ctx context.Context, req *api.RunPodSandboxRequest) (*api.RunPodSandboxResponse, error) { log(ctx, "Got run pod sandbox request") return nil, nil } @@ -92,17 +62,17 @@ func (p *plugin) UpdatePodSandbox(ctx context.Context, req *api.UpdatePodSandbox return nil, nil } -func (p *plugin) PostUpdatePodSandbox(ctx context.Context, pod *api.PodSandbox) (*api.Empty, error) { +func (p *plugin) PostUpdatePodSandbox(ctx context.Context, req *api.PostUpdatePodSandboxRequest) (*api.PostUpdatePodSandboxResponse, error) { log(ctx, "Got post update pod sandbox request") return nil, nil } -func (p *plugin) StopPodSandbox(ctx context.Context, pod *api.PodSandbox) (*api.Empty, error) { +func (p *plugin) StopPodSandbox(ctx context.Context, req *api.StopPodSandboxRequest) (*api.StopPodSandboxResponse, error) { log(ctx, "Got stop pod sandbox request") return nil, nil } -func (p *plugin) RemovePodSandbox(ctx context.Context, pod *api.PodSandbox) (*api.Empty, error) { +func (p *plugin) RemovePodSandbox(ctx context.Context, req *api.RemovePodSandboxRequest) (*api.RemovePodSandboxResponse, error) { log(ctx, "Got remove pod sandbox request") return nil, nil } @@ -112,17 +82,17 @@ func (p *plugin) CreateContainer(ctx context.Context, req *api.CreateContainerRe return nil, nil } -func (p *plugin) PostCreateContainer(ctx context.Context, pod *api.PodSandbox, container *api.Container) (*api.Empty, error) { +func (p *plugin) PostCreateContainer(ctx context.Context, req *api.PostCreateContainerRequest) (*api.PostCreateContainerResponse, error) { log(ctx, "Got post create container request") return nil, nil } -func (p *plugin) StartContainer(ctx context.Context, pod *api.PodSandbox, container *api.Container) (*api.Empty, error) { +func (p *plugin) StartContainer(ctx context.Context, req *api.StartContainerRequest) (*api.StartContainerResponse, error) { log(ctx, "Got start container request") return nil, nil } -func (p *plugin) PostStartContainer(ctx context.Context, pod *api.PodSandbox, container *api.Container) (*api.Empty, error) { +func (p *plugin) PostStartContainer(ctx context.Context, req *api.PostStartContainerRequest) (*api.PostStartContainerResponse, error) { log(ctx, "Got post start container request") return nil, nil } @@ -132,7 +102,7 @@ func (p *plugin) UpdateContainer(ctx context.Context, req *api.UpdateContainerRe return nil, nil } -func (p *plugin) PostUpdateContainer(ctx context.Context, pod *api.PodSandbox, container *api.Container) (*api.Empty, error) { +func (p *plugin) PostUpdateContainer(ctx context.Context, req *api.PostUpdateContainerRequest) (*api.PostUpdateContainerResponse, error) { log(ctx, "Got post update container request") return nil, nil } @@ -142,7 +112,7 @@ func (p *plugin) StopContainer(ctx context.Context, req *api.StopContainerReques return nil, nil } -func (p *plugin) RemoveContainer(ctx context.Context, pod *api.PodSandbox, container *api.Container) (*api.Empty, error) { +func (p *plugin) RemoveContainer(ctx context.Context, req *api.RemoveContainerRequest) (*api.RemoveContainerResponse, error) { log(ctx, "Got remove container request") return nil, nil } From 90e4fd9c17de56054342de7d5ef1a94a80cd0571 Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Fri, 19 Sep 2025 08:43:56 +0300 Subject: [PATCH 09/20] runtime-tools: update to use v1beta1 API revision. Signed-off-by: Krisztian Litkey --- pkg/runtime-tools/generate/generate.go | 2 +- pkg/runtime-tools/generate/generate_suite_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/runtime-tools/generate/generate.go b/pkg/runtime-tools/generate/generate.go index 043dcccb..be9c72f1 100644 --- a/pkg/runtime-tools/generate/generate.go +++ b/pkg/runtime-tools/generate/generate.go @@ -26,7 +26,7 @@ import ( rspec "github.com/opencontainers/runtime-spec/specs-go" "github.com/opencontainers/runtime-tools/generate" - nri "github.com/containerd/nri/pkg/api" + nri "github.com/containerd/nri/pkg/api/v1beta1" ) // GeneratorOption is an option for Generator(). diff --git a/pkg/runtime-tools/generate/generate_suite_test.go b/pkg/runtime-tools/generate/generate_suite_test.go index 10e805df..92a9a58c 100644 --- a/pkg/runtime-tools/generate/generate_suite_test.go +++ b/pkg/runtime-tools/generate/generate_suite_test.go @@ -25,7 +25,7 @@ import ( rspec "github.com/opencontainers/runtime-spec/specs-go" rgen "github.com/opencontainers/runtime-tools/generate" - "github.com/containerd/nri/pkg/api" + api "github.com/containerd/nri/pkg/api/v1beta1" xgen "github.com/containerd/nri/pkg/runtime-tools/generate" ) From 46e9024a4bd861ad812de247ac14929a264a5914 Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Fri, 19 Sep 2025 08:44:53 +0300 Subject: [PATCH 10/20] api,adaptation: protocol translation for v1alpha1. Add protocol translation for plugins that talk v1alpha1. Signed-off-by: Krisztian Litkey --- go.mod | 1 + go.sum | 2 + pkg/adaptation/plugin.go | 1 + pkg/adaptation/v1alpha1-bridge.go | 228 +++++ pkg/api/convert/conversion_test.go | 552 ++++++++++ pkg/api/convert/messages.go | 863 ++++++++++++++++ pkg/api/convert/types.go | 1516 ++++++++++++++++++++++++++++ 7 files changed, 3163 insertions(+) create mode 100644 pkg/adaptation/v1alpha1-bridge.go create mode 100644 pkg/api/convert/conversion_test.go create mode 100644 pkg/api/convert/messages.go create mode 100644 pkg/api/convert/types.go diff --git a/go.mod b/go.mod index 05961849..b78c52a6 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module github.com/containerd/nri go 1.24.0 require ( + github.com/brianvoe/gofakeit/v7 v7.7.3 github.com/containerd/ttrpc v1.2.7 github.com/google/go-cmp v0.7.0 github.com/knqyf263/go-plugin v0.9.0 diff --git a/go.sum b/go.sum index a8463541..dfe64fda 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= +github.com/brianvoe/gofakeit/v7 v7.7.3 h1:RWOATEGpJ5EVg2nN8nlaEyaV/aB4d6c3GqYrbqQekss= +github.com/brianvoe/gofakeit/v7 v7.7.3/go.mod h1:QXuPeBw164PJCzCUZVmgpgHJ3Llj49jSLVkKPMtxtxA= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/containerd/ttrpc v1.2.7 h1:qIrroQvuOL9HQ1X6KHe2ohc7p+HP/0VE6XPU7elJRqQ= diff --git a/pkg/adaptation/plugin.go b/pkg/adaptation/plugin.go index ac6f3e8c..dd1b54dd 100644 --- a/pkg/adaptation/plugin.go +++ b/pkg/adaptation/plugin.go @@ -305,6 +305,7 @@ func (p *plugin) connect(conn stdnet.Conn) (retErr error) { } api.RegisterRuntimeService(p.rpcs, p) + p.RegisterV1Alpha1Bridge() return nil } diff --git a/pkg/adaptation/v1alpha1-bridge.go b/pkg/adaptation/v1alpha1-bridge.go new file mode 100644 index 00000000..4cb90cae --- /dev/null +++ b/pkg/adaptation/v1alpha1-bridge.go @@ -0,0 +1,228 @@ +/* + 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 adaptation + +import ( + "context" + + old "github.com/containerd/nri/pkg/api" + "github.com/containerd/nri/pkg/api/convert" + api "github.com/containerd/nri/pkg/api/v1beta1" +) + +type v1alpha1Bridge struct { + new *plugin + old *v1alpha1Plugin +} + +type v1alpha1Plugin struct { + p old.PluginService +} + +func (p *plugin) RegisterV1Alpha1Bridge() { + b := &v1alpha1Bridge{new: p} + old.RegisterRuntimeService(p.rpcs, b) +} + +func (b *v1alpha1Bridge) RegisterPlugin(ctx context.Context, req *old.RegisterPluginRequest) (*old.Empty, error) { + b.old = &v1alpha1Plugin{ + p: old.NewPluginClient(b.new.rpcc), + } + b.new.impl.ttrpcImpl = b.old + + nreq := convert.RegisterPluginRequest(req) + nrpl, err := b.new.RegisterPlugin(ctx, nreq) + if err != nil { + return nil, err + } + + return convert.RegisterPluginResponse(nrpl), nil +} + +func (b *v1alpha1Bridge) UpdateContainers(ctx context.Context, req *old.UpdateContainersRequest) (*old.UpdateContainersResponse, error) { + nreq := convert.UpdateContainersRequest(req) + nrpl, err := b.new.UpdateContainers(ctx, nreq) + if err != nil { + return nil, err + } + + return convert.UpdateContainersResponse(nrpl), nil +} + +func (p *v1alpha1Plugin) Configure(ctx context.Context, req *api.ConfigureRequest) (*api.ConfigureResponse, error) { + oreq := convert.ConfigureRequest(req) + orpl, err := p.p.Configure(ctx, oreq) + if err != nil { + return nil, err + } + + return convert.ConfigureResponse(orpl), nil +} + +func (p *v1alpha1Plugin) Synchronize(ctx context.Context, req *api.SynchronizeRequest) (*api.SynchronizeResponse, error) { + oreq := convert.SynchronizeRequest(req) + orpl, err := p.p.Synchronize(ctx, oreq) + if err != nil { + return nil, err + } + + return convert.SynchronizeResponse(orpl), nil +} + +func (p *v1alpha1Plugin) Shutdown(_ context.Context, _ *api.ShutdownRequest) (*api.ShutdownResponse, error) { + return &api.ShutdownResponse{}, nil +} + +func (p *v1alpha1Plugin) RunPodSandbox(ctx context.Context, req *api.RunPodSandboxRequest) (*api.RunPodSandboxResponse, error) { + oreq := convert.RunPodSandboxRequest(req) + orpl, err := p.p.StateChange(ctx, oreq) + if err != nil { + return nil, err + } + + return convert.RunPodSandboxResponse(orpl), nil +} + +func (p *v1alpha1Plugin) UpdatePodSandbox(ctx context.Context, req *api.UpdatePodSandboxRequest) (*api.UpdatePodSandboxResponse, error) { + oreq := convert.UpdatePodSandboxRequest(req) + orpl, err := p.p.UpdatePodSandbox(ctx, oreq) + if err != nil { + return nil, err + } + + return convert.UpdatePodSandboxResponse(orpl), nil +} + +func (p *v1alpha1Plugin) PostUpdatePodSandbox(ctx context.Context, req *api.PostUpdatePodSandboxRequest) (*api.PostUpdatePodSandboxResponse, error) { + oreq := convert.PostUpdatePodSandboxRequest(req) + orpl, err := p.p.StateChange(ctx, oreq) + if err != nil { + return nil, err + } + + return convert.PostUpdatePodSandboxResponse(orpl), nil +} + +func (p *v1alpha1Plugin) StopPodSandbox(ctx context.Context, req *api.StopPodSandboxRequest) (*api.StopPodSandboxResponse, error) { + oreq := convert.StopPodSandboxRequest(req) + orpl, err := p.p.StateChange(ctx, oreq) + if err != nil { + return nil, err + } + + return convert.StopPodSandboxResponse(orpl), nil +} + +func (p *v1alpha1Plugin) RemovePodSandbox(ctx context.Context, req *api.RemovePodSandboxRequest) (*api.RemovePodSandboxResponse, error) { + oreq := convert.RemovePodSandboxRequest(req) + orpl, err := p.p.StateChange(ctx, oreq) + if err != nil { + return nil, err + } + + return convert.RemovePodSandboxResponse(orpl), nil +} + +func (p *v1alpha1Plugin) CreateContainer(ctx context.Context, req *api.CreateContainerRequest) (*api.CreateContainerResponse, error) { + oreq := convert.CreateContainerRequest(req) + orpl, err := p.p.CreateContainer(ctx, oreq) + if err != nil { + return nil, err + } + + return convert.CreateContainerResponse(orpl), nil +} + +func (p *v1alpha1Plugin) PostCreateContainer(ctx context.Context, req *api.PostCreateContainerRequest) (*api.PostCreateContainerResponse, error) { + oreq := convert.PostCreateContainerRequest(req) + orpl, err := p.p.StateChange(ctx, oreq) + if err != nil { + return nil, err + } + + return convert.PostCreateContainerResponse(orpl), nil +} + +func (p *v1alpha1Plugin) StartContainer(ctx context.Context, req *api.StartContainerRequest) (*api.StartContainerResponse, error) { + oreq := convert.StartContainerRequest(req) + orpl, err := p.p.StateChange(ctx, oreq) + if err != nil { + return nil, err + } + + return convert.StartContainerResponse(orpl), nil +} + +func (p *v1alpha1Plugin) PostStartContainer(ctx context.Context, req *api.PostStartContainerRequest) (*api.PostStartContainerResponse, error) { + oreq := convert.PostStartContainerRequest(req) + orpl, err := p.p.StateChange(ctx, oreq) + if err != nil { + return nil, err + } + + return convert.PostStartContainerResponse(orpl), nil +} + +func (p *v1alpha1Plugin) UpdateContainer(ctx context.Context, req *api.UpdateContainerRequest) (*api.UpdateContainerResponse, error) { + oreq := convert.UpdateContainerRequest(req) + orpl, err := p.p.UpdateContainer(ctx, oreq) + if err != nil { + return nil, err + } + + return convert.UpdateContainerResponse(orpl), nil +} + +func (p *v1alpha1Plugin) PostUpdateContainer(ctx context.Context, req *api.PostUpdateContainerRequest) (*api.PostUpdateContainerResponse, error) { + oreq := convert.PostUpdateContainerRequest(req) + orpl, err := p.p.StateChange(ctx, oreq) + if err != nil { + return nil, err + } + + return convert.PostUpdateContainerResponse(orpl), nil +} + +func (p *v1alpha1Plugin) StopContainer(ctx context.Context, req *api.StopContainerRequest) (*api.StopContainerResponse, error) { + oreq := convert.StopContainerRequest(req) + orpl, err := p.p.StopContainer(ctx, oreq) + if err != nil { + return nil, err + } + + return convert.StopContainerResponse(orpl), nil +} + +func (p *v1alpha1Plugin) RemoveContainer(ctx context.Context, req *api.RemoveContainerRequest) (*api.RemoveContainerResponse, error) { + oreq := convert.RemoveContainerRequest(req) + orpl, err := p.p.StateChange(ctx, oreq) + if err != nil { + return nil, err + } + + return convert.RemoveContainerResponse(orpl), nil +} + +func (p *v1alpha1Plugin) ValidateContainerAdjustment(ctx context.Context, req *api.ValidateContainerAdjustmentRequest) (*api.ValidateContainerAdjustmentResponse, error) { + oreq := convert.ValidateContainerAdjustmentRequest(req) + orpl, err := p.p.ValidateContainerAdjustment(ctx, oreq) + if err != nil { + return nil, err + } + + return convert.ValidateContainerAdjustmentResponse(orpl), nil +} diff --git a/pkg/api/convert/conversion_test.go b/pkg/api/convert/conversion_test.go new file mode 100644 index 00000000..65bb2b54 --- /dev/null +++ b/pkg/api/convert/conversion_test.go @@ -0,0 +1,552 @@ +/* + 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 convert_test + +import ( + "fmt" + + "github.com/containerd/nri/pkg/api/convert" + v1alpha1 "github.com/containerd/nri/pkg/api/v1alpha1" + + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/testing/protocmp" + + "testing" + + faker "github.com/brianvoe/gofakeit/v7" + "github.com/stretchr/testify/require" + + yaml "gopkg.in/yaml.v3" +) + +// +// Notes: +// In lack of a better idea, we use gofakeit to generate pseudo-random +// messages for conversion testing. The idea is to generate a message +// in one version, convert it to the other version and back, and then +// compare the result with the original message. If they are identical, +// the conversion is likely correct. Obviously this is not a 100% proof +// but should be good enough at least for a start. +// + +func TestRegisterPluginConversion(t *testing.T) { + t.Run("request", func(t *testing.T) { + msg := &v1alpha1.RegisterPluginRequest{} + faker.Struct(msg) + chk := convert.RegisterPluginRequestToV1alpha1( + convert.RegisterPluginRequest(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) + + t.Run("response", func(t *testing.T) { + msg := &v1alpha1.Empty{} + faker.Struct(msg) + chk := convert.RegisterPluginResponse( + convert.RegisterPluginResponseToV1beta1(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) +} + +func TestUpdateContainersConversion(t *testing.T) { + t.Run("request", func(t *testing.T) { + msg := &v1alpha1.UpdateContainersRequest{} + faker.Struct(msg) + chk := convert.UpdateContainersRequestToV1alpha1( + convert.UpdateContainersRequest(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) + + t.Run("response", func(t *testing.T) { + msg := &v1alpha1.UpdateContainersResponse{} + faker.Struct(msg) + chk := convert.UpdateContainersResponse( + convert.UpdateContainersResponseToV1beta1(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) +} + +func TestConfigureConversion(t *testing.T) { + t.Run("request", func(t *testing.T) { + msg := &v1alpha1.ConfigureRequest{} + faker.Struct(msg) + chk := convert.ConfigureRequest( + convert.ConfigureRequestToV1beta1(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) + + t.Run("response", func(t *testing.T) { + msg := &v1alpha1.ConfigureResponse{} + faker.Struct(msg) + chk := convert.ConfigureResponseToV1alpha1( + convert.ConfigureResponse(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) + +} + +func TestSynchronizeConversion(t *testing.T) { + t.Run("request", func(t *testing.T) { + msg := &v1alpha1.SynchronizeRequest{} + faker.Struct(msg) + chk := convert.SynchronizeRequest( + convert.SynchronizeRequestToV1beta1(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) + + t.Run("response", func(t *testing.T) { + msg := &v1alpha1.SynchronizeResponse{} + faker.Struct(msg) + chk := convert.SynchronizeResponseToV1alpha1( + convert.SynchronizeResponse(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) +} + +func TestRunPodSandboxConversion(t *testing.T) { + t.Run("request", func(t *testing.T) { + msg := &v1alpha1.RunPodSandboxRequest{} + faker.Struct(msg) + msg.Event = v1alpha1.Event_RUN_POD_SANDBOX + msg.Container = nil + chk := convert.RunPodSandboxRequest( + convert.RunPodSandboxRequestToV1beta1(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) + + t.Run("response", func(t *testing.T) { + msg := &v1alpha1.Empty{} + faker.Struct(msg) + chk := convert.RunPodSandboxResponseToV1alpha1( + convert.RunPodSandboxResponse(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) +} + +func TestUpdatePodSandboxRequestConversion(t *testing.T) { + t.Run("request", func(t *testing.T) { + msg := &v1alpha1.UpdatePodSandboxRequest{} + chk := convert.UpdatePodSandboxRequest( + convert.UpdatePodSandboxRequestToV1beta1(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) + + t.Run("response", func(t *testing.T) { + msg := &v1alpha1.UpdatePodSandboxResponse{} + faker.Struct(msg) + chk := convert.UpdatePodSandboxResponseToV1alpha1( + convert.UpdatePodSandboxResponse(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) +} + +func TestPostUpdatePodSandboxConversion(t *testing.T) { + t.Run("request", func(t *testing.T) { + msg := &v1alpha1.PostUpdatePodSandboxRequest{} + faker.Struct(msg) + msg.Event = v1alpha1.Event_POST_UPDATE_POD_SANDBOX + msg.Container = nil + chk := convert.PostUpdatePodSandboxRequest( + convert.PostUpdatePodSandboxRequestToV1beta1(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) + + t.Run("response", func(t *testing.T) { + msg := &v1alpha1.Empty{} + faker.Struct(msg) + chk := convert.PostUpdatePodSandboxResponseToV1alpha1( + convert.PostUpdatePodSandboxResponse(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) +} + +func TestStopPodSandboxConversion(t *testing.T) { + t.Run("request", func(t *testing.T) { + msg := &v1alpha1.StopPodSandboxRequest{} + faker.Struct(msg) + msg.Event = v1alpha1.Event_STOP_POD_SANDBOX + msg.Container = nil + chk := convert.StopPodSandboxRequest( + convert.StopPodSandboxRequestToV1beta1(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) + + t.Run("response", func(t *testing.T) { + msg := &v1alpha1.Empty{} + faker.Struct(msg) + chk := convert.StopPodSandboxResponseToV1alpha1( + convert.StopPodSandboxResponse(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) +} + +func TestRemovePodSandboxConversion(t *testing.T) { + t.Run("request", func(t *testing.T) { + msg := &v1alpha1.RemovePodSandboxRequest{} + faker.Struct(msg) + msg.Event = v1alpha1.Event_REMOVE_POD_SANDBOX + msg.Container = nil + chk := convert.RemovePodSandboxRequest( + convert.RemovePodSandboxRequestToV1beta1(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) + + t.Run("response", func(t *testing.T) { + msg := &v1alpha1.Empty{} + faker.Struct(msg) + chk := convert.RemovePodSandboxResponseToV1alpha1( + convert.RemovePodSandboxResponse(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) +} + +func TestCreateContainerConversion(t *testing.T) { + t.Run("request", func(t *testing.T) { + msg := &v1alpha1.CreateContainerRequest{} + chk := convert.CreateContainerRequest( + convert.CreateContainerRequestToV1beta1(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) + + t.Run("response", func(t *testing.T) { + msg := &v1alpha1.CreateContainerResponse{} + faker.Struct(msg) + chk := convert.CreateContainerResponseToV1alpha1( + convert.CreateContainerResponse(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) +} + +func TestPostCreateContainerConversion(t *testing.T) { + t.Run("request", func(t *testing.T) { + msg := &v1alpha1.PostCreateContainerRequest{} + faker.Struct(msg) + msg.Event = v1alpha1.Event_POST_CREATE_CONTAINER + chk := convert.PostCreateContainerRequest( + convert.PostCreateContainerRequestToV1beta1(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) + + t.Run("response", func(t *testing.T) { + msg := &v1alpha1.Empty{} + chk := convert.PostCreateContainerResponseToV1alpha1( + convert.PostCreateContainerResponse(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) +} + +func TestStartContainerConversion(t *testing.T) { + t.Run("request", func(t *testing.T) { + msg := &v1alpha1.StartContainerRequest{} + faker.Struct(msg) + msg.Event = v1alpha1.Event_START_CONTAINER + chk := convert.StartContainerRequest( + convert.StartContainerRequestToV1beta1(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) + + t.Run("response", func(t *testing.T) { + msg := &v1alpha1.Empty{} + chk := convert.StartContainerResponseToV1alpha1( + convert.StartContainerResponse(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) +} + +func TestPostStartContainerConversion(t *testing.T) { + t.Run("request", func(t *testing.T) { + msg := &v1alpha1.PostStartContainerRequest{} + faker.Struct(msg) + msg.Event = v1alpha1.Event_POST_START_CONTAINER + chk := convert.PostStartContainerRequest( + convert.PostStartContainerRequestToV1beta1(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) + + t.Run("response", func(t *testing.T) { + msg := &v1alpha1.Empty{} + chk := convert.PostStartContainerResponseToV1alpha1( + convert.PostStartContainerResponse(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) +} + +func TestUpdateContainerConversion(t *testing.T) { + t.Run("request", func(t *testing.T) { + msg := &v1alpha1.UpdateContainerRequest{} + faker.Struct(msg) + chk := convert.UpdateContainerRequest( + convert.UpdateContainerRequestToV1beta1(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) + + t.Run("response", func(t *testing.T) { + msg := &v1alpha1.UpdateContainerResponse{} + faker.Struct(msg) + chk := convert.UpdateContainerResponseToV1alpha1( + convert.UpdateContainerResponse(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) +} + +func TestPostUpdateContainerConversion(t *testing.T) { + t.Run("request", func(t *testing.T) { + msg := &v1alpha1.PostUpdateContainerRequest{} + faker.Struct(msg) + msg.Event = v1alpha1.Event_POST_UPDATE_CONTAINER + chk := convert.PostUpdateContainerRequest( + convert.PostUpdateContainerRequestToV1beta1(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) + + t.Run("response", func(t *testing.T) { + msg := &v1alpha1.Empty{} + chk := convert.PostUpdateContainerResponseToV1alpha1( + convert.PostUpdateContainerResponse(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) +} + +func TestStopContainerConversion(t *testing.T) { + t.Run("request", func(t *testing.T) { + msg := &v1alpha1.StopContainerRequest{} + faker.Struct(msg) + chk := convert.StopContainerRequest( + convert.StopContainerRequestToV1beta1(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) + + t.Run("response", func(t *testing.T) { + msg := &v1alpha1.StopContainerResponse{} + faker.Struct(msg) + chk := convert.StopContainerResponseToV1alpha1( + convert.StopContainerResponse(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) +} + +func TestRemoveContainerConversion(t *testing.T) { + t.Run("request", func(t *testing.T) { + msg := &v1alpha1.RemoveContainerRequest{} + faker.Struct(msg) + msg.Event = v1alpha1.Event_REMOVE_CONTAINER + chk := convert.RemoveContainerRequest( + convert.RemoveContainerRequestToV1beta1(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) + + t.Run("response", func(t *testing.T) { + msg := &v1alpha1.Empty{} + chk := convert.RemoveContainerResponseToV1alpha1( + convert.RemoveContainerResponse(msg), + ) + + require.True(t, + protoEqual(chk, msg), + protoUnexpectedDiff("converted", "original", chk, msg), + ) + }) +} + +func protoDiff(a, b proto.Message) string { + return cmp.Diff(a, b, protocmp.Transform()) +} + +func protoEqual(a, b proto.Message) bool { + return cmp.Equal(a, b, cmpopts.EquateEmpty(), protocmp.Transform()) +} + +func protoUnexpectedDiff(aKind, bKind string, a, b proto.Message) string { + aData, _ := yaml.Marshal(a) + bData, _ := yaml.Marshal(b) + return fmt.Sprintf("diff:\n%s\n", protoDiff(a, b)) + + fmt.Sprintf("%s message:\n%s\n", aKind, aData) + + fmt.Sprintf("%s message:\n%s\n", bKind, bData) +} + +func init() { + // Make sure gofakeit properly generates test conversion data for + // our deeply nested structs, slices of pointers to structs, etc. + // The default is 10 which is not enough for some of our data types. + faker.RecursiveDepth = 25 +} diff --git a/pkg/api/convert/messages.go b/pkg/api/convert/messages.go new file mode 100644 index 00000000..a45c08a7 --- /dev/null +++ b/pkg/api/convert/messages.go @@ -0,0 +1,863 @@ +/* + 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 convert + +import ( + v1alpha1 "github.com/containerd/nri/pkg/api/v1alpha1" + v1beta1 "github.com/containerd/nri/pkg/api/v1beta1" +) + +// This package provides conversion functions for v1alpha1 and v1beta1 +// revisions of API data types and messages. We use them on the runtime +// side in NRI to provide protocol translation for plugins which talk +// the older revision of the API. +// +// Notes: +// Some of the conversion functions are unused in protocol translation +// itself. These are the conversion for plugin initiated requests from +// v1beta1 to v1alpha1 and responses to them from v1alpha1 to v1beta1, +// and runtime initiated requests from v1alpha1 to v1beta1 and responses +// to them from v1beta1 to v1alpha1. These functions are only used in +// tests to verify the idempotency of message conversion, from v1alpha1 +// to v1beta1 and back. +// +// This is visible in the chosen naming convention as well. Request and +// response conversion functions used in translation omit the revision +// suffix for brevity. The rest have a revision suffix. + +// RegisterPluginRequest converts the request between v1alpha1 and v1beta1. +func RegisterPluginRequest(v1a1 *v1alpha1.RegisterPluginRequest) *v1beta1.RegisterPluginRequest { + if v1a1 == nil { + return nil + } + + return &v1beta1.RegisterPluginRequest{ + PluginName: v1a1.PluginName, + PluginIdx: v1a1.PluginIdx, + } +} + +// RegisterPluginRequestToV1alpha1 converts the request between v1alpha1 and v1beta1. +func RegisterPluginRequestToV1alpha1(v1b1 *v1beta1.RegisterPluginRequest) *v1alpha1.RegisterPluginRequest { + if v1b1 == nil { + return nil + } + + return &v1alpha1.RegisterPluginRequest{ + PluginName: v1b1.PluginName, + PluginIdx: v1b1.PluginIdx, + } +} + +// RegisterPluginResponse converts the reply between v1alpha1 and v1beta1. +func RegisterPluginResponse(v1b1 *v1beta1.RegisterPluginResponse) *v1alpha1.Empty { + if v1b1 == nil { + return nil + } + + return &v1alpha1.Empty{} +} + +// RegisterPluginResponseToV1beta1 converts the reply between v1alpha1 and v1beta1. +func RegisterPluginResponseToV1beta1(v1a1 *v1alpha1.Empty) *v1beta1.RegisterPluginResponse { + if v1a1 == nil { + return nil + } + + return &v1beta1.RegisterPluginResponse{} +} + +// UpdateContainersRequest converts the request between v1alpha1 and v1beta1. +func UpdateContainersRequest(v1a1 *v1alpha1.UpdateContainersRequest) *v1beta1.UpdateContainersRequest { + if v1a1 == nil { + return nil + } + + return &v1beta1.UpdateContainersRequest{ + Update: ContainerUpdateSliceToV1beta1(v1a1.Update), + Evict: ContainerEvictionSliceToV1beta1(v1a1.Evict), + } +} + +// UpdateContainersRequestToV1alpha1 converts the request between v1alpha1 and v1beta1. +func UpdateContainersRequestToV1alpha1(v1b1 *v1beta1.UpdateContainersRequest) *v1alpha1.UpdateContainersRequest { + if v1b1 == nil { + return nil + } + + return &v1alpha1.UpdateContainersRequest{ + Update: ContainerUpdateSliceToV1alpha1(v1b1.Update), + Evict: ContainerEvictionSliceToV1alpha1(v1b1.Evict), + } +} + +// UpdateContainersResponse converts the reply between v1alpha1 and v1beta1. +func UpdateContainersResponse(v1b1 *v1beta1.UpdateContainersResponse) *v1alpha1.UpdateContainersResponse { + if v1b1 == nil { + return nil + } + + return &v1alpha1.UpdateContainersResponse{ + Failed: ContainerUpdateSliceToV1alpha1(v1b1.Failed), + } +} + +// UpdateContainersResponseToV1beta1 converts the reply between v1alpha1 and v1beta1. +func UpdateContainersResponseToV1beta1(v1a1 *v1alpha1.UpdateContainersResponse) *v1beta1.UpdateContainersResponse { + if v1a1 == nil { + return nil + } + + return &v1beta1.UpdateContainersResponse{ + Failed: ContainerUpdateSliceToV1beta1(v1a1.Failed), + } +} + +// ConfigureRequest converts the request between v1alpha1 and v1beta1. +func ConfigureRequest(v1b1 *v1beta1.ConfigureRequest) *v1alpha1.ConfigureRequest { + if v1b1 == nil { + return nil + } + + return &v1alpha1.ConfigureRequest{ + Config: v1b1.Config, + RuntimeName: v1b1.RuntimeName, + RuntimeVersion: v1b1.RuntimeVersion, + RegistrationTimeout: v1b1.RegistrationTimeout, + RequestTimeout: v1b1.RequestTimeout, + } +} + +// ConfigureRequestToV1beta1 converts the request between v1alpha1 and v1beta1. +func ConfigureRequestToV1beta1(v1a1 *v1alpha1.ConfigureRequest) *v1beta1.ConfigureRequest { + if v1a1 == nil { + return nil + } + + return &v1beta1.ConfigureRequest{ + Config: v1a1.Config, + RuntimeName: v1a1.RuntimeName, + RuntimeVersion: v1a1.RuntimeVersion, + RegistrationTimeout: v1a1.RegistrationTimeout, + RequestTimeout: v1a1.RequestTimeout, + } +} + +// ConfigureResponse converts the reply between v1alpha1 and v1beta1. +func ConfigureResponse(v1a1 *v1alpha1.ConfigureResponse) *v1beta1.ConfigureResponse { + if v1a1 == nil { + return nil + } + + return &v1beta1.ConfigureResponse{ + Events: v1a1.Events, + } +} + +// ConfigureResponseToV1alpha1 converts the reply between v1alpha1 and v1beta1. +func ConfigureResponseToV1alpha1(v1b1 *v1beta1.ConfigureResponse) *v1alpha1.ConfigureResponse { + if v1b1 == nil { + return nil + } + + return &v1alpha1.ConfigureResponse{ + Events: v1b1.Events, + } +} + +// SynchronizeRequest converts the request between v1alpha1 and v1beta1. +func SynchronizeRequest(v1b1 *v1beta1.SynchronizeRequest) *v1alpha1.SynchronizeRequest { + if v1b1 == nil { + return nil + } + + return &v1alpha1.SynchronizeRequest{ + Pods: PodSandboxSliceToV1alpha1(v1b1.Pods), + Containers: ContainerSliceToV1alpha1(v1b1.Containers), + More: v1b1.More, + } +} + +// SynchronizeRequestToV1beta1 converts the request between v1alpha1 and v1beta1. +func SynchronizeRequestToV1beta1(v1a1 *v1alpha1.SynchronizeRequest) *v1beta1.SynchronizeRequest { + if v1a1 == nil { + return nil + } + + return &v1beta1.SynchronizeRequest{ + Pods: PodSandboxSliceToV1beta1(v1a1.Pods), + Containers: ContainerSliceToV1beta1(v1a1.Containers), + More: v1a1.More, + } +} + +// SynchronizeResponse converts the reply between v1alpha1 and v1beta1. +func SynchronizeResponse(v1a1 *v1alpha1.SynchronizeResponse) *v1beta1.SynchronizeResponse { + if v1a1 == nil { + return nil + } + + return &v1beta1.SynchronizeResponse{ + Update: ContainerUpdateSliceToV1beta1(v1a1.Update), + More: v1a1.More, + } +} + +// SynchronizeResponseToV1alpha1 converts the reply between v1alpha1 and v1beta1. +func SynchronizeResponseToV1alpha1(v1b1 *v1beta1.SynchronizeResponse) *v1alpha1.SynchronizeResponse { + if v1b1 == nil { + return nil + } + + return &v1alpha1.SynchronizeResponse{ + Update: ContainerUpdateSliceToV1alpha1(v1b1.Update), + More: v1b1.More, + } +} + +// RunPodSandboxRequest converts the request between v1alpha1 and v1beta1. +func RunPodSandboxRequest(v1b1 *v1beta1.RunPodSandboxRequest) *v1alpha1.StateChangeEvent { + if v1b1 == nil { + return nil + } + + v1a1 := &v1alpha1.StateChangeEvent{ + Event: v1alpha1.Event_RUN_POD_SANDBOX, + Pod: PodSandboxToV1alpha1(v1b1.Pod), + } + + return v1a1 +} + +// RunPodSandboxRequestToV1beta1 converts the request between v1alpha1 and v1beta1. +func RunPodSandboxRequestToV1beta1(v1a1 *v1alpha1.StateChangeEvent) *v1beta1.RunPodSandboxRequest { + if v1a1 == nil { + return nil + } + + v1b1 := &v1beta1.RunPodSandboxRequest{ + Pod: PodSandboxToV1beta1(v1a1.Pod), + } + + return v1b1 +} + +// RunPodSandboxResponse converts the reply between v1alpha1 and v1beta1. +func RunPodSandboxResponse(v1a1 *v1alpha1.Empty) *v1beta1.RunPodSandboxResponse { + if v1a1 == nil { + return nil + } + + return &v1beta1.RunPodSandboxResponse{} +} + +// RunPodSandboxResponseToV1alpha1 converts the reply between v1alpha1 and v1beta1. +func RunPodSandboxResponseToV1alpha1(v1b1 *v1beta1.RunPodSandboxResponse) *v1alpha1.Empty { + if v1b1 == nil { + return nil + } + + return &v1alpha1.Empty{} +} + +// UpdatePodSandboxRequest converts the request between v1alpha1 and v1beta1. +func UpdatePodSandboxRequest(v1b1 *v1beta1.UpdatePodSandboxRequest) *v1alpha1.UpdatePodSandboxRequest { + if v1b1 == nil { + return nil + } + + v1a1 := &v1alpha1.UpdatePodSandboxRequest{ + Pod: PodSandboxToV1alpha1(v1b1.Pod), + OverheadLinuxResources: LinuxResourcesToV1alpha1(v1b1.OverheadLinuxResources), + LinuxResources: LinuxResourcesToV1alpha1(v1b1.LinuxResources), + } + + return v1a1 +} + +// UpdatePodSandboxRequestToV1beta1 converts the request between v1alpha1 and v1beta1. +func UpdatePodSandboxRequestToV1beta1(v1a1 *v1alpha1.UpdatePodSandboxRequest) *v1beta1.UpdatePodSandboxRequest { + if v1a1 == nil { + return nil + } + + v1b1 := &v1beta1.UpdatePodSandboxRequest{ + Pod: PodSandboxToV1beta1(v1a1.Pod), + OverheadLinuxResources: LinuxResourcesToV1beta1(v1a1.OverheadLinuxResources), + LinuxResources: LinuxResourcesToV1beta1(v1a1.LinuxResources), + } + + return v1b1 +} + +// UpdatePodSandboxResponse converts the reply between v1alpha1 and v1beta1. +func UpdatePodSandboxResponse(v1a1 *v1alpha1.UpdatePodSandboxResponse) *v1beta1.UpdatePodSandboxResponse { + if v1a1 == nil { + return nil + } + + return &v1beta1.UpdatePodSandboxResponse{} +} + +// UpdatePodSandboxResponseToV1alpha1 converts the reply between v1alpha1 and v1beta1. +func UpdatePodSandboxResponseToV1alpha1(v1b1 *v1beta1.UpdatePodSandboxResponse) *v1alpha1.UpdatePodSandboxResponse { + if v1b1 == nil { + return nil + } + + return &v1alpha1.UpdatePodSandboxResponse{} +} + +// PostUpdatePodSandboxRequest converts the request between v1alpha1 and v1beta1. +func PostUpdatePodSandboxRequest(v1b1 *v1beta1.PostUpdatePodSandboxRequest) *v1alpha1.StateChangeEvent { + if v1b1 == nil { + return nil + } + + return &v1alpha1.StateChangeEvent{ + Event: v1alpha1.Event_POST_UPDATE_POD_SANDBOX, + Pod: PodSandboxToV1alpha1(v1b1.Pod), + } +} + +// PostUpdatePodSandboxRequestToV1beta1 converts the request between v1alpha1 and v1beta1. +func PostUpdatePodSandboxRequestToV1beta1(v1a1 *v1alpha1.StateChangeEvent) *v1beta1.PostUpdatePodSandboxRequest { + if v1a1 == nil { + return nil + } + + return &v1beta1.PostUpdatePodSandboxRequest{ + Pod: PodSandboxToV1beta1(v1a1.Pod), + } +} + +// PostUpdatePodSandboxResponse converts the reply between v1alpha1 and v1beta1. +func PostUpdatePodSandboxResponse(v1a1 *v1alpha1.Empty) *v1beta1.PostUpdatePodSandboxResponse { + if v1a1 == nil { + return nil + } + + return &v1beta1.PostUpdatePodSandboxResponse{} +} + +// PostUpdatePodSandboxResponseToV1alpha1 converts the reply between v1alpha1 and v1beta1. +func PostUpdatePodSandboxResponseToV1alpha1(v1b1 *v1beta1.PostUpdatePodSandboxResponse) *v1alpha1.Empty { + if v1b1 == nil { + return nil + } + + return &v1alpha1.Empty{} +} + +// StopPodSandboxRequest converts the request between v1alpha1 and v1beta1. +func StopPodSandboxRequest(v1b1 *v1beta1.StopPodSandboxRequest) *v1alpha1.StateChangeEvent { + if v1b1 == nil { + return nil + } + + return &v1alpha1.StateChangeEvent{ + Event: v1alpha1.Event_STOP_POD_SANDBOX, + Pod: PodSandboxToV1alpha1(v1b1.Pod), + } +} + +// StopPodSandboxRequestToV1beta1 converts the request between v1alpha1 and v1beta1. +func StopPodSandboxRequestToV1beta1(v1a1 *v1alpha1.StateChangeEvent) *v1beta1.StopPodSandboxRequest { + if v1a1 == nil { + return nil + } + + return &v1beta1.StopPodSandboxRequest{ + Pod: PodSandboxToV1beta1(v1a1.Pod), + } +} + +// StopPodSandboxResponse converts the reply between v1alpha1 and v1beta1. +func StopPodSandboxResponse(v1a1 *v1alpha1.Empty) *v1beta1.StopPodSandboxResponse { + if v1a1 == nil { + return nil + } + + return &v1beta1.StopPodSandboxResponse{} +} + +// StopPodSandboxResponseToV1alpha1 converts the reply between v1alpha1 and v1beta1. +func StopPodSandboxResponseToV1alpha1(v1b1 *v1beta1.StopPodSandboxResponse) *v1alpha1.Empty { + if v1b1 == nil { + return nil + } + + return &v1alpha1.Empty{} +} + +// RemovePodSandboxRequest converts the request between v1alpha1 and v1beta1. +func RemovePodSandboxRequest(v1b1 *v1beta1.RemovePodSandboxRequest) *v1alpha1.StateChangeEvent { + if v1b1 == nil { + return nil + } + + return &v1alpha1.StateChangeEvent{ + Event: v1alpha1.Event_REMOVE_POD_SANDBOX, + Pod: PodSandboxToV1alpha1(v1b1.Pod), + } +} + +// RemovePodSandboxRequestToV1beta1 converts the request between v1alpha1 and v1beta1. +func RemovePodSandboxRequestToV1beta1(v1a1 *v1alpha1.StateChangeEvent) *v1beta1.RemovePodSandboxRequest { + if v1a1 == nil { + return nil + } + + return &v1beta1.RemovePodSandboxRequest{ + Pod: PodSandboxToV1beta1(v1a1.Pod), + } +} + +// RemovePodSandboxResponse converts the reply between v1alpha1 and v1beta1. +func RemovePodSandboxResponse(v1a1 *v1alpha1.Empty) *v1beta1.RemovePodSandboxResponse { + if v1a1 == nil { + return nil + } + + return &v1beta1.RemovePodSandboxResponse{} +} + +// RemovePodSandboxResponseToV1alpha1 converts the reply between v1alpha1 and v1beta1. +func RemovePodSandboxResponseToV1alpha1(v1b1 *v1beta1.RemovePodSandboxResponse) *v1alpha1.Empty { + if v1b1 == nil { + return nil + } + + return &v1alpha1.Empty{} +} + +// CreateContainerRequest converts the request between v1alpha1 and v1beta1. +func CreateContainerRequest(v1b1 *v1beta1.CreateContainerRequest) *v1alpha1.CreateContainerRequest { + if v1b1 == nil { + return nil + } + + return &v1alpha1.CreateContainerRequest{ + Pod: PodSandboxToV1alpha1(v1b1.Pod), + Container: ContainerToV1alpha1(v1b1.Container), + } +} + +// CreateContainerRequestToV1beta1 converts the request between v1alpha1 and v1beta1. +func CreateContainerRequestToV1beta1(v1a1 *v1alpha1.CreateContainerRequest) *v1beta1.CreateContainerRequest { + if v1a1 == nil { + return nil + } + + return &v1beta1.CreateContainerRequest{ + Pod: PodSandboxToV1beta1(v1a1.Pod), + Container: ContainerToV1beta1(v1a1.Container), + } +} + +// CreateContainerResponse converts the reply between v1alpha1 and v1beta1. +func CreateContainerResponse(v1a1 *v1alpha1.CreateContainerResponse) *v1beta1.CreateContainerResponse { + if v1a1 == nil { + return nil + } + + return &v1beta1.CreateContainerResponse{ + Adjust: ContainerAdjustmentToV1beta1(v1a1.Adjust), + Update: ContainerUpdateSliceToV1beta1(v1a1.Update), + Evict: ContainerEvictionSliceToV1beta1(v1a1.Evict), + } +} + +// CreateContainerResponseToV1alpha1 converts the reply between v1alpha1 and v1beta1. +func CreateContainerResponseToV1alpha1(v1b1 *v1beta1.CreateContainerResponse) *v1alpha1.CreateContainerResponse { + if v1b1 == nil { + return nil + } + + return &v1alpha1.CreateContainerResponse{ + Adjust: ContainerAdjustmentToV1alpha1(v1b1.Adjust), + Update: ContainerUpdateSliceToV1alpha1(v1b1.Update), + Evict: ContainerEvictionSliceToV1alpha1(v1b1.Evict), + } +} + +// PostCreateContainerRequest converts the request between v1alpha1 and v1beta1. +func PostCreateContainerRequest(v1b1 *v1beta1.PostCreateContainerRequest) *v1alpha1.StateChangeEvent { + if v1b1 == nil { + return nil + } + + return &v1alpha1.StateChangeEvent{ + Event: v1alpha1.Event_POST_CREATE_CONTAINER, + Pod: PodSandboxToV1alpha1(v1b1.Pod), + Container: ContainerToV1alpha1(v1b1.Container), + } +} + +// PostCreateContainerRequestToV1beta1 converts the request between v1alpha1 and v1beta1. +func PostCreateContainerRequestToV1beta1(v1a1 *v1alpha1.StateChangeEvent) *v1beta1.PostCreateContainerRequest { + if v1a1 == nil { + return nil + } + + return &v1beta1.PostCreateContainerRequest{ + Pod: PodSandboxToV1beta1(v1a1.Pod), + Container: ContainerToV1beta1(v1a1.Container), + } +} + +// PostCreateContainerResponse converts the reply between v1alpha1 and v1beta1. +func PostCreateContainerResponse(v1a1 *v1alpha1.Empty) *v1beta1.PostCreateContainerResponse { + if v1a1 == nil { + return nil + } + + return &v1beta1.PostCreateContainerResponse{} +} + +// PostCreateContainerResponseToV1alpha1 converts the reply between v1alpha1 and v1beta1. +func PostCreateContainerResponseToV1alpha1(v1b1 *v1beta1.PostCreateContainerResponse) *v1alpha1.Empty { + if v1b1 == nil { + return nil + } + + return &v1alpha1.Empty{} +} + +// StartContainerRequest converts the request between v1alpha1 and v1beta1. +func StartContainerRequest(v1b1 *v1beta1.StartContainerRequest) *v1alpha1.StateChangeEvent { + if v1b1 == nil { + return nil + } + + return &v1alpha1.StateChangeEvent{ + Event: v1alpha1.Event_START_CONTAINER, + Pod: PodSandboxToV1alpha1(v1b1.Pod), + Container: ContainerToV1alpha1(v1b1.Container), + } +} + +// StartContainerRequestToV1beta1 converts the request between v1alpha1 and v1beta1. +func StartContainerRequestToV1beta1(v1a1 *v1alpha1.StateChangeEvent) *v1beta1.StartContainerRequest { + if v1a1 == nil { + return nil + } + + return &v1beta1.StartContainerRequest{ + Pod: PodSandboxToV1beta1(v1a1.Pod), + Container: ContainerToV1beta1(v1a1.Container), + } +} + +// StartContainerResponse converts the reply between v1alpha1 and v1beta1. +func StartContainerResponse(v1a1 *v1alpha1.Empty) *v1beta1.StartContainerResponse { + if v1a1 == nil { + return nil + } + + return &v1beta1.StartContainerResponse{} +} + +// StartContainerResponseToV1alpha1 converts the reply between v1alpha1 and v1beta1. +func StartContainerResponseToV1alpha1(v1b1 *v1beta1.StartContainerResponse) *v1alpha1.Empty { + if v1b1 == nil { + return nil + } + + return &v1alpha1.Empty{} +} + +// PostStartContainerRequest converts the request between v1alpha1 and v1beta1. +func PostStartContainerRequest(v1b1 *v1beta1.PostStartContainerRequest) *v1alpha1.StateChangeEvent { + if v1b1 == nil { + return nil + } + + return &v1alpha1.StateChangeEvent{ + Event: v1alpha1.Event_POST_START_CONTAINER, + Pod: PodSandboxToV1alpha1(v1b1.Pod), + Container: ContainerToV1alpha1(v1b1.Container), + } +} + +// PostStartContainerRequestToV1beta1 converts the request between v1alpha1 and v1beta1. +func PostStartContainerRequestToV1beta1(v1a1 *v1alpha1.StateChangeEvent) *v1beta1.PostStartContainerRequest { + if v1a1 == nil { + return nil + } + + return &v1beta1.PostStartContainerRequest{ + Pod: PodSandboxToV1beta1(v1a1.Pod), + Container: ContainerToV1beta1(v1a1.Container), + } +} + +// PostStartContainerResponse converts the reply between v1alpha1 and v1beta1. +func PostStartContainerResponse(v1a1 *v1alpha1.Empty) *v1beta1.PostStartContainerResponse { + if v1a1 == nil { + return nil + } + + return &v1beta1.PostStartContainerResponse{} +} + +// PostStartContainerResponseToV1alpha1 converts the reply between v1alpha1 and v1beta1. +func PostStartContainerResponseToV1alpha1(v1b1 *v1beta1.PostStartContainerResponse) *v1alpha1.Empty { + if v1b1 == nil { + return nil + } + + return &v1alpha1.Empty{} +} + +// UpdateContainerRequest converts the request between v1alpha1 and v1beta1. +func UpdateContainerRequest(v1b1 *v1beta1.UpdateContainerRequest) *v1alpha1.UpdateContainerRequest { + if v1b1 == nil { + return nil + } + + return &v1alpha1.UpdateContainerRequest{ + Pod: PodSandboxToV1alpha1(v1b1.Pod), + Container: ContainerToV1alpha1(v1b1.Container), + LinuxResources: LinuxResourcesToV1alpha1(v1b1.LinuxResources), + } +} + +// UpdateContainerRequestToV1beta1 converts the request between v1alpha1 and v1beta1. +func UpdateContainerRequestToV1beta1(v1a1 *v1alpha1.UpdateContainerRequest) *v1beta1.UpdateContainerRequest { + if v1a1 == nil { + return nil + } + + return &v1beta1.UpdateContainerRequest{ + Pod: PodSandboxToV1beta1(v1a1.Pod), + Container: ContainerToV1beta1(v1a1.Container), + LinuxResources: LinuxResourcesToV1beta1(v1a1.LinuxResources), + } +} + +// UpdateContainerResponse converts the reply between v1alpha1 and v1beta1. +func UpdateContainerResponse(v1a1 *v1alpha1.UpdateContainerResponse) *v1beta1.UpdateContainerResponse { + if v1a1 == nil { + return nil + } + + return &v1beta1.UpdateContainerResponse{ + Update: ContainerUpdateSliceToV1beta1(v1a1.Update), + Evict: ContainerEvictionSliceToV1beta1(v1a1.Evict), + } +} + +// UpdateContainerResponseToV1alpha1 converts the reply between v1alpha1 and v1beta1. +func UpdateContainerResponseToV1alpha1(v1b1 *v1beta1.UpdateContainerResponse) *v1alpha1.UpdateContainerResponse { + if v1b1 == nil { + return nil + } + + return &v1alpha1.UpdateContainerResponse{ + Update: ContainerUpdateSliceToV1alpha1(v1b1.Update), + Evict: ContainerEvictionSliceToV1alpha1(v1b1.Evict), + } +} + +// PostUpdateContainerRequest converts the request between v1alpha1 and v1beta1. +func PostUpdateContainerRequest(v1b1 *v1beta1.PostUpdateContainerRequest) *v1alpha1.StateChangeEvent { + if v1b1 == nil { + return nil + } + + return &v1alpha1.StateChangeEvent{ + Event: v1alpha1.Event_POST_UPDATE_CONTAINER, + Pod: PodSandboxToV1alpha1(v1b1.Pod), + Container: ContainerToV1alpha1(v1b1.Container), + } +} + +// PostUpdateContainerRequestToV1beta1 converts the request between v1alpha1 and v1beta1. +func PostUpdateContainerRequestToV1beta1(v1a1 *v1alpha1.StateChangeEvent) *v1beta1.PostUpdateContainerRequest { + if v1a1 == nil { + return nil + } + + return &v1beta1.PostUpdateContainerRequest{ + Pod: PodSandboxToV1beta1(v1a1.Pod), + Container: ContainerToV1beta1(v1a1.Container), + } +} + +// PostUpdateContainerResponse converts the reply between v1alpha1 and v1beta1. +func PostUpdateContainerResponse(v1a1 *v1alpha1.Empty) *v1beta1.PostUpdateContainerResponse { + if v1a1 == nil { + return nil + } + + return &v1beta1.PostUpdateContainerResponse{} +} + +// PostUpdateContainerResponseToV1alpha1 converts the reply between v1alpha1 and v1beta1. +func PostUpdateContainerResponseToV1alpha1(v1b1 *v1beta1.PostUpdateContainerResponse) *v1alpha1.Empty { + if v1b1 == nil { + return nil + } + + return &v1alpha1.Empty{} +} + +// StopContainerRequest converts the request between v1alpha1 and v1beta1. +func StopContainerRequest(v1b1 *v1beta1.StopContainerRequest) *v1alpha1.StopContainerRequest { + if v1b1 == nil { + return nil + } + + return &v1alpha1.StopContainerRequest{ + Pod: PodSandboxToV1alpha1(v1b1.Pod), + Container: ContainerToV1alpha1(v1b1.Container), + } +} + +// StopContainerRequestToV1beta1 converts the request between v1alpha1 and v1beta1. +func StopContainerRequestToV1beta1(v1a1 *v1alpha1.StopContainerRequest) *v1beta1.StopContainerRequest { + if v1a1 == nil { + return nil + } + + return &v1beta1.StopContainerRequest{ + Pod: PodSandboxToV1beta1(v1a1.Pod), + Container: ContainerToV1beta1(v1a1.Container), + } +} + +// StopContainerResponse converts the reply between v1alpha1 and v1beta1. +func StopContainerResponse(v1a1 *v1alpha1.StopContainerResponse) *v1beta1.StopContainerResponse { + if v1a1 == nil { + return nil + } + + return &v1beta1.StopContainerResponse{ + Update: ContainerUpdateSliceToV1beta1(v1a1.Update), + } +} + +// StopContainerResponseToV1alpha1 converts the reply between v1alpha1 and v1beta1. +func StopContainerResponseToV1alpha1(v1b1 *v1beta1.StopContainerResponse) *v1alpha1.StopContainerResponse { + if v1b1 == nil { + return nil + } + + return &v1alpha1.StopContainerResponse{ + Update: ContainerUpdateSliceToV1alpha1(v1b1.Update), + } +} + +// RemoveContainerRequest converts the request between v1alpha1 and v1beta1. +func RemoveContainerRequest(v1b1 *v1beta1.RemoveContainerRequest) *v1alpha1.StateChangeEvent { + if v1b1 == nil { + return nil + } + + return &v1alpha1.StateChangeEvent{ + Event: v1alpha1.Event_REMOVE_CONTAINER, + Pod: PodSandboxToV1alpha1(v1b1.Pod), + Container: ContainerToV1alpha1(v1b1.Container), + } +} + +// RemoveContainerRequestToV1beta1 converts the request between v1alpha1 and v1beta1. +func RemoveContainerRequestToV1beta1(v1a1 *v1alpha1.StateChangeEvent) *v1beta1.RemoveContainerRequest { + if v1a1 == nil { + return nil + } + + return &v1beta1.RemoveContainerRequest{ + Pod: PodSandboxToV1beta1(v1a1.Pod), + Container: ContainerToV1beta1(v1a1.Container), + } +} + +// RemoveContainerResponse converts the reply between v1alpha1 and v1beta1. +func RemoveContainerResponse(v1a1 *v1alpha1.Empty) *v1beta1.RemoveContainerResponse { + if v1a1 == nil { + return nil + } + + return &v1beta1.RemoveContainerResponse{} +} + +// RemoveContainerResponseToV1alpha1 converts the reply between v1alpha1 and v1beta1. +func RemoveContainerResponseToV1alpha1(v1b1 *v1beta1.RemoveContainerResponse) *v1alpha1.Empty { + if v1b1 == nil { + return nil + } + + return &v1alpha1.Empty{} +} + +// ValidateContainerAdjustmentRequest converts the request between v1alpha1 and v1beta1. +func ValidateContainerAdjustmentRequest(v1b1 *v1beta1.ValidateContainerAdjustmentRequest) *v1alpha1.ValidateContainerAdjustmentRequest { + if v1b1 == nil { + return nil + } + + return &v1alpha1.ValidateContainerAdjustmentRequest{ + Pod: PodSandboxToV1alpha1(v1b1.Pod), + Container: ContainerToV1alpha1(v1b1.Container), + Adjust: ContainerAdjustmentToV1alpha1(v1b1.Adjust), + Update: ContainerUpdateSliceToV1alpha1(v1b1.Update), + Owners: OwningPluginsToV1alpha1(v1b1.Owners), + Plugins: PluginInstanceSliceToV1alpha1(v1b1.Plugins), + } +} + +// ValidateContainerAdjustmentRequestToV1beta1 converts the request between v1alpha1 and v1beta1. +func ValidateContainerAdjustmentRequestToV1beta1(v1a1 *v1alpha1.ValidateContainerAdjustmentRequest) *v1beta1.ValidateContainerAdjustmentRequest { + if v1a1 == nil { + return nil + } + + return &v1beta1.ValidateContainerAdjustmentRequest{ + Pod: PodSandboxToV1beta1(v1a1.Pod), + Container: ContainerToV1beta1(v1a1.Container), + Adjust: ContainerAdjustmentToV1beta1(v1a1.Adjust), + Update: ContainerUpdateSliceToV1beta1(v1a1.Update), + Owners: OwningPluginsToV1beta1(v1a1.Owners), + Plugins: PluginInstanceSliceToV1beta1(v1a1.Plugins), + } +} + +// ValidateContainerAdjustmentResponse converts the reply between v1alpha1 and v1beta1. +func ValidateContainerAdjustmentResponse(v1a1 *v1alpha1.ValidateContainerAdjustmentResponse) *v1beta1.ValidateContainerAdjustmentResponse { + if v1a1 == nil { + return nil + } + + return &v1beta1.ValidateContainerAdjustmentResponse{ + Reject: v1a1.Reject, + Reason: v1a1.Reason, + } +} + +// ValidateContainerAdjustmentResponseToV1alpha1 converts the reply between v1alpha1 and v1beta1. +func ValidateContainerAdjustmentResponseToV1alpha1(v1b1 *v1beta1.ValidateContainerAdjustmentResponse) *v1alpha1.ValidateContainerAdjustmentResponse { + if v1b1 == nil { + return nil + } + + return &v1alpha1.ValidateContainerAdjustmentResponse{ + Reject: v1b1.Reject, + Reason: v1b1.Reason, + } +} diff --git a/pkg/api/convert/types.go b/pkg/api/convert/types.go new file mode 100644 index 00000000..d5775557 --- /dev/null +++ b/pkg/api/convert/types.go @@ -0,0 +1,1516 @@ +/* + 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 convert + +import ( + v1alpha1 "github.com/containerd/nri/pkg/api/v1alpha1" + v1beta1 "github.com/containerd/nri/pkg/api/v1beta1" +) + +// PodSandboxToV1alpha1 converts the type between v1alpha1 and v1beta1. +func PodSandboxToV1alpha1(v1b1 *v1beta1.PodSandbox) *v1alpha1.PodSandbox { + if v1b1 == nil { + return nil + } + + v1a1 := &v1alpha1.PodSandbox{ + Id: v1b1.Id, + Name: v1b1.Name, + Uid: v1b1.Uid, + Namespace: v1b1.Namespace, + Labels: v1b1.Labels, + Annotations: v1b1.Annotations, + RuntimeHandler: v1b1.RuntimeHandler, + Linux: LinuxPodSandboxToV1alpha1(v1b1.Linux), + Pid: v1b1.Pid, + Ips: v1b1.Ips, + } + + return v1a1 +} + +// PodSandboxToV1beta1 converts the type between v1alpha1 and v1beta1. +func PodSandboxToV1beta1(v1a1 *v1alpha1.PodSandbox) *v1beta1.PodSandbox { + if v1a1 == nil { + return nil + } + + v1b1 := &v1beta1.PodSandbox{ + Id: v1a1.Id, + Name: v1a1.Name, + Uid: v1a1.Uid, + Namespace: v1a1.Namespace, + Labels: v1a1.Labels, + Annotations: v1a1.Annotations, + RuntimeHandler: v1a1.RuntimeHandler, + Linux: LinuxPodSandboxToV1beta1(v1a1.Linux), + Pid: v1a1.Pid, + Ips: v1a1.Ips, + } + + return v1b1 +} + +// PodSandboxSliceToV1alpha1 converts the types between v1alpha1 and v1beta1. +func PodSandboxSliceToV1alpha1(v1b1 []*v1beta1.PodSandbox) []*v1alpha1.PodSandbox { + if v1b1 == nil { + return nil + } + + v1a1 := make([]*v1alpha1.PodSandbox, 0, len(v1b1)) + for _, p := range v1b1 { + v1a1 = append(v1a1, PodSandboxToV1alpha1(p)) + } + + return v1a1 +} + +// PodSandboxSliceToV1beta1 converts the types between v1alpha1 and v1beta1. +func PodSandboxSliceToV1beta1(v1a1 []*v1alpha1.PodSandbox) []*v1beta1.PodSandbox { + if v1a1 == nil { + return nil + } + + v1b1 := make([]*v1beta1.PodSandbox, 0, len(v1a1)) + for _, p := range v1a1 { + v1b1 = append(v1b1, PodSandboxToV1beta1(p)) + } + + return v1b1 +} + +// LinuxPodSandboxToV1alpha1 converts the type between v1alpha1 and v1beta1. +func LinuxPodSandboxToV1alpha1(v1b1 *v1beta1.LinuxPodSandbox) *v1alpha1.LinuxPodSandbox { + if v1b1 == nil { + return nil + } + + v1a1 := &v1alpha1.LinuxPodSandbox{ + PodOverhead: LinuxResourcesToV1alpha1(v1b1.PodOverhead), + PodResources: LinuxResourcesToV1alpha1(v1b1.PodResources), + CgroupParent: v1b1.CgroupParent, + CgroupsPath: v1b1.CgroupsPath, + Namespaces: LinuxNamespaceSliceToV1alpha1(v1b1.Namespaces), + Resources: LinuxResourcesToV1alpha1(v1b1.Resources), + } + + return v1a1 +} + +// LinuxPodSandboxToV1beta1 converts the type between v1alpha1 and v1beta1. +func LinuxPodSandboxToV1beta1(v1a1 *v1alpha1.LinuxPodSandbox) *v1beta1.LinuxPodSandbox { + if v1a1 == nil { + return nil + } + + v1b1 := &v1beta1.LinuxPodSandbox{ + PodOverhead: LinuxResourcesToV1beta1(v1a1.PodOverhead), + PodResources: LinuxResourcesToV1beta1(v1a1.PodResources), + CgroupParent: v1a1.CgroupParent, + CgroupsPath: v1a1.CgroupsPath, + Namespaces: LinuxNamespaceSliceToV1beta1(v1a1.Namespaces), + Resources: LinuxResourcesToV1beta1(v1a1.Resources), + } + + return v1b1 +} + +// ContainerToV1alpha1 converts the type between v1alpha1 and v1beta1. +func ContainerToV1alpha1(v1b1 *v1beta1.Container) *v1alpha1.Container { + if v1b1 == nil { + return nil + } + + v1a1 := &v1alpha1.Container{ + Id: v1b1.Id, + PodSandboxId: v1b1.PodSandboxId, + Name: v1b1.Name, + State: v1alpha1.ContainerState(v1b1.State), + Labels: v1b1.Labels, + Annotations: v1b1.Annotations, + Args: v1b1.Args, + Env: v1b1.Env, + Mounts: MountSliceToV1alpha1(v1b1.Mounts), + Hooks: HooksToV1alpha1(v1b1.Hooks), + Linux: LinuxContainerToV1alpha1(v1b1.Linux), + Pid: v1b1.Pid, + Rlimits: POSIXRlimitsSliceToV1alpha1(v1b1.Rlimits), + CreatedAt: v1b1.CreatedAt, + StartedAt: v1b1.StartedAt, + FinishedAt: v1b1.FinishedAt, + ExitCode: v1b1.ExitCode, + StatusReason: v1b1.StatusReason, + StatusMessage: v1b1.StatusMessage, + CDIDevices: CDIDeviceSliceToV1alpha1(v1b1.CDIDevices), + User: UserToV1alpha1(v1b1.User), + } + + return v1a1 +} + +// ContainerToV1beta1 converts the type between v1alpha1 and v1beta1. +func ContainerToV1beta1(v1a1 *v1alpha1.Container) *v1beta1.Container { + if v1a1 == nil { + return nil + } + + v1b1 := &v1beta1.Container{ + Id: v1a1.Id, + PodSandboxId: v1a1.PodSandboxId, + Name: v1a1.Name, + State: v1beta1.ContainerState(v1a1.State), + Labels: v1a1.Labels, + Annotations: v1a1.Annotations, + Args: v1a1.Args, + Env: v1a1.Env, + Mounts: MountSliceToV1beta1(v1a1.Mounts), + Hooks: HooksToV1beta1(v1a1.Hooks), + Linux: LinuxContainerToV1beta1(v1a1.Linux), + Pid: v1a1.Pid, + Rlimits: POSIXRlimitsSliceToV1beta1(v1a1.Rlimits), + CreatedAt: v1a1.CreatedAt, + StartedAt: v1a1.StartedAt, + FinishedAt: v1a1.FinishedAt, + ExitCode: v1a1.ExitCode, + StatusReason: v1a1.StatusReason, + StatusMessage: v1a1.StatusMessage, + CDIDevices: CDIDeviceSliceToV1beta1(v1a1.CDIDevices), + User: UserToV1beta1(v1a1.User), + } + + return v1b1 +} + +// ContainerSliceToV1alpha1 converts the types between v1alpha1 and v1beta1. +func ContainerSliceToV1alpha1(v1b1 []*v1beta1.Container) []*v1alpha1.Container { + if v1b1 == nil { + return nil + } + + v1a1 := make([]*v1alpha1.Container, 0, len(v1b1)) + for _, c := range v1b1 { + v1a1 = append(v1a1, ContainerToV1alpha1(c)) + } + + return v1a1 +} + +// ContainerSliceToV1beta1 converts the types between v1alpha1 and v1beta1. +func ContainerSliceToV1beta1(v1a1 []*v1alpha1.Container) []*v1beta1.Container { + if v1a1 == nil { + return nil + } + + v1b1 := make([]*v1beta1.Container, 0, len(v1a1)) + for _, c := range v1a1 { + v1b1 = append(v1b1, ContainerToV1beta1(c)) + } + + return v1b1 +} + +// MountSliceToV1alpha1 converts the request between v1alpha1 and v1beta1. +func MountSliceToV1alpha1(v1b1 []*v1beta1.Mount) []*v1alpha1.Mount { + if v1b1 == nil { + return nil + } + + v1a1 := make([]*v1alpha1.Mount, 0, len(v1b1)) + for _, m := range v1b1 { + if m != nil { + v1a1 = append(v1a1, &v1alpha1.Mount{ + Source: m.Source, + Destination: m.Destination, + Type: m.Type, + Options: m.Options, + }) + } + } + + return v1a1 +} + +// MountSliceToV1beta1 converts the request between v1alpha1 and v1beta1. +func MountSliceToV1beta1(v1a1 []*v1alpha1.Mount) []*v1beta1.Mount { + if v1a1 == nil { + return nil + } + + v1b1 := make([]*v1beta1.Mount, 0, len(v1a1)) + for _, m := range v1a1 { + if m != nil { + v1b1 = append(v1b1, &v1beta1.Mount{ + Source: m.Source, + Destination: m.Destination, + Type: m.Type, + Options: m.Options, + }) + } + } + + return v1b1 +} + +// HooksToV1alpha1 converts the request between v1alpha1 and v1beta1. +func HooksToV1alpha1(v1b1 *v1beta1.Hooks) *v1alpha1.Hooks { + if v1b1 == nil { + return nil + } + + v1a1 := &v1alpha1.Hooks{ + Prestart: HookSliceToV1alpha1(v1b1.Prestart), + CreateRuntime: HookSliceToV1alpha1(v1b1.CreateRuntime), + CreateContainer: HookSliceToV1alpha1(v1b1.CreateContainer), + StartContainer: HookSliceToV1alpha1(v1b1.StartContainer), + Poststart: HookSliceToV1alpha1(v1b1.Poststart), + Poststop: HookSliceToV1alpha1(v1b1.Poststop), + } + + return v1a1 +} + +// HooksToV1beta1 converts the request between v1alpha1 and v1beta1. +func HooksToV1beta1(v1a1 *v1alpha1.Hooks) *v1beta1.Hooks { + if v1a1 == nil { + return nil + } + + v1b1 := &v1beta1.Hooks{ + Prestart: HookSliceToV1beta1(v1a1.Prestart), + CreateRuntime: HookSliceToV1beta1(v1a1.CreateRuntime), + CreateContainer: HookSliceToV1beta1(v1a1.CreateContainer), + StartContainer: HookSliceToV1beta1(v1a1.StartContainer), + Poststart: HookSliceToV1beta1(v1a1.Poststart), + Poststop: HookSliceToV1beta1(v1a1.Poststop), + } + + return v1b1 +} + +// HookSliceToV1alpha1 converts the request between v1alpha1 and v1beta1. +func HookSliceToV1alpha1(v1b1 []*v1beta1.Hook) []*v1alpha1.Hook { + if v1b1 == nil { + return nil + } + + v1a1 := make([]*v1alpha1.Hook, 0, len(v1b1)) + for _, h := range v1b1 { + if h != nil { + v1a1 = append(v1a1, &v1alpha1.Hook{ + Path: h.Path, + Args: h.Args, + Env: h.Env, + Timeout: OptionalIntToV1alpha1(h.Timeout), + }) + } + } + + return v1a1 +} + +// HookSliceToV1beta1 converts the request between v1alpha1 and v1beta1. +func HookSliceToV1beta1(v1a1 []*v1alpha1.Hook) []*v1beta1.Hook { + if v1a1 == nil { + return nil + } + + v1b1 := make([]*v1beta1.Hook, 0, len(v1a1)) + for _, h := range v1a1 { + if h != nil { + v1b1 = append(v1b1, &v1beta1.Hook{ + Path: h.Path, + Args: h.Args, + Env: h.Env, + Timeout: OptionalIntToV1beta1(h.Timeout), + }) + } + } + + return v1b1 +} + +// LinuxContainerToV1alpha1 converts the request between v1alpha1 and v1beta1. +func LinuxContainerToV1alpha1(v1b1 *v1beta1.LinuxContainer) *v1alpha1.LinuxContainer { + if v1b1 == nil { + return nil + } + + v1a1 := &v1alpha1.LinuxContainer{ + Namespaces: LinuxNamespaceSliceToV1alpha1(v1b1.Namespaces), + Devices: LinuxDeviceSliceToV1alpha1(v1b1.Devices), + Resources: LinuxResourcesToV1alpha1(v1b1.Resources), + OomScoreAdj: OptionalIntToV1alpha1(v1b1.OomScoreAdj), + CgroupsPath: v1b1.CgroupsPath, + IoPriority: LinuxIOPriorityToV1alpha1(v1b1.IoPriority), + SeccompProfile: SecurityProfileToV1alpha1(v1b1.SeccompProfile), + SeccompPolicy: LinuxSeccompToV1alpha1(v1b1.SeccompPolicy), + } + + return v1a1 +} + +// LinuxContainerToV1beta1 converts the request between v1alpha1 and v1beta1. +func LinuxContainerToV1beta1(v1a1 *v1alpha1.LinuxContainer) *v1beta1.LinuxContainer { + if v1a1 == nil { + return nil + } + + v1b1 := &v1beta1.LinuxContainer{ + Namespaces: LinuxNamespaceSliceToV1beta1(v1a1.Namespaces), + Devices: LinuxDeviceSliceToV1beta1(v1a1.Devices), + Resources: LinuxResourcesToV1beta1(v1a1.Resources), + OomScoreAdj: OptionalIntToV1beta1(v1a1.OomScoreAdj), + CgroupsPath: v1a1.CgroupsPath, + IoPriority: LinuxIOPriorityToV1beta1(v1a1.IoPriority), + SeccompProfile: SecurityProfileToV1beta1(v1a1.SeccompProfile), + SeccompPolicy: LinuxSeccompToV1beta1(v1a1.SeccompPolicy), + } + + return v1b1 +} + +// LinuxResourcesToV1alpha1 converts the request between v1alpha1 and v1beta1. +func LinuxResourcesToV1alpha1(v1b1 *v1beta1.LinuxResources) *v1alpha1.LinuxResources { + if v1b1 == nil { + return nil + } + + v1a1 := &v1alpha1.LinuxResources{ + Memory: LinuxMemoryToV1alpha1(v1b1.Memory), + Cpu: LinuxCPUToV1alpha1(v1b1.Cpu), + HugepageLimits: HugepageLimitSliceToV1alpha1(v1b1.HugepageLimits), + BlockioClass: OptionalStringToV1alpha1(v1b1.BlockioClass), + RdtClass: OptionalStringToV1alpha1(v1b1.RdtClass), + Unified: v1b1.Unified, + Devices: LinuxDeviceCgroupSliceToV1alpha1(v1b1.Devices), + Pids: LinuxPidsToV1alpha1(v1b1.Pids), + } + + return v1a1 +} + +// LinuxResourcesToV1beta1 converts the request between v1alpha1 and v1beta1. +func LinuxResourcesToV1beta1(v1a1 *v1alpha1.LinuxResources) *v1beta1.LinuxResources { + if v1a1 == nil { + return nil + } + + v1b1 := &v1beta1.LinuxResources{ + Memory: LinuxMemoryToV1beta1(v1a1.Memory), + Cpu: LinuxCPUToV1beta1(v1a1.Cpu), + HugepageLimits: HugepageLimitSliceToV1beta1(v1a1.HugepageLimits), + BlockioClass: OptionalStringToV1beta1(v1a1.BlockioClass), + RdtClass: OptionalStringToV1beta1(v1a1.RdtClass), + Unified: v1a1.Unified, + Devices: LinuxDeviceCgroupSliceToV1beta1(v1a1.Devices), + Pids: LinuxPidsToV1beta1(v1a1.Pids), + } + + return v1b1 +} + +// LinuxNamespaceSliceToV1alpha1 converts the request between v1alpha1 and v1beta1. +func LinuxNamespaceSliceToV1alpha1(v1b1 []*v1beta1.LinuxNamespace) []*v1alpha1.LinuxNamespace { + if v1b1 == nil { + return nil + } + + v1a1 := make([]*v1alpha1.LinuxNamespace, 0, len(v1b1)) + for _, ns := range v1b1 { + if ns != nil { + v1a1 = append(v1a1, &v1alpha1.LinuxNamespace{ + Type: ns.Type, + Path: ns.Path, + }) + } + } + + return v1a1 +} + +// LinuxNamespaceSliceToV1beta1 converts the request between v1alpha1 and v1beta1. +func LinuxNamespaceSliceToV1beta1(v1a1 []*v1alpha1.LinuxNamespace) []*v1beta1.LinuxNamespace { + if v1a1 == nil { + return nil + } + + v1b1 := make([]*v1beta1.LinuxNamespace, 0, len(v1a1)) + for _, ns := range v1a1 { + if ns != nil { + v1b1 = append(v1b1, &v1beta1.LinuxNamespace{ + Type: ns.Type, + Path: ns.Path, + }) + } + } + + return v1b1 +} + +// LinuxDeviceSliceToV1alpha1 converts the request between v1alpha1 and v1beta1. +func LinuxDeviceSliceToV1alpha1(v1b1 []*v1beta1.LinuxDevice) []*v1alpha1.LinuxDevice { + if v1b1 == nil { + return nil + } + + v1a1 := make([]*v1alpha1.LinuxDevice, 0, len(v1b1)) + for _, d := range v1b1 { + if d != nil { + v1a1 = append(v1a1, &v1alpha1.LinuxDevice{ + Path: d.Path, + Type: d.Type, + Major: d.Major, + Minor: d.Minor, + FileMode: OptionalFileModeToV1alpha1(d.FileMode), + Uid: OptionalUInt32ToV1alpha1(d.Uid), + Gid: OptionalUInt32ToV1alpha1(d.Gid), + }) + } + } + + return v1a1 +} + +// LinuxDeviceSliceToV1beta1 converts the request between v1alpha1 and v1beta1. +func LinuxDeviceSliceToV1beta1(v1a1 []*v1alpha1.LinuxDevice) []*v1beta1.LinuxDevice { + if v1a1 == nil { + return nil + } + + v1b1 := make([]*v1beta1.LinuxDevice, 0, len(v1a1)) + for _, d := range v1a1 { + if d != nil { + v1b1 = append(v1b1, &v1beta1.LinuxDevice{ + Path: d.Path, + Type: d.Type, + Major: d.Major, + Minor: d.Minor, + FileMode: OptionalFileModeToV1beta1(d.FileMode), + Uid: OptionalUInt32ToV1beta1(d.Uid), + Gid: OptionalUInt32ToV1beta1(d.Gid), + }) + } + } + + return v1b1 +} + +// LinuxMemoryToV1alpha1 converts the request between v1alpha1 and v1beta1. +func LinuxMemoryToV1alpha1(v1b1 *v1beta1.LinuxMemory) *v1alpha1.LinuxMemory { + if v1b1 == nil { + return nil + } + + v1a1 := &v1alpha1.LinuxMemory{ + Limit: OptionalInt64ToV1alpha1(v1b1.Limit), + Reservation: OptionalInt64ToV1alpha1(v1b1.Reservation), + Swap: OptionalInt64ToV1alpha1(v1b1.Swap), + Kernel: OptionalInt64ToV1alpha1(v1b1.Kernel), + KernelTcp: OptionalInt64ToV1alpha1(v1b1.KernelTcp), + Swappiness: OptionalUInt64ToV1alpha1(v1b1.Swappiness), + DisableOomKiller: OptionalBoolToV1alpha1(v1b1.DisableOomKiller), + UseHierarchy: OptionalBoolToV1alpha1(v1b1.UseHierarchy), + } + + return v1a1 +} + +// LinuxMemoryToV1beta1 converts the request between v1alpha1 and v1beta1. +func LinuxMemoryToV1beta1(v1a1 *v1alpha1.LinuxMemory) *v1beta1.LinuxMemory { + if v1a1 == nil { + return nil + } + + v1b1 := &v1beta1.LinuxMemory{ + Limit: OptionalInt64ToV1beta1(v1a1.Limit), + Reservation: OptionalInt64ToV1beta1(v1a1.Reservation), + Swap: OptionalInt64ToV1beta1(v1a1.Swap), + Kernel: OptionalInt64ToV1beta1(v1a1.Kernel), + KernelTcp: OptionalInt64ToV1beta1(v1a1.KernelTcp), + Swappiness: OptionalUInt64ToV1beta1(v1a1.Swappiness), + DisableOomKiller: OptionalBoolToV1beta1(v1a1.DisableOomKiller), + UseHierarchy: OptionalBoolToV1beta1(v1a1.UseHierarchy), + } + + return v1b1 +} + +// LinuxCPUToV1alpha1 converts the request between v1alpha1 and v1beta1. +func LinuxCPUToV1alpha1(v1b1 *v1beta1.LinuxCPU) *v1alpha1.LinuxCPU { + if v1b1 == nil { + return nil + } + + v1a1 := &v1alpha1.LinuxCPU{ + Shares: OptionalUInt64ToV1alpha1(v1b1.Shares), + Quota: OptionalInt64ToV1alpha1(v1b1.Quota), + Period: OptionalUInt64ToV1alpha1(v1b1.Period), + RealtimeRuntime: OptionalInt64ToV1alpha1(v1b1.RealtimeRuntime), + RealtimePeriod: OptionalUInt64ToV1alpha1(v1b1.RealtimePeriod), + Cpus: v1b1.Cpus, + Mems: v1b1.Mems, + } + + return v1a1 +} + +// LinuxCPUToV1beta1 converts the request between v1alpha1 and v1beta1. +func LinuxCPUToV1beta1(v1a1 *v1alpha1.LinuxCPU) *v1beta1.LinuxCPU { + if v1a1 == nil { + return nil + } + + v1b1 := &v1beta1.LinuxCPU{ + Shares: OptionalUInt64ToV1beta1(v1a1.Shares), + Quota: OptionalInt64ToV1beta1(v1a1.Quota), + Period: OptionalUInt64ToV1beta1(v1a1.Period), + RealtimeRuntime: OptionalInt64ToV1beta1(v1a1.RealtimeRuntime), + RealtimePeriod: OptionalUInt64ToV1beta1(v1a1.RealtimePeriod), + Cpus: v1a1.Cpus, + Mems: v1a1.Mems, + } + + return v1b1 +} + +// HugepageLimitSliceToV1alpha1 converts the request between v1alpha1 and v1beta1. +func HugepageLimitSliceToV1alpha1(v1b1 []*v1beta1.HugepageLimit) []*v1alpha1.HugepageLimit { + if v1b1 == nil { + return nil + } + + v1a1 := make([]*v1alpha1.HugepageLimit, 0, len(v1b1)) + for _, h := range v1b1 { + if h != nil { + v1a1 = append(v1a1, &v1alpha1.HugepageLimit{ + PageSize: h.PageSize, + Limit: h.Limit, + }) + } + } + + return v1a1 +} + +// HugepageLimitSliceToV1beta1 converts the request between v1alpha1 and v1beta1. +func HugepageLimitSliceToV1beta1(v1a1 []*v1alpha1.HugepageLimit) []*v1beta1.HugepageLimit { + if v1a1 == nil { + return nil + } + + v1b1 := make([]*v1beta1.HugepageLimit, 0, len(v1a1)) + for _, h := range v1a1 { + if h != nil { + v1b1 = append(v1b1, &v1beta1.HugepageLimit{ + PageSize: h.PageSize, + Limit: h.Limit, + }) + } + } + + return v1b1 +} + +// LinuxDeviceCgroupSliceToV1alpha1 converts the request between v1alpha1 and v1beta1. +func LinuxDeviceCgroupSliceToV1alpha1(v1b1 []*v1beta1.LinuxDeviceCgroup) []*v1alpha1.LinuxDeviceCgroup { + if v1b1 == nil { + return nil + } + + v1a1 := make([]*v1alpha1.LinuxDeviceCgroup, 0, len(v1b1)) + for _, d := range v1b1 { + if d != nil { + v1a1 = append(v1a1, &v1alpha1.LinuxDeviceCgroup{ + Allow: d.Allow, + Type: d.Type, + Major: OptionalInt64ToV1alpha1(d.Major), + Minor: OptionalInt64ToV1alpha1(d.Minor), + Access: d.Access, + }) + } + } + + return v1a1 +} + +// LinuxDeviceCgroupSliceToV1beta1 converts the request between v1alpha1 and v1beta1. +func LinuxDeviceCgroupSliceToV1beta1(v1a1 []*v1alpha1.LinuxDeviceCgroup) []*v1beta1.LinuxDeviceCgroup { + if v1a1 == nil { + return nil + } + + v1b1 := make([]*v1beta1.LinuxDeviceCgroup, 0, len(v1a1)) + for _, d := range v1a1 { + if d != nil { + v1b1 = append(v1b1, &v1beta1.LinuxDeviceCgroup{ + Allow: d.Allow, + Type: d.Type, + Major: OptionalInt64ToV1beta1(d.Major), + Minor: OptionalInt64ToV1beta1(d.Minor), + Access: d.Access, + }) + } + } + + return v1b1 +} + +// LinuxPidsToV1alpha1 converts the request between v1alpha1 and v1beta1. +func LinuxPidsToV1alpha1(v1b1 *v1beta1.LinuxPids) *v1alpha1.LinuxPids { + if v1b1 == nil { + return nil + } + + v1a1 := &v1alpha1.LinuxPids{ + Limit: v1b1.Limit, + } + + return v1a1 +} + +// LinuxPidsToV1beta1 converts the request between v1alpha1 and v1beta1. +func LinuxPidsToV1beta1(v1a1 *v1alpha1.LinuxPids) *v1beta1.LinuxPids { + if v1a1 == nil { + return nil + } + + v1b1 := &v1beta1.LinuxPids{ + Limit: v1a1.Limit, + } + + return v1b1 +} + +// LinuxIOPriorityToV1alpha1 converts the request between v1alpha1 and v1beta1. +func LinuxIOPriorityToV1alpha1(v1b1 *v1beta1.LinuxIOPriority) *v1alpha1.LinuxIOPriority { + if v1b1 == nil { + return nil + } + + v1a1 := &v1alpha1.LinuxIOPriority{ + Class: v1alpha1.IOPrioClass(v1b1.Class), + Priority: v1b1.Priority, + } + + return v1a1 +} + +// LinuxIOPriorityToV1beta1 converts the request between v1alpha1 and v1beta1. +func LinuxIOPriorityToV1beta1(v1a1 *v1alpha1.LinuxIOPriority) *v1beta1.LinuxIOPriority { + if v1a1 == nil { + return nil + } + + v1b1 := &v1beta1.LinuxIOPriority{ + Class: v1beta1.IOPrioClass(v1a1.Class), + Priority: v1a1.Priority, + } + + return v1b1 +} + +// SecurityProfileToV1alpha1 converts the request between v1alpha1 and v1beta1. +func SecurityProfileToV1alpha1(v1b1 *v1beta1.SecurityProfile) *v1alpha1.SecurityProfile { + if v1b1 == nil { + return nil + } + + v1a1 := &v1alpha1.SecurityProfile{ + ProfileType: v1alpha1.SecurityProfile_ProfileType(v1b1.ProfileType), + LocalhostRef: v1b1.LocalhostRef, + } + + return v1a1 +} + +// SecurityProfileToV1beta1 converts the request between v1alpha1 and v1beta1. +func SecurityProfileToV1beta1(v1a1 *v1alpha1.SecurityProfile) *v1beta1.SecurityProfile { + if v1a1 == nil { + return nil + } + + v1b1 := &v1beta1.SecurityProfile{ + ProfileType: v1beta1.SecurityProfile_ProfileType(v1a1.ProfileType), + LocalhostRef: v1a1.LocalhostRef, + } + + return v1b1 +} + +// LinuxSeccompToV1alpha1 converts the request between v1alpha1 and v1beta1. +func LinuxSeccompToV1alpha1(v1b1 *v1beta1.LinuxSeccomp) *v1alpha1.LinuxSeccomp { + if v1b1 == nil { + return nil + } + + v1a1 := &v1alpha1.LinuxSeccomp{ + DefaultAction: v1b1.DefaultAction, + DefaultErrno: OptionalUInt32ToV1alpha1(v1b1.DefaultErrno), + Architectures: v1b1.Architectures, + Flags: v1b1.Flags, + ListenerPath: v1b1.ListenerPath, + ListenerMetadata: v1b1.ListenerMetadata, + Syscalls: LinuxSyscallSliceToV1alpha1(v1b1.Syscalls), + } + + return v1a1 +} + +// LinuxSeccompToV1beta1 converts the request between v1alpha1 and v1beta1. +func LinuxSeccompToV1beta1(v1a1 *v1alpha1.LinuxSeccomp) *v1beta1.LinuxSeccomp { + if v1a1 == nil { + return nil + } + + v1b1 := &v1beta1.LinuxSeccomp{ + DefaultAction: v1a1.DefaultAction, + DefaultErrno: OptionalUInt32ToV1beta1(v1a1.DefaultErrno), + Architectures: v1a1.Architectures, + Flags: v1a1.Flags, + ListenerPath: v1a1.ListenerPath, + ListenerMetadata: v1a1.ListenerMetadata, + Syscalls: LinuxSyscallSliceToV1beta1(v1a1.Syscalls), + } + + return v1b1 +} + +// LinuxSyscallSliceToV1alpha1 converts the request between v1alpha1 and v1beta1. +func LinuxSyscallSliceToV1alpha1(v1b1 []*v1beta1.LinuxSyscall) []*v1alpha1.LinuxSyscall { + if v1b1 == nil { + return nil + } + + v1a1 := make([]*v1alpha1.LinuxSyscall, 0, len(v1b1)) + for _, s := range v1b1 { + if s != nil { + v1a1 = append(v1a1, &v1alpha1.LinuxSyscall{ + Names: s.Names, + Action: s.Action, + ErrnoRet: OptionalUInt32ToV1alpha1(s.ErrnoRet), + Args: LinuxSeccompArgSliceToV1alpha1(s.Args), + }) + } + } + + return v1a1 +} + +// LinuxSyscallSliceToV1beta1 converts the request between v1alpha1 and v1beta1. +func LinuxSyscallSliceToV1beta1(v1a1 []*v1alpha1.LinuxSyscall) []*v1beta1.LinuxSyscall { + if v1a1 == nil { + return nil + } + + v1b1 := make([]*v1beta1.LinuxSyscall, 0, len(v1a1)) + for _, s := range v1a1 { + if s != nil { + v1b1 = append(v1b1, &v1beta1.LinuxSyscall{ + Names: s.Names, + Action: s.Action, + ErrnoRet: OptionalUInt32ToV1beta1(s.ErrnoRet), + Args: LinuxSeccompArgSliceToV1beta1(s.Args), + }) + } + } + + return v1b1 +} + +// LinuxSeccompArgSliceToV1alpha1 converts the request between v1alpha1 and v1beta1. +func LinuxSeccompArgSliceToV1alpha1(v1b1 []*v1beta1.LinuxSeccompArg) []*v1alpha1.LinuxSeccompArg { + if v1b1 == nil { + return nil + } + + v1a1 := make([]*v1alpha1.LinuxSeccompArg, 0, len(v1b1)) + for _, a := range v1b1 { + if a != nil { + v1a1 = append(v1a1, &v1alpha1.LinuxSeccompArg{ + Index: a.Index, + Value: a.Value, + ValueTwo: a.ValueTwo, + Op: a.Op, + }) + } + } + + return v1a1 +} + +// LinuxSeccompArgSliceToV1beta1 converts the request between v1alpha1 and v1beta1. +func LinuxSeccompArgSliceToV1beta1(v1a1 []*v1alpha1.LinuxSeccompArg) []*v1beta1.LinuxSeccompArg { + if v1a1 == nil { + return nil + } + + v1b1 := make([]*v1beta1.LinuxSeccompArg, 0, len(v1a1)) + for _, a := range v1a1 { + if a != nil { + v1b1 = append(v1b1, &v1beta1.LinuxSeccompArg{ + Index: a.Index, + Value: a.Value, + ValueTwo: a.ValueTwo, + Op: a.Op, + }) + } + } + + return v1b1 +} + +// OptionalIntToV1alpha1 converts the request between v1alpha1 and v1beta1. +func OptionalIntToV1alpha1(v1b1 *v1beta1.OptionalInt) *v1alpha1.OptionalInt { + if v1b1 == nil { + return nil + } + + v1a1 := &v1alpha1.OptionalInt{ + Value: v1b1.Value, + } + + return v1a1 +} + +// OptionalIntToV1beta1 converts the request between v1alpha1 and v1beta1. +func OptionalIntToV1beta1(v1a1 *v1alpha1.OptionalInt) *v1beta1.OptionalInt { + if v1a1 == nil { + return nil + } + + v1b1 := &v1beta1.OptionalInt{ + Value: v1a1.Value, + } + + return v1b1 +} + +// OptionalStringToV1alpha1 converts the request between v1alpha1 and v1beta1. +func OptionalStringToV1alpha1(v1b1 *v1beta1.OptionalString) *v1alpha1.OptionalString { + if v1b1 == nil { + return nil + } + + v1a1 := &v1alpha1.OptionalString{ + Value: v1b1.Value, + } + + return v1a1 +} + +// OptionalStringToV1beta1 converts the request between v1alpha1 and v1beta1. +func OptionalStringToV1beta1(v1a1 *v1alpha1.OptionalString) *v1beta1.OptionalString { + if v1a1 == nil { + return nil + } + + v1b1 := &v1beta1.OptionalString{ + Value: v1a1.Value, + } + + return v1b1 +} + +// OptionalUInt32ToV1alpha1 converts the request between v1alpha1 and v1beta1. +func OptionalUInt32ToV1alpha1(v1b1 *v1beta1.OptionalUInt32) *v1alpha1.OptionalUInt32 { + if v1b1 == nil { + return nil + } + + v1a1 := &v1alpha1.OptionalUInt32{ + Value: v1b1.Value, + } + + return v1a1 +} + +// OptionalUInt32ToV1beta1 converts the request between v1alpha1 and v1beta1. +func OptionalUInt32ToV1beta1(v1a1 *v1alpha1.OptionalUInt32) *v1beta1.OptionalUInt32 { + if v1a1 == nil { + return nil + } + + v1b1 := &v1beta1.OptionalUInt32{ + Value: v1a1.Value, + } + + return v1b1 +} + +// OptionalInt64ToV1alpha1 converts the request between v1alpha1 and v1beta1. +func OptionalInt64ToV1alpha1(v1b1 *v1beta1.OptionalInt64) *v1alpha1.OptionalInt64 { + if v1b1 == nil { + return nil + } + + v1a1 := &v1alpha1.OptionalInt64{ + Value: v1b1.Value, + } + + return v1a1 +} + +// OptionalInt64ToV1beta1 converts the request between v1alpha1 and v1beta1. +func OptionalInt64ToV1beta1(v1a1 *v1alpha1.OptionalInt64) *v1beta1.OptionalInt64 { + if v1a1 == nil { + return nil + } + + v1b1 := &v1beta1.OptionalInt64{ + Value: v1a1.Value, + } + + return v1b1 +} + +// OptionalUInt64ToV1alpha1 converts the request between v1alpha1 and v1beta1. +func OptionalUInt64ToV1alpha1(v1b1 *v1beta1.OptionalUInt64) *v1alpha1.OptionalUInt64 { + if v1b1 == nil { + return nil + } + + v1a1 := &v1alpha1.OptionalUInt64{ + Value: v1b1.Value, + } + + return v1a1 +} + +// OptionalUInt64ToV1beta1 converts the request between v1alpha1 and v1beta1. +func OptionalUInt64ToV1beta1(v1a1 *v1alpha1.OptionalUInt64) *v1beta1.OptionalUInt64 { + if v1a1 == nil { + return nil + } + + v1b1 := &v1beta1.OptionalUInt64{ + Value: v1a1.Value, + } + + return v1b1 +} + +// OptionalBoolToV1alpha1 converts the request between v1alpha1 and v1beta1. +func OptionalBoolToV1alpha1(v1b1 *v1beta1.OptionalBool) *v1alpha1.OptionalBool { + if v1b1 == nil { + return nil + } + + v1a1 := &v1alpha1.OptionalBool{ + Value: v1b1.Value, + } + + return v1a1 +} + +// OptionalBoolToV1beta1 converts the request between v1alpha1 and v1beta1. +func OptionalBoolToV1beta1(v1a1 *v1alpha1.OptionalBool) *v1beta1.OptionalBool { + if v1a1 == nil { + return nil + } + + v1b1 := &v1beta1.OptionalBool{ + Value: v1a1.Value, + } + + return v1b1 +} + +// OptionalFileModeToV1alpha1 converts the request between v1alpha1 and v1beta1. +func OptionalFileModeToV1alpha1(v1b1 *v1beta1.OptionalFileMode) *v1alpha1.OptionalFileMode { + if v1b1 == nil { + return nil + } + + v1a1 := &v1alpha1.OptionalFileMode{ + Value: v1b1.Value, + } + + return v1a1 +} + +// OptionalFileModeToV1beta1 converts the request between v1alpha1 and v1beta1. +func OptionalFileModeToV1beta1(v1a1 *v1alpha1.OptionalFileMode) *v1beta1.OptionalFileMode { + if v1a1 == nil { + return nil + } + + v1b1 := &v1beta1.OptionalFileMode{ + Value: v1a1.Value, + } + + return v1b1 +} + +// POSIXRlimitsSliceToV1alpha1 converts the request between v1alpha1 and v1beta1. +func POSIXRlimitsSliceToV1alpha1(v1b1 []*v1beta1.POSIXRlimit) []*v1alpha1.POSIXRlimit { + if v1b1 == nil { + return nil + } + + v1a1 := make([]*v1alpha1.POSIXRlimit, 0, len(v1b1)) + for _, r := range v1b1 { + if r != nil { + v1a1 = append(v1a1, &v1alpha1.POSIXRlimit{ + Type: r.Type, + Hard: r.Hard, + Soft: r.Soft, + }) + } + } + + return v1a1 +} + +// POSIXRlimitsSliceToV1beta1 converts the request between v1alpha1 and v1beta1. +func POSIXRlimitsSliceToV1beta1(v1a1 []*v1alpha1.POSIXRlimit) []*v1beta1.POSIXRlimit { + if v1a1 == nil { + return nil + } + + v1b1 := make([]*v1beta1.POSIXRlimit, 0, len(v1a1)) + for _, r := range v1a1 { + if r != nil { + v1b1 = append(v1b1, &v1beta1.POSIXRlimit{ + Type: r.Type, + Hard: r.Hard, + Soft: r.Soft, + }) + } + } + + return v1b1 +} + +// CDIDeviceSliceToV1alpha1 converts the request between v1alpha1 and v1beta1. +func CDIDeviceSliceToV1alpha1(v1b1 []*v1beta1.CDIDevice) []*v1alpha1.CDIDevice { + if v1b1 == nil { + return nil + } + + v1a1 := make([]*v1alpha1.CDIDevice, 0, len(v1b1)) + for _, d := range v1b1 { + if d != nil { + v1a1 = append(v1a1, &v1alpha1.CDIDevice{ + Name: d.Name, + }) + } + } + + return v1a1 +} + +// CDIDeviceSliceToV1beta1 converts the request between v1alpha1 and v1beta1. +func CDIDeviceSliceToV1beta1(v1a1 []*v1alpha1.CDIDevice) []*v1beta1.CDIDevice { + if v1a1 == nil { + return nil + } + + v1b1 := make([]*v1beta1.CDIDevice, 0, len(v1a1)) + for _, d := range v1a1 { + if d != nil { + v1b1 = append(v1b1, &v1beta1.CDIDevice{ + Name: d.Name, + }) + } + } + + return v1b1 +} + +// UserToV1alpha1 converts the request between v1alpha1 and v1beta1. +func UserToV1alpha1(v1b1 *v1beta1.User) *v1alpha1.User { + if v1b1 == nil { + return nil + } + + v1a1 := &v1alpha1.User{ + Uid: v1b1.Uid, + Gid: v1b1.Gid, + AdditionalGids: v1b1.AdditionalGids, + } + + return v1a1 +} + +// UserToV1beta1 converts the request between v1alpha1 and v1beta1. +func UserToV1beta1(v1a1 *v1alpha1.User) *v1beta1.User { + if v1a1 == nil { + return nil + } + + v1b1 := &v1beta1.User{ + Uid: v1a1.Uid, + Gid: v1a1.Gid, + AdditionalGids: v1a1.AdditionalGids, + } + + return v1b1 +} + +// ContainerAdjustmentToV1alpha1 converts the request between v1alpha1 and v1beta1. +func ContainerAdjustmentToV1alpha1(v1b1 *v1beta1.ContainerAdjustment) *v1alpha1.ContainerAdjustment { + if v1b1 == nil { + return nil + } + + v1a1 := &v1alpha1.ContainerAdjustment{ + Annotations: v1b1.Annotations, + Mounts: MountSliceToV1alpha1(v1b1.Mounts), + Env: KeyValueSliceToV1alpha1(v1b1.Env), + Hooks: HooksToV1alpha1(v1b1.Hooks), + Linux: LinuxContainerAdjustmentToV1alpha1(v1b1.Linux), + Rlimits: POSIXRlimitsSliceToV1alpha1(v1b1.Rlimits), + CDIDevices: CDIDeviceSliceToV1alpha1(v1b1.CDIDevices), + Args: v1b1.Args, + } + + return v1a1 +} + +// ContainerAdjustmentToV1beta1 converts the request between v1alpha1 and v1beta1. +func ContainerAdjustmentToV1beta1(v1a1 *v1alpha1.ContainerAdjustment) *v1beta1.ContainerAdjustment { + if v1a1 == nil { + return nil + } + + v1b1 := &v1beta1.ContainerAdjustment{ + Annotations: v1a1.Annotations, + Mounts: MountSliceToV1beta1(v1a1.Mounts), + Env: KeyValueSliceToV1beta1(v1a1.Env), + Hooks: HooksToV1beta1(v1a1.Hooks), + Linux: LinuxContainerAdjustmentToV1beta1(v1a1.Linux), + Rlimits: POSIXRlimitsSliceToV1beta1(v1a1.Rlimits), + CDIDevices: CDIDeviceSliceToV1beta1(v1a1.CDIDevices), + Args: v1a1.Args, + } + + return v1b1 +} + +// ContainerUpdateSliceToV1alpha1 converts the request between v1alpha1 and v1beta1. +func ContainerUpdateSliceToV1alpha1(v1b1 []*v1beta1.ContainerUpdate) []*v1alpha1.ContainerUpdate { + if v1b1 == nil { + return nil + } + + v1a1 := make([]*v1alpha1.ContainerUpdate, 0, len(v1b1)) + for _, u := range v1b1 { + if u != nil { + v1a1 = append(v1a1, &v1alpha1.ContainerUpdate{ + ContainerId: u.ContainerId, + Linux: LinuxContainerUpdateToV1alpha1(u.Linux), + IgnoreFailure: u.IgnoreFailure, + }) + } + } + + return v1a1 +} + +// ContainerUpdateSliceToV1beta1 converts the request between v1alpha1 and v1beta1. +func ContainerUpdateSliceToV1beta1(v1a1 []*v1alpha1.ContainerUpdate) []*v1beta1.ContainerUpdate { + if v1a1 == nil { + return nil + } + + v1b1 := make([]*v1beta1.ContainerUpdate, 0, len(v1a1)) + for _, u := range v1a1 { + if u != nil { + v1b1 = append(v1b1, &v1beta1.ContainerUpdate{ + ContainerId: u.ContainerId, + Linux: LinuxContainerUpdateToV1beta1(u.Linux), + IgnoreFailure: u.IgnoreFailure, + }) + } + } + + return v1b1 +} + +// KeyValueSliceToV1alpha1 converts the request between v1alpha1 and v1beta1. +func KeyValueSliceToV1alpha1(v1b1 []*v1beta1.KeyValue) []*v1alpha1.KeyValue { + if v1b1 == nil { + return nil + } + + v1a1 := make([]*v1alpha1.KeyValue, 0, len(v1b1)) + for _, kv := range v1b1 { + if kv != nil { + v1a1 = append(v1a1, &v1alpha1.KeyValue{ + Key: kv.Key, + Value: kv.Value, + }) + } + } + + return v1a1 +} + +// KeyValueSliceToV1beta1 converts the request between v1alpha1 and v1beta1. +func KeyValueSliceToV1beta1(v1a1 []*v1alpha1.KeyValue) []*v1beta1.KeyValue { + if v1a1 == nil { + return nil + } + + v1b1 := make([]*v1beta1.KeyValue, 0, len(v1a1)) + for _, kv := range v1a1 { + if kv != nil { + v1b1 = append(v1b1, &v1beta1.KeyValue{ + Key: kv.Key, + Value: kv.Value, + }) + } + } + + return v1b1 +} + +// LinuxContainerAdjustmentToV1alpha1 converts the request between v1alpha1 and v1beta1. +func LinuxContainerAdjustmentToV1alpha1(v1b1 *v1beta1.LinuxContainerAdjustment) *v1alpha1.LinuxContainerAdjustment { + if v1b1 == nil { + return nil + } + + v1a1 := &v1alpha1.LinuxContainerAdjustment{ + Devices: LinuxDeviceSliceToV1alpha1(v1b1.Devices), + Resources: LinuxResourcesToV1alpha1(v1b1.Resources), + CgroupsPath: v1b1.CgroupsPath, + OomScoreAdj: OptionalIntToV1alpha1(v1b1.OomScoreAdj), + IoPriority: LinuxIOPriorityToV1alpha1(v1b1.IoPriority), + SeccompPolicy: LinuxSeccompToV1alpha1(v1b1.SeccompPolicy), + Namespaces: LinuxNamespaceSliceToV1alpha1(v1b1.Namespaces), + } + + return v1a1 +} + +// LinuxContainerAdjustmentToV1beta1 converts the request between v1alpha1 and v1beta1. +func LinuxContainerAdjustmentToV1beta1(v1a1 *v1alpha1.LinuxContainerAdjustment) *v1beta1.LinuxContainerAdjustment { + if v1a1 == nil { + return nil + } + + v1b1 := &v1beta1.LinuxContainerAdjustment{ + Devices: LinuxDeviceSliceToV1beta1(v1a1.Devices), + Resources: LinuxResourcesToV1beta1(v1a1.Resources), + CgroupsPath: v1a1.CgroupsPath, + OomScoreAdj: OptionalIntToV1beta1(v1a1.OomScoreAdj), + IoPriority: LinuxIOPriorityToV1beta1(v1a1.IoPriority), + SeccompPolicy: LinuxSeccompToV1beta1(v1a1.SeccompPolicy), + Namespaces: LinuxNamespaceSliceToV1beta1(v1a1.Namespaces), + } + + return v1b1 +} + +// LinuxContainerUpdateToV1alpha1 converts the request between v1alpha1 and v1beta1. +func LinuxContainerUpdateToV1alpha1(v1b1 *v1beta1.LinuxContainerUpdate) *v1alpha1.LinuxContainerUpdate { + if v1b1 == nil { + return nil + } + + v1a1 := &v1alpha1.LinuxContainerUpdate{ + Resources: LinuxResourcesToV1alpha1(v1b1.Resources), + } + + return v1a1 +} + +// LinuxContainerUpdateToV1beta1 converts the request between v1alpha1 and v1beta1. +func LinuxContainerUpdateToV1beta1(v1a1 *v1alpha1.LinuxContainerUpdate) *v1beta1.LinuxContainerUpdate { + if v1a1 == nil { + return nil + } + + v1b1 := &v1beta1.LinuxContainerUpdate{ + Resources: LinuxResourcesToV1beta1(v1a1.Resources), + } + + return v1b1 +} + +// ContainerEvictionSliceToV1alpha1 converts the request between v1alpha1 and v1beta1. +func ContainerEvictionSliceToV1alpha1(v1b1 []*v1beta1.ContainerEviction) []*v1alpha1.ContainerEviction { + if v1b1 == nil { + return nil + } + + v1a1 := make([]*v1alpha1.ContainerEviction, 0, len(v1b1)) + for _, e := range v1b1 { + if e != nil { + v1a1 = append(v1a1, &v1alpha1.ContainerEviction{ + ContainerId: e.ContainerId, + Reason: e.Reason, + }) + } + } + + return v1a1 +} + +// ContainerEvictionSliceToV1beta1 converts the request between v1alpha1 and v1beta1. +func ContainerEvictionSliceToV1beta1(v1a1 []*v1alpha1.ContainerEviction) []*v1beta1.ContainerEviction { + if v1a1 == nil { + return nil + } + + v1b1 := make([]*v1beta1.ContainerEviction, 0, len(v1a1)) + for _, e := range v1a1 { + if e != nil { + v1b1 = append(v1b1, &v1beta1.ContainerEviction{ + ContainerId: e.ContainerId, + Reason: e.Reason, + }) + } + } + + return v1b1 +} + +// OwningPluginsToV1alpha1 converts the request between v1alpha1 and v1beta1. +func OwningPluginsToV1alpha1(v1b1 *v1beta1.OwningPlugins) *v1alpha1.OwningPlugins { + if v1b1 == nil { + return nil + } + + return &v1alpha1.OwningPlugins{ + Owners: FieldOwnersMapToV1alpha1(v1b1.Owners), + } +} + +// OwningPluginsToV1beta1 converts the request between v1alpha1 and v1beta1. +func OwningPluginsToV1beta1(v1a1 *v1alpha1.OwningPlugins) *v1beta1.OwningPlugins { + if v1a1 == nil { + return nil + } + + return &v1beta1.OwningPlugins{ + Owners: FieldOwnersMapToV1beta1(v1a1.Owners), + } +} + +// FieldOwnersMapToV1alpha1 converts the request between v1alpha1 and v1beta1. +func FieldOwnersMapToV1alpha1(v1b1 map[string]*v1beta1.FieldOwners) map[string]*v1alpha1.FieldOwners { + if v1b1 == nil { + return nil + } + + v1a1 := make(map[string]*v1alpha1.FieldOwners, len(v1b1)) + for id, o := range v1b1 { + if o != nil { + v1a1[id] = &v1alpha1.FieldOwners{ + Simple: o.Simple, + Compound: CompoundFieldOwnersMapToV1alpha1(o.Compound), + } + } + } + + return v1a1 +} + +// FieldOwnersMapToV1beta1 converts the request between v1alpha1 and v1beta1. +func FieldOwnersMapToV1beta1(v1a1 map[string]*v1alpha1.FieldOwners) map[string]*v1beta1.FieldOwners { + if v1a1 == nil { + return nil + } + + v1b1 := make(map[string]*v1beta1.FieldOwners, len(v1a1)) + for id, o := range v1a1 { + if o != nil { + v1b1[id] = &v1beta1.FieldOwners{ + Simple: o.Simple, + Compound: CompoundFieldOwnersMapToV1beta1(o.Compound), + } + } + } + + return v1b1 +} + +// CompoundFieldOwnersMapToV1alpha1 converts the request between v1alpha1 and v1beta1. +func CompoundFieldOwnersMapToV1alpha1(v1b1 map[int32]*v1beta1.CompoundFieldOwners) map[int32]*v1alpha1.CompoundFieldOwners { + if v1b1 == nil { + return nil + } + + v1a1 := make(map[int32]*v1alpha1.CompoundFieldOwners, len(v1b1)) + for f, o := range v1b1 { + if o != nil { + v1a1[f] = &v1alpha1.CompoundFieldOwners{ + Owners: o.Owners, + } + } + } + + return v1a1 +} + +// CompoundFieldOwnersMapToV1beta1 converts the request between v1alpha1 and v1beta1. +func CompoundFieldOwnersMapToV1beta1(v1a1 map[int32]*v1alpha1.CompoundFieldOwners) map[int32]*v1beta1.CompoundFieldOwners { + if v1a1 == nil { + return nil + } + + v1b1 := make(map[int32]*v1beta1.CompoundFieldOwners, len(v1a1)) + for f, o := range v1a1 { + if o != nil { + v1b1[f] = &v1beta1.CompoundFieldOwners{ + Owners: o.Owners, + } + } + } + + return v1b1 +} + +// PluginInstanceSliceToV1alpha1 converts the request between v1alpha1 and v1beta1. +func PluginInstanceSliceToV1alpha1(v1b1 []*v1beta1.PluginInstance) []*v1alpha1.PluginInstance { + if v1b1 == nil { + return nil + } + + v1a1 := make([]*v1alpha1.PluginInstance, 0, len(v1b1)) + for _, p := range v1b1 { + if p != nil { + v1a1 = append(v1a1, &v1alpha1.PluginInstance{ + Name: p.Name, + Index: p.Index, + }) + } + } + + return v1a1 +} + +// PluginInstanceSliceToV1beta1 converts the request between v1alpha1 and v1beta1. +func PluginInstanceSliceToV1beta1(v1a1 []*v1alpha1.PluginInstance) []*v1beta1.PluginInstance { + if v1a1 == nil { + return nil + } + + v1b1 := make([]*v1beta1.PluginInstance, 0, len(v1a1)) + for _, p := range v1a1 { + if p != nil { + v1b1 = append(v1b1, &v1beta1.PluginInstance{ + Name: p.Name, + Index: p.Index, + }) + } + } + + return v1b1 +} From 031837fae7a5bd98c1a70cfe2a12925046c4b196 Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Tue, 30 Sep 2025 16:50:30 +0300 Subject: [PATCH 11/20] adaptation, stub: implement plugin shutdown, delay close. Implement plugin shutdown. On error paths where this seems the right choice, shut down plugins instead of closing them. This should give plugins a chance to gather more context (from the shutdown reason) than just closing the connection. On other error code paths where we close the connection, delay it to allow any errors to propagate back to the plugin before the connection is closed. Signed-off-by: Krisztian Litkey --- pkg/adaptation/adaptation.go | 13 ++ pkg/adaptation/adaptation_suite_test.go | 56 +++++++++ pkg/adaptation/plugin.go | 156 +++++++++++++----------- pkg/adaptation/plugin_type.go | 13 ++ pkg/adaptation/suite_test.go | 30 ++++- pkg/stub/v1beta1/stub.go | 14 ++- plugins/logger/nri-logger.go | 5 +- plugins/template/plugin.go | 5 +- 8 files changed, 203 insertions(+), 89 deletions(-) diff --git a/pkg/adaptation/adaptation.go b/pkg/adaptation/adaptation.go index 46785a7f..6e8c6ca5 100644 --- a/pkg/adaptation/adaptation.go +++ b/pkg/adaptation/adaptation.go @@ -22,6 +22,7 @@ import ( "io/fs" "net" "os" + "path" "path/filepath" "sort" "sync" @@ -225,6 +226,18 @@ func (r *Adaptation) Stop() { r.stopPlugins() } +// ShutdownPlugins shuts down plugins matching the given pattern with the given reason. +func (r *Adaptation) ShutdownPlugins(reason, pattern string) { + r.Lock() + defer r.Unlock() + + for _, p := range r.plugins { + if match, _ := path.Match(pattern, p.name()); match { + p.shutdown(reason) + } + } +} + // RunPodSandbox relays the corresponding CRI event to plugins. func (r *Adaptation) RunPodSandbox(ctx context.Context, req *RunPodSandboxRequest) error { r.Lock() diff --git a/pkg/adaptation/adaptation_suite_test.go b/pkg/adaptation/adaptation_suite_test.go index 472d4bb9..04fb18b8 100644 --- a/pkg/adaptation/adaptation_suite_test.go +++ b/pkg/adaptation/adaptation_suite_test.go @@ -3188,6 +3188,62 @@ var _ = Describe("Plugin configuration request", func() { }) }) +var _ = Describe("Plugin shutdown request", func() { + var ( + s = &Suite{} + ) + + AfterEach(func() { + s.Cleanup() + }) + + BeforeEach(func() { + s.Prepare(&mockRuntime{}, &mockPlugin{idx: "00", name: "test"}) + }) + + It("should be able to shut down plugins with a reason", func() { + var ( + reason = "test-shutdown-reason" + timeout = 2 * time.Second + ) + + s.Startup() + + s.ShutdownPlugin(s.plugins[0], reason) + e, err := s.plugins[0].EventQ().Wait(PluginShutdown, time.After(timeout)) + Expect(err).To(BeNil()) + Expect(e.Reason).To(Equal(reason)) + }) + + It("plugin that times out should be shut down with a reason", func() { + var ( + reason = nri.ShutdownRequestTimeout + timeout = 2 * time.Second + ) + + pod := &api.PodSandbox{ + Id: "pod0", + Name: "pod0", + Uid: "uid0", + Namespace: "default", + } + podReq := &api.RunPodSandboxRequest{Pod: pod} + + s.plugins[0].runPodSandbox = func(_ *mockPlugin, _ *api.PodSandbox) error { + time.Sleep(3 * time.Second) + return nil + } + + s.Startup() + Expect(s.runtime.RunPodSandbox(context.Background(), podReq)).To(Succeed()) + + e, err := s.plugins[0].EventQ().Wait(PluginShutdown, time.After(timeout)) + Expect(err).To(BeNil()) + Expect(e.Reason).To(Equal(reason)) + }) + +}) + func protoDiff(a, b proto.Message) string { return cmp.Diff(a, b, protocmp.Transform()) } diff --git a/pkg/adaptation/plugin.go b/pkg/adaptation/plugin.go index dd1b54dd..c7b5b2b8 100644 --- a/pkg/adaptation/plugin.go +++ b/pkg/adaptation/plugin.go @@ -43,6 +43,16 @@ const ( DefaultPluginRegistrationTimeout = api.DefaultPluginRegistrationTimeout // DefaultPluginRequestTimeout is the default timeout for plugins to handle a request. DefaultPluginRequestTimeout = api.DefaultPluginRequestTimeout + + // Give this much time for a plugin before closing due to an error. This should + // allow any returned error or a shutdown request to be received and processed, + // hopefully giving the plugins more context than just a ttrpc.ErrServerClosed. + shutdownDelay = 1 * time.Second + + // ShutdownTtrpcProtoError is the shutdown reason for a ttrpc protocol error + ShutdownTtrpcProtoError = "ttrpc protocol error" + // ShutdownRequestTimeout is the shutdown reason for a plugin timeout + ShutdownRequestTimeout = "request handling timeout" ) var ( @@ -333,40 +343,53 @@ func (p *plugin) start(name, version string) (err error) { select { case err = <-p.regC: if err != nil { + p.delayedClose(shutdownDelay) return fmt.Errorf("failed to register plugin: %w", err) } case <-p.closeC: return fmt.Errorf("failed to register plugin, connection closed") case <-time.After(timeout): - p.close() - p.stop() + p.shutdown("plugin registration timed out") return errors.New("plugin registration timed out") } } err = p.configure(context.Background(), name, version, p.cfg) if err != nil { - p.close() - p.stop() + p.delayedClose(shutdownDelay) return err } return nil } +// Close a plugin after a delay. Clear the plugins event mask immediately. +// If the plugin was launched by us, also stop it. +func (p *plugin) delayedClose(delay time.Duration) { + p.Lock() + defer p.Unlock() + + p.events = 0 + go func() { + time.Sleep(delay) + p.close() + p.stop() + }() +} + // close a plugin shutting down its multiplexed ttrpc connections. func (p *plugin) close() { - if p.impl.isWasm() || p.impl.isBuiltin() { - p.closed = true - return - } - p.Lock() defer p.Unlock() if p.closed { return } + if p.impl.isWasm() || p.impl.isBuiltin() { + p.closed = true + return + } + p.closed = true p.mux.Close() p.rpcc.Close() @@ -399,6 +422,15 @@ func (p *plugin) stop() error { return nil } +func (p *plugin) shutdown(reason string) { + p.delayedClose(shutdownDelay) + go func() { + ctx, cancel := context.WithTimeout(context.Background(), shutdownDelay) + defer cancel() + p.impl.Shutdown(ctx, &api.ShutdownRequest{Reason: reason}) + }() +} + // Name returns a string indentication for the plugin. func (p *plugin) name() string { return p.idx + "-" + p.base @@ -434,11 +466,11 @@ func (p *plugin) RegisterPlugin(ctx context.Context, req *RegisterPluginRequest) if p.isExternal() { if req.PluginName == "" { p.regC <- fmt.Errorf("plugin %q registered with an empty name", p.qualifiedName()) - return &RegisterPluginResponse{}, errors.New("invalid (empty) plugin name") + return nil, errors.New("invalid (empty) plugin name") } if err := api.CheckPluginIndex(req.PluginIdx); err != nil { p.regC <- fmt.Errorf("plugin %q registered with an invalid index: %w", req.PluginName, err) - return &RegisterPluginResponse{}, fmt.Errorf("invalid plugin index: %w", err) + return nil, fmt.Errorf("invalid plugin index: %w", err) } p.base = req.PluginName p.idx = req.PluginIdx @@ -603,10 +635,7 @@ func (p *plugin) runPodSandbox(ctx context.Context, req *RunPodSandboxRequest) ( defer cancel() if _, err := p.impl.RunPodSandbox(ctx, req); err != nil { - if isFatalError(err) { - log.Errorf(ctx, "closing plugin %s, failed to handle RunPodSandbox event: %v", - p.name(), err) - p.close() + if p.closeIfFatalError(ctx, err, "RunPodSandbox") { return nil, nil } return nil, err @@ -625,10 +654,7 @@ func (p *plugin) updatePodSandbox(ctx context.Context, req *UpdatePodSandboxRequ defer cancel() if _, err := p.impl.UpdatePodSandbox(ctx, req); err != nil { - if isFatalError(err) { - log.Errorf(ctx, "closing plugin %s, failed to handle UpdatePodSandbox event: %v", - p.name(), err) - p.close() + if p.closeIfFatalError(ctx, err, "UpdatePodSandbox") { return nil, nil } return nil, err @@ -647,10 +673,7 @@ func (p *plugin) postUpdatePodSandbox(ctx context.Context, req *PostUpdatePodSan defer cancel() if _, err := p.impl.PostUpdatePodSandbox(ctx, req); err != nil { - if isFatalError(err) { - log.Errorf(ctx, "closing plugin %s, failed to handle PostUpdatePodSandbox event: %v", - p.name(), err) - p.close() + if p.closeIfFatalError(ctx, err, "PostUpdatePodSandbox") { return nil, nil } return nil, err @@ -669,10 +692,7 @@ func (p *plugin) stopPodSandbox(ctx context.Context, req *StopPodSandboxRequest) defer cancel() if _, err := p.impl.StopPodSandbox(ctx, req); err != nil { - if isFatalError(err) { - log.Errorf(ctx, "closing plugin %s, failed to handle StopPodSandbox event: %v", - p.name(), err) - p.close() + if p.closeIfFatalError(ctx, err, "StopPodSandbox") { return nil, nil } return nil, err @@ -691,10 +711,7 @@ func (p *plugin) removePodSandbox(ctx context.Context, req *RemovePodSandboxRequ defer cancel() if _, err := p.impl.RemovePodSandbox(ctx, req); err != nil { - if isFatalError(err) { - log.Errorf(ctx, "closing plugin %s, failed to handle RemovePodSandbox event: %v", - p.name(), err) - p.close() + if p.closeIfFatalError(ctx, err, "RemovePodSandbox") { return nil, nil } return nil, err @@ -714,10 +731,7 @@ func (p *plugin) createContainer(ctx context.Context, req *CreateContainerReques rpl, err := p.impl.CreateContainer(ctx, req) if err != nil { - if isFatalError(err) { - log.Errorf(ctx, "closing plugin %s, failed to handle CreateContainer request: %v", - p.name(), err) - p.close() + if p.closeIfFatalError(ctx, err, "CreateContainer") { return nil, nil } return nil, err @@ -736,10 +750,7 @@ func (p *plugin) postCreateContainer(ctx context.Context, req *PostCreateContain defer cancel() if _, err := p.impl.PostCreateContainer(ctx, req); err != nil { - if isFatalError(err) { - log.Errorf(ctx, "closing plugin %s, failed to handle PostCreateContainer event: %v", - p.name(), err) - p.close() + if p.closeIfFatalError(ctx, err, "PostCreateContainer") { return nil, nil } return nil, err @@ -758,10 +769,7 @@ func (p *plugin) startContainer(ctx context.Context, req *StartContainerRequest) defer cancel() if _, err := p.impl.StartContainer(ctx, req); err != nil { - if isFatalError(err) { - log.Errorf(ctx, "closing plugin %s, failed to handle StartContainer event: %v", - p.name(), err) - p.close() + if p.closeIfFatalError(ctx, err, "StartContainer") { return nil, nil } return nil, err @@ -780,10 +788,7 @@ func (p *plugin) postStartContainer(ctx context.Context, req *PostStartContainer defer cancel() if _, err := p.impl.PostStartContainer(ctx, req); err != nil { - if isFatalError(err) { - log.Errorf(ctx, "closing plugin %s, failed to handle PostStartContainer event: %v", - p.name(), err) - p.close() + if p.closeIfFatalError(ctx, err, "StartContainer") { return nil, nil } return nil, err @@ -803,10 +808,7 @@ func (p *plugin) updateContainer(ctx context.Context, req *UpdateContainerReques rpl, err := p.impl.UpdateContainer(ctx, req) if err != nil { - if isFatalError(err) { - log.Errorf(ctx, "closing plugin %s, failed to handle UpdateContainer request: %v", - p.name(), err) - p.close() + if p.closeIfFatalError(ctx, err, "UpdateContainer") { return nil, nil } return nil, err @@ -825,10 +827,7 @@ func (p *plugin) postUpdateContainer(ctx context.Context, req *PostUpdateContain defer cancel() if _, err := p.impl.PostUpdateContainer(ctx, req); err != nil { - if isFatalError(err) { - log.Errorf(ctx, "closing plugin %s, failed to handle PostUpdateContainer event: %v", - p.name(), err) - p.close() + if p.closeIfFatalError(ctx, err, "PostUpdateContainer") { return nil, nil } return nil, err @@ -848,10 +847,7 @@ func (p *plugin) stopContainer(ctx context.Context, req *StopContainerRequest) ( rpl, err = p.impl.StopContainer(ctx, req) if err != nil { - if isFatalError(err) { - log.Errorf(ctx, "closing plugin %s, failed to handle StopContainer request: %v", - p.name(), err) - p.close() + if p.closeIfFatalError(ctx, err, "StopContainer") { return nil, nil } return nil, err @@ -870,10 +866,7 @@ func (p *plugin) removeContainer(ctx context.Context, req *RemoveContainerReques defer cancel() if _, err := p.impl.RemoveContainer(ctx, req); err != nil { - if isFatalError(err) { - log.Errorf(ctx, "closing plugin %s, failed to handle RemoveContainer event: %v", - p.name(), err) - p.close() + if p.closeIfFatalError(ctx, err, "RemoveContainer") { return nil, nil } return nil, err @@ -892,29 +885,44 @@ func (p *plugin) ValidateContainerAdjustment(ctx context.Context, req *ValidateC rpl, err := p.impl.ValidateContainerAdjustment(ctx, req) if err != nil { - if isFatalError(err) { - log.Errorf(ctx, "closing plugin %s, failed to validate request: %v", p.name(), err) - p.close() - } + p.closeIfFatalError(ctx, err, "validation request") return fmt.Errorf("validator plugin %s failed: %v", p.name(), err) } return rpl.ValidationResult(p.name()) } -// isFatalError returns true if the error is fatal and the plugin connection should be closed. -func isFatalError(err error) bool { +func (p *plugin) closeIfFatalError(ctx context.Context, err error, what string) bool { + fatal, reason := isFatalError(err) + if !fatal { + return false + } + + if reason != "" { + log.Errorf(ctx, "shutting down plugin %s, failed to handle %s: %v", what, p.name(), err) + p.shutdown(reason) + } else { + log.Errorf(ctx, "closing plugin %s, failed to handle %s: %v", what, p.name(), err) + p.delayedClose(shutdownDelay) + } + + return true +} + +// isFatalError returns true if the error is fatal and the plugin connection should be closed +// or shutdown with a given reason string. +func isFatalError(err error) (bool, string) { switch { case errors.Is(err, ttrpc.ErrClosed): - return true + return true, "" case errors.Is(err, ttrpc.ErrServerClosed): - return true + return true, "" case errors.Is(err, ttrpc.ErrProtocol): - return true + return true, ShutdownTtrpcProtoError case errors.Is(err, context.DeadlineExceeded): - return true + return true, ShutdownRequestTimeout } - return false + return false, "" } // wasmHostFunctions implements the webassembly host functions diff --git a/pkg/adaptation/plugin_type.go b/pkg/adaptation/plugin_type.go index c0e09e59..e23458aa 100644 --- a/pkg/adaptation/plugin_type.go +++ b/pkg/adaptation/plugin_type.go @@ -45,6 +45,19 @@ func (p *pluginType) isBuiltin() bool { return p.builtinImpl != nil } +func (p *pluginType) Shutdown(ctx context.Context, req *ShutdownRequest) (*ShutdownResponse, error) { + switch { + case p.ttrpcImpl != nil: + return p.ttrpcImpl.Shutdown(ctx, req) + case p.builtinImpl != nil: + return p.builtinImpl.Shutdown(ctx, req) + case p.wasmImpl != nil: + return p.wasmImpl.Shutdown(ctx, req) + } + + return nil, errUnknownImpl +} + func (p *pluginType) Synchronize(ctx context.Context, req *SynchronizeRequest) (*SynchronizeResponse, error) { switch { case p.ttrpcImpl != nil: diff --git a/pkg/adaptation/suite_test.go b/pkg/adaptation/suite_test.go index bfd754f1..195adefd 100644 --- a/pkg/adaptation/suite_test.go +++ b/pkg/adaptation/suite_test.go @@ -128,6 +128,11 @@ func (s *Suite) WaitForPluginsToSync(plugins ...*mockPlugin) { s.runtime.runtime.BlockPluginSync().Unblock() // ensure plugins are fully registered } +// ShutdownPlugin shuts down the given plugin. +func (s *Suite) ShutdownPlugin(plugin *mockPlugin, reason string) { + s.runtime.ShutdownPlugins(reason, plugin.FullName()) +} + // Cleanup the test suite. func (s *Suite) Cleanup() { s.runtime.Stop() @@ -203,6 +208,12 @@ func (m *mockRuntime) Stop() { } } +func (m *mockRuntime) ShutdownPlugins(reason, pattern string) { + if m.runtime != nil { + m.runtime.ShutdownPlugins(reason, pattern) + } +} + func (m *mockRuntime) synchronize(ctx context.Context, cb nri.SyncCB) error { var ( pods []*api.PodSandbox @@ -395,6 +406,7 @@ type mockPlugin struct { } var ( + _ = stub.ShutdownInterface(&mockPlugin{}) _ = stub.ConfigureInterface(&mockPlugin{}) _ = stub.SynchronizeInterface(&mockPlugin{}) _ = stub.RunPodInterface(&mockPlugin{}) @@ -586,8 +598,8 @@ func (m *mockPlugin) Synchronize(_ context.Context, pods []*api.PodSandbox, ctrs return nil, nil } -func (m *mockPlugin) Shutdown(_ context.Context) { - m.q.Add(PluginShutdown) +func (m *mockPlugin) Shutdown(_ context.Context, reason string) { + m.q.Add(PluginShutdownWithReason(reason)) } func (m *mockPlugin) RunPodSandbox(_ context.Context, pod *api.PodSandbox) error { @@ -753,9 +765,10 @@ const ( ) type Event struct { - Type EventType - Pod *api.PodSandbox - Ctr *api.Container + Type EventType + Pod *api.PodSandbox + Ctr *api.Container + Reason string } var ( @@ -773,6 +786,9 @@ var ( ContainerEvent = func(ctr *api.Container, t EventType) *Event { return &Event{Type: t, Ctr: ctr} } + PluginShutdownWithReason = func(reason string) *Event { + return &Event{Type: Shutdown, Reason: reason} + } ) func (e *Event) Matches(o *Event) bool { @@ -868,6 +884,10 @@ func (q *EventQ) Wait(w *Event, deadline <-chan time.Time) (*Event, error) { } q.c = make(chan *Event, 16) defer func() { + if unlocked { + q.Lock() + unlocked = false + } c := q.c q.c = nil close(c) diff --git a/pkg/stub/v1beta1/stub.go b/pkg/stub/v1beta1/stub.go index 1b68ec76..338248c7 100644 --- a/pkg/stub/v1beta1/stub.go +++ b/pkg/stub/v1beta1/stub.go @@ -60,7 +60,7 @@ type SynchronizeInterface interface { // ShutdownInterface handles a Shutdown API request. type ShutdownInterface interface { // Shutdown notifies the plugin about the runtime shutting down. - Shutdown(context.Context) + Shutdown(context.Context, string) } // RunPodInterface handles RunPodSandbox API events. @@ -301,7 +301,7 @@ type stub struct { type handlers struct { Configure func(context.Context, string, string, string) (api.EventMask, error) Synchronize func(context.Context, []*api.PodSandbox, []*api.Container) ([]*api.ContainerUpdate, error) - Shutdown func(context.Context) + Shutdown func(context.Context, string) RunPodSandbox func(context.Context, *api.PodSandbox) error UpdatePodSandbox func(context.Context, *api.PodSandbox, *api.LinuxResources, *api.LinuxResources) error PostUpdatePodSandbox func(context.Context, *api.PodSandbox) error @@ -713,11 +713,13 @@ func (stub *stub) deliverSync(ctx context.Context, req *api.SynchronizeRequest) } // Shutdown the plugin. -func (stub *stub) Shutdown(ctx context.Context, _ *api.ShutdownRequest) (*api.ShutdownResponse, error) { - handler := stub.handlers.Shutdown - if handler != nil { - handler(ctx) +func (stub *stub) Shutdown(ctx context.Context, req *api.ShutdownRequest) (*api.ShutdownResponse, error) { + log.Infof(ctx, "shut down by runtime, with reason %q", req.Reason) + + if stub.handlers.Shutdown != nil { + stub.handlers.Shutdown(ctx, req.Reason) } + return &api.ShutdownResponse{}, nil } diff --git a/plugins/logger/nri-logger.go b/plugins/logger/nri-logger.go index eedd4b5a..2bc17500 100644 --- a/plugins/logger/nri-logger.go +++ b/plugins/logger/nri-logger.go @@ -84,8 +84,9 @@ func (p *plugin) Synchronize(_ context.Context, pods []*api.PodSandbox, containe return nil, nil } -func (p *plugin) Shutdown() { - dump("Shutdown") +func (p *plugin) Shutdown(_ context.Context, reason string) { + dump("Shutdown", "reason", reason) + os.Exit(0) } func (p *plugin) RunPodSandbox(_ context.Context, pod *api.PodSandbox) error { diff --git a/plugins/template/plugin.go b/plugins/template/plugin.go index 28e6d95f..b7d4fd54 100644 --- a/plugins/template/plugin.go +++ b/plugins/template/plugin.go @@ -66,8 +66,9 @@ func (p *plugin) Synchronize(_ context.Context, pods []*api.PodSandbox, containe return nil, nil } -func (p *plugin) Shutdown(_ context.Context) { - log.Info("Runtime shutting down...") +func (p *plugin) Shutdown(_ context.Context, reason string) { + log.Infof("Shutdown with reason %q", reason) + os.Exit(0) } func (p *plugin) RunPodSandbox(_ context.Context, pod *api.PodSandbox) error { From 3ee86984cd1e34f68e9d101c517a135432a51373 Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Wed, 8 Oct 2025 11:32:41 +0300 Subject: [PATCH 12/20] stub: cancel Start() for early lost connection. If our connection gets closed before we had a chance to get Configure()'d by the runtime, cancel Start()'s wait for the result by letting it know. Signed-off-by: Krisztian Litkey --- pkg/stub/v1alpha1/stub.go | 11 ++++++++++- pkg/stub/v1beta1/stub.go | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/pkg/stub/v1alpha1/stub.go b/pkg/stub/v1alpha1/stub.go index 4dc7fbb2..1b0be902 100644 --- a/pkg/stub/v1alpha1/stub.go +++ b/pkg/stub/v1alpha1/stub.go @@ -584,6 +584,12 @@ func (stub *stub) register(ctx context.Context) error { // Handle a lost connection. func (stub *stub) connClosed() { + select { + // if our connection gets closed before we get Configure()'d, let Start() know + case stub.cfgErrC <- ttrpc.ErrClosed: + default: + } + stub.Lock() stub.close() stub.Unlock() @@ -628,7 +634,10 @@ func (stub *stub) Configure(ctx context.Context, req *api.ConfigureRequest) (rpl stub.requestTimeout = time.Duration(req.RequestTimeout * int64(time.Millisecond)) defer func() { - stub.cfgErrC <- retErr + select { + case stub.cfgErrC <- retErr: + default: + } }() if handler := stub.handlers.Configure; handler == nil { diff --git a/pkg/stub/v1beta1/stub.go b/pkg/stub/v1beta1/stub.go index 338248c7..96c9587f 100644 --- a/pkg/stub/v1beta1/stub.go +++ b/pkg/stub/v1beta1/stub.go @@ -584,6 +584,12 @@ func (stub *stub) register(ctx context.Context) error { // Handle a lost connection. func (stub *stub) connClosed() { + select { + // if our connection gets closed before we get Configure()'d, let Start() know + case stub.cfgErrC <- ttrpc.ErrClosed: + default: + } + stub.Lock() stub.close() stub.Unlock() @@ -628,7 +634,10 @@ func (stub *stub) Configure(ctx context.Context, req *api.ConfigureRequest) (rpl stub.requestTimeout = time.Duration(req.RequestTimeout * int64(time.Millisecond)) defer func() { - stub.cfgErrC <- retErr + select { + case stub.cfgErrC <- retErr: + default: + } }() if handler := stub.handlers.Configure; handler == nil { From 593f7f60a23edc94b6708c327373a316bf8ca0c5 Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Fri, 10 Oct 2025 17:59:04 +0300 Subject: [PATCH 13/20] adaptation: honor/apply request timeout to plugin configuration. Signed-off-by: Krisztian Litkey --- pkg/adaptation/plugin.go | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/pkg/adaptation/plugin.go b/pkg/adaptation/plugin.go index c7b5b2b8..cb92d4d7 100644 --- a/pkg/adaptation/plugin.go +++ b/pkg/adaptation/plugin.go @@ -325,11 +325,6 @@ func (p *plugin) start(name, version string) (err error) { // skip start for WASM and builtin plugins and head right to the registration for // events config if p.impl.isTtrpc() { - var ( - err error - timeout = getPluginRegistrationTimeout() - ) - go func() { err := p.rpcs.Serve(context.Background(), p.rpcl) if err != ttrpc.ErrServerClosed { @@ -341,21 +336,22 @@ func (p *plugin) start(name, version string) (err error) { p.mux.Unblock() select { - case err = <-p.regC: + case err := <-p.regC: if err != nil { p.delayedClose(shutdownDelay) return fmt.Errorf("failed to register plugin: %w", err) } case <-p.closeC: return fmt.Errorf("failed to register plugin, connection closed") - case <-time.After(timeout): + case <-time.After(getPluginRegistrationTimeout()): p.shutdown("plugin registration timed out") return errors.New("plugin registration timed out") } } - err = p.configure(context.Background(), name, version, p.cfg) - if err != nil { + ctx, cancel := context.WithTimeout(context.Background(), getPluginRequestTimeout()) + defer cancel() + if err := p.configure(ctx, name, version, p.cfg); err != nil { p.delayedClose(shutdownDelay) return err } From e78593c2d34a2b43ef7c75dbf10d59fc74ddcc45 Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Wed, 22 Oct 2025 09:32:26 +0300 Subject: [PATCH 14/20] api: add Event.Mask(). Add and use Event.Mask(). Signed-off-by: Krisztian Litkey --- pkg/api/v1alpha1/event.go | 11 ++++++++--- pkg/api/v1beta1/event.go | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/pkg/api/v1alpha1/event.go b/pkg/api/v1alpha1/event.go index ff492b1d..b3c73572 100644 --- a/pkg/api/v1alpha1/event.go +++ b/pkg/api/v1alpha1/event.go @@ -57,6 +57,11 @@ type ( // EventMask corresponds to a set of enumerated Events. type EventMask int32 +// Mask returns the EventMask for the given Event. +func (e Event) Mask() EventMask { + return EventMask(1 << (e - 1)) +} + // ParseEventMask parses a string representation into an EventMask. func ParseEventMask(events ...string) (EventMask, error) { var mask EventMask @@ -161,7 +166,7 @@ func (m *EventMask) PrettyString() string { // Set sets the given Events in the mask. func (m *EventMask) Set(events ...Event) *EventMask { for _, e := range events { - *m |= (1 << (e - 1)) + *m |= (e.Mask()) } return m } @@ -169,12 +174,12 @@ func (m *EventMask) Set(events ...Event) *EventMask { // Clear clears the given Events in the mask. func (m *EventMask) Clear(events ...Event) *EventMask { for _, e := range events { - *m &^= (1 << (e - 1)) + *m &^= (e.Mask()) } return m } // IsSet check if the given Event is set in the mask. func (m *EventMask) IsSet(e Event) bool { - return *m&(1<<(e-1)) != 0 + return *m&(e.Mask()) != 0 } diff --git a/pkg/api/v1beta1/event.go b/pkg/api/v1beta1/event.go index 6d4e607f..f68c4314 100644 --- a/pkg/api/v1beta1/event.go +++ b/pkg/api/v1beta1/event.go @@ -29,6 +29,11 @@ const ( // EventMask corresponds to a set of enumerated Events. type EventMask int32 +// Mask returns the EventMask for the given Event. +func (e Event) Mask() EventMask { + return EventMask(1 << (e - 1)) +} + // ParseEventMask parses a string representation into an EventMask. func ParseEventMask(events ...string) (EventMask, error) { var mask EventMask @@ -133,7 +138,7 @@ func (m *EventMask) PrettyString() string { // Set sets the given Events in the mask. func (m *EventMask) Set(events ...Event) *EventMask { for _, e := range events { - *m |= (1 << (e - 1)) + *m |= e.Mask() } return m } @@ -141,12 +146,12 @@ func (m *EventMask) Set(events ...Event) *EventMask { // Clear clears the given Events in the mask. func (m *EventMask) Clear(events ...Event) *EventMask { for _, e := range events { - *m &^= (1 << (e - 1)) + *m &^= e.Mask() } return m } // IsSet check if the given Event is set in the mask. func (m *EventMask) IsSet(e Event) bool { - return *m&(1<<(e-1)) != 0 + return *m&(e.Mask()) != 0 } From 59e96643077b48d61d8b2ac98b6bb169b04600e2 Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Sat, 4 Oct 2025 17:43:28 +0300 Subject: [PATCH 15/20] adaptation: rework adaptation tests. Rework adaptation test suite. Stop using gingko/gomega. Add support for v1beta1, v1alpha1, and builtin test plugins. Rewrite test cases using the new suite. Signed-off-by: Krisztian Litkey --- pkg/adaptation/adaptation_suite_test.go | 3253 ---------------------- pkg/adaptation/adaptation_test.go | 3397 +++++++++++++++++++++++ pkg/adaptation/suite_test.go | 2856 +++++++++++++++---- 3 files changed, 5654 insertions(+), 3852 deletions(-) delete mode 100644 pkg/adaptation/adaptation_suite_test.go create mode 100644 pkg/adaptation/adaptation_test.go diff --git a/pkg/adaptation/adaptation_suite_test.go b/pkg/adaptation/adaptation_suite_test.go deleted file mode 100644 index 04fb18b8..00000000 --- a/pkg/adaptation/adaptation_suite_test.go +++ /dev/null @@ -1,3253 +0,0 @@ -/* - 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 adaptation_test - -import ( - "context" - "fmt" - "os" - "path/filepath" - "slices" - "strconv" - "strings" - "time" - - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/testing/protocmp" - - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - - nri "github.com/containerd/nri/pkg/adaptation" - api "github.com/containerd/nri/pkg/api/v1beta1" - "github.com/containerd/nri/pkg/plugin" - validator "github.com/containerd/nri/plugins/default-validator/builtin" - rspec "github.com/opencontainers/runtime-spec/specs-go" -) - -var _ = Describe("Configuration", func() { - var ( - s = &Suite{} - ) - - AfterEach(func() { - s.Cleanup() - }) - - When("no (extra) options given", func() { - BeforeEach(func() { - s.Prepare(&mockRuntime{}, &mockPlugin{idx: "00", name: "test"}) - }) - - It("should allow startup", func() { - Expect(s.runtime.Start(s.dir)).To(Succeed()) - }) - - It("should allow external plugins to connect", func() { - var ( - runtime = s.runtime - plugin = s.plugins[0] - timeout = time.After(startupTimeout) - ) - Expect(runtime.Start(s.dir)).To(Succeed()) - Expect(plugin.Start(s.dir)).To(Succeed()) - Expect(plugin.Wait(PluginSynchronized, timeout)).To(Succeed()) - }) - }) - - When("external connections are explicitly disabled", func() { - var () - - BeforeEach(func() { - s.Prepare( - &mockRuntime{ - options: []nri.Option{ - nri.WithDisabledExternalConnections(), - }, - }, - &mockPlugin{idx: "00", name: "test"}, - ) - }) - - It("should prevent plugins from connecting", func() { - var ( - runtime = s.runtime - plugin = s.plugins[0] - ) - Expect(runtime.Start(s.dir)).To(Succeed()) - Expect(plugin.Start(s.dir)).ToNot(Succeed()) - }) - }) -}) - -var _ = Describe("Adaptation", func() { - When("SyncFn is nil", func() { - var ( - syncFn func(ctx context.Context, cb nri.SyncCB) error - updateFn = func(_ context.Context, _ []*nri.ContainerUpdate) ([]*nri.ContainerUpdate, error) { - return nil, nil - } - ) - - It("should prevent Adaptation creation with an error", func() { - var ( - dir = GinkgoT().TempDir() - etc = filepath.Join(dir, "etc", "nri") - ) - - Expect(os.MkdirAll(etc, 0o755)).To(Succeed()) - - r, err := nri.New("mockRuntime", "0.0.1", syncFn, updateFn, - nri.WithPluginPath(filepath.Join(dir, "opt", "nri", "plugins")), - nri.WithPluginConfigPath(filepath.Join(dir, "etc", "nri", "conf.d")), - nri.WithSocketPath(filepath.Join(dir, "nri.sock")), - ) - - Expect(r).To(BeNil()) - Expect(err).ToNot(BeNil()) - }) - }) - - When("UpdateFn is nil", func() { - var ( - updateFn func(ctx context.Context, updates []*nri.ContainerUpdate) ([]*nri.ContainerUpdate, error) - syncFn = func(_ context.Context, _ nri.SyncCB) error { - return nil - } - ) - - It("should prevent Adaptation creation with an error", func() { - var ( - dir = GinkgoT().TempDir() - etc = filepath.Join(dir, "etc", "nri") - ) - - Expect(os.MkdirAll(etc, 0o755)).To(Succeed()) - - r, err := nri.New("mockRuntime", "0.0.1", syncFn, updateFn, - nri.WithPluginPath(filepath.Join(dir, "opt", "nri", "plugins")), - nri.WithPluginConfigPath(filepath.Join(dir, "etc", "nri", "conf.d")), - nri.WithSocketPath(filepath.Join(dir, "nri.sock")), - ) - - Expect(r).To(BeNil()) - Expect(err).ToNot(BeNil()) - }) - }) -}) - -var _ = Describe("Plugin connection", func() { - var ( - s = &Suite{} - ) - - BeforeEach(func() { - s.Prepare( - &mockRuntime{ - pods: map[string]*api.PodSandbox{ - "pod0": { - Id: "pod0", - Name: "pod0", - Uid: "uid0", - Namespace: "default", - }, - "pod1": { - Id: "pod1", - Name: "pod1", - Uid: "uid1", - Namespace: "default", - }, - }, - ctrs: map[string]*api.Container{ - "ctr0": { - Id: "ctr0", - PodSandboxId: "pod0", - Name: "ctr0", - State: api.ContainerState_CONTAINER_CREATED, - }, - "ctr1": { - Id: "ctr1", - PodSandboxId: "pod1", - Name: "ctr1", - State: api.ContainerState_CONTAINER_CREATED, - }, - }, - }, - &mockPlugin{ - name: "test", - idx: "00", - }, - ) - }) - - AfterEach(func() { - s.Cleanup() - }) - - It("should configure the plugin", func() { - var ( - plugin = s.plugins[0] - ) - - s.Startup() - - Expect(plugin.Events()).Should( - ContainElement( - PluginConfigured, - ), - ) - }) - - It("should synchronize the plugin after configuration", func() { - var ( - runtime = s.runtime - plugin = s.plugins[0] - ) - - s.Startup() - - Expect(plugin.Events()).Should( - ConsistOf( - PluginConfigured, - PluginSynchronized, - ), - ) - - Expect(protoEqual(plugin.pods["pod0"], runtime.pods["pod0"])).Should(BeTrue(), - protoDiff(plugin.pods["pod0"], runtime.pods["pod0"])) - Expect(protoEqual(plugin.pods["pod1"], runtime.pods["pod1"])).Should(BeTrue(), - protoDiff(plugin.pods["pod1"], runtime.pods["pod1"])) - Expect(protoEqual(plugin.ctrs["ctr0"], runtime.ctrs["ctr0"])).Should(BeTrue(), - protoDiff(plugin.ctrs["ctr0"], runtime.ctrs["ctr0"])) - Expect(protoEqual(plugin.ctrs["ctr1"], runtime.ctrs["ctr1"])).Should(BeTrue(), - protoDiff(plugin.ctrs["ctr1"], runtime.ctrs["ctr1"])) - }) -}) - -var _ = Describe("Pod and container requests and events", func() { - var ( - s = &Suite{} - ) - - AfterEach(func() { - s.Cleanup() - }) - - When("there are no plugins", func() { - BeforeEach(func() { - s.Prepare(&mockRuntime{}) - }) - - It("should always succeed", func() { - var ( - ctx = context.Background() - pod0 = &api.PodSandbox{ - Id: "pod0", - Name: "pod0", - Uid: "uid0", - Namespace: "default", - } - pod1 = &api.PodSandbox{ - Id: "pod1", - Name: "pod1", - Uid: "uid1", - Namespace: "default", - } - ctr0 = &api.Container{ - Id: "ctr0", - PodSandboxId: "pod0", - Name: "ctr0", - State: api.ContainerState_CONTAINER_CREATED, // XXX FIXME-kludge - } - ctr1 = &api.Container{ - Id: "ctr1", - PodSandboxId: "pod1", - Name: "ctr1", - State: api.ContainerState_CONTAINER_CREATED, // XXXX FIXME-kludge - } - ) - - s.Startup() - - Expect(s.runtime.startStopPodAndContainer(ctx, pod0, ctr0)).To(Succeed()) - Expect(s.runtime.startStopPodAndContainer(ctx, pod1, ctr1)).To(Succeed()) - }) - }) - - When("when there are plugins", func() { - BeforeEach(func() { - s.Prepare(&mockRuntime{}, &mockPlugin{idx: "00", name: "test"}) - }) - - DescribeTable("should honor plugins' event subscriptions", - func(subscriptions ...string) { - var ( - runtime = s.runtime - plugin = s.plugins[0] - ctx = context.Background() - - pod = &api.PodSandbox{ - Id: "pod0", - Name: "pod0", - Uid: "uid0", - Namespace: "default", - } - ctr = &api.Container{ - Id: "ctr0", - PodSandboxId: "pod0", - Name: "ctr0", - State: api.ContainerState_CONTAINER_CREATED, // XXX FIXME-kludge - } - ) - - plugin.mask = api.MustParseEventMask(subscriptions...) - - s.Startup() - - Expect(runtime.startStopPodAndContainer(ctx, pod, ctr)).To(Succeed()) - for _, events := range subscriptions { - for _, event := range strings.Split(events, ",") { - match := &Event{Type: EventType(event)} - Expect(plugin.EventQ().Has(match)).To(BeTrue()) - } - } - }, - Entry("with RunPodSandbox", "RunPodSandbox"), - Entry("with UpdatePodSandbox", "UpdatePodSandbox"), - Entry("with PostUpdatePodSandbox", "PostUpdatePodSandbox"), - Entry("with StopPodSandbox", "StopPodSandbox"), - Entry("with RemovePodSandbox", "RemovePodSandbox"), - - Entry("with CreateContainer", "CreateContainer"), - Entry("with PostCreateContainer", "PostCreateContainer"), - Entry("with StartContainer", "StartContainer"), - Entry("with PostStartContainer", "PostStartContainer"), - Entry("with UpdateContainer", "UpdateContainer"), - Entry("with PostUpdateContainer", "PostUpdateContainer"), - Entry("with StopContainer", "StopContainer"), - Entry("with RemoveContainer", "RemoveContainer"), - - Entry("with all pod events", "RunPodSandbox,StopPodSandbox,RemovePodSandbox"), - Entry("with all container requests", "CreateContainer,UpdateContainer,StopContainer"), - Entry("with all container requests and events", - "CreateContainer,PostCreateContainer", - "StartContainer,PostStartContainer", - "UpdateContainer,PostUpdateContainer", - "StopContainer", - "RemoveContainer", - ), - Entry("with all pod and container requests and events", - "RunPodSandbox,UpdatePodSandbox,PostUpdatePodSandbox,StopPodSandbox,RemovePodSandbox", - "CreateContainer,PostCreateContainer", - "StartContainer,PostStartContainer", - "UpdateContainer,PostUpdateContainer", - "StopContainer", - "RemoveContainer", - ), - ) - }) - - When("when there are multiple plugins", func() { - BeforeEach(func() { - s.Prepare( - &mockRuntime{}, - &mockPlugin{idx: "20", name: "test"}, - &mockPlugin{idx: "99", name: "foo"}, - &mockPlugin{idx: "00", name: "bar"}, - ) - - }) - - DescribeTable("should honor plugins' event subscriptions", - func(subscriptions ...string) { - var ( - runtime = s.runtime - plugins = s.plugins - ctx = context.Background() - - pod = &api.PodSandbox{ - Id: "pod0", - Name: "pod0", - Uid: "uid0", - Namespace: "default", - } - ctr = &api.Container{ - Id: "ctr0", - PodSandboxId: "pod0", - Name: "ctr0", - State: api.ContainerState_CONTAINER_CREATED, // XXX FIXME-kludge - } - - order []*mockPlugin - recordOrder = func(p *mockPlugin, _ *api.PodSandbox, _ *api.Container) error { - order = append(order, p) - return nil - } - ) - - for _, p := range plugins { - p.mask = api.MustParseEventMask(subscriptions...) - p.startContainer = recordOrder - } - - s.Startup() - - Expect(runtime.startStopPodAndContainer(ctx, pod, ctr)).To(Succeed()) - Expect(order).Should( - ConsistOf( - plugins[2], - plugins[0], - plugins[1], - ), - ) - }, - - Entry("with StartContainer", "StartContainer"), - Entry("with all container CRI requests", - "CreateContainer,StartContainer,UpdateContainer,StopContainer,RemoveContainer"), - Entry("with all container requests and events", - "CreateContainer,PostCreateContainer", - "StartContainer,PostStartContainer", - "UpdateContainer,PostUpdateContainer", - "StopContainer", - "RemoveContainer", - ), - Entry("with all pod and container requests and events", - "RunPodSandbox,UpdatePodSandbox,PostUpdatePodSandbox,StopPodSandbox,RemovePodSandbox", - "CreateContainer,PostCreateContainer", - "StartContainer,PostStartContainer", - "UpdateContainer,PostUpdateContainer", - "StopContainer", - "RemoveContainer", - ), - ) - }) -}) - -var _ = Describe("Plugin container creation adjustments", func() { - var ( - s = &Suite{} - ) - - adjust := func(subject string, p *mockPlugin, _ *api.PodSandbox, c *api.Container, overwrite bool) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) { - plugin := p.idx + "-" + p.name - a := &api.ContainerAdjustment{} - switch subject { - case "annotation": - if overwrite { - a.RemoveAnnotation("key") - } - a.AddAnnotation("key", plugin) - - case "mount": - mnt := &api.Mount{ - Source: "/dev/" + plugin, - Destination: "/mnt/test", - } - if overwrite { - a.RemoveMount(mnt.Destination) - } - a.AddMount(mnt) - - case "remove mount": - a.RemoveMount("/remove/test/destination") - - case "environment": - if overwrite { - a.RemoveEnv("key") - } - a.AddEnv("key", plugin) - - case "arguments": - if !overwrite { - a.SetArgs([]string{"echo", "updated", "argument", "list"}) - } else { - a.UpdateArgs(append(slices.Clone(c.Args), "twice...")) - } - - case "hooks": - a.AddHooks( - &api.Hooks{ - Prestart: []*api.Hook{ - { - Path: "/bin/" + plugin, - }, - }, - }, - ) - - case "device": - idx, _ := strconv.ParseInt(p.idx, 10, 64) - dev := &api.LinuxDevice{ - Path: "/dev/test", - Type: "c", - Major: 313, - Minor: 100 + idx, - } - if overwrite { - a.RemoveDevice(dev.Path) - } - a.AddDevice(dev) - - case "namespace": - ns := &api.LinuxNamespace{ - Type: "cgroup", - } - a.AddOrReplaceNamespace(ns) - - case "rlimit": - a.AddRlimit("nofile", 456, 123) - - case "CDI-device": - a.AddCDIDevice( - &api.CDIDevice{ - Name: "vendor0.com/dev=dev0", - }, - ) - - case "I/O priority": - a.SetLinuxIOPriority(&nri.LinuxIOPriority{ - Class: api.IOPrioClass_IOPRIO_CLASS_RT, - Priority: 5, - }) - - case "clear I/O priority": - a.SetLinuxIOPriority(&nri.LinuxIOPriority{ - Class: api.IOPrioClass_IOPRIO_CLASS_NONE, - }) - - case "resources/cpu": - a.SetLinuxCPUShares(123) - a.SetLinuxCPUQuota(456) - a.SetLinuxCPUPeriod(789) - a.SetLinuxCPURealtimeRuntime(321) - a.SetLinuxCPURealtimePeriod(654) - a.SetLinuxCPUSetCPUs("0-1") - a.SetLinuxCPUSetMems("2-3") - - case "resources/mem": - a.SetLinuxMemoryLimit(1234000) - a.SetLinuxMemoryReservation(4000) - a.SetLinuxMemorySwap(34000) - a.SetLinuxMemoryKernel(30000) - a.SetLinuxMemoryKernelTCP(2000) - a.SetLinuxMemorySwappiness(987) - a.SetLinuxMemoryDisableOomKiller() - a.SetLinuxMemoryUseHierarchy() - - case "resources/classes": - a.SetLinuxRDTClass(plugin) - a.SetLinuxBlockIOClass(plugin) - - case "resources/hugepagelimits": - a.AddLinuxHugepageLimit("1M", 4096) - a.AddLinuxHugepageLimit("4M", 1024) - - case "resources/unified": - a.AddLinuxUnified("resource.1", "value1") - a.AddLinuxUnified("resource.2", "value2") - - case "cgroupspath": - a.SetLinuxCgroupsPath("/" + plugin) - - case "seccomp": - a.SetLinuxSeccompPolicy( - func() *api.LinuxSeccomp { - seccomp := rspec.LinuxSeccomp{ - DefaultAction: rspec.ActAllow, - ListenerPath: "/run/meshuggah-rocks.sock", - Architectures: []rspec.Arch{}, - Flags: []rspec.LinuxSeccompFlag{}, - Syscalls: []rspec.LinuxSyscall{{ - Names: []string{"sched_getaffinity"}, - Action: rspec.ActNotify, - Args: []rspec.LinuxSeccompArg{}, - }}, - } - return api.FromOCILinuxSeccomp(&seccomp) - }(), - ) - } - - return a, nil, nil - } - - AfterEach(func() { - s.Cleanup() - }) - - When("there is a single plugin", func() { - BeforeEach(func() { - s.Prepare(&mockRuntime{}, &mockPlugin{idx: "00", name: "test"}) - }) - - DescribeTable("should be successfully collected without conflicts", - func(subject string, expected *api.ContainerAdjustment) { - var ( - runtime = s.runtime - plugin = s.plugins[0] - ctx = context.Background() - - pod = &api.PodSandbox{ - Id: "pod0", - Name: "pod0", - Uid: "uid0", - Namespace: "default", - } - ctr = &api.Container{ - Id: "ctr0", - PodSandboxId: "pod0", - Name: "ctr0", - State: api.ContainerState_CONTAINER_CREATED, // XXX FIXME-kludge - Mounts: []*api.Mount{ - { - Type: "bind", - Source: "/remove/test", - Destination: "/remove/test/destination", - }, - }, - Args: []string{ - "echo", - "original", - "argument", - "list", - }, - Linux: &api.LinuxContainer{ - Resources: &api.LinuxResources{ - Cpu: &api.LinuxCPU{ - Shares: api.UInt64(111), - Quota: api.Int64(222), - Period: api.UInt64(333), - RealtimeRuntime: api.Int64(444), - RealtimePeriod: api.UInt64(555), - }, - Memory: &api.LinuxMemory{ - Limit: api.Int64(11111), - Reservation: api.Int64(22222), - Swap: api.Int64(33333), - Swappiness: api.UInt64(44444), - DisableOomKiller: api.Bool(false), - UseHierarchy: api.Bool(false), - }, - }, - }, - } - ) - - create := func(p *mockPlugin, pod *api.PodSandbox, ctr *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) { - return adjust(subject, p, pod, ctr, false) - } - - plugin.createContainer = create - - s.Startup() - - podReq := &api.RunPodSandboxRequest{Pod: pod} - Expect(runtime.RunPodSandbox(ctx, podReq)).To(Succeed()) - ctrReq := &api.CreateContainerRequest{ - Pod: pod, - Container: ctr, - } - reply, err := runtime.CreateContainer(ctx, ctrReq) - Expect(err).To(BeNil()) - Expect(protoEqual(reply.Adjust.Strip(), expected.Strip())).Should(BeTrue(), - protoDiff(reply.Adjust, expected)) - }, - - Entry("adjust annotations", "annotation", - &api.ContainerAdjustment{ - Annotations: map[string]string{ - "key": "00-test", - }, - }, - ), - Entry("adjust mounts", "mount", - &api.ContainerAdjustment{ - Mounts: []*api.Mount{ - { - Source: "/dev/00-test", - Destination: "/mnt/test", - }, - }, - }, - ), - Entry("remove a mount", "remove mount", - &api.ContainerAdjustment{ - Mounts: []*api.Mount{ - { - Destination: api.MarkForRemoval("/remove/test/destination"), - }, - }, - }, - ), - Entry("adjust environment", "environment", - &api.ContainerAdjustment{ - Env: []*api.KeyValue{ - { - Key: "key", - Value: "00-test", - }, - }, - }, - ), - Entry("adjust arguments", "arguments", - &api.ContainerAdjustment{ - Args: []string{ - "echo", - "updated", - "argument", - "list", - }, - }, - ), - Entry("adjust hooks", "hooks", - &api.ContainerAdjustment{ - Hooks: &api.Hooks{ - Prestart: []*api.Hook{ - { - Path: "/bin/00-test", - }, - }, - }, - }, - ), - Entry("adjust devices", "device", - &api.ContainerAdjustment{ - Linux: &api.LinuxContainerAdjustment{ - Devices: []*api.LinuxDevice{ - { - Path: "/dev/test", - Type: "c", - Major: 313, - Minor: 100, - }, - }, - }, - }, - ), - Entry("adjust namespace", "namespace", - &api.ContainerAdjustment{ - Linux: &api.LinuxContainerAdjustment{ - Namespaces: []*api.LinuxNamespace{ - { - Type: "cgroup", - }, - }, - }, - }, - ), - Entry("adjust rlimits", "rlimit", - &api.ContainerAdjustment{ - Rlimits: []*api.POSIXRlimit{{Type: "nofile", Soft: 123, Hard: 456}}, - }, - ), - Entry("adjust CDI Devices", "CDI-device", - &api.ContainerAdjustment{ - CDIDevices: []*api.CDIDevice{ - { - Name: "vendor0.com/dev=dev0", - }, - }, - }, - ), - - Entry("adjust I/O priority", "I/O priority", - &api.ContainerAdjustment{ - Linux: &api.LinuxContainerAdjustment{ - IoPriority: &api.LinuxIOPriority{ - Class: api.IOPrioClass_IOPRIO_CLASS_RT, - Priority: 5, - }, - }, - }, - ), - Entry("clear I/O priority", "clear I/O priority", - &api.ContainerAdjustment{ - Linux: &api.LinuxContainerAdjustment{ - IoPriority: &api.LinuxIOPriority{}, - }, - }, - ), - - Entry("adjust CPU resources", "resources/cpu", - &api.ContainerAdjustment{ - Linux: &api.LinuxContainerAdjustment{ - Resources: &api.LinuxResources{ - Cpu: &api.LinuxCPU{ - Shares: api.UInt64(123), - Quota: api.Int64(456), - Period: api.UInt64(789), - RealtimeRuntime: api.Int64(321), - RealtimePeriod: api.UInt64(654), - Cpus: "0-1", - Mems: "2-3", - }, - }, - }, - }, - ), - Entry("adjust memory resources", "resources/mem", - &api.ContainerAdjustment{ - Linux: &api.LinuxContainerAdjustment{ - Resources: &api.LinuxResources{ - Memory: &api.LinuxMemory{ - Limit: api.Int64(1234000), - Reservation: api.Int64(4000), - Swap: api.Int64(34000), - Kernel: api.Int64(30000), - KernelTcp: api.Int64(2000), - Swappiness: api.UInt64(987), - DisableOomKiller: api.Bool(true), - UseHierarchy: api.Bool(true), - }, - }, - }, - }, - ), - Entry("adjust class-based resources", "resources/classes", - &api.ContainerAdjustment{ - Linux: &api.LinuxContainerAdjustment{ - Resources: &api.LinuxResources{ - RdtClass: api.String("00-test"), - BlockioClass: api.String("00-test"), - }, - }, - }, - ), - Entry("adjust hugepage limits", "resources/hugepagelimits", - &api.ContainerAdjustment{ - Linux: &api.LinuxContainerAdjustment{ - Resources: &api.LinuxResources{ - HugepageLimits: []*api.HugepageLimit{ - { - PageSize: "1M", - Limit: 4096, - }, - { - PageSize: "4M", - Limit: 1024, - }, - }, - }, - }, - }, - ), - Entry("adjust cgroupv2 unified resources", "resources/unified", - &api.ContainerAdjustment{ - Linux: &api.LinuxContainerAdjustment{ - Resources: &api.LinuxResources{ - Unified: map[string]string{ - "resource.1": "value1", - "resource.2": "value2", - }, - }, - }, - }, - ), - Entry("adjust cgroups path", "cgroupspath", - &api.ContainerAdjustment{ - Linux: &api.LinuxContainerAdjustment{ - CgroupsPath: "/00-test", - }, - }, - ), - Entry("adjust seccomp policy", "seccomp", - &api.ContainerAdjustment{ - Linux: &api.LinuxContainerAdjustment{ - SeccompPolicy: func() *api.LinuxSeccomp { - seccomp := rspec.LinuxSeccomp{ - DefaultAction: rspec.ActAllow, - ListenerPath: "/run/meshuggah-rocks.sock", - Architectures: []rspec.Arch{}, - Flags: []rspec.LinuxSeccompFlag{}, - Syscalls: []rspec.LinuxSyscall{{ - Names: []string{"sched_getaffinity"}, - Action: rspec.ActNotify, - Args: []rspec.LinuxSeccompArg{}, - }}, - } - return api.FromOCILinuxSeccomp(&seccomp) - }(), - }, - }, - ), - ) - }) - - When("there are multiple plugins", func() { - BeforeEach(func() { - s.Prepare( - &mockRuntime{}, - &mockPlugin{idx: "10", name: "foo"}, - &mockPlugin{idx: "00", name: "bar"}, - ) - }) - - DescribeTable("should be successfully combined if there are no conflicts", - func(subject string, remove, shouldFail bool, expected *api.ContainerAdjustment) { - var ( - runtime = s.runtime - plugins = s.plugins - ctx = context.Background() - - pod = &api.PodSandbox{ - Id: "pod0", - Name: "pod0", - Uid: "uid0", - Namespace: "default", - } - ctr = &api.Container{ - Id: "ctr0", - PodSandboxId: "pod0", - Name: "ctr0", - State: api.ContainerState_CONTAINER_CREATED, // XXX FIXME-kludge - Args: []string{ - "echo", - "original", - "argument", - "list", - }, - Linux: &api.LinuxContainer{ - Resources: &api.LinuxResources{ - Cpu: &api.LinuxCPU{ - Shares: api.UInt64(111), - Quota: api.Int64(222), - Period: api.UInt64(333), - RealtimeRuntime: api.Int64(444), - RealtimePeriod: api.UInt64(555), - }, - Memory: &api.LinuxMemory{ - Limit: api.Int64(11111), - Reservation: api.Int64(22222), - Swap: api.Int64(33333), - Swappiness: api.UInt64(44444), - DisableOomKiller: api.Bool(false), - UseHierarchy: api.Bool(false), - }, - }, - }, - } - ) - - create := func(p *mockPlugin, pod *api.PodSandbox, ctr *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) { - return adjust(subject, p, pod, ctr, p == plugins[0] && remove) - } - - plugins[0].createContainer = create - plugins[1].createContainer = create - - s.Startup() - - podReq := &api.RunPodSandboxRequest{Pod: pod} - Expect(runtime.RunPodSandbox(ctx, podReq)).To(Succeed()) - ctrReq := &api.CreateContainerRequest{ - Pod: pod, - Container: ctr, - } - reply, err := runtime.CreateContainer(ctx, ctrReq) - if shouldFail { - Expect(err).ToNot(BeNil()) - } else { - Expect(err).To(BeNil()) - Expect(protoEqual(reply.Adjust.Strip(), expected.Strip())).Should(BeTrue(), - protoDiff(reply.Adjust, expected)) - } - }, - - Entry("adjust annotations (conflicts)", "annotation", false, true, nil), - Entry("adjust annotations", "annotation", true, false, - &api.ContainerAdjustment{ - Annotations: map[string]string{ - "-key": "", - "key": "10-foo", - }, - }, - ), - Entry("adjust mounts (conflicts)", "mount", false, true, nil), - Entry("adjust mounts", "mount", true, false, - &api.ContainerAdjustment{ - Mounts: []*api.Mount{ - { - Source: "/dev/10-foo", - Destination: "/mnt/test", - }, - }, - }, - ), - Entry("adjust environment (conflicts)", "environment", false, true, nil), - Entry("adjust environment", "environment", true, false, - &api.ContainerAdjustment{ - Env: []*api.KeyValue{ - { - Key: "key", - Value: "10-foo", - }, - }, - }, - ), - - Entry("adjust arguments (conflicts)", "arguments", false, true, nil), - Entry("adjust arguments", "arguments", true, false, - &api.ContainerAdjustment{ - Args: []string{ - "echo", - "updated", - "argument", - "list", - "twice...", - }, - }, - ), - - Entry("adjust hooks", "hooks", false, false, - &api.ContainerAdjustment{ - Hooks: &api.Hooks{ - Prestart: []*api.Hook{ - { - Path: "/bin/00-bar", - }, - { - Path: "/bin/10-foo", - }, - }, - }, - }, - ), - Entry("adjust devices", "device", false, true, nil), - Entry("adjust devices", "device", true, false, - &api.ContainerAdjustment{ - Linux: &api.LinuxContainerAdjustment{ - Devices: []*api.LinuxDevice{ - { - Path: "/dev/test", - Type: "c", - Major: 313, - Minor: 110, - }, - }, - }, - }, - ), - Entry("adjust resources", "resources/classes", false, true, nil), - Entry("adjust I/O priority (conflicts)", "I/O priority", false, true, nil), - ) - }) - - When("there are validating plugins", func() { - BeforeEach(func() { - s.Prepare( - &mockRuntime{}, - &mockPlugin{idx: "00", name: "foo"}, - &mockPlugin{idx: "00", name: "validator"}, - ) - }) - - DescribeTable("validation result should be honored", - func(subject string, shouldFail bool, expected *api.ContainerAdjustment) { - var ( - runtime = s.runtime - plugins = s.plugins - ctx = context.Background() - - pod = &api.PodSandbox{ - Id: "pod0", - Name: "pod0", - Uid: "uid0", - Namespace: "default", - } - ctr = &api.Container{ - Id: "ctr0", - PodSandboxId: "pod0", - Name: "ctr0", - State: api.ContainerState_CONTAINER_CREATED, // XXX FIXME-kludge - Args: []string{ - "echo", - "original", - "argument", - "list", - }, - } - - forbidden = "no-no" - ) - - create := func(p *mockPlugin, _ *api.PodSandbox, _ *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) { - plugin := p.idx + "-" + p.name - a := &api.ContainerAdjustment{} - switch subject { - case "annotation": - key := "key" - if shouldFail { - key = forbidden - } - a.AddAnnotation(key, plugin) - } - - return a, nil, nil - } - - validate := func(_ *mockPlugin, req *api.ValidateContainerAdjustmentRequest) error { - _, ok := req.Owners.AnnotationOwner(req.Container.Id, forbidden) - if ok { - return fmt.Errorf("forbidden annotation %q adjusted", forbidden) - } - return nil - } - - plugins[0].createContainer = create - plugins[1].validateAdjustment = validate - s.Startup() - - podReq := &api.RunPodSandboxRequest{Pod: pod} - Expect(runtime.RunPodSandbox(ctx, podReq)).To(Succeed()) - ctrReq := &api.CreateContainerRequest{ - Pod: pod, - Container: ctr, - } - reply, err := runtime.CreateContainer(ctx, ctrReq) - if shouldFail { - Expect(err).ToNot(BeNil()) - } else { - Expect(err).To(BeNil()) - Expect(protoEqual(reply.Adjust.Strip(), expected.Strip())).Should(BeTrue(), - protoDiff(reply.Adjust, expected)) - } - }, - - Entry("adjust allowed annotation", "annotation", false, - &api.ContainerAdjustment{ - Annotations: map[string]string{ - "key": "00-foo", - }, - }, - ), - - Entry("adjust forbidden annotation", "annotation", true, nil), - ) - }) - - When("the default validator is enabled and OCI Hook injection is disabled", func() { - BeforeEach(func() { - s.Prepare( - &mockRuntime{ - options: []nri.Option{ - nri.WithDefaultValidator( - &validator.DefaultValidatorConfig{ - Enable: true, - RejectOCIHookAdjustment: true, - }, - ), - }, - }, - &mockPlugin{idx: "00", name: "foo"}, - &mockPlugin{idx: "10", name: "validator1"}, - &mockPlugin{idx: "20", name: "validator2"}, - ) - }) - - It("should reject OCI Hook injection", func() { - var ( - create = func(_ *mockPlugin, _ *api.PodSandbox, ctr *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) { - a := &api.ContainerAdjustment{} - if ctr.GetName() == "ctr1" { - a.AddHooks( - &api.Hooks{ - Prestart: []*api.Hook{ - { - Path: "/bin/sh", - Args: []string{"/bin/sh", "-c", "true"}, - }, - }, - }, - ) - } - - return a, nil, nil - } - - validate = func(_ *mockPlugin, _ *api.ValidateContainerAdjustmentRequest) error { - return nil - } - - runtime = s.runtime - plugins = s.plugins - ctx = context.Background() - - pod = &api.PodSandbox{ - Id: "pod0", - Name: "pod0", - Uid: "uid0", - Namespace: "default", - } - ctr0 = &api.Container{ - Id: "ctr0", - PodSandboxId: "pod0", - Name: "ctr0", - State: api.ContainerState_CONTAINER_CREATED, - } - ctr1 = &api.Container{ - Id: "ctr1", - PodSandboxId: "pod0", - Name: "ctr1", - State: api.ContainerState_CONTAINER_CREATED, - } - ) - - plugins[0].createContainer = create - plugins[1].validateAdjustment = validate - plugins[2].validateAdjustment = validate - - s.Startup() - podReq := &api.RunPodSandboxRequest{Pod: pod} - Expect(runtime.RunPodSandbox(ctx, podReq)).To(Succeed()) - - ctrReq := &api.CreateContainerRequest{ - Pod: pod, - Container: ctr0, - } - reply, err := runtime.CreateContainer(ctx, ctrReq) - Expect(reply).ToNot(BeNil()) - Expect(err).To(BeNil()) - - ctrReq = &api.CreateContainerRequest{ - Pod: pod, - Container: ctr1, - } - reply, err = runtime.CreateContainer(ctx, ctrReq) - Expect(err).ToNot(BeNil()) - Expect(reply).To(BeNil()) - }) - }) - - When("default validator disallows runtime default seccomp policy adjustment", func() { - BeforeEach(func() { - s.Prepare( - &mockRuntime{ - options: []nri.Option{ - nri.WithDefaultValidator( - &validator.DefaultValidatorConfig{ - Enable: true, - RejectRuntimeDefaultSeccompAdjustment: true, - }, - ), - }, - }, - &mockPlugin{idx: "00", name: "foo"}, - &mockPlugin{idx: "10", name: "validator1"}, - &mockPlugin{idx: "20", name: "validator2"}, - ) - }) - - It("should reject runtime default seccomp policy adjustment", func() { - var ( - create = func(_ *mockPlugin, _ *api.PodSandbox, ctr *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) { - a := &api.ContainerAdjustment{} - if ctr.GetName() == "ctr1" { - a.SetLinuxSeccompPolicy( - func() *api.LinuxSeccomp { - seccomp := rspec.LinuxSeccomp{ - DefaultAction: rspec.ActAllow, - ListenerPath: "/run/meshuggah-rocks.sock", - Architectures: []rspec.Arch{}, - Flags: []rspec.LinuxSeccompFlag{}, - Syscalls: []rspec.LinuxSyscall{{ - Names: []string{"sched_getaffinity"}, - Action: rspec.ActNotify, - Args: []rspec.LinuxSeccompArg{}, - }}, - } - return api.FromOCILinuxSeccomp(&seccomp) - }(), - ) - } - return a, nil, nil - } - - validate = func(_ *mockPlugin, _ *api.ValidateContainerAdjustmentRequest) error { - return nil - } - - runtime = s.runtime - plugins = s.plugins - ctx = context.Background() - - pod = &api.PodSandbox{ - Id: "pod0", - Name: "pod0", - Uid: "uid0", - Namespace: "default", - } - ctr0 = &api.Container{ - Id: "ctr0", - PodSandboxId: "pod0", - Name: "ctr0", - State: api.ContainerState_CONTAINER_CREATED, - } - ctr1 = &api.Container{ - Id: "ctr1", - PodSandboxId: "pod0", - Name: "ctr1", - State: api.ContainerState_CONTAINER_CREATED, - Linux: &api.LinuxContainer{ - SeccompProfile: &api.SecurityProfile{ - ProfileType: api.SecurityProfile_RUNTIME_DEFAULT, - }, - }, - } - ) - - plugins[0].createContainer = create - plugins[1].validateAdjustment = validate - plugins[2].validateAdjustment = validate - - s.Startup() - podReq := &api.RunPodSandboxRequest{Pod: pod} - Expect(runtime.RunPodSandbox(ctx, podReq)).To(Succeed()) - - ctrReq := &api.CreateContainerRequest{ - Pod: pod, - Container: ctr0, - } - reply, err := runtime.CreateContainer(ctx, ctrReq) - Expect(reply).ToNot(BeNil()) - Expect(err).To(BeNil()) - - ctrReq = &api.CreateContainerRequest{ - Pod: pod, - Container: ctr1, - } - reply, err = runtime.CreateContainer(ctx, ctrReq) - Expect(err).ToNot(BeNil()) - Expect(reply).To(BeNil()) - }) - }) - - When("default validator allows runtime default seccomp policy adjustment", func() { - BeforeEach(func() { - s.Prepare( - &mockRuntime{ - options: []nri.Option{ - nri.WithDefaultValidator( - &validator.DefaultValidatorConfig{ - Enable: true, - RejectRuntimeDefaultSeccompAdjustment: false, - }, - ), - }, - }, - &mockPlugin{idx: "00", name: "foo"}, - &mockPlugin{idx: "10", name: "validator1"}, - &mockPlugin{idx: "20", name: "validator2"}, - ) - }) - - It("should not reject runtime default seccomp policy adjustment", func() { - var ( - create = func(_ *mockPlugin, _ *api.PodSandbox, ctr *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) { - a := &api.ContainerAdjustment{} - if ctr.GetName() == "ctr1" { - a.SetLinuxSeccompPolicy( - func() *api.LinuxSeccomp { - seccomp := rspec.LinuxSeccomp{ - DefaultAction: rspec.ActAllow, - ListenerPath: "/run/meshuggah-rocks.sock", - Architectures: []rspec.Arch{}, - Flags: []rspec.LinuxSeccompFlag{}, - Syscalls: []rspec.LinuxSyscall{{ - Names: []string{"sched_getaffinity"}, - Action: rspec.ActNotify, - Args: []rspec.LinuxSeccompArg{}, - }}, - } - return api.FromOCILinuxSeccomp(&seccomp) - }(), - ) - } - return a, nil, nil - } - - validate = func(_ *mockPlugin, _ *api.ValidateContainerAdjustmentRequest) error { - return nil - } - - runtime = s.runtime - plugins = s.plugins - ctx = context.Background() - - pod = &api.PodSandbox{ - Id: "pod0", - Name: "pod0", - Uid: "uid0", - Namespace: "default", - } - ctr0 = &api.Container{ - Id: "ctr0", - PodSandboxId: "pod0", - Name: "ctr0", - State: api.ContainerState_CONTAINER_CREATED, - } - ctr1 = &api.Container{ - Id: "ctr1", - PodSandboxId: "pod0", - Name: "ctr1", - State: api.ContainerState_CONTAINER_CREATED, - Linux: &api.LinuxContainer{ - SeccompProfile: &api.SecurityProfile{ - ProfileType: api.SecurityProfile_RUNTIME_DEFAULT, - }, - }, - } - ) - - plugins[0].createContainer = create - plugins[1].validateAdjustment = validate - plugins[2].validateAdjustment = validate - - s.Startup() - podReq := &api.RunPodSandboxRequest{Pod: pod} - Expect(runtime.RunPodSandbox(ctx, podReq)).To(Succeed()) - - ctrReq := &api.CreateContainerRequest{ - Pod: pod, - Container: ctr0, - } - reply, err := runtime.CreateContainer(ctx, ctrReq) - Expect(reply).ToNot(BeNil()) - Expect(err).To(BeNil()) - - ctrReq = &api.CreateContainerRequest{ - Pod: pod, - Container: ctr1, - } - reply, err = runtime.CreateContainer(ctx, ctrReq) - Expect(reply).ToNot(BeNil()) - Expect(err).To(BeNil()) - }) - }) - - When("default validator disallows custom seccomp policy adjustment", func() { - BeforeEach(func() { - s.Prepare( - &mockRuntime{ - options: []nri.Option{ - nri.WithDefaultValidator( - &validator.DefaultValidatorConfig{ - Enable: true, - RejectCustomSeccompAdjustment: true, - }, - ), - }, - }, - &mockPlugin{idx: "00", name: "foo"}, - &mockPlugin{idx: "10", name: "validator1"}, - &mockPlugin{idx: "20", name: "validator2"}, - ) - }) - - It("should reject custom seccomp policy adjustment", func() { - var ( - create = func(_ *mockPlugin, _ *api.PodSandbox, ctr *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) { - a := &api.ContainerAdjustment{} - if ctr.GetName() == "ctr1" { - a.SetLinuxSeccompPolicy( - func() *api.LinuxSeccomp { - seccomp := rspec.LinuxSeccomp{ - DefaultAction: rspec.ActAllow, - ListenerPath: "/run/meshuggah-rocks.sock", - Architectures: []rspec.Arch{}, - Flags: []rspec.LinuxSeccompFlag{}, - Syscalls: []rspec.LinuxSyscall{{ - Names: []string{"sched_getaffinity"}, - Action: rspec.ActNotify, - Args: []rspec.LinuxSeccompArg{}, - }}, - } - return api.FromOCILinuxSeccomp(&seccomp) - }(), - ) - } - return a, nil, nil - } - - validate = func(_ *mockPlugin, _ *api.ValidateContainerAdjustmentRequest) error { - return nil - } - - runtime = s.runtime - plugins = s.plugins - ctx = context.Background() - - pod = &api.PodSandbox{ - Id: "pod0", - Name: "pod0", - Uid: "uid0", - Namespace: "default", - } - ctr0 = &api.Container{ - Id: "ctr0", - PodSandboxId: "pod0", - Name: "ctr0", - State: api.ContainerState_CONTAINER_CREATED, - } - ctr1 = &api.Container{ - Id: "ctr1", - PodSandboxId: "pod0", - Name: "ctr1", - State: api.ContainerState_CONTAINER_CREATED, - Linux: &api.LinuxContainer{ - SeccompProfile: &api.SecurityProfile{ - ProfileType: api.SecurityProfile_LOCALHOST, - LocalhostRef: "/xyzzy/foobar", - }, - }, - } - ) - - plugins[0].createContainer = create - plugins[1].validateAdjustment = validate - plugins[2].validateAdjustment = validate - - s.Startup() - podReq := &api.RunPodSandboxRequest{Pod: pod} - Expect(runtime.RunPodSandbox(ctx, podReq)).To(Succeed()) - - ctrReq := &api.CreateContainerRequest{ - Pod: pod, - Container: ctr0, - } - reply, err := runtime.CreateContainer(ctx, ctrReq) - Expect(reply).ToNot(BeNil()) - Expect(err).To(BeNil()) - - ctrReq = &api.CreateContainerRequest{ - Pod: pod, - Container: ctr1, - } - reply, err = runtime.CreateContainer(ctx, ctrReq) - Expect(err).ToNot(BeNil()) - Expect(reply).To(BeNil()) - }) - }) - - When("default validator allows custom seccomp policy adjustment", func() { - BeforeEach(func() { - s.Prepare( - &mockRuntime{ - options: []nri.Option{ - nri.WithDefaultValidator( - &validator.DefaultValidatorConfig{ - Enable: true, - RejectCustomSeccompAdjustment: false, - }, - ), - }, - }, - &mockPlugin{idx: "00", name: "foo"}, - &mockPlugin{idx: "10", name: "validator1"}, - &mockPlugin{idx: "20", name: "validator2"}, - ) - }) - - It("should not reject custom seccomp policy adjustment", func() { - var ( - create = func(_ *mockPlugin, _ *api.PodSandbox, ctr *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) { - a := &api.ContainerAdjustment{} - if ctr.GetName() == "ctr1" { - a.SetLinuxSeccompPolicy( - func() *api.LinuxSeccomp { - seccomp := rspec.LinuxSeccomp{ - DefaultAction: rspec.ActAllow, - ListenerPath: "/run/meshuggah-rocks.sock", - Architectures: []rspec.Arch{}, - Flags: []rspec.LinuxSeccompFlag{}, - Syscalls: []rspec.LinuxSyscall{{ - Names: []string{"sched_getaffinity"}, - Action: rspec.ActNotify, - Args: []rspec.LinuxSeccompArg{}, - }}, - } - return api.FromOCILinuxSeccomp(&seccomp) - }(), - ) - } - return a, nil, nil - } - - validate = func(_ *mockPlugin, _ *api.ValidateContainerAdjustmentRequest) error { - return nil - } - - runtime = s.runtime - plugins = s.plugins - ctx = context.Background() - - pod = &api.PodSandbox{ - Id: "pod0", - Name: "pod0", - Uid: "uid0", - Namespace: "default", - } - ctr0 = &api.Container{ - Id: "ctr0", - PodSandboxId: "pod0", - Name: "ctr0", - State: api.ContainerState_CONTAINER_CREATED, - } - ctr1 = &api.Container{ - Id: "ctr1", - PodSandboxId: "pod0", - Name: "ctr1", - State: api.ContainerState_CONTAINER_CREATED, - Linux: &api.LinuxContainer{ - SeccompProfile: &api.SecurityProfile{ - ProfileType: api.SecurityProfile_LOCALHOST, - LocalhostRef: "/xyzzy/foobar", - }, - }, - } - ) - - plugins[0].createContainer = create - plugins[1].validateAdjustment = validate - plugins[2].validateAdjustment = validate - - s.Startup() - podReq := &api.RunPodSandboxRequest{Pod: pod} - Expect(runtime.RunPodSandbox(ctx, podReq)).To(Succeed()) - - ctrReq := &api.CreateContainerRequest{ - Pod: pod, - Container: ctr0, - } - reply, err := runtime.CreateContainer(ctx, ctrReq) - Expect(reply).ToNot(BeNil()) - Expect(err).To(BeNil()) - - ctrReq = &api.CreateContainerRequest{ - Pod: pod, - Container: ctr1, - } - reply, err = runtime.CreateContainer(ctx, ctrReq) - Expect(reply).ToNot(BeNil()) - Expect(err).To(BeNil()) - }) - }) - - When("default validator disallows unconfined seccomp policy adjustment", func() { - BeforeEach(func() { - s.Prepare( - &mockRuntime{ - options: []nri.Option{ - nri.WithDefaultValidator( - &validator.DefaultValidatorConfig{ - Enable: true, - RejectUnconfinedSeccompAdjustment: true, - }, - ), - }, - }, - &mockPlugin{idx: "00", name: "foo"}, - &mockPlugin{idx: "10", name: "validator1"}, - &mockPlugin{idx: "20", name: "validator2"}, - ) - }) - - It("should reject unconfined seccomp policy adjustment", func() { - var ( - create = func(_ *mockPlugin, _ *api.PodSandbox, ctr *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) { - a := &api.ContainerAdjustment{} - if ctr.GetName() == "ctr1" { - a.SetLinuxSeccompPolicy( - func() *api.LinuxSeccomp { - seccomp := rspec.LinuxSeccomp{ - DefaultAction: rspec.ActAllow, - ListenerPath: "/run/meshuggah-rocks.sock", - Architectures: []rspec.Arch{}, - Flags: []rspec.LinuxSeccompFlag{}, - Syscalls: []rspec.LinuxSyscall{{ - Names: []string{"sched_getaffinity"}, - Action: rspec.ActNotify, - Args: []rspec.LinuxSeccompArg{}, - }}, - } - return api.FromOCILinuxSeccomp(&seccomp) - }(), - ) - } - return a, nil, nil - } - - validate = func(_ *mockPlugin, _ *api.ValidateContainerAdjustmentRequest) error { - return nil - } - - runtime = s.runtime - plugins = s.plugins - ctx = context.Background() - - pod = &api.PodSandbox{ - Id: "pod0", - Name: "pod0", - Uid: "uid0", - Namespace: "default", - } - ctr0 = &api.Container{ - Id: "ctr0", - PodSandboxId: "pod0", - Name: "ctr0", - State: api.ContainerState_CONTAINER_CREATED, - } - ctr1 = &api.Container{ - Id: "ctr1", - PodSandboxId: "pod0", - Name: "ctr1", - State: api.ContainerState_CONTAINER_CREATED, - Linux: &api.LinuxContainer{ - SeccompProfile: &api.SecurityProfile{ - ProfileType: api.SecurityProfile_UNCONFINED, - }, - }, - } - ) - - plugins[0].createContainer = create - plugins[1].validateAdjustment = validate - plugins[2].validateAdjustment = validate - - s.Startup() - podReq := &api.RunPodSandboxRequest{Pod: pod} - Expect(runtime.RunPodSandbox(ctx, podReq)).To(Succeed()) - - ctrReq := &api.CreateContainerRequest{ - Pod: pod, - Container: ctr0, - } - reply, err := runtime.CreateContainer(ctx, ctrReq) - Expect(reply).ToNot(BeNil()) - Expect(err).To(BeNil()) - - ctrReq = &api.CreateContainerRequest{ - Pod: pod, - Container: ctr1, - } - reply, err = runtime.CreateContainer(ctx, ctrReq) - Expect(err).ToNot(BeNil()) - Expect(reply).To(BeNil()) - }) - }) - - When("default validator allows unconfined seccomp policy adjustment", func() { - BeforeEach(func() { - s.Prepare( - &mockRuntime{ - options: []nri.Option{ - nri.WithDefaultValidator( - &validator.DefaultValidatorConfig{ - Enable: true, - RejectUnconfinedSeccompAdjustment: false, - }, - ), - }, - }, - &mockPlugin{idx: "00", name: "foo"}, - &mockPlugin{idx: "10", name: "validator1"}, - &mockPlugin{idx: "20", name: "validator2"}, - ) - }) - - It("should not reject unconfined seccomp policy adjustment", func() { - var ( - create = func(_ *mockPlugin, _ *api.PodSandbox, ctr *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) { - a := &api.ContainerAdjustment{} - if ctr.GetName() == "ctr1" { - a.SetLinuxSeccompPolicy( - func() *api.LinuxSeccomp { - seccomp := rspec.LinuxSeccomp{ - DefaultAction: rspec.ActAllow, - ListenerPath: "/run/meshuggah-rocks.sock", - Architectures: []rspec.Arch{}, - Flags: []rspec.LinuxSeccompFlag{}, - Syscalls: []rspec.LinuxSyscall{{ - Names: []string{"sched_getaffinity"}, - Action: rspec.ActNotify, - Args: []rspec.LinuxSeccompArg{}, - }}, - } - return api.FromOCILinuxSeccomp(&seccomp) - }(), - ) - } - return a, nil, nil - } - - validate = func(_ *mockPlugin, _ *api.ValidateContainerAdjustmentRequest) error { - return nil - } - - runtime = s.runtime - plugins = s.plugins - ctx = context.Background() - - pod = &api.PodSandbox{ - Id: "pod0", - Name: "pod0", - Uid: "uid0", - Namespace: "default", - } - ctr0 = &api.Container{ - Id: "ctr0", - PodSandboxId: "pod0", - Name: "ctr0", - State: api.ContainerState_CONTAINER_CREATED, - } - ctr1 = &api.Container{ - Id: "ctr1", - PodSandboxId: "pod0", - Name: "ctr1", - State: api.ContainerState_CONTAINER_CREATED, - Linux: &api.LinuxContainer{ - SeccompProfile: &api.SecurityProfile{ - ProfileType: api.SecurityProfile_UNCONFINED, - }, - }, - } - ) - - plugins[0].createContainer = create - plugins[1].validateAdjustment = validate - plugins[2].validateAdjustment = validate - - s.Startup() - podReq := &api.RunPodSandboxRequest{Pod: pod} - Expect(runtime.RunPodSandbox(ctx, podReq)).To(Succeed()) - - ctrReq := &api.CreateContainerRequest{ - Pod: pod, - Container: ctr0, - } - reply, err := runtime.CreateContainer(ctx, ctrReq) - Expect(reply).ToNot(BeNil()) - Expect(err).To(BeNil()) - - ctrReq = &api.CreateContainerRequest{ - Pod: pod, - Container: ctr1, - } - reply, err = runtime.CreateContainer(ctx, ctrReq) - Expect(reply).ToNot(BeNil()) - Expect(err).To(BeNil()) - }) - }) - - When("the default validator is enabled and namespace adjustment is disabled", func() { - BeforeEach(func() { - s.Prepare( - &mockRuntime{ - options: []nri.Option{ - nri.WithDefaultValidator( - &validator.DefaultValidatorConfig{ - Enable: true, - RejectNamespaceAdjustment: true, - }, - ), - }, - }, - &mockPlugin{idx: "00", name: "foo"}, - &mockPlugin{idx: "10", name: "validator1"}, - &mockPlugin{idx: "20", name: "validator2"}, - ) - }) - - It("should reject namespace adjustment", func() { - var ( - create = func(_ *mockPlugin, _ *api.PodSandbox, ctr *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) { - a := &api.ContainerAdjustment{} - if ctr.GetName() == "ctr1" { - a.AddOrReplaceNamespace( - &api.LinuxNamespace{ - Type: "cgroup", - Path: "/", - }, - ) - } - return a, nil, nil - } - - validate = func(_ *mockPlugin, _ *api.ValidateContainerAdjustmentRequest) error { - return nil - } - - runtime = s.runtime - plugins = s.plugins - ctx = context.Background() - - pod = &api.PodSandbox{ - Id: "pod0", - Name: "pod0", - Uid: "uid0", - Namespace: "default", - } - ctr0 = &api.Container{ - Id: "ctr0", - PodSandboxId: "pod0", - Name: "ctr0", - State: api.ContainerState_CONTAINER_CREATED, - } - ctr1 = &api.Container{ - Id: "ctr1", - PodSandboxId: "pod0", - Name: "ctr1", - State: api.ContainerState_CONTAINER_CREATED, - } - ) - - plugins[0].createContainer = create - plugins[1].validateAdjustment = validate - plugins[2].validateAdjustment = validate - - s.Startup() - podReq := &api.RunPodSandboxRequest{Pod: pod} - Expect(runtime.RunPodSandbox(ctx, podReq)).To(Succeed()) - - ctrReq := &api.CreateContainerRequest{ - Pod: pod, - Container: ctr0, - } - reply, err := runtime.CreateContainer(ctx, ctrReq) - Expect(reply).ToNot(BeNil()) - Expect(err).To(BeNil()) - - ctrReq = &api.CreateContainerRequest{ - Pod: pod, - Container: ctr1, - } - reply, err = runtime.CreateContainer(ctx, ctrReq) - Expect(err).ToNot(BeNil()) - Expect(reply).To(BeNil()) - }) - }) - - When("the default validator is enabled with some required plugins", func() { - const AnnotationDomain = plugin.AnnotationDomain - BeforeEach(func() { - s.Prepare( - &mockRuntime{ - options: []nri.Option{ - nri.WithDefaultValidator( - &validator.DefaultValidatorConfig{ - Enable: true, - RequiredPlugins: []string{ - "foo", - "bar", - }, - TolerateMissingAnnotation: "tolerate-missing-plugins." + AnnotationDomain, - }, - ), - }, - }, - &mockPlugin{idx: "00", name: "foo"}, - ) - }) - - It("should not allow container creation if required plugins are missing", func() { - var ( - runtime = s.runtime - ctx = context.Background() - - pod = &api.PodSandbox{ - Id: "pod0", - Name: "pod0", - Uid: "uid0", - Namespace: "default", - } - ) - - s.Startup() - podReq := &api.RunPodSandboxRequest{Pod: pod} - Expect(runtime.RunPodSandbox(ctx, podReq)).To(Succeed()) - - ctrReq := &api.CreateContainerRequest{ - Pod: pod, - Container: &api.Container{ - Id: "ctr0", - PodSandboxId: "pod0", - Name: "ctr0", - State: api.ContainerState_CONTAINER_CREATED, - }, - } - reply, err := runtime.CreateContainer(ctx, ctrReq) - Expect(reply).To(BeNil()) - Expect(err).ToNot(BeNil()) - }) - - It("should allow container creation, if missing plugins are tolerated", func() { - var ( - runtime = s.runtime - ctx = context.Background() - - pod = &api.PodSandbox{ - Id: "pod0", - Name: "pod0", - Uid: "uid0", - Namespace: "default", - Annotations: map[string]string{ - "tolerate-missing-plugins." + AnnotationDomain + "/container.ctr0": "true", - }, - } - ) - - s.Startup() - podReq := &api.RunPodSandboxRequest{Pod: pod} - Expect(runtime.RunPodSandbox(ctx, podReq)).To(Succeed()) - - ctrReq := &api.CreateContainerRequest{ - Pod: pod, - Container: &api.Container{ - Id: "ctr0", - PodSandboxId: "pod0", - Name: "ctr0", - State: api.ContainerState_CONTAINER_CREATED, - }, - } - reply, err := runtime.CreateContainer(ctx, ctrReq) - Expect(reply).ToNot(BeNil()) - Expect(err).To(BeNil()) - }) - - It("should allow container creation if all required plugins are present", func() { - var ( - runtime = s.runtime - ctx = context.Background() - - pod = &api.PodSandbox{ - Id: "pod0", - Name: "pod0", - Uid: "uid0", - Namespace: "default", - } - ) - - s.Startup() - podReq := &api.RunPodSandboxRequest{Pod: pod} - Expect(runtime.RunPodSandbox(ctx, podReq)).To(Succeed()) - - s.StartPlugins(&mockPlugin{idx: "10", name: "bar"}) - s.WaitForPluginsToSync(s.plugin("10-bar")) - - ctrReq := &api.CreateContainerRequest{ - Pod: pod, - Container: &api.Container{ - Id: "ctr0", - PodSandboxId: "pod0", - Name: "ctr0", - State: api.ContainerState_CONTAINER_CREATED, - }, - } - reply, err := runtime.CreateContainer(ctx, ctrReq) - Expect(reply).ToNot(BeNil()) - Expect(err).To(BeNil()) - }) - - It("should not allow container creation if annotated required plugins are missing", func() { - var ( - runtime = s.runtime - ctx = context.Background() - - pod = &api.PodSandbox{ - Id: "pod0", - Name: "pod0", - Uid: "uid0", - Namespace: "default", - Annotations: map[string]string{ - "required-plugins." + AnnotationDomain + "/container.ctr0": "[ \"xyzzy\" ]", - }, - } - ) - - s.Startup() - podReq := &api.RunPodSandboxRequest{Pod: pod} - Expect(runtime.RunPodSandbox(ctx, podReq)).To(Succeed()) - - s.StartPlugins(&mockPlugin{idx: "10", name: "bar"}) - s.WaitForPluginsToSync(s.plugin("10-bar")) - - ctrReq := &api.CreateContainerRequest{ - Pod: pod, - Container: &api.Container{ - Id: "ctr0", - PodSandboxId: "pod0", - Name: "ctr0", - State: api.ContainerState_CONTAINER_CREATED, - }, - } - reply, err := runtime.CreateContainer(ctx, ctrReq) - Expect(reply).To(BeNil()) - Expect(err).ToNot(BeNil()) - - s.StartPlugins(&mockPlugin{idx: "20", name: "xyzzy"}) - s.WaitForPluginsToSync(s.plugin("20-xyzzy")) - - ctrReq = &api.CreateContainerRequest{ - Pod: pod, - Container: &api.Container{ - Id: "ctr0", - PodSandboxId: "pod0", - Name: "ctr0", - State: api.ContainerState_CONTAINER_CREATED, - }, - } - reply, err = runtime.CreateContainer(ctx, ctrReq) - Expect(reply).ToNot(BeNil()) - Expect(err).To(BeNil()) - }) - - }) - -}) - -// -------------------------------------------- - -var _ = Describe("Plugin container updates during creation", func() { - var ( - s = &Suite{} - ) - - update := func(subject, which string, p *mockPlugin, _ *api.PodSandbox, ctr *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) { - plugin := p.idx + "-" + p.name - - if which != plugin && which != "*" && which != "both" { - return nil, nil, nil - } - if ctr.Name != "ctr1" { - return nil, nil, nil - } - - u := &api.ContainerUpdate{} - u.SetContainerId("ctr0") - - switch subject { - case "resources/cpu": - u.SetLinuxCPUShares(123) - u.SetLinuxCPUQuota(456) - u.SetLinuxCPUPeriod(789) - u.SetLinuxCPURealtimeRuntime(321) - u.SetLinuxCPURealtimePeriod(654) - u.SetLinuxCPUSetCPUs("0-1") - u.SetLinuxCPUSetMems("2-3") - - case "resources/memory": - u.SetLinuxMemoryLimit(1234000) - u.SetLinuxMemoryReservation(4000) - u.SetLinuxMemorySwap(34000) - u.SetLinuxMemoryKernel(30000) - u.SetLinuxMemoryKernelTCP(2000) - u.SetLinuxMemorySwappiness(987) - u.SetLinuxMemoryDisableOomKiller() - u.SetLinuxMemoryUseHierarchy() - - case "resources/classes": - u.SetLinuxRDTClass(plugin) - u.SetLinuxBlockIOClass(plugin) - - case "resources/hugepagelimits": - u.AddLinuxHugepageLimit("1M", 4096) - u.AddLinuxHugepageLimit("4M", 1024) - - case "resources/unified": - u.AddLinuxUnified("resource.1", "value1") - u.AddLinuxUnified("resource.2", "value2") - } - - return nil, []*api.ContainerUpdate{u}, nil - } - - AfterEach(func() { - s.Cleanup() - }) - - When("there is a single plugin", func() { - BeforeEach(func() { - s.Prepare(&mockRuntime{}, &mockPlugin{idx: "00", name: "test"}) - }) - - DescribeTable("should be successfully collected without conflicts", - func(subject string, expected *api.ContainerUpdate) { - var ( - runtime = s.runtime - plugin = s.plugins[0] - ctx = context.Background() - - pod0 = &api.PodSandbox{ - Id: "pod0", - Name: "pod0", - Uid: "uid0", - Namespace: "default", - } - ctr0 = &api.Container{ - Id: "ctr0", - PodSandboxId: "pod0", - Name: "ctr0", - State: api.ContainerState_CONTAINER_CREATED, // XXX FIXME-kludge - } - pod1 = &api.PodSandbox{ - Id: "pod1", - Name: "pod1", - Uid: "uid1", - Namespace: "default", - } - ctr1 = &api.Container{ - Id: "ctr1", - PodSandboxId: "pod1", - Name: "ctr1", - State: api.ContainerState_CONTAINER_CREATED, // XXX FIXME-kludge - } - - reply *api.CreateContainerResponse - ) - - create := func(p *mockPlugin, pod *api.PodSandbox, ctr *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) { - plugin := p.idx + "-" + p.name - return update(subject, plugin, p, pod, ctr) - } - - plugin.createContainer = create - - s.Startup() - - podReq := &api.RunPodSandboxRequest{Pod: pod0} - Expect(runtime.RunPodSandbox(ctx, podReq)).To(Succeed()) - ctrReq := &api.CreateContainerRequest{ - Pod: pod0, - Container: ctr0, - } - _, err := runtime.CreateContainer(ctx, ctrReq) - Expect(err).To(BeNil()) - - podReq = &api.RunPodSandboxRequest{Pod: pod1} - Expect(runtime.RunPodSandbox(ctx, podReq)).To(Succeed()) - ctrReq = &api.CreateContainerRequest{ - Pod: pod1, - Container: ctr1, - } - reply, err = runtime.CreateContainer(ctx, ctrReq) - Expect(err).To(BeNil()) - - Expect(len(reply.Update)).To(Equal(1)) - expected.ContainerId = reply.Update[0].ContainerId - Expect(protoEqual(reply.Update[0].Strip(), expected.Strip())).Should(BeTrue(), - protoDiff(reply.Update[0], expected)) - }, - - Entry("update CPU resources", "resources/cpu", - &api.ContainerUpdate{ - Linux: &api.LinuxContainerUpdate{ - Resources: &api.LinuxResources{ - Cpu: &api.LinuxCPU{ - Shares: api.UInt64(123), - Quota: api.Int64(456), - Period: api.UInt64(789), - RealtimeRuntime: api.Int64(321), - RealtimePeriod: api.UInt64(654), - Cpus: "0-1", - Mems: "2-3", - }, - }, - }, - }, - ), - Entry("update memory resources", "resources/memory", - &api.ContainerUpdate{ - Linux: &api.LinuxContainerUpdate{ - Resources: &api.LinuxResources{ - Memory: &api.LinuxMemory{ - Limit: api.Int64(1234000), - Reservation: api.Int64(4000), - Swap: api.Int64(34000), - Kernel: api.Int64(30000), - KernelTcp: api.Int64(2000), - Swappiness: api.UInt64(987), - DisableOomKiller: api.Bool(true), - UseHierarchy: api.Bool(true), - }, - }, - }, - }, - ), - Entry("update class-based resources", "resources/classes", - &api.ContainerUpdate{ - Linux: &api.LinuxContainerUpdate{ - Resources: &api.LinuxResources{ - RdtClass: api.String("00-test"), - BlockioClass: api.String("00-test"), - }, - }, - }, - ), - Entry("update hugepage limits", "resources/hugepagelimits", - &api.ContainerUpdate{ - Linux: &api.LinuxContainerUpdate{ - Resources: &api.LinuxResources{ - HugepageLimits: []*api.HugepageLimit{ - { - PageSize: "1M", - Limit: 4096, - }, - { - PageSize: "4M", - Limit: 1024, - }, - }, - }, - }, - }, - ), - Entry("update cgroupv2 unified resources", "resources/unified", - &api.ContainerUpdate{ - Linux: &api.LinuxContainerUpdate{ - Resources: &api.LinuxResources{ - Unified: map[string]string{ - "resource.1": "value1", - "resource.2": "value2", - }, - }, - }, - }, - ), - ) - }) - - When("there are multiple plugins", func() { - BeforeEach(func() { - s.Prepare( - &mockRuntime{}, - &mockPlugin{idx: "10", name: "foo"}, - &mockPlugin{idx: "00", name: "bar"}, - ) - }) - - DescribeTable("should fail with conflicts, successfully collected otherwise", - func(subject string, which string, expected *api.ContainerUpdate) { - var ( - runtime = s.runtime - plugins = s.plugins - ctx = context.Background() - - pod0 = &api.PodSandbox{ - Id: "pod0", - Name: "pod0", - Uid: "uid0", - Namespace: "default", - } - ctr0 = &api.Container{ - Id: "ctr0", - PodSandboxId: "pod0", - Name: "ctr0", - State: api.ContainerState_CONTAINER_CREATED, // XXX FIXME-kludge - } - pod1 = &api.PodSandbox{ - Id: "pod1", - Name: "pod1", - Uid: "uid1", - Namespace: "default", - } - ctr1 = &api.Container{ - Id: "ctr1", - PodSandboxId: "pod1", - Name: "ctr1", - State: api.ContainerState_CONTAINER_CREATED, // XXX FIXME-kludge - } - - reply *api.CreateContainerResponse - ) - - create := func(p *mockPlugin, pod *api.PodSandbox, ctr *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) { - return update(subject, which, p, pod, ctr) - } - - plugins[0].createContainer = create - plugins[1].createContainer = create - - s.Startup() - - podReq := &api.RunPodSandboxRequest{Pod: pod0} - Expect(runtime.RunPodSandbox(ctx, podReq)).To(Succeed()) - ctrReq := &api.CreateContainerRequest{ - Pod: pod0, - Container: ctr0, - } - _, err := runtime.CreateContainer(ctx, ctrReq) - Expect(err).To(BeNil()) - - podReq = &api.RunPodSandboxRequest{Pod: pod1} - Expect(runtime.RunPodSandbox(ctx, podReq)).To(Succeed()) - ctrReq = &api.CreateContainerRequest{ - Pod: pod1, - Container: ctr1, - } - reply, err = runtime.CreateContainer(ctx, ctrReq) - if which == "both" { - Expect(err).ToNot(BeNil()) - } else { - Expect(err).To(BeNil()) - Expect(len(reply.Update)).To(Equal(1)) - expected.ContainerId = reply.Update[0].ContainerId - Expect(protoEqual(reply.Update[0].Strip(), expected.Strip())).Should(BeTrue(), - protoDiff(reply.Update[0], expected)) - } - }, - - Entry("update CPU resources", "resources/cpu", "both", nil), - Entry("update CPU resources", "resources/cpu", "10-foo", - &api.ContainerUpdate{ - Linux: &api.LinuxContainerUpdate{ - Resources: &api.LinuxResources{ - Cpu: &api.LinuxCPU{ - Shares: api.UInt64(123), - Quota: api.Int64(456), - Period: api.UInt64(789), - RealtimeRuntime: api.Int64(321), - RealtimePeriod: api.UInt64(654), - Cpus: "0-1", - Mems: "2-3", - }, - }, - }, - }, - ), - Entry("update memory resources", "resources/memory", "both", nil), - Entry("update memory resources", "resources/memory", "10-foo", - &api.ContainerUpdate{ - Linux: &api.LinuxContainerUpdate{ - Resources: &api.LinuxResources{ - Memory: &api.LinuxMemory{ - Limit: api.Int64(1234000), - Reservation: api.Int64(4000), - Swap: api.Int64(34000), - Kernel: api.Int64(30000), - KernelTcp: api.Int64(2000), - Swappiness: api.UInt64(987), - DisableOomKiller: api.Bool(true), - UseHierarchy: api.Bool(true), - }, - }, - }, - }, - ), - Entry("update class-based resources", "resources/classes", "both", nil), - Entry("update class-based resources", "resources/classes", "10-foo", - &api.ContainerUpdate{ - Linux: &api.LinuxContainerUpdate{ - Resources: &api.LinuxResources{ - RdtClass: api.String("10-foo"), - BlockioClass: api.String("10-foo"), - }, - }, - }, - ), - Entry("update hugepage limits", "resources/hugepagelimits", "both", nil), - Entry("update hugepage limits", "resources/hugepagelimits", "10-foo", - &api.ContainerUpdate{ - Linux: &api.LinuxContainerUpdate{ - Resources: &api.LinuxResources{ - HugepageLimits: []*api.HugepageLimit{ - { - PageSize: "1M", - Limit: 4096, - }, - { - PageSize: "4M", - Limit: 1024, - }, - }, - }, - }, - }, - ), - Entry("update cgroupv2 unified resources", "resources/unified", "both", nil), - Entry("update cgroupv2 unified resources", "resources/unified", "10-foo", - &api.ContainerUpdate{ - Linux: &api.LinuxContainerUpdate{ - Resources: &api.LinuxResources{ - Unified: map[string]string{ - "resource.1": "value1", - "resource.2": "value2", - }, - }, - }, - }, - ), - ) - }) -}) - -var _ = Describe("Solicited container updates by plugins", func() { - var ( - s = &Suite{} - ) - - update := func(subject, which string, p *mockPlugin, _ *api.PodSandbox, ctr *api.Container, _, _ *api.LinuxResources) ([]*api.ContainerUpdate, error) { - plugin := p.idx + "-" + p.name - - if which != plugin && which != "*" && which != "both" { - return nil, nil - } - if ctr.Name != "ctr0" { - return nil, nil - } - - u := &api.ContainerUpdate{} - u.SetContainerId(ctr.Id) - - switch subject { - case "resources/cpu": - u.SetLinuxCPUShares(123) - u.SetLinuxCPUQuota(456) - u.SetLinuxCPUPeriod(789) - u.SetLinuxCPURealtimeRuntime(321) - u.SetLinuxCPURealtimePeriod(654) - u.SetLinuxCPUSetCPUs("0-1") - u.SetLinuxCPUSetMems("2-3") - - case "resources/memory": - u.SetLinuxMemoryLimit(1234000) - u.SetLinuxMemoryReservation(4000) - u.SetLinuxMemorySwap(34000) - u.SetLinuxMemoryKernel(30000) - u.SetLinuxMemoryKernelTCP(2000) - u.SetLinuxMemorySwappiness(987) - u.SetLinuxMemoryDisableOomKiller() - u.SetLinuxMemoryUseHierarchy() - - case "resources/classes": - u.SetLinuxRDTClass(plugin) - u.SetLinuxBlockIOClass(plugin) - - case "resources/hugepagelimits": - u.AddLinuxHugepageLimit("1M", 4096) - u.AddLinuxHugepageLimit("4M", 1024) - - case "resources/unified": - u.AddLinuxUnified("resource.1", "value1") - u.AddLinuxUnified("resource.2", "value2") - } - - return []*api.ContainerUpdate{u}, nil - } - - AfterEach(func() { - s.Cleanup() - }) - - When("there is a single plugin", func() { - BeforeEach(func() { - s.Prepare(&mockRuntime{}, &mockPlugin{idx: "00", name: "test"}) - }) - - DescribeTable("should be successfully collected without conflicts", - func(subject string, expected *api.ContainerUpdate) { - var ( - runtime = s.runtime - plugin = s.plugins[0] - ctx = context.Background() - - pod0 = &api.PodSandbox{ - Id: "pod0", - Name: "pod0", - Uid: "uid0", - Namespace: "default", - } - ctr0 = &api.Container{ - Id: "ctr0", - PodSandboxId: "pod0", - Name: "ctr0", - State: api.ContainerState_CONTAINER_CREATED, // XXX FIXME-kludge - } - - reply *api.UpdateContainerResponse - ) - - updateContainer := func(p *mockPlugin, pod *api.PodSandbox, ctr *api.Container, r *api.LinuxResources) ([]*api.ContainerUpdate, error) { - plugin := p.idx + "-" + p.name - return update(subject, plugin, p, pod, ctr, r, nil) - } - plugin.updateContainer = updateContainer - - s.Startup() - - podReq := &api.RunPodSandboxRequest{Pod: pod0} - Expect(runtime.RunPodSandbox(ctx, podReq)).To(Succeed()) - ctrReq := &api.CreateContainerRequest{ - Pod: pod0, - Container: ctr0, - } - _, err := runtime.CreateContainer(ctx, ctrReq) - Expect(err).To(BeNil()) - - updReq := &api.UpdateContainerRequest{ - Pod: pod0, - Container: ctr0, - LinuxResources: &api.LinuxResources{ - Cpu: &api.LinuxCPU{ - Shares: api.UInt64(999), - Quota: api.Int64(888), - Period: api.UInt64(777), - RealtimeRuntime: api.Int64(666), - RealtimePeriod: api.UInt64(555), - Cpus: "444", - Mems: "333", - }, - Memory: &api.LinuxMemory{ - Limit: api.Int64(9999), - Reservation: api.Int64(8888), - Swap: api.Int64(7777), - Kernel: api.Int64(6666), - KernelTcp: api.Int64(5555), - Swappiness: api.UInt64(444), - DisableOomKiller: api.Bool(false), - UseHierarchy: api.Bool(false), - }, - }, - } - reply, err = runtime.UpdateContainer(ctx, updReq) - - Expect(len(reply.Update)).To(Equal(1)) - Expect(err).To(BeNil()) - expected.ContainerId = reply.Update[0].ContainerId - Expect(protoEqual(reply.Update[0].Strip(), expected.Strip())).Should(BeTrue(), - protoDiff(reply.Update[0], expected)) - }, - - Entry("update CPU resources", "resources/cpu", - &api.ContainerUpdate{ - Linux: &api.LinuxContainerUpdate{ - Resources: &api.LinuxResources{ - Cpu: &api.LinuxCPU{ - Shares: api.UInt64(123), - Quota: api.Int64(456), - Period: api.UInt64(789), - RealtimeRuntime: api.Int64(321), - RealtimePeriod: api.UInt64(654), - Cpus: "0-1", - Mems: "2-3", - }, - Memory: &api.LinuxMemory{ - Limit: api.Int64(9999), - Reservation: api.Int64(8888), - Swap: api.Int64(7777), - Kernel: api.Int64(6666), - KernelTcp: api.Int64(5555), - Swappiness: api.UInt64(444), - DisableOomKiller: api.Bool(false), - UseHierarchy: api.Bool(false), - }, - }, - }, - }, - ), - Entry("update memory resources", "resources/memory", - &api.ContainerUpdate{ - Linux: &api.LinuxContainerUpdate{ - Resources: &api.LinuxResources{ - Cpu: &api.LinuxCPU{ - Shares: api.UInt64(999), - Quota: api.Int64(888), - Period: api.UInt64(777), - RealtimeRuntime: api.Int64(666), - RealtimePeriod: api.UInt64(555), - Cpus: "444", - Mems: "333", - }, - Memory: &api.LinuxMemory{ - Limit: api.Int64(1234000), - Reservation: api.Int64(4000), - Swap: api.Int64(34000), - Kernel: api.Int64(30000), - KernelTcp: api.Int64(2000), - Swappiness: api.UInt64(987), - DisableOomKiller: api.Bool(true), - UseHierarchy: api.Bool(true), - }, - }, - }, - }, - ), - Entry("update class-based resources", "resources/classes", - &api.ContainerUpdate{ - Linux: &api.LinuxContainerUpdate{ - Resources: &api.LinuxResources{ - Cpu: &api.LinuxCPU{ - Shares: api.UInt64(999), - Quota: api.Int64(888), - Period: api.UInt64(777), - RealtimeRuntime: api.Int64(666), - RealtimePeriod: api.UInt64(555), - Cpus: "444", - Mems: "333", - }, - Memory: &api.LinuxMemory{ - Limit: api.Int64(9999), - Reservation: api.Int64(8888), - Swap: api.Int64(7777), - Kernel: api.Int64(6666), - KernelTcp: api.Int64(5555), - Swappiness: api.UInt64(444), - DisableOomKiller: api.Bool(false), - UseHierarchy: api.Bool(false), - }, - - RdtClass: api.String("00-test"), - BlockioClass: api.String("00-test"), - }, - }, - }, - ), - Entry("update hugepage limits", "resources/hugepagelimits", - &api.ContainerUpdate{ - Linux: &api.LinuxContainerUpdate{ - Resources: &api.LinuxResources{ - Cpu: &api.LinuxCPU{ - Shares: api.UInt64(999), - Quota: api.Int64(888), - Period: api.UInt64(777), - RealtimeRuntime: api.Int64(666), - RealtimePeriod: api.UInt64(555), - Cpus: "444", - Mems: "333", - }, - Memory: &api.LinuxMemory{ - Limit: api.Int64(9999), - Reservation: api.Int64(8888), - Swap: api.Int64(7777), - Kernel: api.Int64(6666), - KernelTcp: api.Int64(5555), - Swappiness: api.UInt64(444), - DisableOomKiller: api.Bool(false), - UseHierarchy: api.Bool(false), - }, - HugepageLimits: []*api.HugepageLimit{ - { - PageSize: "1M", - Limit: 4096, - }, - { - PageSize: "4M", - Limit: 1024, - }, - }, - }, - }, - }, - ), - Entry("update cgroupv2 unified resources", "resources/unified", - &api.ContainerUpdate{ - Linux: &api.LinuxContainerUpdate{ - Resources: &api.LinuxResources{ - Cpu: &api.LinuxCPU{ - Shares: api.UInt64(999), - Quota: api.Int64(888), - Period: api.UInt64(777), - RealtimeRuntime: api.Int64(666), - RealtimePeriod: api.UInt64(555), - Cpus: "444", - Mems: "333", - }, - Memory: &api.LinuxMemory{ - Limit: api.Int64(9999), - Reservation: api.Int64(8888), - Swap: api.Int64(7777), - Kernel: api.Int64(6666), - KernelTcp: api.Int64(5555), - Swappiness: api.UInt64(444), - DisableOomKiller: api.Bool(false), - UseHierarchy: api.Bool(false), - }, - - Unified: map[string]string{ - "resource.1": "value1", - "resource.2": "value2", - }, - }, - }, - }, - ), - ) - }) - - When("there are multiple plugins", func() { - BeforeEach(func() { - s.Prepare( - &mockRuntime{}, - &mockPlugin{idx: "10", name: "foo"}, - &mockPlugin{idx: "00", name: "bar"}, - ) - }) - - DescribeTable("should fail with conflicts, successfully collected otherwise", - func(subject string, which string, expected *api.ContainerUpdate) { - var ( - runtime = s.runtime - plugins = s.plugins - ctx = context.Background() - - pod0 = &api.PodSandbox{ - Id: "pod0", - Name: "pod0", - Uid: "uid0", - Namespace: "default", - } - ctr0 = &api.Container{ - Id: "ctr0", - PodSandboxId: "pod0", - Name: "ctr0", - State: api.ContainerState_CONTAINER_CREATED, // XXX FIXME-kludge - } - - reply *api.UpdateContainerResponse - ) - - updateContainer := func(p *mockPlugin, pod *api.PodSandbox, ctr *api.Container, r *api.LinuxResources) ([]*api.ContainerUpdate, error) { - return update(subject, which, p, pod, ctr, r, nil) - } - - plugins[0].updateContainer = updateContainer - plugins[1].updateContainer = updateContainer - - s.Startup() - - podReq := &api.RunPodSandboxRequest{Pod: pod0} - Expect(runtime.RunPodSandbox(ctx, podReq)).To(Succeed()) - ctrReq := &api.CreateContainerRequest{ - Pod: pod0, - Container: ctr0, - } - _, err := runtime.CreateContainer(ctx, ctrReq) - Expect(err).To(BeNil()) - - updReq := &api.UpdateContainerRequest{ - Pod: pod0, - Container: ctr0, - LinuxResources: &api.LinuxResources{ - Cpu: &api.LinuxCPU{ - Shares: api.UInt64(999), - Quota: api.Int64(888), - Period: api.UInt64(777), - RealtimeRuntime: api.Int64(666), - RealtimePeriod: api.UInt64(555), - Cpus: "444", - Mems: "333", - }, - Memory: &api.LinuxMemory{ - Limit: api.Int64(9999), - Reservation: api.Int64(8888), - Swap: api.Int64(7777), - Kernel: api.Int64(6666), - KernelTcp: api.Int64(5555), - Swappiness: api.UInt64(444), - DisableOomKiller: api.Bool(false), - UseHierarchy: api.Bool(false), - }, - }, - } - reply, err = runtime.UpdateContainer(ctx, updReq) - if which == "both" { - Expect(err).ToNot(BeNil()) - } else { - Expect(err).To(BeNil()) - Expect(len(reply.Update)).To(Equal(1)) - expected.ContainerId = reply.Update[0].ContainerId - Expect(protoEqual(reply.Update[0].Strip(), expected.Strip())).Should(BeTrue(), - protoDiff(reply.Update[0], expected)) - - } - }, - - Entry("update CPU resources", "resources/cpu", "both", nil), - Entry("update CPU resources", "resources/cpu", "10-foo", - &api.ContainerUpdate{ - Linux: &api.LinuxContainerUpdate{ - Resources: &api.LinuxResources{ - Cpu: &api.LinuxCPU{ - Shares: api.UInt64(123), - Quota: api.Int64(456), - Period: api.UInt64(789), - RealtimeRuntime: api.Int64(321), - RealtimePeriod: api.UInt64(654), - Cpus: "0-1", - Mems: "2-3", - }, - Memory: &api.LinuxMemory{ - Limit: api.Int64(9999), - Reservation: api.Int64(8888), - Swap: api.Int64(7777), - Kernel: api.Int64(6666), - KernelTcp: api.Int64(5555), - Swappiness: api.UInt64(444), - DisableOomKiller: api.Bool(false), - UseHierarchy: api.Bool(false), - }, - }, - }, - }, - ), - Entry("update memory resources", "resources/memory", "both", nil), - Entry("update memory resources", "resources/memory", "10-foo", - &api.ContainerUpdate{ - Linux: &api.LinuxContainerUpdate{ - Resources: &api.LinuxResources{ - Cpu: &api.LinuxCPU{ - Shares: api.UInt64(999), - Quota: api.Int64(888), - Period: api.UInt64(777), - RealtimeRuntime: api.Int64(666), - RealtimePeriod: api.UInt64(555), - Cpus: "444", - Mems: "333", - }, - Memory: &api.LinuxMemory{ - Limit: api.Int64(1234000), - Reservation: api.Int64(4000), - Swap: api.Int64(34000), - Kernel: api.Int64(30000), - KernelTcp: api.Int64(2000), - Swappiness: api.UInt64(987), - DisableOomKiller: api.Bool(true), - UseHierarchy: api.Bool(true), - }, - }, - }, - }, - ), - Entry("update class-based resources", "resources/classes", "both", nil), - Entry("update class-based resources", "resources/classes", "10-foo", - &api.ContainerUpdate{ - Linux: &api.LinuxContainerUpdate{ - Resources: &api.LinuxResources{ - Cpu: &api.LinuxCPU{ - Shares: api.UInt64(999), - Quota: api.Int64(888), - Period: api.UInt64(777), - RealtimeRuntime: api.Int64(666), - RealtimePeriod: api.UInt64(555), - Cpus: "444", - Mems: "333", - }, - Memory: &api.LinuxMemory{ - Limit: api.Int64(9999), - Reservation: api.Int64(8888), - Swap: api.Int64(7777), - Kernel: api.Int64(6666), - KernelTcp: api.Int64(5555), - Swappiness: api.UInt64(444), - DisableOomKiller: api.Bool(false), - UseHierarchy: api.Bool(false), - }, - RdtClass: api.String("10-foo"), - BlockioClass: api.String("10-foo"), - }, - }, - }, - ), - Entry("update hugepage limits", "resources/hugepagelimits", "both", nil), - Entry("update hugepage limits", "resources/hugepagelimits", "10-foo", - &api.ContainerUpdate{ - Linux: &api.LinuxContainerUpdate{ - Resources: &api.LinuxResources{ - Cpu: &api.LinuxCPU{ - Shares: api.UInt64(999), - Quota: api.Int64(888), - Period: api.UInt64(777), - RealtimeRuntime: api.Int64(666), - RealtimePeriod: api.UInt64(555), - Cpus: "444", - Mems: "333", - }, - Memory: &api.LinuxMemory{ - Limit: api.Int64(9999), - Reservation: api.Int64(8888), - Swap: api.Int64(7777), - Kernel: api.Int64(6666), - KernelTcp: api.Int64(5555), - Swappiness: api.UInt64(444), - DisableOomKiller: api.Bool(false), - UseHierarchy: api.Bool(false), - }, - HugepageLimits: []*api.HugepageLimit{ - { - PageSize: "1M", - Limit: 4096, - }, - { - PageSize: "4M", - Limit: 1024, - }, - }, - }, - }, - }, - ), - Entry("update cgroupv2 unified resources", "resources/unified", "both", nil), - Entry("update cgroupv2 unified resources", "resources/unified", "10-foo", - &api.ContainerUpdate{ - Linux: &api.LinuxContainerUpdate{ - Resources: &api.LinuxResources{ - Cpu: &api.LinuxCPU{ - Shares: api.UInt64(999), - Quota: api.Int64(888), - Period: api.UInt64(777), - RealtimeRuntime: api.Int64(666), - RealtimePeriod: api.UInt64(555), - Cpus: "444", - Mems: "333", - }, - Memory: &api.LinuxMemory{ - Limit: api.Int64(9999), - Reservation: api.Int64(8888), - Swap: api.Int64(7777), - Kernel: api.Int64(6666), - KernelTcp: api.Int64(5555), - Swappiness: api.UInt64(444), - DisableOomKiller: api.Bool(false), - UseHierarchy: api.Bool(false), - }, - Unified: map[string]string{ - "resource.1": "value1", - "resource.2": "value2", - }, - }, - }, - }, - ), - ) - }) -}) - -var _ = Describe("Unsolicited container update requests", func() { - var ( - s = &Suite{} - ) - - AfterEach(func() { - s.Cleanup() - }) - - When("there are plugins", func() { - BeforeEach(func() { - s.Prepare(&mockRuntime{}, &mockPlugin{idx: "00", name: "test"}) - }) - - It("should fail gracefully without unstarted plugins", func() { - var ( - plugin = s.plugins[0] - ) - - s.StartRuntime() - Expect(plugin.Init(s.Dir())).To(Succeed()) - - updates := []*api.ContainerUpdate{ - { - ContainerId: "pod0", - Linux: &api.LinuxContainerUpdate{ - Resources: &api.LinuxResources{ - RdtClass: api.String("test"), - }, - }, - }, - } - _, err := plugin.stub.UpdateContainers(updates) - Expect(err).ToNot(BeNil()) - }) - - It("should be delivered, without crash/panic", func() { - var ( - runtime = s.runtime - plugin = s.plugins[0] - ctx = context.Background() - - pod = &api.PodSandbox{ - Id: "pod0", - Name: "pod0", - Uid: "uid0", - Namespace: "default", - } - ctr = &api.Container{ - Id: "ctr0", - PodSandboxId: "pod0", - Name: "ctr0", - State: api.ContainerState_CONTAINER_CREATED, - } - - recordedUpdates []*nri.ContainerUpdate - ) - - runtime.updateFn = func(_ context.Context, updates []*nri.ContainerUpdate) ([]*nri.ContainerUpdate, error) { - recordedUpdates = updates - return nil, nil - } - - s.Startup() - Expect(runtime.startStopPodAndContainer(ctx, pod, ctr)).To(Succeed()) - - requestedUpdates := []*api.ContainerUpdate{ - { - ContainerId: "pod0", - Linux: &api.LinuxContainerUpdate{ - Resources: &api.LinuxResources{ - RdtClass: api.String("test"), - }, - }, - }, - } - failed, err := plugin.stub.UpdateContainers(requestedUpdates) - - Expect(failed).To(BeNil()) - Expect(err).To(BeNil()) - Expect(recordedUpdates).ToNot(Equal(requestedUpdates)) - }) - }) -}) - -var _ = Describe("Plugin configuration request", func() { - var ( - s = &Suite{} - ) - - AfterEach(func() { - s.Cleanup() - }) - - BeforeEach(func() { - s.Prepare(&mockRuntime{}, &mockPlugin{idx: "00", name: "test"}) - }) - - It("should pass runtime version information to plugins", func() { - var ( - runtimeName = "test-runtime" - runtimeVersion = "1.2.3" - ) - - s.runtime.name = runtimeName - s.runtime.version = runtimeVersion - - s.Startup() - - Expect(s.plugins[0].RuntimeName()).To(Equal(runtimeName)) - Expect(s.plugins[0].RuntimeVersion()).To(Equal(runtimeVersion)) - }) - - When("unchanged", func() { - It("should pass default timeout information to plugins", func() { - var ( - registerTimeout = nri.DefaultPluginRegistrationTimeout - requestTimeout = nri.DefaultPluginRequestTimeout - ) - - s.Startup() - Expect(s.plugins[0].stub.RegistrationTimeout()).To(Equal(registerTimeout)) - Expect(s.plugins[0].stub.RequestTimeout()).To(Equal(requestTimeout)) - }) - }) - - When("reconfigured", func() { - var ( - registerTimeout = nri.DefaultPluginRegistrationTimeout + 5*time.Millisecond - requestTimeout = nri.DefaultPluginRequestTimeout + 7*time.Millisecond - ) - - BeforeEach(func() { - nri.SetPluginRegistrationTimeout(registerTimeout) - nri.SetPluginRequestTimeout(requestTimeout) - s.Prepare(&mockRuntime{}, &mockPlugin{idx: "00", name: "test"}) - }) - - AfterEach(func() { - nri.SetPluginRegistrationTimeout(nri.DefaultPluginRegistrationTimeout) - nri.SetPluginRequestTimeout(nri.DefaultPluginRequestTimeout) - }) - - It("should pass configured timeout information to plugins", func() { - s.Startup() - Expect(s.plugins[0].stub.RegistrationTimeout()).To(Equal(registerTimeout)) - Expect(s.plugins[0].stub.RequestTimeout()).To(Equal(requestTimeout)) - }) - }) -}) - -var _ = Describe("Plugin shutdown request", func() { - var ( - s = &Suite{} - ) - - AfterEach(func() { - s.Cleanup() - }) - - BeforeEach(func() { - s.Prepare(&mockRuntime{}, &mockPlugin{idx: "00", name: "test"}) - }) - - It("should be able to shut down plugins with a reason", func() { - var ( - reason = "test-shutdown-reason" - timeout = 2 * time.Second - ) - - s.Startup() - - s.ShutdownPlugin(s.plugins[0], reason) - e, err := s.plugins[0].EventQ().Wait(PluginShutdown, time.After(timeout)) - Expect(err).To(BeNil()) - Expect(e.Reason).To(Equal(reason)) - }) - - It("plugin that times out should be shut down with a reason", func() { - var ( - reason = nri.ShutdownRequestTimeout - timeout = 2 * time.Second - ) - - pod := &api.PodSandbox{ - Id: "pod0", - Name: "pod0", - Uid: "uid0", - Namespace: "default", - } - podReq := &api.RunPodSandboxRequest{Pod: pod} - - s.plugins[0].runPodSandbox = func(_ *mockPlugin, _ *api.PodSandbox) error { - time.Sleep(3 * time.Second) - return nil - } - - s.Startup() - Expect(s.runtime.RunPodSandbox(context.Background(), podReq)).To(Succeed()) - - e, err := s.plugins[0].EventQ().Wait(PluginShutdown, time.After(timeout)) - Expect(err).To(BeNil()) - Expect(e.Reason).To(Equal(reason)) - }) - -}) - -func protoDiff(a, b proto.Message) string { - return cmp.Diff(a, b, protocmp.Transform()) -} - -func protoEqual(a, b proto.Message) bool { - return cmp.Equal(a, b, cmpopts.EquateEmpty(), protocmp.Transform()) -} diff --git a/pkg/adaptation/adaptation_test.go b/pkg/adaptation/adaptation_test.go new file mode 100644 index 00000000..b128d9eb --- /dev/null +++ b/pkg/adaptation/adaptation_test.go @@ -0,0 +1,3397 @@ +/* + 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 adaptation_test + +import ( + "context" + "fmt" + "maps" + "os" + "slices" + "strings" + "testing" + "time" + + nri "github.com/containerd/nri/pkg/adaptation" + "github.com/containerd/nri/pkg/api/v1alpha1" + api "github.com/containerd/nri/pkg/api/v1beta1" + pluginhelpers "github.com/containerd/nri/pkg/plugin" + validator "github.com/containerd/nri/plugins/default-validator/builtin" + + rspec "github.com/opencontainers/runtime-spec/specs-go" + + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/testing/protocmp" +) + +type testbase struct { + runtime []RuntimeOption + plugins map[string][]PluginOption +} + +func (b *testbase) Plugins(t *testing.T, dir string, events chan<- Event) []*Plugin { + var ( + ids = slices.Sorted(maps.Keys(b.plugins)) + plugins = []*Plugin{} + ) + + for _, id := range ids { + var ( + indexName = strings.SplitN(id, "-", 2) + options = append( + []PluginOption{ + WithPluginIndex(indexName[0]), + WithPluginName(indexName[1]), + }, + b.plugins[id]..., + ) + ) + + plugins = append(plugins, NewPlugin(t, dir, events, options...)) + } + + return plugins +} + +func (b *testbase) Setup(t *testing.T) (*Suite, *EventCollector) { + var ( + dir = t.TempDir() + evt = StartEventCollector() + sut = NewSuite(t, dir, evt, + WithRuntimeOptions(b.runtime...), + WithPlugins(b.Plugins(t, dir, evt.Channel())...), + ) + ) + + return sut, evt +} + +func TestAdaptationSetup(t *testing.T) { + var ( + syncCB = func(context.Context, nri.SyncCB) error { + return nil + } + updateCB = func(context.Context, []*api.ContainerUpdate) ([]*api.ContainerUpdate, error) { + return nil, nil + } + ) + + t.Run("nil runtime synchronize callback", func(t *testing.T) { + r, err := nri.New( + TestRuntimeName, + TestRuntimeVersion, + nil, + updateCB, + ) + require.Nil(t, r, "adaptation creation should return nil adaptation") + require.NotNil(t, err, "adaptation creation should fail with error") + }) + + t.Run("nil runtime unsolicited plugin update callback", func(t *testing.T) { + r, err := nri.New( + TestRuntimeName, + TestRuntimeVersion, + syncCB, + nil, + ) + require.Nil(t, r, "adaptation creation should return nil adaptation") + require.NotNil(t, err, "adaptation creation should fail with error") + }) + + t.Run("non-nil runtime callbacks", func(t *testing.T) { + r, err := nri.New( + TestRuntimeName, + TestRuntimeVersion, + syncCB, + updateCB, + ) + require.NotNil(t, r, "adaptation creation should return non-nil adaptation") + require.Nil(t, err, "adaptation creation should succeed, with nil error") + }) +} + +func TestAdaptationConfig(t *testing.T) { + type testcase struct { + *testbase + name string + verify func(*testing.T) + } + + var ( + sut *Suite + evt *EventCollector + ) + + const ( + maxWait = 2 * time.Second + ) + + for _, tc := range []*testcase{ + { + name: "disable external plugin connections", + testbase: &testbase{ + runtime: []RuntimeOption{ + WithNRIRuntimeOptions( + nri.WithDisabledExternalConnections(), + ), + }, + plugins: map[string][]PluginOption{ + "00-test": {}, + }, + }, + verify: func(t *testing.T) { + _, ok := evt.Search( + OrderedEventsOccurred( + RuntimeStarted, + PluginFailed("00-test", os.ErrNotExist), + ), + UntilTimeout(maxWait), + ) + require.True(t, ok, "plugin connections should fail") + }, + }, + { + name: "enable external plugin connections", + testbase: &testbase{ + runtime: []RuntimeOption{}, + plugins: map[string][]PluginOption{ + "00-test": {}, + }, + }, + verify: func(t *testing.T) { + _, ok := evt.Search( + OrderedEventsOccurred( + RuntimeStarted, + PluginSynchronized("00-test", nil, nil), + ), + UntilTimeout(maxWait), + ) + require.True(t, ok, "plugins should be able to connect") + }, + }, + { + name: "plugin registration timeout", + testbase: &testbase{ + runtime: []RuntimeOption{ + WithPluginRegistrationTimeout(1 * time.Nanosecond), + }, + plugins: map[string][]PluginOption{ + "00-test": {}, + }, + }, + verify: func(t *testing.T) { + _, ok := evt.Search( + OrderedEventsOccurred( + RuntimeStarted, + PluginClosed("00-test"), + ), + UntilTimeout(maxWait), + ) + require.True(t, ok, "plugin connection should be closed") + }, + }, + { + name: "plugin request timeout", + testbase: &testbase{ + runtime: []RuntimeOption{ + WithPluginRequestTimeout(100 * time.Microsecond), + }, + plugins: map[string][]PluginOption{ + "00-test": { + WithHandlers( + Handlers{ + Configure: func(_, _, _ string) (api.EventMask, error) { + time.Sleep(110 * time.Millisecond) + return 0, nil + }, + }, + ), + }, + }, + }, + verify: func(t *testing.T) { + _, ok := evt.Search( + OrderedEventsOccurred( + RuntimeStarted, + PluginClosed("00-test"), + ), + UntilTimeout(maxWait), + ) + require.True(t, ok, "plugin connection should be closed") + time.Sleep(2 * time.Second) + }, + }, + } { + t.Run(tc.name, func(t *testing.T) { + sut, evt = tc.Setup(t) + sut.Start() + defer func() { sut.Stop(); evt.Stop() }() + tc.verify(t) + }) + } +} + +func TestPluginConfiguration(t *testing.T) { + type testcase struct { + *testbase + name string + expect *PluginEvent + } + + var ( + sut *Suite + evt *EventCollector + ) + + const ( + runtimeName = "custom-runtime-name" + runtimeVersion = "v5.6.7" + registerTimeout = 4 * nri.DefaultPluginRegistrationTimeout / 5 + requestTimeout = 3 * nri.DefaultPluginRequestTimeout / 4 + ) + + for _, tc := range []*testcase{ + { + name: "with default runtime configuration", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": {}, + }, + }, + expect: PluginConfigured( + "00-test", + TestRuntimeName, + TestRuntimeVersion, + nri.DefaultPluginRegistrationTimeout, + nri.DefaultPluginRequestTimeout, + ), + }, + { + name: "with given runtime name and version", + testbase: &testbase{ + runtime: []RuntimeOption{ + WithRuntimeName(runtimeName), + WithRuntimeVersion(runtimeVersion), + }, + plugins: map[string][]PluginOption{ + "00-test": {}, + }, + }, + expect: PluginConfigured( + "00-test", + runtimeName, + runtimeVersion, + nri.DefaultPluginRegistrationTimeout, + nri.DefaultPluginRequestTimeout, + ), + }, + { + name: "with given registration and request timeouts", + testbase: &testbase{ + runtime: []RuntimeOption{ + WithPluginRegistrationTimeout(registerTimeout), + WithPluginRequestTimeout(requestTimeout), + }, + plugins: map[string][]PluginOption{ + "00-test": {}, + }, + }, + expect: PluginConfigured( + "00-test", + TestRuntimeName, + TestRuntimeVersion, + registerTimeout, + requestTimeout, + ), + }, + } { + t.Run(tc.name, func(t *testing.T) { + sut, evt = tc.Setup(t) + sut.Start(WithWaitForPluginsToStart()) + evt.Emit(EndMarker) + _, occurred := evt.Search( + EventOccurred( + tc.expect, + ), + UntilEnd, + ) + require.True(t, occurred, "plugin configured as expected") + }) + + require.NoError(t, sut.Stop(WithWaitForPluginsToClose()), "test shutdown") + evt.Stop() + } +} + +func TestEventSubscription(t *testing.T) { + type testcase struct { + *testbase + name string + expect []Event + reject []Event + } + + var ( + sut *Suite + evt *EventCollector + tc *testcase + ) + + v1beta1Subscribe := func(events ...string) PluginOption { + return WithHandlers( + Handlers{ + Configure: func(_, _, _ string) (api.EventMask, error) { + return api.ParseEventMask(events...) + }, + }, + ) + } + + v1alpha1Subscribe := func(events ...string) PluginOption { + return WithV1alpha1( + V1alpha1Handlers{ + Configure: func(_, _, _ string) (v1alpha1.EventMask, error) { + return v1alpha1.ParseEventMask(events...) + }, + }, + ) + } + + builtinSubscribe := func(events ...string) PluginOption { + return WithBuiltin( + BuiltinHandlers{ + Configure: func(_ *api.ConfigureRequest) (*api.ConfigureResponse, error) { + mask, err := api.ParseEventMask(events...) + if err != nil { + return nil, err + } + return &api.ConfigureResponse{ + Events: int32(mask), + }, nil + }, + }, + ) + } + + for pluginType, subscribe := range map[string]func(events ...string) PluginOption{ + "v1beta1": v1beta1Subscribe, + "v1alpha1": v1alpha1Subscribe, + "builtin": builtinSubscribe, + } { + t.Run(pluginType, func(t *testing.T) { + for _, tc = range []*testcase{ + { + name: "RunPodSandbox", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + subscribe("RunPodSandbox"), + }, + }, + }, + expect: []Event{ + PluginConfigured("00-test", "", "", 0, 0), + PluginSynchronized("00-test", nil, nil), + PluginRunPodSandbox("00-test", nil), + }, + reject: []Event{ + PluginUpdatePodSandbox("00-test", nil, nil, nil), + PluginPostUpdatePodSandbox("00-test", nil), + PluginStopPodSandbox("00-test", nil), + PluginRemovePodSandbox("00-test", nil), + }, + }, + { + name: "UpdatePodSandbox", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + subscribe("UpdatePodSandbox"), + }, + }, + }, + expect: []Event{ + PluginConfigured("00-test", "", "", 0, 0), + PluginSynchronized("00-test", nil, nil), + PluginUpdatePodSandbox("00-test", nil, nil, nil), + }, + reject: []Event{ + PluginRunPodSandbox("00-test", nil), + PluginPostUpdatePodSandbox("00-test", nil), + PluginStopPodSandbox("00-test", nil), + PluginRemovePodSandbox("00-test", nil), + }, + }, + { + name: "PostUpdatePodSandbox", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + subscribe("PostUpdatePodSandbox"), + }, + }, + }, + expect: []Event{ + PluginConfigured("00-test", "", "", 0, 0), + PluginSynchronized("00-test", nil, nil), + PluginPostUpdatePodSandbox("00-test", nil), + }, + reject: []Event{ + PluginRunPodSandbox("00-test", nil), + PluginUpdatePodSandbox("00-test", nil, nil, nil), + PluginStopPodSandbox("00-test", nil), + PluginRemovePodSandbox("00-test", nil), + }, + }, + { + name: "StopPodSandbox", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + subscribe("StopPodSandbox"), + }, + }, + }, + expect: []Event{ + PluginConfigured("00-test", "", "", 0, 0), + PluginSynchronized("00-test", nil, nil), + PluginStopPodSandbox("00-test", nil), + }, + reject: []Event{ + PluginRunPodSandbox("00-test", nil), + PluginUpdatePodSandbox("00-test", nil, nil, nil), + PluginPostUpdatePodSandbox("00-test", nil), + PluginRemovePodSandbox("00-test", nil), + }, + }, + { + name: "RemovePodSandbox", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + subscribe("RemovePodSandbox"), + }, + }, + }, + expect: []Event{ + PluginConfigured("00-test", "", "", 0, 0), + PluginSynchronized("00-test", nil, nil), + PluginRemovePodSandbox("00-test", nil), + }, + reject: []Event{ + PluginRunPodSandbox("00-test", nil), + PluginUpdatePodSandbox("00-test", nil, nil, nil), + PluginPostUpdatePodSandbox("00-test", nil), + PluginStopPodSandbox("00-test", nil), + }, + }, + { + name: "all pod events", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + subscribe( + "RunPodSandbox", + "UpdatePodSandbox", + "PostUpdatePodSandbox", + "StopPodSandbox", + "RemovePodSandbox", + ), + }, + }, + }, + expect: []Event{ + PluginConfigured("00-test", "", "", 0, 0), + PluginSynchronized("00-test", nil, nil), + PluginRunPodSandbox("00-test", nil), + PluginUpdatePodSandbox("00-test", nil, nil, nil), + PluginPostUpdatePodSandbox("00-test", nil), + PluginStopPodSandbox("00-test", nil), + PluginRemovePodSandbox("00-test", nil), + }, + reject: []Event{ + PluginCreateContainer("00-test", nil, nil), + PluginPostCreateContainer("00-test", nil, nil), + PluginStartContainer("00-test", nil, nil), + PluginPostStartContainer("00-test", nil, nil), + PluginUpdateContainer("00-test", nil, nil, nil), + PluginPostUpdateContainer("00-test", nil, nil), + PluginStopContainer("00-test", nil, nil), + PluginRemoveContainer("00-test", nil, nil), + }, + }, + { + name: "CreateContainer", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + subscribe("CreateContainer"), + }, + }, + }, + expect: []Event{ + PluginConfigured("00-test", "", "", 0, 0), + PluginSynchronized("00-test", nil, nil), + PluginCreateContainer("00-test", nil, nil), + }, + reject: []Event{ + PluginRunPodSandbox("00-test", nil), + PluginUpdatePodSandbox("00-test", nil, nil, nil), + PluginPostUpdatePodSandbox("00-test", nil), + PluginStopPodSandbox("00-test", nil), + PluginRemovePodSandbox("00-test", nil), + PluginPostCreateContainer("00-test", nil, nil), + PluginStartContainer("00-test", nil, nil), + PluginPostStartContainer("00-test", nil, nil), + PluginUpdateContainer("00-test", nil, nil, nil), + PluginPostUpdateContainer("00-test", nil, nil), + PluginStopContainer("00-test", nil, nil), + PluginRemoveContainer("00-test", nil, nil), + }, + }, + { + name: "PostCreateContainer", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + subscribe("PostCreateContainer"), + }, + }, + }, + expect: []Event{ + PluginConfigured("00-test", "", "", 0, 0), + PluginSynchronized("00-test", nil, nil), + PluginPostCreateContainer("00-test", nil, nil), + }, + reject: []Event{ + PluginRunPodSandbox("00-test", nil), + PluginUpdatePodSandbox("00-test", nil, nil, nil), + PluginPostUpdatePodSandbox("00-test", nil), + PluginStopPodSandbox("00-test", nil), + PluginRemovePodSandbox("00-test", nil), + PluginCreateContainer("00-test", nil, nil), + PluginStartContainer("00-test", nil, nil), + PluginPostStartContainer("00-test", nil, nil), + PluginUpdateContainer("00-test", nil, nil, nil), + PluginPostUpdateContainer("00-test", nil, nil), + PluginStopContainer("00-test", nil, nil), + PluginRemoveContainer("00-test", nil, nil), + }, + }, + { + name: "StartContainer", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + subscribe("StartContainer"), + }, + }, + }, + expect: []Event{ + PluginConfigured("00-test", "", "", 0, 0), + PluginSynchronized("00-test", nil, nil), + PluginStartContainer("00-test", nil, nil), + }, + reject: []Event{ + PluginRunPodSandbox("00-test", nil), + PluginUpdatePodSandbox("00-test", nil, nil, nil), + PluginPostUpdatePodSandbox("00-test", nil), + PluginStopPodSandbox("00-test", nil), + PluginRemovePodSandbox("00-test", nil), + PluginCreateContainer("00-test", nil, nil), + PluginPostCreateContainer("00-test", nil, nil), + PluginPostStartContainer("00-test", nil, nil), + PluginUpdateContainer("00-test", nil, nil, nil), + PluginPostUpdateContainer("00-test", nil, nil), + PluginStopContainer("00-test", nil, nil), + PluginRemoveContainer("00-test", nil, nil), + }, + }, + { + name: "PostStartContainer", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + subscribe("PostStartContainer"), + }, + }, + }, + expect: []Event{ + PluginConfigured("00-test", "", "", 0, 0), + PluginSynchronized("00-test", nil, nil), + PluginPostStartContainer("00-test", nil, nil), + }, + reject: []Event{ + PluginRunPodSandbox("00-test", nil), + PluginUpdatePodSandbox("00-test", nil, nil, nil), + PluginPostUpdatePodSandbox("00-test", nil), + PluginStopPodSandbox("00-test", nil), + PluginRemovePodSandbox("00-test", nil), + PluginCreateContainer("00-test", nil, nil), + PluginPostCreateContainer("00-test", nil, nil), + PluginStartContainer("00-test", nil, nil), + PluginUpdateContainer("00-test", nil, nil, nil), + PluginPostUpdateContainer("00-test", nil, nil), + PluginStopContainer("00-test", nil, nil), + PluginRemoveContainer("00-test", nil, nil), + }, + }, + { + name: "UpdateContainer", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + subscribe("UpdateContainer"), + }, + }, + }, + expect: []Event{ + PluginConfigured("00-test", "", "", 0, 0), + PluginSynchronized("00-test", nil, nil), + PluginUpdateContainer("00-test", nil, nil, nil), + }, + reject: []Event{ + PluginRunPodSandbox("00-test", nil), + PluginUpdatePodSandbox("00-test", nil, nil, nil), + PluginPostUpdatePodSandbox("00-test", nil), + PluginStopPodSandbox("00-test", nil), + PluginRemovePodSandbox("00-test", nil), + PluginCreateContainer("00-test", nil, nil), + PluginPostCreateContainer("00-test", nil, nil), + PluginStartContainer("00-test", nil, nil), + PluginPostStartContainer("00-test", nil, nil), + PluginPostUpdateContainer("00-test", nil, nil), + PluginStopContainer("00-test", nil, nil), + PluginRemoveContainer("00-test", nil, nil), + }, + }, + { + name: "PostUpdateContainer", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + subscribe("PostUpdateContainer"), + }, + }, + }, + expect: []Event{ + PluginConfigured("00-test", "", "", 0, 0), + PluginSynchronized("00-test", nil, nil), + PluginPostUpdateContainer("00-test", nil, nil), + }, + reject: []Event{ + PluginRunPodSandbox("00-test", nil), + PluginUpdatePodSandbox("00-test", nil, nil, nil), + PluginPostUpdatePodSandbox("00-test", nil), + PluginStopPodSandbox("00-test", nil), + PluginRemovePodSandbox("00-test", nil), + PluginCreateContainer("00-test", nil, nil), + PluginPostCreateContainer("00-test", nil, nil), + PluginStartContainer("00-test", nil, nil), + PluginPostStartContainer("00-test", nil, nil), + PluginUpdateContainer("00-test", nil, nil, nil), + PluginStopContainer("00-test", nil, nil), + PluginRemoveContainer("00-test", nil, nil), + }, + }, + { + name: "StopContainer", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + subscribe("StopContainer"), + }, + }, + }, + expect: []Event{ + PluginConfigured("00-test", "", "", 0, 0), + PluginSynchronized("00-test", nil, nil), + PluginStopContainer("00-test", nil, nil), + }, + reject: []Event{ + PluginRunPodSandbox("00-test", nil), + PluginUpdatePodSandbox("00-test", nil, nil, nil), + PluginPostUpdatePodSandbox("00-test", nil), + PluginStopPodSandbox("00-test", nil), + PluginRemovePodSandbox("00-test", nil), + PluginCreateContainer("00-test", nil, nil), + PluginPostCreateContainer("00-test", nil, nil), + PluginStartContainer("00-test", nil, nil), + PluginPostStartContainer("00-test", nil, nil), + PluginUpdateContainer("00-test", nil, nil, nil), + PluginPostUpdateContainer("00-test", nil, nil), + PluginRemoveContainer("00-test", nil, nil), + }, + }, + { + name: "RemoveContainer", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + subscribe("RemoveContainer"), + }, + }, + }, + expect: []Event{ + PluginConfigured("00-test", "", "", 0, 0), + PluginSynchronized("00-test", nil, nil), + PluginRemoveContainer("00-test", nil, nil), + }, + reject: []Event{ + PluginRunPodSandbox("00-test", nil), + PluginUpdatePodSandbox("00-test", nil, nil, nil), + PluginPostUpdatePodSandbox("00-test", nil), + PluginStopPodSandbox("00-test", nil), + PluginRemovePodSandbox("00-test", nil), + PluginCreateContainer("00-test", nil, nil), + PluginPostCreateContainer("00-test", nil, nil), + PluginStartContainer("00-test", nil, nil), + PluginPostStartContainer("00-test", nil, nil), + PluginUpdateContainer("00-test", nil, nil, nil), + PluginPostUpdateContainer("00-test", nil, nil), + PluginStopContainer("00-test", nil, nil), + }, + }, + { + name: "all container events", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + subscribe( + "CreateContainer", + "PostCreateContainer", + "StartContainer", + "PostStartContainer", + "UpdateContainer", + "PostUpdateContainer", + "StopContainer", + "RemoveContainer", + ), + }, + }, + }, + expect: []Event{ + PluginConfigured("00-test", "", "", 0, 0), + PluginSynchronized("00-test", nil, nil), + PluginCreateContainer("00-test", nil, nil), + PluginPostCreateContainer("00-test", nil, nil), + PluginStartContainer("00-test", nil, nil), + PluginPostStartContainer("00-test", nil, nil), + PluginUpdateContainer("00-test", nil, nil, nil), + PluginPostUpdateContainer("00-test", nil, nil), + PluginStopContainer("00-test", nil, nil), + PluginRemoveContainer("00-test", nil, nil), + }, + reject: []Event{ + PluginRunPodSandbox("00-test", nil), + PluginUpdatePodSandbox("00-test", nil, nil, nil), + PluginPostUpdatePodSandbox("00-test", nil), + PluginStopPodSandbox("00-test", nil), + PluginRemovePodSandbox("00-test", nil), + }, + }, + { + name: "all pod and container events", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + subscribe( + "RunPodSandbox", + "UpdatePodSandbox", + "PostUpdatePodSandbox", + "StopPodSandbox", + "RemovePodSandbox", + "CreateContainer", + "PostCreateContainer", + "StartContainer", + "PostStartContainer", + "UpdateContainer", + "PostUpdateContainer", + "StopContainer", + "RemoveContainer", + ), + }, + }, + }, + expect: []Event{ + PluginConfigured("00-test", "", "", 0, 0), + PluginSynchronized("00-test", nil, nil), + PluginRunPodSandbox("00-test", nil), + PluginUpdatePodSandbox("00-test", nil, nil, nil), + PluginPostUpdatePodSandbox("00-test", nil), + PluginStopPodSandbox("00-test", nil), + PluginRemovePodSandbox("00-test", nil), + PluginCreateContainer("00-test", nil, nil), + PluginPostCreateContainer("00-test", nil, nil), + PluginStartContainer("00-test", nil, nil), + PluginPostStartContainer("00-test", nil, nil), + PluginUpdateContainer("00-test", nil, nil, nil), + PluginPostUpdateContainer("00-test", nil, nil), + PluginStopContainer("00-test", nil, nil), + PluginRemoveContainer("00-test", nil, nil), + }, + }, + } { + t.Run(tc.name, func(t *testing.T) { + sut, evt = tc.Setup(t) + sut.Start(WithWaitForPluginsToStart()) + + pod := sut.NewPod( + WithPodRandomFill(), + WithPodName("pod0"), + ) + + ctr := sut.NewContainer( + WithContainerRandomFill(), + WithContainerPod(pod), + WithContainerName("ctr0"), + ) + + require.NoError(t, sut.StartUpdateStopPodAndContainer(pod, ctr)) + evt.Emit(EndMarker) + + for _, expected := range tc.expect { + _, occurred := evt.Search( + EventOccurred(expected), + UntilEnd, + ) + require.True(t, occurred, "expected event %s occurred", expected) + } + + for _, rejected := range tc.reject { + _, occurred := evt.Search( + EventOccurred(rejected), + UntilEnd, + ) + require.False(t, occurred, "unexpected event %s occurred", rejected) + } + + require.NoError(t, sut.Stop(WithWaitForPluginsToClose()), "test shutdown") + evt.Stop() + }) + } + }) + } +} + +func TestContainerAdjustment(t *testing.T) { + type testcase struct { + *testbase + name string + expect *api.ContainerAdjustment + } + + var ( + sut *Suite + evt *EventCollector + ) + + adjust := func(fn func(*api.ContainerAdjustment)) PluginOption { + return WithHandlers( + Handlers{ + Configure: func(_, _, _ string) (api.EventMask, error) { + return api.Event_CREATE_CONTAINER.Mask(), nil + }, + CreateContainer: func(_ *api.PodSandbox, _ *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) { + a := &api.ContainerAdjustment{} + fn(a) + return a, nil, nil + }, + }, + ) + } + + for _, tc := range []*testcase{ + { + name: "adjust annotations", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddAnnotation("key", "00-test") + }), + }, + }, + }, + expect: &api.ContainerAdjustment{ + Annotations: map[string]string{ + "key": "00-test", + }, + }, + }, + { + name: "adjust mounts", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddMount(&api.Mount{ + Source: "/dev/00-test", + Destination: "/mnt/test", + }) + }), + }, + }, + }, + expect: &api.ContainerAdjustment{ + Mounts: []*api.Mount{ + { + Source: "/dev/00-test", + Destination: "/mnt/test", + }, + }, + }, + }, + { + name: "adjust environment", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddEnv("00-test", "true") + }), + }, + }, + }, + expect: &api.ContainerAdjustment{ + Env: []*api.KeyValue{ + { + Key: "00-test", + Value: "true", + }, + }, + }, + }, + { + name: "adjust OCI hooks", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddHooks(&api.Hooks{ + CreateRuntime: []*api.Hook{ + { + Path: "/bin/00-test", + Args: []string{"/bin/00-test", "arg1", "arg2"}, + }, + }, + }) + }), + }, + }, + }, + expect: &api.ContainerAdjustment{ + Hooks: &api.Hooks{ + CreateRuntime: []*api.Hook{ + { + Path: "/bin/00-test", + Args: []string{"/bin/00-test", "arg1", "arg2"}, + }, + }, + }, + }, + }, + { + name: "adjust Linux devices", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddDevice(&api.LinuxDevice{ + Path: "/dev/00-test", + Type: "c", + Major: 1, + Minor: 2, + FileMode: api.FileMode(0o644), + Uid: api.UInt32(1000), + Gid: api.UInt32(1001), + }) + }), + }, + }, + }, + expect: &api.ContainerAdjustment{ + Linux: &api.LinuxContainerAdjustment{ + Devices: []*api.LinuxDevice{ + { + Path: "/dev/00-test", + Type: "c", + Major: 1, + Minor: 2, + FileMode: api.FileMode(0o644), + Uid: api.UInt32(1000), + Gid: api.UInt32(1001), + }, + }, + }, + }, + }, + { + name: "adjust Linux resources", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.SetLinuxMemoryLimit(1) + a.SetLinuxMemoryReservation(2) + a.SetLinuxMemorySwap(3) + a.SetLinuxMemoryKernel(4) + a.SetLinuxMemoryKernelTCP(5) + a.SetLinuxMemorySwappiness(6) + a.SetLinuxMemoryDisableOomKiller() + a.SetLinuxMemoryUseHierarchy() + a.SetLinuxCPUShares(10) + a.SetLinuxCPUQuota(20) + a.SetLinuxCPUPeriod(30) + a.SetLinuxCPURealtimeRuntime(40) + a.SetLinuxCPURealtimePeriod(50) + a.SetLinuxCPUSetCPUs("0-3") + a.SetLinuxCPUSetMems("1") + a.AddLinuxHugepageLimit("2MB", 1024) + a.AddLinuxHugepageLimit("1GB", 2048) + a.SetLinuxBlockIOClass("blockio-class1") + a.SetLinuxRDTClass("rdt-class1") + a.AddLinuxUnified("key1", "value1") + a.AddLinuxUnified("key2", "value2") + // FIXME: no convenience method for cgroup device rules + a.Linux.Resources.Devices = []*api.LinuxDeviceCgroup{ + { + Allow: true, + Type: "c", + Major: api.Int64(1), + Minor: api.Int64(2), + Access: "rwm", + }, + { + Allow: false, + Type: "b", + Major: api.Int64(3), + Minor: api.Int64(4), + Access: "rm", + }, + } + a.SetLinuxPidLimits(100) + }), + }, + }, + }, + expect: &api.ContainerAdjustment{ + Linux: &api.LinuxContainerAdjustment{ + Resources: &api.LinuxResources{ + Memory: &api.LinuxMemory{ + Limit: api.Int64(1), + Reservation: api.Int64(2), + Swap: api.Int64(3), + Kernel: api.Int64(4), + KernelTcp: api.Int64(5), + Swappiness: api.UInt64(6), + DisableOomKiller: api.Bool(true), + UseHierarchy: api.Bool(true), + }, + Cpu: &api.LinuxCPU{ + Shares: api.UInt64(10), + Quota: api.Int64(20), + Period: api.UInt64(30), + RealtimeRuntime: api.Int64(40), + RealtimePeriod: api.UInt64(50), + Cpus: "0-3", + Mems: "1", + }, + HugepageLimits: []*api.HugepageLimit{ + { + PageSize: "2MB", + Limit: 1024, + }, + { + PageSize: "1GB", + Limit: 2048, + }, + }, + BlockioClass: api.String("blockio-class1"), + RdtClass: api.String("rdt-class1"), + Unified: map[string]string{ + "key1": "value1", + "key2": "value2", + }, + Devices: []*api.LinuxDeviceCgroup{ + { + Allow: true, + Type: "c", + Major: api.Int64(1), + Minor: api.Int64(2), + Access: "rwm", + }, + { + Allow: false, + Type: "b", + Major: api.Int64(3), + Minor: api.Int64(4), + Access: "rm", + }, + }, + Pids: &api.LinuxPids{ + Limit: 100, + }, + }, + }, + }, + }, + { + name: "adjust cgroups path", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.SetLinuxCgroupsPath("/sys/fs/cgroups/00-test") + }), + }, + }, + }, + expect: &api.ContainerAdjustment{ + Linux: &api.LinuxContainerAdjustment{ + CgroupsPath: "/sys/fs/cgroups/00-test", + }, + }, + }, + { + name: "adjust OOM score adjustment", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + v := 987 + a.SetLinuxOomScoreAdj(&v) + }), + }, + }, + }, + expect: &api.ContainerAdjustment{ + Linux: &api.LinuxContainerAdjustment{ + OomScoreAdj: api.Int(987), + }, + }, + }, + { + name: "adjust I/O priority", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.SetLinuxIOPriority(&nri.LinuxIOPriority{ + Class: api.IOPrioClass_IOPRIO_CLASS_RT, + Priority: 5, + }) + }), + }, + }, + }, + expect: &api.ContainerAdjustment{ + Linux: &api.LinuxContainerAdjustment{ + IoPriority: &api.LinuxIOPriority{ + Class: api.IOPrioClass_IOPRIO_CLASS_RT, + Priority: 5, + }, + }, + }, + }, + { + name: "adjust seccomp policy", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.SetLinuxSeccompPolicy( + func() *api.LinuxSeccomp { + seccomp := rspec.LinuxSeccomp{ + DefaultAction: rspec.ActAllow, + ListenerPath: "/run/meshuggah-rocks.sock", + Architectures: []rspec.Arch{}, + Flags: []rspec.LinuxSeccompFlag{}, + Syscalls: []rspec.LinuxSyscall{{ + Names: []string{"sched_getaffinity"}, + Action: rspec.ActNotify, + Args: []rspec.LinuxSeccompArg{}, + }}, + } + return api.FromOCILinuxSeccomp(&seccomp) + }(), + ) + }), + }, + }, + }, + expect: &api.ContainerAdjustment{ + Linux: &api.LinuxContainerAdjustment{ + SeccompPolicy: func() *api.LinuxSeccomp { + seccomp := rspec.LinuxSeccomp{ + DefaultAction: rspec.ActAllow, + ListenerPath: "/run/meshuggah-rocks.sock", + Architectures: []rspec.Arch{}, + Flags: []rspec.LinuxSeccompFlag{}, + Syscalls: []rspec.LinuxSyscall{{ + Names: []string{"sched_getaffinity"}, + Action: rspec.ActNotify, + Args: []rspec.LinuxSeccompArg{}, + }}, + } + return api.FromOCILinuxSeccomp(&seccomp) + }(), + }, + }, + }, + { + name: "adjust namespaces", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddOrReplaceNamespace(&nri.LinuxNamespace{ + Type: "cgroup", + Path: "/tmp/00-test", + }) + }), + }, + }, + }, + expect: &api.ContainerAdjustment{ + Linux: &api.LinuxContainerAdjustment{ + Namespaces: []*api.LinuxNamespace{ + { + Type: "cgroup", + Path: "/tmp/00-test", + }, + }, + }, + }, + }, + { + name: "adjust POSIX rlimits", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddRlimit("nofile", 456, 123) + }), + }, + }, + }, + expect: &api.ContainerAdjustment{ + Rlimits: []*api.POSIXRlimit{{Type: "nofile", Soft: 123, Hard: 456}}, + }, + }, + { + name: "adjust CDI devices", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddCDIDevice( + &api.CDIDevice{ + Name: "vendor0.com/dev=dev0", + }, + ) + }), + }, + }, + }, + expect: &api.ContainerAdjustment{ + CDIDevices: []*api.CDIDevice{ + { + Name: "vendor0.com/dev=dev0", + }, + }, + }, + }, + { + name: "adjust arguments", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.SetArgs([]string{ + "echo", + "updated", + "argument", + "list", + }) + }), + }, + }, + }, + expect: &api.ContainerAdjustment{ + Args: []string{ + "echo", + "updated", + "argument", + "list", + }, + }, + }, + } { + t.Run(tc.name, func(t *testing.T) { + sut, evt = tc.Setup(t) + sut.Start(WithWaitForPluginsToStart()) + + pod := sut.NewPod( + WithPodRandomFill(), + WithPodName("pod0"), + ) + + ctr := sut.NewContainer( + WithContainerRandomFill(), + WithContainerPod(pod), + WithContainerName("ctr0"), + ) + + adjust, _, err := sut.CreateContainer(pod, ctr) + require.NoError(t, err, "CreateContainer should succeed") + require.True(t, + protoEqual(tc.expect.Strip(), adjust.Strip()), + "container adjustment matches expected: %s", + protoDiff(tc.expect.Strip(), adjust.Strip()), + ) + }) + + require.NoError(t, sut.Stop(WithWaitForPluginsToClose()), "test shutdown") + evt.Stop() + } +} + +func TestContainerAdjustmentConflictDetection(t *testing.T) { + type testcase struct { + *testbase + name string + } + + var ( + sut *Suite + evt *EventCollector + ) + + adjust := func(fn func(*api.ContainerAdjustment)) PluginOption { + return WithHandlers( + Handlers{ + Configure: func(_, _, _ string) (api.EventMask, error) { + return api.Event_CREATE_CONTAINER.Mask(), nil + }, + CreateContainer: func(_ *api.PodSandbox, _ *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) { + a := &api.ContainerAdjustment{} + fn(a) + return a, nil, nil + }, + }, + ) + } + + for _, tc := range []*testcase{ + { + name: "adjust annotations", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddAnnotation("key", "00-test") + }), + }, + "01-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddAnnotation("key", "01-test") + }), + }, + }, + }, + }, + { + name: "adjust mounts", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddMount(&api.Mount{ + Source: "/dev/00-test", + Destination: "/mnt/test", + }) + }), + }, + "01-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddMount(&api.Mount{ + Source: "/dev/01-test", + Destination: "/mnt/test", + }) + }), + }, + }, + }, + }, + { + name: "adjust environment", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddEnv("00-test", "true") + }), + }, + "01-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddEnv("00-test", "false") + }), + }, + }, + }, + }, + // no test for OCI hooks: they are collected unconditionally, without conflicts + { + name: "adjust Linux devices", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddDevice(&api.LinuxDevice{ + Path: "/dev/00-test", + Type: "c", + Major: 1, + Minor: 2, + FileMode: api.FileMode(0o644), + Uid: api.UInt32(1000), + Gid: api.UInt32(1001), + }) + }), + }, + "01-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddDevice(&api.LinuxDevice{ + Path: "/dev/00-test", + Type: "b", + Major: 3, + Minor: 4, + FileMode: api.FileMode(0o600), + Uid: api.UInt32(2000), + Gid: api.UInt32(2001), + }) + }), + }, + }, + }, + }, + { + name: "adjust Linux resources", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.SetLinuxMemoryLimit(1) + a.SetLinuxMemoryReservation(2) + a.SetLinuxMemorySwap(3) + a.SetLinuxMemoryKernel(4) + a.SetLinuxMemoryKernelTCP(5) + a.SetLinuxMemorySwappiness(6) + a.SetLinuxMemoryDisableOomKiller() + a.SetLinuxMemoryUseHierarchy() + a.SetLinuxCPUShares(10) + a.SetLinuxCPUQuota(20) + a.SetLinuxCPUPeriod(30) + a.SetLinuxCPURealtimeRuntime(40) + a.SetLinuxCPURealtimePeriod(50) + a.SetLinuxCPUSetCPUs("0-3") + a.SetLinuxCPUSetMems("1") + a.AddLinuxHugepageLimit("2MB", 1024) + a.AddLinuxHugepageLimit("1GB", 2048) + a.SetLinuxBlockIOClass("blockio-class1") + a.SetLinuxRDTClass("rdt-class1") + a.AddLinuxUnified("key1", "value1") + a.AddLinuxUnified("key2", "value2") + // FIXME: no convenience method for cgroup device rules + a.Linux.Resources.Devices = []*api.LinuxDeviceCgroup{ + { + Allow: true, + Type: "c", + Major: api.Int64(1), + Minor: api.Int64(2), + Access: "rwm", + }, + { + Allow: false, + Type: "b", + Major: api.Int64(3), + Minor: api.Int64(4), + Access: "rm", + }, + } + a.SetLinuxPidLimits(100) + }), + }, + "01-test": { + adjust(func(a *api.ContainerAdjustment) { + a.SetLinuxCPUSetCPUs("0") + a.SetLinuxCPUSetMems("0") + }), + }, + }, + }, + }, + { + name: "adjust cgroups path", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.SetLinuxCgroupsPath("/sys/fs/cgroups/00-test") + }), + }, + "01-test": { + adjust(func(a *api.ContainerAdjustment) { + a.SetLinuxCgroupsPath("/sys/fs/cgroups/01-test") + }), + }, + }, + }, + }, + { + name: "adjust OOM score adjustment", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + v := 987 + a.SetLinuxOomScoreAdj(&v) + }), + }, + "01-test": { + adjust(func(a *api.ContainerAdjustment) { + v := 986 + a.SetLinuxOomScoreAdj(&v) + }), + }, + }, + }, + }, + { + name: "adjust I/O priority", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.SetLinuxIOPriority(&nri.LinuxIOPriority{ + Class: api.IOPrioClass_IOPRIO_CLASS_RT, + Priority: 5, + }) + }), + }, + "01-test": { + adjust(func(a *api.ContainerAdjustment) { + a.SetLinuxIOPriority(&nri.LinuxIOPriority{ + Class: api.IOPrioClass_IOPRIO_CLASS_IDLE, + Priority: 1, + }) + }), + }, + }, + }, + }, + { + name: "adjust seccomp policy", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.SetLinuxSeccompPolicy( + func() *api.LinuxSeccomp { + seccomp := rspec.LinuxSeccomp{ + DefaultAction: rspec.ActAllow, + ListenerPath: "/run/meshuggah-rocks.sock", + Architectures: []rspec.Arch{}, + Flags: []rspec.LinuxSeccompFlag{}, + Syscalls: []rspec.LinuxSyscall{{ + Names: []string{"sched_getaffinity"}, + Action: rspec.ActNotify, + Args: []rspec.LinuxSeccompArg{}, + }}, + } + return api.FromOCILinuxSeccomp(&seccomp) + }(), + ) + }), + }, + "01-test": { + adjust(func(a *api.ContainerAdjustment) { + a.SetLinuxSeccompPolicy( + func() *api.LinuxSeccomp { + seccomp := rspec.LinuxSeccomp{ + DefaultAction: rspec.ActAllow, + ListenerPath: "/run/megadeth-rocks.sock", + Architectures: []rspec.Arch{}, + Flags: []rspec.LinuxSeccompFlag{}, + Syscalls: []rspec.LinuxSyscall{{ + Names: []string{"sched_setaffinity"}, + Action: rspec.ActNotify, + Args: []rspec.LinuxSeccompArg{}, + }}, + } + return api.FromOCILinuxSeccomp(&seccomp) + }(), + ) + }), + }, + }, + }, + }, + { + name: "adjust namespaces", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddOrReplaceNamespace(&nri.LinuxNamespace{ + Type: "cgroup", + Path: "/tmp/00-test", + }) + }), + }, + "01-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddOrReplaceNamespace(&nri.LinuxNamespace{ + Type: "cgroup", + Path: "/tmp/01-test", + }) + }), + }, + }, + }, + }, + { + name: "adjust POSIX rlimits", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddRlimit("nofile", 456, 123) + }), + }, + "01-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddRlimit("nofile", 789, 456) + }), + }, + }, + }, + }, + { + name: "adjust CDI devices", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddCDIDevice( + &api.CDIDevice{ + Name: "vendor0.com/dev=dev0", + }, + ) + }), + }, + "01-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddCDIDevice( + &api.CDIDevice{ + Name: "vendor0.com/dev=dev0", + }, + ) + }), + }, + }, + }, + }, + { + name: "adjust arguments", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.SetArgs([]string{ + "echo", + "updated", + "argument", + "list", + }) + }), + }, + "01-test": { + adjust(func(a *api.ContainerAdjustment) { + a.SetArgs([]string{ + "echo", + "another", + "updated", + "argument", + "list", + }) + }), + }, + }, + }, + }, + } { + t.Run(tc.name, func(t *testing.T) { + sut, evt = tc.Setup(t) + sut.Start(WithWaitForPluginsToStart()) + + pod := sut.NewPod( + WithPodRandomFill(), + WithPodName("pod0"), + ) + + ctr := sut.NewContainer( + WithContainerRandomFill(), + WithContainerPod(pod), + WithContainerName("ctr0"), + ) + + adjust, _, err := sut.CreateContainer(pod, ctr) + require.Nil(t, adjust, "CreateContainer should fail") + require.Error(t, err, "CreateContainer should fail") + }) + + require.NoError(t, sut.Stop(WithWaitForPluginsToClose()), "test shutdown") + evt.Stop() + } + +} + +func TestContainerAdjustmentConflictAvoidance(t *testing.T) { + type testcase struct { + *testbase + name string + expect *api.ContainerAdjustment + } + + var ( + sut *Suite + evt *EventCollector + ) + + adjust := func(fn func(*api.ContainerAdjustment)) PluginOption { + return WithHandlers( + Handlers{ + Configure: func(_, _, _ string) (api.EventMask, error) { + return api.Event_CREATE_CONTAINER.Mask(), nil + }, + CreateContainer: func(_ *api.PodSandbox, _ *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) { + a := &api.ContainerAdjustment{} + fn(a) + return a, nil, nil + }, + }, + ) + } + + for _, tc := range []*testcase{ + { + name: "adjust annotations", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddAnnotation("key", "00-test") + }), + }, + "01-test": { + adjust(func(a *api.ContainerAdjustment) { + a.RemoveAnnotation("key") + a.AddAnnotation("key", "01-test") + }), + }, + }, + }, + expect: &api.ContainerAdjustment{ + Annotations: map[string]string{ + // TODO(klihub): do we need/want to leave the removal marker ? + // Do we want to leave it if the same key is not re-set, so that + // it can be used to remove an annotation from the final container ? + api.MarkForRemoval("key"): "", + "key": "01-test", + }, + }, + }, + { + name: "adjust mounts", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddMount(&api.Mount{ + Source: "/dev/00-test", + Destination: "/mnt/test", + }) + }), + }, + "01-test": { + adjust(func(a *api.ContainerAdjustment) { + a.RemoveMount("/mnt/test1") + a.RemoveMount("/mnt/test") + a.AddMount(&api.Mount{ + Source: "/dev/01-test", + Destination: "/mnt/test", + }) + }), + }, + }, + }, + expect: &api.ContainerAdjustment{ + Mounts: []*api.Mount{ + { + Source: "/dev/01-test", + Destination: "/mnt/test", + }, + { + Destination: api.MarkForRemoval("/mnt/test1"), + }, + }, + }, + }, + { + name: "adjust environment", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddEnv("00-test", "true") + }), + }, + "01-test": { + adjust(func(a *api.ContainerAdjustment) { + // TODO(klihub): This seems now inconsistent with + // annotations and mounts. Should we leave a removal + // marker in the collected adjustments if the same + // variable has not been re-set ? + // a.RemoveEnv("00-test1") + a.RemoveEnv("00-test") + a.AddEnv("00-test", "01-test") + }), + }, + }, + }, + expect: &api.ContainerAdjustment{ + Env: []*api.KeyValue{ + { + Key: "00-test", + Value: "01-test", + }, + }, + }, + }, + // no test for OCI hooks: they are collected unconditionally, without conflicts + { + name: "adjust Linux devices", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddDevice(&api.LinuxDevice{ + Path: "/dev/00-test", + Type: "c", + Major: 1, + Minor: 2, + FileMode: api.FileMode(0o644), + Uid: api.UInt32(1000), + Gid: api.UInt32(1001), + }) + }), + }, + "01-test": { + adjust(func(a *api.ContainerAdjustment) { + // TODO(klihub): this seems now inconsistent with mounts. + // Should we leave a removal marker in the collected adjustments + // if the same device has not been re-added ? + a.RemoveDevice("/dev/01-test") + a.RemoveDevice("/dev/00-test") + a.AddDevice(&api.LinuxDevice{ + Path: "/dev/00-test", + Type: "b", + Major: 3, + Minor: 4, + FileMode: api.FileMode(0o600), + Uid: api.UInt32(2000), + Gid: api.UInt32(2001), + }) + }), + }, + }, + }, + expect: &api.ContainerAdjustment{ + Linux: &api.LinuxContainerAdjustment{ + Devices: []*api.LinuxDevice{ + { + Path: "/dev/00-test", + Type: "b", + Major: 3, + Minor: 4, + FileMode: api.FileMode(0o600), + Uid: api.UInt32(2000), + Gid: api.UInt32(2001), + }, + }, + }, + }, + }, + // no test for Linux resources: multiple adjustments always conflict + // no test for cgroups path: multiple adjustments always conflict + // no test for OOM score adjustment: multiple adjustments always conflict + // no test for I/O priority: multiple adjustments always conflict + // no test for seccomp policy: multiple adjustments always conflict + // no test for namespaces: multiple adjustments always conflict + // no test for POSIX rlimits: multiple adjustments always conflict + // no test for CDI devices: multiple adjustments always conflict + { + name: "adjust arguments", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.SetArgs([]string{ + "echo", + "updated", + "argument", + "list", + }) + }), + }, + "01-test": { + adjust(func(a *api.ContainerAdjustment) { + a.UpdateArgs([]string{ + "echo", + "another", + "updated", + "argument", + "list", + }) + }), + }, + }, + }, + expect: &api.ContainerAdjustment{ + Args: []string{ + "echo", + "another", + "updated", + "argument", + "list", + }, + }, + }, + } { + t.Run(tc.name, func(t *testing.T) { + sut, evt = tc.Setup(t) + sut.Start(WithWaitForPluginsToStart()) + + pod := sut.NewPod( + WithPodRandomFill(), + WithPodName("pod0"), + ) + + ctr := sut.NewContainer( + WithContainerRandomFill(), + WithContainerPod(pod), + WithContainerName("ctr0"), + ) + + adjust, _, err := sut.CreateContainer(pod, ctr) + require.NoError(t, err, "CreateContainer should succeed") + require.True(t, + protoEqual(tc.expect.Strip(), adjust.Strip()), + "container adjustment matches expected: %s", + protoDiff(tc.expect.Strip(), adjust.Strip()), + ) + + require.NoError(t, sut.Stop(WithWaitForPluginsToClose()), "test shutdown") + evt.Stop() + }) + } +} + +func TestContainerAdjustmentCollection(t *testing.T) { + type testcase struct { + *testbase + name string + expect *api.ContainerAdjustment + } + + var ( + sut *Suite + evt *EventCollector + ) + + adjust := func(fn func(*api.ContainerAdjustment)) PluginOption { + return WithHandlers( + Handlers{ + Configure: func(_, _, _ string) (api.EventMask, error) { + return api.Event_CREATE_CONTAINER.Mask(), nil + }, + CreateContainer: func(_ *api.PodSandbox, _ *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) { + a := &api.ContainerAdjustment{} + fn(a) + return a, nil, nil + }, + }, + ) + } + + for _, tc := range []*testcase{ + { + name: "adjust everything in a container, by one plugin each", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddAnnotation("key", "00-test") + }), + }, + "01-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddMount(&api.Mount{ + Source: "/dev/00-test", + Destination: "/mnt/test", + }) + }), + }, + "02-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddEnv("00-test", "true") + }), + }, + "03-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddHooks(&api.Hooks{ + CreateRuntime: []*api.Hook{ + { + Path: "/bin/00-test", + Args: []string{"/bin/00-test", "arg1", "arg2"}, + }, + }, + }) + }), + }, + "04-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddDevice(&api.LinuxDevice{ + Path: "/dev/00-test", + Type: "c", + Major: 1, + Minor: 2, + FileMode: api.FileMode(0o644), + Uid: api.UInt32(1000), + Gid: api.UInt32(1001), + }) + }), + }, + "05-test": { + adjust(func(a *api.ContainerAdjustment) { + a.SetLinuxMemoryLimit(1) + a.SetLinuxMemoryReservation(2) + a.SetLinuxMemorySwap(3) + a.SetLinuxMemoryKernel(4) + a.SetLinuxMemoryKernelTCP(5) + a.SetLinuxMemorySwappiness(6) + a.SetLinuxMemoryDisableOomKiller() + a.SetLinuxMemoryUseHierarchy() + a.SetLinuxCPUShares(10) + a.SetLinuxCPUQuota(20) + a.SetLinuxCPUPeriod(30) + a.SetLinuxCPURealtimeRuntime(40) + a.SetLinuxCPURealtimePeriod(50) + a.SetLinuxCPUSetCPUs("0-3") + a.SetLinuxCPUSetMems("1") + a.AddLinuxHugepageLimit("2MB", 1024) + a.AddLinuxHugepageLimit("1GB", 2048) + a.SetLinuxBlockIOClass("blockio-class1") + a.SetLinuxRDTClass("rdt-class1") + a.AddLinuxUnified("key1", "value1") + a.AddLinuxUnified("key2", "value2") + // FIXME: no convenience method for cgroup device rules + a.Linux.Resources.Devices = []*api.LinuxDeviceCgroup{ + { + Allow: true, + Type: "c", + Major: api.Int64(1), + Minor: api.Int64(2), + Access: "rwm", + }, + { + Allow: false, + Type: "b", + Major: api.Int64(3), + Minor: api.Int64(4), + Access: "rm", + }, + } + a.SetLinuxPidLimits(100) + }), + }, + "06-test": { + adjust(func(a *api.ContainerAdjustment) { + a.SetLinuxCgroupsPath("/sys/fs/cgroups/00-test") + }), + }, + "07-test": { + adjust(func(a *api.ContainerAdjustment) { + v := 987 + a.SetLinuxOomScoreAdj(&v) + }), + }, + "08-test": { + adjust(func(a *api.ContainerAdjustment) { + a.SetLinuxIOPriority(&nri.LinuxIOPriority{ + Class: api.IOPrioClass_IOPRIO_CLASS_RT, + Priority: 5, + }) + }), + }, + "09-test": { + adjust(func(a *api.ContainerAdjustment) { + a.SetLinuxSeccompPolicy( + func() *api.LinuxSeccomp { + seccomp := rspec.LinuxSeccomp{ + DefaultAction: rspec.ActAllow, + ListenerPath: "/run/meshuggah-rocks.sock", + Architectures: []rspec.Arch{}, + Flags: []rspec.LinuxSeccompFlag{}, + Syscalls: []rspec.LinuxSyscall{{ + Names: []string{"sched_getaffinity"}, + Action: rspec.ActNotify, + Args: []rspec.LinuxSeccompArg{}, + }}, + } + return api.FromOCILinuxSeccomp(&seccomp) + }(), + ) + }), + }, + "10-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddOrReplaceNamespace(&nri.LinuxNamespace{ + Type: "cgroup", + Path: "/tmp/00-test", + }) + }), + }, + "11-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddRlimit("nofile", 456, 123) + }), + }, + "12-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddCDIDevice( + &api.CDIDevice{ + Name: "vendor0.com/dev=dev0", + }, + ) + }), + }, + "13-test": { + adjust(func(a *api.ContainerAdjustment) { + a.SetArgs([]string{ + "echo", + "updated", + "argument", + "list", + }) + }), + }, + }, + }, + expect: &api.ContainerAdjustment{ + Annotations: map[string]string{ + "key": "00-test", + }, + Mounts: []*api.Mount{ + { + Source: "/dev/00-test", + Destination: "/mnt/test", + }, + }, + Env: []*api.KeyValue{ + { + Key: "00-test", + Value: "true", + }, + }, + Hooks: &api.Hooks{ + CreateRuntime: []*api.Hook{ + { + Path: "/bin/00-test", + Args: []string{"/bin/00-test", "arg1", "arg2"}, + }, + }, + }, + Linux: &api.LinuxContainerAdjustment{ + Devices: []*api.LinuxDevice{ + { + Path: "/dev/00-test", + Type: "c", + Major: 1, + Minor: 2, + FileMode: api.FileMode(0o644), + Uid: api.UInt32(1000), + Gid: api.UInt32(1001), + }, + }, + Resources: &api.LinuxResources{ + Memory: &api.LinuxMemory{ + Limit: api.Int64(1), + Reservation: api.Int64(2), + Swap: api.Int64(3), + Kernel: api.Int64(4), + KernelTcp: api.Int64(5), + Swappiness: api.UInt64(6), + DisableOomKiller: api.Bool(true), + UseHierarchy: api.Bool(true), + }, + Cpu: &api.LinuxCPU{ + Shares: api.UInt64(10), + Quota: api.Int64(20), + Period: api.UInt64(30), + RealtimeRuntime: api.Int64(40), + RealtimePeriod: api.UInt64(50), + Cpus: "0-3", + Mems: "1", + }, + HugepageLimits: []*api.HugepageLimit{ + { + PageSize: "2MB", + Limit: 1024, + }, + { + PageSize: "1GB", + Limit: 2048, + }, + }, + BlockioClass: api.String("blockio-class1"), + RdtClass: api.String("rdt-class1"), + Unified: map[string]string{ + "key1": "value1", + "key2": "value2", + }, + Devices: []*api.LinuxDeviceCgroup{ + { + Allow: true, + Type: "c", + Major: api.Int64(1), + Minor: api.Int64(2), + Access: "rwm", + }, + { + Allow: false, + Type: "b", + Major: api.Int64(3), + Minor: api.Int64(4), + Access: "rm", + }, + }, + Pids: &api.LinuxPids{ + Limit: 100, + }, + }, + CgroupsPath: "/sys/fs/cgroups/00-test", + OomScoreAdj: api.Int(987), + IoPriority: &api.LinuxIOPriority{ + Class: api.IOPrioClass_IOPRIO_CLASS_RT, + Priority: 5, + }, + SeccompPolicy: func() *api.LinuxSeccomp { + seccomp := rspec.LinuxSeccomp{ + DefaultAction: rspec.ActAllow, + ListenerPath: "/run/meshuggah-rocks.sock", + Architectures: []rspec.Arch{}, + Flags: []rspec.LinuxSeccompFlag{}, + Syscalls: []rspec.LinuxSyscall{{ + Names: []string{"sched_getaffinity"}, + Action: rspec.ActNotify, + Args: []rspec.LinuxSeccompArg{}, + }}, + } + return api.FromOCILinuxSeccomp(&seccomp) + }(), + Namespaces: []*api.LinuxNamespace{ + { + Type: "cgroup", + Path: "/tmp/00-test", + }, + }, + }, + Rlimits: []*api.POSIXRlimit{{Type: "nofile", Soft: 123, Hard: 456}}, + CDIDevices: []*api.CDIDevice{ + { + Name: "vendor0.com/dev=dev0", + }, + }, + Args: []string{ + "echo", + "updated", + "argument", + "list", + }, + }, + }, + } { + t.Run(tc.name, func(t *testing.T) { + sut, evt = tc.Setup(t) + sut.Start(WithWaitForPluginsToStart()) + + pod := sut.NewPod( + WithPodRandomFill(), + WithPodName("pod0"), + ) + + ctr := sut.NewContainer( + WithContainerRandomFill(), + WithContainerPod(pod), + WithContainerName("ctr0"), + ) + + adjust, _, err := sut.CreateContainer(pod, ctr) + require.NoError(t, err, "CreateContainer should succeed") + require.True(t, + protoEqual(tc.expect.Strip(), adjust.Strip()), + "container adjustment matches expected: %s", + protoDiff(tc.expect.Strip(), adjust.Strip()), + ) + }) + + require.NoError(t, sut.Stop(WithWaitForPluginsToClose()), "test shutdown") + evt.Stop() + } + +} + +func TestSolicitedContainerUpdates(t *testing.T) { + type testcase struct { + *testbase + name string + expect *api.ContainerUpdate + } + + var ( + sut *Suite + evt *EventCollector + ) + + update := func(fn func(string, *api.ContainerUpdate)) PluginOption { + return WithHandlers( + Handlers{ + Configure: func(_, _, _ string) (api.EventMask, error) { + return api.Event_CREATE_CONTAINER.Mask(), nil + }, + CreateContainer: func(_ *api.PodSandbox, ctr *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) { + u := &api.ContainerUpdate{} + fn(ctr.Name, u) + return nil, []*api.ContainerUpdate{u}, nil + }, + }, + ) + } + + for _, tc := range []*testcase{ + { + name: "update Linux CPU resources", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + update(func(ctr string, u *api.ContainerUpdate) { + if ctr == "ctr1" { + u.SetLinuxCPUShares(123) + u.SetLinuxCPUQuota(456) + u.SetLinuxCPUPeriod(789) + u.SetLinuxCPURealtimeRuntime(321) + u.SetLinuxCPURealtimePeriod(654) + u.SetLinuxCPUSetCPUs("0-1") + u.SetLinuxCPUSetMems("2-3") + } + }), + }, + }, + }, + expect: &api.ContainerUpdate{ + Linux: &api.LinuxContainerUpdate{ + Resources: &api.LinuxResources{ + Cpu: &api.LinuxCPU{ + Shares: api.UInt64(123), + Quota: api.Int64(456), + Period: api.UInt64(789), + RealtimeRuntime: api.Int64(321), + RealtimePeriod: api.UInt64(654), + Cpus: "0-1", + Mems: "2-3", + }, + }, + }, + }, + }, + { + name: "update Linux memory resources", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + update(func(ctr string, u *api.ContainerUpdate) { + if ctr == "ctr1" { + u.SetLinuxMemoryLimit(1234) + u.SetLinuxMemoryReservation(4567) + u.SetLinuxMemorySwap(7890) + u.SetLinuxMemoryKernel(9012) + u.SetLinuxMemoryKernelTCP(2345) + u.SetLinuxMemorySwappiness(5678) + u.SetLinuxMemoryDisableOomKiller() + u.SetLinuxMemoryUseHierarchy() + } + }), + }, + }, + }, + expect: &api.ContainerUpdate{ + Linux: &api.LinuxContainerUpdate{ + Resources: &api.LinuxResources{ + Memory: &api.LinuxMemory{ + Limit: api.Int64(1234), + Reservation: api.Int64(4567), + Swap: api.Int64(7890), + Kernel: api.Int64(9012), + KernelTcp: api.Int64(2345), + Swappiness: api.UInt64(5678), + DisableOomKiller: api.Bool(true), + UseHierarchy: api.Bool(true), + }, + }, + }, + }, + }, + { + name: "update Linux class-based resources", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + update(func(ctr string, u *api.ContainerUpdate) { + if ctr == "ctr1" { + u.SetLinuxRDTClass("00-test.rdt") + u.SetLinuxBlockIOClass("00-test.blkio") + } + }), + }, + }, + }, + expect: &api.ContainerUpdate{ + Linux: &api.LinuxContainerUpdate{ + Resources: &api.LinuxResources{ + RdtClass: api.String("00-test.rdt"), + BlockioClass: api.String("00-test.blkio"), + }, + }, + }, + }, + { + name: "update Linux hugepage limits", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + update(func(ctr string, u *api.ContainerUpdate) { + if ctr == "ctr1" { + u.AddLinuxHugepageLimit("1M", 4096) + u.AddLinuxHugepageLimit("4M", 1024) + } + }), + }, + }, + }, + expect: &api.ContainerUpdate{ + Linux: &api.LinuxContainerUpdate{ + Resources: &api.LinuxResources{ + HugepageLimits: []*api.HugepageLimit{ + { + PageSize: "1M", + Limit: 4096, + }, + { + PageSize: "4M", + Limit: 1024, + }, + }, + }, + }, + }, + }, + { + name: "update Linux cgroupv2 unified resources", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + update(func(ctr string, u *api.ContainerUpdate) { + if ctr == "ctr1" { + u.AddLinuxUnified("resource.1", "value1") + u.AddLinuxUnified("resource.2", "value2") + } + }), + }, + }, + }, + expect: &api.ContainerUpdate{ + Linux: &api.LinuxContainerUpdate{ + Resources: &api.LinuxResources{ + Unified: map[string]string{ + "resource.1": "value1", + "resource.2": "value2", + }, + }, + }, + }, + }, + } { + t.Run(tc.name, func(t *testing.T) { + sut, evt = tc.Setup(t) + sut.Start(WithWaitForPluginsToStart()) + + pod := sut.NewPod( + WithPodRandomFill(), + WithPodName("pod0"), + ) + + ctr0 := sut.NewContainer( + WithContainerRandomFill(), + WithContainerPod(pod), + WithContainerName("ctr0"), + ) + + _, _, err := sut.CreateContainer(pod, ctr0) + require.NoError(t, err, "CreateContainer should succeed") + + ctr1 := sut.NewContainer( + WithContainerRandomFill(), + WithContainerPod(pod), + WithContainerName("ctr1"), + ) + + _, updates, err := sut.CreateContainer(pod, ctr1) + require.NoError(t, err, "CreateContainer should succeed") + + tc.expect.ContainerId = updates[0].ContainerId + require.True(t, + protoEqual(tc.expect.Strip(), updates[0].Strip()), + "container adjustment matches expected: %s", + protoDiff(tc.expect.Strip(), updates[0].Strip()), + ) + }) + + require.NoError(t, sut.Stop(WithWaitForPluginsToClose()), "test shutdown") + evt.Stop() + } +} + +func TestSolicitedContainerUpdatesConflictDetection(t *testing.T) { + type testcase struct { + *testbase + name string + } + + var ( + sut *Suite + evt *EventCollector + ) + + update := func(fn func(string, *api.ContainerUpdate)) PluginOption { + return WithHandlers( + Handlers{ + Configure: func(_, _, _ string) (api.EventMask, error) { + return api.Event_CREATE_CONTAINER.Mask(), nil + }, + CreateContainer: func(_ *api.PodSandbox, ctr *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) { + u := &api.ContainerUpdate{} + fn(ctr.Name, u) + return nil, []*api.ContainerUpdate{u}, nil + }, + }, + ) + } + + for _, tc := range []*testcase{ + { + name: "update Linux CPU resources", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + update(func(ctr string, u *api.ContainerUpdate) { + if ctr == "ctr1" { + u.SetLinuxCPUShares(123) + u.SetLinuxCPUQuota(456) + u.SetLinuxCPUPeriod(789) + u.SetLinuxCPURealtimeRuntime(321) + u.SetLinuxCPURealtimePeriod(654) + u.SetLinuxCPUSetCPUs("0-1") + u.SetLinuxCPUSetMems("2-3") + } + }), + }, + "01-test": { + update(func(ctr string, u *api.ContainerUpdate) { + if ctr == "ctr1" { + u.SetLinuxCPUShares(123) + } + }), + }, + }, + }, + }, + { + name: "update Linux memory resources", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + update(func(ctr string, u *api.ContainerUpdate) { + if ctr == "ctr1" { + u.SetLinuxMemoryLimit(1234) + u.SetLinuxMemoryReservation(4567) + u.SetLinuxMemorySwap(7890) + u.SetLinuxMemoryKernel(9012) + u.SetLinuxMemoryKernelTCP(2345) + u.SetLinuxMemorySwappiness(5678) + u.SetLinuxMemoryDisableOomKiller() + u.SetLinuxMemoryUseHierarchy() + } + }), + }, + "01-test": { + update(func(ctr string, u *api.ContainerUpdate) { + if ctr == "ctr1" { + u.SetLinuxMemoryLimit(1234) + } + }), + }, + }, + }, + }, + { + name: "update Linux class-based resources", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + update(func(ctr string, u *api.ContainerUpdate) { + if ctr == "ctr1" { + u.SetLinuxRDTClass("00-test.rdt") + u.SetLinuxBlockIOClass("00-test.blkio") + } + }), + }, + "01-test": { + update(func(ctr string, u *api.ContainerUpdate) { + if ctr == "ctr1" { + u.SetLinuxRDTClass("00-test.rdt") + u.SetLinuxBlockIOClass("00-test.blkio") + } + }), + }, + }, + }, + }, + { + name: "update Linux hugepage limits", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + update(func(ctr string, u *api.ContainerUpdate) { + if ctr == "ctr1" { + u.AddLinuxHugepageLimit("1M", 4096) + u.AddLinuxHugepageLimit("4M", 1024) + } + }), + }, + "01-test": { + update(func(ctr string, u *api.ContainerUpdate) { + if ctr == "ctr1" { + u.AddLinuxHugepageLimit("1M", 4096) + } + }), + }, + }, + }, + }, + { + name: "update Linux cgroupv2 unified resources", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + update(func(ctr string, u *api.ContainerUpdate) { + if ctr == "ctr1" { + u.AddLinuxUnified("resource.1", "value1") + u.AddLinuxUnified("resource.2", "value2") + } + }), + }, + "01-test": { + update(func(ctr string, u *api.ContainerUpdate) { + if ctr == "ctr1" { + u.AddLinuxUnified("resource.1", "value1") + } + }), + }, + }, + }, + }, + } { + t.Run(tc.name, func(t *testing.T) { + sut, evt = tc.Setup(t) + sut.Start(WithWaitForPluginsToStart()) + + pod := sut.NewPod( + WithPodRandomFill(), + WithPodName("pod0"), + ) + + ctr0 := sut.NewContainer( + WithContainerRandomFill(), + WithContainerPod(pod), + WithContainerName("ctr0"), + ) + + _, _, err := sut.CreateContainer(pod, ctr0) + require.NoError(t, err, "CreateContainer should succeed") + + ctr1 := sut.NewContainer( + WithContainerRandomFill(), + WithContainerPod(pod), + WithContainerName("ctr1"), + ) + + adjust, updates, err := sut.CreateContainer(pod, ctr1) + require.Nil(t, adjust, "CreateContainer should fail") + require.Nil(t, updates, "CreateContainer should fail") + require.Error(t, err, "CreateContainer should fail") + }) + + require.NoError(t, sut.Stop(WithWaitForPluginsToClose()), "test shutdown") + evt.Stop() + } +} + +func TestContainerAdjustmentValidation(t *testing.T) { + type testcase struct { + *testbase + name string + pod []PodOption + container []ContainerOption + fail bool + } + + var ( + sut *Suite + evt *EventCollector + ) + + validate := func(fn func(req *api.ValidateContainerAdjustmentRequest) error) PluginOption { + return WithHandlers( + Handlers{ + ValidateContainerAdjustment: fn, + }, + ) + } + + adjust := func(fn func(*api.ContainerAdjustment)) PluginOption { + return WithHandlers( + Handlers{ + Configure: func(_, _, _ string) (api.EventMask, error) { + return api.Event_CREATE_CONTAINER.Mask(), nil + }, + CreateContainer: func(_ *api.PodSandbox, _ *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) { + a := &api.ContainerAdjustment{} + fn(a) + return a, nil, nil + }, + }, + ) + } + + for _, tc := range []*testcase{ + { + name: "pass custom external validation", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddAnnotation("allowed", "00-test") + }), + }, + "01-validator": { + validate(func(_ *api.ValidateContainerAdjustmentRequest) error { + return nil + }), + }, + }, + }, + }, + { + name: "fail custom external validation", + testbase: &testbase{ + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddAnnotation("forbidden", "00-test") + }), + }, + "01-validator": { + validate(func(req *api.ValidateContainerAdjustmentRequest) error { + _, reject := req.Owners.AnnotationOwner( + req.Container.Id, + "forbidden", + ) + if reject { + return fmt.Errorf("forbidden annotation set") + } + return nil + }), + }, + }, + }, + fail: true, + }, + { + name: "reject OCI hook injection", + testbase: &testbase{ + runtime: []RuntimeOption{ + WithNRIRuntimeOptions( + nri.WithDefaultValidator( + &validator.DefaultValidatorConfig{ + Enable: true, + RejectOCIHookAdjustment: true, + }, + ), + ), + }, + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddHooks( + &api.Hooks{ + Prestart: []*api.Hook{ + { + Path: "/bin/sh", + Args: []string{"/bin/sh", "-c", "true"}, + }, + }, + }, + ) + }), + }, + }, + }, + fail: true, + }, + { + name: "reject default seccomp policy adjustment", + testbase: &testbase{ + runtime: []RuntimeOption{ + WithNRIRuntimeOptions( + nri.WithDefaultValidator( + &validator.DefaultValidatorConfig{ + Enable: true, + RejectRuntimeDefaultSeccompAdjustment: true, + }, + ), + ), + }, + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.SetLinuxSeccompPolicy( + func() *api.LinuxSeccomp { + seccomp := rspec.LinuxSeccomp{ + DefaultAction: rspec.ActAllow, + ListenerPath: "/run/meshuggah-rocks.sock", + Architectures: []rspec.Arch{}, + Flags: []rspec.LinuxSeccompFlag{}, + Syscalls: []rspec.LinuxSyscall{{ + Names: []string{"sched_getaffinity"}, + Action: rspec.ActNotify, + Args: []rspec.LinuxSeccompArg{}, + }}, + } + return api.FromOCILinuxSeccomp(&seccomp) + }(), + ) + }), + }, + }, + }, + container: []ContainerOption{ + WithContainerSeccompProfile( + &api.SecurityProfile{ + ProfileType: api.SecurityProfile_RUNTIME_DEFAULT, + }, + ), + }, + fail: true, + }, + { + name: "allow default seccomp policy adjustment", + testbase: &testbase{ + runtime: []RuntimeOption{ + WithNRIRuntimeOptions( + nri.WithDefaultValidator( + &validator.DefaultValidatorConfig{ + Enable: true, + RejectRuntimeDefaultSeccompAdjustment: false, + }, + ), + ), + }, + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.SetLinuxSeccompPolicy( + func() *api.LinuxSeccomp { + seccomp := rspec.LinuxSeccomp{ + DefaultAction: rspec.ActAllow, + ListenerPath: "/run/meshuggah-rocks.sock", + Architectures: []rspec.Arch{}, + Flags: []rspec.LinuxSeccompFlag{}, + Syscalls: []rspec.LinuxSyscall{{ + Names: []string{"sched_getaffinity"}, + Action: rspec.ActNotify, + Args: []rspec.LinuxSeccompArg{}, + }}, + } + return api.FromOCILinuxSeccomp(&seccomp) + }(), + ) + }), + }, + }, + }, + container: []ContainerOption{ + WithContainerSeccompProfile( + &api.SecurityProfile{ + ProfileType: api.SecurityProfile_RUNTIME_DEFAULT, + }, + ), + }, + }, + { + name: "reject custom seccomp policy adjustment", + testbase: &testbase{ + runtime: []RuntimeOption{ + WithNRIRuntimeOptions( + nri.WithDefaultValidator( + &validator.DefaultValidatorConfig{ + Enable: true, + RejectCustomSeccompAdjustment: true, + }, + ), + ), + }, + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.SetLinuxSeccompPolicy( + func() *api.LinuxSeccomp { + seccomp := rspec.LinuxSeccomp{ + DefaultAction: rspec.ActAllow, + ListenerPath: "/run/meshuggah-rocks.sock", + Architectures: []rspec.Arch{}, + Flags: []rspec.LinuxSeccompFlag{}, + Syscalls: []rspec.LinuxSyscall{{ + Names: []string{"sched_getaffinity"}, + Action: rspec.ActNotify, + Args: []rspec.LinuxSeccompArg{}, + }}, + } + return api.FromOCILinuxSeccomp(&seccomp) + }(), + ) + }), + }, + }, + }, + container: []ContainerOption{ + WithContainerSeccompProfile( + &api.SecurityProfile{ + ProfileType: api.SecurityProfile_LOCALHOST, + LocalhostRef: "/xyzzy/foobar", + }, + ), + }, + fail: true, + }, + { + name: "allow custom seccomp policy adjustment", + testbase: &testbase{ + runtime: []RuntimeOption{ + WithNRIRuntimeOptions( + nri.WithDefaultValidator( + &validator.DefaultValidatorConfig{ + Enable: true, + RejectCustomSeccompAdjustment: false, + }, + ), + ), + }, + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.SetLinuxSeccompPolicy( + func() *api.LinuxSeccomp { + seccomp := rspec.LinuxSeccomp{ + DefaultAction: rspec.ActAllow, + ListenerPath: "/run/meshuggah-rocks.sock", + Architectures: []rspec.Arch{}, + Flags: []rspec.LinuxSeccompFlag{}, + Syscalls: []rspec.LinuxSyscall{{ + Names: []string{"sched_getaffinity"}, + Action: rspec.ActNotify, + Args: []rspec.LinuxSeccompArg{}, + }}, + } + return api.FromOCILinuxSeccomp(&seccomp) + }(), + ) + }), + }, + }, + }, + container: []ContainerOption{ + WithContainerSeccompProfile( + &api.SecurityProfile{ + ProfileType: api.SecurityProfile_LOCALHOST, + LocalhostRef: "/xyzzy/foobar", + }, + ), + }, + }, + { + name: "reject custom seccomp policy adjustment", + testbase: &testbase{ + runtime: []RuntimeOption{ + WithNRIRuntimeOptions( + nri.WithDefaultValidator( + &validator.DefaultValidatorConfig{ + Enable: true, + RejectUnconfinedSeccompAdjustment: true, + }, + ), + ), + }, + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.SetLinuxSeccompPolicy( + func() *api.LinuxSeccomp { + seccomp := rspec.LinuxSeccomp{ + DefaultAction: rspec.ActAllow, + ListenerPath: "/run/meshuggah-rocks.sock", + Architectures: []rspec.Arch{}, + Flags: []rspec.LinuxSeccompFlag{}, + Syscalls: []rspec.LinuxSyscall{{ + Names: []string{"sched_getaffinity"}, + Action: rspec.ActNotify, + Args: []rspec.LinuxSeccompArg{}, + }}, + } + return api.FromOCILinuxSeccomp(&seccomp) + }(), + ) + }), + }, + }, + }, + container: []ContainerOption{ + WithContainerSeccompProfile( + &api.SecurityProfile{ + ProfileType: api.SecurityProfile_UNCONFINED, + }, + ), + }, + fail: true, + }, + { + name: "allow custom seccomp policy adjustment", + testbase: &testbase{ + runtime: []RuntimeOption{ + WithNRIRuntimeOptions( + nri.WithDefaultValidator( + &validator.DefaultValidatorConfig{ + Enable: true, + RejectUnconfinedSeccompAdjustment: false, + }, + ), + ), + }, + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.SetLinuxSeccompPolicy( + func() *api.LinuxSeccomp { + seccomp := rspec.LinuxSeccomp{ + DefaultAction: rspec.ActAllow, + ListenerPath: "/run/meshuggah-rocks.sock", + Architectures: []rspec.Arch{}, + Flags: []rspec.LinuxSeccompFlag{}, + Syscalls: []rspec.LinuxSyscall{{ + Names: []string{"sched_getaffinity"}, + Action: rspec.ActNotify, + Args: []rspec.LinuxSeccompArg{}, + }}, + } + return api.FromOCILinuxSeccomp(&seccomp) + }(), + ) + }), + }, + }, + }, + container: []ContainerOption{ + WithContainerSeccompProfile( + &api.SecurityProfile{ + ProfileType: api.SecurityProfile_UNCONFINED, + }, + ), + }, + }, + { + name: "reject Linux namespace adjustment", + testbase: &testbase{ + runtime: []RuntimeOption{ + WithNRIRuntimeOptions( + nri.WithDefaultValidator( + &validator.DefaultValidatorConfig{ + Enable: true, + RejectNamespaceAdjustment: true, + }, + ), + ), + }, + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddOrReplaceNamespace( + &api.LinuxNamespace{ + Type: "cgroup", + Path: "/", + }, + ) + }), + }, + }, + }, + fail: true, + }, + { + name: "allow Linux namespace adjustment", + testbase: &testbase{ + runtime: []RuntimeOption{ + WithNRIRuntimeOptions( + nri.WithDefaultValidator( + &validator.DefaultValidatorConfig{ + Enable: true, + RejectNamespaceAdjustment: false, + }, + ), + ), + }, + plugins: map[string][]PluginOption{ + "00-test": { + adjust(func(a *api.ContainerAdjustment) { + a.AddOrReplaceNamespace( + &api.LinuxNamespace{ + Type: "cgroup", + Path: "/", + }, + ) + }), + }, + }, + }, + }, + { + name: "reject container creation if required plugin is missing", + testbase: &testbase{ + runtime: []RuntimeOption{ + WithNRIRuntimeOptions( + nri.WithDefaultValidator( + &validator.DefaultValidatorConfig{ + Enable: true, + RequiredPlugins: []string{ + "foo", + "bar", + }, + }, + ), + ), + }, + plugins: map[string][]PluginOption{ + "00-test": {}, + "01-foo": {}, + }, + }, + fail: true, + }, + { + name: "allow container creation if all required plugins are present", + testbase: &testbase{ + runtime: []RuntimeOption{ + WithNRIRuntimeOptions( + nri.WithDefaultValidator( + &validator.DefaultValidatorConfig{ + Enable: true, + RequiredPlugins: []string{ + "foo", + "bar", + }, + }, + ), + ), + }, + plugins: map[string][]PluginOption{ + "00-test": {}, + "01-foo": {}, + "02-bar": {}, + }, + }, + }, + { + name: "allow container creation if missing plugin is tolerated", + testbase: &testbase{ + runtime: []RuntimeOption{ + WithNRIRuntimeOptions( + nri.WithDefaultValidator( + &validator.DefaultValidatorConfig{ + Enable: true, + RequiredPlugins: []string{ + "foo", + "bar", + }, + TolerateMissingAnnotation: "tolerate-missing-plugins." + pluginhelpers.AnnotationDomain, + }, + ), + ), + }, + plugins: map[string][]PluginOption{ + "00-test": {}, + "01-foo": {}, + }, + }, + pod: []PodOption{ + WithPodAnnotations( + map[string]string{ + "tolerate-missing-plugins." + pluginhelpers.AnnotationDomain + "/container.ctr0": "true", + }, + ), + }, + }, + { + name: "reject container creation if annotated required plugin is missing", + testbase: &testbase{ + runtime: []RuntimeOption{ + WithNRIRuntimeOptions( + nri.WithDefaultValidator( + &validator.DefaultValidatorConfig{ + Enable: true, + }, + ), + ), + }, + plugins: map[string][]PluginOption{ + "00-test": {}, + }, + }, + pod: []PodOption{ + WithPodAnnotations( + map[string]string{ + "required-plugins." + pluginhelpers.AnnotationDomain + "/container.ctr0": "[ \"xyzzy\" ]", + }, + ), + }, + fail: true, + }, + { + name: "allow container creation if all annotated required plugin are present", + testbase: &testbase{ + runtime: []RuntimeOption{ + WithNRIRuntimeOptions( + nri.WithDefaultValidator( + &validator.DefaultValidatorConfig{ + Enable: true, + }, + ), + ), + }, + plugins: map[string][]PluginOption{ + "00-test": {}, + "01-xyzzy": {}, + }, + }, + pod: []PodOption{ + WithPodAnnotations( + map[string]string{ + "required-plugins." + pluginhelpers.AnnotationDomain + "/container.ctr0": "[ \"xyzzy\", \"test\" ]", + }, + ), + }, + }, + } { + t.Run(tc.name, func(t *testing.T) { + sut, evt = tc.Setup(t) + sut.Start(WithWaitForPluginsToStart()) + + pod := sut.NewPod( + append( + []PodOption{ + WithPodRandomFill(), + WithPodName("pod0"), + }, + tc.pod..., + )..., + ) + + ctr := sut.NewContainer( + append( + []ContainerOption{ + WithContainerRandomFill(), + WithContainerPod(pod), + WithContainerName("ctr0"), + }, + tc.container..., + )..., + ) + + adjust, _, err := sut.CreateContainer(pod, ctr) + if tc.fail { + require.Nil(t, adjust, "CreateContainer should fail") + require.Error(t, err, "CreateContainer should fail") + } else { + require.NotNil(t, adjust, "CreateContainer should succeed") + require.NoError(t, err, "CreateContainer should succeed") + } + + require.NoError(t, sut.Stop(WithWaitForPluginsToClose()), "test shutdown") + evt.Stop() + }) + } +} + +func protoDiff(a, b proto.Message) string { + return cmp.Diff(a, b, protocmp.Transform()) +} + +func protoEqual(a, b proto.Message) bool { + return cmp.Equal(a, b, cmpopts.EquateEmpty(), protocmp.Transform()) +} diff --git a/pkg/adaptation/suite_test.go b/pkg/adaptation/suite_test.go index 195adefd..da8c66ba 100644 --- a/pkg/adaptation/suite_test.go +++ b/pkg/adaptation/suite_test.go @@ -22,887 +22,2545 @@ import ( "fmt" "os" "path/filepath" - "sort" - "sync" - "testing" "time" nri "github.com/containerd/nri/pkg/adaptation" + builtinstub "github.com/containerd/nri/pkg/adaptation/builtin" + v1alpha1stub "github.com/containerd/nri/pkg/stub/v1alpha1" + stub "github.com/containerd/nri/pkg/stub/v1beta1" + + "github.com/containerd/nri/pkg/api/convert" + "github.com/containerd/nri/pkg/api/v1alpha1" api "github.com/containerd/nri/pkg/api/v1beta1" - "github.com/sirupsen/logrus" - stub "github.com/containerd/nri/pkg/stub/v1beta1" + "testing" - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" + faker "github.com/brianvoe/gofakeit/v7" + "github.com/stretchr/testify/require" ) -func TestRuntime(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "NRI Runtime") -} +type EventKind string const ( - startupTimeout = 2 * time.Second - defaultRuntimeName = "default-runtime-name" - defaultRuntimeVersion = "0.1.2" + Started EventKind = "Started" + Failed EventKind = "Failed" + Closed EventKind = "Closed" + Stopped EventKind = "Stopped" + Shutdown EventKind = "Shutdown" + Synchronize EventKind = "Synchronize" + Update EventKind = "Update" + Timeout EventKind = "Timeout" + Marker EventKind = "Marker" ) -// A test suite consist of a runtime and a set of plugins. -type Suite struct { - dir string // directory to create for test - runtime *mockRuntime // runtime instance for test - plugins []*mockPlugin // plugin instances for test - byName map[string]*mockPlugin +type Event interface { + Kind() EventKind + String() string + Match(Event) bool } -// SuiteOption can be applied to a suite. -type SuiteOption func(s *Suite) error +type EventCollector struct { + stopCh chan struct{} + waitCh chan chan Event + eventCh chan Event + events []Event +} + +type EventWaitHandler func(Event) bool + +func StartEventCollector() *EventCollector { + c := &EventCollector{ + stopCh: make(chan struct{}), + waitCh: make(chan chan Event, 1), + eventCh: make(chan Event, 1), + } -// Prepare test suite, creating test directory. -func (s *Suite) Prepare(runtime *mockRuntime, plugins ...*mockPlugin) string { + go c.collect() + + return c +} + +func (c *EventCollector) collect() { var ( - dir string - etc string + waiters = map[chan Event]struct{}{} + del = func(w chan Event) { + delete(waiters, w) + close(w) + } + add = func(w chan Event) { + waiters[w] = struct{}{} + for _, e := range c.events { + select { + case dw := <-c.waitCh: + del(dw) + if dw == w { + return + } + case w <- e: + } + } + } + stop = func() { + for w := range waiters { + close(w) + } + } ) - logrus.SetLevel(logrus.ErrorLevel) + for { + select { + case <-c.stopCh: + stop() + return + + case w := <-c.waitCh: + if _, ok := waiters[w]; !ok { + add(w) + } else { + del(w) + } + + case e := <-c.eventCh: + c.events = append(c.events, e) + for w := range waiters { + select { + case w <- e: + case w := <-c.waitCh: + if _, ok := waiters[w]; !ok { + add(w) + } else { + del(w) + } + } + } + } + } +} - dir = GinkgoT().TempDir() - etc = filepath.Join(dir, "etc", "nri") +func (c *EventCollector) Stop() { + close(c.stopCh) +} - Expect(os.MkdirAll(etc, 0o755)).To(Succeed()) +func (c *EventCollector) Channel() chan Event { + return c.eventCh +} - if runtime.name == "" { - runtime.name = defaultRuntimeName - } - if runtime.version == "" { - runtime.version = defaultRuntimeVersion +func (c *EventCollector) Emit(e Event) { + c.eventCh <- e +} + +func (c *EventCollector) Search(handler EventWaitHandler, end Event) (Event, bool) { + var ( + w = make(chan Event, 1) + start = func() { + c.waitCh <- w + } + stop = func() { + for { + select { + case <-w: + default: + c.waitCh <- w + //revive:disable-next-line:empty-block + for range w { + } + return + } + } + } + + timeout <-chan time.Time + until Event + ) + + switch e := end.(type) { + case *TimeoutEvent: + timeout = e.Start() + default: + until = end } - s.dir = dir - s.runtime = runtime - s.plugins = plugins + start() - if s.byName == nil { - s.byName = make(map[string]*mockPlugin) + for { + select { + case <-timeout: + stop() + return nil, false + + case e := <-w: + if e == nil { + return nil, false + } + if until != nil && e.Match(until) { + stop() + return nil, false + } + if handler(e) { + stop() + return e, true + } + } } +} - return dir +type TimeoutEvent struct { + timeout time.Duration + started time.Time + ch <-chan time.Time } -// Dir returns the suite's temporary test directory. -func (s *Suite) Dir() string { - return s.dir +func UntilTimeout(d time.Duration) *TimeoutEvent { + return &TimeoutEvent{ + timeout: d, + } } -// Startup starts up the test suite. -func (s *Suite) Startup() { - plugins := s.plugins - s.plugins = nil - s.StartRuntime() - s.StartPlugins(plugins...) - s.WaitForPluginsToSync(plugins...) +func (e *TimeoutEvent) Kind() EventKind { + return Timeout } -// StartRuntime starts the suite runtime. -func (s *Suite) StartRuntime() { - Expect(s.runtime.Start(s.dir)).To(Succeed()) +func (e *TimeoutEvent) String() string { + return fmt.Sprintf("WaitTimeout:%s+%s", e.started.String(), e.timeout.String()) } -// StartPlugins starts the suite plugins. -func (s *Suite) StartPlugins(plugins ...*mockPlugin) { - for _, plugin := range plugins { - s.plugins = append(s.plugins, plugin) - s.byName[plugin.FullName()] = plugin - Expect(plugin.Start(s.dir)).To(Succeed()) +func (e *TimeoutEvent) Match(oe Event) bool { + if o, ok := oe.(*TimeoutEvent); ok { + return o == e } + return false } -// WaitForPluginsToSync waits for the given plugins to get synchronized. -func (s *Suite) WaitForPluginsToSync(plugins ...*mockPlugin) { - timeout := time.After(startupTimeout) - for _, plugin := range plugins { - Expect(plugin.Wait(PluginSynchronized, timeout)).To(Succeed()) +func (e *TimeoutEvent) Start() <-chan time.Time { + if e.ch != nil { + return e.ch } - s.runtime.runtime.BlockPluginSync().Unblock() // ensure plugins are fully registered + + e.started = time.Now() + e.ch = time.After(e.timeout) + + return e.ch } -// ShutdownPlugin shuts down the given plugin. -func (s *Suite) ShutdownPlugin(plugin *mockPlugin, reason string) { - s.runtime.ShutdownPlugins(reason, plugin.FullName()) +type MarkerEvent struct { + marker string } -// Cleanup the test suite. -func (s *Suite) Cleanup() { - s.runtime.Stop() - // TODO(klihub): - for _, plugin := range s.plugins { - plugin.Stop() - } - Expect(os.RemoveAll(s.dir)).To(Succeed()) +var ( + EndMarker = NewMarkerEvent("end") + UntilEnd = EndMarker +) + +func UntilMarker(marker string) *MarkerEvent { + return NewMarkerEvent(marker) } -// Plugin returns a plugin started by StartPlugins by full plugin name. -func (s *Suite) plugin(fullName string) *mockPlugin { - return s.byName[fullName] +func NewMarkerEvent(marker string) *MarkerEvent { + return &MarkerEvent{ + marker: marker, + } } -// ------------------------------------ +func (e *MarkerEvent) Kind() EventKind { + return Marker +} -func Log(format string, args ...interface{}) { - GinkgoWriter.Printf(format+"\n", args...) +func (e *MarkerEvent) String() string { + return fmt.Sprintf("Marker:%s", e.marker) } -type mockRuntime struct { - name string - version string - options []nri.Option - runtime *nri.Adaptation - pods map[string]*api.PodSandbox - ctrs map[string]*api.Container +func (e *MarkerEvent) Match(oe Event) bool { + if o, ok := oe.(*MarkerEvent); ok { + return o.marker == e.marker + } + return false +} - updateFn nri.UpdateFn +func EventOccurred(e Event) EventWaitHandler { + return func(o Event) bool { + return o.Match(e) + } } -func (m *mockRuntime) Start(dir string) error { - var ( - options = []nri.Option{ - nri.WithPluginPath(filepath.Join(dir, "opt", "nri", "plugins")), - nri.WithPluginConfigPath(filepath.Join(dir, "etc", "nri", "conf.d")), - nri.WithSocketPath(filepath.Join(dir, "nri.sock")), +func OrderedEventsOccurred(events ...Event) EventWaitHandler { + return func(o Event) bool { + for i := range events { + if o.Match(events[i]) { + events = events[i+1:] + return len(events) == 0 + } } - err error - ) + return false + } +} + +type Suite struct { + t *testing.T + dir string + evt *EventCollector + options []RuntimeOption + runtime *Runtime + plugins []*Plugin + stopCh chan struct{} +} + +type SuiteOption func(s *Suite) error - if m.runtime != nil { - return errors.New("mock runtime already started") +func WithPlugins(plugins ...*Plugin) SuiteOption { + return func(s *Suite) error { + s.plugins = append(s.plugins, plugins...) + return nil } +} - options = append(options, m.options...) - m.runtime, err = nri.New(m.name, m.version, m.synchronize, m.update, options...) - if err != nil { - return err +func WithRuntimeOptions(options ...RuntimeOption) SuiteOption { + return func(s *Suite) error { + s.options = append(s.options, options...) + return nil } +} - if m.pods == nil { - m.pods = make(map[string]*api.PodSandbox) +func NewSuite(t *testing.T, dir string, evt *EventCollector, options ...SuiteOption) *Suite { + s := &Suite{ + t: t, + dir: dir, + evt: evt, + stopCh: make(chan struct{}), } - if m.ctrs == nil { - m.ctrs = make(map[string]*api.Container) + + for _, o := range options { + require.NoError(t, o(s), "apply suite options") } - if m.updateFn == nil { - m.updateFn = func(context.Context, []*api.ContainerUpdate) ([]*api.ContainerUpdate, error) { - return nil, nil + builtin := []*builtinstub.BuiltinPlugin{} + for _, p := range s.plugins { + if p.builtin != nil { + if s.runtime != nil { + err := errors.New("can't set builtin plugins, runtime already created") + require.NoError(t, err, "create runtime with builtin plugins") + } + builtin = append( + builtin, + &builtinstub.BuiltinPlugin{ + Base: p.Name(), + Index: p.Index(), + Handlers: p.builtin.stub, + }, + ) } } - return m.runtime.Start() + s.runtime = NewRuntime(t, dir, s.evt.Channel(), + append( + s.options, + WithBuiltinPlugins(builtin...), + )..., + ) + + return s } -func (m *mockRuntime) Stop() { - if m.runtime != nil { - m.runtime.Stop() - m.runtime = nil - } +func (s *Suite) Dir() string { + return s.dir } -func (m *mockRuntime) ShutdownPlugins(reason, pattern string) { - if m.runtime != nil { - m.runtime.ShutdownPlugins(reason, pattern) +type SuiteStartAction func(*Suite) error + +func WithWaitForPluginsToStart() SuiteStartAction { + return func(s *Suite) error { + for _, p := range s.plugins { + _, ok := s.evt.Search( + EventOccurred(PluginSynchronized(p.ID(), nil, nil)), + UntilTimeout(3*time.Second), + ) + if !ok { + return fmt.Errorf("timeout waiting for plugin %q to start", p.ID()) + } + } + return nil } } -func (m *mockRuntime) synchronize(ctx context.Context, cb nri.SyncCB) error { - var ( - pods []*api.PodSandbox - ctrs []*api.Container - ids []string - ) +func (s *Suite) Start(actions ...SuiteStartAction) error { + s.runtime.Start() + for _, p := range s.plugins { + p.Start() + } - for id := range m.pods { - ids = append(ids, id) + for _, a := range actions { + if err := a(s); err != nil { + return err + } } - sort.Strings(ids) - for _, id := range ids { - pods = append(pods, m.pods[id]) + + return nil +} + +type SuiteStopAction func(*Suite) error + +func WithWaitForPluginsToClose() SuiteStopAction { + return func(s *Suite) error { + for _, p := range s.plugins { + if !p.IsBuiltin() { + _, ok := s.evt.Search( + EventOccurred(PluginClosed(p.ID())), + UntilTimeout(3*time.Second), + ) + if !ok { + return fmt.Errorf("timeout waiting for plugin %q to stop", p.ID()) + } + } + } + return nil } +} - ids = nil - for id := range m.ctrs { - ids = append(ids, id) +func (s *Suite) Stop(actions ...SuiteStopAction) error { + var errs []error + + for _, p := range s.plugins { + p.Stop() } - sort.Strings(ids) - for _, id := range ids { - ctrs = append(ctrs, m.ctrs[id]) + + for _, a := range actions { + if err := a(s); err != nil { + errs = append(errs, err) + } } - _, err := cb(ctx, pods, ctrs) - return err + s.runtime.Stop() + close(s.stopCh) + + return errors.Join(errs...) } -func (m *mockRuntime) RunPodSandbox(ctx context.Context, req *api.RunPodSandboxRequest) error { - b := m.runtime.BlockPluginSync() - defer b.Unblock() - return m.runtime.RunPodSandbox(ctx, req) +func (s *Suite) Plugin(id string) *Plugin { + for _, p := range s.plugins { + if p.ID() == id { + return p + } + } + return nil } -func (m *mockRuntime) UpdatePodSandbox(ctx context.Context, req *api.UpdatePodSandboxRequest) (*api.UpdatePodSandboxResponse, error) { - b := m.runtime.BlockPluginSync() - defer b.Unblock() - return m.runtime.UpdatePodSandbox(ctx, req) +func (s *Suite) BlockPluginSync() *nri.PluginSyncBlock { + return s.runtime.BlockPluginSync() } -func (m *mockRuntime) CreateContainer(ctx context.Context, req *api.CreateContainerRequest) (*api.CreateContainerResponse, error) { - b := m.runtime.BlockPluginSync() - defer b.Unblock() - return m.runtime.CreateContainer(ctx, req) +func (s *Suite) NewPod(options ...PodOption) *api.PodSandbox { + return s.runtime.NewPod(options...) } -func (m *mockRuntime) UpdateContainer(ctx context.Context, req *api.UpdateContainerRequest) (*api.UpdateContainerResponse, error) { - b := m.runtime.BlockPluginSync() - defer b.Unblock() - return m.runtime.UpdateContainer(ctx, req) +func (s *Suite) NewContainer(options ...ContainerOption) *api.Container { + return s.runtime.NewContainer(options...) } -func (m *mockRuntime) startStopPodAndContainer(ctx context.Context, pod *api.PodSandbox, ctr *api.Container) error { - err := m.RunPodSandbox(ctx, &api.RunPodSandboxRequest{ - Pod: pod, - }) - if err != nil { +func (s *Suite) StartUpdateStopPod(pod *api.PodSandbox) error { + if err := s.RunPodSandbox(pod); err != nil { return err } - _, err = m.UpdatePodSandbox(ctx, &api.UpdatePodSandboxRequest{ - Pod: pod, - OverheadLinuxResources: &api.LinuxResources{}, - LinuxResources: &api.LinuxResources{}, - }) - if err != nil { + if err := s.UpdatePodSandbox(pod, nil, nil); err != nil { return err } - err = m.runtime.PostUpdatePodSandbox(ctx, &api.PostUpdatePodSandboxRequest{ - Pod: pod, - }) - if err != nil { + if err := s.PostUpdatePodSandbox(pod); err != nil { return err } - _, err = m.CreateContainer(ctx, &api.CreateContainerRequest{ - Pod: pod, - Container: ctr, - }) - if err != nil { + if err := s.StopPodSandbox(pod); err != nil { return err } - err = m.runtime.PostCreateContainer(ctx, &api.PostCreateContainerRequest{ - Pod: pod, - Container: ctr, - }) - if err != nil { + return s.RemovePodSandbox(pod) +} + +func (s *Suite) StartUpdateStopPodAndContainer(pod *api.PodSandbox, ctr *api.Container) error { + if err := s.RunPodSandbox(pod); err != nil { return err } - err = m.runtime.StartContainer(ctx, &api.StartContainerRequest{ - Pod: pod, - Container: ctr, - }) - if err != nil { + if err := s.UpdatePodSandbox(pod, nil, nil); err != nil { return err } - err = m.runtime.PostStartContainer(ctx, &api.PostStartContainerRequest{ - Pod: pod, - Container: ctr, - }) - if err != nil { + if err := s.PostUpdatePodSandbox(pod); err != nil { return err } - _, err = m.UpdateContainer(ctx, &api.UpdateContainerRequest{ - Pod: pod, - Container: ctr, - LinuxResources: &api.LinuxResources{}, - }) - if err != nil { + if _, _, err := s.CreateContainer(pod, ctr); err != nil { return err } - err = m.runtime.PostUpdateContainer(ctx, &api.PostUpdateContainerRequest{ - Pod: pod, - Container: ctr, - }) - if err != nil { + if err := s.PostCreateContainer(pod, ctr); err != nil { return err } - _, err = m.runtime.StopContainer(ctx, &api.StopContainerRequest{ - Pod: pod, - Container: ctr, - }) - if err != nil { + if err := s.StartContainer(pod, ctr); err != nil { return err } - err = m.runtime.RemoveContainer(ctx, &api.RemoveContainerRequest{ - Pod: pod, - Container: ctr, - }) - if err != nil { + if err := s.PostStartContainer(pod, ctr); err != nil { return err } - err = m.runtime.StopPodSandbox(ctx, &api.StopPodSandboxRequest{ - Pod: pod, - }) - if err != nil { + if _, err := s.UpdateContainer(pod, ctr, nil); err != nil { return err } - err = m.runtime.RemovePodSandbox(ctx, &api.RemovePodSandboxRequest{ - Pod: pod, - }) - if err != nil { + if err := s.PostUpdateContainer(pod, ctr); err != nil { return err } - return nil + if _, err := s.StopContainer(pod, ctr); err != nil { + return err + } + + if err := s.RemoveContainer(pod, ctr); err != nil { + return err + } + + if err := s.StopPodSandbox(pod); err != nil { + return err + } + + return s.RemovePodSandbox(pod) } -func (m *mockRuntime) update(ctx context.Context, updates []*nri.ContainerUpdate) ([]*nri.ContainerUpdate, error) { - return m.updateFn(ctx, updates) +func (s *Suite) RunPodSandbox(pod *api.PodSandbox) error { + return s.runtime.RunPodSandbox(context.Background(), pod) } -type mockPlugin struct { - name string - idx string - stub stub.Stub - mask stub.EventMask - - runtime string - version string - - q *EventQ - pods map[string]*api.PodSandbox - ctrs map[string]*api.Container - - runPodSandbox func(*mockPlugin, *api.PodSandbox) error - updatePodSandbox func(*mockPlugin, *api.PodSandbox, *api.LinuxResources, *api.LinuxResources) error - postUpdatePodSandbox func(*mockPlugin, *api.PodSandbox) error - stopPodSandbox func(*mockPlugin, *api.PodSandbox) error - removePodSandbox func(*mockPlugin, *api.PodSandbox) error - createContainer func(*mockPlugin, *api.PodSandbox, *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) - postCreateContainer func(*mockPlugin, *api.PodSandbox, *api.Container) error - startContainer func(*mockPlugin, *api.PodSandbox, *api.Container) error - postStartContainer func(*mockPlugin, *api.PodSandbox, *api.Container) error - updateContainer func(*mockPlugin, *api.PodSandbox, *api.Container, *api.LinuxResources) ([]*api.ContainerUpdate, error) - postUpdateContainer func(*mockPlugin, *api.PodSandbox, *api.Container) error - stopContainer func(*mockPlugin, *api.PodSandbox, *api.Container) ([]*api.ContainerUpdate, error) - removeContainer func(*mockPlugin, *api.PodSandbox, *api.Container) error - validateAdjustment func(*mockPlugin, *api.ValidateContainerAdjustmentRequest) error +func (s *Suite) UpdatePodSandbox(pod *api.PodSandbox, overhead, resources *api.LinuxResources) error { + return s.runtime.UpdatePodSandbox(context.Background(), pod, overhead, resources) } -var ( - _ = stub.ShutdownInterface(&mockPlugin{}) - _ = stub.ConfigureInterface(&mockPlugin{}) - _ = stub.SynchronizeInterface(&mockPlugin{}) - _ = stub.RunPodInterface(&mockPlugin{}) - _ = stub.UpdatePodInterface(&mockPlugin{}) - _ = stub.StopPodInterface(&mockPlugin{}) - _ = stub.RemovePodInterface(&mockPlugin{}) - _ = stub.PostUpdatePodInterface(&mockPlugin{}) - _ = stub.CreateContainerInterface(&mockPlugin{}) - _ = stub.StartContainerInterface(&mockPlugin{}) - _ = stub.UpdateContainerInterface(&mockPlugin{}) - _ = stub.StopContainerInterface(&mockPlugin{}) - _ = stub.RemoveContainerInterface(&mockPlugin{}) - _ = stub.PostCreateContainerInterface(&mockPlugin{}) - _ = stub.PostStartContainerInterface(&mockPlugin{}) - _ = stub.PostUpdateContainerInterface(&mockPlugin{}) -) +func (s *Suite) PostUpdatePodSandbox(pod *api.PodSandbox) error { + return s.runtime.PostUpdatePodSandbox(context.Background(), pod) +} -func (m *mockPlugin) Log(format string, args ...interface{}) { - Log("* [plugin %s-%s] "+format, append([]interface{}{m.idx, m.name}, args...)...) +func (s *Suite) StopPodSandbox(pod *api.PodSandbox) error { + return s.runtime.StopPodSandbox(context.Background(), pod) } -func (m *mockPlugin) SetFallbackName(name string, idx int) { - if m.name == "" { - m.name = name - } - if m.idx == "" { - m.idx = fmt.Sprintf("%02d", idx) - } +func (s *Suite) RemovePodSandbox(pod *api.PodSandbox) error { + return s.runtime.RemovePodSandbox(context.Background(), pod) } -func (m *mockPlugin) Wait(e *Event, deadline <-chan time.Time) error { - _, err := m.q.Wait(e, deadline) - return err +func (s *Suite) CreateContainer(pod *api.PodSandbox, ctr *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) { + return s.runtime.CreateContainer(context.Background(), pod, ctr) } -func (m *mockPlugin) Events() []*Event { - return m.q.Events() +func (s *Suite) PostCreateContainer(pod *api.PodSandbox, ctr *api.Container) error { + return s.runtime.PostCreateContainer(context.Background(), pod, ctr) } -func (m *mockPlugin) EventQ() *EventQ { - return m.q +func (s *Suite) StartContainer(pod *api.PodSandbox, ctr *api.Container) error { + return s.runtime.StartContainer(context.Background(), pod, ctr) } -func (m *mockPlugin) Init(dir string) error { - var err error +func (s *Suite) PostStartContainer(pod *api.PodSandbox, ctr *api.Container) error { + return s.runtime.PostStartContainer(context.Background(), pod, ctr) +} - if m.stub != nil { - return fmt.Errorf("plugin %s-%s already initialized", m.idx, m.name) - } +func (s *Suite) UpdateContainer(pod *api.PodSandbox, ctr *api.Container, resources *api.LinuxResources) ([]*api.ContainerUpdate, error) { + return s.runtime.UpdateContainer(context.Background(), pod, ctr, resources) +} - if m.name == "" { - m.name = "mock-plugin" - } - if m.idx == "" { - m.idx = "00" - } +func (s *Suite) PostUpdateContainer(pod *api.PodSandbox, ctr *api.Container) error { + return s.runtime.PostUpdateContainer(context.Background(), pod, ctr) +} + +func (s *Suite) StopContainer(pod *api.PodSandbox, ctr *api.Container) ([]*api.ContainerUpdate, error) { + return s.runtime.StopContainer(context.Background(), pod, ctr) +} - m.q = &EventQ{} +func (s *Suite) RemoveContainer(pod *api.PodSandbox, ctr *api.Container) error { + return s.runtime.RemoveContainer(context.Background(), pod, ctr) +} - m.Log("Init()...") +type RuntimeOption func(*Runtime) error - m.stub, err = stub.New(m, - stub.WithPluginName(m.name), - stub.WithPluginIdx(m.idx), - stub.WithSocketPath(filepath.Join(dir, "nri.sock")), - stub.WithOnClose(m.onClose), - ) - if err != nil { - m.q.Add(PluginCreationError) - return err +func WithRuntimeName(name string) RuntimeOption { + return func(r *Runtime) error { + r.name = name + return nil } - m.pods = make(map[string]*api.PodSandbox) - m.ctrs = make(map[string]*api.Container) +} - if m.runPodSandbox == nil { - m.runPodSandbox = nopPodEvent - } - if m.updatePodSandbox == nil { - m.updatePodSandbox = nopUpdatePodSandbox - } - if m.postUpdatePodSandbox == nil { - m.postUpdatePodSandbox = nopPodEvent - } - if m.stopPodSandbox == nil { - m.stopPodSandbox = nopPodEvent +func WithRuntimeVersion(version string) RuntimeOption { + return func(r *Runtime) error { + r.version = version + return nil } - if m.removePodSandbox == nil { - m.removePodSandbox = nopPodEvent - } - if m.createContainer == nil { - m.createContainer = nopCreateContainer - } - if m.postCreateContainer == nil { - m.postCreateContainer = nopContainerEvent - } - if m.startContainer == nil { - m.startContainer = nopContainerEvent - } - if m.postStartContainer == nil { - m.postStartContainer = nopContainerEvent - } - if m.updateContainer == nil { - m.updateContainer = nopUpdateContainer + +} + +func WithPluginRegistrationTimeout(timeout time.Duration) RuntimeOption { + return func(*Runtime) error { + nri.SetPluginRegistrationTimeout(timeout) + return nil } - if m.postUpdateContainer == nil { - m.postUpdateContainer = nopContainerEvent +} + +func WithPluginRequestTimeout(timeout time.Duration) RuntimeOption { + return func(*Runtime) error { + nri.SetPluginRequestTimeout(timeout) + return nil } - if m.stopContainer == nil { - m.stopContainer = nopStopContainer +} + +var ( + RuntimeStarted = &RuntimeEvent{kind: Started} + RuntimeFailed = func(e error) Event { return &RuntimeEvent{kind: Failed, err: e} } + RuntimeStopped = &RuntimeEvent{kind: Stopped} + RuntimeSynchronize = &RuntimeEvent{kind: Synchronize} + RuntimeUpdate = &RuntimeEvent{kind: Update} +) + +type RuntimeEvent struct { + kind EventKind + err error +} + +func (e *RuntimeEvent) Kind() EventKind { + return e.kind +} + +func (e *RuntimeEvent) String() string { + return "Runtime:" + string(e.kind) +} + +func (e *RuntimeEvent) Match(oe Event) bool { + if e == oe { + return true } - if m.removeContainer == nil { - m.removeContainer = nopContainerEvent + + o, ok := oe.(*RuntimeEvent) + if !ok { + return false } - return nil -} + if e.kind != o.kind { + return false + } -func (m *mockPlugin) Start(dir string) error { - if m.stub == nil { - if err := m.Init(dir); err != nil { - return err - } + if e.kind != Failed { + return true } - if err := m.stub.Start(context.Background()); err != nil { - m.q.Add(PluginStartupError) - return err + if o.err != nil { + return true } - return nil + return e.err == o.err || errors.Is(e.err, o.err) } -func (m *mockPlugin) Stop() { - if m.stub != nil { - m.stub.Stop() - m.stub.Wait() +func WithNRIRuntimeOptions(options ...nri.Option) RuntimeOption { + return func(r *Runtime) error { + r.options = append(r.options, options...) + return nil } - m.q.Add(PluginStopped) } -func (m *mockPlugin) FullName() string { - return m.idx + "-" + m.name +func WithBuiltinPlugins(plugins ...*builtinstub.BuiltinPlugin) RuntimeOption { + return func(r *Runtime) error { + r.options = append(r.options, nri.WithBuiltinPlugins(plugins...)) + return nil + } } -func (m *mockPlugin) RuntimeName() string { - return m.runtime +type Runtime struct { + t *testing.T + dir string + name string + version string + options []nri.Option + syncCB nri.SyncFn + updateCB nri.UpdateFn + r *nri.Adaptation + events chan<- Event + nextPodID int + nextCtrID int } -func (m *mockPlugin) RuntimeVersion() string { - return m.version -} +const ( + TestRuntimeName = "test-runtime" + TestRuntimeVersion = "v1.2.3" + TestNRIPluginDir = "nri/plugins" + TestNRIConfigDir = "nri/conf.d" + TestNRISocket = "nri.sock" +) + +func NewRuntime(t *testing.T, dir string, events chan<- Event, options ...RuntimeOption) *Runtime { + var ( + r = &Runtime{ + t: t, + dir: dir, + name: TestRuntimeName, + version: TestRuntimeVersion, + events: events, + } + pluginDir = filepath.Join(r.dir, TestNRIPluginDir) + configDir = filepath.Join(r.dir, TestNRIConfigDir) + socket = filepath.Join(r.dir, TestNRISocket) + nriOptions = []nri.Option{ + nri.WithPluginPath(pluginDir), + nri.WithPluginConfigPath(configDir), + nri.WithSocketPath(socket), + } + err error + ) + + nri.SetPluginRegistrationTimeout(nri.DefaultPluginRegistrationTimeout) + nri.SetPluginRequestTimeout(nri.DefaultPluginRequestTimeout) -func (m *mockPlugin) onClose() { - if m.stub != nil { - m.stub.Stop() - m.stub.Wait() + r.syncCB = r.synchronize + r.updateCB = r.update + + for _, o := range options { + require.NoError(t, o(r), "apply runtime options") } - if m.q != nil { - m.q.Add(PluginDisconnected) + require.NoError(r.t, os.MkdirAll(pluginDir, 0o755), "create plugin dir") + require.NoError(r.t, os.MkdirAll(configDir, 0o755), "create config dir") + + r.r, err = nri.New( + r.name, + r.version, + r.syncCB, + r.updateCB, + append(nriOptions, r.options...)..., + ) + + if err != nil { + r.emit(RuntimeFailed(err)) } + + return r } -func (m *mockPlugin) Configure(_ context.Context, _, runtime, version string) (stub.EventMask, error) { - m.q.Add(PluginConfigured) +func (*Runtime) Name() string { + return TestRuntimeName +} - m.runtime = runtime - m.version = version +func (*Runtime) Version() string { + return TestRuntimeVersion +} - events := m.mask - if m.validateAdjustment == nil { - events.Clear(api.Event_VALIDATE_CONTAINER_ADJUSTMENT) +func (r *Runtime) Start() { + if r.r != nil { + err := r.r.Start() + if err != nil { + r.emit(RuntimeFailed(err)) + } else { + r.emit(RuntimeStarted) + } } - - return events, nil } -func (m *mockPlugin) Synchronize(_ context.Context, pods []*api.PodSandbox, ctrs []*api.Container) ([]*api.ContainerUpdate, error) { - for _, pod := range pods { - m.pods[pod.Id] = pod +func (r *Runtime) Stop() { + if r.r != nil { + r.r.Stop() + r.emit(RuntimeStopped) } - for _, ctr := range ctrs { - m.ctrs[ctr.Id] = ctr +} + +func (r *Runtime) emit(e Event) { + if r.events != nil { + r.events <- e } +} - m.q.Add(PluginSynchronized) +func (r *Runtime) synchronize(ctx context.Context, cb nri.SyncCB) error { + r.emit(RuntimeSynchronize) + cb(ctx, []*api.PodSandbox{}, []*api.Container{}) + return nil +} +func (r *Runtime) update(_ context.Context, _ []*api.ContainerUpdate) ([]*api.ContainerUpdate, error) { + r.emit(RuntimeUpdate) return nil, nil } -func (m *mockPlugin) Shutdown(_ context.Context, reason string) { - m.q.Add(PluginShutdownWithReason(reason)) +func (r *Runtime) BlockPluginSync() *nri.PluginSyncBlock { + return r.r.BlockPluginSync() } -func (m *mockPlugin) RunPodSandbox(_ context.Context, pod *api.PodSandbox) error { - m.pods[pod.Id] = pod - err := m.runPodSandbox(m, pod) - m.q.Add(PodSandboxEvent(pod, RunPodSandbox)) - return err +func (r *Runtime) RunPodSandbox(ctx context.Context, pod *api.PodSandbox) error { + return r.r.RunPodSandbox( + ctx, + &api.RunPodSandboxRequest{ + Pod: pod, + }, + ) } -func (m *mockPlugin) UpdatePodSandbox(_ context.Context, pod *api.PodSandbox, overhead *api.LinuxResources, res *api.LinuxResources) error { - m.pods[pod.Id] = pod - m.q.Add(PodSandboxEvent(pod, UpdatePodSandbox)) +func (r *Runtime) UpdatePodSandbox(ctx context.Context, pod *api.PodSandbox, overhead, resources *api.LinuxResources) error { + _, err := r.r.UpdatePodSandbox( + ctx, + &api.UpdatePodSandboxRequest{ + Pod: pod, + OverheadLinuxResources: overhead, + LinuxResources: resources, + }, + ) - return m.updatePodSandbox(m, pod, overhead, res) + return err } -func (m *mockPlugin) PostUpdatePodSandbox(_ context.Context, pod *api.PodSandbox) error { - m.pods[pod.Id] = pod - err := m.postUpdatePodSandbox(m, pod) - m.q.Add(PodSandboxEvent(pod, PostUpdatePodSandbox)) - return err +func (r *Runtime) PostUpdatePodSandbox(ctx context.Context, pod *api.PodSandbox) error { + return r.r.PostUpdatePodSandbox( + ctx, + &api.PostUpdatePodSandboxRequest{ + Pod: pod, + }, + ) } -func (m *mockPlugin) StopPodSandbox(_ context.Context, pod *api.PodSandbox) error { - m.pods[pod.Id] = pod - err := m.stopPodSandbox(m, pod) - m.q.Add(PodSandboxEvent(pod, StopPodSandbox)) - return err +func (r *Runtime) StopPodSandbox(ctx context.Context, pod *api.PodSandbox) error { + return r.r.StopPodSandbox( + ctx, + &api.StopPodSandboxRequest{ + Pod: pod, + }, + ) } -func (m *mockPlugin) RemovePodSandbox(_ context.Context, pod *api.PodSandbox) error { - delete(m.pods, pod.Id) - err := m.removePodSandbox(m, pod) - m.q.Add(PodSandboxEvent(pod, RemovePodSandbox)) - return err +func (r *Runtime) RemovePodSandbox(ctx context.Context, pod *api.PodSandbox) error { + return r.r.RemovePodSandbox( + ctx, + &api.RemovePodSandboxRequest{ + Pod: pod, + }, + ) } -func (m *mockPlugin) CreateContainer(_ context.Context, pod *api.PodSandbox, ctr *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) { - m.pods[pod.Id] = pod - m.ctrs[ctr.Id] = ctr - m.q.Add(ContainerEvent(ctr, CreateContainer)) +func (r *Runtime) CreateContainer(ctx context.Context, pod *api.PodSandbox, ctr *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) { + rpl, err := r.r.CreateContainer( + ctx, + &api.CreateContainerRequest{ + Pod: pod, + Container: ctr, + }, + ) + if err != nil { + return nil, nil, err + } - return m.createContainer(m, pod, ctr) + return rpl.Adjust, rpl.Update, nil } -func (m *mockPlugin) PostCreateContainer(_ context.Context, pod *api.PodSandbox, ctr *api.Container) error { - m.pods[pod.Id] = pod - m.ctrs[ctr.Id] = ctr - m.q.Add(ContainerEvent(ctr, PostCreateContainer)) - - return m.postCreateContainer(m, pod, ctr) +func (r *Runtime) PostCreateContainer(ctx context.Context, pod *api.PodSandbox, ctr *api.Container) error { + return r.r.PostCreateContainer( + ctx, + &api.PostCreateContainerRequest{ + Pod: pod, + Container: ctr, + }, + ) } -func (m *mockPlugin) StartContainer(_ context.Context, pod *api.PodSandbox, ctr *api.Container) error { - m.pods[pod.Id] = pod - m.ctrs[ctr.Id] = ctr - m.q.Add(ContainerEvent(ctr, StartContainer)) +func (r *Runtime) StartContainer(ctx context.Context, pod *api.PodSandbox, ctr *api.Container) error { + return r.r.StartContainer( + ctx, + &api.StartContainerRequest{ + Pod: pod, + Container: ctr, + }, + ) +} - return m.startContainer(m, pod, ctr) +func (r *Runtime) PostStartContainer(ctx context.Context, pod *api.PodSandbox, ctr *api.Container) error { + return r.r.PostStartContainer( + ctx, + &api.PostStartContainerRequest{ + Pod: pod, + Container: ctr, + }, + ) } -func (m *mockPlugin) PostStartContainer(_ context.Context, pod *api.PodSandbox, ctr *api.Container) error { - m.pods[pod.Id] = pod - m.ctrs[ctr.Id] = ctr - m.q.Add(ContainerEvent(ctr, PostStartContainer)) +func (r *Runtime) UpdateContainer(ctx context.Context, pod *api.PodSandbox, ctr *api.Container, resources *api.LinuxResources) ([]*api.ContainerUpdate, error) { + rpl, err := r.r.UpdateContainer( + ctx, + &api.UpdateContainerRequest{ + Pod: pod, + Container: ctr, + LinuxResources: resources, + }, + ) - return m.postStartContainer(m, pod, ctr) -} + if err != nil { + return nil, err + } -func (m *mockPlugin) UpdateContainer(_ context.Context, pod *api.PodSandbox, ctr *api.Container, res *api.LinuxResources) ([]*api.ContainerUpdate, error) { - m.pods[pod.Id] = pod - m.ctrs[ctr.Id] = ctr - m.q.Add(ContainerEvent(ctr, UpdateContainer)) + return rpl.Update, nil +} - return m.updateContainer(m, pod, ctr, res) +func (r *Runtime) PostUpdateContainer(ctx context.Context, pod *api.PodSandbox, ctr *api.Container) error { + return r.r.PostUpdateContainer( + ctx, + &api.PostUpdateContainerRequest{ + Pod: pod, + Container: ctr, + }, + ) } -func (m *mockPlugin) PostUpdateContainer(_ context.Context, pod *api.PodSandbox, ctr *api.Container) error { - m.pods[pod.Id] = pod - m.ctrs[ctr.Id] = ctr - m.q.Add(ContainerEvent(ctr, PostUpdateContainer)) +func (r *Runtime) StopContainer(ctx context.Context, pod *api.PodSandbox, ctr *api.Container) ([]*api.ContainerUpdate, error) { + rpl, err := r.r.StopContainer( + ctx, + &api.StopContainerRequest{ + Pod: pod, + Container: ctr, + }, + ) - return m.postUpdateContainer(m, pod, ctr) -} + if err != nil { + return nil, err + } -func (m *mockPlugin) StopContainer(_ context.Context, pod *api.PodSandbox, ctr *api.Container) ([]*api.ContainerUpdate, error) { - m.pods[pod.Id] = pod - m.ctrs[ctr.Id] = ctr - m.q.Add(ContainerEvent(ctr, StopContainer)) + return rpl.Update, nil +} - return m.stopContainer(m, pod, ctr) +func (r *Runtime) RemoveContainer(ctx context.Context, pod *api.PodSandbox, ctr *api.Container) error { + return r.r.RemoveContainer( + ctx, + &api.RemoveContainerRequest{ + Pod: pod, + Container: ctr, + }, + ) } -func (m *mockPlugin) RemoveContainer(_ context.Context, pod *api.PodSandbox, ctr *api.Container) error { - delete(m.ctrs, ctr.Id) - m.q.Add(ContainerEvent(ctr, RemoveContainer)) +type PodOption func(*api.PodSandbox) - return m.removeContainer(m, pod, ctr) +func WithPodRandomFill() PodOption { + return func(pod *api.PodSandbox) { + faker.RecursiveDepth = 25 + faker.Struct(pod) + } } -func (m *mockPlugin) ValidateContainerAdjustment(_ context.Context, req *api.ValidateContainerAdjustmentRequest) error { - if m.validateAdjustment != nil { - m.q.Add(ContainerEvent(req.Container, ValidateContainerAdjustment)) - return m.validateAdjustment(m, req) +func WithPodName(name string) PodOption { + return func(pod *api.PodSandbox) { + pod.Name = name } - return nil } -func nopPodEvent(*mockPlugin, *api.PodSandbox) error { - return nil +func WithPodUID(uid string) PodOption { + return func(pod *api.PodSandbox) { + pod.Uid = uid + } } -func nopContainerEvent(*mockPlugin, *api.PodSandbox, *api.Container) error { - return nil +func WithPodNamespace(namespace string) PodOption { + return func(pod *api.PodSandbox) { + pod.Namespace = namespace + } } -func nopUpdatePodSandbox(*mockPlugin, *api.PodSandbox, *api.LinuxResources, *api.LinuxResources) error { - return nil +func WithPodLabels(labels map[string]string) PodOption { + return func(pod *api.PodSandbox) { + pod.Labels = labels + } } -func nopCreateContainer(*mockPlugin, *api.PodSandbox, *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) { +func WithPodAnnotations(annotations map[string]string) PodOption { + return func(pod *api.PodSandbox) { + pod.Annotations = annotations + } +} + +func WithPodRuntimeHandler(handler string) PodOption { + return func(pod *api.PodSandbox) { + pod.RuntimeHandler = handler + } +} + +func WithPodLinuxResources(overhead, resources *api.LinuxResources) PodOption { + return func(pod *api.PodSandbox) { + pod.Linux.PodOverhead = overhead + pod.Linux.PodResources = resources + pod.Linux.Resources = resources + } +} + +func WithPodCgroupParent(cgroupParent string) PodOption { + return func(pod *api.PodSandbox) { + pod.Linux.CgroupParent = cgroupParent + } +} + +func WithPodCgroupsPath(cgroupsPath string) PodOption { + return func(pod *api.PodSandbox) { + pod.Linux.CgroupsPath = cgroupsPath + } +} + +func WithPodLinuxNamespaces(namespaces []*api.LinuxNamespace) PodOption { + return func(pod *api.PodSandbox) { + pod.Linux.Namespaces = namespaces + } +} + +func (r *Runtime) NewPod(options ...PodOption) *api.PodSandbox { + pod := &api.PodSandbox{} + for _, o := range options { + o(pod) + } + + pod.Id = fmt.Sprintf("pod-%d", r.nextPodID) + r.nextPodID++ + + return pod +} + +type ContainerOption func(*api.Container) + +func WithContainerRandomFill() ContainerOption { + return func(ctr *api.Container) { + faker.RecursiveDepth = 25 + faker.Struct(ctr) + ctr.State = api.ContainerState_CONTAINER_UNKNOWN + } +} + +func WithContainerPodID(id string) ContainerOption { + return func(ctr *api.Container) { + ctr.PodSandboxId = id + } +} + +func WithContainerPod(pod *api.PodSandbox) ContainerOption { + return func(ctr *api.Container) { + ctr.PodSandboxId = pod.GetId() + } +} + +func WithContainerName(name string) ContainerOption { + return func(ctr *api.Container) { + ctr.Name = name + } +} + +func WithContainerState(state api.ContainerState) ContainerOption { + return func(ctr *api.Container) { + ctr.State = state + } +} + +func WithContainerLabels(labels map[string]string) ContainerOption { + return func(ctr *api.Container) { + ctr.Labels = labels + } +} + +func WithContainerAnnotations(annotations map[string]string) ContainerOption { + return func(ctr *api.Container) { + ctr.Annotations = annotations + } +} + +func WithContainerArgs(args ...string) ContainerOption { + return func(ctr *api.Container) { + ctr.Args = args + } +} + +func WithContainerEnv(env map[string]string) ContainerOption { + return func(ctr *api.Container) { + for k, v := range env { + ctr.Env = append(ctr.Env, k+"="+v) + } + } +} + +func WithContainerMounts(mounts ...*api.Mount) ContainerOption { + return func(ctr *api.Container) { + ctr.Mounts = mounts + } +} + +func WithContainerOCIHooks(hooks *api.Hooks) ContainerOption { + return func(ctr *api.Container) { + ctr.Hooks = hooks + } +} + +func WithContainerLinuxResources(resources *api.LinuxResources) ContainerOption { + return func(ctr *api.Container) { + if ctr.Linux == nil { + ctr.Linux = &api.LinuxContainer{} + } + ctr.Linux.Resources = resources + } +} + +func WithContaineOomScoreAdj(adj int32) ContainerOption { + return func(ctr *api.Container) { + if ctr.Linux == nil { + ctr.Linux = &api.LinuxContainer{} + } + ctr.Linux.OomScoreAdj = api.Int(adj) + } +} + +func WithContinerCgroupsPath(cgroupsPath string) ContainerOption { + return func(ctr *api.Container) { + if ctr.Linux == nil { + ctr.Linux = &api.LinuxContainer{} + } + ctr.Linux.CgroupsPath = cgroupsPath + } +} + +func WithContainerLinuxNamespaces(namespaces []*api.LinuxNamespace) ContainerOption { + return func(ctr *api.Container) { + if ctr.Linux == nil { + ctr.Linux = &api.LinuxContainer{} + } + ctr.Linux.Namespaces = namespaces + } +} + +func WithContainerLinuxDevices(devices []*api.LinuxDevice) ContainerOption { + return func(ctr *api.Container) { + if ctr.Linux == nil { + ctr.Linux = &api.LinuxContainer{} + } + ctr.Linux.Devices = devices + } +} + +func WithContainerLinuxIOPriority(ioPrio *api.LinuxIOPriority) ContainerOption { + return func(ctr *api.Container) { + if ctr.Linux == nil { + ctr.Linux = &api.LinuxContainer{} + } + ctr.Linux.IoPriority = ioPrio + } +} + +func WithContainerSeccompProfile(profile *api.SecurityProfile) ContainerOption { + return func(ctr *api.Container) { + if ctr.Linux == nil { + ctr.Linux = &api.LinuxContainer{} + } + ctr.Linux.SeccompProfile = profile + } +} + +func WithContainerSeccompPolicy(policy *api.LinuxSeccomp) ContainerOption { + return func(ctr *api.Container) { + if ctr.Linux == nil { + ctr.Linux = &api.LinuxContainer{} + } + ctr.Linux.SeccompPolicy = policy + } +} + +func WithContainerPid(pid uint32) ContainerOption { + return func(ctr *api.Container) { + ctr.Pid = pid + } +} + +func WithContainerPOSIXRlimits(rlimits []*api.POSIXRlimit) ContainerOption { + return func(ctr *api.Container) { + ctr.Rlimits = rlimits + } +} + +func WithContainerCDIDevices(devices []*api.CDIDevice) ContainerOption { + return func(ctr *api.Container) { + ctr.CDIDevices = devices + } +} + +func WithContainerUser(user *api.User) ContainerOption { + return func(ctr *api.Container) { + ctr.User = user + } +} + +func (r *Runtime) NewContainer(options ...ContainerOption) *api.Container { + ctr := &api.Container{} + for _, o := range options { + o(ctr) + } + + ctr.Id = fmt.Sprintf("ctr-%d", r.nextCtrID) + r.nextCtrID++ + + return ctr +} + +type PluginOption func(*Plugin) error + +func WithPluginName(name string) PluginOption { + return func(p *Plugin) error { + p.name = name + return nil + } +} + +func WithPluginIndex(idx string) PluginOption { + return func(p *Plugin) error { + p.idx = idx + return nil + } +} + +func WithHandlers(h Handlers) PluginOption { + return func(p *Plugin) error { + if p.v1alpha1 != nil { + return errors.New("can't set v1beta1 handlers, plugin is set to v1alpha1") + } + if p.builtin != nil { + return errors.New("can't set v1beta1 handlers, plugin is set to builtin") + } + h := h + p.latest = &latestPlugin{ + p: p, + h: &h, + } + return nil + } +} + +type Handlers struct { + Configure func(string, string, string) (api.EventMask, error) + Synchronize func([]*api.PodSandbox, []*api.Container) ([]*api.ContainerUpdate, error) + Shutdown func(string) + RunPodSandbox func(*api.PodSandbox) error + UpdatePodSandbox func(*api.PodSandbox, *api.LinuxResources, *api.LinuxResources) error + PostUpdatePodSandbox func(*api.PodSandbox) error + StopPodSandbox func(*api.PodSandbox) error + RemovePodSandbox func(*api.PodSandbox) error + CreateContainer func(*api.PodSandbox, *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) + PostCreateContainer func(*api.PodSandbox, *api.Container) error + StartContainer func(*api.PodSandbox, *api.Container) error + PostStartContainer func(*api.PodSandbox, *api.Container) error + UpdateContainer func(*api.PodSandbox, *api.Container, *api.LinuxResources) ([]*api.ContainerUpdate, error) + PostUpdateContainer func(*api.PodSandbox, *api.Container) error + StopContainer func(*api.PodSandbox, *api.Container) ([]*api.ContainerUpdate, error) + RemoveContainer func(*api.PodSandbox, *api.Container) error + ValidateContainerAdjustment func(*api.ValidateContainerAdjustmentRequest) error +} + +func WithV1alpha1(h V1alpha1Handlers) PluginOption { + return func(p *Plugin) error { + if p.latest != nil { + return errors.New("can't set v1beta1 handlers, plugin is set to v1beta1") + } + if p.builtin != nil { + return errors.New("can't set v1beta1 handlers, plugin is set to builtin") + } + h := h + p.v1alpha1 = &v1alpha1Plugin{ + p: p, + h: &h, + } + return nil + } +} + +type V1alpha1Handlers struct { + Configure func(string, string, string) (v1alpha1.EventMask, error) + Synchronize func([]*v1alpha1.PodSandbox, []*v1alpha1.Container) ([]*v1alpha1.ContainerUpdate, error) + Shutdown func() + RunPodSandbox func(*v1alpha1.PodSandbox) error + UpdatePodSandbox func(*v1alpha1.PodSandbox, *v1alpha1.LinuxResources, *v1alpha1.LinuxResources) error + StopPodSandbox func(*v1alpha1.PodSandbox) error + RemovePodSandbox func(*v1alpha1.PodSandbox) error + PostUpdatePodSandbox func(*v1alpha1.PodSandbox) error + CreateContainer func(*v1alpha1.PodSandbox, *v1alpha1.Container) (*v1alpha1.ContainerAdjustment, []*v1alpha1.ContainerUpdate, error) + StartContainer func(*v1alpha1.PodSandbox, *v1alpha1.Container) error + UpdateContainer func(*v1alpha1.PodSandbox, *v1alpha1.Container, *v1alpha1.LinuxResources) ([]*v1alpha1.ContainerUpdate, error) + StopContainer func(*v1alpha1.PodSandbox, *v1alpha1.Container) ([]*v1alpha1.ContainerUpdate, error) + RemoveContainer func(*v1alpha1.PodSandbox, *v1alpha1.Container) error + PostCreateContainer func(*v1alpha1.PodSandbox, *v1alpha1.Container) error + PostStartContainer func(*v1alpha1.PodSandbox, *v1alpha1.Container) error + PostUpdateContainer func(*v1alpha1.PodSandbox, *v1alpha1.Container) error + ValidateContainerAdjustment func(*v1alpha1.ValidateContainerAdjustmentRequest) error +} + +func WithBuiltin(h BuiltinHandlers) PluginOption { + return func(p *Plugin) error { + if p.latest != nil { + return errors.New("can't set builtin handlers, plugin is set to v1beta1") + } + if p.v1alpha1 != nil { + return errors.New("can't set builtin handlers, plugin is set to v1alpha1") + } + h := h + p.builtin = &builtinPlugin{ + p: p, + h: &h, + } + return nil + } +} + +type BuiltinHandlers struct { + Configure func(*api.ConfigureRequest) (*api.ConfigureResponse, error) + Synchronize func(*api.SynchronizeRequest) (*api.SynchronizeResponse, error) + RunPodSandbox func(*api.RunPodSandboxRequest) error + StopPodSandbox func(*api.StopPodSandboxRequest) error + RemovePodSandbox func(*api.RemovePodSandboxRequest) error + UpdatePodSandbox func(*api.UpdatePodSandboxRequest) (*api.UpdatePodSandboxResponse, error) + PostUpdatePodSandbox func(*api.PostUpdatePodSandboxRequest) error + + CreateContainer func(*api.CreateContainerRequest) (*api.CreateContainerResponse, error) + PostCreateContainer func(*api.PostCreateContainerRequest) error + StartContainer func(*api.StartContainerRequest) error + PostStartContainer func(*api.PostStartContainerRequest) error + UpdateContainer func(*api.UpdateContainerRequest) (*api.UpdateContainerResponse, error) + PostUpdateContainer func(*api.PostUpdateContainerRequest) error + StopContainer func(*api.StopContainerRequest) (*api.StopContainerResponse, error) + RemoveContainer func(*api.RemoveContainerRequest) error + ValidateContainerAdjustment func(*api.ValidateContainerAdjustmentRequest) error +} + +type Plugin struct { + t *testing.T + dir string + events chan<- Event + name string + idx string + subscribe []string + latest *latestPlugin + v1alpha1 *v1alpha1Plugin + builtin *builtinPlugin +} + +type latestPlugin struct { + p *Plugin + h *Handlers + stub stub.Stub +} + +type v1alpha1Plugin struct { + p *Plugin + h *V1alpha1Handlers + stub v1alpha1stub.Stub +} + +type builtinPlugin struct { + p *Plugin + h *BuiltinHandlers + stub builtinstub.BuiltinHandlers +} + +func NewPlugin(t *testing.T, dir string, events chan<- Event, options ...PluginOption) *Plugin { + var ( + p = &Plugin{ + t: t, + dir: dir, + events: events, + } + err error + ) + + for _, o := range options { + require.NoError(t, o(p), "apply plugin options") + } + + switch { + default: + p.latest = &latestPlugin{p: p, h: &Handlers{}} + fallthrough + case p.latest != nil: + p.latest.stub, err = stub.New( + p.latest, + stub.WithPluginName(p.name), + stub.WithPluginIdx(p.idx), + stub.WithSocketPath(filepath.Join(p.dir, TestNRISocket)), + stub.WithOnClose(p.onClose), + ) + require.NoError(t, err, "create v1beta1 plugin stub") + + case p.v1alpha1 != nil: + p.v1alpha1.stub, err = v1alpha1stub.New( + p.v1alpha1, + v1alpha1stub.WithPluginName(p.name), + v1alpha1stub.WithPluginIdx(p.idx), + v1alpha1stub.WithSocketPath(filepath.Join(p.dir, TestNRISocket)), + v1alpha1stub.WithOnClose(p.onClose), + ) + require.NoError(t, err, "create v1alpha1 plugin stub") + + case p.builtin != nil: + p.builtin.stub = builtinstub.BuiltinHandlers{ + Configure: p.builtin.Configure, + Synchronize: p.builtin.Synchronize, + RunPodSandbox: p.builtin.RunPodSandbox, + UpdatePodSandbox: p.builtin.UpdatePodSandbox, + PostUpdatePodSandbox: p.builtin.PostUpdatePodSandbox, + StopPodSandbox: p.builtin.StopPodSandbox, + RemovePodSandbox: p.builtin.RemovePodSandbox, + CreateContainer: p.builtin.CreateContainer, + PostCreateContainer: p.builtin.PostCreateContainer, + StartContainer: p.builtin.StartContainer, + PostStartContainer: p.builtin.PostStartContainer, + UpdateContainer: p.builtin.UpdateContainer, + PostUpdateContainer: p.builtin.PostUpdateContainer, + StopContainer: p.builtin.StopContainer, + RemoveContainer: p.builtin.RemoveContainer, + ValidateContainerAdjustment: p.builtin.ValidateContainerAdjustment, + } + } + + return p +} + +func (p *Plugin) ID() string { + return p.idx + "-" + p.name +} + +func (p *Plugin) Name() string { + return p.name +} + +func (p *Plugin) Index() string { + return p.idx +} + +func (p *Plugin) IsV1beta1() bool { + return p.latest != nil +} + +func (p *Plugin) IsV1alpha1() bool { + return p.v1alpha1 != nil +} + +func (p *Plugin) IsBuiltin() bool { + return p.builtin != nil +} + +func (p *Plugin) Kind() string { + switch { + case p.IsV1beta1(): + return "v1beta1" + case p.IsV1alpha1(): + return "v1alpha1" + case p.IsBuiltin(): + return "builtin" + default: + return "unknown" + } +} + +func (p *Plugin) Start() { + var err error + + switch { + case p.latest != nil: + err = p.latest.stub.Start(context.Background()) + case p.v1alpha1 != nil: + err = p.v1alpha1.stub.Start(context.Background()) + case p.builtin != nil: + // Builtin plugins are started by the runtime/adaptation. + } + + if err != nil { + p.Emit(PluginFailed(p.ID(), err)) + return + } + + p.Emit(PluginStarted(p.ID())) +} + +func (p *Plugin) Stop() { + switch { + case p.latest != nil: + p.latest.stub.Stop() + case p.v1alpha1 != nil: + p.v1alpha1.stub.Stop() + case p.builtin != nil: + // Builtin plugins are stopped by the runtime/adaptation. + } + + p.Emit(PluginStopped(p.ID())) +} + +func (p *Plugin) onClose() { + p.Emit(PluginClosed(p.ID())) +} + +func (p *Plugin) Emit(e Event) { + if p.events != nil { + p.events <- e + } +} + +func (p *latestPlugin) Configure(_ context.Context, cfg, runtime, version string) (api.EventMask, error) { + p.p.Emit( + PluginConfigured( + p.p.ID(), + runtime, + version, + p.stub.RegistrationTimeout(), + p.stub.RequestTimeout(), + ), + ) + + if p.h.Configure != nil { + return p.h.Configure(cfg, version, runtime) + } + + events, err := api.ParseEventMask(p.p.subscribe...) + require.NoError(p.p.t, err, "parse event subscription mask %v", p.p.subscribe) + + return events, nil +} + +func (p *latestPlugin) Synchronize(_ context.Context, pods []*api.PodSandbox, containers []*api.Container) ([]*api.ContainerUpdate, error) { + p.p.Emit( + PluginSynchronized( + p.p.ID(), + pods, + containers, + ), + ) + + if p.h.Synchronize != nil { + return p.h.Synchronize(pods, containers) + } + + return nil, nil +} + +func (p *latestPlugin) Shutdown(_ context.Context, reason string) { + p.p.Emit( + PluginShutdown( + p.p.ID(), + reason, + ), + ) + + if p.h.Shutdown != nil { + p.h.Shutdown(reason) + } +} + +func (p *latestPlugin) RunPodSandbox(_ context.Context, pod *api.PodSandbox) error { + p.p.Emit( + PluginRunPodSandbox( + p.p.ID(), + pod, + ), + ) + + if p.h.RunPodSandbox != nil { + return p.h.RunPodSandbox(pod) + } + + return nil +} + +func (p *latestPlugin) UpdatePodSandbox(_ context.Context, pod *api.PodSandbox, overhead, resources *api.LinuxResources) error { + p.p.Emit( + PluginUpdatePodSandbox( + p.p.ID(), + pod, + overhead, + resources, + ), + ) + + if p.h.UpdatePodSandbox != nil { + return p.h.UpdatePodSandbox(pod, overhead, resources) + } + + return nil +} + +func (p *latestPlugin) PostUpdatePodSandbox(_ context.Context, pod *api.PodSandbox) error { + p.p.Emit( + PluginPostUpdatePodSandbox( + p.p.ID(), + pod, + ), + ) + + if p.h.PostUpdatePodSandbox != nil { + return p.h.PostUpdatePodSandbox(pod) + } + + return nil +} + +func (p *latestPlugin) StopPodSandbox(_ context.Context, pod *api.PodSandbox) error { + p.p.Emit( + PluginStopPodSandbox( + p.p.ID(), + pod, + ), + ) + + if p.h.StopPodSandbox != nil { + return p.h.StopPodSandbox(pod) + } + + return nil +} + +func (p *latestPlugin) RemovePodSandbox(_ context.Context, pod *api.PodSandbox) error { + p.p.Emit( + PluginRemovePodSandbox( + p.p.ID(), + pod, + ), + ) + + if p.h.RemovePodSandbox != nil { + return p.h.RemovePodSandbox(pod) + } + + return nil +} + +func (p *latestPlugin) CreateContainer(_ context.Context, pod *api.PodSandbox, container *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) { + p.p.Emit( + PluginCreateContainer( + p.p.ID(), + pod, + container, + ), + ) + + if p.h.CreateContainer != nil { + return p.h.CreateContainer(pod, container) + } + + return nil, nil, nil +} + +func (p *latestPlugin) PostCreateContainer(_ context.Context, pod *api.PodSandbox, container *api.Container) error { + p.p.Emit( + PluginPostCreateContainer( + p.p.ID(), + pod, + container, + ), + ) + + if p.h.PostCreateContainer != nil { + return p.h.PostCreateContainer(pod, container) + } + + return nil +} + +func (p *latestPlugin) StartContainer(_ context.Context, pod *api.PodSandbox, container *api.Container) error { + p.p.Emit( + PluginStartContainer( + p.p.ID(), + pod, + container, + ), + ) + + if p.h.StartContainer != nil { + return p.h.StartContainer(pod, container) + } + + return nil +} + +func (p *latestPlugin) PostStartContainer(_ context.Context, pod *api.PodSandbox, container *api.Container) error { + p.p.Emit( + PluginPostStartContainer( + p.p.ID(), + pod, + container, + ), + ) + + if p.h.PostStartContainer != nil { + return p.h.PostStartContainer(pod, container) + } + + return nil +} + +func (p *latestPlugin) UpdateContainer(_ context.Context, pod *api.PodSandbox, container *api.Container, resources *api.LinuxResources) ([]*api.ContainerUpdate, error) { + p.p.Emit( + PluginUpdateContainer( + p.p.ID(), + pod, + container, + resources, + ), + ) + + if p.h.UpdateContainer != nil { + return p.h.UpdateContainer(pod, container, resources) + } + + return nil, nil +} + +func (p *latestPlugin) PostUpdateContainer(_ context.Context, pod *api.PodSandbox, container *api.Container) error { + p.p.Emit( + PluginPostUpdateContainer( + p.p.ID(), + pod, + container, + ), + ) + + if p.h.PostUpdateContainer != nil { + return p.h.PostUpdateContainer(pod, container) + } + + return nil +} + +func (p *latestPlugin) StopContainer(_ context.Context, pod *api.PodSandbox, container *api.Container) ([]*api.ContainerUpdate, error) { + p.p.Emit( + PluginStopContainer( + p.p.ID(), + pod, + container, + ), + ) + + if p.h.StopContainer != nil { + return p.h.StopContainer(pod, container) + } + + return nil, nil +} + +func (p *latestPlugin) RemoveContainer(_ context.Context, pod *api.PodSandbox, container *api.Container) error { + p.p.Emit( + PluginRemoveContainer( + p.p.ID(), + pod, + container, + ), + ) + + if p.h.RemoveContainer != nil { + return p.h.RemoveContainer(pod, container) + } + + return nil +} + +func (p *latestPlugin) ValidateContainerAdjustment(_ context.Context, req *api.ValidateContainerAdjustmentRequest) error { + p.p.Emit( + PluginValidateContainerAdjustment( + p.p.ID(), + req, + ), + ) + + if p.h.ValidateContainerAdjustment != nil { + return p.h.ValidateContainerAdjustment(req) + } + + return nil +} + +func (p *v1alpha1Plugin) Configure(_ context.Context, cfg, runtime, version string) (v1alpha1.EventMask, error) { + p.p.Emit( + PluginConfigured( + p.p.ID(), + runtime, + version, + p.stub.RegistrationTimeout(), + p.stub.RequestTimeout(), + ), + ) + + if p.h.Configure != nil { + return p.h.Configure(cfg, version, runtime) + } + + events, err := v1alpha1.ParseEventMask(p.p.subscribe...) + require.NoError(p.p.t, err, "parse event subscription mask %v", p.p.subscribe) + + return events, nil +} + +func (p *v1alpha1Plugin) Synchronize(_ context.Context, pods []*v1alpha1.PodSandbox, containers []*v1alpha1.Container) ([]*v1alpha1.ContainerUpdate, error) { + p.p.Emit( + PluginSynchronized( + p.p.ID(), + convert.PodSandboxSliceToV1beta1(pods), + convert.ContainerSliceToV1beta1(containers), + ), + ) + + if p.h.Synchronize != nil { + return p.h.Synchronize(pods, containers) + } + + return nil, nil +} + +func (p *v1alpha1Plugin) Shutdown(_ context.Context) { + p.p.Emit( + PluginShutdown( + p.p.ID(), + "", + ), + ) + + if p.h.Shutdown != nil { + p.h.Shutdown() + } +} + +func (p *v1alpha1Plugin) RunPodSandbox(_ context.Context, pod *v1alpha1.PodSandbox) error { + p.p.Emit( + PluginRunPodSandbox( + p.p.ID(), + convert.PodSandboxToV1beta1(pod), + ), + ) + + if p.h.RunPodSandbox != nil { + return p.h.RunPodSandbox(pod) + } + + return nil +} + +func (p *v1alpha1Plugin) UpdatePodSandbox(_ context.Context, pod *v1alpha1.PodSandbox, overhead, resources *v1alpha1.LinuxResources) error { + p.p.Emit( + PluginUpdatePodSandbox( + p.p.ID(), + convert.PodSandboxToV1beta1(pod), + convert.LinuxResourcesToV1beta1(overhead), + convert.LinuxResourcesToV1beta1(resources), + ), + ) + + if p.h.UpdatePodSandbox != nil { + return p.h.UpdatePodSandbox(pod, overhead, resources) + } + + return nil +} + +func (p *v1alpha1Plugin) PostUpdatePodSandbox(_ context.Context, pod *v1alpha1.PodSandbox) error { + p.p.Emit( + PluginPostUpdatePodSandbox( + p.p.ID(), + convert.PodSandboxToV1beta1(pod), + ), + ) + + if p.h.PostUpdatePodSandbox != nil { + return p.h.PostUpdatePodSandbox(pod) + } + + return nil +} + +func (p *v1alpha1Plugin) StopPodSandbox(_ context.Context, pod *v1alpha1.PodSandbox) error { + p.p.Emit( + PluginStopPodSandbox( + p.p.ID(), + convert.PodSandboxToV1beta1(pod), + ), + ) + + if p.h.StopPodSandbox != nil { + return p.h.StopPodSandbox(pod) + } + + return nil +} + +func (p *v1alpha1Plugin) RemovePodSandbox(_ context.Context, pod *v1alpha1.PodSandbox) error { + p.p.Emit( + PluginRemovePodSandbox( + p.p.ID(), + convert.PodSandboxToV1beta1(pod), + ), + ) + + if p.h.RemovePodSandbox != nil { + return p.h.RemovePodSandbox(pod) + } + + return nil +} + +func (p *v1alpha1Plugin) CreateContainer(_ context.Context, pod *v1alpha1.PodSandbox, container *v1alpha1.Container) (*v1alpha1.ContainerAdjustment, []*v1alpha1.ContainerUpdate, error) { + p.p.Emit( + PluginCreateContainer( + p.p.ID(), + convert.PodSandboxToV1beta1(pod), + convert.ContainerToV1beta1(container), + ), + ) + + if p.h.CreateContainer != nil { + return p.h.CreateContainer(pod, container) + } + return nil, nil, nil } -func nopUpdateContainer(*mockPlugin, *api.PodSandbox, *api.Container, *api.LinuxResources) ([]*api.ContainerUpdate, error) { +func (p *v1alpha1Plugin) PostCreateContainer(_ context.Context, pod *v1alpha1.PodSandbox, container *v1alpha1.Container) error { + p.p.Emit( + PluginPostCreateContainer( + p.p.ID(), + convert.PodSandboxToV1beta1(pod), + convert.ContainerToV1beta1(container), + ), + ) + + if p.h.PostCreateContainer != nil { + return p.h.PostCreateContainer(pod, container) + } + + return nil +} + +func (p *v1alpha1Plugin) StartContainer(_ context.Context, pod *v1alpha1.PodSandbox, container *v1alpha1.Container) error { + p.p.Emit( + PluginStartContainer( + p.p.ID(), + convert.PodSandboxToV1beta1(pod), + convert.ContainerToV1beta1(container), + ), + ) + + if p.h.StartContainer != nil { + return p.h.StartContainer(pod, container) + } + + return nil +} + +func (p *v1alpha1Plugin) PostStartContainer(_ context.Context, pod *v1alpha1.PodSandbox, container *v1alpha1.Container) error { + p.p.Emit( + PluginPostStartContainer( + p.p.ID(), + convert.PodSandboxToV1beta1(pod), + convert.ContainerToV1beta1(container), + ), + ) + + if p.h.PostStartContainer != nil { + return p.h.PostStartContainer(pod, container) + } + + return nil +} + +func (p *v1alpha1Plugin) UpdateContainer(_ context.Context, pod *v1alpha1.PodSandbox, container *v1alpha1.Container, resources *v1alpha1.LinuxResources) ([]*v1alpha1.ContainerUpdate, error) { + p.p.Emit( + PluginUpdateContainer( + p.p.ID(), + convert.PodSandboxToV1beta1(pod), + convert.ContainerToV1beta1(container), + convert.LinuxResourcesToV1beta1(resources), + ), + ) + + if p.h.UpdateContainer != nil { + return p.h.UpdateContainer(pod, container, resources) + } + return nil, nil } -func nopStopContainer(*mockPlugin, *api.PodSandbox, *api.Container) ([]*api.ContainerUpdate, error) { +func (p *v1alpha1Plugin) PostUpdateContainer(_ context.Context, pod *v1alpha1.PodSandbox, container *v1alpha1.Container) error { + p.p.Emit( + PluginPostUpdateContainer( + p.p.ID(), + convert.PodSandboxToV1beta1(pod), + convert.ContainerToV1beta1(container), + ), + ) + + if p.h.PostUpdateContainer != nil { + return p.h.PostUpdateContainer(pod, container) + } + + return nil +} + +func (p *v1alpha1Plugin) StopContainer(_ context.Context, pod *v1alpha1.PodSandbox, container *v1alpha1.Container) ([]*v1alpha1.ContainerUpdate, error) { + p.p.Emit( + PluginStopContainer( + p.p.ID(), + convert.PodSandboxToV1beta1(pod), + convert.ContainerToV1beta1(container), + ), + ) + + if p.h.StopContainer != nil { + return p.h.StopContainer(pod, container) + } + return nil, nil } -type EventType string +func (p *v1alpha1Plugin) RemoveContainer(_ context.Context, pod *v1alpha1.PodSandbox, container *v1alpha1.Container) error { + p.p.Emit( + PluginRemoveContainer( + p.p.ID(), + convert.PodSandboxToV1beta1(pod), + convert.ContainerToV1beta1(container), + ), + ) -const ( - CreateError = "create-error" - Started = "started" - Configured = "configured" - Synchronized = "synchronized" - StartupError = "startup-error" - Shutdown = "shutdown" - Disconnected = "closed" - Stopped = "stopped" - - RunPodSandbox = "RunPodSandbox" - UpdatePodSandbox = "UpdatePodSandbox" - StopPodSandbox = "StopPodSandbox" - RemovePodSandbox = "RemovePodSandbox" - PostUpdatePodSandbox = "PostUpdatePodSandbox" - CreateContainer = "CreateContainer" - StartContainer = "StartContainer" - UpdateContainer = "UpdateContainer" - StopContainer = "StopContainer" - RemoveContainer = "RemoveContainer" - PostCreateContainer = "PostCreateContainer" - PostStartContainer = "PostStartContainer" - PostUpdateContainer = "PostUpdateContainer" - - ValidateContainerAdjustment = "ValidateContainerAdjustment" - - Error = "Error" - Timeout = "" -) + if p.h.RemoveContainer != nil { + return p.h.RemoveContainer(pod, container) + } -type Event struct { - Type EventType - Pod *api.PodSandbox - Ctr *api.Container - Reason string + return nil } -var ( - PluginCreationError = &Event{Type: CreateError} - PluginConfigured = &Event{Type: Configured} - PluginSynchronized = &Event{Type: Synchronized} - PluginStartupError = &Event{Type: StartupError} - PluginShutdown = &Event{Type: Shutdown} - PluginDisconnected = &Event{Type: Disconnected} - PluginStopped = &Event{Type: Stopped} +func (p *v1alpha1Plugin) ValidateContainerAdjustment(_ context.Context, req *v1alpha1.ValidateContainerAdjustmentRequest) error { + p.p.Emit( + PluginValidateContainerAdjustment( + p.p.ID(), + convert.ValidateContainerAdjustmentRequestToV1beta1(req), + ), + ) + + if p.h.ValidateContainerAdjustment != nil { + return p.h.ValidateContainerAdjustment(req) + } + + return nil +} + +func (p *builtinPlugin) Configure(_ context.Context, req *api.ConfigureRequest) (*api.ConfigureResponse, error) { + p.p.Emit( + PluginConfigured( + p.p.ID(), + req.RuntimeName, + req.RuntimeVersion, + time.Duration(req.RegistrationTimeout*int64(time.Millisecond)), + time.Duration(req.RequestTimeout*int64(time.Millisecond)), + ), + ) + + if p.h.Configure != nil { + return p.h.Configure(req) + } + + events, err := api.ParseEventMask(p.p.subscribe...) + require.NoError(p.p.t, err, "parse event subscription mask %v", p.p.subscribe) + + return &api.ConfigureResponse{ + Events: int32(events), + }, nil +} + +func (p *builtinPlugin) Synchronize(_ context.Context, req *api.SynchronizeRequest) (*api.SynchronizeResponse, error) { + p.p.Emit( + PluginSynchronized( + p.p.ID(), + req.Pods, + req.Containers, + ), + ) + + if p.h.Synchronize != nil { + return p.h.Synchronize(req) + } + + return &api.SynchronizeResponse{}, nil +} + +func (p *builtinPlugin) RunPodSandbox(_ context.Context, req *api.RunPodSandboxRequest) error { + p.p.Emit( + PluginRunPodSandbox( + p.p.ID(), + req.Pod, + ), + ) + + if p.h.RunPodSandbox != nil { + return p.h.RunPodSandbox(req) + } + + return nil +} + +func (p *builtinPlugin) UpdatePodSandbox(_ context.Context, req *api.UpdatePodSandboxRequest) (*api.UpdatePodSandboxResponse, error) { + p.p.Emit( + PluginUpdatePodSandbox( + p.p.ID(), + req.Pod, + req.OverheadLinuxResources, + req.LinuxResources, + ), + ) + + if p.h.UpdatePodSandbox != nil { + return p.h.UpdatePodSandbox(req) + } + + return &api.UpdatePodSandboxResponse{}, nil +} + +func (p *builtinPlugin) PostUpdatePodSandbox(_ context.Context, req *api.PostUpdatePodSandboxRequest) error { + p.p.Emit( + PluginPostUpdatePodSandbox( + p.p.ID(), + req.Pod, + ), + ) + + if p.h.PostUpdatePodSandbox != nil { + return p.h.PostUpdatePodSandbox(req) + } + + return nil +} + +func (p *builtinPlugin) StopPodSandbox(_ context.Context, req *api.StopPodSandboxRequest) error { + p.p.Emit( + PluginStopPodSandbox( + p.p.ID(), + req.Pod, + ), + ) + + if p.h.StopPodSandbox != nil { + return p.h.StopPodSandbox(req) + } + + return nil +} - PodSandboxEvent = func(pod *api.PodSandbox, t EventType) *Event { - return &Event{Type: t, Pod: pod} +func (p *builtinPlugin) RemovePodSandbox(_ context.Context, req *api.RemovePodSandboxRequest) error { + p.p.Emit( + PluginRemovePodSandbox( + p.p.ID(), + req.Pod, + ), + ) + + if p.h.RemovePodSandbox != nil { + return p.h.RemovePodSandbox(req) + } + + return nil +} + +func (p *builtinPlugin) CreateContainer(_ context.Context, req *api.CreateContainerRequest) (*api.CreateContainerResponse, error) { + p.p.Emit( + PluginCreateContainer( + p.p.ID(), + req.Pod, + req.Container, + ), + ) + + if p.h.CreateContainer != nil { + return p.h.CreateContainer(req) + } + + return &api.CreateContainerResponse{}, nil +} + +func (p *builtinPlugin) PostCreateContainer(_ context.Context, req *api.PostCreateContainerRequest) error { + p.p.Emit( + PluginPostCreateContainer( + p.p.ID(), + req.Pod, + req.Container, + ), + ) + + if p.h.PostCreateContainer != nil { + return p.h.PostCreateContainer(req) + } + + return nil +} + +func (p *builtinPlugin) StartContainer(_ context.Context, req *api.StartContainerRequest) error { + p.p.Emit( + PluginStartContainer( + p.p.ID(), + req.Pod, + req.Container, + ), + ) + + if p.h.StartContainer != nil { + return p.h.StartContainer(req) + } + + return nil +} + +func (p *builtinPlugin) PostStartContainer(_ context.Context, req *api.PostStartContainerRequest) error { + p.p.Emit( + PluginPostStartContainer( + p.p.ID(), + req.Pod, + req.Container, + ), + ) + + if p.h.PostStartContainer != nil { + return p.h.PostStartContainer(req) + } + + return nil +} + +func (p *builtinPlugin) UpdateContainer(_ context.Context, req *api.UpdateContainerRequest) (*api.UpdateContainerResponse, error) { + p.p.Emit( + PluginUpdateContainer( + p.p.ID(), + req.Pod, + req.Container, + req.LinuxResources, + ), + ) + + if p.h.UpdateContainer != nil { + return p.h.UpdateContainer(req) + } + + return &api.UpdateContainerResponse{}, nil +} + +func (p *builtinPlugin) PostUpdateContainer(_ context.Context, req *api.PostUpdateContainerRequest) error { + p.p.Emit( + PluginPostUpdateContainer( + p.p.ID(), + req.Pod, + req.Container, + ), + ) + + if p.h.PostUpdateContainer != nil { + return p.h.PostUpdateContainer(req) + } + + return nil +} + +func (p *builtinPlugin) StopContainer(_ context.Context, req *api.StopContainerRequest) (*api.StopContainerResponse, error) { + p.p.Emit( + PluginStopContainer( + p.p.ID(), + req.Pod, + req.Container, + ), + ) + + if p.h.StopContainer != nil { + return p.h.StopContainer(req) } - ContainerEvent = func(ctr *api.Container, t EventType) *Event { - return &Event{Type: t, Ctr: ctr} + + return &api.StopContainerResponse{}, nil +} + +func (p *builtinPlugin) RemoveContainer(_ context.Context, req *api.RemoveContainerRequest) error { + p.p.Emit( + PluginRemoveContainer( + p.p.ID(), + req.Pod, + req.Container, + ), + ) + + if p.h.RemoveContainer != nil { + return p.h.RemoveContainer(req) } - PluginShutdownWithReason = func(reason string) *Event { - return &Event{Type: Shutdown, Reason: reason} + + return nil +} + +func (p *builtinPlugin) ValidateContainerAdjustment(_ context.Context, req *api.ValidateContainerAdjustmentRequest) error { + p.p.Emit( + PluginValidateContainerAdjustment( + p.p.ID(), + req, + ), + ) + + if p.h.ValidateContainerAdjustment != nil { + return p.h.ValidateContainerAdjustment(req) } + + return nil +} + +type PluginEvent struct { + kind EventKind + plugin string + err error + reason string + runtimeName string + runtimeVersion string + registrationTimeout time.Duration + requestTimeout time.Duration + pods []*api.PodSandbox + containers []*api.Container + pod *api.PodSandbox + container *api.Container + overhead *api.LinuxResources + resources *api.LinuxResources + validate *api.ValidateContainerAdjustmentRequest +} + +const ( + Configured EventKind = "Configured" + RunPodSandbox EventKind = "RunPodSandbox" + UpdatePodSandbox EventKind = "UpdatePodSandbox" + PostUpdatePodSandbox EventKind = "PostUpdatePodSandbox" + StopPodSandbox EventKind = "StopPodSandbox" + RemovePodSandbox EventKind = "RemovePodSandbox" + CreateContainer EventKind = "CreateContainer" + PostCreateContainer EventKind = "PostCreateContainer" + StartContainer EventKind = "StartContainer" + PostStartContainer EventKind = "PostStartContainer" + UpdateContainer EventKind = "UpdateContainer" + PostUpdateContainer EventKind = "PostUpdateContainer" + StopContainer EventKind = "StopContainer" + RemoveContainer EventKind = "RemoveContainer" + ValidateContainerAdjustment EventKind = "ValidateContainerAdjustment" ) -func (e *Event) Matches(o *Event) bool { - if e.Type != o.Type { +func (e *PluginEvent) Kind() EventKind { + return EventKind(fmt.Sprintf("%s:%s", e.plugin, e.kind)) +} + +func (e *PluginEvent) String() string { + s := fmt.Sprintf("%s:%s", e.plugin, e.kind) + + switch e.kind { + case Failed: + if e.err != nil { + s += fmt.Sprintf(" %v", e.err) + } + } + + return s +} + +func (e *PluginEvent) Match(oe Event) bool { + o, ok := oe.(*PluginEvent) + if !ok { return false } - if e.Pod != nil && o.Pod != nil { - if e.Pod.Id != o.Pod.Id { - return false - } + if e.kind != o.kind || e.plugin != o.plugin { + return false } - if e.Ctr != nil && o.Ctr != nil { - if e.Ctr.Id != o.Ctr.Id || e.Ctr.PodSandboxId != o.Ctr.PodSandboxId { - return false + + switch e.kind { + case Failed: + if errors.Is(e.err, o.err) || errors.Is(o.err, e.err) { + return true + } + if e.err != nil && o.err != nil { + return fmt.Sprintf("%v", e.err) == fmt.Sprintf("%v", o.err) + } + + case Configured: + switch { + case e.runtimeName != "" && o.runtimeName != "": + return e.runtimeName == o.runtimeName + case e.runtimeVersion != "" && o.runtimeVersion != "": + return e.runtimeVersion == o.runtimeVersion + case e.registrationTimeout != 0 && o.registrationTimeout != 0: + return e.registrationTimeout == o.registrationTimeout + case e.requestTimeout != 0 && o.requestTimeout != 0: + return e.requestTimeout == o.requestTimeout } } + return true } -func (e *Event) String() string { - str := "" - switch { - case e.Ctr != nil: - str += e.Ctr.PodSandboxId + ":" + e.Ctr.Id + "/" - case e.Pod != nil: - str += e.Pod.Id + "/" +func PluginStarted(plugin string) *PluginEvent { + return &PluginEvent{ + kind: Started, + plugin: plugin, + } +} + +func PluginStopped(plugin string) *PluginEvent { + return &PluginEvent{ + kind: Stopped, + plugin: plugin, } - return str + string(e.Type) } -type EventQ struct { - sync.Mutex - q []*Event - c chan *Event +func PluginFailed(plugin string, err error) *PluginEvent { + return &PluginEvent{ + kind: Failed, + plugin: plugin, + err: err, + } } -func (q *EventQ) Add(e *Event) { - if q == nil { - return +func PluginClosed(plugin string) *PluginEvent { + return &PluginEvent{ + kind: Closed, + plugin: plugin, } - q.Lock() - defer q.Unlock() - q.q = append(q.q, e) - if q.c != nil { - q.c <- e +} +func PluginShutdown(plugin, reason string) *PluginEvent { + return &PluginEvent{ + kind: Shutdown, + plugin: plugin, + reason: reason, } } -func (q *EventQ) Reset() { - q.Lock() - defer q.Unlock() - q.q = []*Event{} +func PluginConfigured(plugin string, runtime, version string, registration, request time.Duration) *PluginEvent { + return &PluginEvent{ + kind: Configured, + plugin: plugin, + runtimeName: runtime, + runtimeVersion: version, + registrationTimeout: registration, + requestTimeout: request, + } } -func (q *EventQ) Events() []*Event { - q.Lock() - defer q.Unlock() - var events []*Event - events = append(events, q.q...) - return events +func PluginSynchronized(plugin string, pods []*api.PodSandbox, containers []*api.Container) *PluginEvent { + return &PluginEvent{ + kind: Synchronize, + plugin: plugin, + pods: pods, + containers: containers, + } } -func (q *EventQ) Has(e *Event) bool { - q.Lock() - defer q.Unlock() - return q.search(e) != nil +func PluginRunPodSandbox(plugin string, pod *api.PodSandbox) *PluginEvent { + return &PluginEvent{ + kind: RunPodSandbox, + plugin: plugin, + pod: pod, + } } -func (q *EventQ) search(e *Event) *Event { - for _, qe := range q.q { - if qe.Matches(e) { - return qe - } +func PluginUpdatePodSandbox(plugin string, pod *api.PodSandbox, overhead, resources *api.LinuxResources) *PluginEvent { + return &PluginEvent{ + kind: UpdatePodSandbox, + plugin: plugin, + pod: pod, + overhead: overhead, + resources: resources, } - return nil } -func (q *EventQ) Wait(w *Event, deadline <-chan time.Time) (*Event, error) { - var unlocked bool - q.Lock() - defer func() { - if !unlocked { - q.Unlock() - } - }() +func PluginPostUpdatePodSandbox(plugin string, pod *api.PodSandbox) *PluginEvent { + return &PluginEvent{ + kind: PostUpdatePodSandbox, + plugin: plugin, + pod: pod, + } +} - if e := q.search(w); e != nil { - return e, nil +func PluginStopPodSandbox(plugin string, pod *api.PodSandbox) *PluginEvent { + return &PluginEvent{ + kind: StopPodSandbox, + plugin: plugin, + pod: pod, } +} - if q.c != nil { - return nil, errors.New("event queue already busy Wait()ing") +func PluginRemovePodSandbox(plugin string, pod *api.PodSandbox) *PluginEvent { + return &PluginEvent{ + kind: RemovePodSandbox, + plugin: plugin, + pod: pod, } - q.c = make(chan *Event, 16) - defer func() { - if unlocked { - q.Lock() - unlocked = false - } - c := q.c - q.c = nil - close(c) - }() +} - q.Unlock() - unlocked = true - for { - select { - case e := <-q.c: - if e.Matches(w) { - return e, nil - } - case <-deadline: - return nil, fmt.Errorf("event queue timed out Wait()ing for %s", w) - } +func PluginCreateContainer(plugin string, pod *api.PodSandbox, container *api.Container) *PluginEvent { + return &PluginEvent{ + kind: CreateContainer, + plugin: plugin, + pod: pod, + container: container, + } +} + +func PluginPostCreateContainer(plugin string, pod *api.PodSandbox, container *api.Container) *PluginEvent { + return &PluginEvent{ + kind: PostCreateContainer, + plugin: plugin, + pod: pod, + container: container, + } +} + +func PluginStartContainer(plugin string, pod *api.PodSandbox, container *api.Container) *PluginEvent { + return &PluginEvent{ + kind: StartContainer, + plugin: plugin, + pod: pod, + container: container, + } +} + +func PluginPostStartContainer(plugin string, pod *api.PodSandbox, container *api.Container) *PluginEvent { + return &PluginEvent{ + kind: PostStartContainer, + plugin: plugin, + pod: pod, + container: container, + } +} + +func PluginUpdateContainer(plugin string, pod *api.PodSandbox, container *api.Container, resources *api.LinuxResources) *PluginEvent { + return &PluginEvent{ + kind: UpdateContainer, + plugin: plugin, + pod: pod, + container: container, + resources: resources, + } +} + +func PluginPostUpdateContainer(plugin string, pod *api.PodSandbox, container *api.Container) *PluginEvent { + return &PluginEvent{ + kind: PostUpdateContainer, + plugin: plugin, + pod: pod, + container: container, + } +} + +func PluginStopContainer(plugin string, pod *api.PodSandbox, container *api.Container) *PluginEvent { + return &PluginEvent{ + kind: StopContainer, + plugin: plugin, + pod: pod, + container: container, + } +} + +func PluginRemoveContainer(plugin string, pod *api.PodSandbox, container *api.Container) *PluginEvent { + return &PluginEvent{ + kind: RemoveContainer, + plugin: plugin, + pod: pod, + container: container, + } +} + +func PluginValidateContainerAdjustment(plugin string, req *api.ValidateContainerAdjustmentRequest) *PluginEvent { + return &PluginEvent{ + kind: ValidateContainerAdjustment, + plugin: plugin, + validate: req, } } From b03ff6126e0f3aa5bd6f61437500cb0b0f3ad3f5 Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Thu, 30 Oct 2025 15:33:42 +0200 Subject: [PATCH 16/20] net/multiplex: rework mux tests. Rework mux tests without using ginkgo/gomega. Signed-off-by: Krisztian Litkey --- pkg/net/multiplex/mux_suite_test.go | 617 ---------------------------- pkg/net/multiplex/mux_test.go | 452 ++++++++++++++++++++ 2 files changed, 452 insertions(+), 617 deletions(-) delete mode 100644 pkg/net/multiplex/mux_suite_test.go create mode 100644 pkg/net/multiplex/mux_test.go diff --git a/pkg/net/multiplex/mux_suite_test.go b/pkg/net/multiplex/mux_suite_test.go deleted file mode 100644 index 4d3d0e59..00000000 --- a/pkg/net/multiplex/mux_suite_test.go +++ /dev/null @@ -1,617 +0,0 @@ -/* - 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 multiplex_test - -import ( - "fmt" - "net" - "strings" - "sync" - "testing" - - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - - nrinet "github.com/containerd/nri/pkg/net" - mux "github.com/containerd/nri/pkg/net/multiplex" -) - -func TestMultiplex(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Connection Multiplexer") -} - -var _ = Describe("Emulated Connection Setup, Open", func() { - var ( - lMux, pMux mux.Mux - connID mux.ConnID - lConn, pConn net.Conn - err error - ) - - BeforeEach(func() { - lMux, pMux, err = connectMuxes() - Expect(err).To(BeNil()) - Expect(lMux).ToNot(BeNil()) - Expect(pMux).ToNot(BeNil()) - connID = mux.LowestConnID - }) - - AfterEach(func() { - if lMux != nil { - lMux.Close() - } - if pMux != nil { - pMux.Close() - } - }) - - It("Open should return a net.Conn", func() { - // When - lConn, err = lMux.Open(connID) - - // Then - Expect(err).To(BeNil()) - Expect(lConn).ToNot(BeNil()) - }) - - It("Opened net.Conn should allow sending", func() { - // Given - lConn, err = lMux.Open(connID) - Expect(err).To(BeNil()) - Expect(lConn).ToNot(BeNil()) - - // When - _, err = lConn.Write([]byte("this is a test message")) - - // Then - Expect(err).To(BeNil()) - }) - - It("Opened net.Conn should allow receiving", func() { - // Given - pConn, err = pMux.Open(connID) - Expect(err).To(BeNil()) - Expect(pConn).ToNot(BeNil()) - - // When - lConn, err = lMux.Open(connID) - Expect(err).To(BeNil()) - Expect(lConn).ToNot(BeNil()) - - msg := "this is a test message" - _, err = lConn.Write([]byte(msg)) - Expect(err).To(BeNil()) - - // Then - buf := make([]byte, len(msg)) - _, err = pConn.Read(buf) - Expect(err).To(BeNil()) - Expect(string(buf)).To(Equal(msg)) - }) -}) - -var _ = Describe("Emulated Connection Setup, Close", func() { - var ( - lMux, pMux mux.Mux - connID mux.ConnID - lConn, pConn net.Conn - err error - ) - - BeforeEach(func() { - lMux, pMux, err = connectMuxes() - Expect(err).To(BeNil()) - Expect(lMux).ToNot(BeNil()) - Expect(pMux).ToNot(BeNil()) - - connID = mux.LowestConnID - lConn, err = lMux.Open(connID) - Expect(err).To(BeNil()) - Expect(lConn).ToNot(BeNil()) - pConn, err = pMux.Open(connID) - Expect(err).To(BeNil()) - Expect(pConn).ToNot(BeNil()) - }) - - AfterEach(func() { - if lMux != nil { - lMux.Close() - } - if pMux != nil { - pMux.Close() - } - }) - - It("Closed connection should fail sending", func() { - // Given - msg := "this is a test message" - _, err = lConn.Write([]byte(msg)) - Expect(err).To(BeNil()) - - // When - err = lConn.Close() - Expect(err).To(BeNil()) - - // Then - _, err = lConn.Write([]byte(msg)) - Expect(err).ToNot(BeNil()) - }) - - It("Closed connection should fail receiving", func() { - // Given - err = pConn.Close() - Expect(err).To(BeNil()) - - // When - buf := make([]byte, 64) - _, err = pConn.Read(buf) - - // Then - Expect(err).ToNot(BeNil()) - }) -}) - -var _ = Describe("Emulated Connection Setup, Dial", func() { - var ( - lMux, pMux mux.Mux - connID mux.ConnID - conn net.Conn - err error - ) - - BeforeEach(func() { - lMux, pMux, err = connectMuxes() - Expect(err).To(BeNil()) - Expect(lMux).ToNot(BeNil()) - Expect(pMux).ToNot(BeNil()) - connID = mux.LowestConnID - }) - - AfterEach(func() { - if lMux != nil { - lMux.Close() - } - if pMux != nil { - pMux.Close() - } - }) - - dial := func(m mux.Mux, connID mux.ConnID) (net.Conn, error) { - return m.Dialer(connID)("mux", "id") - } - - It("Dial should return a net.Conn", func() { - // When - conn, err = dial(lMux, connID) - - // Then - Expect(err).To(BeNil()) - Expect(conn).ToNot(BeNil()) - }) - - It("Dialed net.Conn should allow sending", func() { - // Given - conn, err = dial(lMux, connID) - Expect(err).To(BeNil()) - Expect(conn).ToNot(BeNil()) - - // When - _, err = conn.Write([]byte("this is a test message")) - - // Then - Expect(err).To(BeNil()) - }) - -}) - -var _ = Describe("Emulated Connection Setup, Listen, Accept", func() { - var ( - lMux, pMux mux.Mux - connID mux.ConnID - l net.Listener - lConn, pConn net.Conn - err error - ) - - BeforeEach(func() { - lMux, pMux, err = connectMuxes() - Expect(err).To(BeNil()) - Expect(lMux).ToNot(BeNil()) - Expect(pMux).ToNot(BeNil()) - connID = mux.LowestConnID - }) - - AfterEach(func() { - if lMux != nil { - lMux.Close() - } - if pMux != nil { - pMux.Close() - } - }) - - accept := func(m mux.Mux, connID mux.ConnID) (net.Conn, error) { - l, err = m.Listen(connID) - if err != nil { - return nil, err - } - return l.Accept() - } - - It("Listen should return a net.Listener", func() { - // When - l, err = pMux.Listen(connID) - - // Then - Expect(err).To(BeNil()) - Expect(l).ToNot(BeNil()) - }) - - It("Accept on the net.Listener should return a net.Conn", func() { - // When - pConn, err = accept(pMux, connID) - - // Then - Expect(err).To(BeNil()) - Expect(pConn).ToNot(BeNil()) - }) - - It("Accepted net.Conn should allow receiving", func() { - // Given - pConn, err = accept(pMux, connID) - Expect(err).To(BeNil()) - Expect(pConn).ToNot(BeNil()) - - // When - lConn, err = lMux.Open(connID) - Expect(err).To(BeNil()) - Expect(lConn).ToNot(BeNil()) - - msg := "this is a test message" - _, err = lConn.Write([]byte(msg)) - Expect(err).To(BeNil()) - - // Then - buf := make([]byte, len(msg)) - _, err = pConn.Read(buf) - Expect(err).To(BeNil()) - Expect(string(buf)).To(Equal(msg)) - }) - -}) - -var _ = Describe("Transmitting data", func() { - var ( - lMux mux.Mux - pMux mux.Mux - err error - ) - - When("single connection", func() { - It("send and receive messages", func() { - connCnt := 1 - msgCnt := 64 - - lMux, pMux, err = connectMuxes() - Expect(err).To(BeNil()) - Expect(lMux).ToNot(BeNil()) - Expect(pMux).ToNot(BeNil()) - - lConn, pConn, err := openMuxes(lMux, pMux, connCnt) - Expect(err).To(BeNil()) - Expect(len(lConn)).To(Equal(connCnt)) - Expect(len(pConn)).To(Equal(connCnt)) - - sendAndReceive(lConn, pConn, msgCnt) - }) - }) - - When("multiple connections", func() { - It("send and receive messages concurrently", func() { - connCnt := 16 - msgCnt := 64 - - lMux, pMux, err = connectMuxes() - Expect(err).To(BeNil()) - Expect(lMux).ToNot(BeNil()) - Expect(pMux).ToNot(BeNil()) - - lConn, pConn, err := openMuxes(lMux, pMux, connCnt) - Expect(err).To(BeNil()) - Expect(len(lConn)).To(Equal(connCnt)) - Expect(len(pConn)).To(Equal(connCnt)) - - sendAndReceive(lConn, pConn, msgCnt) - }) - }) - - When("an oversized message is sent", func() { - It("it is transmitted in multiple chunks", func() { - var ( - connCnt = 1 - maxPayloadSize = 10 + 4<<20 - overflowFactor = 3 - ) - - lMux, pMux, err = connectMuxes() - Expect(err).To(BeNil()) - Expect(lMux).ToNot(BeNil()) - Expect(pMux).ToNot(BeNil()) - - lConn, pConn, err := openMuxes(lMux, pMux, connCnt) - Expect(err).To(BeNil()) - Expect(len(lConn)).To(Equal(connCnt)) - Expect(len(pConn)).To(Equal(connCnt)) - - msg := strings.Repeat("a", overflowFactor*maxPayloadSize) - cnt, err := lConn[0].Write([]byte(msg)) - Expect(err).To(BeNil()) - Expect(cnt).To(Equal(len([]byte(msg)))) - - rcv := make([]byte, overflowFactor*maxPayloadSize) - size := 0 - for i := 0; size < len([]byte(msg)) && i < overflowFactor; i++ { - cnt, err := pConn[0].Read(rcv[size:]) - Expect(err).To(BeNil()) - Expect(cnt).To(Equal(maxPayloadSize)) - size += cnt - } - Expect(rcv).To(Equal([]byte(msg))) - - msg = strings.Repeat("b", 200) - cnt, err = lConn[0].Write([]byte(msg)) - Expect(err).To(BeNil()) - Expect(cnt).To(Equal(len([]byte(msg)))) - - rcv = make([]byte, len([]byte(msg))) - cnt, err = pConn[0].Read(rcv) - Expect(err).To(BeNil()) - Expect(cnt).To(Equal(len([]byte(msg)))) - Expect(rcv).To(Equal([]byte(msg))) - }) - }) -}) - -/* -// TODO -var _ = Describe("Read Queue Length", func() { - var ( - lMux, pMux mux.Mux - connID mux.ConnID - lConn, pConn net.Conn - err error - qLen = 1 - ) - - BeforeEach(func() { - lMux, pMux, err = connectMuxes(mux.WithReadQueueLength(qLen)) - Expect(err).To(BeNil()) - Expect(lMux).ToNot(BeNil()) - Expect(pMux).ToNot(BeNil()) - - connID = mux.LowestConnID - lConn, err = lMux.Open(connID) - Expect(err).To(BeNil()) - Expect(lConn).ToNot(BeNil()) - pConn, err = pMux.Open(connID) - Expect(err).To(BeNil()) - Expect(pConn).ToNot(BeNil()) - }) - - AfterEach(func() { - if lMux != nil { - lMux.Close() - } - if pMux != nil { - pMux.Close() - } - }) - - It("Messages get queued up till queue length", func() { - var msg string - - // When - for i := 0; i < qLen; i++ { - msg = fmt.Sprintf("qlen test message #%d", i) - _, err = lConn.Write([]byte(msg)) - Expect(err).To(BeNil()) - } - - // Then - buf := make([]byte, len(msg)) - for i := 0; i < qLen; i++ { - _, err = pConn.Read(buf) - Expect(err).To(BeNil()) - } - }) - - It("Queue overflow closes mux, connections, results in read error", func() { - var msg string - - // When - for i := 0; i < qLen+1; i++ { - msg = fmt.Sprintf("qlen test message #%d", i) - _, err = lConn.Write([]byte(msg)) - Expect(err).To(BeNil()) - } - - // Then - buf := make([]byte, len(msg)) - for i := 0; i < qLen; i++ { - _, err = pConn.Read(buf) - } - _, err = pConn.Read(buf) - Expect(err).ToNot(BeNil()) - - }) -}) - -var _ = Describe("Blocking and Unblocking", func() { - // TODO... -}) -*/ - -// getSocketPairConn returns connections for a socketpair. -func getSocketPairConn() (net.Conn, net.Conn, error) { - fds, err := nrinet.NewSocketPair() - if err != nil { - return nil, nil, err - } - - lConn, err := fds.LocalConn() - if err != nil { - fds.LocalClose() - fds.PeerClose() - return nil, nil, err - } - pConn, err := fds.PeerConn() - if err != nil { - fds.LocalClose() - fds.PeerClose() - return nil, nil, err - } - - return lConn, pConn, nil -} - -// connectMuxes returns a pair of connected muxes. -func connectMuxes(options ...mux.Option) (mux.Mux, mux.Mux, error) { - lConn, pConn, err := getSocketPairConn() - if err != nil { - return nil, nil, err - } - return mux.Multiplex(lConn, options...), mux.Multiplex(pConn, options...), nil -} - -// openMuxes opens a number of connections for a pair of connected muxes. -func openMuxes(lMux, pMux mux.Mux, count int) ([]net.Conn, []net.Conn, error) { - var ( - lConn []net.Conn - pConn []net.Conn - conn net.Conn - err error - ) - - for i := 0; i < count; i++ { - conn, err = lMux.Open(mux.LowestConnID + mux.ConnID(i)) - if err != nil { - lMux.Trunk().Close() - pMux.Trunk().Close() - return nil, nil, err - } - lConn = append(lConn, conn) - - conn, err = pMux.Open(mux.LowestConnID + mux.ConnID(i)) - if err != nil { - lMux.Trunk().Close() - pMux.Trunk().Close() - return nil, nil, err - } - pConn = append(pConn, conn) - } - - return lConn, pConn, nil -} - -func sendAndReceive(lConn, pConn []net.Conn, msgCount int) { - var ( - wg = &sync.WaitGroup{} - start = make(chan struct{}) - maxMsg = 64 - endMsg = "" - ) - - // message sender - write := func(id int, conn net.Conn, messages []string) []string { - var ( - msg string - cnt int - err error - ) - - if messages == nil { - for i := 0; i < msgCount; i++ { - msg := fmt.Sprintf("[%d] message #%d/%d", id, i+1, msgCount) - Expect(len(msg) <= maxMsg).To(BeTrue()) - messages = append(messages, msg) - } - } - - for _, msg = range messages { - cnt, err = conn.Write([]byte(msg)) - Expect(err).To(BeNil()) - Expect(cnt).To(Equal(len(msg))) - } - - cnt, err = conn.Write([]byte(endMsg)) - Expect(err).To(BeNil()) - Expect(cnt).To(Equal(len(endMsg))) - - return messages - } - - // message receiver and collector - read := func(conn net.Conn) []string { - var ( - msg = make([]byte, maxMsg) - recv []string - cnt int - err error - ) - - for { - cnt, err = conn.Read(msg) - Expect(err).To(BeNil()) - if cnt == 0 { - return recv - } - recv = append(recv, string(msg[:cnt])) - } - } - - // send and receive, or the other way around, check echoed messages for equality - sendrecv := func(id int, conn net.Conn, sender bool) { - var ( - sent []string - recv []string - ) - - defer wg.Done() - <-start - - if sender { - sent = write(id, conn, nil) - recv = read(conn) - Expect(sent).To(Equal(recv)) - } else { - recv = read(conn) - write(id, conn, recv) - } - } - - // set up senders and receivers, waiting for a trigger to start - for i := 0; i < len(lConn); i++ { - go sendrecv(i, lConn[i], true) - go sendrecv(i, pConn[i], false) - wg.Add(2) - } - - // trigger senders/receivers and wait for them to finish - close(start) - wg.Wait() -} diff --git a/pkg/net/multiplex/mux_test.go b/pkg/net/multiplex/mux_test.go new file mode 100644 index 00000000..f0d23bb6 --- /dev/null +++ b/pkg/net/multiplex/mux_test.go @@ -0,0 +1,452 @@ +/* + 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 multiplex_test + +import ( + "fmt" + "net" + "strings" + "sync" + + nrinet "github.com/containerd/nri/pkg/net" + mux "github.com/containerd/nri/pkg/net/multiplex" + + "testing" + + "github.com/stretchr/testify/require" +) + +func TestMux(t *testing.T) { + var ( + lMux, pMux mux.Mux + connID mux.ConnID + lConn, pConn net.Conn + l net.Listener + err error + n int + + setup = func(t *testing.T) { + lMux, pMux, err = connectMuxes() + require.NoError(t, err, "multiplexed socketpair") + require.NotNil(t, lMux, "non-nil mux") + require.NotNil(t, pMux, "non-nil mux") + connID = mux.LowestConnID + } + cleanup = func() { + if lMux != nil { + lMux.Close() + } + if pMux != nil { + pMux.Close() + } + } + dial = func(m mux.Mux, connID mux.ConnID) (net.Conn, error) { + return m.Dialer(connID)("mux", "id") + } + + accept = func(m mux.Mux, connID mux.ConnID) (net.Conn, error) { + l, err = m.Listen(connID) + if err != nil { + return nil, err + } + return l.Accept() + } + ) + + t.Run("Open should return a net.Conn", func(t *testing.T) { + setup(t) + + lConn, err = lMux.Open(connID) + require.NoError(t, err, "open connection without error") + require.NotNil(t, lConn, "opened connection not nil") + + cleanup() + }) + + t.Run("Opened net.Conn should allow sending", func(t *testing.T) { + setup(t) + + lConn, err = lMux.Open(connID) + require.NoError(t, err, "open connection without error") + require.NotNil(t, lConn, "opened connection not nil") + + _, err = lConn.Write([]byte("this is a test message")) + require.NoError(t, err, "write to opened connection without error") + + cleanup() + }) + + t.Run("Opened net.Conn should allow receiving", func(t *testing.T) { + setup(t) + + pConn, err = pMux.Open(connID) + require.NoError(t, err, "open connection without error") + require.NotNil(t, pConn, "opened connection not nil") + + lConn, err = lMux.Open(connID) + require.NoError(t, err, "open connection without error") + require.NotNil(t, lConn, "opened connection not nil") + + msg := "this is a test message" + n, err = lConn.Write([]byte(msg)) + require.NoError(t, err, "write to opened connection without error") + require.Equal(t, len(msg), n, "written bytes matches message length") + + buf := make([]byte, len(msg)) + n, err := pConn.Read(buf) + require.NoError(t, err, "read from opened connection without error") + require.Equal(t, msg, string(buf[:n]), "received message matches sent message") + + cleanup() + }) + + t.Run("Closed connection should fail sending", func(t *testing.T) { + setup(t) + + lConn, err = lMux.Open(connID) + require.NoError(t, err, "open connection without error") + require.NotNil(t, lConn, "opened connection not nil") + + pConn, err = pMux.Open(connID) + require.NoError(t, err, "open connection without error") + require.NotNil(t, pConn, "opened connection not nil") + + msg := "this is a test message" + n, err = lConn.Write([]byte(msg)) + require.NoError(t, err, "write to opened connection without error") + require.Equal(t, len(msg), n, "written bytes matches message length") + + err = lConn.Close() + require.NoError(t, err, "close opened connection without error") + + _, err = lConn.Write([]byte(msg)) + require.Error(t, err, "write to closed connection returns error") + + cleanup() + }) + + t.Run("Closed connection should fail receiving", func(t *testing.T) { + setup(t) + + lConn, err = lMux.Open(connID) + require.NoError(t, err, "open connection without error") + require.NotNil(t, lConn, "opened connection not nil") + + pConn, err = pMux.Open(connID) + require.NoError(t, err, "open connection without error") + require.NotNil(t, pConn, "opened connection not nil") + + err = pConn.Close() + require.NoError(t, err, "close opened connection without error") + + buf := make([]byte, 64) + _, err = pConn.Read(buf) + require.Error(t, err, "read from closed connection returns error") + + cleanup() + }) + + t.Run("dial should return a net.Conn", func(t *testing.T) { + setup(t) + + lConn, err = dial(lMux, connID) + require.NoError(t, err, "dial connection without error") + require.NotNil(t, lConn, "dialed connection not nil") + + cleanup() + }) + + t.Run("Dialed net.Conn should allow sending", func(t *testing.T) { + setup(t) + + lConn, err = dial(lMux, connID) + require.NoError(t, err, "dial connection without error") + require.NotNil(t, lConn, "dialed connection not nil") + + _, err = lConn.Write([]byte("this is a test message")) + require.NoError(t, err, "write to dialed connection without error") + + cleanup() + }) + + t.Run("Listen should return a net.Listener", func(t *testing.T) { + setup(t) + + l, err = pMux.Listen(connID) + require.NoError(t, err, "listen without error") + require.NotNil(t, l, "listener not nil") + + cleanup() + }) + + t.Run("Accept on the listener should return a net.Conn", func(t *testing.T) { + setup(t) + + pConn, err = accept(pMux, connID) + require.NoError(t, err, "accept connection without error") + require.NotNil(t, pConn, "accepted connection not nil") + + cleanup() + }) + + t.Run("Accepted net.Conn should allow receiving", func(t *testing.T) { + setup(t) + + pConn, err = accept(pMux, connID) + require.NoError(t, err, "accept connection without error") + require.NotNil(t, pConn, "accepted connection not nil") + + lConn, err = lMux.Open(connID) + require.NoError(t, err, "open connection without error") + require.NotNil(t, lConn, "opened connection not nil") + + msg := "this is a test message" + _, err = lConn.Write([]byte(msg)) + require.NoError(t, err, "write to opened connection without error") + + buf := make([]byte, len(msg)) + n, err := pConn.Read(buf) + require.NoError(t, err, "read from accepted connection without error") + require.Equal(t, msg, string(buf[:n]), "received message matches sent message") + + cleanup() + }) + + t.Run("transmitting data over a single connection", func(t *testing.T) { + var ( + connCnt = 1 + msgCnt = 64 + ) + + setup(t) + + lc, pc, err := openMuxes(lMux, pMux, connCnt) + require.NoError(t, err, "open a single connection without error") + require.NotNil(t, lc, "opened connection not nil") + require.NotNil(t, pc, "opened connection not nil") + require.Equal(t, connCnt, len(lc), "opened connection count matches") + + sendAndReceive(t, lc, pc, msgCnt) + + cleanup() + }) + + t.Run("transmitting data over multiple connections", func(t *testing.T) { + var ( + connCnt = 16 + msgCnt = 64 + ) + + setup(t) + + lc, pc, err := openMuxes(lMux, pMux, connCnt) + require.NoError(t, err, "open multiple connections without error") + require.NotNil(t, lc, "opened connections not nil") + require.NotNil(t, pc, "opened connections not nil") + require.Equal(t, connCnt, len(lc), "opened connection count matches") + + sendAndReceive(t, lc, pc, msgCnt) + + cleanup() + }) + + t.Run("oversized messages are transmitted (in multiple chunks)", func(t *testing.T) { + var ( + maxPayloadSize = 10 + 4<<20 + overflowFactor = 3 + ) + + setup(t) + + lConn, err = lMux.Open(connID) + require.NoError(t, err, "open connection without error") + require.NotNil(t, lConn, "opened connections not nil") + + pConn, err = pMux.Open(connID) + require.NoError(t, err, "open connection without error") + require.NotNil(t, pConn, "opened connections not nil") + + msg := strings.Repeat("a", overflowFactor*maxPayloadSize) + cnt, err := lConn.Write([]byte(msg)) + require.NoError(t, err, "write oversized message without error") + require.Equal(t, len(msg), cnt, "written bytes matches message length") + + rcv := make([]byte, overflowFactor*maxPayloadSize) + size := 0 + for i := 0; size < len([]byte(msg)) && i < overflowFactor; i++ { + cnt, err := pConn.Read(rcv[size:]) + require.NoError(t, err, "read chunk of oversized message without error") + require.Equal(t, maxPayloadSize, cnt) + size += cnt + } + require.Equal(t, []byte(msg), rcv, "received message matches sent one") + + cleanup() + }) + +} + +// getSocketPairConn returns connections for a socketpair. +func getSocketPairConn() (net.Conn, net.Conn, error) { + fds, err := nrinet.NewSocketPair() + if err != nil { + return nil, nil, err + } + + lConn, err := fds.LocalConn() + if err != nil { + fds.LocalClose() + fds.PeerClose() + return nil, nil, err + } + pConn, err := fds.PeerConn() + if err != nil { + fds.LocalClose() + fds.PeerClose() + return nil, nil, err + } + + return lConn, pConn, nil +} + +// connectMuxes returns a pair of connected muxes. +func connectMuxes(options ...mux.Option) (mux.Mux, mux.Mux, error) { + lConn, pConn, err := getSocketPairConn() + if err != nil { + return nil, nil, err + } + return mux.Multiplex(lConn, options...), mux.Multiplex(pConn, options...), nil +} + +// openMuxes opens a number of connections for a pair of connected muxes. +func openMuxes(lMux, pMux mux.Mux, count int) ([]net.Conn, []net.Conn, error) { + var ( + lConn []net.Conn + pConn []net.Conn + conn net.Conn + err error + ) + + for i := 0; i < count; i++ { + conn, err = lMux.Open(mux.LowestConnID + mux.ConnID(i)) + if err != nil { + lMux.Trunk().Close() + pMux.Trunk().Close() + return nil, nil, err + } + lConn = append(lConn, conn) + + conn, err = pMux.Open(mux.LowestConnID + mux.ConnID(i)) + if err != nil { + lMux.Trunk().Close() + pMux.Trunk().Close() + return nil, nil, err + } + pConn = append(pConn, conn) + } + + return lConn, pConn, nil +} + +// Send and receive data over a set of connections. +func sendAndReceive(t *testing.T, lConn, pConn []net.Conn, msgCount int) { + var ( + wg = &sync.WaitGroup{} + start = make(chan struct{}) + maxMsg = 64 + endMsg = "" + ) + + // message sender + write := func(id int, conn net.Conn, messages []string) []string { + var ( + msg string + cnt int + err error + ) + + if messages == nil { + for i := 0; i < msgCount; i++ { + msg := fmt.Sprintf("[%d] message #%d/%d", id, i+1, msgCount) + require.True(t, len(msg) <= maxMsg, "expected message length") + messages = append(messages, msg) + } + } + + for _, msg = range messages { + cnt, err = conn.Write([]byte(msg)) + require.NoError(t, err, "write message without error") + require.Equal(t, len(msg), cnt, "written bytes matches message length") + } + + cnt, err = conn.Write([]byte(endMsg)) + require.NoError(t, err, "write end message without error") + require.Equal(t, len(endMsg), cnt, "written bytes matches end message length") + + return messages + } + + // message receiver and collector + read := func(conn net.Conn) []string { + var ( + msg = make([]byte, maxMsg) + recv []string + cnt int + err error + ) + + for { + cnt, err = conn.Read(msg) + require.NoError(t, err, "read message without error") + if cnt == 0 { + return recv + } + recv = append(recv, string(msg[:cnt])) + } + } + + // send and receive, or the other way around, check echoed messages for equality + sendrecv := func(id int, conn net.Conn, sender bool) { + var ( + sent []string + recv []string + ) + + defer wg.Done() + <-start + + if sender { + sent = write(id, conn, nil) + recv = read(conn) + require.Equal(t, sent, recv, "sent and received messages match") + } else { + recv = read(conn) + write(id, conn, recv) + } + } + + // set up senders and receivers, waiting for a trigger to start + for i := 0; i < len(lConn); i++ { + go sendrecv(i, lConn[i], true) + go sendrecv(i, pConn[i], false) + wg.Add(2) + } + + // trigger senders/receivers and wait for them to finish + close(start) + wg.Wait() +} From e4974683cf9b2069dda3ce7fe28a7c57677e496f Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Thu, 30 Oct 2025 15:57:10 +0200 Subject: [PATCH 17/20] runtime-tools/generate: rework tests. Rework tests without using ginkgo/gomega. Signed-off-by: Krisztian Litkey --- pkg/adaptation/adaptation_test.go | 6 +- pkg/adaptation/suite_test.go | 4 +- .../generate/generate_suite_test.go | 625 ------------------ 3 files changed, 5 insertions(+), 630 deletions(-) delete mode 100644 pkg/runtime-tools/generate/generate_suite_test.go diff --git a/pkg/adaptation/adaptation_test.go b/pkg/adaptation/adaptation_test.go index b128d9eb..b5d8533a 100644 --- a/pkg/adaptation/adaptation_test.go +++ b/pkg/adaptation/adaptation_test.go @@ -330,7 +330,7 @@ func TestPluginConfiguration(t *testing.T) { EventOccurred( tc.expect, ), - UntilEnd, + UntilEndMarker, ) require.True(t, occurred, "plugin configured as expected") }) @@ -870,7 +870,7 @@ func TestEventSubscription(t *testing.T) { for _, expected := range tc.expect { _, occurred := evt.Search( EventOccurred(expected), - UntilEnd, + UntilEndMarker, ) require.True(t, occurred, "expected event %s occurred", expected) } @@ -878,7 +878,7 @@ func TestEventSubscription(t *testing.T) { for _, rejected := range tc.reject { _, occurred := evt.Search( EventOccurred(rejected), - UntilEnd, + UntilEndMarker, ) require.False(t, occurred, "unexpected event %s occurred", rejected) } diff --git a/pkg/adaptation/suite_test.go b/pkg/adaptation/suite_test.go index da8c66ba..f0e9a859 100644 --- a/pkg/adaptation/suite_test.go +++ b/pkg/adaptation/suite_test.go @@ -247,8 +247,8 @@ type MarkerEvent struct { } var ( - EndMarker = NewMarkerEvent("end") - UntilEnd = EndMarker + EndMarker = NewMarkerEvent("end") + UntilEndMarker = EndMarker ) func UntilMarker(marker string) *MarkerEvent { diff --git a/pkg/runtime-tools/generate/generate_suite_test.go b/pkg/runtime-tools/generate/generate_suite_test.go deleted file mode 100644 index 92a9a58c..00000000 --- a/pkg/runtime-tools/generate/generate_suite_test.go +++ /dev/null @@ -1,625 +0,0 @@ -/* - 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 generate_test - -import ( - "testing" - - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - - rspec "github.com/opencontainers/runtime-spec/specs-go" - rgen "github.com/opencontainers/runtime-tools/generate" - - api "github.com/containerd/nri/pkg/api/v1beta1" - xgen "github.com/containerd/nri/pkg/runtime-tools/generate" -) - -func TestGenerate(t *testing.T) { - RegisterFailHandler(Fail) - RunSpecs(t, "Generate Suite") -} - -var _ = Describe("Adjustment", func() { - When("nil", func() { - It("does not modify the Spec", func() { - var ( - spec = makeSpec() - adjust *api.ContainerAdjustment - ) - - rg := &rgen.Generator{Config: spec} - xg := xgen.SpecGenerator(rg) - - Expect(xg).ToNot(BeNil()) - Expect(xg.Adjust(adjust)).To(Succeed()) - Expect(spec).To(Equal(makeSpec())) - }) - }) - - When("empty", func() { - It("does not modify the Spec", func() { - var ( - spec = makeSpec() - adjust = &api.ContainerAdjustment{ - Linux: &api.LinuxContainerAdjustment{}, - } - ) - - rg := &rgen.Generator{Config: spec} - xg := xgen.SpecGenerator(rg) - - Expect(xg).ToNot(BeNil()) - Expect(xg.Adjust(adjust)).To(Succeed()) - Expect(spec).To(Equal(makeSpec())) - }) - }) - - When("has args", func() { - It("adjusts Spec correctly", func() { - var ( - spec = makeSpec() - adjust = &api.ContainerAdjustment{ - Args: []string{ - "arg0", - "arg1", - "arg2", - }, - } - ) - - rg := &rgen.Generator{Config: spec} - xg := xgen.SpecGenerator(rg) - - Expect(xg).ToNot(BeNil()) - Expect(xg.Adjust(adjust)).To(Succeed()) - Expect(spec).To(Equal(makeSpec(withArgs("arg0", "arg1", "arg2")))) - }) - }) - - When("has rlimits", func() { - It("adjusts Spec correctly", func() { - var ( - spec = makeSpec() - adjust = &api.ContainerAdjustment{ - Rlimits: []*api.POSIXRlimit{{ - Type: "nofile", - Hard: 456, - Soft: 123, - }}, - } - ) - - rg := &rgen.Generator{Config: spec} - xg := xgen.SpecGenerator(rg) - - Expect(xg).ToNot(BeNil()) - Expect(xg.Adjust(adjust)).To(Succeed()) - Expect(spec).To(Equal(makeSpec(withRlimit("nofile", 456, 123)))) - }) - }) - - When("has memory limit", func() { - It("adjusts Spec correctly", func() { - var ( - spec = makeSpec() - adjust = &api.ContainerAdjustment{ - Linux: &api.LinuxContainerAdjustment{ - Resources: &api.LinuxResources{ - Memory: &api.LinuxMemory{ - Limit: api.Int64(11111), - }, - }, - }, - } - ) - - rg := &rgen.Generator{Config: spec} - xg := xgen.SpecGenerator(rg) - - Expect(xg).ToNot(BeNil()) - Expect(xg.Adjust(adjust)).To(Succeed()) - Expect(spec).To(Equal(makeSpec(withMemoryLimit(11111), withMemorySwap(11111)))) - }) - }) - - When("has oom score adj", func() { - It("adjusts Spec correctly", func() { - var ( - oomScoreAdj = 123 - spec = makeSpec() - adjust = &api.ContainerAdjustment{ - Linux: &api.LinuxContainerAdjustment{ - OomScoreAdj: &api.OptionalInt{ - Value: int64(oomScoreAdj), - }, - }, - } - ) - - rg := &rgen.Generator{Config: spec} - xg := xgen.SpecGenerator(rg) - - Expect(xg).ToNot(BeNil()) - Expect(xg.Adjust(adjust)).To(Succeed()) - Expect(spec).To(Equal(makeSpec(withOomScoreAdj(&oomScoreAdj)))) - }) - }) - - When("unset oom score adj", func() { - It("adjusts Spec correctly", func() { - var ( - spec = makeSpec() - adjust = &api.ContainerAdjustment{ - Linux: &api.LinuxContainerAdjustment{ - OomScoreAdj: nil, - }, - } - ) - - rg := &rgen.Generator{Config: spec} - xg := xgen.SpecGenerator(rg) - - Expect(xg).ToNot(BeNil()) - Expect(xg.Adjust(adjust)).To(Succeed()) - Expect(spec).To(Equal(makeSpec(withOomScoreAdj(nil)))) - }) - }) - - When("existing oom score adj", func() { - It("does not adjust Spec", func() { - var ( - spec = makeSpec() - expectedSpec = makeSpec() - adjust = &api.ContainerAdjustment{} - ) - oomScoreAdj := 123 - spec.Process.OOMScoreAdj = &oomScoreAdj - expectedSpec.Process.OOMScoreAdj = &oomScoreAdj - - rg := &rgen.Generator{Config: spec} - xg := xgen.SpecGenerator(rg) - - Expect(xg).ToNot(BeNil()) - Expect(xg.Adjust(adjust)).To(Succeed()) - Expect(spec).To(Equal(expectedSpec)) - }) - }) - - When("has CPU shares", func() { - It("adjusts Spec correctly", func() { - var ( - spec = makeSpec() - adjust = &api.ContainerAdjustment{ - Linux: &api.LinuxContainerAdjustment{ - Resources: &api.LinuxResources{ - Cpu: &api.LinuxCPU{ - Shares: api.UInt64(11111), - }, - }, - }, - } - ) - - rg := &rgen.Generator{Config: spec} - xg := xgen.SpecGenerator(rg) - - Expect(xg).ToNot(BeNil()) - Expect(xg.Adjust(adjust)).To(Succeed()) - Expect(spec).To(Equal(makeSpec(withCPUShares(11111)))) - }) - }) - - When("has CPU quota", func() { - It("adjusts Spec correctly", func() { - var ( - spec = makeSpec() - adjust = &api.ContainerAdjustment{ - Linux: &api.LinuxContainerAdjustment{ - Resources: &api.LinuxResources{ - Cpu: &api.LinuxCPU{ - Quota: api.Int64(11111), - }, - }, - }, - } - ) - - rg := &rgen.Generator{Config: spec} - xg := xgen.SpecGenerator(rg) - - Expect(xg).ToNot(BeNil()) - Expect(xg.Adjust(adjust)).To(Succeed()) - Expect(spec).To(Equal(makeSpec(withCPUQuota(11111)))) - }) - }) - - When("has CPU period", func() { - It("adjusts Spec correctly", func() { - var ( - spec = makeSpec() - adjust = &api.ContainerAdjustment{ - Linux: &api.LinuxContainerAdjustment{ - Resources: &api.LinuxResources{ - Cpu: &api.LinuxCPU{ - Period: api.UInt64(11111), - }, - }, - }, - } - ) - - rg := &rgen.Generator{Config: spec} - xg := xgen.SpecGenerator(rg) - - Expect(xg).ToNot(BeNil()) - Expect(xg.Adjust(adjust)).To(Succeed()) - Expect(spec).To(Equal(makeSpec(withCPUPeriod(11111)))) - }) - }) - - When("has cpuset CPUs", func() { - It("adjusts Spec correctly", func() { - var ( - spec = makeSpec() - adjust = &api.ContainerAdjustment{ - Linux: &api.LinuxContainerAdjustment{ - Resources: &api.LinuxResources{ - Cpu: &api.LinuxCPU{ - Cpus: "5,6", - }, - }, - }, - } - ) - - rg := &rgen.Generator{Config: spec} - xg := xgen.SpecGenerator(rg) - - Expect(xg).ToNot(BeNil()) - Expect(xg.Adjust(adjust)).To(Succeed()) - Expect(spec).To(Equal(makeSpec(withCPUSetCPUs("5,6")))) - }) - }) - - When("has cpuset mems", func() { - It("adjusts Spec correctly", func() { - var ( - spec = makeSpec() - adjust = &api.ContainerAdjustment{ - Linux: &api.LinuxContainerAdjustment{ - Resources: &api.LinuxResources{ - Cpu: &api.LinuxCPU{ - Mems: "5,6", - }, - }, - }, - } - ) - - rg := &rgen.Generator{Config: spec} - xg := xgen.SpecGenerator(rg) - - Expect(xg).ToNot(BeNil()) - Expect(xg.Adjust(adjust)).To(Succeed()) - Expect(spec).To(Equal(makeSpec(withCPUSetMems("5,6")))) - }) - }) - - When("has pids limit", func() { - It("adjusts Spec correctly", func() { - var ( - spec = makeSpec() - adjust = &api.ContainerAdjustment{ - Linux: &api.LinuxContainerAdjustment{ - Resources: &api.LinuxResources{ - Pids: &api.LinuxPids{ - Limit: 123, - }, - }, - }, - } - ) - - rg := &rgen.Generator{Config: spec} - xg := xgen.SpecGenerator(rg) - - Expect(xg).ToNot(BeNil()) - Expect(xg.Adjust(adjust)).To(Succeed()) - Expect(spec).To(Equal(makeSpec(withPidsLimit(123)))) - }) - }) - - When("has mounts", func() { - It("it sorts the Spec mount slice", func() { - var ( - spec = makeSpec() - adjust = &api.ContainerAdjustment{ - Mounts: []*api.Mount{ - { - Destination: "/a/b/c/d/e", - Source: "/host/e", - }, - { - Destination: "/a/b/c", - Source: "/host/c", - }, - { - Destination: "/a/b", - Source: "/host/b", - }, - { - Destination: "/a", - Source: "/host/a", - }, - }, - } - ) - - rg := &rgen.Generator{Config: spec} - xg := xgen.SpecGenerator(rg) - - Expect(xg).ToNot(BeNil()) - Expect(xg.Adjust(adjust)).To(Succeed()) - Expect(spec).To(Equal(makeSpec( - withMounts([]rspec.Mount{ - { - Destination: "/a", - Source: "/host/a", - }, - { - Destination: "/a/b", - Source: "/host/b", - }, - { - Destination: "/a/b/c", - Source: "/host/c", - }, - { - Destination: "/a/b/c/d/e", - Source: "/host/e", - }, - }), - ))) - }) - }) - - When("has a seccomp policy adjustment", func() { - It("adjusts Spec correctly", func() { - var ( - spec = makeSpec() - seccomp = rspec.LinuxSeccomp{ - DefaultAction: rspec.ActAllow, - ListenerPath: "/run/meshuggah-rocks.sock", - Architectures: []rspec.Arch{}, - Flags: []rspec.LinuxSeccompFlag{}, - Syscalls: []rspec.LinuxSyscall{{ - Names: []string{"sched_getaffinity"}, - Action: rspec.ActNotify, - Args: []rspec.LinuxSeccompArg{}, - }}, - } - adjust = &api.ContainerAdjustment{ - Linux: &api.LinuxContainerAdjustment{ - SeccompPolicy: api.FromOCILinuxSeccomp(&seccomp), - }, - } - ) - - rg := &rgen.Generator{Config: spec} - xg := xgen.SpecGenerator(rg) - - Expect(xg).ToNot(BeNil()) - Expect(xg.Adjust(adjust)).To(Succeed()) - Expect(*spec.Linux.Seccomp).To(Equal(seccomp)) - }) - }) - -}) - -type specOption func(*rspec.Spec) - -func withArgs(args ...string) specOption { - return func(spec *rspec.Spec) { - if spec.Process == nil { - spec.Process = &rspec.Process{} - } - spec.Process.Args = args - } -} - -func withMemoryLimit(v int64) specOption { - return func(spec *rspec.Spec) { - if spec.Linux == nil { - spec.Linux = &rspec.Linux{} - } - if spec.Linux.Resources == nil { - spec.Linux.Resources = &rspec.LinuxResources{} - } - if spec.Linux.Resources.Memory == nil { - spec.Linux.Resources.Memory = &rspec.LinuxMemory{} - } - spec.Linux.Resources.Memory.Limit = &v - } -} - -func withMemorySwap(v int64) specOption { - return func(spec *rspec.Spec) { - if spec.Linux == nil { - spec.Linux = &rspec.Linux{} - } - if spec.Linux.Resources == nil { - spec.Linux.Resources = &rspec.LinuxResources{} - } - if spec.Linux.Resources.Memory == nil { - spec.Linux.Resources.Memory = &rspec.LinuxMemory{} - } - spec.Linux.Resources.Memory.Swap = &v - } -} - -func withOomScoreAdj(v *int) specOption { - return func(spec *rspec.Spec) { - if spec.Process == nil { - spec.Process = &rspec.Process{} - } - spec.Process.OOMScoreAdj = v - } -} - -func withCPUShares(v uint64) specOption { - return func(spec *rspec.Spec) { - if spec.Linux == nil { - spec.Linux = &rspec.Linux{} - } - if spec.Linux.Resources == nil { - spec.Linux.Resources = &rspec.LinuxResources{} - } - if spec.Linux.Resources.CPU == nil { - spec.Linux.Resources.CPU = &rspec.LinuxCPU{} - } - spec.Linux.Resources.CPU.Shares = &v - } -} - -func withCPUQuota(v int64) specOption { - return func(spec *rspec.Spec) { - if spec.Linux == nil { - spec.Linux = &rspec.Linux{} - } - if spec.Linux.Resources == nil { - spec.Linux.Resources = &rspec.LinuxResources{} - } - if spec.Linux.Resources.CPU == nil { - spec.Linux.Resources.CPU = &rspec.LinuxCPU{} - } - spec.Linux.Resources.CPU.Quota = &v - } -} - -func withCPUPeriod(v uint64) specOption { - return func(spec *rspec.Spec) { - if spec.Linux == nil { - spec.Linux = &rspec.Linux{} - } - if spec.Linux.Resources == nil { - spec.Linux.Resources = &rspec.LinuxResources{} - } - if spec.Linux.Resources.CPU == nil { - spec.Linux.Resources.CPU = &rspec.LinuxCPU{} - } - spec.Linux.Resources.CPU.Period = &v - } -} - -func withCPUSetCPUs(v string) specOption { - return func(spec *rspec.Spec) { - if spec.Linux == nil { - spec.Linux = &rspec.Linux{} - } - if spec.Linux.Resources == nil { - spec.Linux.Resources = &rspec.LinuxResources{} - } - if spec.Linux.Resources.CPU == nil { - spec.Linux.Resources.CPU = &rspec.LinuxCPU{} - } - spec.Linux.Resources.CPU.Cpus = v - } -} - -func withCPUSetMems(v string) specOption { - return func(spec *rspec.Spec) { - if spec.Linux == nil { - spec.Linux = &rspec.Linux{} - } - if spec.Linux.Resources == nil { - spec.Linux.Resources = &rspec.LinuxResources{} - } - if spec.Linux.Resources.CPU == nil { - spec.Linux.Resources.CPU = &rspec.LinuxCPU{} - } - spec.Linux.Resources.CPU.Mems = v - } -} - -func withPidsLimit(v int64) specOption { - return func(spec *rspec.Spec) { - if spec.Linux == nil { - spec.Linux = &rspec.Linux{} - } - if spec.Linux.Resources == nil { - spec.Linux.Resources = &rspec.LinuxResources{} - } - spec.Linux.Resources.Pids = &rspec.LinuxPids{ - Limit: v, - } - } -} - -func withMounts(mounts []rspec.Mount) specOption { - return func(spec *rspec.Spec) { - spec.Mounts = append(spec.Mounts, mounts...) - } -} - -func withRlimit(typ string, hard, soft uint64) specOption { - return func(spec *rspec.Spec) { - if spec.Process == nil { - return - } - spec.Process.Rlimits = append(spec.Process.Rlimits, rspec.POSIXRlimit{ - Type: typ, - Hard: hard, - Soft: soft, - }) - } -} - -func makeSpec(options ...specOption) *rspec.Spec { - spec := &rspec.Spec{ - Process: &rspec.Process{}, - Linux: &rspec.Linux{ - Resources: &rspec.LinuxResources{ - Memory: &rspec.LinuxMemory{ - Limit: Int64(12345), - }, - CPU: &rspec.LinuxCPU{ - Shares: Uint64(45678), - Quota: Int64(87654), - Period: Uint64(54321), - Cpus: "0-111", - Mems: "0-4", - }, - Pids: &rspec.LinuxPids{ - Limit: 1, - }, - }, - }, - } - for _, o := range options { - o(spec) - } - return spec -} - -func Int64(v int64) *int64 { - return &v -} - -func Uint64(v uint64) *uint64 { - return &v -} From 613ed6b98d25dd1415be0944b2d477c3b38bc16f Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Thu, 30 Oct 2025 16:01:20 +0200 Subject: [PATCH 18/20] go.{mod,sum}: nuke ginkgo/gomega dependencies. Signed-off-by: Krisztian Litkey --- go.mod | 7 ------- go.sum | 12 ------------ plugins/device-injector/go.sum | 16 ++------------- plugins/differ/go.sum | 14 ------------- plugins/hook-injector/go.sum | 14 ------------- plugins/logger/go.sum | 16 ++------------- plugins/network-device-injector/go.sum | 27 +++++++++++++------------- plugins/network-logger/go.sum | 16 ++------------- plugins/template/go.sum | 16 ++------------- plugins/ulimit-adjuster/go.sum | 16 ++------------- plugins/v010-adapter/go.sum | 10 ---------- plugins/wasm/go.sum | 4 ++-- 12 files changed, 25 insertions(+), 143 deletions(-) diff --git a/go.mod b/go.mod index b78c52a6..b8208523 100644 --- a/go.mod +++ b/go.mod @@ -8,8 +8,6 @@ require ( github.com/google/go-cmp v0.7.0 github.com/knqyf263/go-plugin v0.9.0 github.com/moby/sys/mountinfo v0.6.2 - github.com/onsi/ginkgo/v2 v2.19.1 - github.com/onsi/gomega v1.34.0 github.com/opencontainers/runtime-spec v1.1.0 github.com/opencontainers/runtime-tools v0.9.0 github.com/sirupsen/logrus v1.9.3 @@ -24,18 +22,13 @@ require ( require ( github.com/containerd/log v0.1.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/go-logr/logr v1.4.2 // indirect - github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/planetscale/vtprotobuf v0.4.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rogpeppe/go-internal v1.10.0 // indirect github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect golang.org/x/net v0.38.0 // indirect - golang.org/x/text v0.23.0 // indirect - golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect ) diff --git a/go.sum b/go.sum index dfe64fda..c6604d3c 100644 --- a/go.sum +++ b/go.sum @@ -10,18 +10,12 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= -github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= -github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQNvHSdIE7iqsQxK1P41mySCvssg= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -40,10 +34,6 @@ github.com/mndrix/tap-go v0.0.0-20171203230836-629fa407e90b/go.mod h1:pzzDgJWZ34 github.com/moby/sys/mountinfo v0.6.2 h1:BzJjoreD5BMFNmD9Rus6gdd1pLuecOFPt8wC+Vygl78= github.com/moby/sys/mountinfo v0.6.2/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= -github.com/onsi/ginkgo/v2 v2.19.1 h1:QXgq3Z8Crl5EL1WBAC98A5sEBHARrAJNzAmMxzLcRF0= -github.com/onsi/ginkgo/v2 v2.19.1/go.mod h1:O3DtEWQkPa/F7fBMgmZQKKsluAy8pd3rEQdrjkPb9zA= -github.com/onsi/gomega v1.34.0 h1:eSSPsPNp6ZpsG8X1OVmOTxig+CblTc4AxpPBykhe2Os= -github.com/onsi/gomega v1.34.0/go.mod h1:MIKI8c+f+QLWk+hxbePD4i0LMJSExPaZOVfkoex4cAo= github.com/opencontainers/runtime-spec v1.0.3-0.20220825212826-86290f6a00fb/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.1.0 h1:HHUyrt9mwHUjtasSbXSMvs4cyFxh+Bll4AjJ9odEGpg= github.com/opencontainers/runtime-spec v1.1.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= @@ -92,8 +82,6 @@ golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d h1:pgIUhmqwKOUlnKna4r6amKdUngdL8DrkpFeV8+VBElY= diff --git a/plugins/device-injector/go.sum b/plugins/device-injector/go.sum index cd075209..468feef5 100644 --- a/plugins/device-injector/go.sum +++ b/plugins/device-injector/go.sum @@ -6,28 +6,18 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= -github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= -github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQNvHSdIE7iqsQxK1P41mySCvssg= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= github.com/knqyf263/go-plugin v0.9.0 h1:CQs2+lOPIlkZVtcb835ZYDEoyyWJWLbSTWeCs0EwTwI= github.com/knqyf263/go-plugin v0.9.0/go.mod h1:2z5lCO1/pez6qGo8CvCxSlBFSEat4MEp1DrnA+f7w8Q= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/onsi/ginkgo/v2 v2.19.1 h1:QXgq3Z8Crl5EL1WBAC98A5sEBHARrAJNzAmMxzLcRF0= -github.com/onsi/ginkgo/v2 v2.19.1/go.mod h1:O3DtEWQkPa/F7fBMgmZQKKsluAy8pd3rEQdrjkPb9zA= -github.com/onsi/gomega v1.34.0 h1:eSSPsPNp6ZpsG8X1OVmOTxig+CblTc4AxpPBykhe2Os= -github.com/onsi/gomega v1.34.0/go.mod h1:MIKI8c+f+QLWk+hxbePD4i0LMJSExPaZOVfkoex4cAo= github.com/opencontainers/runtime-spec v1.1.0 h1:HHUyrt9mwHUjtasSbXSMvs4cyFxh+Bll4AjJ9odEGpg= github.com/opencontainers/runtime-spec v1.1.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -49,10 +39,8 @@ golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= -golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d h1:pgIUhmqwKOUlnKna4r6amKdUngdL8DrkpFeV8+VBElY= google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= diff --git a/plugins/differ/go.sum b/plugins/differ/go.sum index 7c984f60..bd94e645 100644 --- a/plugins/differ/go.sum +++ b/plugins/differ/go.sum @@ -137,8 +137,6 @@ github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= -github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= @@ -151,10 +149,7 @@ github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8w github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= -github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/go-toolsmith/astcast v1.0.0/go.mod h1:mt2OdQTeAQcY4DQgPSArJjHCcOwlX+Wl/kwN+LbLGQ4= github.com/go-toolsmith/astcopy v1.0.0/go.mod h1:vrgyG+5Bxrnz4MZWPF+pI4R8h3qKRjjyvV/DSez4WVQ= github.com/go-toolsmith/astequal v1.0.0/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY= @@ -240,8 +235,6 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200507031123-427632fa3b1c/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQNvHSdIE7iqsQxK1P41mySCvssg= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/trillian v1.3.11/go.mod h1:0tPraVHrSDkA3BO6vKX67zgLXs6SsOAbHEivX+9mPgw= github.com/google/uuid v0.0.0-20161128191214-064e2069ce9c/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -425,15 +418,10 @@ github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6 github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.16.1 h1:foqVmeWDD6yYpK+Yz3fHyNIxFYNxswxqNFjSKe+vI54= github.com/onsi/ginkgo v1.16.1/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= -github.com/onsi/ginkgo/v2 v2.19.1 h1:QXgq3Z8Crl5EL1WBAC98A5sEBHARrAJNzAmMxzLcRF0= -github.com/onsi/ginkgo/v2 v2.19.1/go.mod h1:O3DtEWQkPa/F7fBMgmZQKKsluAy8pd3rEQdrjkPb9zA= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.11.0/go.mod h1:azGKhqFUon9Vuj0YmTfLSmx0FUwqXYSTl5re8lQLTUg= -github.com/onsi/gomega v1.34.0 h1:eSSPsPNp6ZpsG8X1OVmOTxig+CblTc4AxpPBykhe2Os= -github.com/onsi/gomega v1.34.0/go.mod h1:MIKI8c+f+QLWk+hxbePD4i0LMJSExPaZOVfkoex4cAo= github.com/opencontainers/runtime-spec v1.1.0 h1:HHUyrt9mwHUjtasSbXSMvs4cyFxh+Bll4AjJ9odEGpg= github.com/opencontainers/runtime-spec v1.1.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -863,8 +851,6 @@ golang.org/x/tools v0.0.0-20210104081019-d8d6ddbec6ee/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/plugins/hook-injector/go.sum b/plugins/hook-injector/go.sum index d217cc1c..053ff3b2 100644 --- a/plugins/hook-injector/go.sum +++ b/plugins/hook-injector/go.sum @@ -13,26 +13,16 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k= github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= -github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= -github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= -github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J0b1vyeLSOYI8bm5wbJM/8yDe8= -github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA= github.com/knqyf263/go-plugin v0.9.0 h1:CQs2+lOPIlkZVtcb835ZYDEoyyWJWLbSTWeCs0EwTwI= github.com/knqyf263/go-plugin v0.9.0/go.mod h1:2z5lCO1/pez6qGo8CvCxSlBFSEat4MEp1DrnA+f7w8Q= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/onsi/ginkgo/v2 v2.23.4 h1:ktYTpKJAVZnDT4VjxSbiBenUjmlL/5QkBEocaWXiQus= -github.com/onsi/ginkgo/v2 v2.23.4/go.mod h1:Bt66ApGPBFzHyR+JO10Zbt0Gsp4uWxu5mIOTusL46e8= -github.com/onsi/gomega v1.37.0 h1:CdEG8g0S133B4OswTDC/5XPSzE1OeP29QOioj2PID2Y= -github.com/onsi/gomega v1.37.0/go.mod h1:8D9+Txp43QWKhM24yyOBEdpkzN8FvJyAwecBgsU4KU0= github.com/opencontainers/runtime-spec v1.2.1 h1:S4k4ryNgEpxW1dzyqffOmhI1BHYcjzU8lpJfSlR0xww= github.com/opencontainers/runtime-spec v1.2.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -50,8 +40,6 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tetratelabs/wazero v1.9.0 h1:IcZ56OuxrtaEz8UYNRHBrUa9bYeX9oVY93KspZZBf/I= github.com/tetratelabs/wazero v1.9.0/go.mod h1:TSbcXCfFP0L2FGkRPxHphadXPjo1T6W+CseNNY7EkjM= -go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs= -go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8= go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI= go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU= go.yaml.in/yaml/v3 v3.0.3 h1:bXOww4E/J3f66rav3pX3m8w6jDE4knZjGOw8b5Y6iNE= @@ -63,8 +51,6 @@ golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4= golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU= -golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo= -golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg= google.golang.org/genproto/googleapis/rpc v0.0.0-20250313205543-e70fdf4c4cb4 h1:iK2jbkWL86DXjEx0qiHcRE9dE4/Ahua5k6V8OWFb//c= google.golang.org/genproto/googleapis/rpc v0.0.0-20250313205543-e70fdf4c4cb4/go.mod h1:LuRYeWDFV6WOn90g357N17oMCaxpgCnbi/44qJvDn2I= google.golang.org/grpc v1.72.2 h1:TdbGzwb82ty4OusHWepvFWGLgIbNo1/SUynEN0ssqv8= diff --git a/plugins/logger/go.sum b/plugins/logger/go.sum index cd075209..468feef5 100644 --- a/plugins/logger/go.sum +++ b/plugins/logger/go.sum @@ -6,28 +6,18 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= -github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= -github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQNvHSdIE7iqsQxK1P41mySCvssg= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= github.com/knqyf263/go-plugin v0.9.0 h1:CQs2+lOPIlkZVtcb835ZYDEoyyWJWLbSTWeCs0EwTwI= github.com/knqyf263/go-plugin v0.9.0/go.mod h1:2z5lCO1/pez6qGo8CvCxSlBFSEat4MEp1DrnA+f7w8Q= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/onsi/ginkgo/v2 v2.19.1 h1:QXgq3Z8Crl5EL1WBAC98A5sEBHARrAJNzAmMxzLcRF0= -github.com/onsi/ginkgo/v2 v2.19.1/go.mod h1:O3DtEWQkPa/F7fBMgmZQKKsluAy8pd3rEQdrjkPb9zA= -github.com/onsi/gomega v1.34.0 h1:eSSPsPNp6ZpsG8X1OVmOTxig+CblTc4AxpPBykhe2Os= -github.com/onsi/gomega v1.34.0/go.mod h1:MIKI8c+f+QLWk+hxbePD4i0LMJSExPaZOVfkoex4cAo= github.com/opencontainers/runtime-spec v1.1.0 h1:HHUyrt9mwHUjtasSbXSMvs4cyFxh+Bll4AjJ9odEGpg= github.com/opencontainers/runtime-spec v1.1.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -49,10 +39,8 @@ golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= -golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d h1:pgIUhmqwKOUlnKna4r6amKdUngdL8DrkpFeV8+VBElY= google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= diff --git a/plugins/network-device-injector/go.sum b/plugins/network-device-injector/go.sum index 3c774922..145fbbb6 100644 --- a/plugins/network-device-injector/go.sum +++ b/plugins/network-device-injector/go.sum @@ -10,26 +10,25 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= -github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= -github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQNvHSdIE7iqsQxK1P41mySCvssg= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= +github.com/google/pprof v0.0.0-20230323073829-e72429f035bd h1:r8yyd+DJDmsUhGrRBxH5Pj7KeFK5l+Y3FsgT8keqKtk= +github.com/google/pprof v0.0.0-20230323073829-e72429f035bd/go.mod h1:79YE0hCXdHag9sBkw2o+N/YnZtTkXi0UT9Nnixa5eYk= github.com/knqyf263/go-plugin v0.9.0 h1:CQs2+lOPIlkZVtcb835ZYDEoyyWJWLbSTWeCs0EwTwI= github.com/knqyf263/go-plugin v0.9.0/go.mod h1:2z5lCO1/pez6qGo8CvCxSlBFSEat4MEp1DrnA+f7w8Q= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/onsi/ginkgo/v2 v2.19.1 h1:QXgq3Z8Crl5EL1WBAC98A5sEBHARrAJNzAmMxzLcRF0= -github.com/onsi/ginkgo/v2 v2.19.1/go.mod h1:O3DtEWQkPa/F7fBMgmZQKKsluAy8pd3rEQdrjkPb9zA= -github.com/onsi/gomega v1.34.0 h1:eSSPsPNp6ZpsG8X1OVmOTxig+CblTc4AxpPBykhe2Os= -github.com/onsi/gomega v1.34.0/go.mod h1:MIKI8c+f+QLWk+hxbePD4i0LMJSExPaZOVfkoex4cAo= +github.com/onsi/ginkgo/v2 v2.16.0 h1:7q1w9frJDzninhXxjZd+Y/x54XNjG/UlRLIYPZafsPM= +github.com/onsi/ginkgo/v2 v2.16.0/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= +github.com/onsi/gomega v1.31.1 h1:KYppCUK+bUgAZwHOu7EXVBKyQA6ILvOESHkn/tgoqvo= +github.com/onsi/gomega v1.31.1/go.mod h1:y40C95dwAD1Nz36SsEnxvfFe8FFfNxzI5eJ0EYGyAy0= github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE7dzrbT927iTk= github.com/opencontainers/runtime-spec v1.2.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -58,10 +57,10 @@ golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= -golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= +golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= google.golang.org/genproto/googleapis/rpc v0.0.0-20240509183442-62759503f434 h1:umK/Ey0QEzurTNlsV3R+MfxHAb78HCEX/IkuR+zH4WQ= google.golang.org/genproto/googleapis/rpc v0.0.0-20240509183442-62759503f434/go.mod h1:I7Y+G38R2bu5j1aLzfFmQfTcU/WnFuqDwLZAbvKTKpM= google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= diff --git a/plugins/network-logger/go.sum b/plugins/network-logger/go.sum index 4b1a8250..d6b2a9e2 100644 --- a/plugins/network-logger/go.sum +++ b/plugins/network-logger/go.sum @@ -5,24 +5,14 @@ github.com/containerd/ttrpc v1.2.7/go.mod h1:YCXHsb32f+Sq5/72xHubdiJRQY9inL4a4ZQ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= -github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= -github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQNvHSdIE7iqsQxK1P41mySCvssg= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= github.com/knqyf263/go-plugin v0.9.0 h1:CQs2+lOPIlkZVtcb835ZYDEoyyWJWLbSTWeCs0EwTwI= github.com/knqyf263/go-plugin v0.9.0/go.mod h1:2z5lCO1/pez6qGo8CvCxSlBFSEat4MEp1DrnA+f7w8Q= -github.com/onsi/ginkgo/v2 v2.19.1 h1:QXgq3Z8Crl5EL1WBAC98A5sEBHARrAJNzAmMxzLcRF0= -github.com/onsi/ginkgo/v2 v2.19.1/go.mod h1:O3DtEWQkPa/F7fBMgmZQKKsluAy8pd3rEQdrjkPb9zA= -github.com/onsi/gomega v1.34.0 h1:eSSPsPNp6ZpsG8X1OVmOTxig+CblTc4AxpPBykhe2Os= -github.com/onsi/gomega v1.34.0/go.mod h1:MIKI8c+f+QLWk+hxbePD4i0LMJSExPaZOVfkoex4cAo= github.com/opencontainers/runtime-spec v1.1.0 h1:HHUyrt9mwHUjtasSbXSMvs4cyFxh+Bll4AjJ9odEGpg= github.com/opencontainers/runtime-spec v1.1.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -42,10 +32,8 @@ golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= -golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d h1:pgIUhmqwKOUlnKna4r6amKdUngdL8DrkpFeV8+VBElY= google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= diff --git a/plugins/template/go.sum b/plugins/template/go.sum index cd075209..468feef5 100644 --- a/plugins/template/go.sum +++ b/plugins/template/go.sum @@ -6,28 +6,18 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= -github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= -github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQNvHSdIE7iqsQxK1P41mySCvssg= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= github.com/knqyf263/go-plugin v0.9.0 h1:CQs2+lOPIlkZVtcb835ZYDEoyyWJWLbSTWeCs0EwTwI= github.com/knqyf263/go-plugin v0.9.0/go.mod h1:2z5lCO1/pez6qGo8CvCxSlBFSEat4MEp1DrnA+f7w8Q= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/onsi/ginkgo/v2 v2.19.1 h1:QXgq3Z8Crl5EL1WBAC98A5sEBHARrAJNzAmMxzLcRF0= -github.com/onsi/ginkgo/v2 v2.19.1/go.mod h1:O3DtEWQkPa/F7fBMgmZQKKsluAy8pd3rEQdrjkPb9zA= -github.com/onsi/gomega v1.34.0 h1:eSSPsPNp6ZpsG8X1OVmOTxig+CblTc4AxpPBykhe2Os= -github.com/onsi/gomega v1.34.0/go.mod h1:MIKI8c+f+QLWk+hxbePD4i0LMJSExPaZOVfkoex4cAo= github.com/opencontainers/runtime-spec v1.1.0 h1:HHUyrt9mwHUjtasSbXSMvs4cyFxh+Bll4AjJ9odEGpg= github.com/opencontainers/runtime-spec v1.1.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -49,10 +39,8 @@ golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= -golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d h1:pgIUhmqwKOUlnKna4r6amKdUngdL8DrkpFeV8+VBElY= google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= diff --git a/plugins/ulimit-adjuster/go.sum b/plugins/ulimit-adjuster/go.sum index cd075209..468feef5 100644 --- a/plugins/ulimit-adjuster/go.sum +++ b/plugins/ulimit-adjuster/go.sum @@ -6,28 +6,18 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= -github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= -github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQNvHSdIE7iqsQxK1P41mySCvssg= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= github.com/knqyf263/go-plugin v0.9.0 h1:CQs2+lOPIlkZVtcb835ZYDEoyyWJWLbSTWeCs0EwTwI= github.com/knqyf263/go-plugin v0.9.0/go.mod h1:2z5lCO1/pez6qGo8CvCxSlBFSEat4MEp1DrnA+f7w8Q= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/onsi/ginkgo/v2 v2.19.1 h1:QXgq3Z8Crl5EL1WBAC98A5sEBHARrAJNzAmMxzLcRF0= -github.com/onsi/ginkgo/v2 v2.19.1/go.mod h1:O3DtEWQkPa/F7fBMgmZQKKsluAy8pd3rEQdrjkPb9zA= -github.com/onsi/gomega v1.34.0 h1:eSSPsPNp6ZpsG8X1OVmOTxig+CblTc4AxpPBykhe2Os= -github.com/onsi/gomega v1.34.0/go.mod h1:MIKI8c+f+QLWk+hxbePD4i0LMJSExPaZOVfkoex4cAo= github.com/opencontainers/runtime-spec v1.1.0 h1:HHUyrt9mwHUjtasSbXSMvs4cyFxh+Bll4AjJ9odEGpg= github.com/opencontainers/runtime-spec v1.1.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -49,10 +39,8 @@ golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= -golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d h1:pgIUhmqwKOUlnKna4r6amKdUngdL8DrkpFeV8+VBElY= google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= diff --git a/plugins/v010-adapter/go.sum b/plugins/v010-adapter/go.sum index 4fd903cf..8e107303 100644 --- a/plugins/v010-adapter/go.sum +++ b/plugins/v010-adapter/go.sum @@ -49,8 +49,6 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= -github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -79,8 +77,6 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQNvHSdIE7iqsQxK1P41mySCvssg= -github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -102,10 +98,6 @@ github.com/moby/sys/user v0.3.0 h1:9ni5DlcW5an3SvRSx4MouotOygvzaXbaSrc/wGDFWPo= github.com/moby/sys/user v0.3.0/go.mod h1:bG+tYYYJgaMtRKgEmuueC0hJEAZWwtIbZTB+85uoHjs= github.com/moby/sys/userns v0.1.0 h1:tVLXkFOxVu9A64/yh59slHVv9ahO9UIev4JZusOLG/g= github.com/moby/sys/userns v0.1.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28= -github.com/onsi/ginkgo/v2 v2.19.1 h1:QXgq3Z8Crl5EL1WBAC98A5sEBHARrAJNzAmMxzLcRF0= -github.com/onsi/ginkgo/v2 v2.19.1/go.mod h1:O3DtEWQkPa/F7fBMgmZQKKsluAy8pd3rEQdrjkPb9zA= -github.com/onsi/gomega v1.34.0 h1:eSSPsPNp6ZpsG8X1OVmOTxig+CblTc4AxpPBykhe2Os= -github.com/onsi/gomega v1.34.0/go.mod h1:MIKI8c+f+QLWk+hxbePD4i0LMJSExPaZOVfkoex4cAo= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= @@ -195,8 +187,6 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.35.0 h1:mBffYraMEf7aa0sB+NuKnuCy8qI/9Bughn8dC2Gu5r0= -golang.org/x/tools v0.35.0/go.mod h1:NKdj5HkL/73byiZSJjqJgKn3ep7KjFkBOkR/Hps3VPw= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/plugins/wasm/go.sum b/plugins/wasm/go.sum index 8f815e89..bb615de6 100644 --- a/plugins/wasm/go.sum +++ b/plugins/wasm/go.sum @@ -32,8 +32,8 @@ golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= -golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d h1:pgIUhmqwKOUlnKna4r6amKdUngdL8DrkpFeV8+VBElY= google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= From f14534141f84503d17158e2ec0fe3b4bae836d59 Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Mon, 3 Nov 2025 15:11:32 +0200 Subject: [PATCH 19/20] adaptation: implement plugin update. Start treating plugins which register with the same index and name as multiple instances of the same plugin. When a plugin registers, shut down the previous instance of the same plugin once the later one gets synchronized. Signed-off-by: Krisztian Litkey --- pkg/adaptation/adaptation.go | 67 +++++++++++++++++++++---------- pkg/adaptation/adaptation_test.go | 36 +++++++++++++++++ pkg/api/v1beta1/plugin.go | 4 ++ 3 files changed, 86 insertions(+), 21 deletions(-) diff --git a/pkg/adaptation/adaptation.go b/pkg/adaptation/adaptation.go index 6e8c6ca5..4330f109 100644 --- a/pkg/adaptation/adaptation.go +++ b/pkg/adaptation/adaptation.go @@ -242,7 +242,7 @@ func (r *Adaptation) ShutdownPlugins(reason, pattern string) { func (r *Adaptation) RunPodSandbox(ctx context.Context, req *RunPodSandboxRequest) error { r.Lock() defer r.Unlock() - defer r.removeClosedPlugins() + defer r.removeClosedPlugins(nil) for _, plugin := range r.plugins { _, err := plugin.runPodSandbox(ctx, req) @@ -258,7 +258,7 @@ func (r *Adaptation) RunPodSandbox(ctx context.Context, req *RunPodSandboxReques func (r *Adaptation) UpdatePodSandbox(ctx context.Context, req *UpdatePodSandboxRequest) (*UpdatePodSandboxResponse, error) { r.Lock() defer r.Unlock() - defer r.removeClosedPlugins() + defer r.removeClosedPlugins(nil) for _, plugin := range r.plugins { _, err := plugin.updatePodSandbox(ctx, req) @@ -274,7 +274,7 @@ func (r *Adaptation) UpdatePodSandbox(ctx context.Context, req *UpdatePodSandbox func (r *Adaptation) PostUpdatePodSandbox(ctx context.Context, req *PostUpdatePodSandboxRequest) error { r.Lock() defer r.Unlock() - defer r.removeClosedPlugins() + defer r.removeClosedPlugins(nil) for _, plugin := range r.plugins { _, err := plugin.postUpdatePodSandbox(ctx, req) @@ -290,7 +290,7 @@ func (r *Adaptation) PostUpdatePodSandbox(ctx context.Context, req *PostUpdatePo func (r *Adaptation) StopPodSandbox(ctx context.Context, req *StopPodSandboxRequest) error { r.Lock() defer r.Unlock() - defer r.removeClosedPlugins() + defer r.removeClosedPlugins(nil) for _, plugin := range r.plugins { _, err := plugin.stopPodSandbox(ctx, req) @@ -306,7 +306,7 @@ func (r *Adaptation) StopPodSandbox(ctx context.Context, req *StopPodSandboxRequ func (r *Adaptation) RemovePodSandbox(ctx context.Context, req *RemovePodSandboxRequest) error { r.Lock() defer r.Unlock() - defer r.removeClosedPlugins() + defer r.removeClosedPlugins(nil) for _, plugin := range r.plugins { _, err := plugin.removePodSandbox(ctx, req) @@ -322,7 +322,7 @@ func (r *Adaptation) RemovePodSandbox(ctx context.Context, req *RemovePodSandbox func (r *Adaptation) CreateContainer(ctx context.Context, req *CreateContainerRequest) (*CreateContainerResponse, error) { r.Lock() defer r.Unlock() - defer r.removeClosedPlugins() + defer r.removeClosedPlugins(nil) var ( result = collectCreateContainerResult(req) @@ -357,7 +357,7 @@ func (r *Adaptation) CreateContainer(ctx context.Context, req *CreateContainerRe func (r *Adaptation) PostCreateContainer(ctx context.Context, req *PostCreateContainerRequest) error { r.Lock() defer r.Unlock() - defer r.removeClosedPlugins() + defer r.removeClosedPlugins(nil) for _, plugin := range r.plugins { _, err := plugin.postCreateContainer(ctx, req) @@ -373,7 +373,7 @@ func (r *Adaptation) PostCreateContainer(ctx context.Context, req *PostCreateCon func (r *Adaptation) StartContainer(ctx context.Context, req *StartContainerRequest) error { r.Lock() defer r.Unlock() - defer r.removeClosedPlugins() + defer r.removeClosedPlugins(nil) for _, plugin := range r.plugins { _, err := plugin.startContainer(ctx, req) @@ -389,7 +389,7 @@ func (r *Adaptation) StartContainer(ctx context.Context, req *StartContainerRequ func (r *Adaptation) PostStartContainer(ctx context.Context, req *PostStartContainerRequest) error { r.Lock() defer r.Unlock() - defer r.removeClosedPlugins() + defer r.removeClosedPlugins(nil) for _, plugin := range r.plugins { _, err := plugin.postStartContainer(ctx, req) @@ -405,7 +405,7 @@ func (r *Adaptation) PostStartContainer(ctx context.Context, req *PostStartConta func (r *Adaptation) UpdateContainer(ctx context.Context, req *UpdateContainerRequest) (*UpdateContainerResponse, error) { r.Lock() defer r.Unlock() - defer r.removeClosedPlugins() + defer r.removeClosedPlugins(nil) result := collectUpdateContainerResult(req) for _, plugin := range r.plugins { @@ -426,7 +426,7 @@ func (r *Adaptation) UpdateContainer(ctx context.Context, req *UpdateContainerRe func (r *Adaptation) PostUpdateContainer(ctx context.Context, req *PostUpdateContainerRequest) error { r.Lock() defer r.Unlock() - defer r.removeClosedPlugins() + defer r.removeClosedPlugins(nil) for _, plugin := range r.plugins { _, err := plugin.postUpdateContainer(ctx, req) @@ -442,7 +442,7 @@ func (r *Adaptation) PostUpdateContainer(ctx context.Context, req *PostUpdateCon func (r *Adaptation) StopContainer(ctx context.Context, req *StopContainerRequest) (*StopContainerResponse, error) { r.Lock() defer r.Unlock() - defer r.removeClosedPlugins() + defer r.removeClosedPlugins(nil) result := collectStopContainerResult() for _, plugin := range r.plugins { @@ -463,7 +463,7 @@ func (r *Adaptation) StopContainer(ctx context.Context, req *StopContainerReques func (r *Adaptation) RemoveContainer(ctx context.Context, req *RemoveContainerRequest) error { r.Lock() defer r.Unlock() - defer r.removeClosedPlugins() + defer r.removeClosedPlugins(nil) for _, plugin := range r.plugins { _, err := plugin.removeContainer(ctx, req) @@ -592,7 +592,7 @@ func (r *Adaptation) startPlugins() (retErr error) { } r.plugins = plugins - r.sortPlugins() + r.sortPlugins(nil) return nil } @@ -606,12 +606,19 @@ func (r *Adaptation) stopPlugins() { r.plugins = nil } -func (r *Adaptation) removeClosedPlugins() { - var active, closed, validators []*plugin +func (r *Adaptation) removeClosedPlugins(newPlugin *plugin) *plugin { + var ( + active, closed, validators []*plugin + old *plugin + ) + for _, p := range r.plugins { - if p.isClosed() { + switch { + case p.isClosed(): closed = append(closed, p) - } else { + case isSameExternalInstance(p, newPlugin): + old = p + default: active = append(active, p) if p.isContainerAdjustmentValidator() { validators = append(validators, p) @@ -629,6 +636,7 @@ func (r *Adaptation) removeClosedPlugins() { r.plugins = active r.validators = validators + return old } func (r *Adaptation) startListener() error { @@ -695,8 +703,11 @@ func (r *Adaptation) acceptPluginConnections(l net.Listener) error { if p.isContainerAdjustmentValidator() { r.validators = append(r.validators, p) } - r.sortPlugins() + old := r.sortPlugins(p) r.Unlock() + if old != nil { + old.shutdown(api.ShutdownByOtherInstance) + } log.Infof(ctx, "plugin %q connected and synchronized", p.name()) } @@ -759,8 +770,8 @@ func (r *Adaptation) discoverPlugins() ([]string, []string, []string, error) { return indices, plugins, configs, nil } -func (r *Adaptation) sortPlugins() { - r.removeClosedPlugins() +func (r *Adaptation) sortPlugins(newPlugin *plugin) *plugin { + oldInstance := r.removeClosedPlugins(newPlugin) sort.Slice(r.plugins, func(i, j int) bool { return r.plugins[i].idx < r.plugins[j].idx }) @@ -779,6 +790,20 @@ func (r *Adaptation) sortPlugins() { log.Infof(noCtx, " %q (%s)", p.name(), p.qualifiedName()) } } + return oldInstance +} + +func isSameExternalInstance(p1, p2 *plugin) bool { + if p1 == nil || p2 == nil { + return false + } + if !p1.isExternal() || !p2.isExternal() { + return false + } + if p1.idx != p2.idx || p1.base != p2.base { + return false + } + return p1 != p2 } func (r *Adaptation) hasValidators() bool { diff --git a/pkg/adaptation/adaptation_test.go b/pkg/adaptation/adaptation_test.go index b5d8533a..01e51d58 100644 --- a/pkg/adaptation/adaptation_test.go +++ b/pkg/adaptation/adaptation_test.go @@ -3388,6 +3388,42 @@ func TestContainerAdjustmentValidation(t *testing.T) { } } +func TestPluginInstanceUpdate(t *testing.T) { + var ( + sut *Suite + evt *EventCollector + tc = &testbase{ + plugins: map[string][]PluginOption{ + "00-test": {}, + }, + } + ) + + sut, evt = tc.Setup(t) + sut.Start(WithWaitForPluginsToStart()) + + p := NewPlugin(t, sut.Dir(), evt.Channel(), + WithPluginIndex("00"), + WithPluginName("test"), + ) + + p.Start() + _, started := evt.Search( + EventOccurred(PluginSynchronized(p.ID(), nil, nil)), + UntilTimeout(1*time.Second), + ) + require.True(t, started, "start new plugin instance") + + _, shutdown := evt.Search( + EventOccurred(PluginShutdown("00-test", api.ShutdownByOtherInstance)), + UntilTimeout(1*time.Second), + ) + require.True(t, shutdown, "old instance shut down by new instance") + + sut.Stop() + evt.Stop() +} + func protoDiff(a, b proto.Message) string { return cmp.Diff(a, b, protocmp.Transform()) } diff --git a/pkg/api/v1beta1/plugin.go b/pkg/api/v1beta1/plugin.go index 53cd4d1a..e8f2d64a 100644 --- a/pkg/api/v1beta1/plugin.go +++ b/pkg/api/v1beta1/plugin.go @@ -30,6 +30,10 @@ const ( PluginNameEnvVar = "NRI_PLUGIN_NAME" // PluginIdxEnvVar is used to inform NRI-launched plugins about their ID. PluginIdxEnvVar = "NRI_PLUGIN_IDX" + + // ShutdownByOtherInstance indicates that the plugin was shut down because + // another instance of the same plugin was registered. + ShutdownByOtherInstance = "other plugin instance registered" ) // ParsePluginName parses the (file)name of a plugin into an index and a base. From dde7d95d0b829a5aec1f08043fb57d308abdffbc Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Tue, 4 Nov 2025 18:33:54 +0200 Subject: [PATCH 20/20] Makefile,.github: stop using ginkgo in test runs. Signed-off-by: Krisztian Litkey --- .github/workflows/ci.yml | 2 +- Makefile | 35 ++++++++++++++--------------------- 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da84c836..2b22e257 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,4 +113,4 @@ jobs: echo "${{ github.workspace }}/bin" >> $GITHUB_PATH - run: | - make install-ginkgo test codecov + make test codecov diff --git a/Makefile b/Makefile index a5f7adfe..d53b91b7 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,6 @@ GO_BUILD_FLAGS ?= GO_MODULES := $(shell $(GO_CMD) list ./...) GOLANG_CILINT := golangci-lint -GINKGO := ginkgo RESOLVED_PWD := $(shell realpath $(shell pwd)) BUILD_PATH := $(RESOLVED_PWD)/build @@ -71,7 +70,7 @@ clean: clean-plugins allclean: clean clean-cache -test: test-gopkgs +test: test-gopkgs test-plugins generate: generate-golang @@ -135,23 +134,20 @@ $(BIN_PATH)/wasm build/bin/wasm: FORCE # test targets # -test-gopkgs: ginkgo-tests test-ulimits +test-gopkgs: + $(Q)mkdir -p $(COVERAGE_PATH) && \ + $(GO_TEST) \ + -race \ + -cover \ + -covermode=atomic \ + -coverprofile coverprofile \ + -outputdir $(COVERAGE_PATH) \ + ./pkg/... && \ + $(GO_CMD) tool cover \ + -html=$(COVERAGE_PATH)/coverprofile \ + -o $(COVERAGE_PATH)/coverage.html -SKIPPED_PKGS="ulimit-adjuster,device-injector" - -ginkgo-tests: - $(Q)$(GINKGO) run \ - --race \ - --trace \ - --cover \ - --covermode atomic \ - --output-dir $(COVERAGE_PATH) \ - --junit-report junit.xml \ - --coverprofile coverprofile \ - --succinct \ - --skip-package $(SKIPPED_PKGS) \ - -r && \ - $(GO_CMD) tool cover -html=$(COVERAGE_PATH)/coverprofile -o $(COVERAGE_PATH)/coverage.html +test-plugins: test-ulimits test-device-injector test-ulimits: $(Q)cd ./plugins/ulimit-adjuster && $(GO_TEST) -v @@ -229,6 +225,3 @@ install-wasm-plugin: install-protoc-dependencies: $(Q)GOBIN="$(PROTOC_PATH)/bin" $(GO_INSTALL) google.golang.org/protobuf/cmd/protoc-gen-go - -install-ginkgo: - $(Q)$(GO_INSTALL) -mod=mod github.com/onsi/ginkgo/v2/ginkgo