From 680f42fc2b9203945398ef8cc429e155cc7f7e5d Mon Sep 17 00:00:00 2001 From: Hamza El-Saawy Date: Wed, 13 Apr 2022 17:10:19 -0400 Subject: [PATCH] Added LCOW functional tests and benchmarks Split out test utilities from `test/functional` to an internal package. Updated code to use containerd instead of docker. Added tests and benchmarks for LCOW uVM containers. Updated other LCOW tests. Updated cri-containerd and runhcs tests to use moved code in `test\internal` Signed-off-by: Hamza El-Saawy --- Makefile | 55 +- scripts/Test-Functional.ps1 | 62 + scripts/Test-LCOW-UVM.ps1 | 143 + scripts/Testing.psm1 | 144 + test/cri-containerd/clone_test.go | 16 +- .../container_downlevel_test.go | 4 +- .../container_layers_packing_test.go | 8 +- test/cri-containerd/container_update_test.go | 4 +- test/cri-containerd/createcontainer_test.go | 6 +- test/cri-containerd/main_test.go | 5 +- test/cri-containerd/runpodsandbox_test.go | 7 +- test/functional/lcow_bench_test.go | 101 + test/functional/lcow_container_bench_test.go | 229 + test/functional/lcow_container_test.go | 178 + test/functional/lcow_test.go | 118 +- test/functional/main_test.go | 169 + test/functional/manifest_test.go | 3 - test/functional/test.go | 53 - test/functional/utilities/layerfolders.go | 54 - test/functional/utilities/tempdir.go | 15 - test/functional/uvm_mem_backingtype_test.go | 38 +- test/functional/uvm_memory_test.go | 27 +- test/functional/uvm_plannine_test.go | 33 +- test/functional/uvm_properties_test.go | 21 +- test/functional/uvm_scratch_test.go | 18 +- test/functional/uvm_scsi_test.go | 31 +- test/functional/uvm_virtualdevice_test.go | 15 +- test/functional/uvm_vpmem_test.go | 19 +- test/functional/uvm_vsmb_test.go | 26 +- test/functional/wcow_test.go | 64 +- test/go.mod | 14 +- test/go.sum | 17 +- .../assets/defaultlinuxspec.json | 0 .../assets/defaultwindowsspec.json | 0 .../samples/config.justin.lcow.working.json | 0 .../samples/from-docker-linux/privileged.json | 0 .../assets/samples/from-docker-linux/sh.json | 0 test/internal/cmd/cmd.go | 89 + test/internal/cmd/io.go | 66 + test/internal/constants/constants.go | 15 + test/internal/constants/images.go | 54 + test/internal/container/container.go | 83 + test/internal/containerd/containerd.go | 211 + .../defaultlinuxspec.go | 2 +- .../defaultwindowsspec.go | 2 +- test/internal/flag/flag.go | 77 + test/internal/layers/layerfolders.go | 85 + test/internal/layers/scratch.go | 49 + .../manifest/manifest.go | 0 .../manifest/rsrc_amd64.syso | Bin test/internal/oci/cri.go | 50 + test/internal/oci/images.go | 19 + test/internal/oci/oci.go | 125 + .../require/build.go} | 8 +- test/internal/require/requires.go | 61 + test/internal/schemaversion_test.go | 3 +- .../utilities => internal}/scratch.go | 14 +- .../utilities => internal}/stringsetflag.go | 8 +- test/internal/timeout/timeout.go | 45 + test/internal/uvm/lcow.go | 47 + test/internal/uvm/uvm.go | 59 + .../createuvm.go => internal/uvm/wcow.go} | 44 +- test/runhcs/e2e_matrix_test.go | 33 +- test/runhcs/runhcs_test.go | 2 +- .../github.com/Microsoft/hcsshim/Makefile | 55 +- .../containerd/pkg/cri/constants/constants.go | 26 + .../containerd/pkg/cri/util/deep_copy.go | 42 + .../containerd/containerd/pkg/cri/util/id.go | 29 + .../containerd/pkg/cri/util/image.go | 33 + .../containerd/pkg/cri/util/strings.go | 59 + .../containerd/pkg/cri/util/util.go | 46 + .../remotes/docker/config/config_unix.go | 40 + .../remotes/docker/config/config_windows.go | 41 + .../containerd/remotes/docker/config/hosts.go | 557 + .../pelletier/go-toml/.dockerignore | 2 + .../github.com/pelletier/go-toml/.gitignore | 5 + .../pelletier/go-toml/CONTRIBUTING.md | 132 + .../github.com/pelletier/go-toml/Dockerfile | 11 + .../github.com/pelletier/go-toml/LICENSE | 21 + .../github.com/pelletier/go-toml/Makefile | 29 + .../go-toml/PULL_REQUEST_TEMPLATE.md | 5 + .../github.com/pelletier/go-toml/README.md | 151 + .../pelletier/go-toml/azure-pipelines.yml | 230 + .../github.com/pelletier/go-toml/benchmark.sh | 35 + .../github.com/pelletier/go-toml/doc.go | 23 + .../pelletier/go-toml/example-crlf.toml | 30 + .../github.com/pelletier/go-toml/example.toml | 30 + .../github.com/pelletier/go-toml/fuzz.go | 31 + .../github.com/pelletier/go-toml/fuzz.sh | 15 + .../github.com/pelletier/go-toml/fuzzit.sh | 26 + .../pelletier/go-toml/keysparsing.go | 112 + .../github.com/pelletier/go-toml/lexer.go | 807 + .../github.com/pelletier/go-toml/localtime.go | 281 + .../github.com/pelletier/go-toml/marshal.go | 1269 ++ .../go-toml/marshal_OrderPreserve_test.toml | 39 + .../pelletier/go-toml/marshal_test.toml | 39 + .../github.com/pelletier/go-toml/parser.go | 493 + .../github.com/pelletier/go-toml/position.go | 29 + .../github.com/pelletier/go-toml/token.go | 134 + .../github.com/pelletier/go-toml/toml.go | 529 + .../pelletier/go-toml/tomltree_create.go | 155 + .../pelletier/go-toml/tomltree_write.go | 517 + .../golang.org/x/net/context/context.go | 56 + test/vendor/golang.org/x/net/context/go17.go | 73 + test/vendor/golang.org/x/net/context/go19.go | 21 + .../golang.org/x/net/context/pre_go17.go | 301 + .../golang.org/x/net/context/pre_go19.go | 110 + .../x/net/http2/client_conn_pool.go | 47 +- test/vendor/golang.org/x/net/http2/errors.go | 12 + test/vendor/golang.org/x/net/http2/frame.go | 62 +- .../golang.org/x/net/http2/hpack/huffman.go | 38 +- test/vendor/golang.org/x/net/http2/pipe.go | 11 + test/vendor/golang.org/x/net/http2/server.go | 111 +- .../golang.org/x/net/http2/transport.go | 1446 +- .../golang.org/x/net/http2/writesched.go | 4 +- .../x/net/http2/writesched_random.go | 6 +- test/vendor/golang.org/x/net/idna/go118.go | 14 + .../golang.org/x/net/idna/idna10.0.0.go | 6 +- .../vendor/golang.org/x/net/idna/idna9.0.0.go | 4 +- .../vendor/golang.org/x/net/idna/pre_go118.go | 12 + test/vendor/golang.org/x/net/idna/punycode.go | 36 +- .../pkg/apis/runtime/v1alpha2/api.pb.go | 16979 ++++++++++------ .../pkg/apis/runtime/v1alpha2/api.proto | 170 +- test/vendor/modules.txt | 19 +- 124 files changed, 21528 insertions(+), 7066 deletions(-) create mode 100644 scripts/Test-Functional.ps1 create mode 100644 scripts/Test-LCOW-UVM.ps1 create mode 100644 scripts/Testing.psm1 create mode 100644 test/functional/lcow_bench_test.go create mode 100644 test/functional/lcow_container_bench_test.go create mode 100644 test/functional/lcow_container_test.go create mode 100644 test/functional/main_test.go delete mode 100644 test/functional/manifest_test.go delete mode 100644 test/functional/test.go delete mode 100644 test/functional/utilities/layerfolders.go delete mode 100644 test/functional/utilities/tempdir.go rename test/{functional => internal}/assets/defaultlinuxspec.json (100%) rename test/{functional => internal}/assets/defaultwindowsspec.json (100%) rename test/{functional => internal}/assets/samples/config.justin.lcow.working.json (100%) rename test/{functional => internal}/assets/samples/from-docker-linux/privileged.json (100%) rename test/{functional => internal}/assets/samples/from-docker-linux/sh.json (100%) create mode 100644 test/internal/cmd/cmd.go create mode 100644 test/internal/cmd/io.go create mode 100644 test/internal/constants/constants.go create mode 100644 test/internal/constants/images.go create mode 100644 test/internal/container/container.go create mode 100644 test/internal/containerd/containerd.go rename test/{functional/utilities => internal}/defaultlinuxspec.go (95%) rename test/{functional/utilities => internal}/defaultwindowsspec.go (95%) create mode 100644 test/internal/flag/flag.go create mode 100644 test/internal/layers/layerfolders.go create mode 100644 test/internal/layers/scratch.go rename test/{functional => internal}/manifest/manifest.go (100%) rename test/{functional => internal}/manifest/rsrc_amd64.syso (100%) create mode 100644 test/internal/oci/cri.go create mode 100644 test/internal/oci/images.go create mode 100644 test/internal/oci/oci.go rename test/{functional/utilities/requiresbuild.go => internal/require/build.go} (64%) create mode 100644 test/internal/require/requires.go rename test/{functional/utilities => internal}/scratch.go (86%) rename test/{functional/utilities => internal}/stringsetflag.go (84%) create mode 100644 test/internal/timeout/timeout.go create mode 100644 test/internal/uvm/lcow.go create mode 100644 test/internal/uvm/uvm.go rename test/{functional/utilities/createuvm.go => internal/uvm/wcow.go} (55%) create mode 100644 test/vendor/github.com/containerd/containerd/pkg/cri/constants/constants.go create mode 100644 test/vendor/github.com/containerd/containerd/pkg/cri/util/deep_copy.go create mode 100644 test/vendor/github.com/containerd/containerd/pkg/cri/util/id.go create mode 100644 test/vendor/github.com/containerd/containerd/pkg/cri/util/image.go create mode 100644 test/vendor/github.com/containerd/containerd/pkg/cri/util/strings.go create mode 100644 test/vendor/github.com/containerd/containerd/pkg/cri/util/util.go create mode 100644 test/vendor/github.com/containerd/containerd/remotes/docker/config/config_unix.go create mode 100644 test/vendor/github.com/containerd/containerd/remotes/docker/config/config_windows.go create mode 100644 test/vendor/github.com/containerd/containerd/remotes/docker/config/hosts.go create mode 100644 test/vendor/github.com/pelletier/go-toml/.dockerignore create mode 100644 test/vendor/github.com/pelletier/go-toml/.gitignore create mode 100644 test/vendor/github.com/pelletier/go-toml/CONTRIBUTING.md create mode 100644 test/vendor/github.com/pelletier/go-toml/Dockerfile create mode 100644 test/vendor/github.com/pelletier/go-toml/LICENSE create mode 100644 test/vendor/github.com/pelletier/go-toml/Makefile create mode 100644 test/vendor/github.com/pelletier/go-toml/PULL_REQUEST_TEMPLATE.md create mode 100644 test/vendor/github.com/pelletier/go-toml/README.md create mode 100644 test/vendor/github.com/pelletier/go-toml/azure-pipelines.yml create mode 100644 test/vendor/github.com/pelletier/go-toml/benchmark.sh create mode 100644 test/vendor/github.com/pelletier/go-toml/doc.go create mode 100644 test/vendor/github.com/pelletier/go-toml/example-crlf.toml create mode 100644 test/vendor/github.com/pelletier/go-toml/example.toml create mode 100644 test/vendor/github.com/pelletier/go-toml/fuzz.go create mode 100644 test/vendor/github.com/pelletier/go-toml/fuzz.sh create mode 100644 test/vendor/github.com/pelletier/go-toml/fuzzit.sh create mode 100644 test/vendor/github.com/pelletier/go-toml/keysparsing.go create mode 100644 test/vendor/github.com/pelletier/go-toml/lexer.go create mode 100644 test/vendor/github.com/pelletier/go-toml/localtime.go create mode 100644 test/vendor/github.com/pelletier/go-toml/marshal.go create mode 100644 test/vendor/github.com/pelletier/go-toml/marshal_OrderPreserve_test.toml create mode 100644 test/vendor/github.com/pelletier/go-toml/marshal_test.toml create mode 100644 test/vendor/github.com/pelletier/go-toml/parser.go create mode 100644 test/vendor/github.com/pelletier/go-toml/position.go create mode 100644 test/vendor/github.com/pelletier/go-toml/token.go create mode 100644 test/vendor/github.com/pelletier/go-toml/toml.go create mode 100644 test/vendor/github.com/pelletier/go-toml/tomltree_create.go create mode 100644 test/vendor/github.com/pelletier/go-toml/tomltree_write.go create mode 100644 test/vendor/golang.org/x/net/context/context.go create mode 100644 test/vendor/golang.org/x/net/context/go17.go create mode 100644 test/vendor/golang.org/x/net/context/go19.go create mode 100644 test/vendor/golang.org/x/net/context/pre_go17.go create mode 100644 test/vendor/golang.org/x/net/context/pre_go19.go create mode 100644 test/vendor/golang.org/x/net/idna/go118.go create mode 100644 test/vendor/golang.org/x/net/idna/pre_go118.go diff --git a/Makefile b/Makefile index 3e05b3f7a9..c11786ce3a 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ BASE:=base.tar.gz +DEV_BUILD:=0 GO:=go GO_FLAGS:=-ldflags "-s -w" # strip Go binaries @@ -13,11 +14,14 @@ ifeq "$(GOMODVENDOR)" "1" GO_FLAGS_EXTRA += -mod=vendor endif GO_BUILD:=CGO_ENABLED=$(CGO_ENABLED) $(GO) build $(GO_FLAGS) $(GO_FLAGS_EXTRA) -GO_TEST_BUILD:=CGO_ENABLED=$(CGO_ENABLED) $(GO) test $(GO_FLAGS) $(GO_FLAGS_EXTRA) -c SRCROOT=$(dir $(abspath $(firstword $(MAKEFILE_LIST)))) -# additional directories to search for rule prerequisites and targets -VPATH=$(SRCROOT) + +DELTA_TARGET=out/delta.tar.gz + +ifeq "$(DEV_BUILD)" "1" +DELTA_TARGET=out/delta-dev.tar.gz +endif # The link aliases for gcstools GCS_TOOLS=\ @@ -43,42 +47,47 @@ out/rootfs.vhd: out/rootfs.tar.gz bin/cmd/tar2ext4 gzip -f -d ./out/rootfs.tar.gz bin/cmd/tar2ext4 -vhd -i ./out/rootfs.tar -o $@ -out/rootfs.tar.gz: out/initrd.img - rm -rf rootfs-conv - mkdir rootfs-conv - gunzip -c out/initrd.img | (cd rootfs-conv && cpio -imd) - tar -zcf $@ -C rootfs-conv . - rm -rf rootfs-conv - -out/initrd.img: $(BASE) out/delta.tar.gz $(SRCROOT)/hack/catcpio.sh - $(SRCROOT)/hack/catcpio.sh "$(BASE)" out/delta.tar.gz > out/initrd.img.uncompressed - gzip -c out/initrd.img.uncompressed > $@ - rm out/initrd.img.uncompressed - out/delta.tar.gz: bin/init bin/vsockexec bin/cmd/gcs bin/cmd/gcstools bin/cmd/hooks/wait-paths Makefile @mkdir -p out rm -rf rootfs mkdir -p rootfs/bin/ - mkdir -p rootfs/info/ cp bin/init rootfs/ cp bin/vsockexec rootfs/bin/ cp bin/cmd/gcs rootfs/bin/ cp bin/cmd/gcstools rootfs/bin/ cp bin/cmd/hooks/wait-paths rootfs/bin/ for tool in $(GCS_TOOLS); do ln -s gcstools rootfs/bin/$$tool; done - git -C $(SRCROOT) rev-parse HEAD > rootfs/info/gcs.commit && \ - git -C $(SRCROOT) rev-parse --abbrev-ref HEAD > rootfs/info/gcs.branch && \ - date --iso-8601=minute --utc > rootfs/info/tar.date - $(if $(realpath $(subst .tar,.testdata.json,$(BASE))), \ - jq -r '.IMAGE_NAME' $(subst .tar,.testdata.json,$(BASE)) 2>/dev/null > rootfs/info/image.name && \ - jq -r '.DATETIME' $(subst .tar,.testdata.json,$(BASE)) 2>/dev/null > rootfs/info/build.date ) + git -C $(SRCROOT) rev-parse HEAD > rootfs/gcs.commit && \ + git -C $(SRCROOT) rev-parse --abbrev-ref HEAD > rootfs/gcs.branch tar -zcf $@ -C rootfs . rm -rf rootfs +# This target includes utilities which may be useful for testing purposes. +out/delta-dev.tar.gz: out/delta.tar.gz bin/internal/tools/snp-report + rm -rf rootfs-dev + mkdir rootfs-dev + tar -xzf out/delta.tar.gz -C rootfs-dev + cp bin/internal/tools/snp-report rootfs-dev/bin/ + tar -zcf $@ -C rootfs-dev . + rm -rf rootfs-dev + +out/rootfs.tar.gz: out/initrd.img + rm -rf rootfs-conv + mkdir rootfs-conv + gunzip -c out/initrd.img | (cd rootfs-conv && cpio -imd) + tar -zcf $@ -C rootfs-conv . + rm -rf rootfs-conv + +out/initrd.img: $(BASE) $(DELTA_TARGET) $(SRCROOT)/hack/catcpio.sh + $(SRCROOT)/hack/catcpio.sh "$(BASE)" $(DELTA_TARGET) > out/initrd.img.uncompressed + gzip -c out/initrd.img.uncompressed > $@ + rm out/initrd.img.uncompressed + -include deps/cmd/gcs.gomake -include deps/cmd/gcstools.gomake -include deps/cmd/hooks/wait-paths.gomake -include deps/cmd/tar2ext4.gomake +-include deps/internal/tools/snp-report.gomake # Implicit rule for includes that define Go targets. %.gomake: $(SRCROOT)/Makefile @@ -92,6 +101,8 @@ out/delta.tar.gz: bin/init bin/vsockexec bin/cmd/gcs bin/cmd/gcstools bin/cmd/ho @/bin/echo -e '-include $(@:%.gomake=%.godeps)' >> $@.new mv $@.new $@ +VPATH=$(SRCROOT) + bin/vsockexec: vsockexec/vsockexec.o vsockexec/vsock.o @mkdir -p bin $(CC) $(LDFLAGS) -o $@ $^ diff --git a/scripts/Test-Functional.ps1 b/scripts/Test-Functional.ps1 new file mode 100644 index 0000000000..91569c755c --- /dev/null +++ b/scripts/Test-Functional.ps1 @@ -0,0 +1,62 @@ +# ex: .\scripts\Test-Functional.ps1 -Count 2 -BenchTime "2x" + +[CmdletBinding()] +param ( + [ValidateSet('Test', 'Bench', 'List')] + [alias('a')] + [string] + $Action = 'Bench', + + [string] + $Note = '', + + [string] + $OutDirectory = '.\test\results', + + # test parameters + [int] + $Count = 1, + + [string] + $BenchTime = '5s', + + [string] + $Timeout = '10m', + + [alias('tv')] + [switch] + $TestVerbose, + + [string] + $Run = '', + + [string] + $Feature = '' +) + +Import-Module ( Join-Path $PSScriptRoot Testing.psm1 ) -Force + +$date = Get-Date +$testcmd, $out = New-TestCommand ` + -Action $Action ` + -Path .\bin\test\functional.exe ` + -Name functional ` + -OutDirectory $OutDirectory ` + -Date $date ` + -Note $Note ` + -TestVerbose:$TestVerbose ` + -Count $Count ` + -BenchTime $BenchTime ` + -Timeout $Timeout ` + -Run $Run ` + -Feature $Feature ` + -Verbose:$Verbose + +Invoke-TestCommand ` + -TestCmd $testcmd ` + -OutputFile $out ` + -OutputCmd (&{ if ( $Action -eq 'Bench' ) { 'benchstat' } }) ` + -Preamble ` + -Date $Date ` + -Note $Note ` + -Verbose:$Verbose diff --git a/scripts/Test-LCOW-UVM.ps1 b/scripts/Test-LCOW-UVM.ps1 new file mode 100644 index 0000000000..5ffcea8c53 --- /dev/null +++ b/scripts/Test-LCOW-UVM.ps1 @@ -0,0 +1,143 @@ +#ex: .\scripts\Test-LCOW-UVM.ps1 -vb -Action Bench -BootFilesPath C:\ContainerPlat\LinuxBootFiles\ -MountGCSTest -Count 2 -Benchtime '3s' +# benchstat via `go install golang.org/x/perf/cmd/benchstat@latest` + +[CmdletBinding()] +param ( + [ValidateSet('Test', 'Bench', 'List', 'Shell')] + [alias('a')] + [string] + $Action = 'Bench', + + [string] + $Note = '', + + # test parameters + [int] + $Count = 1, + + [string] + $BenchTime = '5s', + + [string] + $Timeout = '10m', + + [alias('tv')] + [switch] + $TestVerbose, + + [string] + $Run = '', + + [string] + $CodePath = '.', + + [string] + $OutDirectory = '.\test\results', + + # uvm parameters + [string] + $BootFilesPath = 'C:\ContainerPlat\LinuxBootFiles', + + [switch] + $DisableTimeSync, + + [string] + $RootfsMount = '/run/rootfs', + + [string] + $RootfsPath = (Join-Path $BootFilesPath 'rootfs.vhd'), + # $RootfsPath = "C:\ContainerPlatData\root\io.containerd.snapshotter.v1.windows-lcow\snapshots\2\layer.vhd", + + [string] + $GCSTestMount = '/run/bin', + + [string] + $GCSTestPath = '.\bin\test\gcstest', + + [switch] + $MountGCSTest, + + [string] + $Feature = '' +) + +Import-Module ( Join-Path $PSScriptRoot Testing.psm1 ) -Force + +$CodePath = Resolve-Path $CodePath +$OutDirectory = Resolve-Path $OutDirectory +$BootFilesPath = Resolve-Path $BootFilesPath +$RootfsPath = Resolve-Path $RootfsPath +$GCSTestPath = Resolve-Path $GCSTestPath + +$shell = ( $Action -eq 'Shell' ) + +if ( $shell ) { + $cmd = 'ash' +} else { + $date = Get-Date + $waitfiles = "$RootfsMount" + $gcspath = 'gcstest' + if ( $MountGCSTest ) { + $waitfiles += ",$GCSTestMount" + $gcspath = "$GCSTestMount/gcstest" + } + + $pre = "wait-paths -p $waitfiles -t 5 ; " + ` + 'echo nproc: `$(nproc) ; ' + ` + 'echo kernel: `$(uname -a) ; ' + ` + 'echo gcs.commit: `$(cat /info/gcs.commit 2>/dev/null) ; ' + ` + 'echo gcs.branch: `$(cat /info/gcs.branch 2>/dev/null) ; ' + ` + 'echo tar.date: `$(cat /info/tar.date 2>/dev/null) ; ' + ` + 'echo image.name: `$(cat /info/image.name 2>/dev/null) ; ' + ` + 'echo build.date: `$(cat /info/build.date 2>/dev/null) ; ' + + $testcmd, $out = New-TestCommand ` + -Action $Action ` + -Path $gcspath ` + -Name gcstest ` + -OutDirectory $OutDirectory ` + -Date $date ` + -Note $Note ` + -TestVerbose:$TestVerbose ` + -Count $Count ` + -BenchTime $BenchTime ` + -Timeout $Timeout ` + -Run $Run ` + -Feature $Feature ` + -Verbose:$Verbose + + $testcmd += " `'-rootfs-path=$RootfsMount`' " + $cmd = $pre + $testcmd +} + +$boot = '.\bin\tools\uvmboot.exe -gcs lcow ' + ` + '-fwd-stdout -fwd-stderr -output-handling stdout ' + ` + "-boot-files-path $BootFilesPath " + ` + '-root-fs-type vhd ' + ` + '-kernel-file vmlinux ' + ` + "-security-policy=`"`" " + ` + "-mount `"$RootfsPath,$RootfsMount`" " + +if ( $MountGCSTest ) { + $boot += "-share `"$GCSTestPath,$GCSTestMount`" " +} + +if ( $DisableTimeSync ) { + $boot += ' -disable-time-sync ' +} + +if ( $shell ) { + $boot += ' -t ' +} + +$boot += " -exec `"$cmd`" " + +Invoke-TestCommand ` + -TestCmd $boot ` + -TestCmdPreamble $testcmd ` + -OutputFile (&{ if ( $Action -ne 'Shell' ) { $out } }) ` + -OutputCmd (&{ if ( $Action -eq 'Bench' ) { 'benchstat' } }) ` + -Preamble ` + -Date $Date ` + -Note $Note ` + -Verbose:$Verbose diff --git a/scripts/Testing.psm1 b/scripts/Testing.psm1 new file mode 100644 index 0000000000..3b79edc710 --- /dev/null +++ b/scripts/Testing.psm1 @@ -0,0 +1,144 @@ +function New-TestCommand { + [CmdletBinding()] + param ( + [ValidateSet('Test', 'Bench', 'List')] + [alias('a')] + [string] + $Action = 'Bench', + + [Parameter(Mandatory)] + [string] + $Path, + + [Parameter(Mandatory)] + [string] + $Name, + + [Parameter(Mandatory)] + [string] + $OutDirectory , + + [DateTime] + $Date = (Get-Date), + + [string] + $Note = '', + + # test parameters + [alias('tv')] + [switch] + $TestVerbose = $false, + + [int] + $Count = 1, + + [string] + $BenchTime = '5s', + + [string] + $Timeout = '10m', + + [string] + $Run = '', + + [string] + $Feature = '' + ) + + $OutDirectory = Resolve-Path $OutDirectory + Write-Verbose "creating $OutDirectory" + + New-Item -ItemType 'directory' -Path $OutDirectory -Force > $null + + $testcmd = "$Path `'-test.timeout=$Timeout`' `'-test.shuffle=on`' `'-test.count=$Count`' " + + if ( $TestVerbose ) { + $testcmd += ' ''-test.v'' ' + } + + switch ( $Action ) { + 'List' { + if ( $Run -eq '' ) { + $Run = '.' + } + $testcmd += " `'-test.list=$Run`' " + } + 'Test' { + if ( $Run -ne '' ) { + $testcmd += " `'-test.run=$Run`' " + } + } + 'Bench' { + if ( $Run -eq '' ) { + $Run = '.' + } + $testcmd += ' ''-test.run=^#'' ''-test.benchmem'' ' + ` + " `'-test.bench=$Run`' `'-test.benchtime=$BenchTime`' " + } + } + + if ( $Feature -ne '' ) { + $testcmd += " `'-feature=$Feature`' " + } + + $f = $Name + '-' + $Action + if ($Note -ne '' ) { + $f += '-' + $Note + } + $out = Join-Path $OutDirectory "$f-$(Get-Date -Date $date -Format FileDateTime).txt" + + return $testcmd, $out +} + +function Invoke-TestCommand { + [CmdletBinding()] + param ( + [Parameter(Mandatory)] + [string] + $TestCmd, + + [string] + $TestCmdPreamble = $TestCmd, + + [string] + $OutputFile = 'nul', + + [string] + $OutputCmd, + + [switch] + $Preamble, + + [DateTime] + $Date = (Get-Date), + + [string] + $Note + ) + + if ($OutputFile -eq '' ) { + $OutputFile = 'nul' + } + + Write-Verbose "Saving output to: $OutputFile" + if ( $Preamble ) { + & { + Write-Output "test.date: $(Get-Date -Date $Date -UFormat '%FT%R%Z' -AsUTC)" + if ( $Note -ne '' ) { + Write-Output "note: $Note" + } + Write-Output "test.command: $TestCmdPreamble" + Write-Output "pkg.commit: $(git rev-parse HEAD)" + } | Tee-Object -Append -FilePath $OutputFile + } + + Write-Verbose "Running command: $TestCmd" + Invoke-Expression $TestCmd | Tee-Object -Append -FilePath $OutputFile + + if ( $OutputCmd -ne '' -and $OutputFile -ne 'nul' ) { + $oc = "$OutputCmd $OutputFile" + Write-Verbose "Running command: $oc" + Invoke-Expression $oc + } + +} \ No newline at end of file diff --git a/test/cri-containerd/clone_test.go b/test/cri-containerd/clone_test.go index 1da12e4903..44c0e292ec 100644 --- a/test/cri-containerd/clone_test.go +++ b/test/cri-containerd/clone_test.go @@ -14,7 +14,7 @@ import ( "github.com/Microsoft/hcsshim/osversion" "github.com/Microsoft/hcsshim/pkg/annotations" - testutilities "github.com/Microsoft/hcsshim/test/functional/utilities" + "github.com/Microsoft/hcsshim/test/internal/require" runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" ) @@ -240,7 +240,7 @@ func cleanupContainer(t *testing.T, client runtime.RuntimeServiceClient, ctx con // cloned container from that template. func Test_CloneContainer_WCOW(t *testing.T) { requireFeatures(t, featureWCOWHypervisor) - testutilities.RequiresBuild(t, osversion.V20H2) + require.Build(t, osversion.V20H2) ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -265,7 +265,7 @@ func Test_CloneContainer_WCOW(t *testing.T) { // A test for creating multiple clones(3 clones) from one template container. func Test_MultiplClonedContainers_WCOW(t *testing.T) { requireFeatures(t, featureWCOWHypervisor) - testutilities.RequiresBuild(t, osversion.V20H2) + require.Build(t, osversion.V20H2) ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -302,7 +302,7 @@ func Test_MultiplClonedContainers_WCOW(t *testing.T) { // container. func Test_NormalContainerInClonedPod_WCOW(t *testing.T) { requireFeatures(t, featureWCOWHypervisor) - testutilities.RequiresBuild(t, osversion.V20H2) + require.Build(t, osversion.V20H2) ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -342,7 +342,7 @@ func Test_NormalContainerInClonedPod_WCOW(t *testing.T) { // of those pods. func Test_CloneContainersWithClonedPodPool_WCOW(t *testing.T) { requireFeatures(t, featureWCOWHypervisor) - testutilities.RequiresBuild(t, osversion.V20H2) + require.Build(t, osversion.V20H2) ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -390,7 +390,7 @@ func Test_CloneContainersWithClonedPodPool_WCOW(t *testing.T) { func Test_ClonedContainerRunningAfterDeletingTemplate(t *testing.T) { requireFeatures(t, featureWCOWHypervisor) - testutilities.RequiresBuild(t, osversion.V20H2) + require.Build(t, osversion.V20H2) ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -424,7 +424,7 @@ func Test_ClonedContainerRunningAfterDeletingTemplate(t *testing.T) { // can be made from each of them simultaneously. func Test_MultipleTemplateAndClones_WCOW(t *testing.T) { requireFeatures(t, featureWCOWHypervisor) - testutilities.RequiresBuild(t, osversion.V20H2) + require.Build(t, osversion.V20H2) ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -467,7 +467,7 @@ func Test_MultipleTemplateAndClones_WCOW(t *testing.T) { // and verifies that the request correctly fails with an error. func Test_VerifyCloneAndTemplateConfig(t *testing.T) { requireFeatures(t, featureWCOWHypervisor) - testutilities.RequiresBuild(t, osversion.V20H2) + require.Build(t, osversion.V20H2) ctx, cancel := context.WithCancel(context.Background()) defer cancel() diff --git a/test/cri-containerd/container_downlevel_test.go b/test/cri-containerd/container_downlevel_test.go index 6bee88adf6..d9f5e748bb 100644 --- a/test/cri-containerd/container_downlevel_test.go +++ b/test/cri-containerd/container_downlevel_test.go @@ -7,13 +7,13 @@ import ( "testing" "github.com/Microsoft/hcsshim/osversion" - testutilities "github.com/Microsoft/hcsshim/test/functional/utilities" + "github.com/Microsoft/hcsshim/test/internal/require" runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" ) func Test_CreateContainer_DownLevel_WCOW_Hypervisor(t *testing.T) { requireFeatures(t, featureWCOWHypervisor) - testutilities.RequiresBuild(t, osversion.V19H1) + require.Build(t, osversion.V19H1) pullRequiredImages(t, []string{imageWindowsNanoserver17763}) diff --git a/test/cri-containerd/container_layers_packing_test.go b/test/cri-containerd/container_layers_packing_test.go index 89a64bbb02..01043311bd 100644 --- a/test/cri-containerd/container_layers_packing_test.go +++ b/test/cri-containerd/container_layers_packing_test.go @@ -11,7 +11,7 @@ import ( "github.com/Microsoft/hcsshim/osversion" "github.com/Microsoft/hcsshim/pkg/annotations" - testutilities "github.com/Microsoft/hcsshim/test/functional/utilities" + "github.com/Microsoft/hcsshim/test/internal/require" ) const ( @@ -38,7 +38,7 @@ func validateTargets(ctx context.Context, t *testing.T, deviceNumber int, podID } func Test_Container_Layer_Packing_On_VPMem(t *testing.T) { - testutilities.RequiresBuild(t, osversion.V19H1) + require.Build(t, osversion.V19H1) client := newTestRuntimeClient(t) ctx, cancel := context.WithCancel(context.Background()) @@ -93,7 +93,7 @@ func Test_Container_Layer_Packing_On_VPMem(t *testing.T) { } func Test_Many_Container_Layers_Supported_On_VPMem(t *testing.T) { - testutilities.RequiresBuild(t, osversion.V19H1) + require.Build(t, osversion.V19H1) client := newTestRuntimeClient(t) ctx, cancel := context.WithCancel(context.Background()) @@ -124,7 +124,7 @@ func Test_Many_Container_Layers_Supported_On_VPMem(t *testing.T) { } func Test_Annotation_Disable_Multi_Mapping(t *testing.T) { - testutilities.RequiresBuild(t, osversion.V19H1) + require.Build(t, osversion.V19H1) client := newTestRuntimeClient(t) ctx, cancel := context.WithCancel(context.Background()) diff --git a/test/cri-containerd/container_update_test.go b/test/cri-containerd/container_update_test.go index ccfdc8bb8d..592391af28 100644 --- a/test/cri-containerd/container_update_test.go +++ b/test/cri-containerd/container_update_test.go @@ -10,7 +10,7 @@ import ( "github.com/Microsoft/hcsshim/osversion" "github.com/Microsoft/hcsshim/pkg/annotations" - testutilities "github.com/Microsoft/hcsshim/test/functional/utilities" + "github.com/Microsoft/hcsshim/test/internal/require" runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" ) @@ -32,7 +32,7 @@ func calculateJobCPURate(hostProcs uint32, processorCount uint32) uint32 { } func Test_Container_UpdateResources_CPUShare(t *testing.T) { - testutilities.RequiresBuild(t, osversion.V20H2) + require.Build(t, osversion.V20H2) type config struct { name string requiredFeatures []string diff --git a/test/cri-containerd/createcontainer_test.go b/test/cri-containerd/createcontainer_test.go index 0efa1c62e3..3f68d31df1 100644 --- a/test/cri-containerd/createcontainer_test.go +++ b/test/cri-containerd/createcontainer_test.go @@ -14,7 +14,7 @@ import ( "github.com/Microsoft/go-winio" "github.com/Microsoft/hcsshim/osversion" "github.com/Microsoft/hcsshim/pkg/annotations" - testutilities "github.com/Microsoft/hcsshim/test/functional/utilities" + "github.com/Microsoft/hcsshim/test/internal/require" runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" ) @@ -844,7 +844,7 @@ func Test_CreateContainer_CPUShares_LCOW(t *testing.T) { func Test_CreateContainer_Mount_File_LCOW(t *testing.T) { requireFeatures(t, featureLCOW) - testutilities.RequiresBuild(t, osversion.V19H1) + require.Build(t, osversion.V19H1) pullRequiredLCOWImages(t, []string{imageLcowK8sPause, imageLcowAlpine}) @@ -889,7 +889,7 @@ func Test_CreateContainer_Mount_File_LCOW(t *testing.T) { func Test_CreateContainer_Mount_ReadOnlyFile_LCOW(t *testing.T) { requireFeatures(t, featureLCOW) - testutilities.RequiresBuild(t, osversion.V19H1) + require.Build(t, osversion.V19H1) pullRequiredLCOWImages(t, []string{imageLcowK8sPause, imageLcowAlpine}) diff --git a/test/cri-containerd/main_test.go b/test/cri-containerd/main_test.go index 5e0a5468aa..eaa17f56c2 100644 --- a/test/cri-containerd/main_test.go +++ b/test/cri-containerd/main_test.go @@ -14,8 +14,7 @@ import ( "time" "github.com/Microsoft/hcsshim/osversion" - _ "github.com/Microsoft/hcsshim/test/functional/manifest" - testutilities "github.com/Microsoft/hcsshim/test/functional/utilities" + testutilities "github.com/Microsoft/hcsshim/test/internal" "github.com/containerd/containerd" eventtypes "github.com/containerd/containerd/api/events" eventsapi "github.com/containerd/containerd/api/services/events/v1" @@ -25,6 +24,8 @@ import ( "github.com/gogo/protobuf/types" "google.golang.org/grpc" runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" + + _ "github.com/Microsoft/hcsshim/test/internal/manifest" ) const ( diff --git a/test/cri-containerd/runpodsandbox_test.go b/test/cri-containerd/runpodsandbox_test.go index 515ab9765e..fa795926ab 100644 --- a/test/cri-containerd/runpodsandbox_test.go +++ b/test/cri-containerd/runpodsandbox_test.go @@ -22,7 +22,8 @@ import ( "github.com/Microsoft/hcsshim/internal/shimdiag" "github.com/Microsoft/hcsshim/osversion" "github.com/Microsoft/hcsshim/pkg/annotations" - testutilities "github.com/Microsoft/hcsshim/test/functional/utilities" + "github.com/Microsoft/hcsshim/test/internal/require" + testuvm "github.com/Microsoft/hcsshim/test/internal/uvm" "github.com/containerd/containerd/log" "golang.org/x/sys/windows" runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" @@ -982,7 +983,7 @@ func Test_RunPodSandbox_Mount_SandboxDir_NoShare_WCOW(t *testing.T) { } func Test_RunPodSandbox_CPUGroup(t *testing.T) { - testutilities.RequiresBuild(t, osversion.V21H1) + require.Build(t, osversion.V21H1) ctx := context.Background() presentID := "FA22A12C-36B3-486D-A3E9-BC526C2B450B" @@ -1062,7 +1063,7 @@ func createExt4VHD(ctx context.Context, t *testing.T, path string) { log.L.Logger.SetOutput(io.Discard) defer log.L.Logger.SetOutput(origLogOut) } - uvm := testutilities.CreateLCOWUVM(ctx, t, t.Name()+"-createExt4VHD") + uvm := testuvm.CreateAndStartLCOW(ctx, t, t.Name()+"-createExt4VHD") defer uvm.Close() if err := lcow.CreateScratch(ctx, uvm, path, 2, ""); err != nil { diff --git a/test/functional/lcow_bench_test.go b/test/functional/lcow_bench_test.go new file mode 100644 index 0000000000..79950d6e8b --- /dev/null +++ b/test/functional/lcow_bench_test.go @@ -0,0 +1,101 @@ +//go:build windows && functional +// +build windows,functional + +package functional + +import ( + "context" + "testing" + + "github.com/Microsoft/hcsshim/osversion" + + "github.com/Microsoft/hcsshim/test/internal/require" + "github.com/Microsoft/hcsshim/test/internal/uvm" +) + +func BenchmarkLCOW_UVM_Create(b *testing.B) { + requireFeatures(b, featureLCOW) + require.Build(b, osversion.RS5) + + ctx := context.Background() + + b.StopTimer() + b.ResetTimer() + for i := 0; i < b.N; i++ { + opts := defaultLCOWOptions(b, b.Name()) + + b.StartTimer() + vm := uvm.CreateLCOW(ctx, b, opts) + b.StopTimer() + + // vm.Close() hangs unless the vm was started + cleanup := uvm.Start(ctx, b, vm) + cleanup() + } +} + +func BenchmarkLCOW_UVM_Start(b *testing.B) { + requireFeatures(b, featureLCOW) + require.Build(b, osversion.RS5) + + ctx := context.Background() + + b.StopTimer() + b.ResetTimer() + for i := 0; i < b.N; i++ { + vm := uvm.CreateLCOW(ctx, b, defaultLCOWOptions(b, b.Name())) + + b.StartTimer() + if err := vm.Start(ctx); err != nil { + b.Fatalf("could not start UVM: %v", err) + } + b.StopTimer() + + vm.Close() + } +} + +func BenchmarkLCOW_UVM_Kill(b *testing.B) { + requireFeatures(b, featureLCOW) + require.Build(b, osversion.RS5) + + ctx := context.Background() + + b.StopTimer() + b.ResetTimer() + for i := 0; i < b.N; i++ { + vm := uvm.CreateLCOW(ctx, b, defaultLCOWOptions(b, b.Name())) + cleanup := uvm.Start(ctx, b, vm) + + b.StartTimer() + uvm.Kill(ctx, b, vm) + if err := vm.Wait(); err != nil { + b.Fatalf("could not kill uvm %q: %v", vm.ID(), err) + } + b.StopTimer() + + cleanup() + } +} + +func BenchmarkLCOW_UVM_Close(b *testing.B) { + requireFeatures(b, featureLCOW) + require.Build(b, osversion.RS5) + + ctx := context.Background() + + b.StopTimer() + b.ResetTimer() + for i := 0; i < b.N; i++ { + vm := uvm.CreateLCOW(ctx, b, defaultLCOWOptions(b, b.Name())) + cleanup := uvm.Start(ctx, b, vm) + + b.StartTimer() + if err := vm.Close(); err != nil { + b.Fatalf("could not kill uvm %q: %v", vm.ID(), err) + } + b.StopTimer() + + cleanup() + } +} diff --git a/test/functional/lcow_container_bench_test.go b/test/functional/lcow_container_bench_test.go new file mode 100644 index 0000000000..88bddc71ab --- /dev/null +++ b/test/functional/lcow_container_bench_test.go @@ -0,0 +1,229 @@ +//go:build windows && functional +// +build windows,functional + +package functional + +import ( + "context" + "strings" + "testing" + + ctrdoci "github.com/containerd/containerd/oci" + cri_util "github.com/containerd/containerd/pkg/cri/util" + + "github.com/Microsoft/hcsshim/internal/hcsoci" + "github.com/Microsoft/hcsshim/internal/resources" + "github.com/Microsoft/hcsshim/osversion" + + "github.com/Microsoft/hcsshim/test/internal/cmd" + "github.com/Microsoft/hcsshim/test/internal/constants" + "github.com/Microsoft/hcsshim/test/internal/container" + "github.com/Microsoft/hcsshim/test/internal/containerd" + "github.com/Microsoft/hcsshim/test/internal/layers" + "github.com/Microsoft/hcsshim/test/internal/oci" + "github.com/Microsoft/hcsshim/test/internal/require" + "github.com/Microsoft/hcsshim/test/internal/uvm" +) + +func BenchmarkLCOW_Container(b *testing.B) { + requireFeatures(b, featureLCOW, featureContainer) + require.Build(b, osversion.RS5) + + ctx, _, client := newContainerdClient(context.Background(), b) + cid := containerd.PullImage(ctx, b, client, constants.ImageLinuxAlpineLatest, constants.PlatformLinux) + ls := layers.FromChainID(ctx, b, client, cid, constants.SnapshotterLinux) + + // Create a new uvm per benchmark in case any left over state lingers + + b.Run("Create", func(b *testing.B) { + vmID := strings.ReplaceAll(b.Name(), "/", "") + opts := defaultLCOWOptions(b, vmID) + cache := layers.CacheFile(ctx, b, "") + vm := uvm.CreateAndStartLCOWFromOpts(ctx, b, opts) + uvm.SetSecurityPolicy(ctx, b, vm, "") + + b.StopTimer() + b.ResetTimer() + for i := 0; i < b.N; i++ { + id := cri_util.GenerateID() + scratch, _ := layers.ScratchSpace(ctx, b, vm, "", "", cache) + spec := oci.CreateLinuxSpec(ctx, b, id, + oci.DefaultLinuxSpecOpts(id, + ctrdoci.WithProcessArgs("/bin/sh", "-c", "true"), + oci.WithWindowsLayerFolders(append(ls, scratch)))...) + + co := &hcsoci.CreateOptions{ + ID: id, + HostingSystem: vm, + Owner: hcsOwner, + Spec: spec, + // dont create a network namespace on the host side + NetworkNamespace: "", + } + + b.StartTimer() + c, r, err := hcsoci.CreateContainer(ctx, co) + if err != nil { + b.Fatalf("could not create container %q: %v", co.ID, err) + } + b.StopTimer() + + // container creations launches gorountines on the guest that do + // not finish until the init process has terminated. + // so start the container, then clean everything up + init := container.Start(ctx, b, c, nil) + cmd.WaitExitCode(ctx, b, init, 0) + + container.Kill(ctx, b, c) + container.Wait(ctx, b, c) + if err := resources.ReleaseResources(ctx, r, vm, true); err != nil { + b.Errorf("failed to release container resources: %v", err) + } + if err := c.Close(); err != nil { + b.Errorf("could not close container %q: %v", c.ID(), err) + } + } + }) + + b.Run("Start", func(b *testing.B) { + vmID := strings.ReplaceAll(b.Name(), "/", "") + opts := defaultLCOWOptions(b, vmID) + cache := layers.CacheFile(ctx, b, "") + vm := uvm.CreateAndStartLCOWFromOpts(ctx, b, opts) + uvm.SetSecurityPolicy(ctx, b, vm, "") + + b.StopTimer() + b.ResetTimer() + for i := 0; i < b.N; i++ { + id := cri_util.GenerateID() + scratch, _ := layers.ScratchSpace(ctx, b, vm, "", "", cache) + spec := oci.CreateLinuxSpec(ctx, b, id, + oci.DefaultLinuxSpecOpts(id, + ctrdoci.WithProcessArgs("/bin/sh", "-c", "true"), + oci.WithWindowsLayerFolders(append(ls, scratch)))...) + + c, _, cleanup := container.Create(ctx, b, vm, spec, id, hcsOwner) + + b.StartTimer() + if err := c.Start(ctx); err != nil { + b.Fatalf("could not start %q: %v", c.ID(), err) + } + b.StopTimer() + + init := cmd.Create(ctx, b, c, nil, nil) + cmd.Start(ctx, b, init) + cmd.WaitExitCode(ctx, b, init, 0) + + container.Kill(ctx, b, c) + container.Wait(ctx, b, c) + cleanup() + } + }) + + b.Run("InitExec", func(b *testing.B) { + vmID := strings.ReplaceAll(b.Name(), "/", "") + opts := defaultLCOWOptions(b, vmID) + cache := layers.CacheFile(ctx, b, "") + vm := uvm.CreateAndStartLCOWFromOpts(ctx, b, opts) + uvm.SetSecurityPolicy(ctx, b, vm, "") + + b.StopTimer() + b.ResetTimer() + for i := 0; i < b.N; i++ { + id := cri_util.GenerateID() + scratch, _ := layers.ScratchSpace(ctx, b, vm, "", "", cache) + spec := oci.CreateLinuxSpec(ctx, b, id, + oci.DefaultLinuxSpecOpts(id, + ctrdoci.WithProcessArgs("/bin/sh", "-c", oci.TailNullArgs), + oci.WithWindowsLayerFolders(append(ls, scratch)))...) + + c, _, cleanup := container.Create(ctx, b, vm, spec, id, hcsOwner) + if err := c.Start(ctx); err != nil { + b.Fatalf("could not start %q: %v", c.ID(), err) + } + init := cmd.Create(ctx, b, c, nil, nil) + + b.StartTimer() + cmd.Start(ctx, b, init) + b.StopTimer() + + cmd.Kill(ctx, b, init) + cmd.WaitExitCode(ctx, b, init, 137) + + container.Kill(ctx, b, c) + container.Wait(ctx, b, c) + cleanup() + } + }) + + b.Run("InitExecKill", func(b *testing.B) { + vmID := strings.ReplaceAll(b.Name(), "/", "") + opts := defaultLCOWOptions(b, vmID) + cache := layers.CacheFile(ctx, b, "") + vm := uvm.CreateAndStartLCOWFromOpts(ctx, b, opts) + uvm.SetSecurityPolicy(ctx, b, vm, "") + + b.StopTimer() + b.ResetTimer() + for i := 0; i < b.N; i++ { + id := cri_util.GenerateID() + scratch, _ := layers.ScratchSpace(ctx, b, vm, "", "", cache) + spec := oci.CreateLinuxSpec(ctx, b, id, + oci.DefaultLinuxSpecOpts(id, + ctrdoci.WithProcessArgs("/bin/sh", "-c", oci.TailNullArgs), + oci.WithWindowsLayerFolders(append(ls, scratch)))...) + + c, _, cleanup := container.Create(ctx, b, vm, spec, id, hcsOwner) + init := container.Start(ctx, b, c, nil) + + b.StartTimer() + cmd.Kill(ctx, b, init) + cmd.WaitExitCode(ctx, b, init, 137) + b.StopTimer() + + container.Kill(ctx, b, c) + container.Wait(ctx, b, c) + cleanup() + } + }) + + b.Run("ContainerKill", func(b *testing.B) { + vmID := strings.ReplaceAll(b.Name(), "/", "") + opts := defaultLCOWOptions(b, vmID) + cache := layers.CacheFile(ctx, b, "") + vm := uvm.CreateAndStartLCOWFromOpts(ctx, b, opts) + uvm.SetSecurityPolicy(ctx, b, vm, "") + + b.StopTimer() + b.ResetTimer() + for i := 0; i < b.N; i++ { + id := cri_util.GenerateID() + scratch, _ := layers.ScratchSpace(ctx, b, vm, "", "", cache) + spec := oci.CreateLinuxSpec(ctx, b, id, + oci.DefaultLinuxSpecOpts(id, + ctrdoci.WithProcessArgs("/bin/sh", "-c", "true"), + oci.WithWindowsLayerFolders(append(ls, scratch)))...) + + c, _, cleanup := container.Create(ctx, b, vm, spec, id, hcsOwner) + + // (c container).Wait() waits until the gc receives a notification message from + // the guest (via the bridge) that the container exited. + // The Linux guest starts a goroutine to send that notification (bridge_v2.go:createContainerV2) + // That goroutine, in turn, waits on the init process, which does not unblock until it has + // been waited on (usually via a WaitForProcess request) and had its exit code read + // (hcsv2/process.go:(*containerProcess).Wait). + // + // So ... to test container kill and wait times, we need to first start and wait on the init process + init := container.Start(ctx, b, c, nil) + cmd.WaitExitCode(ctx, b, init, 0) + + b.StartTimer() + container.Kill(ctx, b, c) + container.Wait(ctx, b, c) + b.StopTimer() + + cleanup() + } + }) + +} diff --git a/test/functional/lcow_container_test.go b/test/functional/lcow_container_test.go new file mode 100644 index 0000000000..6a12705c8d --- /dev/null +++ b/test/functional/lcow_container_test.go @@ -0,0 +1,178 @@ +//go:build windows && functional +// +build windows,functional + +package functional + +import ( + "context" + "strings" + "testing" + + ctrdoci "github.com/containerd/containerd/oci" + + "github.com/Microsoft/hcsshim/osversion" + + "github.com/Microsoft/hcsshim/test/internal/cmd" + "github.com/Microsoft/hcsshim/test/internal/constants" + "github.com/Microsoft/hcsshim/test/internal/container" + "github.com/Microsoft/hcsshim/test/internal/containerd" + "github.com/Microsoft/hcsshim/test/internal/layers" + "github.com/Microsoft/hcsshim/test/internal/oci" + "github.com/Microsoft/hcsshim/test/internal/require" + "github.com/Microsoft/hcsshim/test/internal/uvm" +) + +func TestLCOW_ContainerLifecycle(t *testing.T) { + requireFeatures(t, featureLCOW, featureContainer) + require.Build(t, osversion.RS5) + + ctx, _, client := newContainerdClient(context.Background(), t) + cid := containerd.PullImage(ctx, t, client, constants.ImageLinuxAlpineLatest, constants.PlatformLinux) + ls := layers.FromChainID(ctx, t, client, cid, constants.SnapshotterLinux) + + opts := defaultLCOWOptions(t, t.Name()) + vm := uvm.CreateAndStartLCOWFromOpts(ctx, t, opts) + uvm.SetSecurityPolicy(ctx, t, vm, "") + + scratch, _ := layers.ScratchSpace(ctx, t, vm, "", "", "") + + spec := oci.CreateLinuxSpec(ctx, t, t.Name(), + oci.DefaultLinuxSpecOpts("", + ctrdoci.WithProcessArgs("/bin/sh", "-c", oci.TailNullArgs), + oci.WithWindowsLayerFolders(append(ls, scratch)))...) + + c, _, cleanup := container.Create(ctx, t, vm, spec, t.Name(), hcsOwner) + t.Cleanup(cleanup) + + init := container.Start(ctx, t, c, nil) + t.Cleanup(func() { + container.Kill(ctx, t, c) + container.Wait(ctx, t, c) + }) + cmd.Kill(ctx, t, init) + if e := cmd.Wait(ctx, t, init); e != 137 { + t.Errorf("got exit code %d, wanted %d", e, 137) + } +} + +var ioTests = []struct { + name string + args []string + in string + want string +}{ + { + name: "true", + args: []string{"/bin/sh", "-c", "true"}, + want: "", + }, + { + name: "echo", + args: []string{"/bin/sh", "-c", `echo -n "hi y'all"`}, + want: "hi y'all", + }, + { + name: "tee", + args: []string{"/bin/sh", "-c", "tee"}, + in: "are you copying me?", + want: "are you copying me?", + }, +} + +func TestLCOW_ContainerIO(t *testing.T) { + requireFeatures(t, featureLCOW, featureContainer) + require.Build(t, osversion.RS5) + + ctx, _, client := newContainerdClient(context.Background(), t) + cid := containerd.PullImage(ctx, t, client, constants.ImageLinuxAlpineLatest, constants.PlatformLinux) + ls := layers.FromChainID(ctx, t, client, cid, constants.SnapshotterLinux) + + opts := defaultLCOWOptions(t, t.Name()) + cache := layers.CacheFile(ctx, t, "") + vm := uvm.CreateAndStartLCOWFromOpts(ctx, t, opts) + uvm.SetSecurityPolicy(ctx, t, vm, "") + + for _, tt := range ioTests { + t.Run(tt.name, func(t *testing.T) { + id := strings.ReplaceAll(t.Name(), "/", "") + scratch, _ := layers.ScratchSpace(ctx, t, vm, "", "", cache) + spec := oci.CreateLinuxSpec(ctx, t, id, + oci.DefaultLinuxSpecOpts(id, + ctrdoci.WithProcessArgs(tt.args...), + oci.WithWindowsLayerFolders(append(ls, scratch)))...) + + c, _, cleanup := container.Create(ctx, t, vm, spec, id, hcsOwner) + t.Cleanup(cleanup) + + io := cmd.NewBufferedIO() + if tt.in != "" { + io = cmd.NewBufferedIOFromString(tt.in) + } + init := container.Start(ctx, t, c, io) + + t.Cleanup(func() { + container.Kill(ctx, t, c) + container.Wait(ctx, t, c) + }) + + if e := cmd.Wait(ctx, t, init); e != 0 { + t.Fatalf("got exit code %d, wanted %d", e, 0) + } + + io.TestOutput(t, tt.want, nil) + }) + } +} + +func TestLCOW_ContainerExec(t *testing.T) { + requireFeatures(t, featureLCOW, featureContainer) + require.Build(t, osversion.RS5) + + ctx, _, client := newContainerdClient(context.Background(), t) + cid := containerd.PullImage(ctx, t, client, constants.ImageLinuxAlpineLatest, constants.PlatformLinux) + ls := layers.FromChainID(ctx, t, client, cid, constants.SnapshotterLinux) + + opts := defaultLCOWOptions(t, t.Name()) + vm := uvm.CreateAndStartLCOWFromOpts(ctx, t, opts) + uvm.SetSecurityPolicy(ctx, t, vm, "") + + id := strings.ReplaceAll(t.Name(), "/", "") + scratch, _ := layers.ScratchSpace(ctx, t, vm, "", "", "") + spec := oci.CreateLinuxSpec(ctx, t, id, + oci.DefaultLinuxSpecOpts(id, + ctrdoci.WithProcessArgs("/bin/sh", "-c", oci.TailNullArgs), + oci.WithWindowsLayerFolders(append(ls, scratch)))...) + + c, _, cleanup := container.Create(ctx, t, vm, spec, id, hcsOwner) + t.Cleanup(cleanup) + init := container.Start(ctx, t, c, nil) + t.Cleanup(func() { + cmd.Kill(ctx, t, init) + cmd.Wait(ctx, t, init) + container.Kill(ctx, t, c) + container.Wait(ctx, t, c) + }) + + for _, tt := range ioTests { + t.Run(tt.name, func(t *testing.T) { + ps := oci.CreateLinuxSpec(ctx, t, id, + oci.DefaultLinuxSpecOpts(id, + // oci.WithTTY, + ctrdoci.WithDefaultPathEnv, + ctrdoci.WithProcessArgs(tt.args...))..., + ).Process + io := cmd.NewBufferedIO() + if tt.in != "" { + io = cmd.NewBufferedIOFromString(tt.in) + } + p := cmd.Create(ctx, t, c, ps, io) + cmd.Start(ctx, t, p) + + if e := cmd.Wait(ctx, t, p); e != 0 { + t.Fatalf("got exit code %d, wanted %d", e, 0) + } + + io.TestOutput(t, tt.want, nil) + }) + } +} diff --git a/test/functional/lcow_test.go b/test/functional/lcow_test.go index 361518d112..b154a69a32 100644 --- a/test/functional/lcow_test.go +++ b/test/functional/lcow_test.go @@ -1,5 +1,5 @@ -//go:build functional || lcow -// +build functional lcow +//go:build windows && functional +// +build windows,functional package functional @@ -8,12 +8,13 @@ import ( "context" "fmt" "os" - "os/exec" "path/filepath" "strings" "testing" "time" + "github.com/opencontainers/runtime-spec/specs-go" + "github.com/Microsoft/hcsshim/internal/cmd" "github.com/Microsoft/hcsshim/internal/cow" "github.com/Microsoft/hcsshim/internal/hcsoci" @@ -21,50 +22,87 @@ import ( "github.com/Microsoft/hcsshim/internal/resources" "github.com/Microsoft/hcsshim/internal/uvm" "github.com/Microsoft/hcsshim/osversion" - testutilities "github.com/Microsoft/hcsshim/test/functional/utilities" + + testutilities "github.com/Microsoft/hcsshim/test/internal" + testcmd "github.com/Microsoft/hcsshim/test/internal/cmd" + "github.com/Microsoft/hcsshim/test/internal/layers" + "github.com/Microsoft/hcsshim/test/internal/require" + testuvm "github.com/Microsoft/hcsshim/test/internal/uvm" ) -// TestLCOWUVMNoSCSINoVPMemInitrd starts an LCOW utility VM without a SCSI controller and +// test if waiting after creating (but not starting) an LCOW uVM returns +func TestLCOW_UVMCreateWait(t *testing.T) { + t.Skip("closing a created-but-not-started uVM hangs indefinitely") + requireFeatures(t, featureLCOW) + require.Build(t, osversion.RS5) + + ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) + t.Cleanup(cancel) + + vm := testuvm.CreateLCOW(ctx, t, defaultLCOWOptions(t, t.Name())) + testuvm.Close(ctx, t, vm) +} + +// TestLCOW_UVMNoSCSINoVPMemInitrd starts an LCOW utility VM without a SCSI controller and // no VPMem device. Uses initrd. -func TestLCOWUVMNoSCSINoVPMemInitrd(t *testing.T) { - opts := uvm.NewDefaultOptionsLCOW(t.Name(), "") +func TestLCOW_UVMNoSCSINoVPMemInitrd(t *testing.T) { + requireFeatures(t, featureLCOW) + + opts := defaultLCOWOptions(t, t.Name()) opts.SCSIControllerCount = 0 opts.VPMemDeviceCount = 0 opts.PreferredRootFSType = uvm.PreferredRootFSTypeInitRd opts.RootFSFile = uvm.InitrdFile + opts.KernelDirect = false testLCOWUVMNoSCSISingleVPMem(t, opts, fmt.Sprintf("Command line: initrd=/%s", opts.RootFSFile)) } -// TestLCOWUVMNoSCSISingleVPMemVHD starts an LCOW utility VM without a SCSI controller and +// TestLCOW_UVMNoSCSISingleVPMemVHD starts an LCOW utility VM without a SCSI controller and // only a single VPMem device. Uses VPMEM VHD -func TestLCOWUVMNoSCSISingleVPMemVHD(t *testing.T) { - opts := uvm.NewDefaultOptionsLCOW(t.Name(), "") +func TestLCOW_UVMNoSCSISingleVPMemVHD(t *testing.T) { + requireFeatures(t, featureLCOW) + + opts := defaultLCOWOptions(t, t.Name()) opts.SCSIControllerCount = 0 opts.VPMemDeviceCount = 1 opts.PreferredRootFSType = uvm.PreferredRootFSTypeVHD opts.RootFSFile = uvm.VhdFile - testLCOWUVMNoSCSISingleVPMem(t, opts, `Command line: root=/dev/pmem0 init=/init`) + testLCOWUVMNoSCSISingleVPMem(t, opts, `Command line: root=/dev/pmem0`, `init=/init`) } -func testLCOWUVMNoSCSISingleVPMem(t *testing.T, opts *uvm.OptionsLCOW, expected string) { - testutilities.RequiresBuild(t, osversion.RS5) - lcowUVM := testutilities.CreateLCOWUVMFromOpts(context.Background(), t, opts) +func testLCOWUVMNoSCSISingleVPMem(t *testing.T, opts *uvm.OptionsLCOW, expected ...string) { + require.Build(t, osversion.RS5) + requireFeatures(t, featureLCOW) + ctx := context.Background() + + lcowUVM := testuvm.CreateAndStartLCOWFromOpts(ctx, t, opts) defer lcowUVM.Close() - out, err := exec.Command(`hcsdiag`, `exec`, `-uvm`, lcowUVM.ID(), `dmesg`).Output() // TODO: Move the CreateProcess. + + io := testcmd.NewBufferedIO() + // c := cmd.Command(lcowUVM, "dmesg") + c := testcmd.Create(ctx, t, lcowUVM, &specs.Process{Args: []string{"dmesg"}}, io) + testcmd.Run(ctx, t, c) + + out, err := io.Output() + if err != nil { - t.Fatal(string(err.(*exec.ExitError).Stderr)) + t.Fatalf("uvm exec failed with: %s", err) } - if !strings.Contains(string(out), expected) { - t.Fatalf("Expected dmesg output to have %q: %s", expected, string(out)) + + for _, s := range expected { + if !strings.Contains(out, s) { + t.Fatalf("Expected dmesg output to have %q: %s", s, out) + } } } -// TestLCOWTimeUVMStartVHD starts/terminates a utility VM booting from VPMem- +// TestLCOW_TimeUVMStartVHD starts/terminates a utility VM booting from VPMem- // attached root filesystem a number of times. -func TestLCOWTimeUVMStartVHD(t *testing.T) { - testutilities.RequiresBuild(t, osversion.RS5) +func TestLCOW_TimeUVMStartVHD(t *testing.T) { + require.Build(t, osversion.RS5) + requireFeatures(t, featureLCOW) testLCOWTimeUVMStart(t, false, uvm.PreferredRootFSTypeVHD) } @@ -72,16 +110,18 @@ func TestLCOWTimeUVMStartVHD(t *testing.T) { // TestLCOWUVMStart_KernelDirect_VHD starts/terminates a utility VM booting from // VPMem- attached root filesystem a number of times starting from the Linux // Kernel directly and skipping EFI. -func TestLCOWUVMStart_KernelDirect_VHD(t *testing.T) { - testutilities.RequiresBuild(t, 18286) +func TestLCOW_UVMStart_KernelDirect_VHD(t *testing.T) { + require.Build(t, 18286) + requireFeatures(t, featureLCOW) testLCOWTimeUVMStart(t, true, uvm.PreferredRootFSTypeVHD) } // TestLCOWTimeUVMStartInitRD starts/terminates a utility VM booting from initrd- // attached root file system a number of times. -func TestLCOWTimeUVMStartInitRD(t *testing.T) { - testutilities.RequiresBuild(t, osversion.RS5) +func TestLCOW_TimeUVMStartInitRD(t *testing.T) { + require.Build(t, osversion.RS5) + requireFeatures(t, featureLCOW) testLCOWTimeUVMStart(t, false, uvm.PreferredRootFSTypeInitRd) } @@ -89,15 +129,18 @@ func TestLCOWTimeUVMStartInitRD(t *testing.T) { // TestLCOWUVMStart_KernelDirect_InitRd starts/terminates a utility VM booting // from initrd- attached root file system a number of times starting from the // Linux Kernel directly and skipping EFI. -func TestLCOWUVMStart_KernelDirect_InitRd(t *testing.T) { - testutilities.RequiresBuild(t, 18286) +func TestLCOW_UVMStart_KernelDirect_InitRd(t *testing.T) { + require.Build(t, 18286) + requireFeatures(t, featureLCOW) testLCOWTimeUVMStart(t, true, uvm.PreferredRootFSTypeInitRd) } func testLCOWTimeUVMStart(t *testing.T, kernelDirect bool, rfsType uvm.PreferredRootFSType) { + requireFeatures(t, featureLCOW) + for i := 0; i < 3; i++ { - opts := uvm.NewDefaultOptionsLCOW(t.Name(), "") + opts := defaultLCOWOptions(t, t.Name()) opts.KernelDirect = kernelDirect opts.VPMemDeviceCount = 32 opts.PreferredRootFSType = rfsType @@ -108,36 +151,39 @@ func testLCOWTimeUVMStart(t *testing.T, kernelDirect bool, rfsType uvm.Preferred opts.RootFSFile = uvm.VhdFile } - lcowUVM := testutilities.CreateLCOWUVMFromOpts(context.Background(), t, opts) + lcowUVM := testuvm.CreateAndStartLCOWFromOpts(context.Background(), t, opts) lcowUVM.Close() } } func TestLCOWSimplePodScenario(t *testing.T) { t.Skip("Doesn't work quite yet") - testutilities.RequiresBuild(t, osversion.RS5) - alpineLayers := testutilities.LayerFolders(t, "alpine") - cacheDir := testutilities.CreateTempDir(t) + require.Build(t, osversion.RS5) + requireFeatures(t, featureLCOW, featureContainer) + + alpineLayers := layers.LayerFolders(t, "alpine") + + cacheDir := t.TempDir() defer os.RemoveAll(cacheDir) cacheFile := filepath.Join(cacheDir, "cache.vhdx") // This is what gets mounted into /tmp/scratch - uvmScratchDir := testutilities.CreateTempDir(t) + uvmScratchDir := t.TempDir() defer os.RemoveAll(uvmScratchDir) uvmScratchFile := filepath.Join(uvmScratchDir, "uvmscratch.vhdx") // Scratch for the first container - c1ScratchDir := testutilities.CreateTempDir(t) + c1ScratchDir := t.TempDir() defer os.RemoveAll(c1ScratchDir) c1ScratchFile := filepath.Join(c1ScratchDir, "sandbox.vhdx") // Scratch for the second container - c2ScratchDir := testutilities.CreateTempDir(t) + c2ScratchDir := t.TempDir() defer os.RemoveAll(c2ScratchDir) c2ScratchFile := filepath.Join(c2ScratchDir, "sandbox.vhdx") - lcowUVM := testutilities.CreateLCOWUVM(context.Background(), t, "uvm") + lcowUVM := testuvm.CreateAndStartLCOW(context.Background(), t, "uvm") defer lcowUVM.Close() // Populate the cache and generate the scratch file for /tmp/scratch diff --git a/test/functional/main_test.go b/test/functional/main_test.go new file mode 100644 index 0000000000..a00739aa4c --- /dev/null +++ b/test/functional/main_test.go @@ -0,0 +1,169 @@ +//go:build windows && functional + +package functional + +import ( + "context" + "flag" + "log" + "os" + "os/exec" + "strconv" + "testing" + "time" + + "github.com/containerd/containerd" + "github.com/sirupsen/logrus" + + "github.com/Microsoft/hcsshim/internal/cow" + "github.com/Microsoft/hcsshim/internal/hcsoci" + "github.com/Microsoft/hcsshim/internal/resources" + "github.com/Microsoft/hcsshim/internal/uvm" + "github.com/Microsoft/hcsshim/internal/winapi" + + testctrd "github.com/Microsoft/hcsshim/test/internal/containerd" + testflag "github.com/Microsoft/hcsshim/test/internal/flag" + "github.com/Microsoft/hcsshim/test/internal/require" + + _ "github.com/Microsoft/hcsshim/test/internal/manifest" +) + +// owner field for uVMs +const hcsOwner = "hcsshim-functional-tests" + +const ( + featureLCOW = "LCOW" + featureWCOW = "WCOW" + featureContainer = "container" + featureHostProcess = "HostProcess" + featureUVMMem = "UVMMem" + featurePlan9 = "Plan9" + featureSCSI = "SCSI" + featureScratch = "Scratch" + featureVSMB = "vSMB" + featureVPMEM = "vPMEM" +) + +var allFeatures = []string{ + featureLCOW, + featureWCOW, + featureHostProcess, + featureContainer, + featureUVMMem, + featurePlan9, + featureSCSI, + featureScratch, + featureVSMB, + featureVPMEM, +} + +// todo: use a new containerd namespace and then nuke everything in it + +var ( + debug bool + pauseDurationOnCreateContainerFailure time.Duration + + // flags + flagFeatures = testflag.NewFeatureFlag(allFeatures) + flagContainerdAddress = flag.String("ctr-address", "tcp://127.0.0.1:2376", "Address for containerd's GRPC server") + flagContainerdNamespace = flag.String("ctr-namespace", "k8s.io", "Containerd namespace") + flagCtrExePath = flag.String("ctr-path", `C:\ContainerPlat\ctr.exe`, "Path to ctr.exe") + flagLinuxBootFilesPath = flag.String("linux-bootfiles", + `C:\\ContainerPlat\\LinuxBootFiles`, + "Path to LCOW UVM boot files (rootfs.vhd, initrd.img, kernel, vmlinux)") +) + +func init() { + if !winapi.IsEvelated() { + log.Fatal("tests must be run in an elevated context") + } + + if _, ok := os.LookupEnv("HCSSHIM_FUNCTIONAL_TESTS_DEBUG"); ok { + debug = true + } + flag.BoolVar(&debug, "debug", debug, "Set logging level to debug [%HCSSHIM_FUNCTIONAL_TESTS_DEBUG%]") + + // This allows for debugging a utility VM. + if s := os.Getenv("HCSSHIM_FUNCTIONAL_TESTS_PAUSE_ON_CREATECONTAINER_FAIL_IN_MINUTES"); s != "" { + if t, err := strconv.Atoi(s); err == nil { + pauseDurationOnCreateContainerFailure = time.Duration(t) * time.Minute + } + } + flag.DurationVar(&pauseDurationOnCreateContainerFailure, + "container-creation-failure-pause", + pauseDurationOnCreateContainerFailure, + "The number of minutes to wait after a container creation failure to try again "+ + "[%HCSSHIM_FUNCTIONAL_TESTS_PAUSE_ON_CREATECONTAINER_FAIL_IN_MINUTES%]") + + // Try to stop any pre-existing compute processes + // cmd := exec.Command("powershell", `get-computeprocess | stop-computeprocess -force`) + // _ = cmd.Run() +} + +func TestMain(m *testing.M) { + flag.Parse() + + lvl := logrus.WarnLevel + if vf := flag.Lookup("test.v"); debug || (vf != nil && vf.Value.String() == strconv.FormatBool(true)) { + lvl = logrus.DebugLevel + } + logrus.SetLevel(lvl) + logrus.SetFormatter(&logrus.TextFormatter{FullTimestamp: true}) + logrus.Infof("using features %q", flagFeatures.S.Strings()) + + e := m.Run() + + // close any uVMs that escaped + cmdStr := ` foreach ($vm in Get-ComputeProcess -Owner '` + hcsOwner + `') { Write-Output "uVM $($vm.Id) was left running" ; Stop-ComputeProcess -Force -Id $vm.Id } ` + cmd := exec.Command("powershell", "-NoLogo", " -NonInteractive", "-Command", cmdStr) + o, err := cmd.CombinedOutput() + if err != nil { + logrus.Warningf("could not call %q to clean up remaining uVMs: %v", cmdStr, err) + } else if len(o) > 0 { + logrus.Warningf(string(o)) + } + + os.Exit(e) +} + +func CreateContainerTestWrapper(ctx context.Context, options *hcsoci.CreateOptions) (cow.Container, *resources.Resources, error) { + if pauseDurationOnCreateContainerFailure != 0 { + options.DoNotReleaseResourcesOnFailure = true + } + s, r, err := hcsoci.CreateContainer(ctx, options) + if err != nil { + logrus.Warnf("Test is pausing for %s for debugging CreateContainer failure", pauseDurationOnCreateContainerFailure) + time.Sleep(pauseDurationOnCreateContainerFailure) + _ = resources.ReleaseResources(ctx, r, options.HostingSystem, true) + } + + return s, r, err +} + +func requireFeatures(t testing.TB, features ...string) { + require.Features(t, flagFeatures.S, features...) +} + +func getContainerdOptions() testctrd.ContainerdClientOptions { + return testctrd.ContainerdClientOptions{ + Address: *flagContainerdAddress, + Namespace: *flagContainerdNamespace, + } +} + +func newContainerdClient(ctx context.Context, t testing.TB) (context.Context, context.CancelFunc, *containerd.Client) { + return getContainerdOptions().NewClient(ctx, t) +} + +func defaultLCOWOptions(_ testing.TB, name string) *uvm.OptionsLCOW { + opts := uvm.NewDefaultOptionsLCOW(name, "") + opts.BootFilesPath = *flagLinuxBootFilesPath + + return opts +} + +func defaultWCOWOptions(_ testing.TB, name string) *uvm.OptionsWCOW { + opts := uvm.NewDefaultOptionsWCOW(name, "") + + return opts +} diff --git a/test/functional/manifest_test.go b/test/functional/manifest_test.go deleted file mode 100644 index d7be25b1d2..0000000000 --- a/test/functional/manifest_test.go +++ /dev/null @@ -1,3 +0,0 @@ -package functional - -import _ "github.com/Microsoft/hcsshim/test/functional/manifest" diff --git a/test/functional/test.go b/test/functional/test.go deleted file mode 100644 index 28314d4928..0000000000 --- a/test/functional/test.go +++ /dev/null @@ -1,53 +0,0 @@ -package functional - -import ( - "context" - "os" - "os/exec" - "strconv" - "time" - - "github.com/Microsoft/hcsshim/internal/cow" - "github.com/Microsoft/hcsshim/internal/hcsoci" - "github.com/Microsoft/hcsshim/internal/resources" - "github.com/sirupsen/logrus" -) - -const ( - bytesPerMB = 1024 * 1024 -) - -var pauseDurationOnCreateContainerFailure time.Duration - -func init() { - if len(os.Getenv("HCSSHIM_FUNCTIONAL_TESTS_DEBUG")) > 0 { - logrus.SetLevel(logrus.DebugLevel) - logrus.SetFormatter(&logrus.TextFormatter{FullTimestamp: true}) - } - - // This allows for debugging a utility VM. - s := os.Getenv("HCSSHIM_FUNCTIONAL_TESTS_PAUSE_ON_CREATECONTAINER_FAIL_IN_MINUTES") - if s != "" { - if t, err := strconv.Atoi(s); err == nil { - pauseDurationOnCreateContainerFailure = time.Duration(t) * time.Minute - } - } - - // Try to stop any pre-existing compute processes - cmd := exec.Command("powershell", `get-computeprocess | stop-computeprocess -force`) - _ = cmd.Run() - -} - -func CreateContainerTestWrapper(ctx context.Context, options *hcsoci.CreateOptions) (cow.Container, *resources.Resources, error) { - if pauseDurationOnCreateContainerFailure != 0 { - options.DoNotReleaseResourcesOnFailure = true - } - s, r, err := hcsoci.CreateContainer(ctx, options) - if err != nil { - logrus.Warnf("Test is pausing for %s for debugging CreateContainer failure", pauseDurationOnCreateContainerFailure) - time.Sleep(pauseDurationOnCreateContainerFailure) - _ = resources.ReleaseResources(ctx, r, options.HostingSystem, true) - } - return s, r, err -} diff --git a/test/functional/utilities/layerfolders.go b/test/functional/utilities/layerfolders.go deleted file mode 100644 index 6fc23dd049..0000000000 --- a/test/functional/utilities/layerfolders.go +++ /dev/null @@ -1,54 +0,0 @@ -package testutilities - -import ( - "bytes" - "encoding/json" - "io/ioutil" - "os" - "os/exec" - "path/filepath" - "strings" - "testing" -) - -var imageLayers map[string][]string - -func init() { - imageLayers = make(map[string][]string) -} - -func LayerFolders(t *testing.T, imageName string) []string { - if _, ok := imageLayers[imageName]; !ok { - imageLayers[imageName] = getLayers(t, imageName) - } - return imageLayers[imageName] -} - -func getLayers(t *testing.T, imageName string) []string { - cmd := exec.Command("docker", "inspect", imageName, "-f", `"{{.GraphDriver.Data.dir}}"`) - var out bytes.Buffer - cmd.Stdout = &out - if err := cmd.Run(); err != nil { - t.Skipf("Failed to find layers for %q. Check docker images", imageName) - } - imagePath := strings.Replace(strings.TrimSpace(out.String()), `"`, ``, -1) - layers := getLayerChain(t, imagePath) - return append([]string{imagePath}, layers...) -} - -func getLayerChain(t *testing.T, layerFolder string) []string { - jPath := filepath.Join(layerFolder, "layerchain.json") - content, err := ioutil.ReadFile(jPath) - if os.IsNotExist(err) { - t.Fatalf("layerchain not found") - } else if err != nil { - t.Fatalf("failed to read layerchain") - } - - var layerChain []string - err = json.Unmarshal(content, &layerChain) - if err != nil { - t.Fatalf("failed to unmarshal layerchain") - } - return layerChain -} diff --git a/test/functional/utilities/tempdir.go b/test/functional/utilities/tempdir.go deleted file mode 100644 index ebbe6ae533..0000000000 --- a/test/functional/utilities/tempdir.go +++ /dev/null @@ -1,15 +0,0 @@ -package testutilities - -import ( - "io/ioutil" - "testing" -) - -// CreateTempDir creates a temporary directory -func CreateTempDir(t *testing.T) string { - tempDir, err := ioutil.TempDir("", "test") - if err != nil { - t.Fatalf("failed to create temporary directory: %s", err) - } - return tempDir -} diff --git a/test/functional/uvm_mem_backingtype_test.go b/test/functional/uvm_mem_backingtype_test.go index 03ff8a00ed..d7c1f5c25b 100644 --- a/test/functional/uvm_mem_backingtype_test.go +++ b/test/functional/uvm_mem_backingtype_test.go @@ -1,4 +1,5 @@ -//go:build functional || uvmmem +//go:build windows && (functional || uvmmem) +// +build windows // +build functional uvmmem package functional @@ -11,17 +12,19 @@ import ( "github.com/Microsoft/hcsshim/internal/uvm" "github.com/Microsoft/hcsshim/osversion" - testutilities "github.com/Microsoft/hcsshim/test/functional/utilities" + "github.com/Microsoft/hcsshim/test/internal/require" "github.com/sirupsen/logrus" + + tuvm "github.com/Microsoft/hcsshim/test/internal/uvm" ) func runMemStartLCOWTest(t *testing.T, opts *uvm.OptionsLCOW) { - u := testutilities.CreateLCOWUVMFromOpts(context.Background(), t, opts) + u := tuvm.CreateAndStartLCOWFromOpts(context.Background(), t, opts) u.Close() } func runMemStartWCOWTest(t *testing.T, opts *uvm.OptionsWCOW) { - u, _, scratchDir := testutilities.CreateWCOWUVMFromOptsWithImage(context.Background(), t, opts, "microsoft/nanoserver") + u, _, scratchDir := tuvm.CreateWCOWUVMFromOptsWithImage(context.Background(), t, opts, "microsoft/nanoserver") defer os.RemoveAll(scratchDir) u.Close() } @@ -46,7 +49,7 @@ func runMemTests(t *testing.T, os string) { wopts.EnableDeferredCommit = bt.enableDeferredCommit runMemStartWCOWTest(t, wopts) } else { - lopts := uvm.NewDefaultOptionsLCOW(t.Name(), "") + lopts := defaultLCOWOptions(t, t.Name()) lopts.MemorySizeInMB = 512 lopts.AllowOvercommit = bt.allowOvercommit lopts.EnableDeferredCommit = bt.enableDeferredCommit @@ -56,12 +59,18 @@ func runMemTests(t *testing.T, os string) { } func TestMemBackingTypeWCOW(t *testing.T) { - testutilities.RequiresBuild(t, osversion.RS5) + t.Skip("not yet updated") + + require.Build(t, osversion.RS5) + requireFeatures(t, featureWCOW) runMemTests(t, "windows") } func TestMemBackingTypeLCOW(t *testing.T) { - testutilities.RequiresBuild(t, osversion.RS5) + t.Skip("not yet updated") + + require.Build(t, osversion.RS5) + requireFeatures(t, featureLCOW) runMemTests(t, "linux") } @@ -88,21 +97,30 @@ func runBenchMemStartLcowTest(b *testing.B, allowOvercommit bool, enableDeferred } func BenchmarkMemBackingTypeVirtualLCOW(b *testing.B) { - //testutilities.RequiresBuild(t, osversion.RS5) + b.Skip("not yet updated") + + require.Build(b, osversion.RS5) + requireFeatures(b, featureLCOW) logrus.SetOutput(ioutil.Discard) runBenchMemStartLcowTest(b, true, false) } func BenchmarkMemBackingTypeVirtualDeferredLCOW(b *testing.B) { - //testutilities.RequiresBuild(t, osversion.RS5) + b.Skip("not yet updated") + + require.Build(b, osversion.RS5) + requireFeatures(b, featureLCOW) logrus.SetOutput(ioutil.Discard) runBenchMemStartLcowTest(b, true, true) } func BenchmarkMemBackingTypePhyscialLCOW(b *testing.B) { - //testutilities.RequiresBuild(t, osversion.RS5) + b.Skip("not yet updated") + + require.Build(b, osversion.RS5) + requireFeatures(b, featureLCOW) logrus.SetOutput(ioutil.Discard) runBenchMemStartLcowTest(b, false, false) diff --git a/test/functional/uvm_memory_test.go b/test/functional/uvm_memory_test.go index bc1ecd5ea9..76adcade95 100644 --- a/test/functional/uvm_memory_test.go +++ b/test/functional/uvm_memory_test.go @@ -1,3 +1,5 @@ +//go:build windows && functional + package functional import ( @@ -6,23 +8,29 @@ import ( "testing" "time" + "github.com/Microsoft/hcsshim/internal/memory" "github.com/Microsoft/hcsshim/internal/uvm" "github.com/Microsoft/hcsshim/osversion" - testutilities "github.com/Microsoft/hcsshim/test/functional/utilities" + + "github.com/Microsoft/hcsshim/test/internal/require" + tuvm "github.com/Microsoft/hcsshim/test/internal/uvm" ) func TestUVMMemoryUpdateLCOW(t *testing.T) { - testutilities.RequiresBuild(t, osversion.RS5) + t.Skip("not yet updated") + + require.Build(t, osversion.RS5) + requireFeatures(t, featureLCOW) ctx, cancel := context.WithTimeout(context.Background(), 40*time.Second) defer cancel() - opts := uvm.NewDefaultOptionsLCOW(t.Name(), "") + opts := defaultLCOWOptions(t, t.Name()) opts.MemorySizeInMB = 1024 * 2 - u := testutilities.CreateLCOWUVMFromOpts(ctx, t, opts) + u := tuvm.CreateAndStartLCOWFromOpts(ctx, t, opts) defer u.Close() - newMemorySize := uint64(opts.MemorySizeInMB/2) * bytesPerMB + newMemorySize := uint64(opts.MemorySizeInMB/2) * memory.MegaByte if err := u.UpdateMemory(ctx, newMemorySize); err != nil { t.Fatalf("failed to make call to modify UVM memory size in MB with: %v", err) @@ -37,7 +45,10 @@ func TestUVMMemoryUpdateLCOW(t *testing.T) { } func TestUVMMemoryUpdateWCOW(t *testing.T) { - testutilities.RequiresBuild(t, osversion.RS5) + t.Skip("not yet updated") + + require.Build(t, osversion.RS5) + requireFeatures(t, featureWCOW) ctx, cancel := context.WithTimeout(context.Background(), 40*time.Second) defer cancel() @@ -45,11 +56,11 @@ func TestUVMMemoryUpdateWCOW(t *testing.T) { opts := uvm.NewDefaultOptionsWCOW(t.Name(), "") opts.MemorySizeInMB = 1024 * 2 - u, _, uvmScratchDir := testutilities.CreateWCOWUVMFromOptsWithImage(ctx, t, opts, "mcr.microsoft.com/windows/nanoserver:1909") + u, _, uvmScratchDir := tuvm.CreateWCOWUVMFromOptsWithImage(ctx, t, opts, "mcr.microsoft.com/windows/nanoserver:1909") defer os.RemoveAll(uvmScratchDir) defer u.Close() - newMemoryInBytes := uint64(opts.MemorySizeInMB/2) * bytesPerMB + newMemoryInBytes := uint64(opts.MemorySizeInMB/2) * memory.MegaByte if err := u.UpdateMemory(ctx, newMemoryInBytes); err != nil { t.Fatalf("failed to make call to modify UVM memory size in MB with: %v", err) } diff --git a/test/functional/uvm_plannine_test.go b/test/functional/uvm_plannine_test.go index 86573631ed..cc1cb48767 100644 --- a/test/functional/uvm_plannine_test.go +++ b/test/functional/uvm_plannine_test.go @@ -1,5 +1,5 @@ -//go:build functional || uvmp9 -// +build functional uvmp9 +//go:build windows && functional +// +build windows,functional // This file isn't called uvm_plan9_test.go as go test skips when a number is in it... go figure (pun intended) @@ -16,18 +16,25 @@ import ( "github.com/Microsoft/hcsshim/internal/hcs" "github.com/Microsoft/hcsshim/internal/uvm" "github.com/Microsoft/hcsshim/osversion" - testutilities "github.com/Microsoft/hcsshim/test/functional/utilities" + + "github.com/Microsoft/hcsshim/test/internal/require" + testuvm "github.com/Microsoft/hcsshim/test/internal/uvm" ) // TestPlan9 tests adding/removing Plan9 shares to/from a v2 Linux utility VM // TODO: This is very basic. Need multiple shares and so-on. Can be iterated on later. func TestPlan9(t *testing.T) { - testutilities.RequiresBuild(t, osversion.RS5) + t.Skip("not yet updated") + + require.Build(t, osversion.RS5) + requireFeatures(t, featureLCOW, featurePlan9) + ctx := context.Background() - vm := testutilities.CreateLCOWUVM(context.Background(), t, t.Name()) + vm := testuvm.CreateAndStartLCOWFromOpts(ctx, t, defaultLCOWOptions(t, t.Name())) defer vm.Close() + testuvm.SetSecurityPolicy(ctx, t, vm, "") - dir := testutilities.CreateTempDir(t) + dir := t.TempDir() defer os.RemoveAll(dir) var iterations uint32 = 64 var shares []*uvm.Plan9Share @@ -48,15 +55,19 @@ func TestPlan9(t *testing.T) { } func TestPlan9_Writable(t *testing.T) { - testutilities.RequiresBuild(t, osversion.RS5) + // t.Skip("not yet updated") - opts := uvm.NewDefaultOptionsLCOW(t.Name(), "") + require.Build(t, osversion.RS5) + requireFeatures(t, featureLCOW, featurePlan9) + ctx := context.Background() + + opts := defaultLCOWOptions(t, t.Name()) opts.NoWritableFileShares = true - vm := testutilities.CreateLCOWUVMFromOpts(context.Background(), t, opts) + vm := testuvm.CreateAndStartLCOWFromOpts(ctx, t, opts) defer vm.Close() + testuvm.SetSecurityPolicy(ctx, t, vm, "") - dir := testutilities.CreateTempDir(t) - defer os.RemoveAll(dir) + dir := t.TempDir() // mount as writable should fail share, err := vm.AddPlan9(context.Background(), dir, fmt.Sprintf("/tmp/%s", filepath.Base(dir)), false, false, nil) diff --git a/test/functional/uvm_properties_test.go b/test/functional/uvm_properties_test.go index c9f732e4f1..696c81db07 100644 --- a/test/functional/uvm_properties_test.go +++ b/test/functional/uvm_properties_test.go @@ -1,4 +1,5 @@ -//go:build functional || uvmproperties +//go:build windows && (functional || uvmproperties) +// +build windows // +build functional uvmproperties package functional @@ -9,13 +10,17 @@ import ( "testing" "github.com/Microsoft/hcsshim/osversion" - testutilities "github.com/Microsoft/hcsshim/test/functional/utilities" + "github.com/Microsoft/hcsshim/test/internal/require" + tuvm "github.com/Microsoft/hcsshim/test/internal/uvm" ) func TestPropertiesGuestConnection_LCOW(t *testing.T) { - testutilities.RequiresBuild(t, osversion.RS5) + t.Skip("not yet updated") - uvm := testutilities.CreateLCOWUVM(context.Background(), t, t.Name()) + require.Build(t, osversion.RS5) + requireFeatures(t, featureLCOW) + + uvm := tuvm.CreateAndStartLCOWFromOpts(context.Background(), t, defaultLCOWOptions(t, t.Name())) defer uvm.Close() p, gc := uvm.Capabilities() @@ -27,8 +32,12 @@ func TestPropertiesGuestConnection_LCOW(t *testing.T) { } func TestPropertiesGuestConnection_WCOW(t *testing.T) { - testutilities.RequiresBuild(t, osversion.RS5) - uvm, _, uvmScratchDir := testutilities.CreateWCOWUVM(context.Background(), t, t.Name(), "microsoft/nanoserver") + t.Skip("not yet updated") + + require.Build(t, osversion.RS5) + requireFeatures(t, featureWCOW) + + uvm, _, uvmScratchDir := tuvm.CreateWCOWUVM(context.Background(), t, t.Name(), "microsoft/nanoserver") defer os.RemoveAll(uvmScratchDir) defer uvm.Close() diff --git a/test/functional/uvm_scratch_test.go b/test/functional/uvm_scratch_test.go index 97096205f6..3b01aa4634 100644 --- a/test/functional/uvm_scratch_test.go +++ b/test/functional/uvm_scratch_test.go @@ -1,4 +1,5 @@ -//go:build functional || uvmscratch +//go:build windows && (functional || uvmscratch) +// +build windows // +build functional uvmscratch package functional @@ -12,15 +13,20 @@ import ( "github.com/Microsoft/hcsshim/internal/lcow" "github.com/Microsoft/hcsshim/internal/uvm" "github.com/Microsoft/hcsshim/osversion" - testutilities "github.com/Microsoft/hcsshim/test/functional/utilities" + "github.com/Microsoft/hcsshim/test/internal/require" + tuvm "github.com/Microsoft/hcsshim/test/internal/uvm" ) func TestScratchCreateLCOW(t *testing.T) { - testutilities.RequiresBuild(t, osversion.RS5) - tempDir := testutilities.CreateTempDir(t) + t.Skip("not yet updated") + + require.Build(t, osversion.RS5) + requireFeatures(t, featureLCOW, featureScratch) + + tempDir := t.TempDir() defer os.RemoveAll(tempDir) - firstUVM := testutilities.CreateLCOWUVM(context.Background(), t, "TestCreateLCOWScratch") + firstUVM := tuvm.CreateAndStartLCOW(context.Background(), t, "TestCreateLCOWScratch") defer firstUVM.Close() cacheFile := filepath.Join(tempDir, "cache.vhdx") @@ -37,7 +43,7 @@ func TestScratchCreateLCOW(t *testing.T) { t.Fatalf("cacheFile wasn't created!") } - targetUVM := testutilities.CreateLCOWUVM(context.Background(), t, "TestCreateLCOWScratch_target") + targetUVM := tuvm.CreateAndStartLCOW(context.Background(), t, "TestCreateLCOWScratch_target") defer targetUVM.Close() // A non-cached create diff --git a/test/functional/uvm_scsi_test.go b/test/functional/uvm_scsi_test.go index b25a0db38a..86aeeb139b 100644 --- a/test/functional/uvm_scsi_test.go +++ b/test/functional/uvm_scsi_test.go @@ -1,4 +1,5 @@ -//go:build functional || uvmscsi +//go:build windows && (functional || uvmscsi) +// +build windows // +build functional uvmscsi package functional @@ -18,15 +19,21 @@ import ( "github.com/Microsoft/hcsshim/internal/lcow" "github.com/Microsoft/hcsshim/internal/uvm" "github.com/Microsoft/hcsshim/osversion" - testutilities "github.com/Microsoft/hcsshim/test/functional/utilities" + testutilities "github.com/Microsoft/hcsshim/test/internal" + "github.com/Microsoft/hcsshim/test/internal/require" + tuvm "github.com/Microsoft/hcsshim/test/internal/uvm" "github.com/sirupsen/logrus" ) // TestSCSIAddRemovev2LCOW validates adding and removing SCSI disks // from a utility VM in both attach-only and with a container path. func TestSCSIAddRemoveLCOW(t *testing.T) { - testutilities.RequiresBuild(t, osversion.RS5) - u := testutilities.CreateLCOWUVM(context.Background(), t, t.Name()) + t.Skip("not yet updated") + + require.Build(t, osversion.RS5) + requireFeatures(t, featureLCOW, featureSCSI) + + u := tuvm.CreateAndStartLCOWFromOpts(context.Background(), t, defaultLCOWOptions(t, t.Name())) defer u.Close() testSCSIAddRemoveMultiple(t, u, `/run/gcs/c/0/scsi`, "linux", []string{}) @@ -36,9 +43,13 @@ func TestSCSIAddRemoveLCOW(t *testing.T) { // TestSCSIAddRemoveWCOW validates adding and removing SCSI disks // from a utility VM in both attach-only and with a container path. func TestSCSIAddRemoveWCOW(t *testing.T) { - testutilities.RequiresBuild(t, osversion.RS5) + t.Skip("not yet updated") + + require.Build(t, osversion.RS5) + requireFeatures(t, featureWCOW, featureSCSI) + // TODO make the image configurable to the build we're testing on - u, layers, uvmScratchDir := testutilities.CreateWCOWUVM(context.Background(), t, t.Name(), "mcr.microsoft.com/windows/nanoserver:1903") + u, layers, uvmScratchDir := tuvm.CreateWCOWUVM(context.Background(), t, t.Name(), "mcr.microsoft.com/windows/nanoserver:1903") defer os.RemoveAll(uvmScratchDir) defer u.Close() @@ -214,8 +225,12 @@ func testSCSIAddRemoveMultiple(t *testing.T, u *uvm.UtilityVM, pathPrefix string } func TestParallelScsiOps(t *testing.T) { - testutilities.RequiresBuild(t, osversion.RS5) - u := testutilities.CreateLCOWUVM(context.Background(), t, t.Name()) + t.Skip("not yet updated") + + require.Build(t, osversion.RS5) + requireFeatures(t, featureLCOW, featureSCSI) + + u := tuvm.CreateAndStartLCOWFromOpts(context.Background(), t, defaultLCOWOptions(t, t.Name())) defer u.Close() // Create a sandbox to use diff --git a/test/functional/uvm_virtualdevice_test.go b/test/functional/uvm_virtualdevice_test.go index 73f8ede868..59c6c581c8 100644 --- a/test/functional/uvm_virtualdevice_test.go +++ b/test/functional/uvm_virtualdevice_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package functional @@ -12,7 +12,8 @@ import ( "github.com/Microsoft/hcsshim/internal/uvm" "github.com/Microsoft/hcsshim/osversion" - testutilities "github.com/Microsoft/hcsshim/test/functional/utilities" + "github.com/Microsoft/hcsshim/test/internal/require" + tuvm "github.com/Microsoft/hcsshim/test/internal/uvm" ) const lcowGPUBootFilesPath = "C:\\ContainerPlat\\LinuxBootFiles\\nvidiagpu" @@ -30,7 +31,11 @@ func findTestVirtualDevice() (string, error) { } func TestVirtualDevice(t *testing.T) { - testutilities.RequiresBuild(t, osversion.V20H1) + t.Skip("not yet updated") + + require.Build(t, osversion.V20H1) + requireFeatures(t, featureLCOW) + ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second) defer cancel() @@ -54,7 +59,7 @@ func TestVirtualDevice(t *testing.T) { opts.BootFilesPath = lcowGPUBootFilesPath // create test uvm and ensure we can assign and remove the device - vm := testutilities.CreateLCOWUVMFromOpts(ctx, t, opts) + vm := tuvm.CreateAndStartLCOWFromOpts(ctx, t, opts) defer vm.Close() vpci, err := vm.AssignDevice(ctx, testDeviceInstanceID, 0, "") if err != nil { diff --git a/test/functional/uvm_vpmem_test.go b/test/functional/uvm_vpmem_test.go index 71b3e4f6e7..bc48df3c84 100644 --- a/test/functional/uvm_vpmem_test.go +++ b/test/functional/uvm_vpmem_test.go @@ -1,4 +1,5 @@ -//go:build functional || uvmvpmem +//go:build windows && (functional || uvmvpmem) +// +build windows // +build functional uvmvpmem package functional @@ -12,22 +13,28 @@ import ( "github.com/Microsoft/hcsshim/internal/copyfile" "github.com/Microsoft/hcsshim/internal/uvm" "github.com/Microsoft/hcsshim/osversion" - testutilities "github.com/Microsoft/hcsshim/test/functional/utilities" + "github.com/Microsoft/hcsshim/test/internal/layers" + "github.com/Microsoft/hcsshim/test/internal/require" + tuvm "github.com/Microsoft/hcsshim/test/internal/uvm" ) // TestVPMEM tests adding/removing VPMem Read-Only layers from a v2 Linux utility VM func TestVPMEM(t *testing.T) { - testutilities.RequiresBuild(t, osversion.RS5) - alpineLayers := testutilities.LayerFolders(t, "alpine") + t.Skip("not yet updated") + + require.Build(t, osversion.RS5) + requireFeatures(t, featureLCOW, featureVPMEM) + + alpineLayers := layers.LayerFolders(t, "alpine") ctx := context.Background() - u := testutilities.CreateLCOWUVM(ctx, t, t.Name()) + u := tuvm.CreateAndStartLCOW(ctx, t, t.Name()) defer u.Close() var iterations uint32 = uvm.MaxVPMEMCount // Use layer.vhd from the alpine image as something to add - tempDir := testutilities.CreateTempDir(t) + tempDir := t.TempDir() if err := copyfile.CopyFile(ctx, filepath.Join(alpineLayers[0], "layer.vhd"), filepath.Join(tempDir, "layer.vhd"), true); err != nil { t.Fatal(err) } diff --git a/test/functional/uvm_vsmb_test.go b/test/functional/uvm_vsmb_test.go index 167aecccdf..c15d54282e 100644 --- a/test/functional/uvm_vsmb_test.go +++ b/test/functional/uvm_vsmb_test.go @@ -1,4 +1,5 @@ -//go:build functional || uvmvsmb +//go:build windows && (functional || uvmvsmb) +// +build windows // +build functional uvmvsmb package functional @@ -12,17 +13,23 @@ import ( "github.com/Microsoft/hcsshim/internal/hcs" "github.com/Microsoft/hcsshim/internal/uvm" "github.com/Microsoft/hcsshim/osversion" - testutilities "github.com/Microsoft/hcsshim/test/functional/utilities" + + "github.com/Microsoft/hcsshim/test/internal/require" + tuvm "github.com/Microsoft/hcsshim/test/internal/uvm" ) // TestVSMB tests adding/removing VSMB layers from a v2 Windows utility VM func TestVSMB(t *testing.T) { - testutilities.RequiresBuild(t, osversion.RS5) - uvm, _, uvmScratchDir := testutilities.CreateWCOWUVM(context.Background(), t, t.Name(), "microsoft/nanoserver") + t.Skip("not yet updated") + + require.Build(t, osversion.RS5) + requireFeatures(t, featureWCOW, featureVSMB) + + uvm, _, uvmScratchDir := tuvm.CreateWCOWUVM(context.Background(), t, t.Name(), "microsoft/nanoserver") defer os.RemoveAll(uvmScratchDir) defer uvm.Close() - dir := testutilities.CreateTempDir(t) + dir := t.TempDir() defer os.RemoveAll(dir) var iterations uint32 = 64 options := uvm.DefaultVSMBOptions(true) @@ -44,15 +51,18 @@ func TestVSMB(t *testing.T) { // TODO: VSMB for mapped directories func TestVSMB_Writable(t *testing.T) { - testutilities.RequiresBuild(t, osversion.RS5) + t.Skip("not yet updated") + + require.Build(t, osversion.RS5) + requireFeatures(t, featureWCOW, featureVSMB) opts := uvm.NewDefaultOptionsWCOW(t.Name(), "") opts.NoWritableFileShares = true - vm, _, uvmScratchDir := testutilities.CreateWCOWUVMFromOptsWithImage(context.Background(), t, opts, "microsoft/nanoserver") + vm, _, uvmScratchDir := tuvm.CreateWCOWUVMFromOptsWithImage(context.Background(), t, opts, "microsoft/nanoserver") defer os.RemoveAll(uvmScratchDir) defer vm.Close() - dir := testutilities.CreateTempDir(t) + dir := t.TempDir() defer os.RemoveAll(dir) options := vm.DefaultVSMBOptions(true) options.TakeBackupPrivilege = true diff --git a/test/functional/wcow_test.go b/test/functional/wcow_test.go index 32bb4999c0..56204f68c9 100644 --- a/test/functional/wcow_test.go +++ b/test/functional/wcow_test.go @@ -1,4 +1,5 @@ -//go:build functional || wcow +//go:build windows && (functional || wcow) +// +build windows // +build functional wcow package functional @@ -23,7 +24,8 @@ import ( "github.com/Microsoft/hcsshim/internal/wclayer" "github.com/Microsoft/hcsshim/internal/wcow" "github.com/Microsoft/hcsshim/osversion" - testutilities "github.com/Microsoft/hcsshim/test/functional/utilities" + "github.com/Microsoft/hcsshim/test/internal/layers" + "github.com/Microsoft/hcsshim/test/internal/require" specs "github.com/opencontainers/runtime-spec/specs-go" ) @@ -342,8 +344,8 @@ const imageName = "busyboxw" // Creates two temp folders used for the mounts/mapped directories func createTestMounts(t *testing.T) (string, string) { // Create two temp folders for mapped directories. - hostRWSharedDirectory := testutilities.CreateTempDir(t) - hostROSharedDirectory := testutilities.CreateTempDir(t) + hostRWSharedDirectory := t.TempDir() + hostROSharedDirectory := t.TempDir() fRW, _ := os.OpenFile(filepath.Join(hostRWSharedDirectory, "readwrite"), os.O_RDWR|os.O_CREATE, 0755) fRO, _ := os.OpenFile(filepath.Join(hostROSharedDirectory, "readonly"), os.O_RDWR|os.O_CREATE, 0755) fRW.Close() @@ -363,10 +365,14 @@ func generateShimLayersStruct(t *testing.T, imageLayers []string) []hcsshim.Laye // Argon through HCSShim interface (v1) func TestWCOWArgonShim(t *testing.T) { - imageLayers := testutilities.LayerFolders(t, imageName) + t.Skip("not yet updated") + + requireFeatures(t, featureWCOW) + + imageLayers := layers.LayerFolders(t, imageName) argonShimMounted := false - argonShimScratchDir := testutilities.CreateTempDir(t) + argonShimScratchDir := t.TempDir() defer os.RemoveAll(argonShimScratchDir) if err := wclayer.CreateScratchLayer(context.Background(), argonShimScratchDir, imageLayers); err != nil { t.Fatalf("failed to create argon scratch layer: %s", err) @@ -429,9 +435,13 @@ func TestWCOWArgonShim(t *testing.T) { // Xenon through HCSShim interface (v1) func TestWCOWXenonShim(t *testing.T) { - imageLayers := testutilities.LayerFolders(t, imageName) + t.Skip("not yet updated") + + requireFeatures(t, featureWCOW) - xenonShimScratchDir := testutilities.CreateTempDir(t) + imageLayers := layers.LayerFolders(t, imageName) + + xenonShimScratchDir := t.TempDir() defer os.RemoveAll(xenonShimScratchDir) if err := wclayer.CreateScratchLayer(context.Background(), xenonShimScratchDir, imageLayers); err != nil { t.Fatalf("failed to create xenon scratch layer: %s", err) @@ -499,9 +509,13 @@ func generateWCOWOciTestSpec(t *testing.T, imageLayers []string, scratchPath, ho // Argon through HCSOCI interface (v1) func TestWCOWArgonOciV1(t *testing.T) { - imageLayers := testutilities.LayerFolders(t, imageName) + t.Skip("not yet updated") + + requireFeatures(t, featureWCOW) + + imageLayers := layers.LayerFolders(t, imageName) argonOci1Mounted := false - argonOci1ScratchDir := testutilities.CreateTempDir(t) + argonOci1ScratchDir := t.TempDir() defer os.RemoveAll(argonOci1ScratchDir) if err := wclayer.CreateScratchLayer(context.Background(), argonOci1ScratchDir, imageLayers); err != nil { t.Fatalf("failed to create argon scratch layer: %s", err) @@ -547,10 +561,14 @@ func TestWCOWArgonOciV1(t *testing.T) { // Xenon through HCSOCI interface (v1) func TestWCOWXenonOciV1(t *testing.T) { - imageLayers := testutilities.LayerFolders(t, imageName) + t.Skip("not yet updated") + + requireFeatures(t, featureWCOW) + + imageLayers := layers.LayerFolders(t, imageName) xenonOci1Mounted := false - xenonOci1ScratchDir := testutilities.CreateTempDir(t) + xenonOci1ScratchDir := t.TempDir() defer os.RemoveAll(xenonOci1ScratchDir) if err := wclayer.CreateScratchLayer(context.Background(), xenonOci1ScratchDir, imageLayers); err != nil { t.Fatalf("failed to create xenon scratch layer: %s", err) @@ -603,11 +621,15 @@ func TestWCOWXenonOciV1(t *testing.T) { // Argon through HCSOCI interface (v2) func TestWCOWArgonOciV2(t *testing.T) { - testutilities.RequiresBuild(t, osversion.RS5) - imageLayers := testutilities.LayerFolders(t, imageName) + t.Skip("not yet updated") + + require.Build(t, osversion.RS5) + requireFeatures(t, featureWCOW) + + imageLayers := layers.LayerFolders(t, imageName) argonOci2Mounted := false - argonOci2ScratchDir := testutilities.CreateTempDir(t) + argonOci2ScratchDir := t.TempDir() defer os.RemoveAll(argonOci2ScratchDir) if err := wclayer.CreateScratchLayer(context.Background(), argonOci2ScratchDir, imageLayers); err != nil { t.Fatalf("failed to create argon scratch layer: %s", err) @@ -654,12 +676,16 @@ func TestWCOWArgonOciV2(t *testing.T) { // Xenon through HCSOCI interface (v2) func TestWCOWXenonOciV2(t *testing.T) { - testutilities.RequiresBuild(t, osversion.RS5) - imageLayers := testutilities.LayerFolders(t, imageName) + t.Skip("not yet updated") + + require.Build(t, osversion.RS5) + requireFeatures(t, featureWCOW) + + imageLayers := layers.LayerFolders(t, imageName) xenonOci2Mounted := false xenonOci2UVMCreated := false - xenonOci2ScratchDir := testutilities.CreateTempDir(t) + xenonOci2ScratchDir := t.TempDir() defer os.RemoveAll(xenonOci2ScratchDir) if err := wclayer.CreateScratchLayer(context.Background(), xenonOci2ScratchDir, imageLayers); err != nil { t.Fatalf("failed to create xenon scratch layer: %s", err) @@ -688,7 +714,7 @@ func TestWCOWXenonOciV2(t *testing.T) { // Create the utility VM. xenonOci2UVMId := "xenonOci2UVM" - xenonOci2UVMScratchDir := testutilities.CreateTempDir(t) + xenonOci2UVMScratchDir := t.TempDir() if err := wcow.CreateUVMScratch(context.Background(), uvmImagePath, xenonOci2UVMScratchDir, xenonOci2UVMId); err != nil { t.Fatalf("failed to create scratch: %s", err) } diff --git a/test/go.mod b/test/go.mod index bd3ba07913..e33abfeac1 100644 --- a/test/go.mod +++ b/test/go.mod @@ -19,14 +19,13 @@ require ( golang.org/x/sync v0.0.0-20210220032951-036812b2e83c golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e google.golang.org/grpc v1.40.0 - k8s.io/cri-api v0.20.6 + k8s.io/cri-api v0.23.1 ) require ( github.com/bits-and-blooms/bitset v1.2.0 // indirect github.com/blang/semver v3.5.1+incompatible // indirect github.com/cenkalti/backoff/v4 v4.1.1 // indirect - github.com/containerd/cgroups v1.0.1 // indirect github.com/containerd/console v1.0.2 // indirect github.com/containerd/continuity v0.1.0 // indirect github.com/containerd/fifo v1.0.0 // indirect @@ -53,12 +52,17 @@ require ( github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f // indirect go.opencensus.io v0.22.3 // indirect - golang.org/x/net v0.0.0-20210825183410-e898025ed96a // indirect - golang.org/x/text v0.3.6 // indirect - google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a // indirect + golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect + golang.org/x/text v0.3.7 // indirect + google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2 // indirect google.golang.org/protobuf v1.27.1 // indirect ) +require ( + github.com/containerd/cgroups v1.0.1 // indirect + github.com/pelletier/go-toml v1.8.1 // indirect +) + replace ( github.com/Microsoft/hcsshim => ../ google.golang.org/genproto => google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63 diff --git a/test/go.sum b/test/go.sum index 07245d050c..7ff78ef3bb 100644 --- a/test/go.sum +++ b/test/go.sum @@ -495,6 +495,7 @@ github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3 github.com/opencontainers/selinux v1.8.2 h1:c4ca10UMgRcvZ6h0K4HtS15UaVSBEaE+iln2LVpAuGc= github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml v1.8.1 h1:1Nf83orprkJyknT6h7zbuEGUEjcyVlCxSUGTENmNCRM= github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -577,8 +578,9 @@ github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRci github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= @@ -705,8 +707,9 @@ golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210825183410-e898025ed96a h1:bRuuGXV8wwSdGTB+CtJf+FjgO1APK1CoO39T4BN/XBw= golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211209124913-491a49abca63 h1:iocB37TsdFuN6IBRZ+ry36wrkoV51/tl5vOWqkcPGvY= +golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -786,6 +789,7 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -795,8 +799,9 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -910,8 +915,9 @@ gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= @@ -942,8 +948,9 @@ k8s.io/component-base v0.20.6/go.mod h1:6f1MPBAeI+mvuts3sIdtpjljHWBQ2cIy38oBIWMY k8s.io/cri-api v0.17.3/go.mod h1:X1sbHmuXhwaHs9xxYffLqJogVsnI+f6cPRcgPel7ywM= k8s.io/cri-api v0.20.1/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= k8s.io/cri-api v0.20.4/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= -k8s.io/cri-api v0.20.6 h1:iXX0K2pRrbR8yXbZtDK/bSnmg/uSqIFiVJK1x4LUOMc= k8s.io/cri-api v0.20.6/go.mod h1:ew44AjNXwyn1s0U4xCKGodU7J1HzBeZ1MpGrpa5r8Yc= +k8s.io/cri-api v0.23.1 h1:0DHL/hpTf4Fp+QkUXFefWcp1fhjXr9OlNdY9X99c+O8= +k8s.io/cri-api v0.23.1/go.mod h1:REJE3PSU0h/LOV1APBrupxrEJqnoxZC8KWzkBUHwrK4= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20201113003025-83324d819ded/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= diff --git a/test/functional/assets/defaultlinuxspec.json b/test/internal/assets/defaultlinuxspec.json similarity index 100% rename from test/functional/assets/defaultlinuxspec.json rename to test/internal/assets/defaultlinuxspec.json diff --git a/test/functional/assets/defaultwindowsspec.json b/test/internal/assets/defaultwindowsspec.json similarity index 100% rename from test/functional/assets/defaultwindowsspec.json rename to test/internal/assets/defaultwindowsspec.json diff --git a/test/functional/assets/samples/config.justin.lcow.working.json b/test/internal/assets/samples/config.justin.lcow.working.json similarity index 100% rename from test/functional/assets/samples/config.justin.lcow.working.json rename to test/internal/assets/samples/config.justin.lcow.working.json diff --git a/test/functional/assets/samples/from-docker-linux/privileged.json b/test/internal/assets/samples/from-docker-linux/privileged.json similarity index 100% rename from test/functional/assets/samples/from-docker-linux/privileged.json rename to test/internal/assets/samples/from-docker-linux/privileged.json diff --git a/test/functional/assets/samples/from-docker-linux/sh.json b/test/internal/assets/samples/from-docker-linux/sh.json similarity index 100% rename from test/functional/assets/samples/from-docker-linux/sh.json rename to test/internal/assets/samples/from-docker-linux/sh.json diff --git a/test/internal/cmd/cmd.go b/test/internal/cmd/cmd.go new file mode 100644 index 0000000000..8689822cee --- /dev/null +++ b/test/internal/cmd/cmd.go @@ -0,0 +1,89 @@ +//go:build windows + +package cmd + +import ( + "context" + "errors" + "strings" + "testing" + "time" + + "github.com/opencontainers/runtime-spec/specs-go" + + "github.com/Microsoft/hcsshim/internal/cmd" + "github.com/Microsoft/hcsshim/internal/cow" + "github.com/Microsoft/hcsshim/internal/log" +) + +const CopyAfterExitTimeout = time.Second + +func desc(c *cmd.Cmd) string { + desc := "init command" + if c.Spec != nil { + desc = strings.Join(c.Spec.Args, " ") + } + + return desc +} + +func Create(ctx context.Context, _ testing.TB, c cow.ProcessHost, p *specs.Process, io *BufferedIO) *cmd.Cmd { + cc := &cmd.Cmd{ + Host: c, + Context: ctx, + Spec: p, + Log: log.G(ctx), + CopyAfterExitTimeout: CopyAfterExitTimeout, + ExitState: &cmd.ExitState{}, + } + io.AddToCmd(cc) + + return cc +} + +func Start(_ context.Context, t testing.TB, c *cmd.Cmd) { + if err := c.Start(); err != nil { + t.Helper() + t.Fatalf("failed to start %q: %v", desc(c), err) + } +} + +func Run(ctx context.Context, t testing.TB, c *cmd.Cmd) int { + Start(ctx, t, c) + e := Wait(ctx, t, c) + + return e +} + +func Wait(_ context.Context, t testing.TB, c *cmd.Cmd) int { + // todo, wait on context.Done + if err := c.Wait(); err != nil { + t.Helper() + + ee := &cmd.ExitError{} + if errors.As(err, &ee) { + return ee.ExitCode() + } + t.Fatalf("failed to wait on %q: %v", desc(c), err) + } + + return 0 +} + +func WaitExitCode(ctx context.Context, t testing.TB, c *cmd.Cmd, e int) { + if ee := Wait(ctx, t, c); ee != e { + t.Helper() + t.Errorf("got exit code %d, wanted %d", ee, e) + } +} + +func Kill(ctx context.Context, t testing.TB, c *cmd.Cmd) { + ok, err := c.Process.Kill(ctx) + if !ok { + t.Helper() + t.Fatalf("could not deliver kill to %q", desc(c)) + } else if err != nil { + t.Helper() + t.Fatalf("could not kill %q: %v", desc(c), err) + } +} diff --git a/test/internal/cmd/io.go b/test/internal/cmd/io.go new file mode 100644 index 0000000000..4d4955638d --- /dev/null +++ b/test/internal/cmd/io.go @@ -0,0 +1,66 @@ +//go:build windows + +package cmd + +import ( + "bytes" + "errors" + "testing" + + "github.com/Microsoft/hcsshim/internal/cmd" +) + +// todo: add buffered input + +type BufferedIO struct { + in *bytes.Buffer + out, err bytes.Buffer +} + +func NewBufferedIOFromString(in string) *BufferedIO { + b := NewBufferedIO() + b.in = bytes.NewBufferString(in) + + return b +} + +func NewBufferedIO() *BufferedIO { + return &BufferedIO{} +} + +func (b *BufferedIO) Output() (_ string, err error) { + o := b.out.String() + if e := b.err.String(); len(e) != 0 { + err = errors.New(e) + } + + return o, err +} + +func (b *BufferedIO) TestOutput(t testing.TB, out string, err error) { + t.Helper() + + outGive, errGive := b.Output() + if !errors.Is(errGive, err) { + t.Fatalf("got stderr: %v; wanted: %v", errGive, err) + } + if outGive != out { + t.Fatalf("got stdout %q; wanted %q", outGive, out) + } +} + +func (b *BufferedIO) AddToCmd(c *cmd.Cmd) { + if b == nil { + return + } + + if c.Stdin == nil && b.in != nil { + c.Stdin = b.in + } + if c.Stdout == nil { + c.Stdout = &b.out + } + if c.Stderr == nil { + c.Stderr = &b.err + } +} diff --git a/test/internal/constants/constants.go b/test/internal/constants/constants.go new file mode 100644 index 0000000000..8d900f71a1 --- /dev/null +++ b/test/internal/constants/constants.go @@ -0,0 +1,15 @@ +package constants + +const ( + PlatformWindows = "windows" + PlatformLinux = "linux" + SnapshotterWindows = "windows" + SnapshotterLinux = "windows-lcow" +) + +func SnapshotterFromPlatform(platform string) string { + if platform == PlatformWindows { + return SnapshotterWindows + } + return SnapshotterLinux +} diff --git a/test/internal/constants/images.go b/test/internal/constants/images.go new file mode 100644 index 0000000000..551b69a8da --- /dev/null +++ b/test/internal/constants/images.go @@ -0,0 +1,54 @@ +package constants + +// not technically constants, but close enough ... + +import ( + "fmt" +) + +const ( + DockerImageRepo = "docker.io/library" + McrWindowsImageRepo = "mcr.microsoft.com/windows" + + ImageLinuxAlpineLatest = "docker.io/library/alpine:latest" + ImageLinuxPause31 = "k8s.gcr.io/pause:3.1" +) + +var ( + ImageWindowsNanoserver1709 = NanoserverImage("1709") + ImageWindowsNanoserver1803 = NanoserverImage("1803") + ImageWindowsNanoserver1809 = NanoserverImage("1809") + ImageWindowsNanoserver1903 = NanoserverImage("1903") + ImageWindowsNanoserver1909 = NanoserverImage("1909") + ImageWindowsNanoserver2004 = NanoserverImage("2004") + ImageWindowsNanoserver2009 = NanoserverImage("2009") + ImageWindowsNanoserverLTSC2022 = NanoserverImage("ltsc2022") + + ImageWindowsServercore1709 = ServercoreImage("1709") + ImageWindowsServercore1803 = ServercoreImage("1803") + ImageWindowsServercore1809 = ServercoreImage("1809") + ImageWindowsServercore1903 = ServercoreImage("1903") + ImageWindowsServercore1909 = ServercoreImage("1909") + ImageWindowsServercore2004 = ServercoreImage("2004") + ImageWindowsServercore2009 = ServercoreImage("2009") + ImageWindowsServercoreLTSC2022 = ServercoreImage("ltsc2022") +) + +// all inputs should be predefined and vetted +// may not be formatted correctly for arbitrary inputs +func makeImageURL(repo, image, tag string) string { + r := fmt.Sprintf("%s/%s", repo, image) + if tag != "" { + r = fmt.Sprintf("%s:%s", r, tag) + } + + return r +} + +func NanoserverImage(tag string) string { + return makeImageURL(McrWindowsImageRepo, "nanoserver", tag) +} + +func ServercoreImage(tag string) string { + return makeImageURL(McrWindowsImageRepo, "servercore", tag) +} diff --git a/test/internal/container/container.go b/test/internal/container/container.go new file mode 100644 index 0000000000..440f55585a --- /dev/null +++ b/test/internal/container/container.go @@ -0,0 +1,83 @@ +//go:build windows + +package container + +import ( + "context" + "testing" + + "github.com/opencontainers/runtime-spec/specs-go" + + "github.com/Microsoft/hcsshim/internal/cmd" + "github.com/Microsoft/hcsshim/internal/cow" + "github.com/Microsoft/hcsshim/internal/hcsoci" + "github.com/Microsoft/hcsshim/internal/resources" + "github.com/Microsoft/hcsshim/internal/uvm" + + testcmd "github.com/Microsoft/hcsshim/test/internal/cmd" +) + +func Create( + ctx context.Context, + t testing.TB, + vm *uvm.UtilityVM, + spec *specs.Spec, + name, owner string, +) (cow.Container, *resources.Resources, func()) { + t.Helper() + + if spec.Windows == nil || spec.Windows.Network == nil || spec.Windows.LayerFolders == nil { + t.Fatalf("improperly configured windows spec for container %q: %#+v", name, spec.Windows) + } + + co := &hcsoci.CreateOptions{ + ID: name, + HostingSystem: vm, + Owner: owner, + Spec: spec, + // dont create a network namespace on the host side + NetworkNamespace: "", //spec.Windows.Network.NetworkNamespace, + } + + c, r, err := hcsoci.CreateContainer(ctx, co) + if err != nil { + t.Fatalf("could not create container %q: %v", co.ID, err) + } + f := func() { + if err := resources.ReleaseResources(ctx, r, vm, true); err != nil { + t.Errorf("failed to release container resources: %v", err) + } + if err := c.Close(); err != nil { + t.Errorf("could not close container %q: %v", c.ID(), err) + } + } + + return c, r, f +} + +func Start(ctx context.Context, t testing.TB, c cow.Container, io *testcmd.BufferedIO) *cmd.Cmd { + t.Helper() + + if err := c.Start(ctx); err != nil { + t.Fatalf("could not start %q: %v", c.ID(), err) + } + + // OCI spec is nil to tell bridge to start container's init process + init := testcmd.Create(ctx, t, c, nil, io) + testcmd.Start(ctx, t, init) + + return init +} + +func Wait(_ context.Context, t testing.TB, c cow.Container) { + // todo: add wait on ctx.Done + if err := c.Wait(); err != nil { + t.Fatalf("could not wait on container %q: %v", c.ID(), err) + } +} + +func Kill(ctx context.Context, t testing.TB, c cow.Container) { + if err := c.Shutdown(ctx); err != nil { + t.Fatalf("could not terminate container %q: %v", c.ID(), err) + } +} diff --git a/test/internal/containerd/containerd.go b/test/internal/containerd/containerd.go new file mode 100644 index 0000000000..3dbf8f97ab --- /dev/null +++ b/test/internal/containerd/containerd.go @@ -0,0 +1,211 @@ +//go:build windows + +package containerd + +import ( + "context" + "errors" + "sync" + "testing" + + "github.com/containerd/containerd" + "github.com/containerd/containerd/errdefs" + kubeutil "github.com/containerd/containerd/integration/remote/util" + "github.com/containerd/containerd/mount" + "github.com/containerd/containerd/namespaces" + "github.com/containerd/containerd/platforms" + "github.com/containerd/containerd/remotes" + "github.com/containerd/containerd/remotes/docker" + "github.com/containerd/containerd/remotes/docker/config" + "github.com/containerd/containerd/snapshots" + "github.com/opencontainers/image-spec/identity" + "google.golang.org/grpc" + + "github.com/Microsoft/hcsshim/test/internal/constants" + "github.com/Microsoft/hcsshim/test/internal/timeout" +) + +// images maps image refs -> chain ID +var images sync.Map + +// default containerd.New(address) does not connect to tcp endpoints on windows +func createGRPCConn(ctx context.Context, address string) (*grpc.ClientConn, error) { + addr, dialer, err := kubeutil.GetAddressAndDialer(address) + if err != nil { + return nil, err + } + + return grpc.DialContext(ctx, addr, grpc.WithInsecure(), grpc.WithContextDialer(dialer)) +} + +type ContainerdClientOptions struct { + Address string + Namespace string +} + +// NewClient returns a containerd client, a context with the namespace set, and the +// context's cancel function. The context should be used for containerd operations, and +// cancel function will terminate those operations early. +func (cco ContainerdClientOptions) NewClient( + ctx context.Context, + t testing.TB, + opts ...containerd.ClientOpt, +) (context.Context, context.CancelFunc, *containerd.Client) { + t.Helper() + + // regular `New` does not work on windows, need to use `WithConn` + cctx, ccancel := context.WithTimeout(ctx, timeout.ConnectTimeout) + defer ccancel() + + conn, err := createGRPCConn(cctx, cco.Address) + if err != nil { + t.Fatalf("failed to dial runtime client: %v", err) + } + + defOpts := []containerd.ClientOpt{ + containerd.WithDefaultNamespace(cco.Namespace), + } + opts = append(defOpts, opts...) + c, err := containerd.NewWithConn(conn, opts...) + if err != nil { + t.Fatalf("could not create new containerd client: %v", err) + } + t.Cleanup(func() { + c.Close() + }) + + ctx = namespaces.WithNamespace(ctx, cco.Namespace) + ctx, cancel := context.WithCancel(ctx) + t.Cleanup(cancel) + + return ctx, cancel, c +} + +func GetPlatformComparer(t testing.TB, platform string) platforms.MatchComparer { + var p platforms.MatchComparer + if platform == "" { + p = platforms.All + } else { + pp, err := platforms.Parse(platform) + if err != nil { + t.Helper() + t.Fatalf("could not parse platform %q: %v", platform, err) + } + p = platforms.Only(pp) + } + + return p +} + +// GetImageChainID gets the chain id of an image. platform can be "". +func GetImageChainID(ctx context.Context, t testing.TB, client *containerd.Client, image, platform string) string { + t.Helper() + is := client.ImageService() + + i, err := is.Get(ctx, image) + if err != nil { + t.Fatalf("could not retrieve image %q: %v", image, err) + } + + p := GetPlatformComparer(t, platform) + + diffIDs, err := i.RootFS(ctx, client.ContentStore(), p) + if err != nil { + t.Fatalf("could not retrieve unpacked diff ids: %v", err) + } + chainID := identity.ChainID(diffIDs).String() + + return chainID +} + +func CreateActiveSnapshot(ctx context.Context, t testing.TB, client *containerd.Client, snapshotter, parent, key string, opts ...snapshots.Opt) []mount.Mount { + t.Helper() + + ss := client.SnapshotService(snapshotter) + + ms, err := ss.Prepare(ctx, key, parent, opts...) + if err != nil { + t.Fatalf("could not make active snapshot %q from %q: %v", key, parent, err) + } + + t.Cleanup(func() { + if err := ss.Remove(ctx, key); err != nil && !errors.Is(err, errdefs.ErrNotFound) { + // remove is not idempotent, so do not Fail test + t.Logf("failed to remove active snapshot %q: %v", key, err) + } + }) + + return ms +} + +// a view will not not create a new scratch layer/vhd, but instead return only the directory of the +// committed snapshot `parent` +func CreateViewSnapshot(ctx context.Context, t testing.TB, client *containerd.Client, snapshotter, parent, key string, opts ...snapshots.Opt) []mount.Mount { + t.Helper() + + ss := client.SnapshotService(snapshotter) + + ms, err := ss.View(ctx, key, parent, opts...) + if err != nil { + t.Fatalf("could not make active snapshot %q from %q: %v", key, parent, err) + } + + t.Cleanup(func() { + if err := ss.Remove(ctx, key); err != nil && !errors.Is(err, errdefs.ErrNotFound) { + // remove is not idempotent, so do not Fail test + t.Logf("failed to remove view snapshot %q: %v %T", key, err, err) + } + }) + + return ms +} + +// copied from https://github.com/containerd/containerd/blob/main/cmd/ctr/commands/images/pull.go + +// PullImage pulls the image for the specified platform and returns the chain ID +func PullImage(ctx context.Context, t testing.TB, client *containerd.Client, ref string, plat string) string { + if chainID, ok := images.Load(ref); ok { + return chainID.(string) + } + + r := GetResolver(ctx, t) + p := GetPlatformComparer(t, plat) + ss := constants.SnapshotterFromPlatform(plat) + + opts := []containerd.RemoteOpt{ + containerd.WithResolver(r), + containerd.WithSchema1Conversion, + containerd.WithPlatformMatcher(p), + } + img, err := client.Fetch(ctx, ref, opts...) + if err != nil { + t.Fatalf("could not fetch image %q: %v", ref, err) + } + t.Logf("fetched image %q", img.Name) + + i := containerd.NewImageWithPlatform(client, img, p) + if err := i.Unpack(ctx, ss); err != nil { + t.Fatalf("could not unpack image %q: %v", i.Name(), err) + } + + diffIDs, err := i.RootFS(ctx) + if err != nil { + t.Fatalf("could not fetch RootFS diff IDs for %q: %v", i.Name(), err) + } + + chainID := identity.ChainID(diffIDs).String() + images.Store(ref, chainID) + t.Logf("unpacked image %q", img.Name) + + return chainID +} + +func GetResolver(ctx context.Context, _ testing.TB) remotes.Resolver { + options := docker.ResolverOptions{ + Tracker: docker.NewInMemoryTracker(), + } + hostOptions := config.HostOptions{} + options.Hosts = config.ConfigureHosts(ctx, hostOptions) + + return docker.NewResolver(options) +} diff --git a/test/functional/utilities/defaultlinuxspec.go b/test/internal/defaultlinuxspec.go similarity index 95% rename from test/functional/utilities/defaultlinuxspec.go rename to test/internal/defaultlinuxspec.go index 2f0b019799..7f43b94665 100644 --- a/test/functional/utilities/defaultlinuxspec.go +++ b/test/internal/defaultlinuxspec.go @@ -1,4 +1,4 @@ -package testutilities +package internal import ( "encoding/json" diff --git a/test/functional/utilities/defaultwindowsspec.go b/test/internal/defaultwindowsspec.go similarity index 95% rename from test/functional/utilities/defaultwindowsspec.go rename to test/internal/defaultwindowsspec.go index e1fa541a54..7c6ee9a5dc 100644 --- a/test/functional/utilities/defaultwindowsspec.go +++ b/test/internal/defaultwindowsspec.go @@ -1,4 +1,4 @@ -package testutilities +package internal import ( "encoding/json" diff --git a/test/internal/flag/flag.go b/test/internal/flag/flag.go new file mode 100644 index 0000000000..da4daf6af4 --- /dev/null +++ b/test/internal/flag/flag.go @@ -0,0 +1,77 @@ +// This package augments the default "flags" package with functionality similar +// to that in "github.com/urfave/cli", since the two packages do not mix easily +// and the "testing" package uses a default flagset that we cannot easily update. +package flag + +import ( + "flag" + "strings" +) + +const FeatureFlagName = "feature" + +func NewFeatureFlag(all []string) *StringSlice { + ff := NewStringSlice() + flag.Var(ff, FeatureFlagName, + "The sets of functionality to test; can be set multiple times, or separated with commas."+ + "Supported features: "+strings.Join(all, ","), + ) + + return ff +} + +// StringSlice is a type to be used with the standard library's flag.Var +// function as a custom flag value, similar to "github.com/urfave/cli".StringSlice. +// It takes either a comma-separated list of strings, or repeat invocations. +type StringSlice struct { + S StringSet +} + +var _ flag.Value = &StringSlice{} + +// NewStringSetFlag returns a new StringSetFlag with an empty set. +func NewStringSlice() *StringSlice { + return &StringSlice{ + S: make(StringSet), + } +} + +// Strings returns a string slice of the flags provided to the flag +func (ss *StringSlice) Strings() []string { + return ss.S.Strings() +} + +func (ss *StringSlice) String() string { + return ss.S.String() +} + +// Set is called by `flag` each time the flag is seen when parsing the +// command line. +func (ss *StringSlice) Set(s string) error { + for _, f := range strings.Split(s, ",") { + f = Standardize(f) + ss.S[f] = struct{}{} + } + + return nil +} + +type StringSet map[string]struct{} + +func (ss StringSet) Strings() []string { + a := make([]string, 0, len(ss)) + for k := range ss { + a = append(a, k) + } + + return a +} + +func (ss StringSet) String() string { + return "[" + strings.Join(ss.Strings(), ", ") + "]" +} + +// Standardize formats the feature flag s to be consistent (ie, trim and to lowercase) +func Standardize(s string) string { + return strings.ToLower(strings.TrimSpace(s)) +} diff --git a/test/internal/layers/layerfolders.go b/test/internal/layers/layerfolders.go new file mode 100644 index 0000000000..3f63492970 --- /dev/null +++ b/test/internal/layers/layerfolders.go @@ -0,0 +1,85 @@ +//go:build windows + +package layers + +import ( + "bytes" + "context" + "encoding/json" + "io/ioutil" + "os" + "os/exec" + "path/filepath" + "strings" + "testing" + + "github.com/containerd/containerd" + "github.com/containerd/containerd/mount" + + testctrd "github.com/Microsoft/hcsshim/test/internal/containerd" +) + +var imageLayers map[string][]string + +func init() { + imageLayers = make(map[string][]string) +} + +func FromChainID(ctx context.Context, t testing.TB, client *containerd.Client, chainID, snapshotter string) []string { + ms := testctrd.CreateViewSnapshot(ctx, t, client, snapshotter, chainID, chainID+"view") + if len(ms) != 1 { + t.Fatalf("Rootfs does not contain exactly 1 mount for the root file system") + } + + return FromMount(ctx, t, ms[0]) +} + +func FromMount(_ context.Context, t testing.TB, m mount.Mount) (layers []string) { + for _, option := range m.Options { + if strings.HasPrefix(option, mount.ParentLayerPathsFlag) { + err := json.Unmarshal([]byte(option[len(mount.ParentLayerPathsFlag):]), &layers) + if err != nil { + t.Fatalf("failed to unmarshal parent layer paths from mount: %v", err) + } + } + } + layers = append(layers, m.Source) + + return layers +} + +func LayerFolders(t testing.TB, imageName string) []string { + if _, ok := imageLayers[imageName]; !ok { + imageLayers[imageName] = getLayers(t, imageName) + } + return imageLayers[imageName] +} + +func getLayers(t testing.TB, imageName string) []string { + cmd := exec.Command("docker", "inspect", imageName, "-f", `"{{.GraphDriver.Data.dir}}"`) + var out bytes.Buffer + cmd.Stdout = &out + if err := cmd.Run(); err != nil { + t.Skipf("Failed to find layers for %q. Check docker images", imageName) + } + imagePath := strings.Replace(strings.TrimSpace(out.String()), `"`, ``, -1) + layers := getLayerChain(t, imagePath) + return append([]string{imagePath}, layers...) +} + +func getLayerChain(t testing.TB, layerFolder string) []string { + jPath := filepath.Join(layerFolder, "layerchain.json") + content, err := ioutil.ReadFile(jPath) + if os.IsNotExist(err) { + t.Fatalf("layerchain not found") + } else if err != nil { + t.Fatalf("failed to read layerchain") + } + + var layerChain []string + err = json.Unmarshal(content, &layerChain) + if err != nil { + t.Fatalf("failed to unmarshal layerchain") + } + return layerChain +} diff --git a/test/internal/layers/scratch.go b/test/internal/layers/scratch.go new file mode 100644 index 0000000000..6d0dd4b6e2 --- /dev/null +++ b/test/internal/layers/scratch.go @@ -0,0 +1,49 @@ +//go:build windows + +package layers + +import ( + "context" + "path/filepath" + "testing" + + "github.com/Microsoft/hcsshim/internal/lcow" + "github.com/Microsoft/hcsshim/internal/uvm" +) + +const ( + CacheFileName = "cache.vhdx" + ScratchSpaceName = "sandbox.vhdx" + UVMScratchSpaceName = "uvmscratch.vhdx" +) + +func CacheFile(_ context.Context, t testing.TB, dir string) string { + if dir == "" { + dir = t.TempDir() + } + cache := filepath.Join(dir, CacheFileName) + return cache +} + +// ScratchSpace creates an LCOW scratch space VHD at `dir\name`, and returns the dir and name. +// If name, dir, or chache are empty, ScratchSpace uses a default name or creates a temporary +// directory, respectively. +func ScratchSpace(ctx context.Context, t testing.TB, vm *uvm.UtilityVM, name, dir, cache string) (string, string) { + if dir == "" { + dir = t.TempDir() + } + if cache == "" { + cache = CacheFile(ctx, t, dir) + } + if name == "" { + name = ScratchSpaceName + } + scratch := filepath.Join(dir, name) + + if err := lcow.CreateScratch(ctx, vm, scratch, lcow.DefaultScratchSizeGB, cache); err != nil { + t.Helper() + t.Fatalf("could not create scratch space %q using vm %q and cache file %q: %v", scratch, vm.ID(), cache, err) + } + + return dir, scratch +} diff --git a/test/functional/manifest/manifest.go b/test/internal/manifest/manifest.go similarity index 100% rename from test/functional/manifest/manifest.go rename to test/internal/manifest/manifest.go diff --git a/test/functional/manifest/rsrc_amd64.syso b/test/internal/manifest/rsrc_amd64.syso similarity index 100% rename from test/functional/manifest/rsrc_amd64.syso rename to test/internal/manifest/rsrc_amd64.syso diff --git a/test/internal/oci/cri.go b/test/internal/oci/cri.go new file mode 100644 index 0000000000..5157755cfb --- /dev/null +++ b/test/internal/oci/cri.go @@ -0,0 +1,50 @@ +package oci + +import ( + imagespec "github.com/opencontainers/image-spec/specs-go/v1" + runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" +) + +// +// not technically OCI, but making a CRI package seems overkill +// + +func LinuxWorkloadRuntimeConfig(name string, cmd, args []string, wd string) *runtime.ContainerConfig { + return &runtime.ContainerConfig{ + Metadata: &runtime.ContainerMetadata{ + Name: name, + }, + Command: cmd, + Args: args, + WorkingDir: wd, + } +} + +func LinuxWorkloadImageConfig() *imagespec.ImageConfig { + return LinuxImageConfig([]string{""}, []string{"/bin/sh"}, "/") +} + +func LinuxSandboxRuntimeConfig(name string) *runtime.PodSandboxConfig { + return &runtime.PodSandboxConfig{ + Metadata: &runtime.PodSandboxMetadata{ + Name: name, + Namespace: "default", + }, + Hostname: "", + Windows: &runtime.WindowsPodSandboxConfig{}, + } +} + +// based off of: +// containerd\pkg\cri\server\sandbox_run_windows.go +// containerd\pkg\cri\server\container_create.go +// containerd\pkg\cri\server\container_create_windows.go + +func LinuxSandboxImageConfig(pause bool) *imagespec.ImageConfig { + entry := []string{"/bin/sh", "-c", TailNullArgs} + if pause { + entry = []string{"/pause"} + } + + return LinuxImageConfig(entry, []string{}, "/") +} diff --git a/test/internal/oci/images.go b/test/internal/oci/images.go new file mode 100644 index 0000000000..4a87bd566b --- /dev/null +++ b/test/internal/oci/images.go @@ -0,0 +1,19 @@ +package oci + +import ( + imagespec "github.com/opencontainers/image-spec/specs-go/v1" +) + +var DefaultUnixEnv = []string{ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", +} + +func LinuxImageConfig(entry, cmd []string, wd string) *imagespec.ImageConfig { + return &imagespec.ImageConfig{ + WorkingDir: wd, + Entrypoint: entry, + Cmd: cmd, + User: "", + Env: DefaultUnixEnv, + } +} diff --git a/test/internal/oci/oci.go b/test/internal/oci/oci.go new file mode 100644 index 0000000000..d3af84cb20 --- /dev/null +++ b/test/internal/oci/oci.go @@ -0,0 +1,125 @@ +package oci + +import ( + "context" + "errors" + "testing" + + "github.com/Microsoft/hcsshim/test/internal/constants" + "github.com/containerd/containerd/containers" + "github.com/containerd/containerd/namespaces" + ctrdoci "github.com/containerd/containerd/oci" + criconstants "github.com/containerd/containerd/pkg/cri/constants" + "github.com/opencontainers/runtime-spec/specs-go" +) + +// +// testing helper functions for OCI spec creation +// + +const ( + TailNullArgs = "tail -f /dev/null" + + DefaultNamespace = namespaces.Default + CRINamespace = criconstants.K8sContainerdNamespace + + // from containerd\pkg\cri\server\helpers_linux.go + + HostnameEnv = "HOSTNAME" +) + +func DefaultLinuxSpecOpts(nns string, extra ...ctrdoci.SpecOpts) []ctrdoci.SpecOpts { + opts := []ctrdoci.SpecOpts{ + WithoutRunMount, + ctrdoci.WithRootFSReadonly(), + WithDisabledCgroups, // we set our own cgroups + ctrdoci.WithDefaultUnixDevices, + ctrdoci.WithDefaultPathEnv, + WithWindowsNetworkNamespace(nns), + } + opts = append(opts, extra...) + + return opts +} + +// DefaultLinuxSpec returns a default OCI spec for a Linux container. +// See CreateSpecWithPlatform for more details. +func DefaultLinuxSpec(ctx context.Context, t testing.TB, nns string) *specs.Spec { + return CreateLinuxSpec(ctx, t, t.Name(), DefaultLinuxSpecOpts(nns)...) +} + +// CreateLinuxSpec returns the OCI spec for a Linux container. +// See CreateSpecWithPlatform for more details. +func CreateLinuxSpec(ctx context.Context, t testing.TB, id string, opts ...ctrdoci.SpecOpts) *specs.Spec { + return CreateSpecWithPlatform(ctx, t, constants.PlatformLinux, id, opts...) +} + +// CreateWindowsSpec returns the OCI spec for a Windows container. +// See CreateSpecWithPlatform for more details. +func CreateWindowsSpec(ctx context.Context, t testing.TB, id string, opts ...ctrdoci.SpecOpts) *specs.Spec { + return CreateSpecWithPlatform(ctx, t, constants.PlatformWindows, id, opts...) +} + +// CreateSpecWithPlatform returns the OCI spec for the specified platform. +// The context must contain a containerd namespace (via "github.com/containerd/containerd/namespaces".WithNamespace) +func CreateSpecWithPlatform(ctx context.Context, t testing.TB, plat, id string, opts ...ctrdoci.SpecOpts) *specs.Spec { + // ctx = namespaces.WithNamespace(ctx, ns) + container := &containers.Container{ID: id} + + spec, err := ctrdoci.GenerateSpecWithPlatform(ctx, nil, plat, container, opts...) + if err != nil { + t.Helper() + t.Fatalf("failed to generate spec for container %q: %v", id, err) + } + + return spec +} + +func WithWindowsLayerFolders(layers []string) ctrdoci.SpecOpts { + return func(ctx context.Context, client ctrdoci.Client, c *containers.Container, s *specs.Spec) error { + if len(layers) < 2 { + return errors.New("at least two layers are required, including the sandbox path") + } + + if s.Windows == nil { + s.Windows = &specs.Windows{} + } + s.Windows.LayerFolders = layers + + return nil + } +} + +//defined in containerd\pkg\cri\opts\spec_windows.go + +func WithWindowsNetworkNamespace(path string) ctrdoci.SpecOpts { + return func(ctx context.Context, client ctrdoci.Client, c *containers.Container, s *specs.Spec) error { + if s.Windows == nil { + s.Windows = &specs.Windows{} + } + if s.Windows.Network == nil { + s.Windows.Network = &specs.WindowsNetwork{} + } + s.Windows.Network.NetworkNamespace = path + + return nil + } +} + +//defined in containerd\pkg\cri\opts\spec_linux.go + +// WithDisabledCgroups clears the Cgroups Path from the spec +func WithDisabledCgroups(_ context.Context, _ ctrdoci.Client, c *containers.Container, s *specs.Spec) error { + if s.Linux == nil { + s.Linux = &specs.Linux{} + } + s.Linux.CgroupsPath = "" + return nil +} + +// defined in containerd\oci\spec_opts_linux.go + +// WithoutRunMount removes the `/run` inside the spec +func WithoutRunMount(ctx context.Context, client ctrdoci.Client, c *containers.Container, s *specs.Spec) error { + return ctrdoci.WithoutMounts("/run")(ctx, client, c, s) +} diff --git a/test/functional/utilities/requiresbuild.go b/test/internal/require/build.go similarity index 64% rename from test/functional/utilities/requiresbuild.go rename to test/internal/require/build.go index 47930994d0..cbb399d6c9 100644 --- a/test/functional/utilities/requiresbuild.go +++ b/test/internal/require/build.go @@ -1,4 +1,6 @@ -package testutilities +//go:build windows + +package require import ( "testing" @@ -6,13 +8,13 @@ import ( "github.com/Microsoft/hcsshim/osversion" ) -func RequiresBuild(t *testing.T, b uint16) { +func Build(t testing.TB, b uint16) { if osversion.Build() < b { t.Skipf("Requires build %d+", b) } } -func RequiresExactBuild(t *testing.T, b uint16) { +func ExactBuild(t testing.TB, b uint16) { if osversion.Build() != b { t.Skipf("Requires exact build %d", b) } diff --git a/test/internal/require/requires.go b/test/internal/require/requires.go new file mode 100644 index 0000000000..16eadba2d4 --- /dev/null +++ b/test/internal/require/requires.go @@ -0,0 +1,61 @@ +package require + +import ( + "os" + "path/filepath" + "testing" + + "github.com/Microsoft/hcsshim/test/internal/flag" +) + +// Features checks the wanted features are present in given, +// and skips the test if any are missing. If the given set is empty, +// the function returns (by default all features are enabled). +func Features(t testing.TB, given flag.StringSet, want ...string) { + if len(given) == 0 { + return + } + for _, f := range want { + ff := flag.Standardize(f) + if _, ok := given[ff]; !ok { + t.Skipf("skipping test due to feature not set: %s", f) + } + } +} + +// Binary checks if `binary` exists in the same directory as the test +// binary. +// Returns full binary path if it exists, otherwise, skips the test. +func Binary(t testing.TB, binary string) string { + executable, err := os.Executable() + if err != nil { + t.Skipf("error locating executable: %s", err) + return "" + } + + baseDir := filepath.Dir(executable) + return File(t, baseDir, binary) +} + +// File checks if `file` exists in `path`, and returns the full path +// if it exists. Otherwise, it skips the test. +func File(t testing.TB, path, file string) string { + path, err := filepath.Abs(path) + if err != nil { + t.Fatalf("could not resolve path %q: %v", path, err) + } + + p := filepath.Join(path, file) + fi, err := os.Stat(p) + switch { + case os.IsNotExist(err): + t.Skipf("file %q not found", p) + case err != nil: + t.Fatalf("could not stat file %q: %v", p, err) + case fi.IsDir(): + t.Fatalf("path %q is a directory", p) + default: + } + + return p +} diff --git a/test/internal/schemaversion_test.go b/test/internal/schemaversion_test.go index 1c492bd8a9..044399abaf 100644 --- a/test/internal/schemaversion_test.go +++ b/test/internal/schemaversion_test.go @@ -9,8 +9,9 @@ import ( hcsschema "github.com/Microsoft/hcsshim/internal/hcs/schema2" "github.com/Microsoft/hcsshim/internal/schemaversion" "github.com/Microsoft/hcsshim/osversion" - _ "github.com/Microsoft/hcsshim/test/functional/manifest" "github.com/sirupsen/logrus" + + _ "github.com/Microsoft/hcsshim/test/internal/manifest" ) func init() { diff --git a/test/functional/utilities/scratch.go b/test/internal/scratch.go similarity index 86% rename from test/functional/utilities/scratch.go rename to test/internal/scratch.go index e7cf11028a..333a4cd478 100644 --- a/test/functional/utilities/scratch.go +++ b/test/internal/scratch.go @@ -1,4 +1,6 @@ -package testutilities +//go:build windows + +package internal import ( "context" @@ -9,6 +11,8 @@ import ( "github.com/Microsoft/hcsshim/internal/lcow" "github.com/Microsoft/hcsshim/internal/uvm" "github.com/Microsoft/hcsshim/internal/wclayer" + + tuvm "github.com/Microsoft/hcsshim/test/internal/uvm" ) const lcowGlobalSVMID = "test.lcowglobalsvm" @@ -35,7 +39,7 @@ func CreateWCOWBlankRWLayer(t *testing.T, imageLayers []string) string { // t.Fatalf("failed to locate UVM folder from %+v: %s", imageLayers, err) // } - tempDir := CreateTempDir(t) + tempDir := t.TempDir() if err := wclayer.CreateScratchLayer(context.Background(), tempDir, imageLayers); err != nil { t.Fatalf("Failed CreateScratchLayer: %s", err) } @@ -47,10 +51,10 @@ func CreateWCOWBlankRWLayer(t *testing.T, imageLayers []string) string { // for a "service VM". func CreateLCOWBlankRWLayer(ctx context.Context, t *testing.T) string { if lcowGlobalSVM == nil { - lcowGlobalSVM = CreateLCOWUVM(ctx, t, lcowGlobalSVMID) - lcowCacheScratchFile = filepath.Join(CreateTempDir(t), "sandbox.vhdx") + lcowGlobalSVM = tuvm.CreateAndStartLCOW(ctx, t, lcowGlobalSVMID) + lcowCacheScratchFile = filepath.Join(t.TempDir(), "sandbox.vhdx") } - tempDir := CreateTempDir(t) + tempDir := t.TempDir() if err := lcow.CreateScratch(ctx, lcowGlobalSVM, filepath.Join(tempDir, "sandbox.vhdx"), lcow.DefaultScratchSizeGB, lcowCacheScratchFile); err != nil { t.Fatalf("failed to create EXT4 scratch for LCOW test cases: %s", err) diff --git a/test/functional/utilities/stringsetflag.go b/test/internal/stringsetflag.go similarity index 84% rename from test/functional/utilities/stringsetflag.go rename to test/internal/stringsetflag.go index eeb06bf4cf..464d05c46c 100644 --- a/test/functional/utilities/stringsetflag.go +++ b/test/internal/stringsetflag.go @@ -1,10 +1,12 @@ -package testutilities +package internal + +import "github.com/Microsoft/hcsshim/test/internal/flag" // StringSetFlag is a type to be used with the standard library's flag.Var // function as a custom flag value. It accumulates the arguments passed each // time the flag is used into a set. type StringSetFlag struct { - set map[string]struct{} + set flag.StringSet } // NewStringSetFlag returns a new StringSetFlag with an empty set. @@ -36,6 +38,6 @@ func (ssf StringSetFlag) Set(s string) error { } // ValueSet returns the internal set of what values have been seen. -func (ssf StringSetFlag) ValueSet() map[string]struct{} { +func (ssf StringSetFlag) ValueSet() flag.StringSet { return ssf.set } diff --git a/test/internal/timeout/timeout.go b/test/internal/timeout/timeout.go new file mode 100644 index 0000000000..756652a07e --- /dev/null +++ b/test/internal/timeout/timeout.go @@ -0,0 +1,45 @@ +// Package provides functionality for timing out operations and waiting +// for deadlines. +package timeout + +import ( + "context" + "testing" + "time" +) + +const ConnectTimeout = time.Second * 10 + +type ErrorFunc func(error) error + +// WaitForError waits until f returns or the context is done. +// The returned error will be passed to the error processing functions fe or fec, respectively. +// If processed error is non-nil, it is passed to t.Fatal(). +// +// Both error processing functions should expect nil errors. +func WaitForError(ctx context.Context, t testing.TB, f func() error, fe, fec ErrorFunc) { + var err error + ch := make(chan struct{}) + + go func() { + err = f() + close(ch) + }() + + select { + case <-ch: + fatalOnError(t, fe, err) + case <-ctx.Done(): + fatalOnError(t, fec, ctx.Err()) + } +} + +func fatalOnError(t testing.TB, f func(error) error, err error) { + if f != nil { + err = f(err) + } + if err != nil { + t.Helper() + t.Fatal(err.Error()) + } +} diff --git a/test/internal/uvm/lcow.go b/test/internal/uvm/lcow.go new file mode 100644 index 0000000000..8867499438 --- /dev/null +++ b/test/internal/uvm/lcow.go @@ -0,0 +1,47 @@ +//go:build windows + +package uvm + +import ( + "context" + "testing" + + "github.com/Microsoft/hcsshim/internal/uvm" +) + +// CreateAndStartLCOW with all default options. +func CreateAndStartLCOW(ctx context.Context, t testing.TB, id string) *uvm.UtilityVM { + return CreateAndStartLCOWFromOpts(ctx, t, uvm.NewDefaultOptionsLCOW(id, "")) +} + +// CreateAndStartLCOWFromOpts creates an LCOW utility VM with the specified options. +func CreateAndStartLCOWFromOpts(ctx context.Context, t testing.TB, opts *uvm.OptionsLCOW) *uvm.UtilityVM { + t.Helper() + + if opts == nil { + t.Fatal("opts must be set") + } + + vm := CreateLCOW(ctx, t, opts) + cleanup := Start(ctx, t, vm) + t.Cleanup(cleanup) + + return vm +} + +func CreateLCOW(ctx context.Context, t testing.TB, opts *uvm.OptionsLCOW) *uvm.UtilityVM { + vm, err := uvm.CreateLCOW(ctx, opts) + if err != nil { + t.Helper() + t.Fatalf("could not create LCOW UVM: %v", err) + } + + return vm +} + +func SetSecurityPolicy(ctx context.Context, t testing.TB, vm *uvm.UtilityVM, policy string) { + if err := vm.SetSecurityPolicy(ctx, policy); err != nil { + t.Helper() + t.Fatalf("could not set vm security policy to %q: %v", policy, err) + } +} diff --git a/test/internal/uvm/uvm.go b/test/internal/uvm/uvm.go new file mode 100644 index 0000000000..b94eb989f0 --- /dev/null +++ b/test/internal/uvm/uvm.go @@ -0,0 +1,59 @@ +//go:build windows + +package uvm + +import ( + "context" + "fmt" + "testing" + + "github.com/Microsoft/hcsshim/internal/uvm" + + "github.com/Microsoft/hcsshim/test/internal/timeout" +) + +func Start(ctx context.Context, t testing.TB, vm *uvm.UtilityVM) func() { + err := vm.Start(ctx) + f := func() { + if err := vm.Close(); err != nil { + t.Logf("could not close vm %q: %v", vm.ID(), err) + } + } + + if err != nil { + t.Helper() + t.Fatalf("could not start UVM: %v", err) + } + + return f +} + +func Wait(ctx context.Context, t testing.TB, vm *uvm.UtilityVM) { + fe := func(err error) error { + if err != nil { + err = fmt.Errorf("could not wait for uvm %q: %v", vm.ID(), err) + } + + return err + } + timeout.WaitForError(ctx, t, vm.Wait, fe, fe) +} + +func Kill(ctx context.Context, t testing.TB, vm *uvm.UtilityVM) { + if err := vm.Terminate(ctx); err != nil { + t.Helper() + t.Fatalf("could not kill uvm %q: %v", vm.ID(), err) + } +} + +func Close(ctx context.Context, t testing.TB, vm *uvm.UtilityVM) { + // Terminate will error on context cancellation, but close does not accept contexts + fe := func(err error) error { + if err != nil { + err = fmt.Errorf("could not close uvm %q: %w", vm.ID(), err) + } + + return err + } + timeout.WaitForError(ctx, t, vm.Close, fe, fe) +} diff --git a/test/functional/utilities/createuvm.go b/test/internal/uvm/wcow.go similarity index 55% rename from test/functional/utilities/createuvm.go rename to test/internal/uvm/wcow.go index d88307bde9..be6af674b2 100644 --- a/test/functional/utilities/createuvm.go +++ b/test/internal/uvm/wcow.go @@ -1,4 +1,6 @@ -package testutilities +//go:build windows + +package uvm import ( "context" @@ -6,17 +8,20 @@ import ( "testing" "github.com/Microsoft/hcsshim/internal/uvm" + + "github.com/Microsoft/hcsshim/test/internal/layers" ) // CreateWCOWUVM creates a WCOW utility VM with all default options. Returns the // UtilityVM object; folder used as its scratch -func CreateWCOWUVM(ctx context.Context, t *testing.T, id, image string) (*uvm.UtilityVM, []string, string) { +func CreateWCOWUVM(ctx context.Context, t testing.TB, id, image string) (*uvm.UtilityVM, []string, string) { return CreateWCOWUVMFromOptsWithImage(ctx, t, uvm.NewDefaultOptionsWCOW(id, ""), image) - } // CreateWCOWUVMFromOpts creates a WCOW utility VM with the passed opts. -func CreateWCOWUVMFromOpts(ctx context.Context, t *testing.T, opts *uvm.OptionsWCOW) *uvm.UtilityVM { +func CreateWCOWUVMFromOpts(ctx context.Context, t testing.TB, opts *uvm.OptionsWCOW) *uvm.UtilityVM { + t.Helper() + if opts == nil || len(opts.LayerFolders) < 2 { t.Fatalf("opts must bet set with LayerFolders") } @@ -29,19 +34,22 @@ func CreateWCOWUVMFromOpts(ctx context.Context, t *testing.T, opts *uvm.OptionsW uvm.Close() t.Fatal(err) } + return uvm } // CreateWCOWUVMFromOptsWithImage creates a WCOW utility VM with the passed opts // builds the LayerFolders based on `image`. Returns the UtilityVM object; // folder used as its scratch -func CreateWCOWUVMFromOptsWithImage(ctx context.Context, t *testing.T, opts *uvm.OptionsWCOW, image string) (*uvm.UtilityVM, []string, string) { +func CreateWCOWUVMFromOptsWithImage(ctx context.Context, t testing.TB, opts *uvm.OptionsWCOW, image string) (*uvm.UtilityVM, []string, string) { + t.Helper() + if opts == nil { t.Fatal("opts must be set") } - uvmLayers := LayerFolders(t, image) - scratchDir := CreateTempDir(t) + uvmLayers := layers.LayerFolders(t, image) + scratchDir := t.TempDir() defer func() { if t.Failed() { os.RemoveAll(scratchDir) @@ -53,25 +61,3 @@ func CreateWCOWUVMFromOptsWithImage(ctx context.Context, t *testing.T, opts *uvm return CreateWCOWUVMFromOpts(ctx, t, opts), uvmLayers, scratchDir } - -// CreateLCOWUVM with all default options. -func CreateLCOWUVM(ctx context.Context, t *testing.T, id string) *uvm.UtilityVM { - return CreateLCOWUVMFromOpts(ctx, t, uvm.NewDefaultOptionsLCOW(id, "")) -} - -// CreateLCOWUVMFromOpts creates an LCOW utility VM with the specified options. -func CreateLCOWUVMFromOpts(ctx context.Context, t *testing.T, opts *uvm.OptionsLCOW) *uvm.UtilityVM { - if opts == nil { - t.Fatal("opts must be set") - } - - uvm, err := uvm.CreateLCOW(ctx, opts) - if err != nil { - t.Fatalf("could not create LCOW UVM: %v", err) - } - if err := uvm.Start(ctx); err != nil { - uvm.Close() - t.Fatalf("could not start LCOW UVM: %v", err) - } - return uvm -} diff --git a/test/runhcs/e2e_matrix_test.go b/test/runhcs/e2e_matrix_test.go index 8aeb815134..41cb3eb781 100644 --- a/test/runhcs/e2e_matrix_test.go +++ b/test/runhcs/e2e_matrix_test.go @@ -19,7 +19,8 @@ import ( "github.com/Microsoft/go-winio/vhd" "github.com/Microsoft/hcsshim/osversion" runhcs "github.com/Microsoft/hcsshim/pkg/go-runhcs" - testutilities "github.com/Microsoft/hcsshim/test/functional/utilities" + "github.com/Microsoft/hcsshim/test/internal/layers" + "github.com/Microsoft/hcsshim/test/internal/require" runc "github.com/containerd/go-runc" "github.com/opencontainers/runtime-tools/generate" "github.com/pkg/errors" @@ -167,7 +168,7 @@ func testWindows(t *testing.T, version int, isolated bool) { var err error // Make the bundle - bundle := testutilities.CreateTempDir(t) + bundle := t.TempDir() defer func() { if err == nil { os.RemoveAll(bundle) @@ -175,7 +176,7 @@ func testWindows(t *testing.T, version int, isolated bool) { t.Errorf("additional logs at bundle path: %v", bundle) } }() - scratch := testutilities.CreateTempDir(t) + scratch := t.TempDir() defer func() { vhd.DetachVhd(filepath.Join(scratch, "sandbox.vhdx")) os.RemoveAll(scratch) @@ -195,7 +196,7 @@ func testWindows(t *testing.T, version int, isolated bool) { // Get the LayerFolders imageName := getWindowsImageNameByVersion(t, version) - layers := testutilities.LayerFolders(t, imageName) + layers := layers.LayerFolders(t, imageName) for _, layer := range layers { g.AddWindowsLayerFolders(layer) } @@ -311,25 +312,25 @@ func testLCOWPod(t *testing.T) { } func Test_RS1_Argon(t *testing.T) { - testutilities.RequiresExactBuild(t, osversion.RS1) + require.ExactBuild(t, osversion.RS1) testWindows(t, osversion.RS1, false) } func Test_RS1_Xenon(t *testing.T) { - testutilities.RequiresExactBuild(t, osversion.RS1) + require.ExactBuild(t, osversion.RS1) testWindows(t, osversion.RS1, true) } func Test_RS3_Argon(t *testing.T) { - testutilities.RequiresExactBuild(t, osversion.RS3) + require.ExactBuild(t, osversion.RS3) testWindows(t, osversion.RS3, false) } func Test_RS3_Xenon(t *testing.T) { - testutilities.RequiresExactBuild(t, osversion.RS3) + require.ExactBuild(t, osversion.RS3) guests := []int{osversion.RS1, osversion.RS3} for _, g := range guests { @@ -338,13 +339,13 @@ func Test_RS3_Xenon(t *testing.T) { } func Test_RS4_Argon(t *testing.T) { - testutilities.RequiresExactBuild(t, osversion.RS4) + require.ExactBuild(t, osversion.RS4) testWindows(t, osversion.RS4, false) } func Test_RS4_Xenon(t *testing.T) { - testutilities.RequiresExactBuild(t, osversion.RS4) + require.ExactBuild(t, osversion.RS4) guests := []int{osversion.RS1, osversion.RS3, osversion.RS4} for _, g := range guests { @@ -353,19 +354,19 @@ func Test_RS4_Xenon(t *testing.T) { } func Test_RS5_Argon(t *testing.T) { - testutilities.RequiresExactBuild(t, osversion.RS5) + require.ExactBuild(t, osversion.RS5) testWindows(t, osversion.RS5, false) } func Test_RS5_ArgonPods(t *testing.T) { - testutilities.RequiresExactBuild(t, osversion.RS5) + require.ExactBuild(t, osversion.RS5) testWindowsPod(t, osversion.RS5, false) } func Test_RS5_UVMAndContainer(t *testing.T) { - testutilities.RequiresExactBuild(t, osversion.RS5) + require.ExactBuild(t, osversion.RS5) guests := []int{osversion.RS1, osversion.RS3, osversion.RS4, osversion.RS5} for _, g := range guests { @@ -374,19 +375,19 @@ func Test_RS5_UVMAndContainer(t *testing.T) { } func Test_RS5_UVMPods(t *testing.T) { - testutilities.RequiresExactBuild(t, osversion.RS5) + require.ExactBuild(t, osversion.RS5) testWindowsPod(t, osversion.RS5, true) } func Test_RS5_LCOW(t *testing.T) { - testutilities.RequiresExactBuild(t, osversion.RS5) + require.ExactBuild(t, osversion.RS5) testLCOW(t) } func Test_RS5_LCOW_UVMPods(t *testing.T) { - testutilities.RequiresExactBuild(t, osversion.RS5) + require.ExactBuild(t, osversion.RS5) testLCOWPod(t) } diff --git a/test/runhcs/runhcs_test.go b/test/runhcs/runhcs_test.go index 6e7b98152e..24cf5ed1bd 100644 --- a/test/runhcs/runhcs_test.go +++ b/test/runhcs/runhcs_test.go @@ -4,5 +4,5 @@ package runhcs import ( - _ "github.com/Microsoft/hcsshim/test/functional/manifest" + _ "github.com/Microsoft/hcsshim/test/internal/manifest" ) diff --git a/test/vendor/github.com/Microsoft/hcsshim/Makefile b/test/vendor/github.com/Microsoft/hcsshim/Makefile index 3e05b3f7a9..c11786ce3a 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/Makefile +++ b/test/vendor/github.com/Microsoft/hcsshim/Makefile @@ -1,4 +1,5 @@ BASE:=base.tar.gz +DEV_BUILD:=0 GO:=go GO_FLAGS:=-ldflags "-s -w" # strip Go binaries @@ -13,11 +14,14 @@ ifeq "$(GOMODVENDOR)" "1" GO_FLAGS_EXTRA += -mod=vendor endif GO_BUILD:=CGO_ENABLED=$(CGO_ENABLED) $(GO) build $(GO_FLAGS) $(GO_FLAGS_EXTRA) -GO_TEST_BUILD:=CGO_ENABLED=$(CGO_ENABLED) $(GO) test $(GO_FLAGS) $(GO_FLAGS_EXTRA) -c SRCROOT=$(dir $(abspath $(firstword $(MAKEFILE_LIST)))) -# additional directories to search for rule prerequisites and targets -VPATH=$(SRCROOT) + +DELTA_TARGET=out/delta.tar.gz + +ifeq "$(DEV_BUILD)" "1" +DELTA_TARGET=out/delta-dev.tar.gz +endif # The link aliases for gcstools GCS_TOOLS=\ @@ -43,42 +47,47 @@ out/rootfs.vhd: out/rootfs.tar.gz bin/cmd/tar2ext4 gzip -f -d ./out/rootfs.tar.gz bin/cmd/tar2ext4 -vhd -i ./out/rootfs.tar -o $@ -out/rootfs.tar.gz: out/initrd.img - rm -rf rootfs-conv - mkdir rootfs-conv - gunzip -c out/initrd.img | (cd rootfs-conv && cpio -imd) - tar -zcf $@ -C rootfs-conv . - rm -rf rootfs-conv - -out/initrd.img: $(BASE) out/delta.tar.gz $(SRCROOT)/hack/catcpio.sh - $(SRCROOT)/hack/catcpio.sh "$(BASE)" out/delta.tar.gz > out/initrd.img.uncompressed - gzip -c out/initrd.img.uncompressed > $@ - rm out/initrd.img.uncompressed - out/delta.tar.gz: bin/init bin/vsockexec bin/cmd/gcs bin/cmd/gcstools bin/cmd/hooks/wait-paths Makefile @mkdir -p out rm -rf rootfs mkdir -p rootfs/bin/ - mkdir -p rootfs/info/ cp bin/init rootfs/ cp bin/vsockexec rootfs/bin/ cp bin/cmd/gcs rootfs/bin/ cp bin/cmd/gcstools rootfs/bin/ cp bin/cmd/hooks/wait-paths rootfs/bin/ for tool in $(GCS_TOOLS); do ln -s gcstools rootfs/bin/$$tool; done - git -C $(SRCROOT) rev-parse HEAD > rootfs/info/gcs.commit && \ - git -C $(SRCROOT) rev-parse --abbrev-ref HEAD > rootfs/info/gcs.branch && \ - date --iso-8601=minute --utc > rootfs/info/tar.date - $(if $(realpath $(subst .tar,.testdata.json,$(BASE))), \ - jq -r '.IMAGE_NAME' $(subst .tar,.testdata.json,$(BASE)) 2>/dev/null > rootfs/info/image.name && \ - jq -r '.DATETIME' $(subst .tar,.testdata.json,$(BASE)) 2>/dev/null > rootfs/info/build.date ) + git -C $(SRCROOT) rev-parse HEAD > rootfs/gcs.commit && \ + git -C $(SRCROOT) rev-parse --abbrev-ref HEAD > rootfs/gcs.branch tar -zcf $@ -C rootfs . rm -rf rootfs +# This target includes utilities which may be useful for testing purposes. +out/delta-dev.tar.gz: out/delta.tar.gz bin/internal/tools/snp-report + rm -rf rootfs-dev + mkdir rootfs-dev + tar -xzf out/delta.tar.gz -C rootfs-dev + cp bin/internal/tools/snp-report rootfs-dev/bin/ + tar -zcf $@ -C rootfs-dev . + rm -rf rootfs-dev + +out/rootfs.tar.gz: out/initrd.img + rm -rf rootfs-conv + mkdir rootfs-conv + gunzip -c out/initrd.img | (cd rootfs-conv && cpio -imd) + tar -zcf $@ -C rootfs-conv . + rm -rf rootfs-conv + +out/initrd.img: $(BASE) $(DELTA_TARGET) $(SRCROOT)/hack/catcpio.sh + $(SRCROOT)/hack/catcpio.sh "$(BASE)" $(DELTA_TARGET) > out/initrd.img.uncompressed + gzip -c out/initrd.img.uncompressed > $@ + rm out/initrd.img.uncompressed + -include deps/cmd/gcs.gomake -include deps/cmd/gcstools.gomake -include deps/cmd/hooks/wait-paths.gomake -include deps/cmd/tar2ext4.gomake +-include deps/internal/tools/snp-report.gomake # Implicit rule for includes that define Go targets. %.gomake: $(SRCROOT)/Makefile @@ -92,6 +101,8 @@ out/delta.tar.gz: bin/init bin/vsockexec bin/cmd/gcs bin/cmd/gcstools bin/cmd/ho @/bin/echo -e '-include $(@:%.gomake=%.godeps)' >> $@.new mv $@.new $@ +VPATH=$(SRCROOT) + bin/vsockexec: vsockexec/vsockexec.o vsockexec/vsock.o @mkdir -p bin $(CC) $(LDFLAGS) -o $@ $^ diff --git a/test/vendor/github.com/containerd/containerd/pkg/cri/constants/constants.go b/test/vendor/github.com/containerd/containerd/pkg/cri/constants/constants.go new file mode 100644 index 0000000000..b382215025 --- /dev/null +++ b/test/vendor/github.com/containerd/containerd/pkg/cri/constants/constants.go @@ -0,0 +1,26 @@ +/* + 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 constants + +// TODO(random-liu): Merge annotations package into this package. + +const ( + // K8sContainerdNamespace is the namespace we use to connect containerd. + K8sContainerdNamespace = "k8s.io" + // CRIVersion is the CRI version supported by the CRI plugin. + CRIVersion = "v1alpha2" +) diff --git a/test/vendor/github.com/containerd/containerd/pkg/cri/util/deep_copy.go b/test/vendor/github.com/containerd/containerd/pkg/cri/util/deep_copy.go new file mode 100644 index 0000000000..d0e0bf37ef --- /dev/null +++ b/test/vendor/github.com/containerd/containerd/pkg/cri/util/deep_copy.go @@ -0,0 +1,42 @@ +/* + 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 util + +import ( + "encoding/json" + + "github.com/pkg/errors" +) + +// DeepCopy makes a deep copy from src into dst. +func DeepCopy(dst interface{}, src interface{}) error { + if dst == nil { + return errors.New("dst cannot be nil") + } + if src == nil { + return errors.New("src cannot be nil") + } + bytes, err := json.Marshal(src) + if err != nil { + return errors.Wrap(err, "unable to marshal src") + } + err = json.Unmarshal(bytes, dst) + if err != nil { + return errors.Wrap(err, "unable to unmarshal into dst") + } + return nil +} diff --git a/test/vendor/github.com/containerd/containerd/pkg/cri/util/id.go b/test/vendor/github.com/containerd/containerd/pkg/cri/util/id.go new file mode 100644 index 0000000000..90f762ba70 --- /dev/null +++ b/test/vendor/github.com/containerd/containerd/pkg/cri/util/id.go @@ -0,0 +1,29 @@ +/* + 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 util + +import ( + "encoding/hex" + "math/rand" +) + +// GenerateID generates a random unique id. +func GenerateID() string { + b := make([]byte, 32) + rand.Read(b) + return hex.EncodeToString(b) +} diff --git a/test/vendor/github.com/containerd/containerd/pkg/cri/util/image.go b/test/vendor/github.com/containerd/containerd/pkg/cri/util/image.go new file mode 100644 index 0000000000..d3abcd31a6 --- /dev/null +++ b/test/vendor/github.com/containerd/containerd/pkg/cri/util/image.go @@ -0,0 +1,33 @@ +/* + 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 util + +import ( + "github.com/containerd/containerd/reference/docker" +) + +// NormalizeImageRef normalizes the image reference following the docker convention. This is added +// mainly for backward compatibility. +// The reference returned can only be either tagged or digested. For reference contains both tag +// and digest, the function returns digested reference, e.g. docker.io/library/busybox:latest@ +// sha256:7cc4b5aefd1d0cadf8d97d4350462ba51c694ebca145b08d7d41b41acc8db5aa will be returned as +// docker.io/library/busybox@sha256:7cc4b5aefd1d0cadf8d97d4350462ba51c694ebca145b08d7d41b41acc8db5aa. +// +// Deprecated: use github.com/containerd/containerd/reference/docker.ParseDockerRef() instead +func NormalizeImageRef(ref string) (docker.Named, error) { + return docker.ParseDockerRef(ref) +} diff --git a/test/vendor/github.com/containerd/containerd/pkg/cri/util/strings.go b/test/vendor/github.com/containerd/containerd/pkg/cri/util/strings.go new file mode 100644 index 0000000000..df1a5c91a4 --- /dev/null +++ b/test/vendor/github.com/containerd/containerd/pkg/cri/util/strings.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 util + +import "strings" + +// InStringSlice checks whether a string is inside a string slice. +// Comparison is case insensitive. +func InStringSlice(ss []string, str string) bool { + for _, s := range ss { + if strings.EqualFold(s, str) { + return true + } + } + return false +} + +// SubtractStringSlice subtracts string from string slice. +// Comparison is case insensitive. +func SubtractStringSlice(ss []string, str string) []string { + var res []string + for _, s := range ss { + if strings.EqualFold(s, str) { + continue + } + res = append(res, s) + } + return res +} + +// MergeStringSlices merges 2 string slices into one and remove duplicated elements. +func MergeStringSlices(a []string, b []string) []string { + set := map[string]struct{}{} + for _, s := range a { + set[s] = struct{}{} + } + for _, s := range b { + set[s] = struct{}{} + } + var ss []string + for s := range set { + ss = append(ss, s) + } + return ss +} diff --git a/test/vendor/github.com/containerd/containerd/pkg/cri/util/util.go b/test/vendor/github.com/containerd/containerd/pkg/cri/util/util.go new file mode 100644 index 0000000000..22266ad585 --- /dev/null +++ b/test/vendor/github.com/containerd/containerd/pkg/cri/util/util.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 util + +import ( + "time" + + "github.com/containerd/containerd/namespaces" + "golang.org/x/net/context" + + "github.com/containerd/containerd/pkg/cri/constants" +) + +// deferCleanupTimeout is the default timeout for containerd cleanup operations +// in defer. +const deferCleanupTimeout = 1 * time.Minute + +// DeferContext returns a context for containerd cleanup operations in defer. +// A default timeout is applied to avoid cleanup operation pending forever. +func DeferContext() (context.Context, context.CancelFunc) { + return context.WithTimeout(NamespacedContext(), deferCleanupTimeout) +} + +// NamespacedContext returns a context with kubernetes namespace set. +func NamespacedContext() context.Context { + return WithNamespace(context.Background()) +} + +// WithNamespace adds kubernetes namespace to the context. +func WithNamespace(ctx context.Context) context.Context { + return namespaces.WithNamespace(ctx, constants.K8sContainerdNamespace) +} diff --git a/test/vendor/github.com/containerd/containerd/remotes/docker/config/config_unix.go b/test/vendor/github.com/containerd/containerd/remotes/docker/config/config_unix.go new file mode 100644 index 0000000000..8245c4d70b --- /dev/null +++ b/test/vendor/github.com/containerd/containerd/remotes/docker/config/config_unix.go @@ -0,0 +1,40 @@ +// +build !windows + +/* + 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 config + +import ( + "crypto/x509" + "path/filepath" +) + +func hostPaths(root, host string) []string { + ch := hostDirectory(host) + if ch == host { + return []string{filepath.Join(root, host)} + } + + return []string{ + filepath.Join(root, ch), + filepath.Join(root, host), + } +} + +func rootSystemPool() (*x509.CertPool, error) { + return x509.SystemCertPool() +} diff --git a/test/vendor/github.com/containerd/containerd/remotes/docker/config/config_windows.go b/test/vendor/github.com/containerd/containerd/remotes/docker/config/config_windows.go new file mode 100644 index 0000000000..948b653963 --- /dev/null +++ b/test/vendor/github.com/containerd/containerd/remotes/docker/config/config_windows.go @@ -0,0 +1,41 @@ +// +build windows + +/* + 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 config + +import ( + "crypto/x509" + "path/filepath" + "strings" +) + +func hostPaths(root, host string) []string { + ch := hostDirectory(host) + if ch == host { + return []string{filepath.Join(root, host)} + } + + return []string{ + filepath.Join(root, strings.Replace(ch, ":", "", -1)), + filepath.Join(root, strings.Replace(host, ":", "", -1)), + } +} + +func rootSystemPool() (*x509.CertPool, error) { + return x509.NewCertPool(), nil +} diff --git a/test/vendor/github.com/containerd/containerd/remotes/docker/config/hosts.go b/test/vendor/github.com/containerd/containerd/remotes/docker/config/hosts.go new file mode 100644 index 0000000000..b24ba33f54 --- /dev/null +++ b/test/vendor/github.com/containerd/containerd/remotes/docker/config/hosts.go @@ -0,0 +1,557 @@ +/* + 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 config contains utilities for helping configure the Docker resolver +package config + +import ( + "context" + "crypto/tls" + "io/ioutil" + "net" + "net/http" + "net/url" + "os" + "path" + "path/filepath" + "sort" + "strings" + "time" + + "github.com/containerd/containerd/errdefs" + "github.com/containerd/containerd/log" + "github.com/containerd/containerd/remotes/docker" + "github.com/pelletier/go-toml" + "github.com/pkg/errors" +) + +// UpdateClientFunc is a function that lets you to amend http Client behavior used by registry clients. +type UpdateClientFunc func(client *http.Client) error + +type hostConfig struct { + scheme string + host string + path string + + capabilities docker.HostCapabilities + + caCerts []string + clientPairs [][2]string + skipVerify *bool + + header http.Header + + // TODO: API ("docker" or "oci") + // TODO: API Version ("v1", "v2") + // TODO: Add credential configuration (domain alias, username) +} + +// HostOptions is used to configure registry hosts +type HostOptions struct { + HostDir func(string) (string, error) + Credentials func(host string) (string, string, error) + DefaultTLS *tls.Config + DefaultScheme string + // UpdateClient will be called after creating http.Client object, so clients can provide extra configuration + UpdateClient UpdateClientFunc +} + +// ConfigureHosts creates a registry hosts function from the provided +// host creation options. The host directory can read hosts.toml or +// certificate files laid out in the Docker specific layout. +// If a `HostDir` function is not required, defaults are used. +func ConfigureHosts(ctx context.Context, options HostOptions) docker.RegistryHosts { + return func(host string) ([]docker.RegistryHost, error) { + var hosts []hostConfig + if options.HostDir != nil { + dir, err := options.HostDir(host) + if err != nil && !errdefs.IsNotFound(err) { + return nil, err + } + if dir != "" { + log.G(ctx).WithField("dir", dir).Debug("loading host directory") + hosts, err = loadHostDir(ctx, dir) + if err != nil { + return nil, err + } + } + } + + // If hosts was not set, add a default host + // NOTE: Check nil here and not empty, the host may be + // intentionally configured to not have any endpoints + if hosts == nil { + hosts = make([]hostConfig, 1) + } + if len(hosts) > 0 && hosts[len(hosts)-1].host == "" { + if host == "docker.io" { + hosts[len(hosts)-1].scheme = "https" + hosts[len(hosts)-1].host = "registry-1.docker.io" + } else { + hosts[len(hosts)-1].host = host + if options.DefaultScheme != "" { + hosts[len(hosts)-1].scheme = options.DefaultScheme + } else { + hosts[len(hosts)-1].scheme = "https" + } + } + hosts[len(hosts)-1].path = "/v2" + hosts[len(hosts)-1].capabilities = docker.HostCapabilityPull | docker.HostCapabilityResolve | docker.HostCapabilityPush + } + + var defaultTLSConfig *tls.Config + if options.DefaultTLS != nil { + defaultTLSConfig = options.DefaultTLS + } else { + defaultTLSConfig = &tls.Config{} + } + + defaultTransport := &http.Transport{ + Proxy: http.ProxyFromEnvironment, + DialContext: (&net.Dialer{ + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + FallbackDelay: 300 * time.Millisecond, + }).DialContext, + MaxIdleConns: 10, + IdleConnTimeout: 30 * time.Second, + TLSHandshakeTimeout: 10 * time.Second, + TLSClientConfig: defaultTLSConfig, + ExpectContinueTimeout: 5 * time.Second, + } + + client := &http.Client{ + Transport: defaultTransport, + } + if options.UpdateClient != nil { + if err := options.UpdateClient(client); err != nil { + return nil, err + } + } + + authOpts := []docker.AuthorizerOpt{docker.WithAuthClient(client)} + if options.Credentials != nil { + authOpts = append(authOpts, docker.WithAuthCreds(options.Credentials)) + } + authorizer := docker.NewDockerAuthorizer(authOpts...) + + rhosts := make([]docker.RegistryHost, len(hosts)) + for i, host := range hosts { + + rhosts[i].Scheme = host.scheme + rhosts[i].Host = host.host + rhosts[i].Path = host.path + rhosts[i].Capabilities = host.capabilities + rhosts[i].Header = host.header + + if host.caCerts != nil || host.clientPairs != nil || host.skipVerify != nil { + tr := defaultTransport.Clone() + tlsConfig := tr.TLSClientConfig + if host.skipVerify != nil { + tlsConfig.InsecureSkipVerify = *host.skipVerify + } + if host.caCerts != nil { + if tlsConfig.RootCAs == nil { + rootPool, err := rootSystemPool() + if err != nil { + return nil, errors.Wrap(err, "unable to initialize cert pool") + } + tlsConfig.RootCAs = rootPool + } + for _, f := range host.caCerts { + data, err := ioutil.ReadFile(f) + if err != nil { + return nil, errors.Wrapf(err, "unable to read CA cert %q", f) + } + if !tlsConfig.RootCAs.AppendCertsFromPEM(data) { + return nil, errors.Errorf("unable to load CA cert %q", f) + } + } + } + + if host.clientPairs != nil { + for _, pair := range host.clientPairs { + certPEMBlock, err := ioutil.ReadFile(pair[0]) + if err != nil { + return nil, errors.Wrapf(err, "unable to read CERT file %q", pair[0]) + } + var keyPEMBlock []byte + if pair[1] != "" { + keyPEMBlock, err = ioutil.ReadFile(pair[1]) + if err != nil { + return nil, errors.Wrapf(err, "unable to read CERT file %q", pair[1]) + } + } else { + // Load key block from same PEM file + keyPEMBlock = certPEMBlock + } + cert, err := tls.X509KeyPair(certPEMBlock, keyPEMBlock) + if err != nil { + return nil, errors.Wrap(err, "failed to load X509 key pair") + } + + tlsConfig.Certificates = append(tlsConfig.Certificates, cert) + } + } + + c := *client + c.Transport = tr + if options.UpdateClient != nil { + if err := options.UpdateClient(&c); err != nil { + return nil, err + } + } + + rhosts[i].Client = &c + rhosts[i].Authorizer = docker.NewDockerAuthorizer(append(authOpts, docker.WithAuthClient(&c))...) + } else { + rhosts[i].Client = client + rhosts[i].Authorizer = authorizer + } + } + + return rhosts, nil + } + +} + +// HostDirFromRoot returns a function which finds a host directory +// based at the given root. +func HostDirFromRoot(root string) func(string) (string, error) { + return func(host string) (string, error) { + for _, p := range hostPaths(root, host) { + if _, err := os.Stat(p); err == nil { + return p, nil + } else if !os.IsNotExist(err) { + return "", err + } + } + return "", errdefs.ErrNotFound + } +} + +// hostDirectory converts ":port" to "_port_" in directory names +func hostDirectory(host string) string { + idx := strings.LastIndex(host, ":") + if idx > 0 { + return host[:idx] + "_" + host[idx+1:] + "_" + } + return host +} + +func loadHostDir(ctx context.Context, hostsDir string) ([]hostConfig, error) { + b, err := ioutil.ReadFile(filepath.Join(hostsDir, "hosts.toml")) + if err != nil && !os.IsNotExist(err) { + return nil, err + } + + if len(b) == 0 { + // If hosts.toml does not exist, fallback to checking for + // certificate files based on Docker's certificate file + // pattern (".crt", ".cert", ".key" files) + return loadCertFiles(ctx, hostsDir) + } + + hosts, err := parseHostsFile(hostsDir, b) + if err != nil { + log.G(ctx).WithError(err).Error("failed to decode hosts.toml") + // Fallback to checking certificate files + return loadCertFiles(ctx, hostsDir) + } + + return hosts, nil +} + +type hostFileConfig struct { + // Capabilities determine what operations a host is + // capable of performing. Allowed values + // - pull + // - resolve + // - push + Capabilities []string `toml:"capabilities"` + + // CACert can be a string or an array of strings + CACert interface{} `toml:"ca"` + + // TODO: Make this an array (two key types, one for pairs (multiple files), one for single file?) + Client interface{} `toml:"client"` + + SkipVerify *bool `toml:"skip_verify"` + + Header map[string]interface{} `toml:"header"` + + // API (default: "docker") + // API Version (default: "v2") + // Credentials: helper? name? username? alternate domain? token? +} + +func parseHostsFile(baseDir string, b []byte) ([]hostConfig, error) { + tree, err := toml.LoadBytes(b) + if err != nil { + return nil, errors.Wrap(err, "failed to parse TOML") + } + + // HACK: we want to keep toml parsing structures private in this package, however go-toml ignores private embedded types. + // so we remap it to a public type within the func body, so technically it's public, but not possible to import elsewhere. + type HostFileConfig = hostFileConfig + + c := struct { + HostFileConfig + // Server specifies the default server. When `host` is + // also specified, those hosts are tried first. + Server string `toml:"server"` + // HostConfigs store the per-host configuration + HostConfigs map[string]hostFileConfig `toml:"host"` + }{} + + orderedHosts, err := getSortedHosts(tree) + if err != nil { + return nil, err + } + + var ( + hosts []hostConfig + ) + + if err := tree.Unmarshal(&c); err != nil { + return nil, err + } + + // Parse hosts array + for _, host := range orderedHosts { + config := c.HostConfigs[host] + + parsed, err := parseHostConfig(host, baseDir, config) + if err != nil { + return nil, err + } + hosts = append(hosts, parsed) + } + + // Parse root host config and append it as the last element + parsed, err := parseHostConfig(c.Server, baseDir, c.HostFileConfig) + if err != nil { + return nil, err + } + hosts = append(hosts, parsed) + + return hosts, nil +} + +func parseHostConfig(server string, baseDir string, config hostFileConfig) (hostConfig, error) { + var ( + result = hostConfig{} + err error + ) + + if server != "" { + if !strings.HasPrefix(server, "http") { + server = "https://" + server + } + u, err := url.Parse(server) + if err != nil { + return hostConfig{}, errors.Wrapf(err, "unable to parse server %v", server) + } + result.scheme = u.Scheme + result.host = u.Host + // TODO: Handle path based on registry protocol + // Define a registry protocol type + // OCI v1 - Always use given path as is + // Docker v2 - Always ensure ends with /v2/ + if len(u.Path) > 0 { + u.Path = path.Clean(u.Path) + if !strings.HasSuffix(u.Path, "/v2") { + u.Path = u.Path + "/v2" + } + } else { + u.Path = "/v2" + } + result.path = u.Path + } + + result.skipVerify = config.SkipVerify + + if len(config.Capabilities) > 0 { + for _, c := range config.Capabilities { + switch strings.ToLower(c) { + case "pull": + result.capabilities |= docker.HostCapabilityPull + case "resolve": + result.capabilities |= docker.HostCapabilityResolve + case "push": + result.capabilities |= docker.HostCapabilityPush + default: + return hostConfig{}, errors.Errorf("unknown capability %v", c) + } + } + } else { + result.capabilities = docker.HostCapabilityPull | docker.HostCapabilityResolve | docker.HostCapabilityPush + } + + if config.CACert != nil { + switch cert := config.CACert.(type) { + case string: + result.caCerts = []string{makeAbsPath(cert, baseDir)} + case []interface{}: + result.caCerts, err = makeStringSlice(cert, func(p string) string { + return makeAbsPath(p, baseDir) + }) + if err != nil { + return hostConfig{}, err + } + default: + return hostConfig{}, errors.Errorf("invalid type %v for \"ca\"", cert) + } + } + + if config.Client != nil { + switch client := config.Client.(type) { + case string: + result.clientPairs = [][2]string{{makeAbsPath(client, baseDir), ""}} + case []interface{}: + // []string or [][2]string + for _, pairs := range client { + switch p := pairs.(type) { + case string: + result.clientPairs = append(result.clientPairs, [2]string{makeAbsPath(p, baseDir), ""}) + case []interface{}: + slice, err := makeStringSlice(p, func(s string) string { + return makeAbsPath(s, baseDir) + }) + if err != nil { + return hostConfig{}, err + } + if len(slice) != 2 { + return hostConfig{}, errors.Errorf("invalid pair %v for \"client\"", p) + } + + var pair [2]string + copy(pair[:], slice) + result.clientPairs = append(result.clientPairs, pair) + default: + return hostConfig{}, errors.Errorf("invalid type %T for \"client\"", p) + } + } + default: + return hostConfig{}, errors.Errorf("invalid type %v for \"client\"", client) + } + } + + if config.Header != nil { + header := http.Header{} + for key, ty := range config.Header { + switch value := ty.(type) { + case string: + header[key] = []string{value} + case []interface{}: + header[key], err = makeStringSlice(value, nil) + if err != nil { + return hostConfig{}, err + } + default: + return hostConfig{}, errors.Errorf("invalid type %v for header %q", ty, key) + } + } + result.header = header + } + + return result, nil +} + +// getSortedHosts returns the list of hosts as they defined in the file. +func getSortedHosts(root *toml.Tree) ([]string, error) { + iter, ok := root.Get("host").(*toml.Tree) + if !ok { + return nil, errors.Errorf("invalid `host` tree") + } + + list := append([]string{}, iter.Keys()...) + + // go-toml stores TOML sections in the map object, so no order guaranteed. + // We retrieve line number for each key and sort the keys by position. + sort.Slice(list, func(i, j int) bool { + h1 := iter.GetPath([]string{list[i]}).(*toml.Tree) + h2 := iter.GetPath([]string{list[j]}).(*toml.Tree) + return h1.Position().Line < h2.Position().Line + }) + + return list, nil +} + +// makeStringSlice is a helper func to convert from []interface{} to []string. +// Additionally an optional cb func may be passed to perform string mapping. +func makeStringSlice(slice []interface{}, cb func(string) string) ([]string, error) { + out := make([]string, len(slice)) + for i, value := range slice { + str, ok := value.(string) + if !ok { + return nil, errors.Errorf("unable to cast %v to string", value) + } + + if cb != nil { + out[i] = cb(str) + } else { + out[i] = str + } + } + return out, nil +} + +func makeAbsPath(p string, base string) string { + if filepath.IsAbs(p) { + return p + } + return filepath.Join(base, p) +} + +// loadCertsDir loads certs from certsDir like "/etc/docker/certs.d" . +// Compatible with Docker file layout +// - files ending with ".crt" are treated as CA certificate files +// - files ending with ".cert" are treated as client certificates, and +// files with the same name but ending with ".key" are treated as the +// corresponding private key. +// NOTE: If a ".key" file is missing, this function will just return +// the ".cert", which may contain the private key. If the ".cert" file +// does not contain the private key, the caller should detect and error. +func loadCertFiles(ctx context.Context, certsDir string) ([]hostConfig, error) { + fs, err := ioutil.ReadDir(certsDir) + if err != nil && !os.IsNotExist(err) { + return nil, err + } + hosts := make([]hostConfig, 1) + for _, f := range fs { + if f.IsDir() { + continue + } + if strings.HasSuffix(f.Name(), ".crt") { + hosts[0].caCerts = append(hosts[0].caCerts, filepath.Join(certsDir, f.Name())) + } + if strings.HasSuffix(f.Name(), ".cert") { + var pair [2]string + certFile := f.Name() + pair[0] = filepath.Join(certsDir, certFile) + // Check if key also exists + keyFile := filepath.Join(certsDir, certFile[:len(certFile)-5]+".key") + if _, err := os.Stat(keyFile); err == nil { + pair[1] = keyFile + } else if !os.IsNotExist(err) { + return nil, err + } + hosts[0].clientPairs = append(hosts[0].clientPairs, pair) + } + } + return hosts, nil +} diff --git a/test/vendor/github.com/pelletier/go-toml/.dockerignore b/test/vendor/github.com/pelletier/go-toml/.dockerignore new file mode 100644 index 0000000000..7b5883475d --- /dev/null +++ b/test/vendor/github.com/pelletier/go-toml/.dockerignore @@ -0,0 +1,2 @@ +cmd/tomll/tomll +cmd/tomljson/tomljson diff --git a/test/vendor/github.com/pelletier/go-toml/.gitignore b/test/vendor/github.com/pelletier/go-toml/.gitignore new file mode 100644 index 0000000000..e6ba63a5c5 --- /dev/null +++ b/test/vendor/github.com/pelletier/go-toml/.gitignore @@ -0,0 +1,5 @@ +test_program/test_program_bin +fuzz/ +cmd/tomll/tomll +cmd/tomljson/tomljson +cmd/tomltestgen/tomltestgen diff --git a/test/vendor/github.com/pelletier/go-toml/CONTRIBUTING.md b/test/vendor/github.com/pelletier/go-toml/CONTRIBUTING.md new file mode 100644 index 0000000000..405c911c90 --- /dev/null +++ b/test/vendor/github.com/pelletier/go-toml/CONTRIBUTING.md @@ -0,0 +1,132 @@ +## Contributing + +Thank you for your interest in go-toml! We appreciate you considering +contributing to go-toml! + +The main goal is the project is to provide an easy-to-use TOML +implementation for Go that gets the job done and gets out of your way – +dealing with TOML is probably not the central piece of your project. + +As the single maintainer of go-toml, time is scarce. All help, big or +small, is more than welcomed! + +### Ask questions + +Any question you may have, somebody else might have it too. Always feel +free to ask them on the [issues tracker][issues-tracker]. We will try to +answer them as clearly and quickly as possible, time permitting. + +Asking questions also helps us identify areas where the documentation needs +improvement, or new features that weren't envisioned before. Sometimes, a +seemingly innocent question leads to the fix of a bug. Don't hesitate and +ask away! + +### Improve the documentation + +The best way to share your knowledge and experience with go-toml is to +improve the documentation. Fix a typo, clarify an interface, add an +example, anything goes! + +The documentation is present in the [README][readme] and thorough the +source code. On release, it gets updated on [GoDoc][godoc]. To make a +change to the documentation, create a pull request with your proposed +changes. For simple changes like that, the easiest way to go is probably +the "Fork this project and edit the file" button on Github, displayed at +the top right of the file. Unless it's a trivial change (for example a +typo), provide a little bit of context in your pull request description or +commit message. + +### Report a bug + +Found a bug! Sorry to hear that :(. Help us and other track them down and +fix by reporting it. [File a new bug report][bug-report] on the [issues +tracker][issues-tracker]. The template should provide enough guidance on +what to include. When in doubt: add more details! By reducing ambiguity and +providing more information, it decreases back and forth and saves everyone +time. + +### Code changes + +Want to contribute a patch? Very happy to hear that! + +First, some high-level rules: + +* A short proposal with some POC code is better than a lengthy piece of + text with no code. Code speaks louder than words. +* No backward-incompatible patch will be accepted unless discussed. + Sometimes it's hard, and Go's lack of versioning by default does not + help, but we try not to break people's programs unless we absolutely have + to. +* If you are writing a new feature or extending an existing one, make sure + to write some documentation. +* Bug fixes need to be accompanied with regression tests. +* New code needs to be tested. +* Your commit messages need to explain why the change is needed, even if + already included in the PR description. + +It does sound like a lot, but those best practices are here to save time +overall and continuously improve the quality of the project, which is +something everyone benefits from. + +#### Get started + +The fairly standard code contribution process looks like that: + +1. [Fork the project][fork]. +2. Make your changes, commit on any branch you like. +3. [Open up a pull request][pull-request] +4. Review, potential ask for changes. +5. Merge. You're in! + +Feel free to ask for help! You can create draft pull requests to gather +some early feedback! + +#### Run the tests + +You can run tests for go-toml using Go's test tool: `go test ./...`. +When creating a pull requests, all tests will be ran on Linux on a few Go +versions (Travis CI), and on Windows using the latest Go version +(AppVeyor). + +#### Style + +Try to look around and follow the same format and structure as the rest of +the code. We enforce using `go fmt` on the whole code base. + +--- + +### Maintainers-only + +#### Merge pull request + +Checklist: + +* Passing CI. +* Does not introduce backward-incompatible changes (unless discussed). +* Has relevant doc changes. +* Has relevant unit tests. + +1. Merge using "squash and merge". +2. Make sure to edit the commit message to keep all the useful information + nice and clean. +3. Make sure the commit title is clear and contains the PR number (#123). + +#### New release + +1. Go to [releases][releases]. Click on "X commits to master since this + release". +2. Make note of all the changes. Look for backward incompatible changes, + new features, and bug fixes. +3. Pick the new version using the above and semver. +4. Create a [new release][new-release]. +5. Follow the same format as [1.1.0][release-110]. + +[issues-tracker]: https://github.com/pelletier/go-toml/issues +[bug-report]: https://github.com/pelletier/go-toml/issues/new?template=bug_report.md +[godoc]: https://godoc.org/github.com/pelletier/go-toml +[readme]: ./README.md +[fork]: https://help.github.com/articles/fork-a-repo +[pull-request]: https://help.github.com/en/articles/creating-a-pull-request +[releases]: https://github.com/pelletier/go-toml/releases +[new-release]: https://github.com/pelletier/go-toml/releases/new +[release-110]: https://github.com/pelletier/go-toml/releases/tag/v1.1.0 diff --git a/test/vendor/github.com/pelletier/go-toml/Dockerfile b/test/vendor/github.com/pelletier/go-toml/Dockerfile new file mode 100644 index 0000000000..fffdb01666 --- /dev/null +++ b/test/vendor/github.com/pelletier/go-toml/Dockerfile @@ -0,0 +1,11 @@ +FROM golang:1.12-alpine3.9 as builder +WORKDIR /go/src/github.com/pelletier/go-toml +COPY . . +ENV CGO_ENABLED=0 +ENV GOOS=linux +RUN go install ./... + +FROM scratch +COPY --from=builder /go/bin/tomll /usr/bin/tomll +COPY --from=builder /go/bin/tomljson /usr/bin/tomljson +COPY --from=builder /go/bin/jsontoml /usr/bin/jsontoml diff --git a/test/vendor/github.com/pelletier/go-toml/LICENSE b/test/vendor/github.com/pelletier/go-toml/LICENSE new file mode 100644 index 0000000000..583bdae628 --- /dev/null +++ b/test/vendor/github.com/pelletier/go-toml/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013 - 2017 Thomas Pelletier, Eric Anderton + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/test/vendor/github.com/pelletier/go-toml/Makefile b/test/vendor/github.com/pelletier/go-toml/Makefile new file mode 100644 index 0000000000..9e4503aea6 --- /dev/null +++ b/test/vendor/github.com/pelletier/go-toml/Makefile @@ -0,0 +1,29 @@ +export CGO_ENABLED=0 +go := go +go.goos ?= $(shell echo `go version`|cut -f4 -d ' '|cut -d '/' -f1) +go.goarch ?= $(shell echo `go version`|cut -f4 -d ' '|cut -d '/' -f2) + +out.tools := tomll tomljson jsontoml +out.dist := $(out.tools:=_$(go.goos)_$(go.goarch).tar.xz) +sources := $(wildcard **/*.go) + + +.PHONY: +tools: $(out.tools) + +$(out.tools): $(sources) + GOOS=$(go.goos) GOARCH=$(go.goarch) $(go) build ./cmd/$@ + +.PHONY: +dist: $(out.dist) + +$(out.dist):%_$(go.goos)_$(go.goarch).tar.xz: % + if [ "$(go.goos)" = "windows" ]; then \ + tar -cJf $@ $^.exe; \ + else \ + tar -cJf $@ $^; \ + fi + +.PHONY: +clean: + rm -rf $(out.tools) $(out.dist) diff --git a/test/vendor/github.com/pelletier/go-toml/PULL_REQUEST_TEMPLATE.md b/test/vendor/github.com/pelletier/go-toml/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000..041cdc4a2f --- /dev/null +++ b/test/vendor/github.com/pelletier/go-toml/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,5 @@ +**Issue:** add link to pelletier/go-toml issue here + +Explanation of what this pull request does. + +More detailed description of the decisions being made and the reasons why (if the patch is non-trivial). diff --git a/test/vendor/github.com/pelletier/go-toml/README.md b/test/vendor/github.com/pelletier/go-toml/README.md new file mode 100644 index 0000000000..6831deb5bd --- /dev/null +++ b/test/vendor/github.com/pelletier/go-toml/README.md @@ -0,0 +1,151 @@ +# go-toml + +Go library for the [TOML](https://github.com/mojombo/toml) format. + +This library supports TOML version +[v1.0.0-rc.1](https://github.com/toml-lang/toml/blob/master/versions/en/toml-v1.0.0-rc.1.md) + +[![GoDoc](https://godoc.org/github.com/pelletier/go-toml?status.svg)](http://godoc.org/github.com/pelletier/go-toml) +[![license](https://img.shields.io/github/license/pelletier/go-toml.svg)](https://github.com/pelletier/go-toml/blob/master/LICENSE) +[![Build Status](https://dev.azure.com/pelletierthomas/go-toml-ci/_apis/build/status/pelletier.go-toml?branchName=master)](https://dev.azure.com/pelletierthomas/go-toml-ci/_build/latest?definitionId=1&branchName=master) +[![codecov](https://codecov.io/gh/pelletier/go-toml/branch/master/graph/badge.svg)](https://codecov.io/gh/pelletier/go-toml) +[![Go Report Card](https://goreportcard.com/badge/github.com/pelletier/go-toml)](https://goreportcard.com/report/github.com/pelletier/go-toml) +[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fpelletier%2Fgo-toml.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fpelletier%2Fgo-toml?ref=badge_shield) + +## Features + +Go-toml provides the following features for using data parsed from TOML documents: + +* Load TOML documents from files and string data +* Easily navigate TOML structure using Tree +* Marshaling and unmarshaling to and from data structures +* Line & column position data for all parsed elements +* [Query support similar to JSON-Path](query/) +* Syntax errors contain line and column numbers + +## Import + +```go +import "github.com/pelletier/go-toml" +``` + +## Usage example + +Read a TOML document: + +```go +config, _ := toml.Load(` +[postgres] +user = "pelletier" +password = "mypassword"`) +// retrieve data directly +user := config.Get("postgres.user").(string) + +// or using an intermediate object +postgresConfig := config.Get("postgres").(*toml.Tree) +password := postgresConfig.Get("password").(string) +``` + +Or use Unmarshal: + +```go +type Postgres struct { + User string + Password string +} +type Config struct { + Postgres Postgres +} + +doc := []byte(` +[Postgres] +User = "pelletier" +Password = "mypassword"`) + +config := Config{} +toml.Unmarshal(doc, &config) +fmt.Println("user=", config.Postgres.User) +``` + +Or use a query: + +```go +// use a query to gather elements without walking the tree +q, _ := query.Compile("$..[user,password]") +results := q.Execute(config) +for ii, item := range results.Values() { + fmt.Printf("Query result %d: %v\n", ii, item) +} +``` + +## Documentation + +The documentation and additional examples are available at +[godoc.org](http://godoc.org/github.com/pelletier/go-toml). + +## Tools + +Go-toml provides two handy command line tools: + +* `tomll`: Reads TOML files and lints them. + + ``` + go install github.com/pelletier/go-toml/cmd/tomll + tomll --help + ``` +* `tomljson`: Reads a TOML file and outputs its JSON representation. + + ``` + go install github.com/pelletier/go-toml/cmd/tomljson + tomljson --help + ``` + + * `jsontoml`: Reads a JSON file and outputs a TOML representation. + + ``` + go install github.com/pelletier/go-toml/cmd/jsontoml + jsontoml --help + ``` + +### Docker image + +Those tools are also availble as a Docker image from +[dockerhub](https://hub.docker.com/r/pelletier/go-toml). For example, to +use `tomljson`: + +``` +docker run -v $PWD:/workdir pelletier/go-toml tomljson /workdir/example.toml +``` + +Only master (`latest`) and tagged versions are published to dockerhub. You +can build your own image as usual: + +``` +docker build -t go-toml . +``` + +## Contribute + +Feel free to report bugs and patches using GitHub's pull requests system on +[pelletier/go-toml](https://github.com/pelletier/go-toml). Any feedback would be +much appreciated! + +### Run tests + +`go test ./...` + +### Fuzzing + +The script `./fuzz.sh` is available to +run [go-fuzz](https://github.com/dvyukov/go-fuzz) on go-toml. + +## Versioning + +Go-toml follows [Semantic Versioning](http://semver.org/). The supported version +of [TOML](https://github.com/toml-lang/toml) is indicated at the beginning of +this document. The last two major versions of Go are supported +(see [Go Release Policy](https://golang.org/doc/devel/release.html#policy)). + +## License + +The MIT License (MIT). Read [LICENSE](LICENSE). diff --git a/test/vendor/github.com/pelletier/go-toml/azure-pipelines.yml b/test/vendor/github.com/pelletier/go-toml/azure-pipelines.yml new file mode 100644 index 0000000000..ff5376b093 --- /dev/null +++ b/test/vendor/github.com/pelletier/go-toml/azure-pipelines.yml @@ -0,0 +1,230 @@ +trigger: +- master + +stages: +- stage: fuzzit + displayName: "Run Fuzzit" + dependsOn: [] + condition: and(succeeded(), eq(variables['Build.SourceBranchName'], 'master')) + jobs: + - job: submit + displayName: "Submit" + pool: + vmImage: ubuntu-latest + steps: + - task: GoTool@0 + displayName: "Install Go 1.15" + inputs: + version: "1.15" + - script: echo "##vso[task.setvariable variable=PATH]${PATH}:/home/vsts/go/bin/" + - script: mkdir -p ${HOME}/go/src/github.com/pelletier/go-toml + - script: cp -R . ${HOME}/go/src/github.com/pelletier/go-toml + - task: Bash@3 + inputs: + filePath: './fuzzit.sh' + env: + TYPE: fuzzing + FUZZIT_API_KEY: $(FUZZIT_API_KEY) + +- stage: run_checks + displayName: "Check" + dependsOn: [] + jobs: + - job: fmt + displayName: "fmt" + pool: + vmImage: ubuntu-latest + steps: + - task: GoTool@0 + displayName: "Install Go 1.15" + inputs: + version: "1.15" + - task: Go@0 + displayName: "go fmt ./..." + inputs: + command: 'custom' + customCommand: 'fmt' + arguments: './...' + - job: coverage + displayName: "coverage" + pool: + vmImage: ubuntu-latest + steps: + - task: GoTool@0 + displayName: "Install Go 1.15" + inputs: + version: "1.15" + - task: Go@0 + displayName: "Generate coverage" + inputs: + command: 'test' + arguments: "-race -coverprofile=coverage.txt -covermode=atomic" + - task: Bash@3 + inputs: + targetType: 'inline' + script: 'bash <(curl -s https://codecov.io/bash) -t ${CODECOV_TOKEN}' + env: + CODECOV_TOKEN: $(CODECOV_TOKEN) + - job: benchmark + displayName: "benchmark" + pool: + vmImage: ubuntu-latest + steps: + - task: GoTool@0 + displayName: "Install Go 1.15" + inputs: + version: "1.15" + - script: echo "##vso[task.setvariable variable=PATH]${PATH}:/home/vsts/go/bin/" + - task: Bash@3 + inputs: + filePath: './benchmark.sh' + arguments: "master $(Build.Repository.Uri)" + + - job: fuzzing + displayName: "fuzzing" + pool: + vmImage: ubuntu-latest + steps: + - task: GoTool@0 + displayName: "Install Go 1.15" + inputs: + version: "1.15" + - script: echo "##vso[task.setvariable variable=PATH]${PATH}:/home/vsts/go/bin/" + - script: mkdir -p ${HOME}/go/src/github.com/pelletier/go-toml + - script: cp -R . ${HOME}/go/src/github.com/pelletier/go-toml + - task: Bash@3 + inputs: + filePath: './fuzzit.sh' + env: + TYPE: local-regression + + - job: go_unit_tests + displayName: "unit tests" + strategy: + matrix: + linux 1.15: + goVersion: '1.15' + imageName: 'ubuntu-latest' + mac 1.15: + goVersion: '1.15' + imageName: 'macOS-latest' + windows 1.15: + goVersion: '1.15' + imageName: 'windows-latest' + linux 1.14: + goVersion: '1.14' + imageName: 'ubuntu-latest' + mac 1.14: + goVersion: '1.14' + imageName: 'macOS-latest' + windows 1.14: + goVersion: '1.14' + imageName: 'windows-latest' + pool: + vmImage: $(imageName) + steps: + - task: GoTool@0 + displayName: "Install Go $(goVersion)" + inputs: + version: $(goVersion) + - task: Go@0 + displayName: "go test ./..." + inputs: + command: 'test' + arguments: './...' +- stage: build_binaries + displayName: "Build binaries" + dependsOn: run_checks + jobs: + - job: build_binary + displayName: "Build binary" + strategy: + matrix: + linux_amd64: + GOOS: linux + GOARCH: amd64 + darwin_amd64: + GOOS: darwin + GOARCH: amd64 + windows_amd64: + GOOS: windows + GOARCH: amd64 + pool: + vmImage: ubuntu-latest + steps: + - task: GoTool@0 + displayName: "Install Go" + inputs: + version: 1.15 + - task: Bash@3 + inputs: + targetType: inline + script: "make dist" + env: + go.goos: $(GOOS) + go.goarch: $(GOARCH) + - task: CopyFiles@2 + inputs: + sourceFolder: '$(Build.SourcesDirectory)' + contents: '*.tar.xz' + TargetFolder: '$(Build.ArtifactStagingDirectory)' + - task: PublishBuildArtifacts@1 + inputs: + pathtoPublish: '$(Build.ArtifactStagingDirectory)' + artifactName: binaries +- stage: build_binaries_manifest + displayName: "Build binaries manifest" + dependsOn: build_binaries + jobs: + - job: build_manifest + displayName: "Build binaries manifest" + steps: + - task: DownloadBuildArtifacts@0 + inputs: + buildType: 'current' + downloadType: 'single' + artifactName: 'binaries' + downloadPath: '$(Build.SourcesDirectory)' + - task: Bash@3 + inputs: + targetType: inline + script: "cd binaries && sha256sum --binary *.tar.xz | tee $(Build.ArtifactStagingDirectory)/sha256sums.txt" + - task: PublishBuildArtifacts@1 + inputs: + pathtoPublish: '$(Build.ArtifactStagingDirectory)' + artifactName: manifest + +- stage: build_docker_image + displayName: "Build Docker image" + dependsOn: run_checks + jobs: + - job: build + displayName: "Build" + pool: + vmImage: ubuntu-latest + steps: + - task: Docker@2 + inputs: + command: 'build' + Dockerfile: 'Dockerfile' + buildContext: '.' + addPipelineData: false + +- stage: publish_docker_image + displayName: "Publish Docker image" + dependsOn: build_docker_image + condition: and(succeeded(), eq(variables['Build.SourceBranchName'], 'master')) + jobs: + - job: publish + displayName: "Publish" + pool: + vmImage: ubuntu-latest + steps: + - task: Docker@2 + inputs: + containerRegistry: 'DockerHub' + repository: 'pelletier/go-toml' + command: 'buildAndPush' + Dockerfile: 'Dockerfile' + buildContext: '.' + tags: 'latest' diff --git a/test/vendor/github.com/pelletier/go-toml/benchmark.sh b/test/vendor/github.com/pelletier/go-toml/benchmark.sh new file mode 100644 index 0000000000..a69d3040fa --- /dev/null +++ b/test/vendor/github.com/pelletier/go-toml/benchmark.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +set -ex + +reference_ref=${1:-master} +reference_git=${2:-.} + +if ! `hash benchstat 2>/dev/null`; then + echo "Installing benchstat" + go get golang.org/x/perf/cmd/benchstat +fi + +tempdir=`mktemp -d /tmp/go-toml-benchmark-XXXXXX` +ref_tempdir="${tempdir}/ref" +ref_benchmark="${ref_tempdir}/benchmark-`echo -n ${reference_ref}|tr -s '/' '-'`.txt" +local_benchmark="`pwd`/benchmark-local.txt" + +echo "=== ${reference_ref} (${ref_tempdir})" +git clone ${reference_git} ${ref_tempdir} >/dev/null 2>/dev/null +pushd ${ref_tempdir} >/dev/null +git checkout ${reference_ref} >/dev/null 2>/dev/null +go test -bench=. -benchmem | tee ${ref_benchmark} +cd benchmark +go test -bench=. -benchmem | tee -a ${ref_benchmark} +popd >/dev/null + +echo "" +echo "=== local" +go test -bench=. -benchmem | tee ${local_benchmark} +cd benchmark +go test -bench=. -benchmem | tee -a ${local_benchmark} + +echo "" +echo "=== diff" +benchstat -delta-test=none ${ref_benchmark} ${local_benchmark} diff --git a/test/vendor/github.com/pelletier/go-toml/doc.go b/test/vendor/github.com/pelletier/go-toml/doc.go new file mode 100644 index 0000000000..a1406a32b3 --- /dev/null +++ b/test/vendor/github.com/pelletier/go-toml/doc.go @@ -0,0 +1,23 @@ +// Package toml is a TOML parser and manipulation library. +// +// This version supports the specification as described in +// https://github.com/toml-lang/toml/blob/master/versions/en/toml-v0.5.0.md +// +// Marshaling +// +// Go-toml can marshal and unmarshal TOML documents from and to data +// structures. +// +// TOML document as a tree +// +// Go-toml can operate on a TOML document as a tree. Use one of the Load* +// functions to parse TOML data and obtain a Tree instance, then one of its +// methods to manipulate the tree. +// +// JSONPath-like queries +// +// The package github.com/pelletier/go-toml/query implements a system +// similar to JSONPath to quickly retrieve elements of a TOML document using a +// single expression. See the package documentation for more information. +// +package toml diff --git a/test/vendor/github.com/pelletier/go-toml/example-crlf.toml b/test/vendor/github.com/pelletier/go-toml/example-crlf.toml new file mode 100644 index 0000000000..f45bf88b8f --- /dev/null +++ b/test/vendor/github.com/pelletier/go-toml/example-crlf.toml @@ -0,0 +1,30 @@ +# This is a TOML document. Boom. + +title = "TOML Example" + +[owner] +name = "Tom Preston-Werner" +organization = "GitHub" +bio = "GitHub Cofounder & CEO\nLikes tater tots and beer." +dob = 1979-05-27T07:32:00Z # First class dates? Why not? + +[database] +server = "192.168.1.1" +ports = [ 8001, 8001, 8002 ] +connection_max = 5000 +enabled = true + +[servers] + + # You can indent as you please. Tabs or spaces. TOML don't care. + [servers.alpha] + ip = "10.0.0.1" + dc = "eqdc10" + + [servers.beta] + ip = "10.0.0.2" + dc = "eqdc10" + +[clients] +data = [ ["gamma", "delta"], [1, 2] ] # just an update to make sure parsers support it +score = 4e-08 # to make sure leading zeroes in exponent parts of floats are supported \ No newline at end of file diff --git a/test/vendor/github.com/pelletier/go-toml/example.toml b/test/vendor/github.com/pelletier/go-toml/example.toml new file mode 100644 index 0000000000..f45bf88b8f --- /dev/null +++ b/test/vendor/github.com/pelletier/go-toml/example.toml @@ -0,0 +1,30 @@ +# This is a TOML document. Boom. + +title = "TOML Example" + +[owner] +name = "Tom Preston-Werner" +organization = "GitHub" +bio = "GitHub Cofounder & CEO\nLikes tater tots and beer." +dob = 1979-05-27T07:32:00Z # First class dates? Why not? + +[database] +server = "192.168.1.1" +ports = [ 8001, 8001, 8002 ] +connection_max = 5000 +enabled = true + +[servers] + + # You can indent as you please. Tabs or spaces. TOML don't care. + [servers.alpha] + ip = "10.0.0.1" + dc = "eqdc10" + + [servers.beta] + ip = "10.0.0.2" + dc = "eqdc10" + +[clients] +data = [ ["gamma", "delta"], [1, 2] ] # just an update to make sure parsers support it +score = 4e-08 # to make sure leading zeroes in exponent parts of floats are supported \ No newline at end of file diff --git a/test/vendor/github.com/pelletier/go-toml/fuzz.go b/test/vendor/github.com/pelletier/go-toml/fuzz.go new file mode 100644 index 0000000000..14570c8d35 --- /dev/null +++ b/test/vendor/github.com/pelletier/go-toml/fuzz.go @@ -0,0 +1,31 @@ +// +build gofuzz + +package toml + +func Fuzz(data []byte) int { + tree, err := LoadBytes(data) + if err != nil { + if tree != nil { + panic("tree must be nil if there is an error") + } + return 0 + } + + str, err := tree.ToTomlString() + if err != nil { + if str != "" { + panic(`str must be "" if there is an error`) + } + panic(err) + } + + tree, err = Load(str) + if err != nil { + if tree != nil { + panic("tree must be nil if there is an error") + } + return 0 + } + + return 1 +} diff --git a/test/vendor/github.com/pelletier/go-toml/fuzz.sh b/test/vendor/github.com/pelletier/go-toml/fuzz.sh new file mode 100644 index 0000000000..3204b4c446 --- /dev/null +++ b/test/vendor/github.com/pelletier/go-toml/fuzz.sh @@ -0,0 +1,15 @@ +#! /bin/sh +set -eu + +go get github.com/dvyukov/go-fuzz/go-fuzz +go get github.com/dvyukov/go-fuzz/go-fuzz-build + +if [ ! -e toml-fuzz.zip ]; then + go-fuzz-build github.com/pelletier/go-toml +fi + +rm -fr fuzz +mkdir -p fuzz/corpus +cp *.toml fuzz/corpus + +go-fuzz -bin=toml-fuzz.zip -workdir=fuzz diff --git a/test/vendor/github.com/pelletier/go-toml/fuzzit.sh b/test/vendor/github.com/pelletier/go-toml/fuzzit.sh new file mode 100644 index 0000000000..b575a6081f --- /dev/null +++ b/test/vendor/github.com/pelletier/go-toml/fuzzit.sh @@ -0,0 +1,26 @@ +#!/bin/bash +set -xe + +# go-fuzz doesn't support modules yet, so ensure we do everything +# in the old style GOPATH way +export GO111MODULE="off" + +# install go-fuzz +go get -u github.com/dvyukov/go-fuzz/go-fuzz github.com/dvyukov/go-fuzz/go-fuzz-build + +# target name can only contain lower-case letters (a-z), digits (0-9) and a dash (-) +# to add another target, make sure to create it with `fuzzit create target` +# before using `fuzzit create job` +TARGET=toml-fuzzer + +go-fuzz-build -libfuzzer -o ${TARGET}.a github.com/pelletier/go-toml +clang -fsanitize=fuzzer ${TARGET}.a -o ${TARGET} + +# install fuzzit for talking to fuzzit.dev service +# or latest version: +# https://github.com/fuzzitdev/fuzzit/releases/latest/download/fuzzit_Linux_x86_64 +wget -q -O fuzzit https://github.com/fuzzitdev/fuzzit/releases/download/v2.4.52/fuzzit_Linux_x86_64 +chmod a+x fuzzit + +# TODO: change kkowalczyk to go-toml and create toml-fuzzer target there +./fuzzit create job --type $TYPE go-toml/${TARGET} ${TARGET} diff --git a/test/vendor/github.com/pelletier/go-toml/keysparsing.go b/test/vendor/github.com/pelletier/go-toml/keysparsing.go new file mode 100644 index 0000000000..e091500b24 --- /dev/null +++ b/test/vendor/github.com/pelletier/go-toml/keysparsing.go @@ -0,0 +1,112 @@ +// Parsing keys handling both bare and quoted keys. + +package toml + +import ( + "errors" + "fmt" +) + +// Convert the bare key group string to an array. +// The input supports double quotation and single quotation, +// but escape sequences are not supported. Lexers must unescape them beforehand. +func parseKey(key string) ([]string, error) { + runes := []rune(key) + var groups []string + + if len(key) == 0 { + return nil, errors.New("empty key") + } + + idx := 0 + for idx < len(runes) { + for ; idx < len(runes) && isSpace(runes[idx]); idx++ { + // skip leading whitespace + } + if idx >= len(runes) { + break + } + r := runes[idx] + if isValidBareChar(r) { + // parse bare key + startIdx := idx + endIdx := -1 + idx++ + for idx < len(runes) { + r = runes[idx] + if isValidBareChar(r) { + idx++ + } else if r == '.' { + endIdx = idx + break + } else if isSpace(r) { + endIdx = idx + for ; idx < len(runes) && isSpace(runes[idx]); idx++ { + // skip trailing whitespace + } + if idx < len(runes) && runes[idx] != '.' { + return nil, fmt.Errorf("invalid key character after whitespace: %c", runes[idx]) + } + break + } else { + return nil, fmt.Errorf("invalid bare key character: %c", r) + } + } + if endIdx == -1 { + endIdx = idx + } + groups = append(groups, string(runes[startIdx:endIdx])) + } else if r == '\'' { + // parse single quoted key + idx++ + startIdx := idx + for { + if idx >= len(runes) { + return nil, fmt.Errorf("unclosed single-quoted key") + } + r = runes[idx] + if r == '\'' { + groups = append(groups, string(runes[startIdx:idx])) + idx++ + break + } + idx++ + } + } else if r == '"' { + // parse double quoted key + idx++ + startIdx := idx + for { + if idx >= len(runes) { + return nil, fmt.Errorf("unclosed double-quoted key") + } + r = runes[idx] + if r == '"' { + groups = append(groups, string(runes[startIdx:idx])) + idx++ + break + } + idx++ + } + } else if r == '.' { + idx++ + if idx >= len(runes) { + return nil, fmt.Errorf("unexpected end of key") + } + r = runes[idx] + if !isValidBareChar(r) && r != '\'' && r != '"' && r != ' ' { + return nil, fmt.Errorf("expecting key part after dot") + } + } else { + return nil, fmt.Errorf("invalid key character: %c", r) + } + } + if len(groups) == 0 { + return nil, fmt.Errorf("empty key") + } + return groups, nil +} + +func isValidBareChar(r rune) bool { + return isAlphanumeric(r) || r == '-' || isDigit(r) +} diff --git a/test/vendor/github.com/pelletier/go-toml/lexer.go b/test/vendor/github.com/pelletier/go-toml/lexer.go new file mode 100644 index 0000000000..b188619246 --- /dev/null +++ b/test/vendor/github.com/pelletier/go-toml/lexer.go @@ -0,0 +1,807 @@ +// TOML lexer. +// +// Written using the principles developed by Rob Pike in +// http://www.youtube.com/watch?v=HxaD_trXwRE + +package toml + +import ( + "bytes" + "errors" + "fmt" + "regexp" + "strconv" + "strings" +) + +var dateRegexp *regexp.Regexp + +// Define state functions +type tomlLexStateFn func() tomlLexStateFn + +// Define lexer +type tomlLexer struct { + inputIdx int + input []rune // Textual source + currentTokenStart int + currentTokenStop int + tokens []token + brackets []rune + line int + col int + endbufferLine int + endbufferCol int +} + +// Basic read operations on input + +func (l *tomlLexer) read() rune { + r := l.peek() + if r == '\n' { + l.endbufferLine++ + l.endbufferCol = 1 + } else { + l.endbufferCol++ + } + l.inputIdx++ + return r +} + +func (l *tomlLexer) next() rune { + r := l.read() + + if r != eof { + l.currentTokenStop++ + } + return r +} + +func (l *tomlLexer) ignore() { + l.currentTokenStart = l.currentTokenStop + l.line = l.endbufferLine + l.col = l.endbufferCol +} + +func (l *tomlLexer) skip() { + l.next() + l.ignore() +} + +func (l *tomlLexer) fastForward(n int) { + for i := 0; i < n; i++ { + l.next() + } +} + +func (l *tomlLexer) emitWithValue(t tokenType, value string) { + l.tokens = append(l.tokens, token{ + Position: Position{l.line, l.col}, + typ: t, + val: value, + }) + l.ignore() +} + +func (l *tomlLexer) emit(t tokenType) { + l.emitWithValue(t, string(l.input[l.currentTokenStart:l.currentTokenStop])) +} + +func (l *tomlLexer) peek() rune { + if l.inputIdx >= len(l.input) { + return eof + } + return l.input[l.inputIdx] +} + +func (l *tomlLexer) peekString(size int) string { + maxIdx := len(l.input) + upperIdx := l.inputIdx + size // FIXME: potential overflow + if upperIdx > maxIdx { + upperIdx = maxIdx + } + return string(l.input[l.inputIdx:upperIdx]) +} + +func (l *tomlLexer) follow(next string) bool { + return next == l.peekString(len(next)) +} + +// Error management + +func (l *tomlLexer) errorf(format string, args ...interface{}) tomlLexStateFn { + l.tokens = append(l.tokens, token{ + Position: Position{l.line, l.col}, + typ: tokenError, + val: fmt.Sprintf(format, args...), + }) + return nil +} + +// State functions + +func (l *tomlLexer) lexVoid() tomlLexStateFn { + for { + next := l.peek() + switch next { + case '}': // after '{' + return l.lexRightCurlyBrace + case '[': + return l.lexTableKey + case '#': + return l.lexComment(l.lexVoid) + case '=': + return l.lexEqual + case '\r': + fallthrough + case '\n': + l.skip() + continue + } + + if isSpace(next) { + l.skip() + } + + if isKeyStartChar(next) { + return l.lexKey + } + + if next == eof { + l.next() + break + } + } + + l.emit(tokenEOF) + return nil +} + +func (l *tomlLexer) lexRvalue() tomlLexStateFn { + for { + next := l.peek() + switch next { + case '.': + return l.errorf("cannot start float with a dot") + case '=': + return l.lexEqual + case '[': + return l.lexLeftBracket + case ']': + return l.lexRightBracket + case '{': + return l.lexLeftCurlyBrace + case '}': + return l.lexRightCurlyBrace + case '#': + return l.lexComment(l.lexRvalue) + case '"': + return l.lexString + case '\'': + return l.lexLiteralString + case ',': + return l.lexComma + case '\r': + fallthrough + case '\n': + l.skip() + if len(l.brackets) > 0 && l.brackets[len(l.brackets)-1] == '[' { + return l.lexRvalue + } + return l.lexVoid + } + + if l.follow("true") { + return l.lexTrue + } + + if l.follow("false") { + return l.lexFalse + } + + if l.follow("inf") { + return l.lexInf + } + + if l.follow("nan") { + return l.lexNan + } + + if isSpace(next) { + l.skip() + continue + } + + if next == eof { + l.next() + break + } + + possibleDate := l.peekString(35) + dateSubmatches := dateRegexp.FindStringSubmatch(possibleDate) + if dateSubmatches != nil && dateSubmatches[0] != "" { + l.fastForward(len(dateSubmatches[0])) + if dateSubmatches[2] == "" { // no timezone information => local date + return l.lexLocalDate + } + return l.lexDate + } + + if next == '+' || next == '-' || isDigit(next) { + return l.lexNumber + } + + return l.errorf("no value can start with %c", next) + } + + l.emit(tokenEOF) + return nil +} + +func (l *tomlLexer) lexLeftCurlyBrace() tomlLexStateFn { + l.next() + l.emit(tokenLeftCurlyBrace) + l.brackets = append(l.brackets, '{') + return l.lexVoid +} + +func (l *tomlLexer) lexRightCurlyBrace() tomlLexStateFn { + l.next() + l.emit(tokenRightCurlyBrace) + if len(l.brackets) == 0 || l.brackets[len(l.brackets)-1] != '{' { + return l.errorf("cannot have '}' here") + } + l.brackets = l.brackets[:len(l.brackets)-1] + return l.lexRvalue +} + +func (l *tomlLexer) lexDate() tomlLexStateFn { + l.emit(tokenDate) + return l.lexRvalue +} + +func (l *tomlLexer) lexLocalDate() tomlLexStateFn { + l.emit(tokenLocalDate) + return l.lexRvalue +} + +func (l *tomlLexer) lexTrue() tomlLexStateFn { + l.fastForward(4) + l.emit(tokenTrue) + return l.lexRvalue +} + +func (l *tomlLexer) lexFalse() tomlLexStateFn { + l.fastForward(5) + l.emit(tokenFalse) + return l.lexRvalue +} + +func (l *tomlLexer) lexInf() tomlLexStateFn { + l.fastForward(3) + l.emit(tokenInf) + return l.lexRvalue +} + +func (l *tomlLexer) lexNan() tomlLexStateFn { + l.fastForward(3) + l.emit(tokenNan) + return l.lexRvalue +} + +func (l *tomlLexer) lexEqual() tomlLexStateFn { + l.next() + l.emit(tokenEqual) + return l.lexRvalue +} + +func (l *tomlLexer) lexComma() tomlLexStateFn { + l.next() + l.emit(tokenComma) + if len(l.brackets) > 0 && l.brackets[len(l.brackets)-1] == '{' { + return l.lexVoid + } + return l.lexRvalue +} + +// Parse the key and emits its value without escape sequences. +// bare keys, basic string keys and literal string keys are supported. +func (l *tomlLexer) lexKey() tomlLexStateFn { + var sb strings.Builder + + for r := l.peek(); isKeyChar(r) || r == '\n' || r == '\r'; r = l.peek() { + if r == '"' { + l.next() + str, err := l.lexStringAsString(`"`, false, true) + if err != nil { + return l.errorf(err.Error()) + } + sb.WriteString("\"") + sb.WriteString(str) + sb.WriteString("\"") + l.next() + continue + } else if r == '\'' { + l.next() + str, err := l.lexLiteralStringAsString(`'`, false) + if err != nil { + return l.errorf(err.Error()) + } + sb.WriteString("'") + sb.WriteString(str) + sb.WriteString("'") + l.next() + continue + } else if r == '\n' { + return l.errorf("keys cannot contain new lines") + } else if isSpace(r) { + var str strings.Builder + str.WriteString(" ") + + // skip trailing whitespace + l.next() + for r = l.peek(); isSpace(r); r = l.peek() { + str.WriteRune(r) + l.next() + } + // break loop if not a dot + if r != '.' { + break + } + str.WriteString(".") + // skip trailing whitespace after dot + l.next() + for r = l.peek(); isSpace(r); r = l.peek() { + str.WriteRune(r) + l.next() + } + sb.WriteString(str.String()) + continue + } else if r == '.' { + // skip + } else if !isValidBareChar(r) { + return l.errorf("keys cannot contain %c character", r) + } + sb.WriteRune(r) + l.next() + } + l.emitWithValue(tokenKey, sb.String()) + return l.lexVoid +} + +func (l *tomlLexer) lexComment(previousState tomlLexStateFn) tomlLexStateFn { + return func() tomlLexStateFn { + for next := l.peek(); next != '\n' && next != eof; next = l.peek() { + if next == '\r' && l.follow("\r\n") { + break + } + l.next() + } + l.ignore() + return previousState + } +} + +func (l *tomlLexer) lexLeftBracket() tomlLexStateFn { + l.next() + l.emit(tokenLeftBracket) + l.brackets = append(l.brackets, '[') + return l.lexRvalue +} + +func (l *tomlLexer) lexLiteralStringAsString(terminator string, discardLeadingNewLine bool) (string, error) { + var sb strings.Builder + + if discardLeadingNewLine { + if l.follow("\r\n") { + l.skip() + l.skip() + } else if l.peek() == '\n' { + l.skip() + } + } + + // find end of string + for { + if l.follow(terminator) { + return sb.String(), nil + } + + next := l.peek() + if next == eof { + break + } + sb.WriteRune(l.next()) + } + + return "", errors.New("unclosed string") +} + +func (l *tomlLexer) lexLiteralString() tomlLexStateFn { + l.skip() + + // handle special case for triple-quote + terminator := "'" + discardLeadingNewLine := false + if l.follow("''") { + l.skip() + l.skip() + terminator = "'''" + discardLeadingNewLine = true + } + + str, err := l.lexLiteralStringAsString(terminator, discardLeadingNewLine) + if err != nil { + return l.errorf(err.Error()) + } + + l.emitWithValue(tokenString, str) + l.fastForward(len(terminator)) + l.ignore() + return l.lexRvalue +} + +// Lex a string and return the results as a string. +// Terminator is the substring indicating the end of the token. +// The resulting string does not include the terminator. +func (l *tomlLexer) lexStringAsString(terminator string, discardLeadingNewLine, acceptNewLines bool) (string, error) { + var sb strings.Builder + + if discardLeadingNewLine { + if l.follow("\r\n") { + l.skip() + l.skip() + } else if l.peek() == '\n' { + l.skip() + } + } + + for { + if l.follow(terminator) { + return sb.String(), nil + } + + if l.follow("\\") { + l.next() + switch l.peek() { + case '\r': + fallthrough + case '\n': + fallthrough + case '\t': + fallthrough + case ' ': + // skip all whitespace chars following backslash + for strings.ContainsRune("\r\n\t ", l.peek()) { + l.next() + } + case '"': + sb.WriteString("\"") + l.next() + case 'n': + sb.WriteString("\n") + l.next() + case 'b': + sb.WriteString("\b") + l.next() + case 'f': + sb.WriteString("\f") + l.next() + case '/': + sb.WriteString("/") + l.next() + case 't': + sb.WriteString("\t") + l.next() + case 'r': + sb.WriteString("\r") + l.next() + case '\\': + sb.WriteString("\\") + l.next() + case 'u': + l.next() + var code strings.Builder + for i := 0; i < 4; i++ { + c := l.peek() + if !isHexDigit(c) { + return "", errors.New("unfinished unicode escape") + } + l.next() + code.WriteRune(c) + } + intcode, err := strconv.ParseInt(code.String(), 16, 32) + if err != nil { + return "", errors.New("invalid unicode escape: \\u" + code.String()) + } + sb.WriteRune(rune(intcode)) + case 'U': + l.next() + var code strings.Builder + for i := 0; i < 8; i++ { + c := l.peek() + if !isHexDigit(c) { + return "", errors.New("unfinished unicode escape") + } + l.next() + code.WriteRune(c) + } + intcode, err := strconv.ParseInt(code.String(), 16, 64) + if err != nil { + return "", errors.New("invalid unicode escape: \\U" + code.String()) + } + sb.WriteRune(rune(intcode)) + default: + return "", errors.New("invalid escape sequence: \\" + string(l.peek())) + } + } else { + r := l.peek() + + if 0x00 <= r && r <= 0x1F && r != '\t' && !(acceptNewLines && (r == '\n' || r == '\r')) { + return "", fmt.Errorf("unescaped control character %U", r) + } + l.next() + sb.WriteRune(r) + } + + if l.peek() == eof { + break + } + } + + return "", errors.New("unclosed string") +} + +func (l *tomlLexer) lexString() tomlLexStateFn { + l.skip() + + // handle special case for triple-quote + terminator := `"` + discardLeadingNewLine := false + acceptNewLines := false + if l.follow(`""`) { + l.skip() + l.skip() + terminator = `"""` + discardLeadingNewLine = true + acceptNewLines = true + } + + str, err := l.lexStringAsString(terminator, discardLeadingNewLine, acceptNewLines) + if err != nil { + return l.errorf(err.Error()) + } + + l.emitWithValue(tokenString, str) + l.fastForward(len(terminator)) + l.ignore() + return l.lexRvalue +} + +func (l *tomlLexer) lexTableKey() tomlLexStateFn { + l.next() + + if l.peek() == '[' { + // token '[[' signifies an array of tables + l.next() + l.emit(tokenDoubleLeftBracket) + return l.lexInsideTableArrayKey + } + // vanilla table key + l.emit(tokenLeftBracket) + return l.lexInsideTableKey +} + +// Parse the key till "]]", but only bare keys are supported +func (l *tomlLexer) lexInsideTableArrayKey() tomlLexStateFn { + for r := l.peek(); r != eof; r = l.peek() { + switch r { + case ']': + if l.currentTokenStop > l.currentTokenStart { + l.emit(tokenKeyGroupArray) + } + l.next() + if l.peek() != ']' { + break + } + l.next() + l.emit(tokenDoubleRightBracket) + return l.lexVoid + case '[': + return l.errorf("table array key cannot contain ']'") + default: + l.next() + } + } + return l.errorf("unclosed table array key") +} + +// Parse the key till "]" but only bare keys are supported +func (l *tomlLexer) lexInsideTableKey() tomlLexStateFn { + for r := l.peek(); r != eof; r = l.peek() { + switch r { + case ']': + if l.currentTokenStop > l.currentTokenStart { + l.emit(tokenKeyGroup) + } + l.next() + l.emit(tokenRightBracket) + return l.lexVoid + case '[': + return l.errorf("table key cannot contain ']'") + default: + l.next() + } + } + return l.errorf("unclosed table key") +} + +func (l *tomlLexer) lexRightBracket() tomlLexStateFn { + l.next() + l.emit(tokenRightBracket) + if len(l.brackets) == 0 || l.brackets[len(l.brackets)-1] != '[' { + return l.errorf("cannot have ']' here") + } + l.brackets = l.brackets[:len(l.brackets)-1] + return l.lexRvalue +} + +type validRuneFn func(r rune) bool + +func isValidHexRune(r rune) bool { + return r >= 'a' && r <= 'f' || + r >= 'A' && r <= 'F' || + r >= '0' && r <= '9' || + r == '_' +} + +func isValidOctalRune(r rune) bool { + return r >= '0' && r <= '7' || r == '_' +} + +func isValidBinaryRune(r rune) bool { + return r == '0' || r == '1' || r == '_' +} + +func (l *tomlLexer) lexNumber() tomlLexStateFn { + r := l.peek() + + if r == '0' { + follow := l.peekString(2) + if len(follow) == 2 { + var isValidRune validRuneFn + switch follow[1] { + case 'x': + isValidRune = isValidHexRune + case 'o': + isValidRune = isValidOctalRune + case 'b': + isValidRune = isValidBinaryRune + default: + if follow[1] >= 'a' && follow[1] <= 'z' || follow[1] >= 'A' && follow[1] <= 'Z' { + return l.errorf("unknown number base: %s. possible options are x (hex) o (octal) b (binary)", string(follow[1])) + } + } + + if isValidRune != nil { + l.next() + l.next() + digitSeen := false + for { + next := l.peek() + if !isValidRune(next) { + break + } + digitSeen = true + l.next() + } + + if !digitSeen { + return l.errorf("number needs at least one digit") + } + + l.emit(tokenInteger) + + return l.lexRvalue + } + } + } + + if r == '+' || r == '-' { + l.next() + if l.follow("inf") { + return l.lexInf + } + if l.follow("nan") { + return l.lexNan + } + } + + pointSeen := false + expSeen := false + digitSeen := false + for { + next := l.peek() + if next == '.' { + if pointSeen { + return l.errorf("cannot have two dots in one float") + } + l.next() + if !isDigit(l.peek()) { + return l.errorf("float cannot end with a dot") + } + pointSeen = true + } else if next == 'e' || next == 'E' { + expSeen = true + l.next() + r := l.peek() + if r == '+' || r == '-' { + l.next() + } + } else if isDigit(next) { + digitSeen = true + l.next() + } else if next == '_' { + l.next() + } else { + break + } + if pointSeen && !digitSeen { + return l.errorf("cannot start float with a dot") + } + } + + if !digitSeen { + return l.errorf("no digit in that number") + } + if pointSeen || expSeen { + l.emit(tokenFloat) + } else { + l.emit(tokenInteger) + } + return l.lexRvalue +} + +func (l *tomlLexer) run() { + for state := l.lexVoid; state != nil; { + state = state() + } +} + +func init() { + // Regexp for all date/time formats supported by TOML. + // Group 1: nano precision + // Group 2: timezone + // + // /!\ also matches the empty string + // + // Example matches: + // 1979-05-27T07:32:00Z + // 1979-05-27T00:32:00-07:00 + // 1979-05-27T00:32:00.999999-07:00 + // 1979-05-27 07:32:00Z + // 1979-05-27 00:32:00-07:00 + // 1979-05-27 00:32:00.999999-07:00 + // 1979-05-27T07:32:00 + // 1979-05-27T00:32:00.999999 + // 1979-05-27 07:32:00 + // 1979-05-27 00:32:00.999999 + // 1979-05-27 + // 07:32:00 + // 00:32:00.999999 + dateRegexp = regexp.MustCompile(`^(?:\d{1,4}-\d{2}-\d{2})?(?:[T ]?\d{2}:\d{2}:\d{2}(\.\d{1,9})?(Z|[+-]\d{2}:\d{2})?)?`) +} + +// Entry point +func lexToml(inputBytes []byte) []token { + runes := bytes.Runes(inputBytes) + l := &tomlLexer{ + input: runes, + tokens: make([]token, 0, 256), + line: 1, + col: 1, + endbufferLine: 1, + endbufferCol: 1, + } + l.run() + return l.tokens +} diff --git a/test/vendor/github.com/pelletier/go-toml/localtime.go b/test/vendor/github.com/pelletier/go-toml/localtime.go new file mode 100644 index 0000000000..a2149e9663 --- /dev/null +++ b/test/vendor/github.com/pelletier/go-toml/localtime.go @@ -0,0 +1,281 @@ +// Implementation of TOML's local date/time. +// Copied over from https://github.com/googleapis/google-cloud-go/blob/master/civil/civil.go +// to avoid pulling all the Google dependencies. +// +// Copyright 2016 Google LLC +// +// 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 civil implements types for civil time, a time-zone-independent +// representation of time that follows the rules of the proleptic +// Gregorian calendar with exactly 24-hour days, 60-minute hours, and 60-second +// minutes. +// +// Because they lack location information, these types do not represent unique +// moments or intervals of time. Use time.Time for that purpose. +package toml + +import ( + "fmt" + "time" +) + +// A LocalDate represents a date (year, month, day). +// +// This type does not include location information, and therefore does not +// describe a unique 24-hour timespan. +type LocalDate struct { + Year int // Year (e.g., 2014). + Month time.Month // Month of the year (January = 1, ...). + Day int // Day of the month, starting at 1. +} + +// LocalDateOf returns the LocalDate in which a time occurs in that time's location. +func LocalDateOf(t time.Time) LocalDate { + var d LocalDate + d.Year, d.Month, d.Day = t.Date() + return d +} + +// ParseLocalDate parses a string in RFC3339 full-date format and returns the date value it represents. +func ParseLocalDate(s string) (LocalDate, error) { + t, err := time.Parse("2006-01-02", s) + if err != nil { + return LocalDate{}, err + } + return LocalDateOf(t), nil +} + +// String returns the date in RFC3339 full-date format. +func (d LocalDate) String() string { + return fmt.Sprintf("%04d-%02d-%02d", d.Year, d.Month, d.Day) +} + +// IsValid reports whether the date is valid. +func (d LocalDate) IsValid() bool { + return LocalDateOf(d.In(time.UTC)) == d +} + +// In returns the time corresponding to time 00:00:00 of the date in the location. +// +// In is always consistent with time.LocalDate, even when time.LocalDate returns a time +// on a different day. For example, if loc is America/Indiana/Vincennes, then both +// time.LocalDate(1955, time.May, 1, 0, 0, 0, 0, loc) +// and +// civil.LocalDate{Year: 1955, Month: time.May, Day: 1}.In(loc) +// return 23:00:00 on April 30, 1955. +// +// In panics if loc is nil. +func (d LocalDate) In(loc *time.Location) time.Time { + return time.Date(d.Year, d.Month, d.Day, 0, 0, 0, 0, loc) +} + +// AddDays returns the date that is n days in the future. +// n can also be negative to go into the past. +func (d LocalDate) AddDays(n int) LocalDate { + return LocalDateOf(d.In(time.UTC).AddDate(0, 0, n)) +} + +// DaysSince returns the signed number of days between the date and s, not including the end day. +// This is the inverse operation to AddDays. +func (d LocalDate) DaysSince(s LocalDate) (days int) { + // We convert to Unix time so we do not have to worry about leap seconds: + // Unix time increases by exactly 86400 seconds per day. + deltaUnix := d.In(time.UTC).Unix() - s.In(time.UTC).Unix() + return int(deltaUnix / 86400) +} + +// Before reports whether d1 occurs before d2. +func (d1 LocalDate) Before(d2 LocalDate) bool { + if d1.Year != d2.Year { + return d1.Year < d2.Year + } + if d1.Month != d2.Month { + return d1.Month < d2.Month + } + return d1.Day < d2.Day +} + +// After reports whether d1 occurs after d2. +func (d1 LocalDate) After(d2 LocalDate) bool { + return d2.Before(d1) +} + +// MarshalText implements the encoding.TextMarshaler interface. +// The output is the result of d.String(). +func (d LocalDate) MarshalText() ([]byte, error) { + return []byte(d.String()), nil +} + +// UnmarshalText implements the encoding.TextUnmarshaler interface. +// The date is expected to be a string in a format accepted by ParseLocalDate. +func (d *LocalDate) UnmarshalText(data []byte) error { + var err error + *d, err = ParseLocalDate(string(data)) + return err +} + +// A LocalTime represents a time with nanosecond precision. +// +// This type does not include location information, and therefore does not +// describe a unique moment in time. +// +// This type exists to represent the TIME type in storage-based APIs like BigQuery. +// Most operations on Times are unlikely to be meaningful. Prefer the LocalDateTime type. +type LocalTime struct { + Hour int // The hour of the day in 24-hour format; range [0-23] + Minute int // The minute of the hour; range [0-59] + Second int // The second of the minute; range [0-59] + Nanosecond int // The nanosecond of the second; range [0-999999999] +} + +// LocalTimeOf returns the LocalTime representing the time of day in which a time occurs +// in that time's location. It ignores the date. +func LocalTimeOf(t time.Time) LocalTime { + var tm LocalTime + tm.Hour, tm.Minute, tm.Second = t.Clock() + tm.Nanosecond = t.Nanosecond() + return tm +} + +// ParseLocalTime parses a string and returns the time value it represents. +// ParseLocalTime accepts an extended form of the RFC3339 partial-time format. After +// the HH:MM:SS part of the string, an optional fractional part may appear, +// consisting of a decimal point followed by one to nine decimal digits. +// (RFC3339 admits only one digit after the decimal point). +func ParseLocalTime(s string) (LocalTime, error) { + t, err := time.Parse("15:04:05.999999999", s) + if err != nil { + return LocalTime{}, err + } + return LocalTimeOf(t), nil +} + +// String returns the date in the format described in ParseLocalTime. If Nanoseconds +// is zero, no fractional part will be generated. Otherwise, the result will +// end with a fractional part consisting of a decimal point and nine digits. +func (t LocalTime) String() string { + s := fmt.Sprintf("%02d:%02d:%02d", t.Hour, t.Minute, t.Second) + if t.Nanosecond == 0 { + return s + } + return s + fmt.Sprintf(".%09d", t.Nanosecond) +} + +// IsValid reports whether the time is valid. +func (t LocalTime) IsValid() bool { + // Construct a non-zero time. + tm := time.Date(2, 2, 2, t.Hour, t.Minute, t.Second, t.Nanosecond, time.UTC) + return LocalTimeOf(tm) == t +} + +// MarshalText implements the encoding.TextMarshaler interface. +// The output is the result of t.String(). +func (t LocalTime) MarshalText() ([]byte, error) { + return []byte(t.String()), nil +} + +// UnmarshalText implements the encoding.TextUnmarshaler interface. +// The time is expected to be a string in a format accepted by ParseLocalTime. +func (t *LocalTime) UnmarshalText(data []byte) error { + var err error + *t, err = ParseLocalTime(string(data)) + return err +} + +// A LocalDateTime represents a date and time. +// +// This type does not include location information, and therefore does not +// describe a unique moment in time. +type LocalDateTime struct { + Date LocalDate + Time LocalTime +} + +// Note: We deliberately do not embed LocalDate into LocalDateTime, to avoid promoting AddDays and Sub. + +// LocalDateTimeOf returns the LocalDateTime in which a time occurs in that time's location. +func LocalDateTimeOf(t time.Time) LocalDateTime { + return LocalDateTime{ + Date: LocalDateOf(t), + Time: LocalTimeOf(t), + } +} + +// ParseLocalDateTime parses a string and returns the LocalDateTime it represents. +// ParseLocalDateTime accepts a variant of the RFC3339 date-time format that omits +// the time offset but includes an optional fractional time, as described in +// ParseLocalTime. Informally, the accepted format is +// YYYY-MM-DDTHH:MM:SS[.FFFFFFFFF] +// where the 'T' may be a lower-case 't'. +func ParseLocalDateTime(s string) (LocalDateTime, error) { + t, err := time.Parse("2006-01-02T15:04:05.999999999", s) + if err != nil { + t, err = time.Parse("2006-01-02t15:04:05.999999999", s) + if err != nil { + return LocalDateTime{}, err + } + } + return LocalDateTimeOf(t), nil +} + +// String returns the date in the format described in ParseLocalDate. +func (dt LocalDateTime) String() string { + return dt.Date.String() + "T" + dt.Time.String() +} + +// IsValid reports whether the datetime is valid. +func (dt LocalDateTime) IsValid() bool { + return dt.Date.IsValid() && dt.Time.IsValid() +} + +// In returns the time corresponding to the LocalDateTime in the given location. +// +// If the time is missing or ambigous at the location, In returns the same +// result as time.LocalDate. For example, if loc is America/Indiana/Vincennes, then +// both +// time.LocalDate(1955, time.May, 1, 0, 30, 0, 0, loc) +// and +// civil.LocalDateTime{ +// civil.LocalDate{Year: 1955, Month: time.May, Day: 1}}, +// civil.LocalTime{Minute: 30}}.In(loc) +// return 23:30:00 on April 30, 1955. +// +// In panics if loc is nil. +func (dt LocalDateTime) In(loc *time.Location) time.Time { + return time.Date(dt.Date.Year, dt.Date.Month, dt.Date.Day, dt.Time.Hour, dt.Time.Minute, dt.Time.Second, dt.Time.Nanosecond, loc) +} + +// Before reports whether dt1 occurs before dt2. +func (dt1 LocalDateTime) Before(dt2 LocalDateTime) bool { + return dt1.In(time.UTC).Before(dt2.In(time.UTC)) +} + +// After reports whether dt1 occurs after dt2. +func (dt1 LocalDateTime) After(dt2 LocalDateTime) bool { + return dt2.Before(dt1) +} + +// MarshalText implements the encoding.TextMarshaler interface. +// The output is the result of dt.String(). +func (dt LocalDateTime) MarshalText() ([]byte, error) { + return []byte(dt.String()), nil +} + +// UnmarshalText implements the encoding.TextUnmarshaler interface. +// The datetime is expected to be a string in a format accepted by ParseLocalDateTime +func (dt *LocalDateTime) UnmarshalText(data []byte) error { + var err error + *dt, err = ParseLocalDateTime(string(data)) + return err +} diff --git a/test/vendor/github.com/pelletier/go-toml/marshal.go b/test/vendor/github.com/pelletier/go-toml/marshal.go new file mode 100644 index 0000000000..032e0ffc52 --- /dev/null +++ b/test/vendor/github.com/pelletier/go-toml/marshal.go @@ -0,0 +1,1269 @@ +package toml + +import ( + "bytes" + "encoding" + "errors" + "fmt" + "io" + "reflect" + "sort" + "strconv" + "strings" + "time" +) + +const ( + tagFieldName = "toml" + tagFieldComment = "comment" + tagCommented = "commented" + tagMultiline = "multiline" + tagDefault = "default" +) + +type tomlOpts struct { + name string + nameFromTag bool + comment string + commented bool + multiline bool + include bool + omitempty bool + defaultValue string +} + +type encOpts struct { + quoteMapKeys bool + arraysOneElementPerLine bool +} + +var encOptsDefaults = encOpts{ + quoteMapKeys: false, +} + +type annotation struct { + tag string + comment string + commented string + multiline string + defaultValue string +} + +var annotationDefault = annotation{ + tag: tagFieldName, + comment: tagFieldComment, + commented: tagCommented, + multiline: tagMultiline, + defaultValue: tagDefault, +} + +type marshalOrder int + +// Orders the Encoder can write the fields to the output stream. +const ( + // Sort fields alphabetically. + OrderAlphabetical marshalOrder = iota + 1 + // Preserve the order the fields are encountered. For example, the order of fields in + // a struct. + OrderPreserve +) + +var timeType = reflect.TypeOf(time.Time{}) +var marshalerType = reflect.TypeOf(new(Marshaler)).Elem() +var unmarshalerType = reflect.TypeOf(new(Unmarshaler)).Elem() +var textMarshalerType = reflect.TypeOf(new(encoding.TextMarshaler)).Elem() +var textUnmarshalerType = reflect.TypeOf(new(encoding.TextUnmarshaler)).Elem() +var localDateType = reflect.TypeOf(LocalDate{}) +var localTimeType = reflect.TypeOf(LocalTime{}) +var localDateTimeType = reflect.TypeOf(LocalDateTime{}) +var mapStringInterfaceType = reflect.TypeOf(map[string]interface{}{}) + +// Check if the given marshal type maps to a Tree primitive +func isPrimitive(mtype reflect.Type) bool { + switch mtype.Kind() { + case reflect.Ptr: + return isPrimitive(mtype.Elem()) + case reflect.Bool: + return true + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return true + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + return true + case reflect.Float32, reflect.Float64: + return true + case reflect.String: + return true + case reflect.Struct: + return isTimeType(mtype) + default: + return false + } +} + +func isTimeType(mtype reflect.Type) bool { + return mtype == timeType || mtype == localDateType || mtype == localDateTimeType || mtype == localTimeType +} + +// Check if the given marshal type maps to a Tree slice or array +func isTreeSequence(mtype reflect.Type) bool { + switch mtype.Kind() { + case reflect.Ptr: + return isTreeSequence(mtype.Elem()) + case reflect.Slice, reflect.Array: + return isTree(mtype.Elem()) + default: + return false + } +} + +// Check if the given marshal type maps to a slice or array of a custom marshaler type +func isCustomMarshalerSequence(mtype reflect.Type) bool { + switch mtype.Kind() { + case reflect.Ptr: + return isCustomMarshalerSequence(mtype.Elem()) + case reflect.Slice, reflect.Array: + return isCustomMarshaler(mtype.Elem()) || isCustomMarshaler(reflect.New(mtype.Elem()).Type()) + default: + return false + } +} + +// Check if the given marshal type maps to a slice or array of a text marshaler type +func isTextMarshalerSequence(mtype reflect.Type) bool { + switch mtype.Kind() { + case reflect.Ptr: + return isTextMarshalerSequence(mtype.Elem()) + case reflect.Slice, reflect.Array: + return isTextMarshaler(mtype.Elem()) || isTextMarshaler(reflect.New(mtype.Elem()).Type()) + default: + return false + } +} + +// Check if the given marshal type maps to a non-Tree slice or array +func isOtherSequence(mtype reflect.Type) bool { + switch mtype.Kind() { + case reflect.Ptr: + return isOtherSequence(mtype.Elem()) + case reflect.Slice, reflect.Array: + return !isTreeSequence(mtype) + default: + return false + } +} + +// Check if the given marshal type maps to a Tree +func isTree(mtype reflect.Type) bool { + switch mtype.Kind() { + case reflect.Ptr: + return isTree(mtype.Elem()) + case reflect.Map: + return true + case reflect.Struct: + return !isPrimitive(mtype) + default: + return false + } +} + +func isCustomMarshaler(mtype reflect.Type) bool { + return mtype.Implements(marshalerType) +} + +func callCustomMarshaler(mval reflect.Value) ([]byte, error) { + return mval.Interface().(Marshaler).MarshalTOML() +} + +func isTextMarshaler(mtype reflect.Type) bool { + return mtype.Implements(textMarshalerType) && !isTimeType(mtype) +} + +func callTextMarshaler(mval reflect.Value) ([]byte, error) { + return mval.Interface().(encoding.TextMarshaler).MarshalText() +} + +func isCustomUnmarshaler(mtype reflect.Type) bool { + return mtype.Implements(unmarshalerType) +} + +func callCustomUnmarshaler(mval reflect.Value, tval interface{}) error { + return mval.Interface().(Unmarshaler).UnmarshalTOML(tval) +} + +func isTextUnmarshaler(mtype reflect.Type) bool { + return mtype.Implements(textUnmarshalerType) +} + +func callTextUnmarshaler(mval reflect.Value, text []byte) error { + return mval.Interface().(encoding.TextUnmarshaler).UnmarshalText(text) +} + +// Marshaler is the interface implemented by types that +// can marshal themselves into valid TOML. +type Marshaler interface { + MarshalTOML() ([]byte, error) +} + +// Unmarshaler is the interface implemented by types that +// can unmarshal a TOML description of themselves. +type Unmarshaler interface { + UnmarshalTOML(interface{}) error +} + +/* +Marshal returns the TOML encoding of v. Behavior is similar to the Go json +encoder, except that there is no concept of a Marshaler interface or MarshalTOML +function for sub-structs, and currently only definite types can be marshaled +(i.e. no `interface{}`). + +The following struct annotations are supported: + + toml:"Field" Overrides the field's name to output. + omitempty When set, empty values and groups are not emitted. + comment:"comment" Emits a # comment on the same line. This supports new lines. + commented:"true" Emits the value as commented. + +Note that pointers are automatically assigned the "omitempty" option, as TOML +explicitly does not handle null values (saying instead the label should be +dropped). + +Tree structural types and corresponding marshal types: + + *Tree (*)struct, (*)map[string]interface{} + []*Tree (*)[](*)struct, (*)[](*)map[string]interface{} + []interface{} (as interface{}) (*)[]primitive, (*)[]([]interface{}) + interface{} (*)primitive + +Tree primitive types and corresponding marshal types: + + uint64 uint, uint8-uint64, pointers to same + int64 int, int8-uint64, pointers to same + float64 float32, float64, pointers to same + string string, pointers to same + bool bool, pointers to same + time.LocalTime time.LocalTime{}, pointers to same + +For additional flexibility, use the Encoder API. +*/ +func Marshal(v interface{}) ([]byte, error) { + return NewEncoder(nil).marshal(v) +} + +// Encoder writes TOML values to an output stream. +type Encoder struct { + w io.Writer + encOpts + annotation + line int + col int + order marshalOrder + promoteAnon bool + indentation string +} + +// NewEncoder returns a new encoder that writes to w. +func NewEncoder(w io.Writer) *Encoder { + return &Encoder{ + w: w, + encOpts: encOptsDefaults, + annotation: annotationDefault, + line: 0, + col: 1, + order: OrderAlphabetical, + indentation: " ", + } +} + +// Encode writes the TOML encoding of v to the stream. +// +// See the documentation for Marshal for details. +func (e *Encoder) Encode(v interface{}) error { + b, err := e.marshal(v) + if err != nil { + return err + } + if _, err := e.w.Write(b); err != nil { + return err + } + return nil +} + +// QuoteMapKeys sets up the encoder to encode +// maps with string type keys with quoted TOML keys. +// +// This relieves the character limitations on map keys. +func (e *Encoder) QuoteMapKeys(v bool) *Encoder { + e.quoteMapKeys = v + return e +} + +// ArraysWithOneElementPerLine sets up the encoder to encode arrays +// with more than one element on multiple lines instead of one. +// +// For example: +// +// A = [1,2,3] +// +// Becomes +// +// A = [ +// 1, +// 2, +// 3, +// ] +func (e *Encoder) ArraysWithOneElementPerLine(v bool) *Encoder { + e.arraysOneElementPerLine = v + return e +} + +// Order allows to change in which order fields will be written to the output stream. +func (e *Encoder) Order(ord marshalOrder) *Encoder { + e.order = ord + return e +} + +// Indentation allows to change indentation when marshalling. +func (e *Encoder) Indentation(indent string) *Encoder { + e.indentation = indent + return e +} + +// SetTagName allows changing default tag "toml" +func (e *Encoder) SetTagName(v string) *Encoder { + e.tag = v + return e +} + +// SetTagComment allows changing default tag "comment" +func (e *Encoder) SetTagComment(v string) *Encoder { + e.comment = v + return e +} + +// SetTagCommented allows changing default tag "commented" +func (e *Encoder) SetTagCommented(v string) *Encoder { + e.commented = v + return e +} + +// SetTagMultiline allows changing default tag "multiline" +func (e *Encoder) SetTagMultiline(v string) *Encoder { + e.multiline = v + return e +} + +// PromoteAnonymous allows to change how anonymous struct fields are marshaled. +// Usually, they are marshaled as if the inner exported fields were fields in +// the outer struct. However, if an anonymous struct field is given a name in +// its TOML tag, it is treated like a regular struct field with that name. +// rather than being anonymous. +// +// In case anonymous promotion is enabled, all anonymous structs are promoted +// and treated like regular struct fields. +func (e *Encoder) PromoteAnonymous(promote bool) *Encoder { + e.promoteAnon = promote + return e +} + +func (e *Encoder) marshal(v interface{}) ([]byte, error) { + // Check if indentation is valid + for _, char := range e.indentation { + if !isSpace(char) { + return []byte{}, fmt.Errorf("invalid indentation: must only contains space or tab characters") + } + } + + mtype := reflect.TypeOf(v) + if mtype == nil { + return []byte{}, errors.New("nil cannot be marshaled to TOML") + } + + switch mtype.Kind() { + case reflect.Struct, reflect.Map: + case reflect.Ptr: + if mtype.Elem().Kind() != reflect.Struct { + return []byte{}, errors.New("Only pointer to struct can be marshaled to TOML") + } + if reflect.ValueOf(v).IsNil() { + return []byte{}, errors.New("nil pointer cannot be marshaled to TOML") + } + default: + return []byte{}, errors.New("Only a struct or map can be marshaled to TOML") + } + + sval := reflect.ValueOf(v) + if isCustomMarshaler(mtype) { + return callCustomMarshaler(sval) + } + if isTextMarshaler(mtype) { + return callTextMarshaler(sval) + } + t, err := e.valueToTree(mtype, sval) + if err != nil { + return []byte{}, err + } + + var buf bytes.Buffer + _, err = t.writeToOrdered(&buf, "", "", 0, e.arraysOneElementPerLine, e.order, e.indentation, false) + + return buf.Bytes(), err +} + +// Create next tree with a position based on Encoder.line +func (e *Encoder) nextTree() *Tree { + return newTreeWithPosition(Position{Line: e.line, Col: 1}) +} + +// Convert given marshal struct or map value to toml tree +func (e *Encoder) valueToTree(mtype reflect.Type, mval reflect.Value) (*Tree, error) { + if mtype.Kind() == reflect.Ptr { + return e.valueToTree(mtype.Elem(), mval.Elem()) + } + tval := e.nextTree() + switch mtype.Kind() { + case reflect.Struct: + switch mval.Interface().(type) { + case Tree: + reflect.ValueOf(tval).Elem().Set(mval) + default: + for i := 0; i < mtype.NumField(); i++ { + mtypef, mvalf := mtype.Field(i), mval.Field(i) + opts := tomlOptions(mtypef, e.annotation) + if opts.include && ((mtypef.Type.Kind() != reflect.Interface && !opts.omitempty) || !isZero(mvalf)) { + val, err := e.valueToToml(mtypef.Type, mvalf) + if err != nil { + return nil, err + } + if tree, ok := val.(*Tree); ok && mtypef.Anonymous && !opts.nameFromTag && !e.promoteAnon { + e.appendTree(tval, tree) + } else { + val = e.wrapTomlValue(val, tval) + tval.SetPathWithOptions([]string{opts.name}, SetOptions{ + Comment: opts.comment, + Commented: opts.commented, + Multiline: opts.multiline, + }, val) + } + } + } + } + case reflect.Map: + keys := mval.MapKeys() + if e.order == OrderPreserve && len(keys) > 0 { + // Sorting []reflect.Value is not straight forward. + // + // OrderPreserve will support deterministic results when string is used + // as the key to maps. + typ := keys[0].Type() + kind := keys[0].Kind() + if kind == reflect.String { + ikeys := make([]string, len(keys)) + for i := range keys { + ikeys[i] = keys[i].Interface().(string) + } + sort.Strings(ikeys) + for i := range ikeys { + keys[i] = reflect.ValueOf(ikeys[i]).Convert(typ) + } + } + } + for _, key := range keys { + mvalf := mval.MapIndex(key) + if (mtype.Elem().Kind() == reflect.Ptr || mtype.Elem().Kind() == reflect.Interface) && mvalf.IsNil() { + continue + } + val, err := e.valueToToml(mtype.Elem(), mvalf) + if err != nil { + return nil, err + } + val = e.wrapTomlValue(val, tval) + if e.quoteMapKeys { + keyStr, err := tomlValueStringRepresentation(key.String(), "", "", e.order, e.arraysOneElementPerLine) + if err != nil { + return nil, err + } + tval.SetPath([]string{keyStr}, val) + } else { + tval.SetPath([]string{key.String()}, val) + } + } + } + return tval, nil +} + +// Convert given marshal slice to slice of Toml trees +func (e *Encoder) valueToTreeSlice(mtype reflect.Type, mval reflect.Value) ([]*Tree, error) { + tval := make([]*Tree, mval.Len(), mval.Len()) + for i := 0; i < mval.Len(); i++ { + val, err := e.valueToTree(mtype.Elem(), mval.Index(i)) + if err != nil { + return nil, err + } + tval[i] = val + } + return tval, nil +} + +// Convert given marshal slice to slice of toml values +func (e *Encoder) valueToOtherSlice(mtype reflect.Type, mval reflect.Value) (interface{}, error) { + tval := make([]interface{}, mval.Len(), mval.Len()) + for i := 0; i < mval.Len(); i++ { + val, err := e.valueToToml(mtype.Elem(), mval.Index(i)) + if err != nil { + return nil, err + } + tval[i] = val + } + return tval, nil +} + +// Convert given marshal value to toml value +func (e *Encoder) valueToToml(mtype reflect.Type, mval reflect.Value) (interface{}, error) { + if mtype.Kind() == reflect.Ptr { + switch { + case isCustomMarshaler(mtype): + return callCustomMarshaler(mval) + case isTextMarshaler(mtype): + b, err := callTextMarshaler(mval) + return string(b), err + default: + return e.valueToToml(mtype.Elem(), mval.Elem()) + } + } + if mtype.Kind() == reflect.Interface { + return e.valueToToml(mval.Elem().Type(), mval.Elem()) + } + switch { + case isCustomMarshaler(mtype): + return callCustomMarshaler(mval) + case isTextMarshaler(mtype): + b, err := callTextMarshaler(mval) + return string(b), err + case isTree(mtype): + return e.valueToTree(mtype, mval) + case isOtherSequence(mtype), isCustomMarshalerSequence(mtype), isTextMarshalerSequence(mtype): + return e.valueToOtherSlice(mtype, mval) + case isTreeSequence(mtype): + return e.valueToTreeSlice(mtype, mval) + default: + switch mtype.Kind() { + case reflect.Bool: + return mval.Bool(), nil + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + if mtype.Kind() == reflect.Int64 && mtype == reflect.TypeOf(time.Duration(1)) { + return fmt.Sprint(mval), nil + } + return mval.Int(), nil + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + return mval.Uint(), nil + case reflect.Float32, reflect.Float64: + return mval.Float(), nil + case reflect.String: + return mval.String(), nil + case reflect.Struct: + return mval.Interface(), nil + default: + return nil, fmt.Errorf("Marshal can't handle %v(%v)", mtype, mtype.Kind()) + } + } +} + +func (e *Encoder) appendTree(t, o *Tree) error { + for key, value := range o.values { + if _, ok := t.values[key]; ok { + continue + } + if tomlValue, ok := value.(*tomlValue); ok { + tomlValue.position.Col = t.position.Col + } + t.values[key] = value + } + return nil +} + +// Create a toml value with the current line number as the position line +func (e *Encoder) wrapTomlValue(val interface{}, parent *Tree) interface{} { + _, isTree := val.(*Tree) + _, isTreeS := val.([]*Tree) + if isTree || isTreeS { + return val + } + + ret := &tomlValue{ + value: val, + position: Position{ + e.line, + parent.position.Col, + }, + } + e.line++ + return ret +} + +// Unmarshal attempts to unmarshal the Tree into a Go struct pointed by v. +// Neither Unmarshaler interfaces nor UnmarshalTOML functions are supported for +// sub-structs, and only definite types can be unmarshaled. +func (t *Tree) Unmarshal(v interface{}) error { + d := Decoder{tval: t, tagName: tagFieldName} + return d.unmarshal(v) +} + +// Marshal returns the TOML encoding of Tree. +// See Marshal() documentation for types mapping table. +func (t *Tree) Marshal() ([]byte, error) { + var buf bytes.Buffer + _, err := t.WriteTo(&buf) + if err != nil { + return nil, err + } + return buf.Bytes(), nil +} + +// Unmarshal parses the TOML-encoded data and stores the result in the value +// pointed to by v. Behavior is similar to the Go json encoder, except that there +// is no concept of an Unmarshaler interface or UnmarshalTOML function for +// sub-structs, and currently only definite types can be unmarshaled to (i.e. no +// `interface{}`). +// +// The following struct annotations are supported: +// +// toml:"Field" Overrides the field's name to map to. +// default:"foo" Provides a default value. +// +// For default values, only fields of the following types are supported: +// * string +// * bool +// * int +// * int64 +// * float64 +// +// See Marshal() documentation for types mapping table. +func Unmarshal(data []byte, v interface{}) error { + t, err := LoadReader(bytes.NewReader(data)) + if err != nil { + return err + } + return t.Unmarshal(v) +} + +// Decoder reads and decodes TOML values from an input stream. +type Decoder struct { + r io.Reader + tval *Tree + encOpts + tagName string + strict bool + visitor visitorState +} + +// NewDecoder returns a new decoder that reads from r. +func NewDecoder(r io.Reader) *Decoder { + return &Decoder{ + r: r, + encOpts: encOptsDefaults, + tagName: tagFieldName, + } +} + +// Decode reads a TOML-encoded value from it's input +// and unmarshals it in the value pointed at by v. +// +// See the documentation for Marshal for details. +func (d *Decoder) Decode(v interface{}) error { + var err error + d.tval, err = LoadReader(d.r) + if err != nil { + return err + } + return d.unmarshal(v) +} + +// SetTagName allows changing default tag "toml" +func (d *Decoder) SetTagName(v string) *Decoder { + d.tagName = v + return d +} + +// Strict allows changing to strict decoding. Any fields that are found in the +// input data and do not have a corresponding struct member cause an error. +func (d *Decoder) Strict(strict bool) *Decoder { + d.strict = strict + return d +} + +func (d *Decoder) unmarshal(v interface{}) error { + mtype := reflect.TypeOf(v) + if mtype == nil { + return errors.New("nil cannot be unmarshaled from TOML") + } + if mtype.Kind() != reflect.Ptr { + return errors.New("only a pointer to struct or map can be unmarshaled from TOML") + } + + elem := mtype.Elem() + + switch elem.Kind() { + case reflect.Struct, reflect.Map: + case reflect.Interface: + elem = mapStringInterfaceType + default: + return errors.New("only a pointer to struct or map can be unmarshaled from TOML") + } + + if reflect.ValueOf(v).IsNil() { + return errors.New("nil pointer cannot be unmarshaled from TOML") + } + + vv := reflect.ValueOf(v).Elem() + + if d.strict { + d.visitor = newVisitorState(d.tval) + } + + sval, err := d.valueFromTree(elem, d.tval, &vv) + if err != nil { + return err + } + if err := d.visitor.validate(); err != nil { + return err + } + reflect.ValueOf(v).Elem().Set(sval) + return nil +} + +// Convert toml tree to marshal struct or map, using marshal type. When mval1 +// is non-nil, merge fields into the given value instead of allocating a new one. +func (d *Decoder) valueFromTree(mtype reflect.Type, tval *Tree, mval1 *reflect.Value) (reflect.Value, error) { + if mtype.Kind() == reflect.Ptr { + return d.unwrapPointer(mtype, tval, mval1) + } + + // Check if pointer to value implements the Unmarshaler interface. + if mvalPtr := reflect.New(mtype); isCustomUnmarshaler(mvalPtr.Type()) { + d.visitor.visitAll() + + if tval == nil { + return mvalPtr.Elem(), nil + } + + if err := callCustomUnmarshaler(mvalPtr, tval.ToMap()); err != nil { + return reflect.ValueOf(nil), fmt.Errorf("unmarshal toml: %v", err) + } + return mvalPtr.Elem(), nil + } + + var mval reflect.Value + switch mtype.Kind() { + case reflect.Struct: + if mval1 != nil { + mval = *mval1 + } else { + mval = reflect.New(mtype).Elem() + } + + switch mval.Interface().(type) { + case Tree: + mval.Set(reflect.ValueOf(tval).Elem()) + default: + for i := 0; i < mtype.NumField(); i++ { + mtypef := mtype.Field(i) + an := annotation{tag: d.tagName} + opts := tomlOptions(mtypef, an) + if !opts.include { + continue + } + baseKey := opts.name + keysToTry := []string{ + baseKey, + strings.ToLower(baseKey), + strings.ToTitle(baseKey), + strings.ToLower(string(baseKey[0])) + baseKey[1:], + } + + found := false + if tval != nil { + for _, key := range keysToTry { + exists := tval.HasPath([]string{key}) + if !exists { + continue + } + + d.visitor.push(key) + val := tval.GetPath([]string{key}) + fval := mval.Field(i) + mvalf, err := d.valueFromToml(mtypef.Type, val, &fval) + if err != nil { + return mval, formatError(err, tval.GetPositionPath([]string{key})) + } + mval.Field(i).Set(mvalf) + found = true + d.visitor.pop() + break + } + } + + if !found && opts.defaultValue != "" { + mvalf := mval.Field(i) + var val interface{} + var err error + switch mvalf.Kind() { + case reflect.String: + val = opts.defaultValue + case reflect.Bool: + val, err = strconv.ParseBool(opts.defaultValue) + case reflect.Uint: + val, err = strconv.ParseUint(opts.defaultValue, 10, 0) + case reflect.Uint8: + val, err = strconv.ParseUint(opts.defaultValue, 10, 8) + case reflect.Uint16: + val, err = strconv.ParseUint(opts.defaultValue, 10, 16) + case reflect.Uint32: + val, err = strconv.ParseUint(opts.defaultValue, 10, 32) + case reflect.Uint64: + val, err = strconv.ParseUint(opts.defaultValue, 10, 64) + case reflect.Int: + val, err = strconv.ParseInt(opts.defaultValue, 10, 0) + case reflect.Int8: + val, err = strconv.ParseInt(opts.defaultValue, 10, 8) + case reflect.Int16: + val, err = strconv.ParseInt(opts.defaultValue, 10, 16) + case reflect.Int32: + val, err = strconv.ParseInt(opts.defaultValue, 10, 32) + case reflect.Int64: + val, err = strconv.ParseInt(opts.defaultValue, 10, 64) + case reflect.Float32: + val, err = strconv.ParseFloat(opts.defaultValue, 32) + case reflect.Float64: + val, err = strconv.ParseFloat(opts.defaultValue, 64) + default: + return mvalf, fmt.Errorf("unsupported field type for default option") + } + + if err != nil { + return mvalf, err + } + mvalf.Set(reflect.ValueOf(val).Convert(mvalf.Type())) + } + + // save the old behavior above and try to check structs + if !found && opts.defaultValue == "" && mtypef.Type.Kind() == reflect.Struct { + tmpTval := tval + if !mtypef.Anonymous { + tmpTval = nil + } + fval := mval.Field(i) + v, err := d.valueFromTree(mtypef.Type, tmpTval, &fval) + if err != nil { + return v, err + } + mval.Field(i).Set(v) + } + } + } + case reflect.Map: + mval = reflect.MakeMap(mtype) + for _, key := range tval.Keys() { + d.visitor.push(key) + // TODO: path splits key + val := tval.GetPath([]string{key}) + mvalf, err := d.valueFromToml(mtype.Elem(), val, nil) + if err != nil { + return mval, formatError(err, tval.GetPositionPath([]string{key})) + } + mval.SetMapIndex(reflect.ValueOf(key).Convert(mtype.Key()), mvalf) + d.visitor.pop() + } + } + return mval, nil +} + +// Convert toml value to marshal struct/map slice, using marshal type +func (d *Decoder) valueFromTreeSlice(mtype reflect.Type, tval []*Tree) (reflect.Value, error) { + mval, err := makeSliceOrArray(mtype, len(tval)) + if err != nil { + return mval, err + } + + for i := 0; i < len(tval); i++ { + d.visitor.push(strconv.Itoa(i)) + val, err := d.valueFromTree(mtype.Elem(), tval[i], nil) + if err != nil { + return mval, err + } + mval.Index(i).Set(val) + d.visitor.pop() + } + return mval, nil +} + +// Convert toml value to marshal primitive slice, using marshal type +func (d *Decoder) valueFromOtherSlice(mtype reflect.Type, tval []interface{}) (reflect.Value, error) { + mval, err := makeSliceOrArray(mtype, len(tval)) + if err != nil { + return mval, err + } + + for i := 0; i < len(tval); i++ { + val, err := d.valueFromToml(mtype.Elem(), tval[i], nil) + if err != nil { + return mval, err + } + mval.Index(i).Set(val) + } + return mval, nil +} + +// Convert toml value to marshal primitive slice, using marshal type +func (d *Decoder) valueFromOtherSliceI(mtype reflect.Type, tval interface{}) (reflect.Value, error) { + val := reflect.ValueOf(tval) + length := val.Len() + + mval, err := makeSliceOrArray(mtype, length) + if err != nil { + return mval, err + } + + for i := 0; i < length; i++ { + val, err := d.valueFromToml(mtype.Elem(), val.Index(i).Interface(), nil) + if err != nil { + return mval, err + } + mval.Index(i).Set(val) + } + return mval, nil +} + +// Create a new slice or a new array with specified length +func makeSliceOrArray(mtype reflect.Type, tLength int) (reflect.Value, error) { + var mval reflect.Value + switch mtype.Kind() { + case reflect.Slice: + mval = reflect.MakeSlice(mtype, tLength, tLength) + case reflect.Array: + mval = reflect.New(reflect.ArrayOf(mtype.Len(), mtype.Elem())).Elem() + if tLength > mtype.Len() { + return mval, fmt.Errorf("unmarshal: TOML array length (%v) exceeds destination array length (%v)", tLength, mtype.Len()) + } + } + return mval, nil +} + +// Convert toml value to marshal value, using marshal type. When mval1 is non-nil +// and the given type is a struct value, merge fields into it. +func (d *Decoder) valueFromToml(mtype reflect.Type, tval interface{}, mval1 *reflect.Value) (reflect.Value, error) { + if mtype.Kind() == reflect.Ptr { + return d.unwrapPointer(mtype, tval, mval1) + } + + switch t := tval.(type) { + case *Tree: + var mval11 *reflect.Value + if mtype.Kind() == reflect.Struct { + mval11 = mval1 + } + + if isTree(mtype) { + return d.valueFromTree(mtype, t, mval11) + } + + if mtype.Kind() == reflect.Interface { + if mval1 == nil || mval1.IsNil() { + return d.valueFromTree(reflect.TypeOf(map[string]interface{}{}), t, nil) + } else { + return d.valueFromToml(mval1.Elem().Type(), t, nil) + } + } + + return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to a tree", tval, tval) + case []*Tree: + if isTreeSequence(mtype) { + return d.valueFromTreeSlice(mtype, t) + } + if mtype.Kind() == reflect.Interface { + if mval1 == nil || mval1.IsNil() { + return d.valueFromTreeSlice(reflect.TypeOf([]map[string]interface{}{}), t) + } else { + ival := mval1.Elem() + return d.valueFromToml(mval1.Elem().Type(), t, &ival) + } + } + return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to trees", tval, tval) + case []interface{}: + d.visitor.visit() + if isOtherSequence(mtype) { + return d.valueFromOtherSlice(mtype, t) + } + if mtype.Kind() == reflect.Interface { + if mval1 == nil || mval1.IsNil() { + return d.valueFromOtherSlice(reflect.TypeOf([]interface{}{}), t) + } else { + ival := mval1.Elem() + return d.valueFromToml(mval1.Elem().Type(), t, &ival) + } + } + return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to a slice", tval, tval) + default: + d.visitor.visit() + // Check if pointer to value implements the encoding.TextUnmarshaler. + if mvalPtr := reflect.New(mtype); isTextUnmarshaler(mvalPtr.Type()) && !isTimeType(mtype) { + if err := d.unmarshalText(tval, mvalPtr); err != nil { + return reflect.ValueOf(nil), fmt.Errorf("unmarshal text: %v", err) + } + return mvalPtr.Elem(), nil + } + + switch mtype.Kind() { + case reflect.Bool, reflect.Struct: + val := reflect.ValueOf(tval) + + switch val.Type() { + case localDateType: + localDate := val.Interface().(LocalDate) + switch mtype { + case timeType: + return reflect.ValueOf(time.Date(localDate.Year, localDate.Month, localDate.Day, 0, 0, 0, 0, time.Local)), nil + } + case localDateTimeType: + localDateTime := val.Interface().(LocalDateTime) + switch mtype { + case timeType: + return reflect.ValueOf(time.Date( + localDateTime.Date.Year, + localDateTime.Date.Month, + localDateTime.Date.Day, + localDateTime.Time.Hour, + localDateTime.Time.Minute, + localDateTime.Time.Second, + localDateTime.Time.Nanosecond, + time.Local)), nil + } + } + + // if this passes for when mtype is reflect.Struct, tval is a time.LocalTime + if !val.Type().ConvertibleTo(mtype) { + return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to %v", tval, tval, mtype.String()) + } + + return val.Convert(mtype), nil + case reflect.String: + val := reflect.ValueOf(tval) + // stupidly, int64 is convertible to string. So special case this. + if !val.Type().ConvertibleTo(mtype) || val.Kind() == reflect.Int64 { + return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to %v", tval, tval, mtype.String()) + } + + return val.Convert(mtype), nil + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + val := reflect.ValueOf(tval) + if mtype.Kind() == reflect.Int64 && mtype == reflect.TypeOf(time.Duration(1)) && val.Kind() == reflect.String { + d, err := time.ParseDuration(val.String()) + if err != nil { + return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to %v. %s", tval, tval, mtype.String(), err) + } + return reflect.ValueOf(d), nil + } + if !val.Type().ConvertibleTo(mtype) || val.Kind() == reflect.Float64 { + return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to %v", tval, tval, mtype.String()) + } + if reflect.Indirect(reflect.New(mtype)).OverflowInt(val.Convert(reflect.TypeOf(int64(0))).Int()) { + return reflect.ValueOf(nil), fmt.Errorf("%v(%T) would overflow %v", tval, tval, mtype.String()) + } + + return val.Convert(mtype), nil + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + val := reflect.ValueOf(tval) + if !val.Type().ConvertibleTo(mtype) || val.Kind() == reflect.Float64 { + return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to %v", tval, tval, mtype.String()) + } + + if val.Convert(reflect.TypeOf(int(1))).Int() < 0 { + return reflect.ValueOf(nil), fmt.Errorf("%v(%T) is negative so does not fit in %v", tval, tval, mtype.String()) + } + if reflect.Indirect(reflect.New(mtype)).OverflowUint(val.Convert(reflect.TypeOf(uint64(0))).Uint()) { + return reflect.ValueOf(nil), fmt.Errorf("%v(%T) would overflow %v", tval, tval, mtype.String()) + } + + return val.Convert(mtype), nil + case reflect.Float32, reflect.Float64: + val := reflect.ValueOf(tval) + if !val.Type().ConvertibleTo(mtype) || val.Kind() == reflect.Int64 { + return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to %v", tval, tval, mtype.String()) + } + if reflect.Indirect(reflect.New(mtype)).OverflowFloat(val.Convert(reflect.TypeOf(float64(0))).Float()) { + return reflect.ValueOf(nil), fmt.Errorf("%v(%T) would overflow %v", tval, tval, mtype.String()) + } + + return val.Convert(mtype), nil + case reflect.Interface: + if mval1 == nil || mval1.IsNil() { + return reflect.ValueOf(tval), nil + } else { + ival := mval1.Elem() + return d.valueFromToml(mval1.Elem().Type(), t, &ival) + } + case reflect.Slice, reflect.Array: + if isOtherSequence(mtype) && isOtherSequence(reflect.TypeOf(t)) { + return d.valueFromOtherSliceI(mtype, t) + } + return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to %v(%v)", tval, tval, mtype, mtype.Kind()) + default: + return reflect.ValueOf(nil), fmt.Errorf("Can't convert %v(%T) to %v(%v)", tval, tval, mtype, mtype.Kind()) + } + } +} + +func (d *Decoder) unwrapPointer(mtype reflect.Type, tval interface{}, mval1 *reflect.Value) (reflect.Value, error) { + var melem *reflect.Value + + if mval1 != nil && !mval1.IsNil() && (mtype.Elem().Kind() == reflect.Struct || mtype.Elem().Kind() == reflect.Interface) { + elem := mval1.Elem() + melem = &elem + } + + val, err := d.valueFromToml(mtype.Elem(), tval, melem) + if err != nil { + return reflect.ValueOf(nil), err + } + mval := reflect.New(mtype.Elem()) + mval.Elem().Set(val) + return mval, nil +} + +func (d *Decoder) unmarshalText(tval interface{}, mval reflect.Value) error { + var buf bytes.Buffer + fmt.Fprint(&buf, tval) + return callTextUnmarshaler(mval, buf.Bytes()) +} + +func tomlOptions(vf reflect.StructField, an annotation) tomlOpts { + tag := vf.Tag.Get(an.tag) + parse := strings.Split(tag, ",") + var comment string + if c := vf.Tag.Get(an.comment); c != "" { + comment = c + } + commented, _ := strconv.ParseBool(vf.Tag.Get(an.commented)) + multiline, _ := strconv.ParseBool(vf.Tag.Get(an.multiline)) + defaultValue := vf.Tag.Get(tagDefault) + result := tomlOpts{ + name: vf.Name, + nameFromTag: false, + comment: comment, + commented: commented, + multiline: multiline, + include: true, + omitempty: false, + defaultValue: defaultValue, + } + if parse[0] != "" { + if parse[0] == "-" && len(parse) == 1 { + result.include = false + } else { + result.name = strings.Trim(parse[0], " ") + result.nameFromTag = true + } + } + if vf.PkgPath != "" { + result.include = false + } + if len(parse) > 1 && strings.Trim(parse[1], " ") == "omitempty" { + result.omitempty = true + } + if vf.Type.Kind() == reflect.Ptr { + result.omitempty = true + } + return result +} + +func isZero(val reflect.Value) bool { + switch val.Type().Kind() { + case reflect.Slice, reflect.Array, reflect.Map: + return val.Len() == 0 + default: + return reflect.DeepEqual(val.Interface(), reflect.Zero(val.Type()).Interface()) + } +} + +func formatError(err error, pos Position) error { + if err.Error()[0] == '(' { // Error already contains position information + return err + } + return fmt.Errorf("%s: %s", pos, err) +} + +// visitorState keeps track of which keys were unmarshaled. +type visitorState struct { + tree *Tree + path []string + keys map[string]struct{} + active bool +} + +func newVisitorState(tree *Tree) visitorState { + path, result := []string{}, map[string]struct{}{} + insertKeys(path, result, tree) + return visitorState{ + tree: tree, + path: path[:0], + keys: result, + active: true, + } +} + +func (s *visitorState) push(key string) { + if s.active { + s.path = append(s.path, key) + } +} + +func (s *visitorState) pop() { + if s.active { + s.path = s.path[:len(s.path)-1] + } +} + +func (s *visitorState) visit() { + if s.active { + delete(s.keys, strings.Join(s.path, ".")) + } +} + +func (s *visitorState) visitAll() { + if s.active { + for k := range s.keys { + if strings.HasPrefix(k, strings.Join(s.path, ".")) { + delete(s.keys, k) + } + } + } +} + +func (s *visitorState) validate() error { + if !s.active { + return nil + } + undecoded := make([]string, 0, len(s.keys)) + for key := range s.keys { + undecoded = append(undecoded, key) + } + sort.Strings(undecoded) + if len(undecoded) > 0 { + return fmt.Errorf("undecoded keys: %q", undecoded) + } + return nil +} + +func insertKeys(path []string, m map[string]struct{}, tree *Tree) { + for k, v := range tree.values { + switch node := v.(type) { + case []*Tree: + for i, item := range node { + insertKeys(append(path, k, strconv.Itoa(i)), m, item) + } + case *Tree: + insertKeys(append(path, k), m, node) + case *tomlValue: + m[strings.Join(append(path, k), ".")] = struct{}{} + } + } +} diff --git a/test/vendor/github.com/pelletier/go-toml/marshal_OrderPreserve_test.toml b/test/vendor/github.com/pelletier/go-toml/marshal_OrderPreserve_test.toml new file mode 100644 index 0000000000..792b72ed72 --- /dev/null +++ b/test/vendor/github.com/pelletier/go-toml/marshal_OrderPreserve_test.toml @@ -0,0 +1,39 @@ +title = "TOML Marshal Testing" + +[basic_lists] + floats = [12.3,45.6,78.9] + bools = [true,false,true] + dates = [1979-05-27T07:32:00Z,1980-05-27T07:32:00Z] + ints = [8001,8001,8002] + uints = [5002,5003] + strings = ["One","Two","Three"] + +[[subdocptrs]] + name = "Second" + +[basic_map] + one = "one" + two = "two" + +[subdoc] + + [subdoc.second] + name = "Second" + + [subdoc.first] + name = "First" + +[basic] + uint = 5001 + bool = true + float = 123.4 + float64 = 123.456782132399 + int = 5000 + string = "Bite me" + date = 1979-05-27T07:32:00Z + +[[subdoclist]] + name = "List.First" + +[[subdoclist]] + name = "List.Second" diff --git a/test/vendor/github.com/pelletier/go-toml/marshal_test.toml b/test/vendor/github.com/pelletier/go-toml/marshal_test.toml new file mode 100644 index 0000000000..ba5e110bf0 --- /dev/null +++ b/test/vendor/github.com/pelletier/go-toml/marshal_test.toml @@ -0,0 +1,39 @@ +title = "TOML Marshal Testing" + +[basic] + bool = true + date = 1979-05-27T07:32:00Z + float = 123.4 + float64 = 123.456782132399 + int = 5000 + string = "Bite me" + uint = 5001 + +[basic_lists] + bools = [true,false,true] + dates = [1979-05-27T07:32:00Z,1980-05-27T07:32:00Z] + floats = [12.3,45.6,78.9] + ints = [8001,8001,8002] + strings = ["One","Two","Three"] + uints = [5002,5003] + +[basic_map] + one = "one" + two = "two" + +[subdoc] + + [subdoc.first] + name = "First" + + [subdoc.second] + name = "Second" + +[[subdoclist]] + name = "List.First" + +[[subdoclist]] + name = "List.Second" + +[[subdocptrs]] + name = "Second" diff --git a/test/vendor/github.com/pelletier/go-toml/parser.go b/test/vendor/github.com/pelletier/go-toml/parser.go new file mode 100644 index 0000000000..7bf40bbdc7 --- /dev/null +++ b/test/vendor/github.com/pelletier/go-toml/parser.go @@ -0,0 +1,493 @@ +// TOML Parser. + +package toml + +import ( + "errors" + "fmt" + "math" + "reflect" + "regexp" + "strconv" + "strings" + "time" +) + +type tomlParser struct { + flowIdx int + flow []token + tree *Tree + currentTable []string + seenTableKeys []string +} + +type tomlParserStateFn func() tomlParserStateFn + +// Formats and panics an error message based on a token +func (p *tomlParser) raiseError(tok *token, msg string, args ...interface{}) { + panic(tok.Position.String() + ": " + fmt.Sprintf(msg, args...)) +} + +func (p *tomlParser) run() { + for state := p.parseStart; state != nil; { + state = state() + } +} + +func (p *tomlParser) peek() *token { + if p.flowIdx >= len(p.flow) { + return nil + } + return &p.flow[p.flowIdx] +} + +func (p *tomlParser) assume(typ tokenType) { + tok := p.getToken() + if tok == nil { + p.raiseError(tok, "was expecting token %s, but token stream is empty", tok) + } + if tok.typ != typ { + p.raiseError(tok, "was expecting token %s, but got %s instead", typ, tok) + } +} + +func (p *tomlParser) getToken() *token { + tok := p.peek() + if tok == nil { + return nil + } + p.flowIdx++ + return tok +} + +func (p *tomlParser) parseStart() tomlParserStateFn { + tok := p.peek() + + // end of stream, parsing is finished + if tok == nil { + return nil + } + + switch tok.typ { + case tokenDoubleLeftBracket: + return p.parseGroupArray + case tokenLeftBracket: + return p.parseGroup + case tokenKey: + return p.parseAssign + case tokenEOF: + return nil + case tokenError: + p.raiseError(tok, "parsing error: %s", tok.String()) + default: + p.raiseError(tok, "unexpected token %s", tok.typ) + } + return nil +} + +func (p *tomlParser) parseGroupArray() tomlParserStateFn { + startToken := p.getToken() // discard the [[ + key := p.getToken() + if key.typ != tokenKeyGroupArray { + p.raiseError(key, "unexpected token %s, was expecting a table array key", key) + } + + // get or create table array element at the indicated part in the path + keys, err := parseKey(key.val) + if err != nil { + p.raiseError(key, "invalid table array key: %s", err) + } + p.tree.createSubTree(keys[:len(keys)-1], startToken.Position) // create parent entries + destTree := p.tree.GetPath(keys) + var array []*Tree + if destTree == nil { + array = make([]*Tree, 0) + } else if target, ok := destTree.([]*Tree); ok && target != nil { + array = destTree.([]*Tree) + } else { + p.raiseError(key, "key %s is already assigned and not of type table array", key) + } + p.currentTable = keys + + // add a new tree to the end of the table array + newTree := newTree() + newTree.position = startToken.Position + array = append(array, newTree) + p.tree.SetPath(p.currentTable, array) + + // remove all keys that were children of this table array + prefix := key.val + "." + found := false + for ii := 0; ii < len(p.seenTableKeys); { + tableKey := p.seenTableKeys[ii] + if strings.HasPrefix(tableKey, prefix) { + p.seenTableKeys = append(p.seenTableKeys[:ii], p.seenTableKeys[ii+1:]...) + } else { + found = (tableKey == key.val) + ii++ + } + } + + // keep this key name from use by other kinds of assignments + if !found { + p.seenTableKeys = append(p.seenTableKeys, key.val) + } + + // move to next parser state + p.assume(tokenDoubleRightBracket) + return p.parseStart +} + +func (p *tomlParser) parseGroup() tomlParserStateFn { + startToken := p.getToken() // discard the [ + key := p.getToken() + if key.typ != tokenKeyGroup { + p.raiseError(key, "unexpected token %s, was expecting a table key", key) + } + for _, item := range p.seenTableKeys { + if item == key.val { + p.raiseError(key, "duplicated tables") + } + } + + p.seenTableKeys = append(p.seenTableKeys, key.val) + keys, err := parseKey(key.val) + if err != nil { + p.raiseError(key, "invalid table array key: %s", err) + } + if err := p.tree.createSubTree(keys, startToken.Position); err != nil { + p.raiseError(key, "%s", err) + } + destTree := p.tree.GetPath(keys) + if target, ok := destTree.(*Tree); ok && target != nil && target.inline { + p.raiseError(key, "could not re-define exist inline table or its sub-table : %s", + strings.Join(keys, ".")) + } + p.assume(tokenRightBracket) + p.currentTable = keys + return p.parseStart +} + +func (p *tomlParser) parseAssign() tomlParserStateFn { + key := p.getToken() + p.assume(tokenEqual) + + parsedKey, err := parseKey(key.val) + if err != nil { + p.raiseError(key, "invalid key: %s", err.Error()) + } + + value := p.parseRvalue() + var tableKey []string + if len(p.currentTable) > 0 { + tableKey = p.currentTable + } else { + tableKey = []string{} + } + + prefixKey := parsedKey[0 : len(parsedKey)-1] + tableKey = append(tableKey, prefixKey...) + + // find the table to assign, looking out for arrays of tables + var targetNode *Tree + switch node := p.tree.GetPath(tableKey).(type) { + case []*Tree: + targetNode = node[len(node)-1] + case *Tree: + targetNode = node + case nil: + // create intermediate + if err := p.tree.createSubTree(tableKey, key.Position); err != nil { + p.raiseError(key, "could not create intermediate group: %s", err) + } + targetNode = p.tree.GetPath(tableKey).(*Tree) + default: + p.raiseError(key, "Unknown table type for path: %s", + strings.Join(tableKey, ".")) + } + + if targetNode.inline { + p.raiseError(key, "could not add key or sub-table to exist inline table or its sub-table : %s", + strings.Join(tableKey, ".")) + } + + // assign value to the found table + keyVal := parsedKey[len(parsedKey)-1] + localKey := []string{keyVal} + finalKey := append(tableKey, keyVal) + if targetNode.GetPath(localKey) != nil { + p.raiseError(key, "The following key was defined twice: %s", + strings.Join(finalKey, ".")) + } + var toInsert interface{} + + switch value.(type) { + case *Tree, []*Tree: + toInsert = value + default: + toInsert = &tomlValue{value: value, position: key.Position} + } + targetNode.values[keyVal] = toInsert + return p.parseStart +} + +var numberUnderscoreInvalidRegexp *regexp.Regexp +var hexNumberUnderscoreInvalidRegexp *regexp.Regexp + +func numberContainsInvalidUnderscore(value string) error { + if numberUnderscoreInvalidRegexp.MatchString(value) { + return errors.New("invalid use of _ in number") + } + return nil +} + +func hexNumberContainsInvalidUnderscore(value string) error { + if hexNumberUnderscoreInvalidRegexp.MatchString(value) { + return errors.New("invalid use of _ in hex number") + } + return nil +} + +func cleanupNumberToken(value string) string { + cleanedVal := strings.Replace(value, "_", "", -1) + return cleanedVal +} + +func (p *tomlParser) parseRvalue() interface{} { + tok := p.getToken() + if tok == nil || tok.typ == tokenEOF { + p.raiseError(tok, "expecting a value") + } + + switch tok.typ { + case tokenString: + return tok.val + case tokenTrue: + return true + case tokenFalse: + return false + case tokenInf: + if tok.val[0] == '-' { + return math.Inf(-1) + } + return math.Inf(1) + case tokenNan: + return math.NaN() + case tokenInteger: + cleanedVal := cleanupNumberToken(tok.val) + var err error + var val int64 + if len(cleanedVal) >= 3 && cleanedVal[0] == '0' { + switch cleanedVal[1] { + case 'x': + err = hexNumberContainsInvalidUnderscore(tok.val) + if err != nil { + p.raiseError(tok, "%s", err) + } + val, err = strconv.ParseInt(cleanedVal[2:], 16, 64) + case 'o': + err = numberContainsInvalidUnderscore(tok.val) + if err != nil { + p.raiseError(tok, "%s", err) + } + val, err = strconv.ParseInt(cleanedVal[2:], 8, 64) + case 'b': + err = numberContainsInvalidUnderscore(tok.val) + if err != nil { + p.raiseError(tok, "%s", err) + } + val, err = strconv.ParseInt(cleanedVal[2:], 2, 64) + default: + panic("invalid base") // the lexer should catch this first + } + } else { + err = numberContainsInvalidUnderscore(tok.val) + if err != nil { + p.raiseError(tok, "%s", err) + } + val, err = strconv.ParseInt(cleanedVal, 10, 64) + } + if err != nil { + p.raiseError(tok, "%s", err) + } + return val + case tokenFloat: + err := numberContainsInvalidUnderscore(tok.val) + if err != nil { + p.raiseError(tok, "%s", err) + } + cleanedVal := cleanupNumberToken(tok.val) + val, err := strconv.ParseFloat(cleanedVal, 64) + if err != nil { + p.raiseError(tok, "%s", err) + } + return val + case tokenDate: + layout := time.RFC3339Nano + if !strings.Contains(tok.val, "T") { + layout = strings.Replace(layout, "T", " ", 1) + } + val, err := time.ParseInLocation(layout, tok.val, time.UTC) + if err != nil { + p.raiseError(tok, "%s", err) + } + return val + case tokenLocalDate: + v := strings.Replace(tok.val, " ", "T", -1) + isDateTime := false + isTime := false + for _, c := range v { + if c == 'T' || c == 't' { + isDateTime = true + break + } + if c == ':' { + isTime = true + break + } + } + + var val interface{} + var err error + + if isDateTime { + val, err = ParseLocalDateTime(v) + } else if isTime { + val, err = ParseLocalTime(v) + } else { + val, err = ParseLocalDate(v) + } + + if err != nil { + p.raiseError(tok, "%s", err) + } + return val + case tokenLeftBracket: + return p.parseArray() + case tokenLeftCurlyBrace: + return p.parseInlineTable() + case tokenEqual: + p.raiseError(tok, "cannot have multiple equals for the same key") + case tokenError: + p.raiseError(tok, "%s", tok) + } + + p.raiseError(tok, "never reached") + + return nil +} + +func tokenIsComma(t *token) bool { + return t != nil && t.typ == tokenComma +} + +func (p *tomlParser) parseInlineTable() *Tree { + tree := newTree() + var previous *token +Loop: + for { + follow := p.peek() + if follow == nil || follow.typ == tokenEOF { + p.raiseError(follow, "unterminated inline table") + } + switch follow.typ { + case tokenRightCurlyBrace: + p.getToken() + break Loop + case tokenKey, tokenInteger, tokenString: + if !tokenIsComma(previous) && previous != nil { + p.raiseError(follow, "comma expected between fields in inline table") + } + key := p.getToken() + p.assume(tokenEqual) + + parsedKey, err := parseKey(key.val) + if err != nil { + p.raiseError(key, "invalid key: %s", err) + } + + value := p.parseRvalue() + tree.SetPath(parsedKey, value) + case tokenComma: + if tokenIsComma(previous) { + p.raiseError(follow, "need field between two commas in inline table") + } + p.getToken() + default: + p.raiseError(follow, "unexpected token type in inline table: %s", follow.String()) + } + previous = follow + } + if tokenIsComma(previous) { + p.raiseError(previous, "trailing comma at the end of inline table") + } + tree.inline = true + return tree +} + +func (p *tomlParser) parseArray() interface{} { + var array []interface{} + arrayType := reflect.TypeOf(newTree()) + for { + follow := p.peek() + if follow == nil || follow.typ == tokenEOF { + p.raiseError(follow, "unterminated array") + } + if follow.typ == tokenRightBracket { + p.getToken() + break + } + val := p.parseRvalue() + if reflect.TypeOf(val) != arrayType { + arrayType = nil + } + array = append(array, val) + follow = p.peek() + if follow == nil || follow.typ == tokenEOF { + p.raiseError(follow, "unterminated array") + } + if follow.typ != tokenRightBracket && follow.typ != tokenComma { + p.raiseError(follow, "missing comma") + } + if follow.typ == tokenComma { + p.getToken() + } + } + + // if the array is a mixed-type array or its length is 0, + // don't convert it to a table array + if len(array) <= 0 { + arrayType = nil + } + // An array of Trees is actually an array of inline + // tables, which is a shorthand for a table array. If the + // array was not converted from []interface{} to []*Tree, + // the two notations would not be equivalent. + if arrayType == reflect.TypeOf(newTree()) { + tomlArray := make([]*Tree, len(array)) + for i, v := range array { + tomlArray[i] = v.(*Tree) + } + return tomlArray + } + return array +} + +func parseToml(flow []token) *Tree { + result := newTree() + result.position = Position{1, 1} + parser := &tomlParser{ + flowIdx: 0, + flow: flow, + tree: result, + currentTable: make([]string, 0), + seenTableKeys: make([]string, 0), + } + parser.run() + return result +} + +func init() { + numberUnderscoreInvalidRegexp = regexp.MustCompile(`([^\d]_|_[^\d])|_$|^_`) + hexNumberUnderscoreInvalidRegexp = regexp.MustCompile(`(^0x_)|([^\da-f]_|_[^\da-f])|_$|^_`) +} diff --git a/test/vendor/github.com/pelletier/go-toml/position.go b/test/vendor/github.com/pelletier/go-toml/position.go new file mode 100644 index 0000000000..c17bff87ba --- /dev/null +++ b/test/vendor/github.com/pelletier/go-toml/position.go @@ -0,0 +1,29 @@ +// Position support for go-toml + +package toml + +import ( + "fmt" +) + +// Position of a document element within a TOML document. +// +// Line and Col are both 1-indexed positions for the element's line number and +// column number, respectively. Values of zero or less will cause Invalid(), +// to return true. +type Position struct { + Line int // line within the document + Col int // column within the line +} + +// String representation of the position. +// Displays 1-indexed line and column numbers. +func (p Position) String() string { + return fmt.Sprintf("(%d, %d)", p.Line, p.Col) +} + +// Invalid returns whether or not the position is valid (i.e. with negative or +// null values) +func (p Position) Invalid() bool { + return p.Line <= 0 || p.Col <= 0 +} diff --git a/test/vendor/github.com/pelletier/go-toml/token.go b/test/vendor/github.com/pelletier/go-toml/token.go new file mode 100644 index 0000000000..6af4ec46bc --- /dev/null +++ b/test/vendor/github.com/pelletier/go-toml/token.go @@ -0,0 +1,134 @@ +package toml + +import "fmt" + +// Define tokens +type tokenType int + +const ( + eof = -(iota + 1) +) + +const ( + tokenError tokenType = iota + tokenEOF + tokenComment + tokenKey + tokenString + tokenInteger + tokenTrue + tokenFalse + tokenFloat + tokenInf + tokenNan + tokenEqual + tokenLeftBracket + tokenRightBracket + tokenLeftCurlyBrace + tokenRightCurlyBrace + tokenLeftParen + tokenRightParen + tokenDoubleLeftBracket + tokenDoubleRightBracket + tokenDate + tokenLocalDate + tokenKeyGroup + tokenKeyGroupArray + tokenComma + tokenColon + tokenDollar + tokenStar + tokenQuestion + tokenDot + tokenDotDot + tokenEOL +) + +var tokenTypeNames = []string{ + "Error", + "EOF", + "Comment", + "Key", + "String", + "Integer", + "True", + "False", + "Float", + "Inf", + "NaN", + "=", + "[", + "]", + "{", + "}", + "(", + ")", + "]]", + "[[", + "LocalDate", + "LocalDate", + "KeyGroup", + "KeyGroupArray", + ",", + ":", + "$", + "*", + "?", + ".", + "..", + "EOL", +} + +type token struct { + Position + typ tokenType + val string +} + +func (tt tokenType) String() string { + idx := int(tt) + if idx < len(tokenTypeNames) { + return tokenTypeNames[idx] + } + return "Unknown" +} + +func (t token) String() string { + switch t.typ { + case tokenEOF: + return "EOF" + case tokenError: + return t.val + } + + return fmt.Sprintf("%q", t.val) +} + +func isSpace(r rune) bool { + return r == ' ' || r == '\t' +} + +func isAlphanumeric(r rune) bool { + return 'a' <= r && r <= 'z' || 'A' <= r && r <= 'Z' || r == '_' +} + +func isKeyChar(r rune) bool { + // Keys start with the first character that isn't whitespace or [ and end + // with the last non-whitespace character before the equals sign. Keys + // cannot contain a # character." + return !(r == '\r' || r == '\n' || r == eof || r == '=') +} + +func isKeyStartChar(r rune) bool { + return !(isSpace(r) || r == '\r' || r == '\n' || r == eof || r == '[') +} + +func isDigit(r rune) bool { + return '0' <= r && r <= '9' +} + +func isHexDigit(r rune) bool { + return isDigit(r) || + (r >= 'a' && r <= 'f') || + (r >= 'A' && r <= 'F') +} diff --git a/test/vendor/github.com/pelletier/go-toml/toml.go b/test/vendor/github.com/pelletier/go-toml/toml.go new file mode 100644 index 0000000000..cbb89a9af3 --- /dev/null +++ b/test/vendor/github.com/pelletier/go-toml/toml.go @@ -0,0 +1,529 @@ +package toml + +import ( + "errors" + "fmt" + "io" + "io/ioutil" + "os" + "runtime" + "strings" +) + +type tomlValue struct { + value interface{} // string, int64, uint64, float64, bool, time.Time, [] of any of this list + comment string + commented bool + multiline bool + position Position +} + +// Tree is the result of the parsing of a TOML file. +type Tree struct { + values map[string]interface{} // string -> *tomlValue, *Tree, []*Tree + comment string + commented bool + inline bool + position Position +} + +func newTree() *Tree { + return newTreeWithPosition(Position{}) +} + +func newTreeWithPosition(pos Position) *Tree { + return &Tree{ + values: make(map[string]interface{}), + position: pos, + } +} + +// TreeFromMap initializes a new Tree object using the given map. +func TreeFromMap(m map[string]interface{}) (*Tree, error) { + result, err := toTree(m) + if err != nil { + return nil, err + } + return result.(*Tree), nil +} + +// Position returns the position of the tree. +func (t *Tree) Position() Position { + return t.position +} + +// Has returns a boolean indicating if the given key exists. +func (t *Tree) Has(key string) bool { + if key == "" { + return false + } + return t.HasPath(strings.Split(key, ".")) +} + +// HasPath returns true if the given path of keys exists, false otherwise. +func (t *Tree) HasPath(keys []string) bool { + return t.GetPath(keys) != nil +} + +// Keys returns the keys of the toplevel tree (does not recurse). +func (t *Tree) Keys() []string { + keys := make([]string, len(t.values)) + i := 0 + for k := range t.values { + keys[i] = k + i++ + } + return keys +} + +// Get the value at key in the Tree. +// Key is a dot-separated path (e.g. a.b.c) without single/double quoted strings. +// If you need to retrieve non-bare keys, use GetPath. +// Returns nil if the path does not exist in the tree. +// If keys is of length zero, the current tree is returned. +func (t *Tree) Get(key string) interface{} { + if key == "" { + return t + } + return t.GetPath(strings.Split(key, ".")) +} + +// GetPath returns the element in the tree indicated by 'keys'. +// If keys is of length zero, the current tree is returned. +func (t *Tree) GetPath(keys []string) interface{} { + if len(keys) == 0 { + return t + } + subtree := t + for _, intermediateKey := range keys[:len(keys)-1] { + value, exists := subtree.values[intermediateKey] + if !exists { + return nil + } + switch node := value.(type) { + case *Tree: + subtree = node + case []*Tree: + // go to most recent element + if len(node) == 0 { + return nil + } + subtree = node[len(node)-1] + default: + return nil // cannot navigate through other node types + } + } + // branch based on final node type + switch node := subtree.values[keys[len(keys)-1]].(type) { + case *tomlValue: + return node.value + default: + return node + } +} + +// GetArray returns the value at key in the Tree. +// It returns []string, []int64, etc type if key has homogeneous lists +// Key is a dot-separated path (e.g. a.b.c) without single/double quoted strings. +// Returns nil if the path does not exist in the tree. +// If keys is of length zero, the current tree is returned. +func (t *Tree) GetArray(key string) interface{} { + if key == "" { + return t + } + return t.GetArrayPath(strings.Split(key, ".")) +} + +// GetArrayPath returns the element in the tree indicated by 'keys'. +// If keys is of length zero, the current tree is returned. +func (t *Tree) GetArrayPath(keys []string) interface{} { + if len(keys) == 0 { + return t + } + subtree := t + for _, intermediateKey := range keys[:len(keys)-1] { + value, exists := subtree.values[intermediateKey] + if !exists { + return nil + } + switch node := value.(type) { + case *Tree: + subtree = node + case []*Tree: + // go to most recent element + if len(node) == 0 { + return nil + } + subtree = node[len(node)-1] + default: + return nil // cannot navigate through other node types + } + } + // branch based on final node type + switch node := subtree.values[keys[len(keys)-1]].(type) { + case *tomlValue: + switch n := node.value.(type) { + case []interface{}: + return getArray(n) + default: + return node.value + } + default: + return node + } +} + +// if homogeneous array, then return slice type object over []interface{} +func getArray(n []interface{}) interface{} { + var s []string + var i64 []int64 + var f64 []float64 + var bl []bool + for _, value := range n { + switch v := value.(type) { + case string: + s = append(s, v) + case int64: + i64 = append(i64, v) + case float64: + f64 = append(f64, v) + case bool: + bl = append(bl, v) + default: + return n + } + } + if len(s) == len(n) { + return s + } else if len(i64) == len(n) { + return i64 + } else if len(f64) == len(n) { + return f64 + } else if len(bl) == len(n) { + return bl + } + return n +} + +// GetPosition returns the position of the given key. +func (t *Tree) GetPosition(key string) Position { + if key == "" { + return t.position + } + return t.GetPositionPath(strings.Split(key, ".")) +} + +// SetPositionPath sets the position of element in the tree indicated by 'keys'. +// If keys is of length zero, the current tree position is set. +func (t *Tree) SetPositionPath(keys []string, pos Position) { + if len(keys) == 0 { + t.position = pos + return + } + subtree := t + for _, intermediateKey := range keys[:len(keys)-1] { + value, exists := subtree.values[intermediateKey] + if !exists { + return + } + switch node := value.(type) { + case *Tree: + subtree = node + case []*Tree: + // go to most recent element + if len(node) == 0 { + return + } + subtree = node[len(node)-1] + default: + return + } + } + // branch based on final node type + switch node := subtree.values[keys[len(keys)-1]].(type) { + case *tomlValue: + node.position = pos + return + case *Tree: + node.position = pos + return + case []*Tree: + // go to most recent element + if len(node) == 0 { + return + } + node[len(node)-1].position = pos + return + } +} + +// GetPositionPath returns the element in the tree indicated by 'keys'. +// If keys is of length zero, the current tree is returned. +func (t *Tree) GetPositionPath(keys []string) Position { + if len(keys) == 0 { + return t.position + } + subtree := t + for _, intermediateKey := range keys[:len(keys)-1] { + value, exists := subtree.values[intermediateKey] + if !exists { + return Position{0, 0} + } + switch node := value.(type) { + case *Tree: + subtree = node + case []*Tree: + // go to most recent element + if len(node) == 0 { + return Position{0, 0} + } + subtree = node[len(node)-1] + default: + return Position{0, 0} + } + } + // branch based on final node type + switch node := subtree.values[keys[len(keys)-1]].(type) { + case *tomlValue: + return node.position + case *Tree: + return node.position + case []*Tree: + // go to most recent element + if len(node) == 0 { + return Position{0, 0} + } + return node[len(node)-1].position + default: + return Position{0, 0} + } +} + +// GetDefault works like Get but with a default value +func (t *Tree) GetDefault(key string, def interface{}) interface{} { + val := t.Get(key) + if val == nil { + return def + } + return val +} + +// SetOptions arguments are supplied to the SetWithOptions and SetPathWithOptions functions to modify marshalling behaviour. +// The default values within the struct are valid default options. +type SetOptions struct { + Comment string + Commented bool + Multiline bool +} + +// SetWithOptions is the same as Set, but allows you to provide formatting +// instructions to the key, that will be used by Marshal(). +func (t *Tree) SetWithOptions(key string, opts SetOptions, value interface{}) { + t.SetPathWithOptions(strings.Split(key, "."), opts, value) +} + +// SetPathWithOptions is the same as SetPath, but allows you to provide +// formatting instructions to the key, that will be reused by Marshal(). +func (t *Tree) SetPathWithOptions(keys []string, opts SetOptions, value interface{}) { + subtree := t + for i, intermediateKey := range keys[:len(keys)-1] { + nextTree, exists := subtree.values[intermediateKey] + if !exists { + nextTree = newTreeWithPosition(Position{Line: t.position.Line + i, Col: t.position.Col}) + subtree.values[intermediateKey] = nextTree // add new element here + } + switch node := nextTree.(type) { + case *Tree: + subtree = node + case []*Tree: + // go to most recent element + if len(node) == 0 { + // create element if it does not exist + node = append(node, newTreeWithPosition(Position{Line: t.position.Line + i, Col: t.position.Col})) + subtree.values[intermediateKey] = node + } + subtree = node[len(node)-1] + } + } + + var toInsert interface{} + + switch v := value.(type) { + case *Tree: + v.comment = opts.Comment + v.commented = opts.Commented + toInsert = value + case []*Tree: + for i := range v { + v[i].commented = opts.Commented + } + toInsert = value + case *tomlValue: + v.comment = opts.Comment + v.commented = opts.Commented + v.multiline = opts.Multiline + toInsert = v + default: + toInsert = &tomlValue{value: value, + comment: opts.Comment, + commented: opts.Commented, + multiline: opts.Multiline, + position: Position{Line: subtree.position.Line + len(subtree.values) + 1, Col: subtree.position.Col}} + } + + subtree.values[keys[len(keys)-1]] = toInsert +} + +// Set an element in the tree. +// Key is a dot-separated path (e.g. a.b.c). +// Creates all necessary intermediate trees, if needed. +func (t *Tree) Set(key string, value interface{}) { + t.SetWithComment(key, "", false, value) +} + +// SetWithComment is the same as Set, but allows you to provide comment +// information to the key, that will be reused by Marshal(). +func (t *Tree) SetWithComment(key string, comment string, commented bool, value interface{}) { + t.SetPathWithComment(strings.Split(key, "."), comment, commented, value) +} + +// SetPath sets an element in the tree. +// Keys is an array of path elements (e.g. {"a","b","c"}). +// Creates all necessary intermediate trees, if needed. +func (t *Tree) SetPath(keys []string, value interface{}) { + t.SetPathWithComment(keys, "", false, value) +} + +// SetPathWithComment is the same as SetPath, but allows you to provide comment +// information to the key, that will be reused by Marshal(). +func (t *Tree) SetPathWithComment(keys []string, comment string, commented bool, value interface{}) { + t.SetPathWithOptions(keys, SetOptions{Comment: comment, Commented: commented}, value) +} + +// Delete removes a key from the tree. +// Key is a dot-separated path (e.g. a.b.c). +func (t *Tree) Delete(key string) error { + keys, err := parseKey(key) + if err != nil { + return err + } + return t.DeletePath(keys) +} + +// DeletePath removes a key from the tree. +// Keys is an array of path elements (e.g. {"a","b","c"}). +func (t *Tree) DeletePath(keys []string) error { + keyLen := len(keys) + if keyLen == 1 { + delete(t.values, keys[0]) + return nil + } + tree := t.GetPath(keys[:keyLen-1]) + item := keys[keyLen-1] + switch node := tree.(type) { + case *Tree: + delete(node.values, item) + return nil + } + return errors.New("no such key to delete") +} + +// createSubTree takes a tree and a key and create the necessary intermediate +// subtrees to create a subtree at that point. In-place. +// +// e.g. passing a.b.c will create (assuming tree is empty) tree[a], tree[a][b] +// and tree[a][b][c] +// +// Returns nil on success, error object on failure +func (t *Tree) createSubTree(keys []string, pos Position) error { + subtree := t + for i, intermediateKey := range keys { + nextTree, exists := subtree.values[intermediateKey] + if !exists { + tree := newTreeWithPosition(Position{Line: t.position.Line + i, Col: t.position.Col}) + tree.position = pos + tree.inline = subtree.inline + subtree.values[intermediateKey] = tree + nextTree = tree + } + + switch node := nextTree.(type) { + case []*Tree: + subtree = node[len(node)-1] + case *Tree: + subtree = node + default: + return fmt.Errorf("unknown type for path %s (%s): %T (%#v)", + strings.Join(keys, "."), intermediateKey, nextTree, nextTree) + } + } + return nil +} + +// LoadBytes creates a Tree from a []byte. +func LoadBytes(b []byte) (tree *Tree, err error) { + defer func() { + if r := recover(); r != nil { + if _, ok := r.(runtime.Error); ok { + panic(r) + } + err = errors.New(r.(string)) + } + }() + + if len(b) >= 4 && (hasUTF32BigEndianBOM4(b) || hasUTF32LittleEndianBOM4(b)) { + b = b[4:] + } else if len(b) >= 3 && hasUTF8BOM3(b) { + b = b[3:] + } else if len(b) >= 2 && (hasUTF16BigEndianBOM2(b) || hasUTF16LittleEndianBOM2(b)) { + b = b[2:] + } + + tree = parseToml(lexToml(b)) + return +} + +func hasUTF16BigEndianBOM2(b []byte) bool { + return b[0] == 0xFE && b[1] == 0xFF +} + +func hasUTF16LittleEndianBOM2(b []byte) bool { + return b[0] == 0xFF && b[1] == 0xFE +} + +func hasUTF8BOM3(b []byte) bool { + return b[0] == 0xEF && b[1] == 0xBB && b[2] == 0xBF +} + +func hasUTF32BigEndianBOM4(b []byte) bool { + return b[0] == 0x00 && b[1] == 0x00 && b[2] == 0xFE && b[3] == 0xFF +} + +func hasUTF32LittleEndianBOM4(b []byte) bool { + return b[0] == 0xFF && b[1] == 0xFE && b[2] == 0x00 && b[3] == 0x00 +} + +// LoadReader creates a Tree from any io.Reader. +func LoadReader(reader io.Reader) (tree *Tree, err error) { + inputBytes, err := ioutil.ReadAll(reader) + if err != nil { + return + } + tree, err = LoadBytes(inputBytes) + return +} + +// Load creates a Tree from a string. +func Load(content string) (tree *Tree, err error) { + return LoadBytes([]byte(content)) +} + +// LoadFile creates a Tree from a file. +func LoadFile(path string) (tree *Tree, err error) { + file, err := os.Open(path) + if err != nil { + return nil, err + } + defer file.Close() + return LoadReader(file) +} diff --git a/test/vendor/github.com/pelletier/go-toml/tomltree_create.go b/test/vendor/github.com/pelletier/go-toml/tomltree_create.go new file mode 100644 index 0000000000..80353500a0 --- /dev/null +++ b/test/vendor/github.com/pelletier/go-toml/tomltree_create.go @@ -0,0 +1,155 @@ +package toml + +import ( + "fmt" + "reflect" + "time" +) + +var kindToType = [reflect.String + 1]reflect.Type{ + reflect.Bool: reflect.TypeOf(true), + reflect.String: reflect.TypeOf(""), + reflect.Float32: reflect.TypeOf(float64(1)), + reflect.Float64: reflect.TypeOf(float64(1)), + reflect.Int: reflect.TypeOf(int64(1)), + reflect.Int8: reflect.TypeOf(int64(1)), + reflect.Int16: reflect.TypeOf(int64(1)), + reflect.Int32: reflect.TypeOf(int64(1)), + reflect.Int64: reflect.TypeOf(int64(1)), + reflect.Uint: reflect.TypeOf(uint64(1)), + reflect.Uint8: reflect.TypeOf(uint64(1)), + reflect.Uint16: reflect.TypeOf(uint64(1)), + reflect.Uint32: reflect.TypeOf(uint64(1)), + reflect.Uint64: reflect.TypeOf(uint64(1)), +} + +// typeFor returns a reflect.Type for a reflect.Kind, or nil if none is found. +// supported values: +// string, bool, int64, uint64, float64, time.Time, int, int8, int16, int32, uint, uint8, uint16, uint32, float32 +func typeFor(k reflect.Kind) reflect.Type { + if k > 0 && int(k) < len(kindToType) { + return kindToType[k] + } + return nil +} + +func simpleValueCoercion(object interface{}) (interface{}, error) { + switch original := object.(type) { + case string, bool, int64, uint64, float64, time.Time: + return original, nil + case int: + return int64(original), nil + case int8: + return int64(original), nil + case int16: + return int64(original), nil + case int32: + return int64(original), nil + case uint: + return uint64(original), nil + case uint8: + return uint64(original), nil + case uint16: + return uint64(original), nil + case uint32: + return uint64(original), nil + case float32: + return float64(original), nil + case fmt.Stringer: + return original.String(), nil + case []interface{}: + value := reflect.ValueOf(original) + length := value.Len() + arrayValue := reflect.MakeSlice(value.Type(), 0, length) + for i := 0; i < length; i++ { + val := value.Index(i).Interface() + simpleValue, err := simpleValueCoercion(val) + if err != nil { + return nil, err + } + arrayValue = reflect.Append(arrayValue, reflect.ValueOf(simpleValue)) + } + return arrayValue.Interface(), nil + default: + return nil, fmt.Errorf("cannot convert type %T to Tree", object) + } +} + +func sliceToTree(object interface{}) (interface{}, error) { + // arrays are a bit tricky, since they can represent either a + // collection of simple values, which is represented by one + // *tomlValue, or an array of tables, which is represented by an + // array of *Tree. + + // holding the assumption that this function is called from toTree only when value.Kind() is Array or Slice + value := reflect.ValueOf(object) + insideType := value.Type().Elem() + length := value.Len() + if length > 0 { + insideType = reflect.ValueOf(value.Index(0).Interface()).Type() + } + if insideType.Kind() == reflect.Map { + // this is considered as an array of tables + tablesArray := make([]*Tree, 0, length) + for i := 0; i < length; i++ { + table := value.Index(i) + tree, err := toTree(table.Interface()) + if err != nil { + return nil, err + } + tablesArray = append(tablesArray, tree.(*Tree)) + } + return tablesArray, nil + } + + sliceType := typeFor(insideType.Kind()) + if sliceType == nil { + sliceType = insideType + } + + arrayValue := reflect.MakeSlice(reflect.SliceOf(sliceType), 0, length) + + for i := 0; i < length; i++ { + val := value.Index(i).Interface() + simpleValue, err := simpleValueCoercion(val) + if err != nil { + return nil, err + } + arrayValue = reflect.Append(arrayValue, reflect.ValueOf(simpleValue)) + } + return &tomlValue{value: arrayValue.Interface(), position: Position{}}, nil +} + +func toTree(object interface{}) (interface{}, error) { + value := reflect.ValueOf(object) + + if value.Kind() == reflect.Map { + values := map[string]interface{}{} + keys := value.MapKeys() + for _, key := range keys { + if key.Kind() != reflect.String { + if _, ok := key.Interface().(string); !ok { + return nil, fmt.Errorf("map key needs to be a string, not %T (%v)", key.Interface(), key.Kind()) + } + } + + v := value.MapIndex(key) + newValue, err := toTree(v.Interface()) + if err != nil { + return nil, err + } + values[key.String()] = newValue + } + return &Tree{values: values, position: Position{}}, nil + } + + if value.Kind() == reflect.Array || value.Kind() == reflect.Slice { + return sliceToTree(object) + } + + simpleValue, err := simpleValueCoercion(object) + if err != nil { + return nil, err + } + return &tomlValue{value: simpleValue, position: Position{}}, nil +} diff --git a/test/vendor/github.com/pelletier/go-toml/tomltree_write.go b/test/vendor/github.com/pelletier/go-toml/tomltree_write.go new file mode 100644 index 0000000000..ae6dac49d1 --- /dev/null +++ b/test/vendor/github.com/pelletier/go-toml/tomltree_write.go @@ -0,0 +1,517 @@ +package toml + +import ( + "bytes" + "fmt" + "io" + "math" + "math/big" + "reflect" + "sort" + "strconv" + "strings" + "time" +) + +type valueComplexity int + +const ( + valueSimple valueComplexity = iota + 1 + valueComplex +) + +type sortNode struct { + key string + complexity valueComplexity +} + +// Encodes a string to a TOML-compliant multi-line string value +// This function is a clone of the existing encodeTomlString function, except that whitespace characters +// are preserved. Quotation marks and backslashes are also not escaped. +func encodeMultilineTomlString(value string, commented string) string { + var b bytes.Buffer + adjacentQuoteCount := 0 + + b.WriteString(commented) + for i, rr := range value { + if rr != '"' { + adjacentQuoteCount = 0 + } else { + adjacentQuoteCount++ + } + switch rr { + case '\b': + b.WriteString(`\b`) + case '\t': + b.WriteString("\t") + case '\n': + b.WriteString("\n" + commented) + case '\f': + b.WriteString(`\f`) + case '\r': + b.WriteString("\r") + case '"': + if adjacentQuoteCount >= 3 || i == len(value)-1 { + adjacentQuoteCount = 0 + b.WriteString(`\"`) + } else { + b.WriteString(`"`) + } + case '\\': + b.WriteString(`\`) + default: + intRr := uint16(rr) + if intRr < 0x001F { + b.WriteString(fmt.Sprintf("\\u%0.4X", intRr)) + } else { + b.WriteRune(rr) + } + } + } + return b.String() +} + +// Encodes a string to a TOML-compliant string value +func encodeTomlString(value string) string { + var b bytes.Buffer + + for _, rr := range value { + switch rr { + case '\b': + b.WriteString(`\b`) + case '\t': + b.WriteString(`\t`) + case '\n': + b.WriteString(`\n`) + case '\f': + b.WriteString(`\f`) + case '\r': + b.WriteString(`\r`) + case '"': + b.WriteString(`\"`) + case '\\': + b.WriteString(`\\`) + default: + intRr := uint16(rr) + if intRr < 0x001F { + b.WriteString(fmt.Sprintf("\\u%0.4X", intRr)) + } else { + b.WriteRune(rr) + } + } + } + return b.String() +} + +func tomlTreeStringRepresentation(t *Tree, ord marshalOrder) (string, error) { + var orderedVals []sortNode + switch ord { + case OrderPreserve: + orderedVals = sortByLines(t) + default: + orderedVals = sortAlphabetical(t) + } + + var values []string + for _, node := range orderedVals { + k := node.key + v := t.values[k] + + repr, err := tomlValueStringRepresentation(v, "", "", ord, false) + if err != nil { + return "", err + } + values = append(values, quoteKeyIfNeeded(k)+" = "+repr) + } + return "{ " + strings.Join(values, ", ") + " }", nil +} + +func tomlValueStringRepresentation(v interface{}, commented string, indent string, ord marshalOrder, arraysOneElementPerLine bool) (string, error) { + // this interface check is added to dereference the change made in the writeTo function. + // That change was made to allow this function to see formatting options. + tv, ok := v.(*tomlValue) + if ok { + v = tv.value + } else { + tv = &tomlValue{} + } + + switch value := v.(type) { + case uint64: + return strconv.FormatUint(value, 10), nil + case int64: + return strconv.FormatInt(value, 10), nil + case float64: + // Default bit length is full 64 + bits := 64 + // Float panics if nan is used + if !math.IsNaN(value) { + // if 32 bit accuracy is enough to exactly show, use 32 + _, acc := big.NewFloat(value).Float32() + if acc == big.Exact { + bits = 32 + } + } + if math.Trunc(value) == value { + return strings.ToLower(strconv.FormatFloat(value, 'f', 1, bits)), nil + } + return strings.ToLower(strconv.FormatFloat(value, 'f', -1, bits)), nil + case string: + if tv.multiline { + return "\"\"\"\n" + encodeMultilineTomlString(value, commented) + "\"\"\"", nil + } + return "\"" + encodeTomlString(value) + "\"", nil + case []byte: + b, _ := v.([]byte) + return string(b), nil + case bool: + if value { + return "true", nil + } + return "false", nil + case time.Time: + return value.Format(time.RFC3339), nil + case LocalDate: + return value.String(), nil + case LocalDateTime: + return value.String(), nil + case LocalTime: + return value.String(), nil + case *Tree: + return tomlTreeStringRepresentation(value, ord) + case nil: + return "", nil + } + + rv := reflect.ValueOf(v) + + if rv.Kind() == reflect.Slice { + var values []string + for i := 0; i < rv.Len(); i++ { + item := rv.Index(i).Interface() + itemRepr, err := tomlValueStringRepresentation(item, commented, indent, ord, arraysOneElementPerLine) + if err != nil { + return "", err + } + values = append(values, itemRepr) + } + if arraysOneElementPerLine && len(values) > 1 { + stringBuffer := bytes.Buffer{} + valueIndent := indent + ` ` // TODO: move that to a shared encoder state + + stringBuffer.WriteString("[\n") + + for _, value := range values { + stringBuffer.WriteString(valueIndent) + stringBuffer.WriteString(commented + value) + stringBuffer.WriteString(`,`) + stringBuffer.WriteString("\n") + } + + stringBuffer.WriteString(indent + commented + "]") + + return stringBuffer.String(), nil + } + return "[" + strings.Join(values, ", ") + "]", nil + } + return "", fmt.Errorf("unsupported value type %T: %v", v, v) +} + +func getTreeArrayLine(trees []*Tree) (line int) { + // get lowest line number that is not 0 + for _, tv := range trees { + if tv.position.Line < line || line == 0 { + line = tv.position.Line + } + } + return +} + +func sortByLines(t *Tree) (vals []sortNode) { + var ( + line int + lines []int + tv *Tree + tom *tomlValue + node sortNode + ) + vals = make([]sortNode, 0) + m := make(map[int]sortNode) + + for k := range t.values { + v := t.values[k] + switch v.(type) { + case *Tree: + tv = v.(*Tree) + line = tv.position.Line + node = sortNode{key: k, complexity: valueComplex} + case []*Tree: + line = getTreeArrayLine(v.([]*Tree)) + node = sortNode{key: k, complexity: valueComplex} + default: + tom = v.(*tomlValue) + line = tom.position.Line + node = sortNode{key: k, complexity: valueSimple} + } + lines = append(lines, line) + vals = append(vals, node) + m[line] = node + } + sort.Ints(lines) + + for i, line := range lines { + vals[i] = m[line] + } + + return vals +} + +func sortAlphabetical(t *Tree) (vals []sortNode) { + var ( + node sortNode + simpVals []string + compVals []string + ) + vals = make([]sortNode, 0) + m := make(map[string]sortNode) + + for k := range t.values { + v := t.values[k] + switch v.(type) { + case *Tree, []*Tree: + node = sortNode{key: k, complexity: valueComplex} + compVals = append(compVals, node.key) + default: + node = sortNode{key: k, complexity: valueSimple} + simpVals = append(simpVals, node.key) + } + vals = append(vals, node) + m[node.key] = node + } + + // Simples first to match previous implementation + sort.Strings(simpVals) + i := 0 + for _, key := range simpVals { + vals[i] = m[key] + i++ + } + + sort.Strings(compVals) + for _, key := range compVals { + vals[i] = m[key] + i++ + } + + return vals +} + +func (t *Tree) writeTo(w io.Writer, indent, keyspace string, bytesCount int64, arraysOneElementPerLine bool) (int64, error) { + return t.writeToOrdered(w, indent, keyspace, bytesCount, arraysOneElementPerLine, OrderAlphabetical, " ", false) +} + +func (t *Tree) writeToOrdered(w io.Writer, indent, keyspace string, bytesCount int64, arraysOneElementPerLine bool, ord marshalOrder, indentString string, parentCommented bool) (int64, error) { + var orderedVals []sortNode + + switch ord { + case OrderPreserve: + orderedVals = sortByLines(t) + default: + orderedVals = sortAlphabetical(t) + } + + for _, node := range orderedVals { + switch node.complexity { + case valueComplex: + k := node.key + v := t.values[k] + + combinedKey := quoteKeyIfNeeded(k) + if keyspace != "" { + combinedKey = keyspace + "." + combinedKey + } + + switch node := v.(type) { + // node has to be of those two types given how keys are sorted above + case *Tree: + tv, ok := t.values[k].(*Tree) + if !ok { + return bytesCount, fmt.Errorf("invalid value type at %s: %T", k, t.values[k]) + } + if tv.comment != "" { + comment := strings.Replace(tv.comment, "\n", "\n"+indent+"#", -1) + start := "# " + if strings.HasPrefix(comment, "#") { + start = "" + } + writtenBytesCountComment, errc := writeStrings(w, "\n", indent, start, comment) + bytesCount += int64(writtenBytesCountComment) + if errc != nil { + return bytesCount, errc + } + } + + var commented string + if parentCommented || t.commented || tv.commented { + commented = "# " + } + writtenBytesCount, err := writeStrings(w, "\n", indent, commented, "[", combinedKey, "]\n") + bytesCount += int64(writtenBytesCount) + if err != nil { + return bytesCount, err + } + bytesCount, err = node.writeToOrdered(w, indent+indentString, combinedKey, bytesCount, arraysOneElementPerLine, ord, indentString, parentCommented || t.commented || tv.commented) + if err != nil { + return bytesCount, err + } + case []*Tree: + for _, subTree := range node { + var commented string + if parentCommented || t.commented || subTree.commented { + commented = "# " + } + writtenBytesCount, err := writeStrings(w, "\n", indent, commented, "[[", combinedKey, "]]\n") + bytesCount += int64(writtenBytesCount) + if err != nil { + return bytesCount, err + } + + bytesCount, err = subTree.writeToOrdered(w, indent+indentString, combinedKey, bytesCount, arraysOneElementPerLine, ord, indentString, parentCommented || t.commented || subTree.commented) + if err != nil { + return bytesCount, err + } + } + } + default: // Simple + k := node.key + v, ok := t.values[k].(*tomlValue) + if !ok { + return bytesCount, fmt.Errorf("invalid value type at %s: %T", k, t.values[k]) + } + + var commented string + if parentCommented || t.commented || v.commented { + commented = "# " + } + repr, err := tomlValueStringRepresentation(v, commented, indent, ord, arraysOneElementPerLine) + if err != nil { + return bytesCount, err + } + + if v.comment != "" { + comment := strings.Replace(v.comment, "\n", "\n"+indent+"#", -1) + start := "# " + if strings.HasPrefix(comment, "#") { + start = "" + } + writtenBytesCountComment, errc := writeStrings(w, "\n", indent, start, comment, "\n") + bytesCount += int64(writtenBytesCountComment) + if errc != nil { + return bytesCount, errc + } + } + + quotedKey := quoteKeyIfNeeded(k) + writtenBytesCount, err := writeStrings(w, indent, commented, quotedKey, " = ", repr, "\n") + bytesCount += int64(writtenBytesCount) + if err != nil { + return bytesCount, err + } + } + } + + return bytesCount, nil +} + +// quote a key if it does not fit the bare key format (A-Za-z0-9_-) +// quoted keys use the same rules as strings +func quoteKeyIfNeeded(k string) string { + // when encoding a map with the 'quoteMapKeys' option enabled, the tree will contain + // keys that have already been quoted. + // not an ideal situation, but good enough of a stop gap. + if len(k) >= 2 && k[0] == '"' && k[len(k)-1] == '"' { + return k + } + isBare := true + for _, r := range k { + if !isValidBareChar(r) { + isBare = false + break + } + } + if isBare { + return k + } + return quoteKey(k) +} + +func quoteKey(k string) string { + return "\"" + encodeTomlString(k) + "\"" +} + +func writeStrings(w io.Writer, s ...string) (int, error) { + var n int + for i := range s { + b, err := io.WriteString(w, s[i]) + n += b + if err != nil { + return n, err + } + } + return n, nil +} + +// WriteTo encode the Tree as Toml and writes it to the writer w. +// Returns the number of bytes written in case of success, or an error if anything happened. +func (t *Tree) WriteTo(w io.Writer) (int64, error) { + return t.writeTo(w, "", "", 0, false) +} + +// ToTomlString generates a human-readable representation of the current tree. +// Output spans multiple lines, and is suitable for ingest by a TOML parser. +// If the conversion cannot be performed, ToString returns a non-nil error. +func (t *Tree) ToTomlString() (string, error) { + b, err := t.Marshal() + if err != nil { + return "", err + } + return string(b), nil +} + +// String generates a human-readable representation of the current tree. +// Alias of ToString. Present to implement the fmt.Stringer interface. +func (t *Tree) String() string { + result, _ := t.ToTomlString() + return result +} + +// ToMap recursively generates a representation of the tree using Go built-in structures. +// The following types are used: +// +// * bool +// * float64 +// * int64 +// * string +// * uint64 +// * time.Time +// * map[string]interface{} (where interface{} is any of this list) +// * []interface{} (where interface{} is any of this list) +func (t *Tree) ToMap() map[string]interface{} { + result := map[string]interface{}{} + + for k, v := range t.values { + switch node := v.(type) { + case []*Tree: + var array []interface{} + for _, item := range node { + array = append(array, item.ToMap()) + } + result[k] = array + case *Tree: + result[k] = node.ToMap() + case *tomlValue: + result[k] = node.value + } + } + return result +} diff --git a/test/vendor/golang.org/x/net/context/context.go b/test/vendor/golang.org/x/net/context/context.go new file mode 100644 index 0000000000..a3c021d3f8 --- /dev/null +++ b/test/vendor/golang.org/x/net/context/context.go @@ -0,0 +1,56 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package context defines the Context type, which carries deadlines, +// cancelation signals, and other request-scoped values across API boundaries +// and between processes. +// As of Go 1.7 this package is available in the standard library under the +// name context. https://golang.org/pkg/context. +// +// Incoming requests to a server should create a Context, and outgoing calls to +// servers should accept a Context. The chain of function calls between must +// propagate the Context, optionally replacing it with a modified copy created +// using WithDeadline, WithTimeout, WithCancel, or WithValue. +// +// Programs that use Contexts should follow these rules to keep interfaces +// consistent across packages and enable static analysis tools to check context +// propagation: +// +// Do not store Contexts inside a struct type; instead, pass a Context +// explicitly to each function that needs it. The Context should be the first +// parameter, typically named ctx: +// +// func DoSomething(ctx context.Context, arg Arg) error { +// // ... use ctx ... +// } +// +// Do not pass a nil Context, even if a function permits it. Pass context.TODO +// if you are unsure about which Context to use. +// +// Use context Values only for request-scoped data that transits processes and +// APIs, not for passing optional parameters to functions. +// +// The same Context may be passed to functions running in different goroutines; +// Contexts are safe for simultaneous use by multiple goroutines. +// +// See http://blog.golang.org/context for example code for a server that uses +// Contexts. +package context // import "golang.org/x/net/context" + +// Background returns a non-nil, empty Context. It is never canceled, has no +// values, and has no deadline. It is typically used by the main function, +// initialization, and tests, and as the top-level Context for incoming +// requests. +func Background() Context { + return background +} + +// TODO returns a non-nil, empty Context. Code should use context.TODO when +// it's unclear which Context to use or it is not yet available (because the +// surrounding function has not yet been extended to accept a Context +// parameter). TODO is recognized by static analysis tools that determine +// whether Contexts are propagated correctly in a program. +func TODO() Context { + return todo +} diff --git a/test/vendor/golang.org/x/net/context/go17.go b/test/vendor/golang.org/x/net/context/go17.go new file mode 100644 index 0000000000..344bd14334 --- /dev/null +++ b/test/vendor/golang.org/x/net/context/go17.go @@ -0,0 +1,73 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build go1.7 +// +build go1.7 + +package context + +import ( + "context" // standard library's context, as of Go 1.7 + "time" +) + +var ( + todo = context.TODO() + background = context.Background() +) + +// Canceled is the error returned by Context.Err when the context is canceled. +var Canceled = context.Canceled + +// DeadlineExceeded is the error returned by Context.Err when the context's +// deadline passes. +var DeadlineExceeded = context.DeadlineExceeded + +// WithCancel returns a copy of parent with a new Done channel. The returned +// context's Done channel is closed when the returned cancel function is called +// or when the parent context's Done channel is closed, whichever happens first. +// +// Canceling this context releases resources associated with it, so code should +// call cancel as soon as the operations running in this Context complete. +func WithCancel(parent Context) (ctx Context, cancel CancelFunc) { + ctx, f := context.WithCancel(parent) + return ctx, CancelFunc(f) +} + +// WithDeadline returns a copy of the parent context with the deadline adjusted +// to be no later than d. If the parent's deadline is already earlier than d, +// WithDeadline(parent, d) is semantically equivalent to parent. The returned +// context's Done channel is closed when the deadline expires, when the returned +// cancel function is called, or when the parent context's Done channel is +// closed, whichever happens first. +// +// Canceling this context releases resources associated with it, so code should +// call cancel as soon as the operations running in this Context complete. +func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) { + ctx, f := context.WithDeadline(parent, deadline) + return ctx, CancelFunc(f) +} + +// WithTimeout returns WithDeadline(parent, time.Now().Add(timeout)). +// +// Canceling this context releases resources associated with it, so code should +// call cancel as soon as the operations running in this Context complete: +// +// func slowOperationWithTimeout(ctx context.Context) (Result, error) { +// ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond) +// defer cancel() // releases resources if slowOperation completes before timeout elapses +// return slowOperation(ctx) +// } +func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) { + return WithDeadline(parent, time.Now().Add(timeout)) +} + +// WithValue returns a copy of parent in which the value associated with key is +// val. +// +// Use context Values only for request-scoped data that transits processes and +// APIs, not for passing optional parameters to functions. +func WithValue(parent Context, key interface{}, val interface{}) Context { + return context.WithValue(parent, key, val) +} diff --git a/test/vendor/golang.org/x/net/context/go19.go b/test/vendor/golang.org/x/net/context/go19.go new file mode 100644 index 0000000000..64d31ecc3e --- /dev/null +++ b/test/vendor/golang.org/x/net/context/go19.go @@ -0,0 +1,21 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build go1.9 +// +build go1.9 + +package context + +import "context" // standard library's context, as of Go 1.7 + +// A Context carries a deadline, a cancelation signal, and other values across +// API boundaries. +// +// Context's methods may be called by multiple goroutines simultaneously. +type Context = context.Context + +// A CancelFunc tells an operation to abandon its work. +// A CancelFunc does not wait for the work to stop. +// After the first call, subsequent calls to a CancelFunc do nothing. +type CancelFunc = context.CancelFunc diff --git a/test/vendor/golang.org/x/net/context/pre_go17.go b/test/vendor/golang.org/x/net/context/pre_go17.go new file mode 100644 index 0000000000..5270db5db7 --- /dev/null +++ b/test/vendor/golang.org/x/net/context/pre_go17.go @@ -0,0 +1,301 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build !go1.7 +// +build !go1.7 + +package context + +import ( + "errors" + "fmt" + "sync" + "time" +) + +// An emptyCtx is never canceled, has no values, and has no deadline. It is not +// struct{}, since vars of this type must have distinct addresses. +type emptyCtx int + +func (*emptyCtx) Deadline() (deadline time.Time, ok bool) { + return +} + +func (*emptyCtx) Done() <-chan struct{} { + return nil +} + +func (*emptyCtx) Err() error { + return nil +} + +func (*emptyCtx) Value(key interface{}) interface{} { + return nil +} + +func (e *emptyCtx) String() string { + switch e { + case background: + return "context.Background" + case todo: + return "context.TODO" + } + return "unknown empty Context" +} + +var ( + background = new(emptyCtx) + todo = new(emptyCtx) +) + +// Canceled is the error returned by Context.Err when the context is canceled. +var Canceled = errors.New("context canceled") + +// DeadlineExceeded is the error returned by Context.Err when the context's +// deadline passes. +var DeadlineExceeded = errors.New("context deadline exceeded") + +// WithCancel returns a copy of parent with a new Done channel. The returned +// context's Done channel is closed when the returned cancel function is called +// or when the parent context's Done channel is closed, whichever happens first. +// +// Canceling this context releases resources associated with it, so code should +// call cancel as soon as the operations running in this Context complete. +func WithCancel(parent Context) (ctx Context, cancel CancelFunc) { + c := newCancelCtx(parent) + propagateCancel(parent, c) + return c, func() { c.cancel(true, Canceled) } +} + +// newCancelCtx returns an initialized cancelCtx. +func newCancelCtx(parent Context) *cancelCtx { + return &cancelCtx{ + Context: parent, + done: make(chan struct{}), + } +} + +// propagateCancel arranges for child to be canceled when parent is. +func propagateCancel(parent Context, child canceler) { + if parent.Done() == nil { + return // parent is never canceled + } + if p, ok := parentCancelCtx(parent); ok { + p.mu.Lock() + if p.err != nil { + // parent has already been canceled + child.cancel(false, p.err) + } else { + if p.children == nil { + p.children = make(map[canceler]bool) + } + p.children[child] = true + } + p.mu.Unlock() + } else { + go func() { + select { + case <-parent.Done(): + child.cancel(false, parent.Err()) + case <-child.Done(): + } + }() + } +} + +// parentCancelCtx follows a chain of parent references until it finds a +// *cancelCtx. This function understands how each of the concrete types in this +// package represents its parent. +func parentCancelCtx(parent Context) (*cancelCtx, bool) { + for { + switch c := parent.(type) { + case *cancelCtx: + return c, true + case *timerCtx: + return c.cancelCtx, true + case *valueCtx: + parent = c.Context + default: + return nil, false + } + } +} + +// removeChild removes a context from its parent. +func removeChild(parent Context, child canceler) { + p, ok := parentCancelCtx(parent) + if !ok { + return + } + p.mu.Lock() + if p.children != nil { + delete(p.children, child) + } + p.mu.Unlock() +} + +// A canceler is a context type that can be canceled directly. The +// implementations are *cancelCtx and *timerCtx. +type canceler interface { + cancel(removeFromParent bool, err error) + Done() <-chan struct{} +} + +// A cancelCtx can be canceled. When canceled, it also cancels any children +// that implement canceler. +type cancelCtx struct { + Context + + done chan struct{} // closed by the first cancel call. + + mu sync.Mutex + children map[canceler]bool // set to nil by the first cancel call + err error // set to non-nil by the first cancel call +} + +func (c *cancelCtx) Done() <-chan struct{} { + return c.done +} + +func (c *cancelCtx) Err() error { + c.mu.Lock() + defer c.mu.Unlock() + return c.err +} + +func (c *cancelCtx) String() string { + return fmt.Sprintf("%v.WithCancel", c.Context) +} + +// cancel closes c.done, cancels each of c's children, and, if +// removeFromParent is true, removes c from its parent's children. +func (c *cancelCtx) cancel(removeFromParent bool, err error) { + if err == nil { + panic("context: internal error: missing cancel error") + } + c.mu.Lock() + if c.err != nil { + c.mu.Unlock() + return // already canceled + } + c.err = err + close(c.done) + for child := range c.children { + // NOTE: acquiring the child's lock while holding parent's lock. + child.cancel(false, err) + } + c.children = nil + c.mu.Unlock() + + if removeFromParent { + removeChild(c.Context, c) + } +} + +// WithDeadline returns a copy of the parent context with the deadline adjusted +// to be no later than d. If the parent's deadline is already earlier than d, +// WithDeadline(parent, d) is semantically equivalent to parent. The returned +// context's Done channel is closed when the deadline expires, when the returned +// cancel function is called, or when the parent context's Done channel is +// closed, whichever happens first. +// +// Canceling this context releases resources associated with it, so code should +// call cancel as soon as the operations running in this Context complete. +func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) { + if cur, ok := parent.Deadline(); ok && cur.Before(deadline) { + // The current deadline is already sooner than the new one. + return WithCancel(parent) + } + c := &timerCtx{ + cancelCtx: newCancelCtx(parent), + deadline: deadline, + } + propagateCancel(parent, c) + d := deadline.Sub(time.Now()) + if d <= 0 { + c.cancel(true, DeadlineExceeded) // deadline has already passed + return c, func() { c.cancel(true, Canceled) } + } + c.mu.Lock() + defer c.mu.Unlock() + if c.err == nil { + c.timer = time.AfterFunc(d, func() { + c.cancel(true, DeadlineExceeded) + }) + } + return c, func() { c.cancel(true, Canceled) } +} + +// A timerCtx carries a timer and a deadline. It embeds a cancelCtx to +// implement Done and Err. It implements cancel by stopping its timer then +// delegating to cancelCtx.cancel. +type timerCtx struct { + *cancelCtx + timer *time.Timer // Under cancelCtx.mu. + + deadline time.Time +} + +func (c *timerCtx) Deadline() (deadline time.Time, ok bool) { + return c.deadline, true +} + +func (c *timerCtx) String() string { + return fmt.Sprintf("%v.WithDeadline(%s [%s])", c.cancelCtx.Context, c.deadline, c.deadline.Sub(time.Now())) +} + +func (c *timerCtx) cancel(removeFromParent bool, err error) { + c.cancelCtx.cancel(false, err) + if removeFromParent { + // Remove this timerCtx from its parent cancelCtx's children. + removeChild(c.cancelCtx.Context, c) + } + c.mu.Lock() + if c.timer != nil { + c.timer.Stop() + c.timer = nil + } + c.mu.Unlock() +} + +// WithTimeout returns WithDeadline(parent, time.Now().Add(timeout)). +// +// Canceling this context releases resources associated with it, so code should +// call cancel as soon as the operations running in this Context complete: +// +// func slowOperationWithTimeout(ctx context.Context) (Result, error) { +// ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond) +// defer cancel() // releases resources if slowOperation completes before timeout elapses +// return slowOperation(ctx) +// } +func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) { + return WithDeadline(parent, time.Now().Add(timeout)) +} + +// WithValue returns a copy of parent in which the value associated with key is +// val. +// +// Use context Values only for request-scoped data that transits processes and +// APIs, not for passing optional parameters to functions. +func WithValue(parent Context, key interface{}, val interface{}) Context { + return &valueCtx{parent, key, val} +} + +// A valueCtx carries a key-value pair. It implements Value for that key and +// delegates all other calls to the embedded Context. +type valueCtx struct { + Context + key, val interface{} +} + +func (c *valueCtx) String() string { + return fmt.Sprintf("%v.WithValue(%#v, %#v)", c.Context, c.key, c.val) +} + +func (c *valueCtx) Value(key interface{}) interface{} { + if c.key == key { + return c.val + } + return c.Context.Value(key) +} diff --git a/test/vendor/golang.org/x/net/context/pre_go19.go b/test/vendor/golang.org/x/net/context/pre_go19.go new file mode 100644 index 0000000000..1f9715341f --- /dev/null +++ b/test/vendor/golang.org/x/net/context/pre_go19.go @@ -0,0 +1,110 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build !go1.9 +// +build !go1.9 + +package context + +import "time" + +// A Context carries a deadline, a cancelation signal, and other values across +// API boundaries. +// +// Context's methods may be called by multiple goroutines simultaneously. +type Context interface { + // Deadline returns the time when work done on behalf of this context + // should be canceled. Deadline returns ok==false when no deadline is + // set. Successive calls to Deadline return the same results. + Deadline() (deadline time.Time, ok bool) + + // Done returns a channel that's closed when work done on behalf of this + // context should be canceled. Done may return nil if this context can + // never be canceled. Successive calls to Done return the same value. + // + // WithCancel arranges for Done to be closed when cancel is called; + // WithDeadline arranges for Done to be closed when the deadline + // expires; WithTimeout arranges for Done to be closed when the timeout + // elapses. + // + // Done is provided for use in select statements: + // + // // Stream generates values with DoSomething and sends them to out + // // until DoSomething returns an error or ctx.Done is closed. + // func Stream(ctx context.Context, out chan<- Value) error { + // for { + // v, err := DoSomething(ctx) + // if err != nil { + // return err + // } + // select { + // case <-ctx.Done(): + // return ctx.Err() + // case out <- v: + // } + // } + // } + // + // See http://blog.golang.org/pipelines for more examples of how to use + // a Done channel for cancelation. + Done() <-chan struct{} + + // Err returns a non-nil error value after Done is closed. Err returns + // Canceled if the context was canceled or DeadlineExceeded if the + // context's deadline passed. No other values for Err are defined. + // After Done is closed, successive calls to Err return the same value. + Err() error + + // Value returns the value associated with this context for key, or nil + // if no value is associated with key. Successive calls to Value with + // the same key returns the same result. + // + // Use context values only for request-scoped data that transits + // processes and API boundaries, not for passing optional parameters to + // functions. + // + // A key identifies a specific value in a Context. Functions that wish + // to store values in Context typically allocate a key in a global + // variable then use that key as the argument to context.WithValue and + // Context.Value. A key can be any type that supports equality; + // packages should define keys as an unexported type to avoid + // collisions. + // + // Packages that define a Context key should provide type-safe accessors + // for the values stores using that key: + // + // // Package user defines a User type that's stored in Contexts. + // package user + // + // import "golang.org/x/net/context" + // + // // User is the type of value stored in the Contexts. + // type User struct {...} + // + // // key is an unexported type for keys defined in this package. + // // This prevents collisions with keys defined in other packages. + // type key int + // + // // userKey is the key for user.User values in Contexts. It is + // // unexported; clients use user.NewContext and user.FromContext + // // instead of using this key directly. + // var userKey key = 0 + // + // // NewContext returns a new Context that carries value u. + // func NewContext(ctx context.Context, u *User) context.Context { + // return context.WithValue(ctx, userKey, u) + // } + // + // // FromContext returns the User value stored in ctx, if any. + // func FromContext(ctx context.Context) (*User, bool) { + // u, ok := ctx.Value(userKey).(*User) + // return u, ok + // } + Value(key interface{}) interface{} +} + +// A CancelFunc tells an operation to abandon its work. +// A CancelFunc does not wait for the work to stop. +// After the first call, subsequent calls to a CancelFunc do nothing. +type CancelFunc func() diff --git a/test/vendor/golang.org/x/net/http2/client_conn_pool.go b/test/vendor/golang.org/x/net/http2/client_conn_pool.go index 652bc11a02..c936843eaf 100644 --- a/test/vendor/golang.org/x/net/http2/client_conn_pool.go +++ b/test/vendor/golang.org/x/net/http2/client_conn_pool.go @@ -16,6 +16,12 @@ import ( // ClientConnPool manages a pool of HTTP/2 client connections. type ClientConnPool interface { + // GetClientConn returns a specific HTTP/2 connection (usually + // a TLS-TCP connection) to an HTTP/2 server. On success, the + // returned ClientConn accounts for the upcoming RoundTrip + // call, so the caller should not omit it. If the caller needs + // to, ClientConn.RoundTrip can be called with a bogus + // new(http.Request) to release the stream reservation. GetClientConn(req *http.Request, addr string) (*ClientConn, error) MarkDead(*ClientConn) } @@ -42,7 +48,7 @@ type clientConnPool struct { conns map[string][]*ClientConn // key is host:port dialing map[string]*dialCall // currently in-flight dials keys map[*ClientConn][]string - addConnCalls map[string]*addConnCall // in-flight addConnIfNeede calls + addConnCalls map[string]*addConnCall // in-flight addConnIfNeeded calls } func (p *clientConnPool) GetClientConn(req *http.Request, addr string) (*ClientConn, error) { @@ -54,28 +60,8 @@ const ( noDialOnMiss = false ) -// shouldTraceGetConn reports whether getClientConn should call any -// ClientTrace.GetConn hook associated with the http.Request. -// -// This complexity is needed to avoid double calls of the GetConn hook -// during the back-and-forth between net/http and x/net/http2 (when the -// net/http.Transport is upgraded to also speak http2), as well as support -// the case where x/net/http2 is being used directly. -func (p *clientConnPool) shouldTraceGetConn(st clientConnIdleState) bool { - // If our Transport wasn't made via ConfigureTransport, always - // trace the GetConn hook if provided, because that means the - // http2 package is being used directly and it's the one - // dialing, as opposed to net/http. - if _, ok := p.t.ConnPool.(noDialClientConnPool); !ok { - return true - } - // Otherwise, only use the GetConn hook if this connection has - // been used previously for other requests. For fresh - // connections, the net/http package does the dialing. - return !st.freshConn -} - func (p *clientConnPool) getClientConn(req *http.Request, addr string, dialOnMiss bool) (*ClientConn, error) { + // TODO(dneil): Dial a new connection when t.DisableKeepAlives is set? if isConnectionCloseRequest(req) && dialOnMiss { // It gets its own connection. traceGetConn(req, addr) @@ -89,10 +75,14 @@ func (p *clientConnPool) getClientConn(req *http.Request, addr string, dialOnMis for { p.mu.Lock() for _, cc := range p.conns[addr] { - if st := cc.idleState(); st.canTakeNewRequest { - if p.shouldTraceGetConn(st) { + if cc.ReserveNewRequest() { + // When a connection is presented to us by the net/http package, + // the GetConn hook has already been called. + // Don't call it a second time here. + if !cc.getConnCalled { traceGetConn(req, addr) } + cc.getConnCalled = false p.mu.Unlock() return cc, nil } @@ -108,7 +98,13 @@ func (p *clientConnPool) getClientConn(req *http.Request, addr string, dialOnMis if shouldRetryDial(call, req) { continue } - return call.res, call.err + cc, err := call.res, call.err + if err != nil { + return nil, err + } + if cc.ReserveNewRequest() { + return cc, nil + } } } @@ -205,6 +201,7 @@ func (c *addConnCall) run(t *Transport, key string, tc *tls.Conn) { if err != nil { c.err = err } else { + cc.getConnCalled = true // already called by the net/http package p.addConnLocked(key, cc) } delete(p.addConnCalls, key) diff --git a/test/vendor/golang.org/x/net/http2/errors.go b/test/vendor/golang.org/x/net/http2/errors.go index 71f2c46317..2663e5d287 100644 --- a/test/vendor/golang.org/x/net/http2/errors.go +++ b/test/vendor/golang.org/x/net/http2/errors.go @@ -53,6 +53,13 @@ func (e ErrCode) String() string { return fmt.Sprintf("unknown error code 0x%x", uint32(e)) } +func (e ErrCode) stringToken() string { + if s, ok := errCodeName[e]; ok { + return s + } + return fmt.Sprintf("ERR_UNKNOWN_%d", uint32(e)) +} + // ConnectionError is an error that results in the termination of the // entire connection. type ConnectionError ErrCode @@ -67,6 +74,11 @@ type StreamError struct { Cause error // optional additional detail } +// errFromPeer is a sentinel error value for StreamError.Cause to +// indicate that the StreamError was sent from the peer over the wire +// and wasn't locally generated in the Transport. +var errFromPeer = errors.New("received from peer") + func streamError(id uint32, code ErrCode) StreamError { return StreamError{StreamID: id, Code: code} } diff --git a/test/vendor/golang.org/x/net/http2/frame.go b/test/vendor/golang.org/x/net/http2/frame.go index 514c126c5f..96a7479052 100644 --- a/test/vendor/golang.org/x/net/http2/frame.go +++ b/test/vendor/golang.org/x/net/http2/frame.go @@ -122,7 +122,7 @@ var flagName = map[FrameType]map[Flags]string{ // a frameParser parses a frame given its FrameHeader and payload // bytes. The length of payload will always equal fh.Length (which // might be 0). -type frameParser func(fc *frameCache, fh FrameHeader, payload []byte) (Frame, error) +type frameParser func(fc *frameCache, fh FrameHeader, countError func(string), payload []byte) (Frame, error) var frameParsers = map[FrameType]frameParser{ FrameData: parseDataFrame, @@ -267,6 +267,11 @@ type Framer struct { lastFrame Frame errDetail error + // countError is a non-nil func that's called on a frame parse + // error with some unique error path token. It's initialized + // from Transport.CountError or Server.CountError. + countError func(errToken string) + // lastHeaderStream is non-zero if the last frame was an // unfinished HEADERS/CONTINUATION. lastHeaderStream uint32 @@ -426,6 +431,7 @@ func NewFramer(w io.Writer, r io.Reader) *Framer { fr := &Framer{ w: w, r: r, + countError: func(string) {}, logReads: logFrameReads, logWrites: logFrameWrites, debugReadLoggerf: log.Printf, @@ -500,7 +506,7 @@ func (fr *Framer) ReadFrame() (Frame, error) { if _, err := io.ReadFull(fr.r, payload); err != nil { return nil, err } - f, err := typeFrameParser(fh.Type)(fr.frameCache, fh, payload) + f, err := typeFrameParser(fh.Type)(fr.frameCache, fh, fr.countError, payload) if err != nil { if ce, ok := err.(connError); ok { return nil, fr.connError(ce.Code, ce.Reason) @@ -588,13 +594,14 @@ func (f *DataFrame) Data() []byte { return f.data } -func parseDataFrame(fc *frameCache, fh FrameHeader, payload []byte) (Frame, error) { +func parseDataFrame(fc *frameCache, fh FrameHeader, countError func(string), payload []byte) (Frame, error) { if fh.StreamID == 0 { // DATA frames MUST be associated with a stream. If a // DATA frame is received whose stream identifier // field is 0x0, the recipient MUST respond with a // connection error (Section 5.4.1) of type // PROTOCOL_ERROR. + countError("frame_data_stream_0") return nil, connError{ErrCodeProtocol, "DATA frame with stream ID 0"} } f := fc.getDataFrame() @@ -605,6 +612,7 @@ func parseDataFrame(fc *frameCache, fh FrameHeader, payload []byte) (Frame, erro var err error payload, padSize, err = readByte(payload) if err != nil { + countError("frame_data_pad_byte_short") return nil, err } } @@ -613,6 +621,7 @@ func parseDataFrame(fc *frameCache, fh FrameHeader, payload []byte) (Frame, erro // length of the frame payload, the recipient MUST // treat this as a connection error. // Filed: https://github.com/http2/http2-spec/issues/610 + countError("frame_data_pad_too_big") return nil, connError{ErrCodeProtocol, "pad size larger than data payload"} } f.data = payload[:len(payload)-int(padSize)] @@ -695,7 +704,7 @@ type SettingsFrame struct { p []byte } -func parseSettingsFrame(_ *frameCache, fh FrameHeader, p []byte) (Frame, error) { +func parseSettingsFrame(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (Frame, error) { if fh.Flags.Has(FlagSettingsAck) && fh.Length > 0 { // When this (ACK 0x1) bit is set, the payload of the // SETTINGS frame MUST be empty. Receipt of a @@ -703,6 +712,7 @@ func parseSettingsFrame(_ *frameCache, fh FrameHeader, p []byte) (Frame, error) // field value other than 0 MUST be treated as a // connection error (Section 5.4.1) of type // FRAME_SIZE_ERROR. + countError("frame_settings_ack_with_length") return nil, ConnectionError(ErrCodeFrameSize) } if fh.StreamID != 0 { @@ -713,14 +723,17 @@ func parseSettingsFrame(_ *frameCache, fh FrameHeader, p []byte) (Frame, error) // field is anything other than 0x0, the endpoint MUST // respond with a connection error (Section 5.4.1) of // type PROTOCOL_ERROR. + countError("frame_settings_has_stream") return nil, ConnectionError(ErrCodeProtocol) } if len(p)%6 != 0 { + countError("frame_settings_mod_6") // Expecting even number of 6 byte settings. return nil, ConnectionError(ErrCodeFrameSize) } f := &SettingsFrame{FrameHeader: fh, p: p} if v, ok := f.Value(SettingInitialWindowSize); ok && v > (1<<31)-1 { + countError("frame_settings_window_size_too_big") // Values above the maximum flow control window size of 2^31 - 1 MUST // be treated as a connection error (Section 5.4.1) of type // FLOW_CONTROL_ERROR. @@ -832,11 +845,13 @@ type PingFrame struct { func (f *PingFrame) IsAck() bool { return f.Flags.Has(FlagPingAck) } -func parsePingFrame(_ *frameCache, fh FrameHeader, payload []byte) (Frame, error) { +func parsePingFrame(_ *frameCache, fh FrameHeader, countError func(string), payload []byte) (Frame, error) { if len(payload) != 8 { + countError("frame_ping_length") return nil, ConnectionError(ErrCodeFrameSize) } if fh.StreamID != 0 { + countError("frame_ping_has_stream") return nil, ConnectionError(ErrCodeProtocol) } f := &PingFrame{FrameHeader: fh} @@ -872,11 +887,13 @@ func (f *GoAwayFrame) DebugData() []byte { return f.debugData } -func parseGoAwayFrame(_ *frameCache, fh FrameHeader, p []byte) (Frame, error) { +func parseGoAwayFrame(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (Frame, error) { if fh.StreamID != 0 { + countError("frame_goaway_has_stream") return nil, ConnectionError(ErrCodeProtocol) } if len(p) < 8 { + countError("frame_goaway_short") return nil, ConnectionError(ErrCodeFrameSize) } return &GoAwayFrame{ @@ -912,7 +929,7 @@ func (f *UnknownFrame) Payload() []byte { return f.p } -func parseUnknownFrame(_ *frameCache, fh FrameHeader, p []byte) (Frame, error) { +func parseUnknownFrame(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (Frame, error) { return &UnknownFrame{fh, p}, nil } @@ -923,8 +940,9 @@ type WindowUpdateFrame struct { Increment uint32 // never read with high bit set } -func parseWindowUpdateFrame(_ *frameCache, fh FrameHeader, p []byte) (Frame, error) { +func parseWindowUpdateFrame(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (Frame, error) { if len(p) != 4 { + countError("frame_windowupdate_bad_len") return nil, ConnectionError(ErrCodeFrameSize) } inc := binary.BigEndian.Uint32(p[:4]) & 0x7fffffff // mask off high reserved bit @@ -936,8 +954,10 @@ func parseWindowUpdateFrame(_ *frameCache, fh FrameHeader, p []byte) (Frame, err // control window MUST be treated as a connection // error (Section 5.4.1). if fh.StreamID == 0 { + countError("frame_windowupdate_zero_inc_conn") return nil, ConnectionError(ErrCodeProtocol) } + countError("frame_windowupdate_zero_inc_stream") return nil, streamError(fh.StreamID, ErrCodeProtocol) } return &WindowUpdateFrame{ @@ -988,7 +1008,7 @@ func (f *HeadersFrame) HasPriority() bool { return f.FrameHeader.Flags.Has(FlagHeadersPriority) } -func parseHeadersFrame(_ *frameCache, fh FrameHeader, p []byte) (_ Frame, err error) { +func parseHeadersFrame(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (_ Frame, err error) { hf := &HeadersFrame{ FrameHeader: fh, } @@ -997,11 +1017,13 @@ func parseHeadersFrame(_ *frameCache, fh FrameHeader, p []byte) (_ Frame, err er // is received whose stream identifier field is 0x0, the recipient MUST // respond with a connection error (Section 5.4.1) of type // PROTOCOL_ERROR. + countError("frame_headers_zero_stream") return nil, connError{ErrCodeProtocol, "HEADERS frame with stream ID 0"} } var padLength uint8 if fh.Flags.Has(FlagHeadersPadded) { if p, padLength, err = readByte(p); err != nil { + countError("frame_headers_pad_short") return } } @@ -1009,16 +1031,19 @@ func parseHeadersFrame(_ *frameCache, fh FrameHeader, p []byte) (_ Frame, err er var v uint32 p, v, err = readUint32(p) if err != nil { + countError("frame_headers_prio_short") return nil, err } hf.Priority.StreamDep = v & 0x7fffffff hf.Priority.Exclusive = (v != hf.Priority.StreamDep) // high bit was set p, hf.Priority.Weight, err = readByte(p) if err != nil { + countError("frame_headers_prio_weight_short") return nil, err } } - if len(p)-int(padLength) <= 0 { + if len(p)-int(padLength) < 0 { + countError("frame_headers_pad_too_big") return nil, streamError(fh.StreamID, ErrCodeProtocol) } hf.headerFragBuf = p[:len(p)-int(padLength)] @@ -1125,11 +1150,13 @@ func (p PriorityParam) IsZero() bool { return p == PriorityParam{} } -func parsePriorityFrame(_ *frameCache, fh FrameHeader, payload []byte) (Frame, error) { +func parsePriorityFrame(_ *frameCache, fh FrameHeader, countError func(string), payload []byte) (Frame, error) { if fh.StreamID == 0 { + countError("frame_priority_zero_stream") return nil, connError{ErrCodeProtocol, "PRIORITY frame with stream ID 0"} } if len(payload) != 5 { + countError("frame_priority_bad_length") return nil, connError{ErrCodeFrameSize, fmt.Sprintf("PRIORITY frame payload size was %d; want 5", len(payload))} } v := binary.BigEndian.Uint32(payload[:4]) @@ -1172,11 +1199,13 @@ type RSTStreamFrame struct { ErrCode ErrCode } -func parseRSTStreamFrame(_ *frameCache, fh FrameHeader, p []byte) (Frame, error) { +func parseRSTStreamFrame(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (Frame, error) { if len(p) != 4 { + countError("frame_rststream_bad_len") return nil, ConnectionError(ErrCodeFrameSize) } if fh.StreamID == 0 { + countError("frame_rststream_zero_stream") return nil, ConnectionError(ErrCodeProtocol) } return &RSTStreamFrame{fh, ErrCode(binary.BigEndian.Uint32(p[:4]))}, nil @@ -1202,8 +1231,9 @@ type ContinuationFrame struct { headerFragBuf []byte } -func parseContinuationFrame(_ *frameCache, fh FrameHeader, p []byte) (Frame, error) { +func parseContinuationFrame(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (Frame, error) { if fh.StreamID == 0 { + countError("frame_continuation_zero_stream") return nil, connError{ErrCodeProtocol, "CONTINUATION frame with stream ID 0"} } return &ContinuationFrame{fh, p}, nil @@ -1252,7 +1282,7 @@ func (f *PushPromiseFrame) HeadersEnded() bool { return f.FrameHeader.Flags.Has(FlagPushPromiseEndHeaders) } -func parsePushPromise(_ *frameCache, fh FrameHeader, p []byte) (_ Frame, err error) { +func parsePushPromise(_ *frameCache, fh FrameHeader, countError func(string), p []byte) (_ Frame, err error) { pp := &PushPromiseFrame{ FrameHeader: fh, } @@ -1263,6 +1293,7 @@ func parsePushPromise(_ *frameCache, fh FrameHeader, p []byte) (_ Frame, err err // with. If the stream identifier field specifies the value // 0x0, a recipient MUST respond with a connection error // (Section 5.4.1) of type PROTOCOL_ERROR. + countError("frame_pushpromise_zero_stream") return nil, ConnectionError(ErrCodeProtocol) } // The PUSH_PROMISE frame includes optional padding. @@ -1270,18 +1301,21 @@ func parsePushPromise(_ *frameCache, fh FrameHeader, p []byte) (_ Frame, err err var padLength uint8 if fh.Flags.Has(FlagPushPromisePadded) { if p, padLength, err = readByte(p); err != nil { + countError("frame_pushpromise_pad_short") return } } p, pp.PromiseID, err = readUint32(p) if err != nil { + countError("frame_pushpromise_promiseid_short") return } pp.PromiseID = pp.PromiseID & (1<<31 - 1) if int(padLength) > len(p) { // like the DATA frame, error out if padding is longer than the body. + countError("frame_pushpromise_pad_too_big") return nil, ConnectionError(ErrCodeProtocol) } pp.headerFragBuf = p[:len(p)-int(padLength)] diff --git a/test/vendor/golang.org/x/net/http2/hpack/huffman.go b/test/vendor/golang.org/x/net/http2/hpack/huffman.go index a1ab2f0567..fe0b84ccd4 100644 --- a/test/vendor/golang.org/x/net/http2/hpack/huffman.go +++ b/test/vendor/golang.org/x/net/http2/hpack/huffman.go @@ -140,25 +140,29 @@ func buildRootHuffmanNode() { panic("unexpected size") } lazyRootHuffmanNode = newInternalNode() - for i, code := range huffmanCodes { - addDecoderNode(byte(i), code, huffmanCodeLen[i]) - } -} + // allocate a leaf node for each of the 256 symbols + leaves := new([256]node) + + for sym, code := range huffmanCodes { + codeLen := huffmanCodeLen[sym] + + cur := lazyRootHuffmanNode + for codeLen > 8 { + codeLen -= 8 + i := uint8(code >> codeLen) + if cur.children[i] == nil { + cur.children[i] = newInternalNode() + } + cur = cur.children[i] + } + shift := 8 - codeLen + start, end := int(uint8(code< 8 { - codeLen -= 8 - i := uint8(code >> codeLen) - if cur.children[i] == nil { - cur.children[i] = newInternalNode() + leaves[sym].sym = byte(sym) + leaves[sym].codeLen = codeLen + for i := start; i < start+end; i++ { + cur.children[i] = &leaves[sym] } - cur = cur.children[i] - } - shift := 8 - codeLen - start, end := int(uint8(code< 0 { // Check whether the client has flow control quota. if st.inflow.available() < int32(f.Length) { - return streamError(id, ErrCodeFlowControl) + return sc.countError("flow_on_data_length", streamError(id, ErrCodeFlowControl)) } st.inflow.take(int32(f.Length)) @@ -1710,7 +1727,7 @@ func (sc *serverConn) processData(f *DataFrame) error { wrote, err := st.body.Write(data) if err != nil { sc.sendWindowUpdate(nil, int(f.Length)-wrote) - return streamError(id, ErrCodeStreamClosed) + return sc.countError("body_write_err", streamError(id, ErrCodeStreamClosed)) } if wrote != len(data) { panic("internal error: bad Writer") @@ -1796,7 +1813,7 @@ func (sc *serverConn) processHeaders(f *MetaHeadersFrame) error { // stream identifier MUST respond with a connection error // (Section 5.4.1) of type PROTOCOL_ERROR. if id%2 != 1 { - return ConnectionError(ErrCodeProtocol) + return sc.countError("headers_even", ConnectionError(ErrCodeProtocol)) } // A HEADERS frame can be used to create a new stream or // send a trailer for an open one. If we already have a stream @@ -1813,7 +1830,7 @@ func (sc *serverConn) processHeaders(f *MetaHeadersFrame) error { // this state, it MUST respond with a stream error (Section 5.4.2) of // type STREAM_CLOSED. if st.state == stateHalfClosedRemote { - return streamError(id, ErrCodeStreamClosed) + return sc.countError("headers_half_closed", streamError(id, ErrCodeStreamClosed)) } return st.processTrailerHeaders(f) } @@ -1824,7 +1841,7 @@ func (sc *serverConn) processHeaders(f *MetaHeadersFrame) error { // receives an unexpected stream identifier MUST respond with // a connection error (Section 5.4.1) of type PROTOCOL_ERROR. if id <= sc.maxClientStreamID { - return ConnectionError(ErrCodeProtocol) + return sc.countError("stream_went_down", ConnectionError(ErrCodeProtocol)) } sc.maxClientStreamID = id @@ -1841,14 +1858,14 @@ func (sc *serverConn) processHeaders(f *MetaHeadersFrame) error { if sc.curClientStreams+1 > sc.advMaxStreams { if sc.unackedSettings == 0 { // They should know better. - return streamError(id, ErrCodeProtocol) + return sc.countError("over_max_streams", streamError(id, ErrCodeProtocol)) } // Assume it's a network race, where they just haven't // received our last SETTINGS update. But actually // this can't happen yet, because we don't yet provide // a way for users to adjust server parameters at // runtime. - return streamError(id, ErrCodeRefusedStream) + return sc.countError("over_max_streams_race", streamError(id, ErrCodeRefusedStream)) } initialState := stateOpen @@ -1858,7 +1875,7 @@ func (sc *serverConn) processHeaders(f *MetaHeadersFrame) error { st := sc.newStream(id, 0, initialState) if f.HasPriority() { - if err := checkPriority(f.StreamID, f.Priority); err != nil { + if err := sc.checkPriority(f.StreamID, f.Priority); err != nil { return err } sc.writeSched.AdjustStream(st.id, f.Priority) @@ -1902,15 +1919,15 @@ func (st *stream) processTrailerHeaders(f *MetaHeadersFrame) error { sc := st.sc sc.serveG.check() if st.gotTrailerHeader { - return ConnectionError(ErrCodeProtocol) + return sc.countError("dup_trailers", ConnectionError(ErrCodeProtocol)) } st.gotTrailerHeader = true if !f.StreamEnded() { - return streamError(st.id, ErrCodeProtocol) + return sc.countError("trailers_not_ended", streamError(st.id, ErrCodeProtocol)) } if len(f.PseudoFields()) > 0 { - return streamError(st.id, ErrCodeProtocol) + return sc.countError("trailers_pseudo", streamError(st.id, ErrCodeProtocol)) } if st.trailer != nil { for _, hf := range f.RegularFields() { @@ -1919,7 +1936,7 @@ func (st *stream) processTrailerHeaders(f *MetaHeadersFrame) error { // TODO: send more details to the peer somehow. But http2 has // no way to send debug data at a stream level. Discuss with // HTTP folk. - return streamError(st.id, ErrCodeProtocol) + return sc.countError("trailers_bogus", streamError(st.id, ErrCodeProtocol)) } st.trailer[key] = append(st.trailer[key], hf.Value) } @@ -1928,13 +1945,13 @@ func (st *stream) processTrailerHeaders(f *MetaHeadersFrame) error { return nil } -func checkPriority(streamID uint32, p PriorityParam) error { +func (sc *serverConn) checkPriority(streamID uint32, p PriorityParam) error { if streamID == p.StreamDep { // Section 5.3.1: "A stream cannot depend on itself. An endpoint MUST treat // this as a stream error (Section 5.4.2) of type PROTOCOL_ERROR." // Section 5.3.3 says that a stream can depend on one of its dependencies, // so it's only self-dependencies that are forbidden. - return streamError(streamID, ErrCodeProtocol) + return sc.countError("priority", streamError(streamID, ErrCodeProtocol)) } return nil } @@ -1943,7 +1960,7 @@ func (sc *serverConn) processPriority(f *PriorityFrame) error { if sc.inGoAway { return nil } - if err := checkPriority(f.StreamID, f.PriorityParam); err != nil { + if err := sc.checkPriority(f.StreamID, f.PriorityParam); err != nil { return err } sc.writeSched.AdjustStream(f.StreamID, f.PriorityParam) @@ -2000,7 +2017,7 @@ func (sc *serverConn) newWriterAndRequest(st *stream, f *MetaHeadersFrame) (*res isConnect := rp.method == "CONNECT" if isConnect { if rp.path != "" || rp.scheme != "" || rp.authority == "" { - return nil, nil, streamError(f.StreamID, ErrCodeProtocol) + return nil, nil, sc.countError("bad_connect", streamError(f.StreamID, ErrCodeProtocol)) } } else if rp.method == "" || rp.path == "" || (rp.scheme != "https" && rp.scheme != "http") { // See 8.1.2.6 Malformed Requests and Responses: @@ -2013,13 +2030,13 @@ func (sc *serverConn) newWriterAndRequest(st *stream, f *MetaHeadersFrame) (*res // "All HTTP/2 requests MUST include exactly one valid // value for the :method, :scheme, and :path // pseudo-header fields" - return nil, nil, streamError(f.StreamID, ErrCodeProtocol) + return nil, nil, sc.countError("bad_path_method", streamError(f.StreamID, ErrCodeProtocol)) } bodyOpen := !f.StreamEnded() if rp.method == "HEAD" && bodyOpen { // HEAD requests can't have bodies - return nil, nil, streamError(f.StreamID, ErrCodeProtocol) + return nil, nil, sc.countError("head_body", streamError(f.StreamID, ErrCodeProtocol)) } rp.header = make(http.Header) @@ -2102,7 +2119,7 @@ func (sc *serverConn) newWriterAndRequestNoBody(st *stream, rp requestParam) (*r var err error url_, err = url.ParseRequestURI(rp.path) if err != nil { - return nil, nil, streamError(st.id, ErrCodeProtocol) + return nil, nil, sc.countError("bad_path", streamError(st.id, ErrCodeProtocol)) } requestURI = rp.path } @@ -2985,3 +3002,31 @@ func h1ServerKeepAlivesDisabled(hs *http.Server) bool { } return false } + +func (sc *serverConn) countError(name string, err error) error { + if sc == nil || sc.srv == nil { + return err + } + f := sc.srv.CountError + if f == nil { + return err + } + var typ string + var code ErrCode + switch e := err.(type) { + case ConnectionError: + typ = "conn" + code = ErrCode(e) + case StreamError: + typ = "stream" + code = ErrCode(e.Code) + default: + return err + } + codeStr := errCodeName[code] + if codeStr == "" { + codeStr = strconv.Itoa(int(code)) + } + f(fmt.Sprintf("%s_%s_%s", typ, codeStr, name)) + return err +} diff --git a/test/vendor/golang.org/x/net/http2/transport.go b/test/vendor/golang.org/x/net/http2/transport.go index b261beb1d0..f135b0f751 100644 --- a/test/vendor/golang.org/x/net/http2/transport.go +++ b/test/vendor/golang.org/x/net/http2/transport.go @@ -24,6 +24,7 @@ import ( "net/http" "net/http/httptrace" "net/textproto" + "os" "sort" "strconv" "strings" @@ -51,6 +52,15 @@ const ( transportDefaultStreamMinRefresh = 4 << 10 defaultUserAgent = "Go-http-client/2.0" + + // initialMaxConcurrentStreams is a connections maxConcurrentStreams until + // it's received servers initial SETTINGS frame, which corresponds with the + // spec's minimum recommended value. + initialMaxConcurrentStreams = 100 + + // defaultMaxConcurrentStreams is a connections default maxConcurrentStreams + // if the server doesn't include one in its initial SETTINGS frame. + defaultMaxConcurrentStreams = 1000 ) // Transport is an HTTP/2 Transport. @@ -121,6 +131,17 @@ type Transport struct { // Defaults to 15s. PingTimeout time.Duration + // WriteByteTimeout is the timeout after which the connection will be + // closed no data can be written to it. The timeout begins when data is + // available to write, and is extended whenever any bytes are written. + WriteByteTimeout time.Duration + + // CountError, if non-nil, is called on HTTP/2 transport errors. + // It's intended to increment a metric for monitoring, such + // as an expvar or Prometheus metric. + // The errType consists of only ASCII word characters. + CountError func(errType string) + // t1, if non-nil, is the standard library Transport using // this transport. Its settings are used (but not its // RoundTrip method, etc). @@ -227,11 +248,12 @@ func (t *Transport) initConnPool() { // ClientConn is the state of a single HTTP/2 client connection to an // HTTP/2 server. type ClientConn struct { - t *Transport - tconn net.Conn // usually *tls.Conn, except specialized impls - tlsState *tls.ConnectionState // nil only for specialized impls - reused uint32 // whether conn is being reused; atomic - singleUse bool // whether being used for a single http.Request + t *Transport + tconn net.Conn // usually *tls.Conn, except specialized impls + tlsState *tls.ConnectionState // nil only for specialized impls + reused uint32 // whether conn is being reused; atomic + singleUse bool // whether being used for a single http.Request + getConnCalled bool // used by clientConnPool // readLoop goroutine fields: readerDone chan struct{} // closed on error @@ -244,86 +266,94 @@ type ClientConn struct { cond *sync.Cond // hold mu; broadcast on flow/closed changes flow flow // our conn-level flow control quota (cs.flow is per stream) inflow flow // peer's conn-level flow control + doNotReuse bool // whether conn is marked to not be reused for any future requests closing bool closed bool + seenSettings bool // true if we've seen a settings frame, false otherwise wantSettingsAck bool // we sent a SETTINGS frame and haven't heard back goAway *GoAwayFrame // if non-nil, the GoAwayFrame we received goAwayDebug string // goAway frame's debug data, retained as a string streams map[uint32]*clientStream // client-initiated + streamsReserved int // incr by ReserveNewRequest; decr on RoundTrip nextStreamID uint32 pendingRequests int // requests blocked and waiting to be sent because len(streams) == maxConcurrentStreams pings map[[8]byte]chan struct{} // in flight ping data to notification channel - bw *bufio.Writer br *bufio.Reader - fr *Framer lastActive time.Time lastIdle time.Time // time last idle - // Settings from peer: (also guarded by mu) + // Settings from peer: (also guarded by wmu) maxFrameSize uint32 maxConcurrentStreams uint32 peerMaxHeaderListSize uint64 initialWindowSize uint32 + // reqHeaderMu is a 1-element semaphore channel controlling access to sending new requests. + // Write to reqHeaderMu to lock it, read from it to unlock. + // Lock reqmu BEFORE mu or wmu. + reqHeaderMu chan struct{} + + // wmu is held while writing. + // Acquire BEFORE mu when holding both, to avoid blocking mu on network writes. + // Only acquire both at the same time when changing peer settings. + wmu sync.Mutex + bw *bufio.Writer + fr *Framer + werr error // first write error that has occurred hbuf bytes.Buffer // HPACK encoder writes into this henc *hpack.Encoder - - wmu sync.Mutex // held while writing; acquire AFTER mu if holding both - werr error // first write error that has occurred } // clientStream is the state for a single HTTP/2 stream. One of these // is created for each Transport.RoundTrip call. type clientStream struct { - cc *ClientConn - req *http.Request + cc *ClientConn + + // Fields of Request that we may access even after the response body is closed. + ctx context.Context + reqCancel <-chan struct{} + trace *httptrace.ClientTrace // or nil ID uint32 - resc chan resAndError bufPipe pipe // buffered pipe with the flow-controlled response payload - startedWrite bool // started request body write; guarded by cc.mu requestedGzip bool - on100 func() // optional code to run if get a 100 continue response + isHead bool + + abortOnce sync.Once + abort chan struct{} // closed to signal stream should end immediately + abortErr error // set if abort is closed + + peerClosed chan struct{} // closed when the peer sends an END_STREAM flag + donec chan struct{} // closed after the stream is in the closed state + on100 chan struct{} // buffered; written to if a 100 is received + + respHeaderRecv chan struct{} // closed when headers are received + res *http.Response // set if respHeaderRecv is closed flow flow // guarded by cc.mu inflow flow // guarded by cc.mu bytesRemain int64 // -1 means unknown; owned by transportResponseBody.Read readErr error // sticky read error; owned by transportResponseBody.Read - stopReqBody error // if non-nil, stop writing req body; guarded by cc.mu - didReset bool // whether we sent a RST_STREAM to the server; guarded by cc.mu - peerReset chan struct{} // closed on peer reset - resetErr error // populated before peerReset is closed + reqBody io.ReadCloser + reqBodyContentLength int64 // -1 means unknown + reqBodyClosed bool // body has been closed; guarded by cc.mu - done chan struct{} // closed when stream remove from cc.streams map; close calls guarded by cc.mu + // owned by writeRequest: + sentEndStream bool // sent an END_STREAM flag to the peer + sentHeaders bool // owned by clientConnReadLoop: firstByte bool // got the first response byte pastHeaders bool // got first MetaHeadersFrame (actual headers) pastTrailers bool // got optional second MetaHeadersFrame (trailers) num1xx uint8 // number of 1xx responses seen + readClosed bool // peer sent an END_STREAM flag + readAborted bool // read loop reset the stream trailer http.Header // accumulated trailers resTrailer *http.Header // client's Response.Trailer } -// awaitRequestCancel waits for the user to cancel a request or for the done -// channel to be signaled. A non-nil error is returned only if the request was -// canceled. -func awaitRequestCancel(req *http.Request, done <-chan struct{}) error { - ctx := req.Context() - if req.Cancel == nil && ctx.Done() == nil { - return nil - } - select { - case <-req.Cancel: - return errRequestCanceled - case <-ctx.Done(): - return ctx.Err() - case <-done: - return nil - } -} - var got1xxFuncForTests func(int, textproto.MIMEHeader) error // get1xxTraceFunc returns the value of request's httptrace.ClientTrace.Got1xxResponse func, @@ -335,78 +365,65 @@ func (cs *clientStream) get1xxTraceFunc() func(int, textproto.MIMEHeader) error return traceGot1xxResponseFunc(cs.trace) } -// awaitRequestCancel waits for the user to cancel a request, its context to -// expire, or for the request to be done (any way it might be removed from the -// cc.streams map: peer reset, successful completion, TCP connection breakage, -// etc). If the request is canceled, then cs will be canceled and closed. -func (cs *clientStream) awaitRequestCancel(req *http.Request) { - if err := awaitRequestCancel(req, cs.done); err != nil { - cs.cancelStream() - cs.bufPipe.CloseWithError(err) - } +func (cs *clientStream) abortStream(err error) { + cs.cc.mu.Lock() + defer cs.cc.mu.Unlock() + cs.abortStreamLocked(err) } -func (cs *clientStream) cancelStream() { - cc := cs.cc - cc.mu.Lock() - didReset := cs.didReset - cs.didReset = true - cc.mu.Unlock() - - if !didReset { - cc.writeStreamReset(cs.ID, ErrCodeCancel, nil) - cc.forgetStreamID(cs.ID) +func (cs *clientStream) abortStreamLocked(err error) { + cs.abortOnce.Do(func() { + cs.abortErr = err + close(cs.abort) + }) + if cs.reqBody != nil && !cs.reqBodyClosed { + cs.reqBody.Close() + cs.reqBodyClosed = true } -} - -// checkResetOrDone reports any error sent in a RST_STREAM frame by the -// server, or errStreamClosed if the stream is complete. -func (cs *clientStream) checkResetOrDone() error { - select { - case <-cs.peerReset: - return cs.resetErr - case <-cs.done: - return errStreamClosed - default: - return nil + // TODO(dneil): Clean up tests where cs.cc.cond is nil. + if cs.cc.cond != nil { + // Wake up writeRequestBody if it is waiting on flow control. + cs.cc.cond.Broadcast() } } -func (cs *clientStream) getStartedWrite() bool { +func (cs *clientStream) abortRequestBodyWrite() { cc := cs.cc cc.mu.Lock() defer cc.mu.Unlock() - return cs.startedWrite -} - -func (cs *clientStream) abortRequestBodyWrite(err error) { - if err == nil { - panic("nil error") - } - cc := cs.cc - cc.mu.Lock() - if cs.stopReqBody == nil { - cs.stopReqBody = err - if cs.req.Body != nil { - cs.req.Body.Close() - } + if cs.reqBody != nil && !cs.reqBodyClosed { + cs.reqBody.Close() + cs.reqBodyClosed = true cc.cond.Broadcast() } - cc.mu.Unlock() } type stickyErrWriter struct { - w io.Writer - err *error + conn net.Conn + timeout time.Duration + err *error } func (sew stickyErrWriter) Write(p []byte) (n int, err error) { if *sew.err != nil { return 0, *sew.err } - n, err = sew.w.Write(p) - *sew.err = err - return + for { + if sew.timeout != 0 { + sew.conn.SetWriteDeadline(time.Now().Add(sew.timeout)) + } + nn, err := sew.conn.Write(p[n:]) + n += nn + if n < len(p) && nn > 0 && errors.Is(err, os.ErrDeadlineExceeded) { + // Keep extending the deadline so long as we're making progress. + continue + } + if sew.timeout != 0 { + sew.conn.SetWriteDeadline(time.Time{}) + } + *sew.err = err + return n, err + } } // noCachedConnError is the concrete type of ErrNoCachedConn, which @@ -479,9 +496,9 @@ func (t *Transport) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Res } reused := !atomic.CompareAndSwapUint32(&cc.reused, 0, 1) traceGotConn(req, cc, reused) - res, gotErrAfterReqBodyWrite, err := cc.roundTrip(req) + res, err := cc.RoundTrip(req) if err != nil && retry <= 6 { - if req, err = shouldRetryRequest(req, err, gotErrAfterReqBodyWrite); err == nil { + if req, err = shouldRetryRequest(req, err); err == nil { // After the first retry, do exponential backoff with 10% jitter. if retry == 0 { continue @@ -492,7 +509,7 @@ func (t *Transport) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Res case <-time.After(time.Second * time.Duration(backoff)): continue case <-req.Context().Done(): - return nil, req.Context().Err() + err = req.Context().Err() } } } @@ -523,7 +540,7 @@ var ( // response headers. It is always called with a non-nil error. // It returns either a request to retry (either the same request, or a // modified clone), or an error if the request can't be replayed. -func shouldRetryRequest(req *http.Request, err error, afterBodyWrite bool) (*http.Request, error) { +func shouldRetryRequest(req *http.Request, err error) (*http.Request, error) { if !canRetryError(err) { return nil, err } @@ -536,7 +553,6 @@ func shouldRetryRequest(req *http.Request, err error, afterBodyWrite bool) (*htt // If the request body can be reset back to its original // state via the optional req.GetBody, do that. if req.GetBody != nil { - // TODO: consider a req.Body.Close here? or audit that all caller paths do? body, err := req.GetBody() if err != nil { return nil, err @@ -548,10 +564,8 @@ func shouldRetryRequest(req *http.Request, err error, afterBodyWrite bool) (*htt // The Request.Body can't reset back to the beginning, but we // don't seem to have started to read from it yet, so reuse - // the request directly. The "afterBodyWrite" means the - // bodyWrite process has started, which becomes true before - // the first Read. - if !afterBodyWrite { + // the request directly. + if err == errClientConnUnusable { return req, nil } @@ -563,6 +577,10 @@ func canRetryError(err error) bool { return true } if se, ok := err.(StreamError); ok { + if se.Code == ErrCodeProtocol && se.Cause == errFromPeer { + // See golang/go#47635, golang/go#42777 + return true + } return se.Code == ErrCodeRefusedStream } return false @@ -637,14 +655,15 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, erro tconn: c, readerDone: make(chan struct{}), nextStreamID: 1, - maxFrameSize: 16 << 10, // spec default - initialWindowSize: 65535, // spec default - maxConcurrentStreams: 1000, // "infinite", per spec. 1000 seems good enough. - peerMaxHeaderListSize: 0xffffffffffffffff, // "infinite", per spec. Use 2^64-1 instead. + maxFrameSize: 16 << 10, // spec default + initialWindowSize: 65535, // spec default + maxConcurrentStreams: initialMaxConcurrentStreams, // "infinite", per spec. Use a smaller value until we have received server settings. + peerMaxHeaderListSize: 0xffffffffffffffff, // "infinite", per spec. Use 2^64-1 instead. streams: make(map[uint32]*clientStream), singleUse: singleUse, wantSettingsAck: true, pings: make(map[[8]byte]chan struct{}), + reqHeaderMu: make(chan struct{}, 1), } if d := t.idleConnTimeout(); d != 0 { cc.idleTimeout = d @@ -659,9 +678,16 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, erro // TODO: adjust this writer size to account for frame size + // MTU + crypto/tls record padding. - cc.bw = bufio.NewWriter(stickyErrWriter{c, &cc.werr}) + cc.bw = bufio.NewWriter(stickyErrWriter{ + conn: c, + timeout: t.WriteByteTimeout, + err: &cc.werr, + }) cc.br = bufio.NewReader(c) cc.fr = NewFramer(cc.bw, cc.br) + if t.CountError != nil { + cc.fr.countError = t.CountError + } cc.fr.ReadMetaHeaders = hpack.NewDecoder(initialHeaderTableSize, nil) cc.fr.MaxHeaderListSize = t.maxHeaderListSize() @@ -714,6 +740,13 @@ func (cc *ClientConn) healthCheck() { } } +// SetDoNotReuse marks cc as not reusable for future HTTP requests. +func (cc *ClientConn) SetDoNotReuse() { + cc.mu.Lock() + defer cc.mu.Unlock() + cc.doNotReuse = true +} + func (cc *ClientConn) setGoAway(f *GoAwayFrame) { cc.mu.Lock() defer cc.mu.Unlock() @@ -731,27 +764,94 @@ func (cc *ClientConn) setGoAway(f *GoAwayFrame) { last := f.LastStreamID for streamID, cs := range cc.streams { if streamID > last { - select { - case cs.resc <- resAndError{err: errClientConnGotGoAway}: - default: - } + cs.abortStreamLocked(errClientConnGotGoAway) } } } // CanTakeNewRequest reports whether the connection can take a new request, // meaning it has not been closed or received or sent a GOAWAY. +// +// If the caller is going to immediately make a new request on this +// connection, use ReserveNewRequest instead. func (cc *ClientConn) CanTakeNewRequest() bool { cc.mu.Lock() defer cc.mu.Unlock() return cc.canTakeNewRequestLocked() } +// ReserveNewRequest is like CanTakeNewRequest but also reserves a +// concurrent stream in cc. The reservation is decremented on the +// next call to RoundTrip. +func (cc *ClientConn) ReserveNewRequest() bool { + cc.mu.Lock() + defer cc.mu.Unlock() + if st := cc.idleStateLocked(); !st.canTakeNewRequest { + return false + } + cc.streamsReserved++ + return true +} + +// ClientConnState describes the state of a ClientConn. +type ClientConnState struct { + // Closed is whether the connection is closed. + Closed bool + + // Closing is whether the connection is in the process of + // closing. It may be closing due to shutdown, being a + // single-use connection, being marked as DoNotReuse, or + // having received a GOAWAY frame. + Closing bool + + // StreamsActive is how many streams are active. + StreamsActive int + + // StreamsReserved is how many streams have been reserved via + // ClientConn.ReserveNewRequest. + StreamsReserved int + + // StreamsPending is how many requests have been sent in excess + // of the peer's advertised MaxConcurrentStreams setting and + // are waiting for other streams to complete. + StreamsPending int + + // MaxConcurrentStreams is how many concurrent streams the + // peer advertised as acceptable. Zero means no SETTINGS + // frame has been received yet. + MaxConcurrentStreams uint32 + + // LastIdle, if non-zero, is when the connection last + // transitioned to idle state. + LastIdle time.Time +} + +// State returns a snapshot of cc's state. +func (cc *ClientConn) State() ClientConnState { + cc.wmu.Lock() + maxConcurrent := cc.maxConcurrentStreams + if !cc.seenSettings { + maxConcurrent = 0 + } + cc.wmu.Unlock() + + cc.mu.Lock() + defer cc.mu.Unlock() + return ClientConnState{ + Closed: cc.closed, + Closing: cc.closing || cc.singleUse || cc.doNotReuse || cc.goAway != nil, + StreamsActive: len(cc.streams), + StreamsReserved: cc.streamsReserved, + StreamsPending: cc.pendingRequests, + LastIdle: cc.lastIdle, + MaxConcurrentStreams: maxConcurrent, + } +} + // clientConnIdleState describes the suitability of a client // connection to initiate a new RoundTrip request. type clientConnIdleState struct { canTakeNewRequest bool - freshConn bool // whether it's unused by any previous request } func (cc *ClientConn) idleState() clientConnIdleState { @@ -772,13 +872,13 @@ func (cc *ClientConn) idleStateLocked() (st clientConnIdleState) { // writing it. maxConcurrentOkay = true } else { - maxConcurrentOkay = int64(len(cc.streams)+1) < int64(cc.maxConcurrentStreams) + maxConcurrentOkay = int64(len(cc.streams)+cc.streamsReserved+1) <= int64(cc.maxConcurrentStreams) } st.canTakeNewRequest = cc.goAway == nil && !cc.closed && !cc.closing && maxConcurrentOkay && + !cc.doNotReuse && int64(cc.nextStreamID)+2*int64(cc.pendingRequests) < math.MaxInt32 && !cc.tooIdleLocked() - st.freshConn = cc.nextStreamID == 1 && st.canTakeNewRequest return } @@ -809,7 +909,7 @@ func (cc *ClientConn) onIdleTimeout() { func (cc *ClientConn) closeIfIdle() { cc.mu.Lock() - if len(cc.streams) > 0 { + if len(cc.streams) > 0 || cc.streamsReserved > 0 { cc.mu.Unlock() return } @@ -824,9 +924,15 @@ func (cc *ClientConn) closeIfIdle() { cc.tconn.Close() } +func (cc *ClientConn) isDoNotReuseAndIdle() bool { + cc.mu.Lock() + defer cc.mu.Unlock() + return cc.doNotReuse && len(cc.streams) == 0 +} + var shutdownEnterWaitStateHook = func() {} -// Shutdown gracefully close the client connection, waiting for running streams to complete. +// Shutdown gracefully closes the client connection, waiting for running streams to complete. func (cc *ClientConn) Shutdown(ctx context.Context) error { if err := cc.sendGoAway(); err != nil { return err @@ -865,15 +971,18 @@ func (cc *ClientConn) Shutdown(ctx context.Context) error { func (cc *ClientConn) sendGoAway() error { cc.mu.Lock() - defer cc.mu.Unlock() - cc.wmu.Lock() - defer cc.wmu.Unlock() - if cc.closing { + closing := cc.closing + cc.closing = true + maxStreamID := cc.nextStreamID + cc.mu.Unlock() + if closing { // GOAWAY sent already return nil } + + cc.wmu.Lock() + defer cc.wmu.Unlock() // Send a graceful shutdown frame to server - maxStreamID := cc.nextStreamID if err := cc.fr.WriteGoAway(maxStreamID, ErrCodeNo, nil); err != nil { return err } @@ -881,7 +990,6 @@ func (cc *ClientConn) sendGoAway() error { return err } // Prevent new requests - cc.closing = true return nil } @@ -889,17 +997,12 @@ func (cc *ClientConn) sendGoAway() error { // err is sent to streams. func (cc *ClientConn) closeForError(err error) error { cc.mu.Lock() + cc.closed = true + for _, cs := range cc.streams { + cs.abortStreamLocked(err) + } defer cc.cond.Broadcast() defer cc.mu.Unlock() - for id, cs := range cc.streams { - select { - case cs.resc <- resAndError{err: err}: - default: - } - cs.bufPipe.CloseWithError(err) - delete(cc.streams, id) - } - cc.closed = true return cc.tconn.Close() } @@ -914,6 +1017,9 @@ func (cc *ClientConn) Close() error { // closes the client connection immediately. In-flight requests are interrupted. func (cc *ClientConn) closeForLostPing() error { err := errors.New("http2: client connection lost") + if f := cc.t.CountError; f != nil { + f("conn_close_lost_ping") + } return cc.closeForError(err) } @@ -978,41 +1084,158 @@ func actualContentLength(req *http.Request) int64 { return -1 } +func (cc *ClientConn) decrStreamReservations() { + cc.mu.Lock() + defer cc.mu.Unlock() + cc.decrStreamReservationsLocked() +} + +func (cc *ClientConn) decrStreamReservationsLocked() { + if cc.streamsReserved > 0 { + cc.streamsReserved-- + } +} + func (cc *ClientConn) RoundTrip(req *http.Request) (*http.Response, error) { - resp, _, err := cc.roundTrip(req) - return resp, err + ctx := req.Context() + cs := &clientStream{ + cc: cc, + ctx: ctx, + reqCancel: req.Cancel, + isHead: req.Method == "HEAD", + reqBody: req.Body, + reqBodyContentLength: actualContentLength(req), + trace: httptrace.ContextClientTrace(ctx), + peerClosed: make(chan struct{}), + abort: make(chan struct{}), + respHeaderRecv: make(chan struct{}), + donec: make(chan struct{}), + } + go cs.doRequest(req) + + waitDone := func() error { + select { + case <-cs.donec: + return nil + case <-ctx.Done(): + return ctx.Err() + case <-cs.reqCancel: + return errRequestCanceled + } + } + + handleResponseHeaders := func() (*http.Response, error) { + res := cs.res + if res.StatusCode > 299 { + // On error or status code 3xx, 4xx, 5xx, etc abort any + // ongoing write, assuming that the server doesn't care + // about our request body. If the server replied with 1xx or + // 2xx, however, then assume the server DOES potentially + // want our body (e.g. full-duplex streaming: + // golang.org/issue/13444). If it turns out the server + // doesn't, they'll RST_STREAM us soon enough. This is a + // heuristic to avoid adding knobs to Transport. Hopefully + // we can keep it. + cs.abortRequestBodyWrite() + } + res.Request = req + res.TLS = cc.tlsState + if res.Body == noBody && actualContentLength(req) == 0 { + // If there isn't a request or response body still being + // written, then wait for the stream to be closed before + // RoundTrip returns. + if err := waitDone(); err != nil { + return nil, err + } + } + return res, nil + } + + for { + select { + case <-cs.respHeaderRecv: + return handleResponseHeaders() + case <-cs.abort: + select { + case <-cs.respHeaderRecv: + // If both cs.respHeaderRecv and cs.abort are signaling, + // pick respHeaderRecv. The server probably wrote the + // response and immediately reset the stream. + // golang.org/issue/49645 + return handleResponseHeaders() + default: + waitDone() + return nil, cs.abortErr + } + case <-ctx.Done(): + err := ctx.Err() + cs.abortStream(err) + return nil, err + case <-cs.reqCancel: + cs.abortStream(errRequestCanceled) + return nil, errRequestCanceled + } + } } -func (cc *ClientConn) roundTrip(req *http.Request) (res *http.Response, gotErrAfterReqBodyWrite bool, err error) { +// doRequest runs for the duration of the request lifetime. +// +// It sends the request and performs post-request cleanup (closing Request.Body, etc.). +func (cs *clientStream) doRequest(req *http.Request) { + err := cs.writeRequest(req) + cs.cleanupWriteRequest(err) +} + +// writeRequest sends a request. +// +// It returns nil after the request is written, the response read, +// and the request stream is half-closed by the peer. +// +// It returns non-nil if the request ends otherwise. +// If the returned error is StreamError, the error Code may be used in resetting the stream. +func (cs *clientStream) writeRequest(req *http.Request) (err error) { + cc := cs.cc + ctx := cs.ctx + if err := checkConnHeaders(req); err != nil { - return nil, false, err - } - if cc.idleTimer != nil { - cc.idleTimer.Stop() + return err } - trailers, err := commaSeparatedTrailers(req) - if err != nil { - return nil, false, err + // Acquire the new-request lock by writing to reqHeaderMu. + // This lock guards the critical section covering allocating a new stream ID + // (requires mu) and creating the stream (requires wmu). + if cc.reqHeaderMu == nil { + panic("RoundTrip on uninitialized ClientConn") // for tests + } + select { + case cc.reqHeaderMu <- struct{}{}: + case <-cs.reqCancel: + return errRequestCanceled + case <-ctx.Done(): + return ctx.Err() } - hasTrailers := trailers != "" cc.mu.Lock() - if err := cc.awaitOpenSlotForRequest(req); err != nil { + if cc.idleTimer != nil { + cc.idleTimer.Stop() + } + cc.decrStreamReservationsLocked() + if err := cc.awaitOpenSlotForStreamLocked(cs); err != nil { cc.mu.Unlock() - return nil, false, err + <-cc.reqHeaderMu + return err } - - body := req.Body - contentLen := actualContentLength(req) - hasBody := contentLen != 0 + cc.addStreamLocked(cs) // assigns stream ID + if isConnectionCloseRequest(req) { + cc.doNotReuse = true + } + cc.mu.Unlock() // TODO(bradfitz): this is a copy of the logic in net/http. Unify somewhere? - var requestedGzip bool if !cc.t.disableCompression() && req.Header.Get("Accept-Encoding") == "" && req.Header.Get("Range") == "" && - req.Method != "HEAD" { + !cs.isHead { // Request gzip only, not deflate. Deflate is ambiguous and // not as universally supported anyway. // See: https://zlib.net/zlib_faq.html#faq39 @@ -1025,183 +1248,224 @@ func (cc *ClientConn) roundTrip(req *http.Request) (res *http.Response, gotErrAf // We don't request gzip if the request is for a range, since // auto-decoding a portion of a gzipped document will just fail // anyway. See https://golang.org/issue/8923 - requestedGzip = true + cs.requestedGzip = true } - // we send: HEADERS{1}, CONTINUATION{0,} + DATA{0,} (DATA is - // sent by writeRequestBody below, along with any Trailers, - // again in form HEADERS{1}, CONTINUATION{0,}) - hdrs, err := cc.encodeHeaders(req, requestedGzip, trailers, contentLen) + continueTimeout := cc.t.expectContinueTimeout() + if continueTimeout != 0 { + if !httpguts.HeaderValuesContainsToken(req.Header["Expect"], "100-continue") { + continueTimeout = 0 + } else { + cs.on100 = make(chan struct{}, 1) + } + } + + // Past this point (where we send request headers), it is possible for + // RoundTrip to return successfully. Since the RoundTrip contract permits + // the caller to "mutate or reuse" the Request after closing the Response's Body, + // we must take care when referencing the Request from here on. + err = cs.encodeAndWriteHeaders(req) + <-cc.reqHeaderMu if err != nil { - cc.mu.Unlock() - return nil, false, err + return err } - cs := cc.newStream() - cs.req = req - cs.trace = httptrace.ContextClientTrace(req.Context()) - cs.requestedGzip = requestedGzip - bodyWriter := cc.t.getBodyWriterState(cs, body) - cs.on100 = bodyWriter.on100 + hasBody := cs.reqBodyContentLength != 0 + if !hasBody { + cs.sentEndStream = true + } else { + if continueTimeout != 0 { + traceWait100Continue(cs.trace) + timer := time.NewTimer(continueTimeout) + select { + case <-timer.C: + err = nil + case <-cs.on100: + err = nil + case <-cs.abort: + err = cs.abortErr + case <-ctx.Done(): + err = ctx.Err() + case <-cs.reqCancel: + err = errRequestCanceled + } + timer.Stop() + if err != nil { + traceWroteRequest(cs.trace, err) + return err + } + } - defer func() { - cc.wmu.Lock() - werr := cc.werr - cc.wmu.Unlock() - if werr != nil { - cc.Close() + if err = cs.writeRequestBody(req); err != nil { + if err != errStopReqBodyWrite { + traceWroteRequest(cs.trace, err) + return err + } + } else { + cs.sentEndStream = true } - }() + } + + traceWroteRequest(cs.trace, err) + + var respHeaderTimer <-chan time.Time + var respHeaderRecv chan struct{} + if d := cc.responseHeaderTimeout(); d != 0 { + timer := time.NewTimer(d) + defer timer.Stop() + respHeaderTimer = timer.C + respHeaderRecv = cs.respHeaderRecv + } + // Wait until the peer half-closes its end of the stream, + // or until the request is aborted (via context, error, or otherwise), + // whichever comes first. + for { + select { + case <-cs.peerClosed: + return nil + case <-respHeaderTimer: + return errTimeout + case <-respHeaderRecv: + respHeaderRecv = nil + respHeaderTimer = nil // keep waiting for END_STREAM + case <-cs.abort: + return cs.abortErr + case <-ctx.Done(): + return ctx.Err() + case <-cs.reqCancel: + return errRequestCanceled + } + } +} + +func (cs *clientStream) encodeAndWriteHeaders(req *http.Request) error { + cc := cs.cc + ctx := cs.ctx cc.wmu.Lock() + defer cc.wmu.Unlock() + + // If the request was canceled while waiting for cc.mu, just quit. + select { + case <-cs.abort: + return cs.abortErr + case <-ctx.Done(): + return ctx.Err() + case <-cs.reqCancel: + return errRequestCanceled + default: + } + + // Encode headers. + // + // we send: HEADERS{1}, CONTINUATION{0,} + DATA{0,} (DATA is + // sent by writeRequestBody below, along with any Trailers, + // again in form HEADERS{1}, CONTINUATION{0,}) + trailers, err := commaSeparatedTrailers(req) + if err != nil { + return err + } + hasTrailers := trailers != "" + contentLen := actualContentLength(req) + hasBody := contentLen != 0 + hdrs, err := cc.encodeHeaders(req, cs.requestedGzip, trailers, contentLen) + if err != nil { + return err + } + + // Write the request. endStream := !hasBody && !hasTrailers - werr := cc.writeHeaders(cs.ID, endStream, int(cc.maxFrameSize), hdrs) - cc.wmu.Unlock() + cs.sentHeaders = true + err = cc.writeHeaders(cs.ID, endStream, int(cc.maxFrameSize), hdrs) traceWroteHeaders(cs.trace) - cc.mu.Unlock() + return err +} - if werr != nil { - if hasBody { - req.Body.Close() // per RoundTripper contract - bodyWriter.cancel() - } - cc.forgetStreamID(cs.ID) - // Don't bother sending a RST_STREAM (our write already failed; - // no need to keep writing) - traceWroteRequest(cs.trace, werr) - return nil, false, werr - } +// cleanupWriteRequest performs post-request tasks. +// +// If err (the result of writeRequest) is non-nil and the stream is not closed, +// cleanupWriteRequest will send a reset to the peer. +func (cs *clientStream) cleanupWriteRequest(err error) { + cc := cs.cc - var respHeaderTimer <-chan time.Time - if hasBody { - bodyWriter.scheduleBodyWrite() - } else { - traceWroteRequest(cs.trace, nil) - if d := cc.responseHeaderTimeout(); d != 0 { - timer := time.NewTimer(d) - defer timer.Stop() - respHeaderTimer = timer.C - } + if cs.ID == 0 { + // We were canceled before creating the stream, so return our reservation. + cc.decrStreamReservations() } - readLoopResCh := cs.resc - bodyWritten := false - ctx := req.Context() + // TODO: write h12Compare test showing whether + // Request.Body is closed by the Transport, + // and in multiple cases: server replies <=299 and >299 + // while still writing request body + cc.mu.Lock() + bodyClosed := cs.reqBodyClosed + cs.reqBodyClosed = true + cc.mu.Unlock() + if !bodyClosed && cs.reqBody != nil { + cs.reqBody.Close() + } - handleReadLoopResponse := func(re resAndError) (*http.Response, bool, error) { - res := re.res - if re.err != nil || res.StatusCode > 299 { - // On error or status code 3xx, 4xx, 5xx, etc abort any - // ongoing write, assuming that the server doesn't care - // about our request body. If the server replied with 1xx or - // 2xx, however, then assume the server DOES potentially - // want our body (e.g. full-duplex streaming: - // golang.org/issue/13444). If it turns out the server - // doesn't, they'll RST_STREAM us soon enough. This is a - // heuristic to avoid adding knobs to Transport. Hopefully - // we can keep it. - bodyWriter.cancel() - cs.abortRequestBodyWrite(errStopReqBodyWrite) - if hasBody && !bodyWritten { - <-bodyWriter.resc + if err != nil && cs.sentEndStream { + // If the connection is closed immediately after the response is read, + // we may be aborted before finishing up here. If the stream was closed + // cleanly on both sides, there is no error. + select { + case <-cs.peerClosed: + err = nil + default: + } + } + if err != nil { + cs.abortStream(err) // possibly redundant, but harmless + if cs.sentHeaders { + if se, ok := err.(StreamError); ok { + if se.Cause != errFromPeer { + cc.writeStreamReset(cs.ID, se.Code, err) + } + } else { + cc.writeStreamReset(cs.ID, ErrCodeCancel, err) } } - if re.err != nil { - cc.forgetStreamID(cs.ID) - return nil, cs.getStartedWrite(), re.err + cs.bufPipe.CloseWithError(err) // no-op if already closed + } else { + if cs.sentHeaders && !cs.sentEndStream { + cc.writeStreamReset(cs.ID, ErrCodeNo, nil) } - res.Request = req - res.TLS = cc.tlsState - return res, false, nil + cs.bufPipe.CloseWithError(errRequestCanceled) } - - handleError := func(err error) (*http.Response, bool, error) { - if !hasBody || bodyWritten { - cc.writeStreamReset(cs.ID, ErrCodeCancel, nil) - } else { - bodyWriter.cancel() - cs.abortRequestBodyWrite(errStopReqBodyWriteAndCancel) - <-bodyWriter.resc - } + if cs.ID != 0 { cc.forgetStreamID(cs.ID) - return nil, cs.getStartedWrite(), err } - for { - select { - case re := <-readLoopResCh: - return handleReadLoopResponse(re) - case <-respHeaderTimer: - return handleError(errTimeout) - case <-ctx.Done(): - return handleError(ctx.Err()) - case <-req.Cancel: - return handleError(errRequestCanceled) - case <-cs.peerReset: - // processResetStream already removed the - // stream from the streams map; no need for - // forgetStreamID. - return nil, cs.getStartedWrite(), cs.resetErr - case err := <-bodyWriter.resc: - bodyWritten = true - // Prefer the read loop's response, if available. Issue 16102. - select { - case re := <-readLoopResCh: - return handleReadLoopResponse(re) - default: - } - if err != nil { - cc.forgetStreamID(cs.ID) - return nil, cs.getStartedWrite(), err - } - if d := cc.responseHeaderTimeout(); d != 0 { - timer := time.NewTimer(d) - defer timer.Stop() - respHeaderTimer = timer.C - } - } + cc.wmu.Lock() + werr := cc.werr + cc.wmu.Unlock() + if werr != nil { + cc.Close() } + + close(cs.donec) } -// awaitOpenSlotForRequest waits until len(streams) < maxConcurrentStreams. +// awaitOpenSlotForStream waits until len(streams) < maxConcurrentStreams. // Must hold cc.mu. -func (cc *ClientConn) awaitOpenSlotForRequest(req *http.Request) error { - var waitingForConn chan struct{} - var waitingForConnErr error // guarded by cc.mu +func (cc *ClientConn) awaitOpenSlotForStreamLocked(cs *clientStream) error { for { cc.lastActive = time.Now() if cc.closed || !cc.canTakeNewRequestLocked() { - if waitingForConn != nil { - close(waitingForConn) - } return errClientConnUnusable } cc.lastIdle = time.Time{} - if int64(len(cc.streams))+1 <= int64(cc.maxConcurrentStreams) { - if waitingForConn != nil { - close(waitingForConn) - } + if int64(len(cc.streams)) < int64(cc.maxConcurrentStreams) { return nil } - // Unfortunately, we cannot wait on a condition variable and channel at - // the same time, so instead, we spin up a goroutine to check if the - // request is canceled while we wait for a slot to open in the connection. - if waitingForConn == nil { - waitingForConn = make(chan struct{}) - go func() { - if err := awaitRequestCancel(req, waitingForConn); err != nil { - cc.mu.Lock() - waitingForConnErr = err - cc.cond.Broadcast() - cc.mu.Unlock() - } - }() - } cc.pendingRequests++ cc.cond.Wait() cc.pendingRequests-- - if waitingForConnErr != nil { - return waitingForConnErr + select { + case <-cs.abort: + return cs.abortErr + default: } } } @@ -1228,10 +1492,6 @@ func (cc *ClientConn) writeHeaders(streamID uint32, endStream bool, maxFrameSize cc.fr.WriteContinuation(streamID, endHeaders, chunk) } } - // TODO(bradfitz): this Flush could potentially block (as - // could the WriteHeaders call(s) above), which means they - // wouldn't respond to Request.Cancel being readable. That's - // rare, but this should probably be in a goroutine. cc.bw.Flush() return cc.werr } @@ -1258,7 +1518,7 @@ func (cs *clientStream) frameScratchBufferLen(maxFrameSize int) int { if n > max { n = max } - if cl := actualContentLength(cs.req); cl != -1 && cl+1 < n { + if cl := cs.reqBodyContentLength; cl != -1 && cl+1 < n { // Add an extra byte past the declared content-length to // give the caller's Request.Body io.Reader a chance to // give us more bytes than they declared, so we can catch it @@ -1273,31 +1533,13 @@ func (cs *clientStream) frameScratchBufferLen(maxFrameSize int) int { var bufPool sync.Pool // of *[]byte -func (cs *clientStream) writeRequestBody(body io.Reader, bodyCloser io.Closer) (err error) { +func (cs *clientStream) writeRequestBody(req *http.Request) (err error) { cc := cs.cc + body := cs.reqBody sentEnd := false // whether we sent the final DATA frame w/ END_STREAM - defer func() { - traceWroteRequest(cs.trace, err) - // TODO: write h12Compare test showing whether - // Request.Body is closed by the Transport, - // and in multiple cases: server replies <=299 and >299 - // while still writing request body - var cerr error - cc.mu.Lock() - if cs.stopReqBody == nil { - cs.stopReqBody = errStopReqBodyWrite - cerr = bodyCloser.Close() - } - cc.mu.Unlock() - if err == nil { - err = cerr - } - }() - - req := cs.req hasTrailers := req.Trailer != nil - remainLen := actualContentLength(req) + remainLen := cs.reqBodyContentLength hasContentLen := remainLen != -1 cc.mu.Lock() @@ -1335,29 +1577,29 @@ func (cs *clientStream) writeRequestBody(body io.Reader, bodyCloser io.Closer) ( } if remainLen < 0 { err = errReqBodyTooLong - cc.writeStreamReset(cs.ID, ErrCodeCancel, err) return err } } - if err == io.EOF { - sawEOF = true - err = nil - } else if err != nil { - cc.writeStreamReset(cs.ID, ErrCodeCancel, err) - return err + if err != nil { + cc.mu.Lock() + bodyClosed := cs.reqBodyClosed + cc.mu.Unlock() + switch { + case bodyClosed: + return errStopReqBodyWrite + case err == io.EOF: + sawEOF = true + err = nil + default: + return err + } } remain := buf[:n] for len(remain) > 0 && err == nil { var allowed int32 allowed, err = cs.awaitFlowControl(len(remain)) - switch { - case err == errStopReqBodyWrite: - return err - case err == errStopReqBodyWriteAndCancel: - cc.writeStreamReset(cs.ID, ErrCodeCancel, nil) - return err - case err != nil: + if err != nil { return err } cc.wmu.Lock() @@ -1388,21 +1630,27 @@ func (cs *clientStream) writeRequestBody(body io.Reader, bodyCloser io.Closer) ( return nil } + // Since the RoundTrip contract permits the caller to "mutate or reuse" + // a request after the Response's Body is closed, verify that this hasn't + // happened before accessing the trailers. + cc.mu.Lock() + trailer := req.Trailer + err = cs.abortErr + cc.mu.Unlock() + if err != nil { + return err + } + + cc.wmu.Lock() + defer cc.wmu.Unlock() var trls []byte - if hasTrailers { - cc.mu.Lock() - trls, err = cc.encodeTrailers(req) - cc.mu.Unlock() + if len(trailer) > 0 { + trls, err = cc.encodeTrailers(trailer) if err != nil { - cc.writeStreamReset(cs.ID, ErrCodeInternal, err) - cc.forgetStreamID(cs.ID) return err } } - cc.wmu.Lock() - defer cc.wmu.Unlock() - // Two ways to send END_STREAM: either with trailers, or // with an empty DATA frame. if len(trls) > 0 { @@ -1422,17 +1670,24 @@ func (cs *clientStream) writeRequestBody(body io.Reader, bodyCloser io.Closer) ( // if the stream is dead. func (cs *clientStream) awaitFlowControl(maxBytes int) (taken int32, err error) { cc := cs.cc + ctx := cs.ctx cc.mu.Lock() defer cc.mu.Unlock() for { if cc.closed { return 0, errClientConnClosed } - if cs.stopReqBody != nil { - return 0, cs.stopReqBody + if cs.reqBodyClosed { + return 0, errStopReqBodyWrite } - if err := cs.checkResetOrDone(); err != nil { - return 0, err + select { + case <-cs.abort: + return 0, cs.abortErr + case <-ctx.Done(): + return 0, ctx.Err() + case <-cs.reqCancel: + return 0, errRequestCanceled + default: } if a := cs.flow.available(); a > 0 { take := a @@ -1450,9 +1705,14 @@ func (cs *clientStream) awaitFlowControl(maxBytes int) (taken int32, err error) } } -// requires cc.mu be held. +var errNilRequestURL = errors.New("http2: Request.URI is nil") + +// requires cc.wmu be held. func (cc *ClientConn) encodeHeaders(req *http.Request, addGzipHeader bool, trailers string, contentLength int64) ([]byte, error) { cc.hbuf.Reset() + if req.URL == nil { + return nil, errNilRequestURL + } host := req.Host if host == "" { @@ -1638,12 +1898,12 @@ func shouldSendReqContentLength(method string, contentLength int64) bool { } } -// requires cc.mu be held. -func (cc *ClientConn) encodeTrailers(req *http.Request) ([]byte, error) { +// requires cc.wmu be held. +func (cc *ClientConn) encodeTrailers(trailer http.Header) ([]byte, error) { cc.hbuf.Reset() hlSize := uint64(0) - for k, vv := range req.Trailer { + for k, vv := range trailer { for _, v := range vv { hf := hpack.HeaderField{Name: k, Value: v} hlSize += uint64(hf.Size()) @@ -1653,7 +1913,7 @@ func (cc *ClientConn) encodeTrailers(req *http.Request) ([]byte, error) { return nil, errRequestHeaderListSize } - for k, vv := range req.Trailer { + for k, vv := range trailer { lowKey, ascii := asciiToLower(k) if !ascii { // Skip writing invalid headers. Per RFC 7540, Section 8.1.2, header @@ -1683,51 +1943,51 @@ type resAndError struct { } // requires cc.mu be held. -func (cc *ClientConn) newStream() *clientStream { - cs := &clientStream{ - cc: cc, - ID: cc.nextStreamID, - resc: make(chan resAndError, 1), - peerReset: make(chan struct{}), - done: make(chan struct{}), - } +func (cc *ClientConn) addStreamLocked(cs *clientStream) { cs.flow.add(int32(cc.initialWindowSize)) cs.flow.setConnFlow(&cc.flow) cs.inflow.add(transportDefaultStreamFlow) cs.inflow.setConnFlow(&cc.inflow) + cs.ID = cc.nextStreamID cc.nextStreamID += 2 cc.streams[cs.ID] = cs - return cs + if cs.ID == 0 { + panic("assigned stream ID 0") + } } func (cc *ClientConn) forgetStreamID(id uint32) { - cc.streamByID(id, true) -} - -func (cc *ClientConn) streamByID(id uint32, andRemove bool) *clientStream { cc.mu.Lock() - defer cc.mu.Unlock() - cs := cc.streams[id] - if andRemove && cs != nil && !cc.closed { - cc.lastActive = time.Now() - delete(cc.streams, id) - if len(cc.streams) == 0 && cc.idleTimer != nil { - cc.idleTimer.Reset(cc.idleTimeout) - cc.lastIdle = time.Now() - } - close(cs.done) - // Wake up checkResetOrDone via clientStream.awaitFlowControl and - // wake up RoundTrip if there is a pending request. - cc.cond.Broadcast() + slen := len(cc.streams) + delete(cc.streams, id) + if len(cc.streams) != slen-1 { + panic("forgetting unknown stream id") + } + cc.lastActive = time.Now() + if len(cc.streams) == 0 && cc.idleTimer != nil { + cc.idleTimer.Reset(cc.idleTimeout) + cc.lastIdle = time.Now() + } + // Wake up writeRequestBody via clientStream.awaitFlowControl and + // wake up RoundTrip if there is a pending request. + cc.cond.Broadcast() + + closeOnIdle := cc.singleUse || cc.doNotReuse || cc.t.disableKeepAlives() + if closeOnIdle && cc.streamsReserved == 0 && len(cc.streams) == 0 { + if VerboseLogs { + cc.vlogf("http2: Transport closing idle conn %p (forSingleUse=%v, maxStream=%v)", cc, cc.singleUse, cc.nextStreamID-2) + } + cc.closed = true + defer cc.tconn.Close() } - return cs + + cc.mu.Unlock() } // clientConnReadLoop is the state owned by the clientConn's frame-reading readLoop. type clientConnReadLoop struct { - _ incomparable - cc *ClientConn - closeWhenIdle bool + _ incomparable + cc *ClientConn } // readLoop runs in its own goroutine and reads and dispatches frames. @@ -1787,23 +2047,49 @@ func (rl *clientConnReadLoop) cleanup() { } else if err == io.EOF { err = io.ErrUnexpectedEOF } + cc.closed = true for _, cs := range cc.streams { - cs.bufPipe.CloseWithError(err) // no-op if already closed select { - case cs.resc <- resAndError{err: err}: + case <-cs.peerClosed: + // The server closed the stream before closing the conn, + // so no need to interrupt it. default: + cs.abortStreamLocked(err) } - close(cs.done) } - cc.closed = true cc.cond.Broadcast() cc.mu.Unlock() } +// countReadFrameError calls Transport.CountError with a string +// representing err. +func (cc *ClientConn) countReadFrameError(err error) { + f := cc.t.CountError + if f == nil || err == nil { + return + } + if ce, ok := err.(ConnectionError); ok { + errCode := ErrCode(ce) + f(fmt.Sprintf("read_frame_conn_error_%s", errCode.stringToken())) + return + } + if errors.Is(err, io.EOF) { + f("read_frame_eof") + return + } + if errors.Is(err, io.ErrUnexpectedEOF) { + f("read_frame_unexpected_eof") + return + } + if errors.Is(err, ErrFrameTooLarge) { + f("read_frame_too_large") + return + } + f("read_frame_other") +} + func (rl *clientConnReadLoop) run() error { cc := rl.cc - rl.closeWhenIdle = cc.t.disableKeepAlives() || cc.singleUse - gotReply := false // ever saw a HEADERS reply gotSettings := false readIdleTimeout := cc.t.ReadIdleTimeout var t *time.Timer @@ -1820,9 +2106,7 @@ func (rl *clientConnReadLoop) run() error { cc.vlogf("http2: Transport readFrame error on conn %p: (%T) %v", cc, err, err) } if se, ok := err.(StreamError); ok { - if cs := cc.streamByID(se.StreamID, false); cs != nil { - cs.cc.writeStreamReset(cs.ID, se.Code, err) - cs.cc.forgetStreamID(cs.ID) + if cs := rl.streamByID(se.StreamID); cs != nil { if se.Cause == nil { se.Cause = cc.fr.errDetail } @@ -1830,6 +2114,7 @@ func (rl *clientConnReadLoop) run() error { } continue } else if err != nil { + cc.countReadFrameError(err) return err } if VerboseLogs { @@ -1842,22 +2127,16 @@ func (rl *clientConnReadLoop) run() error { } gotSettings = true } - maybeIdle := false // whether frame might transition us to idle switch f := f.(type) { case *MetaHeadersFrame: err = rl.processHeaders(f) - maybeIdle = true - gotReply = true case *DataFrame: err = rl.processData(f) - maybeIdle = true case *GoAwayFrame: err = rl.processGoAway(f) - maybeIdle = true case *RSTStreamFrame: err = rl.processResetStream(f) - maybeIdle = true case *SettingsFrame: err = rl.processSettings(f) case *PushPromiseFrame: @@ -1875,38 +2154,24 @@ func (rl *clientConnReadLoop) run() error { } return err } - if rl.closeWhenIdle && gotReply && maybeIdle { - cc.closeIfIdle() - } } } func (rl *clientConnReadLoop) processHeaders(f *MetaHeadersFrame) error { - cc := rl.cc - cs := cc.streamByID(f.StreamID, false) + cs := rl.streamByID(f.StreamID) if cs == nil { // We'd get here if we canceled a request while the // server had its response still in flight. So if this // was just something we canceled, ignore it. return nil } - if f.StreamEnded() { - // Issue 20521: If the stream has ended, streamByID() causes - // clientStream.done to be closed, which causes the request's bodyWriter - // to be closed with an errStreamClosed, which may be received by - // clientConn.RoundTrip before the result of processing these headers. - // Deferring stream closure allows the header processing to occur first. - // clientConn.RoundTrip may still receive the bodyWriter error first, but - // the fix for issue 16102 prioritises any response. - // - // Issue 22413: If there is no request body, we should close the - // stream before writing to cs.resc so that the stream is closed - // immediately once RoundTrip returns. - if cs.req.Body != nil { - defer cc.forgetStreamID(f.StreamID) - } else { - cc.forgetStreamID(f.StreamID) - } + if cs.readClosed { + rl.endStreamError(cs, StreamError{ + StreamID: f.StreamID, + Code: ErrCodeProtocol, + Cause: errors.New("protocol error: headers after END_STREAM"), + }) + return nil } if !cs.firstByte { if cs.trace != nil { @@ -1930,9 +2195,11 @@ func (rl *clientConnReadLoop) processHeaders(f *MetaHeadersFrame) error { return err } // Any other error type is a stream error. - cs.cc.writeStreamReset(f.StreamID, ErrCodeProtocol, err) - cc.forgetStreamID(cs.ID) - cs.resc <- resAndError{err: err} + rl.endStreamError(cs, StreamError{ + StreamID: f.StreamID, + Code: ErrCodeProtocol, + Cause: err, + }) return nil // return nil from process* funcs to keep conn alive } if res == nil { @@ -1940,7 +2207,11 @@ func (rl *clientConnReadLoop) processHeaders(f *MetaHeadersFrame) error { return nil } cs.resTrailer = &res.Trailer - cs.resc <- resAndError{res: res} + cs.res = res + close(cs.respHeaderRecv) + if f.StreamEnded() { + rl.endStream(cs) + } return nil } @@ -2002,6 +2273,9 @@ func (rl *clientConnReadLoop) handleResponse(cs *clientStream, f *MetaHeadersFra } if statusCode >= 100 && statusCode <= 199 { + if f.StreamEnded() { + return nil, errors.New("1xx informational response with END_STREAM flag") + } cs.num1xx++ const max1xxResponses = 5 // arbitrary bound on number of informational responses, same as net/http if cs.num1xx > max1xxResponses { @@ -2014,42 +2288,49 @@ func (rl *clientConnReadLoop) handleResponse(cs *clientStream, f *MetaHeadersFra } if statusCode == 100 { traceGot100Continue(cs.trace) - if cs.on100 != nil { - cs.on100() // forces any write delay timer to fire + select { + case cs.on100 <- struct{}{}: + default: } } cs.pastHeaders = false // do it all again return nil, nil } - streamEnded := f.StreamEnded() - isHead := cs.req.Method == "HEAD" - if !streamEnded || isHead { - res.ContentLength = -1 - if clens := res.Header["Content-Length"]; len(clens) == 1 { - if cl, err := strconv.ParseUint(clens[0], 10, 63); err == nil { - res.ContentLength = int64(cl) - } else { - // TODO: care? unlike http/1, it won't mess up our framing, so it's - // more safe smuggling-wise to ignore. - } - } else if len(clens) > 1 { + res.ContentLength = -1 + if clens := res.Header["Content-Length"]; len(clens) == 1 { + if cl, err := strconv.ParseUint(clens[0], 10, 63); err == nil { + res.ContentLength = int64(cl) + } else { // TODO: care? unlike http/1, it won't mess up our framing, so it's // more safe smuggling-wise to ignore. } + } else if len(clens) > 1 { + // TODO: care? unlike http/1, it won't mess up our framing, so it's + // more safe smuggling-wise to ignore. + } else if f.StreamEnded() && !cs.isHead { + res.ContentLength = 0 } - if streamEnded || isHead { + if cs.isHead { res.Body = noBody return res, nil } - cs.bufPipe = pipe{b: &dataBuffer{expected: res.ContentLength}} + if f.StreamEnded() { + if res.ContentLength > 0 { + res.Body = missingBody{} + } else { + res.Body = noBody + } + return res, nil + } + + cs.bufPipe.setBuffer(&dataBuffer{expected: res.ContentLength}) cs.bytesRemain = res.ContentLength res.Body = transportResponseBody{cs} - go cs.awaitRequestCancel(cs.req) - if cs.requestedGzip && res.Header.Get("Content-Encoding") == "gzip" { + if cs.requestedGzip && asciiEqualFold(res.Header.Get("Content-Encoding"), "gzip") { res.Header.Del("Content-Encoding") res.Header.Del("Content-Length") res.ContentLength = -1 @@ -2088,8 +2369,7 @@ func (rl *clientConnReadLoop) processTrailers(cs *clientStream, f *MetaHeadersFr } // transportResponseBody is the concrete type of Transport.RoundTrip's -// Response.Body. It is an io.ReadCloser. On Read, it reads from cs.body. -// On Close it sends RST_STREAM if EOF wasn't already seen. +// Response.Body. It is an io.ReadCloser. type transportResponseBody struct { cs *clientStream } @@ -2107,7 +2387,7 @@ func (b transportResponseBody) Read(p []byte) (n int, err error) { n = int(cs.bytesRemain) if err == nil { err = errors.New("net/http: server replied with more than declared Content-Length; truncated") - cc.writeStreamReset(cs.ID, ErrCodeProtocol, err) + cs.abortStream(err) } cs.readErr = err return int(cs.bytesRemain), err @@ -2125,8 +2405,6 @@ func (b transportResponseBody) Read(p []byte) (n int, err error) { } cc.mu.Lock() - defer cc.mu.Unlock() - var connAdd, streamAdd int32 // Check the conn-level first, before the stream-level. if v := cc.inflow.available(); v < transportDefaultConnFlow/2 { @@ -2143,6 +2421,8 @@ func (b transportResponseBody) Read(p []byte) (n int, err error) { cs.inflow.add(streamAdd) } } + cc.mu.Unlock() + if connAdd != 0 || streamAdd != 0 { cc.wmu.Lock() defer cc.wmu.Unlock() @@ -2163,34 +2443,45 @@ func (b transportResponseBody) Close() error { cs := b.cs cc := cs.cc - serverSentStreamEnd := cs.bufPipe.Err() == io.EOF unread := cs.bufPipe.Len() - - if unread > 0 || !serverSentStreamEnd { + if unread > 0 { cc.mu.Lock() - cc.wmu.Lock() - if !serverSentStreamEnd { - cc.fr.WriteRSTStream(cs.ID, ErrCodeCancel) - cs.didReset = true - } // Return connection-level flow control. if unread > 0 { cc.inflow.add(int32(unread)) + } + cc.mu.Unlock() + + // TODO(dneil): Acquiring this mutex can block indefinitely. + // Move flow control return to a goroutine? + cc.wmu.Lock() + // Return connection-level flow control. + if unread > 0 { cc.fr.WriteWindowUpdate(0, uint32(unread)) } cc.bw.Flush() cc.wmu.Unlock() - cc.mu.Unlock() } cs.bufPipe.BreakWithError(errClosedResponseBody) - cc.forgetStreamID(cs.ID) + cs.abortStream(errClosedResponseBody) + + select { + case <-cs.donec: + case <-cs.ctx.Done(): + // See golang/go#49366: The net/http package can cancel the + // request context after the response body is fully read. + // Don't treat this as an error. + return nil + case <-cs.reqCancel: + return errRequestCanceled + } return nil } func (rl *clientConnReadLoop) processData(f *DataFrame) error { cc := rl.cc - cs := cc.streamByID(f.StreamID, f.StreamEnded()) + cs := rl.streamByID(f.StreamID) data := f.Data() if cs == nil { cc.mu.Lock() @@ -2219,6 +2510,14 @@ func (rl *clientConnReadLoop) processData(f *DataFrame) error { } return nil } + if cs.readClosed { + cc.logf("protocol error: received DATA after END_STREAM") + rl.endStreamError(cs, StreamError{ + StreamID: f.StreamID, + Code: ErrCodeProtocol, + }) + return nil + } if !cs.firstByte { cc.logf("protocol error: received DATA before a HEADERS frame") rl.endStreamError(cs, StreamError{ @@ -2228,7 +2527,7 @@ func (rl *clientConnReadLoop) processData(f *DataFrame) error { return nil } if f.Length > 0 { - if cs.req.Method == "HEAD" && len(data) > 0 { + if cs.isHead && len(data) > 0 { cc.logf("protocol error: received DATA on a HEAD request") rl.endStreamError(cs, StreamError{ StreamID: f.StreamID, @@ -2250,30 +2549,39 @@ func (rl *clientConnReadLoop) processData(f *DataFrame) error { if pad := int(f.Length) - len(data); pad > 0 { refund += pad } - // Return len(data) now if the stream is already closed, - // since data will never be read. - didReset := cs.didReset - if didReset { - refund += len(data) + + didReset := false + var err error + if len(data) > 0 { + if _, err = cs.bufPipe.Write(data); err != nil { + // Return len(data) now if the stream is already closed, + // since data will never be read. + didReset = true + refund += len(data) + } } + if refund > 0 { cc.inflow.add(int32(refund)) + if !didReset { + cs.inflow.add(int32(refund)) + } + } + cc.mu.Unlock() + + if refund > 0 { cc.wmu.Lock() cc.fr.WriteWindowUpdate(0, uint32(refund)) if !didReset { - cs.inflow.add(int32(refund)) cc.fr.WriteWindowUpdate(cs.ID, uint32(refund)) } cc.bw.Flush() cc.wmu.Unlock() } - cc.mu.Unlock() - if len(data) > 0 && !didReset { - if _, err := cs.bufPipe.Write(data); err != nil { - rl.endStreamError(cs, err) - return err - } + if err != nil { + rl.endStreamError(cs, err) + return nil } } @@ -2286,24 +2594,32 @@ func (rl *clientConnReadLoop) processData(f *DataFrame) error { func (rl *clientConnReadLoop) endStream(cs *clientStream) { // TODO: check that any declared content-length matches, like // server.go's (*stream).endStream method. - rl.endStreamError(cs, nil) + if !cs.readClosed { + cs.readClosed = true + // Close cs.bufPipe and cs.peerClosed with cc.mu held to avoid a + // race condition: The caller can read io.EOF from Response.Body + // and close the body before we close cs.peerClosed, causing + // cleanupWriteRequest to send a RST_STREAM. + rl.cc.mu.Lock() + defer rl.cc.mu.Unlock() + cs.bufPipe.closeWithErrorAndCode(io.EOF, cs.copyTrailers) + close(cs.peerClosed) + } } func (rl *clientConnReadLoop) endStreamError(cs *clientStream, err error) { - var code func() - if err == nil { - err = io.EOF - code = cs.copyTrailers - } - if isConnectionCloseRequest(cs.req) { - rl.closeWhenIdle = true - } - cs.bufPipe.closeWithErrorAndCode(err, code) + cs.readAborted = true + cs.abortStream(err) +} - select { - case cs.resc <- resAndError{err: err}: - default: +func (rl *clientConnReadLoop) streamByID(id uint32) *clientStream { + rl.cc.mu.Lock() + defer rl.cc.mu.Unlock() + cs := rl.cc.streams[id] + if cs != nil && !cs.readAborted { + return cs } + return nil } func (cs *clientStream) copyTrailers() { @@ -2322,12 +2638,33 @@ func (rl *clientConnReadLoop) processGoAway(f *GoAwayFrame) error { if f.ErrCode != 0 { // TODO: deal with GOAWAY more. particularly the error code cc.vlogf("transport got GOAWAY with error code = %v", f.ErrCode) + if fn := cc.t.CountError; fn != nil { + fn("recv_goaway_" + f.ErrCode.stringToken()) + } + } cc.setGoAway(f) return nil } func (rl *clientConnReadLoop) processSettings(f *SettingsFrame) error { + cc := rl.cc + // Locking both mu and wmu here allows frame encoding to read settings with only wmu held. + // Acquiring wmu when f.IsAck() is unnecessary, but convenient and mostly harmless. + cc.wmu.Lock() + defer cc.wmu.Unlock() + + if err := rl.processSettingsNoWrite(f); err != nil { + return err + } + if !f.IsAck() { + cc.fr.WriteSettingsAck() + cc.bw.Flush() + } + return nil +} + +func (rl *clientConnReadLoop) processSettingsNoWrite(f *SettingsFrame) error { cc := rl.cc cc.mu.Lock() defer cc.mu.Unlock() @@ -2340,12 +2677,14 @@ func (rl *clientConnReadLoop) processSettings(f *SettingsFrame) error { return ConnectionError(ErrCodeProtocol) } + var seenMaxConcurrentStreams bool err := f.ForeachSetting(func(s Setting) error { switch s.ID { case SettingMaxFrameSize: cc.maxFrameSize = s.Val case SettingMaxConcurrentStreams: cc.maxConcurrentStreams = s.Val + seenMaxConcurrentStreams = true case SettingMaxHeaderListSize: cc.peerMaxHeaderListSize = uint64(s.Val) case SettingInitialWindowSize: @@ -2377,17 +2716,23 @@ func (rl *clientConnReadLoop) processSettings(f *SettingsFrame) error { return err } - cc.wmu.Lock() - defer cc.wmu.Unlock() + if !cc.seenSettings { + if !seenMaxConcurrentStreams { + // This was the servers initial SETTINGS frame and it + // didn't contain a MAX_CONCURRENT_STREAMS field so + // increase the number of concurrent streams this + // connection can establish to our default. + cc.maxConcurrentStreams = defaultMaxConcurrentStreams + } + cc.seenSettings = true + } - cc.fr.WriteSettingsAck() - cc.bw.Flush() - return cc.werr + return nil } func (rl *clientConnReadLoop) processWindowUpdate(f *WindowUpdateFrame) error { cc := rl.cc - cs := cc.streamByID(f.StreamID, false) + cs := rl.streamByID(f.StreamID) if f.StreamID != 0 && cs == nil { return nil } @@ -2407,24 +2752,22 @@ func (rl *clientConnReadLoop) processWindowUpdate(f *WindowUpdateFrame) error { } func (rl *clientConnReadLoop) processResetStream(f *RSTStreamFrame) error { - cs := rl.cc.streamByID(f.StreamID, true) + cs := rl.streamByID(f.StreamID) if cs == nil { - // TODO: return error if server tries to RST_STEAM an idle stream + // TODO: return error if server tries to RST_STREAM an idle stream return nil } - select { - case <-cs.peerReset: - // Already reset. - // This is the only goroutine - // which closes this, so there - // isn't a race. - default: - err := streamError(cs.ID, f.ErrCode) - cs.resetErr = err - close(cs.peerReset) - cs.bufPipe.CloseWithError(err) - cs.cc.cond.Broadcast() // wake up checkResetOrDone via clientStream.awaitFlowControl + serr := streamError(cs.ID, f.ErrCode) + serr.Cause = errFromPeer + if f.ErrCode == ErrCodeProtocol { + rl.cc.SetDoNotReuse() } + if fn := cs.cc.t.CountError; fn != nil { + fn("recv_rststream_" + f.ErrCode.stringToken()) + } + cs.abortStream(serr) + + cs.bufPipe.CloseWithError(serr) return nil } @@ -2446,19 +2789,24 @@ func (cc *ClientConn) Ping(ctx context.Context) error { } cc.mu.Unlock() } - cc.wmu.Lock() - if err := cc.fr.WritePing(false, p); err != nil { - cc.wmu.Unlock() - return err - } - if err := cc.bw.Flush(); err != nil { - cc.wmu.Unlock() - return err - } - cc.wmu.Unlock() + errc := make(chan error, 1) + go func() { + cc.wmu.Lock() + defer cc.wmu.Unlock() + if err := cc.fr.WritePing(false, p); err != nil { + errc <- err + return + } + if err := cc.bw.Flush(); err != nil { + errc <- err + return + } + }() select { case <-c: return nil + case err := <-errc: + return err case <-ctx.Done(): return ctx.Err() case <-cc.readerDone: @@ -2535,6 +2883,11 @@ func (t *Transport) logf(format string, args ...interface{}) { var noBody io.ReadCloser = ioutil.NopCloser(bytes.NewReader(nil)) +type missingBody struct{} + +func (missingBody) Close() error { return nil } +func (missingBody) Read([]byte) (int, error) { return 0, io.ErrUnexpectedEOF } + func strSliceContains(ss []string, s string) bool { for _, v := range ss { if v == s { @@ -2580,87 +2933,6 @@ type errorReader struct{ err error } func (r errorReader) Read(p []byte) (int, error) { return 0, r.err } -// bodyWriterState encapsulates various state around the Transport's writing -// of the request body, particularly regarding doing delayed writes of the body -// when the request contains "Expect: 100-continue". -type bodyWriterState struct { - cs *clientStream - timer *time.Timer // if non-nil, we're doing a delayed write - fnonce *sync.Once // to call fn with - fn func() // the code to run in the goroutine, writing the body - resc chan error // result of fn's execution - delay time.Duration // how long we should delay a delayed write for -} - -func (t *Transport) getBodyWriterState(cs *clientStream, body io.Reader) (s bodyWriterState) { - s.cs = cs - if body == nil { - return - } - resc := make(chan error, 1) - s.resc = resc - s.fn = func() { - cs.cc.mu.Lock() - cs.startedWrite = true - cs.cc.mu.Unlock() - resc <- cs.writeRequestBody(body, cs.req.Body) - } - s.delay = t.expectContinueTimeout() - if s.delay == 0 || - !httpguts.HeaderValuesContainsToken( - cs.req.Header["Expect"], - "100-continue") { - return - } - s.fnonce = new(sync.Once) - - // Arm the timer with a very large duration, which we'll - // intentionally lower later. It has to be large now because - // we need a handle to it before writing the headers, but the - // s.delay value is defined to not start until after the - // request headers were written. - const hugeDuration = 365 * 24 * time.Hour - s.timer = time.AfterFunc(hugeDuration, func() { - s.fnonce.Do(s.fn) - }) - return -} - -func (s bodyWriterState) cancel() { - if s.timer != nil { - if s.timer.Stop() { - s.resc <- nil - } - } -} - -func (s bodyWriterState) on100() { - if s.timer == nil { - // If we didn't do a delayed write, ignore the server's - // bogus 100 continue response. - return - } - s.timer.Stop() - go func() { s.fnonce.Do(s.fn) }() -} - -// scheduleBodyWrite starts writing the body, either immediately (in -// the common case) or after the delay timeout. It should not be -// called until after the headers have been written. -func (s bodyWriterState) scheduleBodyWrite() { - if s.timer == nil { - // We're not doing a delayed write (see - // getBodyWriterState), so just start the writing - // goroutine immediately. - go s.fn() - return - } - traceWait100Continue(s.cs.trace) - if s.timer.Stop() { - s.timer.Reset(s.delay) - } -} - // isConnectionCloseRequest reports whether req should use its own // connection for a single request and then close the connection. func isConnectionCloseRequest(req *http.Request) bool { diff --git a/test/vendor/golang.org/x/net/http2/writesched.go b/test/vendor/golang.org/x/net/http2/writesched.go index f24d2b1e7d..c7cd001739 100644 --- a/test/vendor/golang.org/x/net/http2/writesched.go +++ b/test/vendor/golang.org/x/net/http2/writesched.go @@ -32,7 +32,8 @@ type WriteScheduler interface { // Pop dequeues the next frame to write. Returns false if no frames can // be written. Frames with a given wr.StreamID() are Pop'd in the same - // order they are Push'd. No frames should be discarded except by CloseStream. + // order they are Push'd, except RST_STREAM frames. No frames should be + // discarded except by CloseStream. Pop() (wr FrameWriteRequest, ok bool) } @@ -52,6 +53,7 @@ type FrameWriteRequest struct { // stream is the stream on which this frame will be written. // nil for non-stream frames like PING and SETTINGS. + // nil for RST_STREAM streams, which use the StreamError.StreamID field instead. stream *stream // done, if non-nil, must be a buffered channel with space for diff --git a/test/vendor/golang.org/x/net/http2/writesched_random.go b/test/vendor/golang.org/x/net/http2/writesched_random.go index 9a7b9e581c..f2e55e05ce 100644 --- a/test/vendor/golang.org/x/net/http2/writesched_random.go +++ b/test/vendor/golang.org/x/net/http2/writesched_random.go @@ -45,11 +45,11 @@ func (ws *randomWriteScheduler) AdjustStream(streamID uint32, priority PriorityP } func (ws *randomWriteScheduler) Push(wr FrameWriteRequest) { - id := wr.StreamID() - if id == 0 { + if wr.isControl() { ws.zero.push(wr) return } + id := wr.StreamID() q, ok := ws.sq[id] if !ok { q = ws.queuePool.get() @@ -59,7 +59,7 @@ func (ws *randomWriteScheduler) Push(wr FrameWriteRequest) { } func (ws *randomWriteScheduler) Pop() (FrameWriteRequest, bool) { - // Control frames first. + // Control and RST_STREAM frames first. if !ws.zero.empty() { return ws.zero.shift(), true } diff --git a/test/vendor/golang.org/x/net/idna/go118.go b/test/vendor/golang.org/x/net/idna/go118.go new file mode 100644 index 0000000000..c5c4338dbe --- /dev/null +++ b/test/vendor/golang.org/x/net/idna/go118.go @@ -0,0 +1,14 @@ +// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. + +// Copyright 2021 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build go1.18 +// +build go1.18 + +package idna + +// Transitional processing is disabled by default in Go 1.18. +// https://golang.org/issue/47510 +const transitionalLookup = false diff --git a/test/vendor/golang.org/x/net/idna/idna10.0.0.go b/test/vendor/golang.org/x/net/idna/idna10.0.0.go index 5208ba6cb8..64ccf85feb 100644 --- a/test/vendor/golang.org/x/net/idna/idna10.0.0.go +++ b/test/vendor/golang.org/x/net/idna/idna10.0.0.go @@ -59,10 +59,10 @@ type Option func(*options) // Transitional sets a Profile to use the Transitional mapping as defined in UTS // #46. This will cause, for example, "ß" to be mapped to "ss". Using the // transitional mapping provides a compromise between IDNA2003 and IDNA2008 -// compatibility. It is used by most browsers when resolving domain names. This +// compatibility. It is used by some browsers when resolving domain names. This // option is only meaningful if combined with MapForLookup. func Transitional(transitional bool) Option { - return func(o *options) { o.transitional = true } + return func(o *options) { o.transitional = transitional } } // VerifyDNSLength sets whether a Profile should fail if any of the IDN parts @@ -284,7 +284,7 @@ var ( punycode = &Profile{} lookup = &Profile{options{ - transitional: true, + transitional: transitionalLookup, useSTD3Rules: true, checkHyphens: true, checkJoiners: true, diff --git a/test/vendor/golang.org/x/net/idna/idna9.0.0.go b/test/vendor/golang.org/x/net/idna/idna9.0.0.go index 55f718f127..aae6aac872 100644 --- a/test/vendor/golang.org/x/net/idna/idna9.0.0.go +++ b/test/vendor/golang.org/x/net/idna/idna9.0.0.go @@ -58,10 +58,10 @@ type Option func(*options) // Transitional sets a Profile to use the Transitional mapping as defined in UTS // #46. This will cause, for example, "ß" to be mapped to "ss". Using the // transitional mapping provides a compromise between IDNA2003 and IDNA2008 -// compatibility. It is used by most browsers when resolving domain names. This +// compatibility. It is used by some browsers when resolving domain names. This // option is only meaningful if combined with MapForLookup. func Transitional(transitional bool) Option { - return func(o *options) { o.transitional = true } + return func(o *options) { o.transitional = transitional } } // VerifyDNSLength sets whether a Profile should fail if any of the IDN parts diff --git a/test/vendor/golang.org/x/net/idna/pre_go118.go b/test/vendor/golang.org/x/net/idna/pre_go118.go new file mode 100644 index 0000000000..3aaccab1c5 --- /dev/null +++ b/test/vendor/golang.org/x/net/idna/pre_go118.go @@ -0,0 +1,12 @@ +// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. + +// Copyright 2021 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build !go1.18 +// +build !go1.18 + +package idna + +const transitionalLookup = true diff --git a/test/vendor/golang.org/x/net/idna/punycode.go b/test/vendor/golang.org/x/net/idna/punycode.go index 02c7d59af3..e8e3ac11a9 100644 --- a/test/vendor/golang.org/x/net/idna/punycode.go +++ b/test/vendor/golang.org/x/net/idna/punycode.go @@ -49,6 +49,7 @@ func decode(encoded string) (string, error) { } } i, n, bias := int32(0), initialN, initialBias + overflow := false for pos < len(encoded) { oldI, w := i, int32(1) for k := base; ; k += base { @@ -60,29 +61,32 @@ func decode(encoded string) (string, error) { return "", punyError(encoded) } pos++ - i += digit * w - if i < 0 { + i, overflow = madd(i, digit, w) + if overflow { return "", punyError(encoded) } t := k - bias - if t < tmin { + if k <= bias { t = tmin - } else if t > tmax { + } else if k >= bias+tmax { t = tmax } if digit < t { break } - w *= base - t - if w >= math.MaxInt32/base { + w, overflow = madd(0, w, base-t) + if overflow { return "", punyError(encoded) } } + if len(output) >= 1024 { + return "", punyError(encoded) + } x := int32(len(output) + 1) bias = adapt(i-oldI, x, oldI == 0) n += i / x i %= x - if n > utf8.MaxRune || len(output) >= 1024 { + if n < 0 || n > utf8.MaxRune { return "", punyError(encoded) } output = append(output, 0) @@ -115,6 +119,7 @@ func encode(prefix, s string) (string, error) { if b > 0 { output = append(output, '-') } + overflow := false for remaining != 0 { m := int32(0x7fffffff) for _, r := range s { @@ -122,8 +127,8 @@ func encode(prefix, s string) (string, error) { m = r } } - delta += (m - n) * (h + 1) - if delta < 0 { + delta, overflow = madd(delta, m-n, h+1) + if overflow { return "", punyError(s) } n = m @@ -141,9 +146,9 @@ func encode(prefix, s string) (string, error) { q := delta for k := base; ; k += base { t := k - bias - if t < tmin { + if k <= bias { t = tmin - } else if t > tmax { + } else if k >= bias+tmax { t = tmax } if q < t { @@ -164,6 +169,15 @@ func encode(prefix, s string) (string, error) { return string(output), nil } +// madd computes a + (b * c), detecting overflow. +func madd(a, b, c int32) (next int32, overflow bool) { + p := int64(b) * int64(c) + if p > math.MaxInt32-int64(a) { + return 0, true + } + return a + int32(p), false +} + func decodeDigit(x byte) (digit int32, ok bool) { switch { case '0' <= x && x <= '9': diff --git a/test/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.pb.go b/test/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.pb.go index 852cac52a0..dd1d1d84e9 100644 --- a/test/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.pb.go +++ b/test/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.pb.go @@ -933,9 +933,13 @@ type LinuxPodSandboxConfig struct { // LinuxSandboxSecurityContext holds sandbox security attributes. SecurityContext *LinuxSandboxSecurityContext `protobuf:"bytes,2,opt,name=security_context,json=securityContext,proto3" json:"security_context,omitempty"` // Sysctls holds linux sysctls config for the sandbox. - Sysctls map[string]string `protobuf:"bytes,3,rep,name=sysctls,proto3" json:"sysctls,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_sizecache int32 `json:"-"` + Sysctls map[string]string `protobuf:"bytes,3,rep,name=sysctls,proto3" json:"sysctls,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Optional overhead represents the overheads associated with this sandbox + Overhead *LinuxContainerResources `protobuf:"bytes,4,opt,name=overhead,proto3" json:"overhead,omitempty"` + // Optional resources represents the sum of container resources for this sandbox + Resources *LinuxContainerResources `protobuf:"bytes,5,opt,name=resources,proto3" json:"resources,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *LinuxPodSandboxConfig) Reset() { *m = LinuxPodSandboxConfig{} } @@ -991,6 +995,20 @@ func (m *LinuxPodSandboxConfig) GetSysctls() map[string]string { return nil } +func (m *LinuxPodSandboxConfig) GetOverhead() *LinuxContainerResources { + if m != nil { + return m.Overhead + } + return nil +} + +func (m *LinuxPodSandboxConfig) GetResources() *LinuxContainerResources { + if m != nil { + return m.Resources + } + return nil +} + // PodSandboxMetadata holds all necessary information for building the sandbox name. // The container runtime is encouraged to expose the metadata associated with the // PodSandbox in its user interface for better user experience. For example, @@ -1119,9 +1137,11 @@ type PodSandboxConfig struct { // consider proposing new typed fields for any new features instead. Annotations map[string]string `protobuf:"bytes,7,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Optional configurations specific to Linux hosts. - Linux *LinuxPodSandboxConfig `protobuf:"bytes,8,opt,name=linux,proto3" json:"linux,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_sizecache int32 `json:"-"` + Linux *LinuxPodSandboxConfig `protobuf:"bytes,8,opt,name=linux,proto3" json:"linux,omitempty"` + // Optional configurations specific to Windows hosts. + Windows *WindowsPodSandboxConfig `protobuf:"bytes,9,opt,name=windows,proto3" json:"windows,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *PodSandboxConfig) Reset() { *m = PodSandboxConfig{} } @@ -1212,6 +1232,13 @@ func (m *PodSandboxConfig) GetLinux() *LinuxPodSandboxConfig { return nil } +func (m *PodSandboxConfig) GetWindows() *WindowsPodSandboxConfig { + if m != nil { + return m.Windows + } + return nil +} + type RunPodSandboxRequest struct { // Configuration for creating a PodSandbox. Config *PodSandboxConfig `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` @@ -1219,7 +1246,7 @@ type RunPodSandboxRequest struct { // If the runtime handler is unknown, this request should be rejected. An // empty string should select the default handler, equivalent to the // behavior before this feature was added. - // See https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md + // See https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class RuntimeHandler string `protobuf:"bytes,2,opt,name=runtime_handler,json=runtimeHandler,proto3" json:"runtime_handler,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` @@ -2226,6 +2253,716 @@ func (m *ListPodSandboxResponse) GetItems() []*PodSandbox { return nil } +type PodSandboxStatsRequest struct { + // ID of the pod sandbox for which to retrieve stats. + PodSandboxId string `protobuf:"bytes,1,opt,name=pod_sandbox_id,json=podSandboxId,proto3" json:"pod_sandbox_id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PodSandboxStatsRequest) Reset() { *m = PodSandboxStatsRequest{} } +func (*PodSandboxStatsRequest) ProtoMessage() {} +func (*PodSandboxStatsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{30} +} +func (m *PodSandboxStatsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PodSandboxStatsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PodSandboxStatsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PodSandboxStatsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_PodSandboxStatsRequest.Merge(m, src) +} +func (m *PodSandboxStatsRequest) XXX_Size() int { + return m.Size() +} +func (m *PodSandboxStatsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_PodSandboxStatsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_PodSandboxStatsRequest proto.InternalMessageInfo + +func (m *PodSandboxStatsRequest) GetPodSandboxId() string { + if m != nil { + return m.PodSandboxId + } + return "" +} + +type PodSandboxStatsResponse struct { + Stats *PodSandboxStats `protobuf:"bytes,1,opt,name=stats,proto3" json:"stats,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PodSandboxStatsResponse) Reset() { *m = PodSandboxStatsResponse{} } +func (*PodSandboxStatsResponse) ProtoMessage() {} +func (*PodSandboxStatsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{31} +} +func (m *PodSandboxStatsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PodSandboxStatsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PodSandboxStatsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PodSandboxStatsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_PodSandboxStatsResponse.Merge(m, src) +} +func (m *PodSandboxStatsResponse) XXX_Size() int { + return m.Size() +} +func (m *PodSandboxStatsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_PodSandboxStatsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_PodSandboxStatsResponse proto.InternalMessageInfo + +func (m *PodSandboxStatsResponse) GetStats() *PodSandboxStats { + if m != nil { + return m.Stats + } + return nil +} + +// PodSandboxStatsFilter is used to filter pod sandboxes. +// All those fields are combined with 'AND'. +type PodSandboxStatsFilter struct { + // ID of the pod sandbox. + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // LabelSelector to select matches. + // Only api.MatchLabels is supported for now and the requirements + // are ANDed. MatchExpressions is not supported yet. + LabelSelector map[string]string `protobuf:"bytes,2,rep,name=label_selector,json=labelSelector,proto3" json:"label_selector,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PodSandboxStatsFilter) Reset() { *m = PodSandboxStatsFilter{} } +func (*PodSandboxStatsFilter) ProtoMessage() {} +func (*PodSandboxStatsFilter) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{32} +} +func (m *PodSandboxStatsFilter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PodSandboxStatsFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PodSandboxStatsFilter.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PodSandboxStatsFilter) XXX_Merge(src proto.Message) { + xxx_messageInfo_PodSandboxStatsFilter.Merge(m, src) +} +func (m *PodSandboxStatsFilter) XXX_Size() int { + return m.Size() +} +func (m *PodSandboxStatsFilter) XXX_DiscardUnknown() { + xxx_messageInfo_PodSandboxStatsFilter.DiscardUnknown(m) +} + +var xxx_messageInfo_PodSandboxStatsFilter proto.InternalMessageInfo + +func (m *PodSandboxStatsFilter) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *PodSandboxStatsFilter) GetLabelSelector() map[string]string { + if m != nil { + return m.LabelSelector + } + return nil +} + +type ListPodSandboxStatsRequest struct { + // Filter for the list request. + Filter *PodSandboxStatsFilter `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListPodSandboxStatsRequest) Reset() { *m = ListPodSandboxStatsRequest{} } +func (*ListPodSandboxStatsRequest) ProtoMessage() {} +func (*ListPodSandboxStatsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{33} +} +func (m *ListPodSandboxStatsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListPodSandboxStatsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListPodSandboxStatsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ListPodSandboxStatsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListPodSandboxStatsRequest.Merge(m, src) +} +func (m *ListPodSandboxStatsRequest) XXX_Size() int { + return m.Size() +} +func (m *ListPodSandboxStatsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListPodSandboxStatsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListPodSandboxStatsRequest proto.InternalMessageInfo + +func (m *ListPodSandboxStatsRequest) GetFilter() *PodSandboxStatsFilter { + if m != nil { + return m.Filter + } + return nil +} + +type ListPodSandboxStatsResponse struct { + // Stats of the pod sandbox. + Stats []*PodSandboxStats `protobuf:"bytes,1,rep,name=stats,proto3" json:"stats,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListPodSandboxStatsResponse) Reset() { *m = ListPodSandboxStatsResponse{} } +func (*ListPodSandboxStatsResponse) ProtoMessage() {} +func (*ListPodSandboxStatsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{34} +} +func (m *ListPodSandboxStatsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListPodSandboxStatsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListPodSandboxStatsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ListPodSandboxStatsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListPodSandboxStatsResponse.Merge(m, src) +} +func (m *ListPodSandboxStatsResponse) XXX_Size() int { + return m.Size() +} +func (m *ListPodSandboxStatsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ListPodSandboxStatsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ListPodSandboxStatsResponse proto.InternalMessageInfo + +func (m *ListPodSandboxStatsResponse) GetStats() []*PodSandboxStats { + if m != nil { + return m.Stats + } + return nil +} + +// PodSandboxAttributes provides basic information of the pod sandbox. +type PodSandboxAttributes struct { + // ID of the pod sandbox. + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Metadata of the pod sandbox. + Metadata *PodSandboxMetadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` + // Key-value pairs that may be used to scope and select individual resources. + Labels map[string]string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Unstructured key-value map holding arbitrary metadata. + // Annotations MUST NOT be altered by the runtime; the value of this field + // MUST be identical to that of the corresponding PodSandboxStatus used to + // instantiate the PodSandbox this status represents. + Annotations map[string]string `protobuf:"bytes,4,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PodSandboxAttributes) Reset() { *m = PodSandboxAttributes{} } +func (*PodSandboxAttributes) ProtoMessage() {} +func (*PodSandboxAttributes) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{35} +} +func (m *PodSandboxAttributes) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PodSandboxAttributes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PodSandboxAttributes.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PodSandboxAttributes) XXX_Merge(src proto.Message) { + xxx_messageInfo_PodSandboxAttributes.Merge(m, src) +} +func (m *PodSandboxAttributes) XXX_Size() int { + return m.Size() +} +func (m *PodSandboxAttributes) XXX_DiscardUnknown() { + xxx_messageInfo_PodSandboxAttributes.DiscardUnknown(m) +} + +var xxx_messageInfo_PodSandboxAttributes proto.InternalMessageInfo + +func (m *PodSandboxAttributes) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *PodSandboxAttributes) GetMetadata() *PodSandboxMetadata { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *PodSandboxAttributes) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +func (m *PodSandboxAttributes) GetAnnotations() map[string]string { + if m != nil { + return m.Annotations + } + return nil +} + +// PodSandboxStats provides the resource usage statistics for a pod. +// The linux or windows field will be populated depending on the platform. +type PodSandboxStats struct { + // Information of the pod. + Attributes *PodSandboxAttributes `protobuf:"bytes,1,opt,name=attributes,proto3" json:"attributes,omitempty"` + // Stats from linux. + Linux *LinuxPodSandboxStats `protobuf:"bytes,2,opt,name=linux,proto3" json:"linux,omitempty"` + // Stats from windows. + Windows *WindowsPodSandboxStats `protobuf:"bytes,3,opt,name=windows,proto3" json:"windows,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PodSandboxStats) Reset() { *m = PodSandboxStats{} } +func (*PodSandboxStats) ProtoMessage() {} +func (*PodSandboxStats) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{36} +} +func (m *PodSandboxStats) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PodSandboxStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PodSandboxStats.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PodSandboxStats) XXX_Merge(src proto.Message) { + xxx_messageInfo_PodSandboxStats.Merge(m, src) +} +func (m *PodSandboxStats) XXX_Size() int { + return m.Size() +} +func (m *PodSandboxStats) XXX_DiscardUnknown() { + xxx_messageInfo_PodSandboxStats.DiscardUnknown(m) +} + +var xxx_messageInfo_PodSandboxStats proto.InternalMessageInfo + +func (m *PodSandboxStats) GetAttributes() *PodSandboxAttributes { + if m != nil { + return m.Attributes + } + return nil +} + +func (m *PodSandboxStats) GetLinux() *LinuxPodSandboxStats { + if m != nil { + return m.Linux + } + return nil +} + +func (m *PodSandboxStats) GetWindows() *WindowsPodSandboxStats { + if m != nil { + return m.Windows + } + return nil +} + +// LinuxPodSandboxStats provides the resource usage statistics for a pod sandbox on linux. +type LinuxPodSandboxStats struct { + // CPU usage gathered for the pod sandbox. + Cpu *CpuUsage `protobuf:"bytes,1,opt,name=cpu,proto3" json:"cpu,omitempty"` + // Memory usage gathered for the pod sandbox. + Memory *MemoryUsage `protobuf:"bytes,2,opt,name=memory,proto3" json:"memory,omitempty"` + // Network usage gathered for the pod sandbox + Network *NetworkUsage `protobuf:"bytes,3,opt,name=network,proto3" json:"network,omitempty"` + // Stats pertaining to processes in the pod sandbox. + Process *ProcessUsage `protobuf:"bytes,4,opt,name=process,proto3" json:"process,omitempty"` + // Stats of containers in the measured pod sandbox. + Containers []*ContainerStats `protobuf:"bytes,5,rep,name=containers,proto3" json:"containers,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LinuxPodSandboxStats) Reset() { *m = LinuxPodSandboxStats{} } +func (*LinuxPodSandboxStats) ProtoMessage() {} +func (*LinuxPodSandboxStats) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{37} +} +func (m *LinuxPodSandboxStats) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LinuxPodSandboxStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LinuxPodSandboxStats.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LinuxPodSandboxStats) XXX_Merge(src proto.Message) { + xxx_messageInfo_LinuxPodSandboxStats.Merge(m, src) +} +func (m *LinuxPodSandboxStats) XXX_Size() int { + return m.Size() +} +func (m *LinuxPodSandboxStats) XXX_DiscardUnknown() { + xxx_messageInfo_LinuxPodSandboxStats.DiscardUnknown(m) +} + +var xxx_messageInfo_LinuxPodSandboxStats proto.InternalMessageInfo + +func (m *LinuxPodSandboxStats) GetCpu() *CpuUsage { + if m != nil { + return m.Cpu + } + return nil +} + +func (m *LinuxPodSandboxStats) GetMemory() *MemoryUsage { + if m != nil { + return m.Memory + } + return nil +} + +func (m *LinuxPodSandboxStats) GetNetwork() *NetworkUsage { + if m != nil { + return m.Network + } + return nil +} + +func (m *LinuxPodSandboxStats) GetProcess() *ProcessUsage { + if m != nil { + return m.Process + } + return nil +} + +func (m *LinuxPodSandboxStats) GetContainers() []*ContainerStats { + if m != nil { + return m.Containers + } + return nil +} + +// WindowsPodSandboxStats provides the resource usage statistics for a pod sandbox on windows +type WindowsPodSandboxStats struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *WindowsPodSandboxStats) Reset() { *m = WindowsPodSandboxStats{} } +func (*WindowsPodSandboxStats) ProtoMessage() {} +func (*WindowsPodSandboxStats) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{38} +} +func (m *WindowsPodSandboxStats) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WindowsPodSandboxStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WindowsPodSandboxStats.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *WindowsPodSandboxStats) XXX_Merge(src proto.Message) { + xxx_messageInfo_WindowsPodSandboxStats.Merge(m, src) +} +func (m *WindowsPodSandboxStats) XXX_Size() int { + return m.Size() +} +func (m *WindowsPodSandboxStats) XXX_DiscardUnknown() { + xxx_messageInfo_WindowsPodSandboxStats.DiscardUnknown(m) +} + +var xxx_messageInfo_WindowsPodSandboxStats proto.InternalMessageInfo + +// NetworkUsage contains data about network resources. +type NetworkUsage struct { + // The time at which these stats were updated. + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + // Stats for the default network interface. + DefaultInterface *NetworkInterfaceUsage `protobuf:"bytes,2,opt,name=default_interface,json=defaultInterface,proto3" json:"default_interface,omitempty"` + // Stats for all found network interfaces, excluding the default. + Interfaces []*NetworkInterfaceUsage `protobuf:"bytes,3,rep,name=interfaces,proto3" json:"interfaces,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *NetworkUsage) Reset() { *m = NetworkUsage{} } +func (*NetworkUsage) ProtoMessage() {} +func (*NetworkUsage) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{39} +} +func (m *NetworkUsage) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NetworkUsage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NetworkUsage.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *NetworkUsage) XXX_Merge(src proto.Message) { + xxx_messageInfo_NetworkUsage.Merge(m, src) +} +func (m *NetworkUsage) XXX_Size() int { + return m.Size() +} +func (m *NetworkUsage) XXX_DiscardUnknown() { + xxx_messageInfo_NetworkUsage.DiscardUnknown(m) +} + +var xxx_messageInfo_NetworkUsage proto.InternalMessageInfo + +func (m *NetworkUsage) GetTimestamp() int64 { + if m != nil { + return m.Timestamp + } + return 0 +} + +func (m *NetworkUsage) GetDefaultInterface() *NetworkInterfaceUsage { + if m != nil { + return m.DefaultInterface + } + return nil +} + +func (m *NetworkUsage) GetInterfaces() []*NetworkInterfaceUsage { + if m != nil { + return m.Interfaces + } + return nil +} + +// NetworkInterfaceUsage contains resource value data about a network interface. +type NetworkInterfaceUsage struct { + // The name of the network interface. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Cumulative count of bytes received. + RxBytes *UInt64Value `protobuf:"bytes,2,opt,name=rx_bytes,json=rxBytes,proto3" json:"rx_bytes,omitempty"` + // Cumulative count of receive errors encountered. + RxErrors *UInt64Value `protobuf:"bytes,3,opt,name=rx_errors,json=rxErrors,proto3" json:"rx_errors,omitempty"` + // Cumulative count of bytes transmitted. + TxBytes *UInt64Value `protobuf:"bytes,4,opt,name=tx_bytes,json=txBytes,proto3" json:"tx_bytes,omitempty"` + // Cumulative count of transmit errors encountered. + TxErrors *UInt64Value `protobuf:"bytes,5,opt,name=tx_errors,json=txErrors,proto3" json:"tx_errors,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *NetworkInterfaceUsage) Reset() { *m = NetworkInterfaceUsage{} } +func (*NetworkInterfaceUsage) ProtoMessage() {} +func (*NetworkInterfaceUsage) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{40} +} +func (m *NetworkInterfaceUsage) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NetworkInterfaceUsage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NetworkInterfaceUsage.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *NetworkInterfaceUsage) XXX_Merge(src proto.Message) { + xxx_messageInfo_NetworkInterfaceUsage.Merge(m, src) +} +func (m *NetworkInterfaceUsage) XXX_Size() int { + return m.Size() +} +func (m *NetworkInterfaceUsage) XXX_DiscardUnknown() { + xxx_messageInfo_NetworkInterfaceUsage.DiscardUnknown(m) +} + +var xxx_messageInfo_NetworkInterfaceUsage proto.InternalMessageInfo + +func (m *NetworkInterfaceUsage) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *NetworkInterfaceUsage) GetRxBytes() *UInt64Value { + if m != nil { + return m.RxBytes + } + return nil +} + +func (m *NetworkInterfaceUsage) GetRxErrors() *UInt64Value { + if m != nil { + return m.RxErrors + } + return nil +} + +func (m *NetworkInterfaceUsage) GetTxBytes() *UInt64Value { + if m != nil { + return m.TxBytes + } + return nil +} + +func (m *NetworkInterfaceUsage) GetTxErrors() *UInt64Value { + if m != nil { + return m.TxErrors + } + return nil +} + +// ProcessUsage are stats pertaining to processes. +type ProcessUsage struct { + // The time at which these stats were updated. + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + // Number of processes. + ProcessCount *UInt64Value `protobuf:"bytes,2,opt,name=process_count,json=processCount,proto3" json:"process_count,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ProcessUsage) Reset() { *m = ProcessUsage{} } +func (*ProcessUsage) ProtoMessage() {} +func (*ProcessUsage) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{41} +} +func (m *ProcessUsage) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProcessUsage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProcessUsage.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ProcessUsage) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProcessUsage.Merge(m, src) +} +func (m *ProcessUsage) XXX_Size() int { + return m.Size() +} +func (m *ProcessUsage) XXX_DiscardUnknown() { + xxx_messageInfo_ProcessUsage.DiscardUnknown(m) +} + +var xxx_messageInfo_ProcessUsage proto.InternalMessageInfo + +func (m *ProcessUsage) GetTimestamp() int64 { + if m != nil { + return m.Timestamp + } + return 0 +} + +func (m *ProcessUsage) GetProcessCount() *UInt64Value { + if m != nil { + return m.ProcessCount + } + return nil +} + // ImageSpec is an internal representation of an image. type ImageSpec struct { // Container's Image field (e.g. imageID or imageDigest). @@ -2241,7 +2978,7 @@ type ImageSpec struct { func (m *ImageSpec) Reset() { *m = ImageSpec{} } func (*ImageSpec) ProtoMessage() {} func (*ImageSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{30} + return fileDescriptor_00212fb1f9d3bf1c, []int{42} } func (m *ImageSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2294,7 +3031,7 @@ type KeyValue struct { func (m *KeyValue) Reset() { *m = KeyValue{} } func (*KeyValue) ProtoMessage() {} func (*KeyValue) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{31} + return fileDescriptor_00212fb1f9d3bf1c, []int{43} } func (m *KeyValue) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2357,15 +3094,21 @@ type LinuxContainerResources struct { // CpusetMems constrains the allowed set of memory nodes. Default: "" (not specified). CpusetMems string `protobuf:"bytes,7,opt,name=cpuset_mems,json=cpusetMems,proto3" json:"cpuset_mems,omitempty"` // List of HugepageLimits to limit the HugeTLB usage of container per page size. Default: nil (not specified). - HugepageLimits []*HugepageLimit `protobuf:"bytes,8,rep,name=hugepage_limits,json=hugepageLimits,proto3" json:"hugepage_limits,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_sizecache int32 `json:"-"` + HugepageLimits []*HugepageLimit `protobuf:"bytes,8,rep,name=hugepage_limits,json=hugepageLimits,proto3" json:"hugepage_limits,omitempty"` + // Unified resources for cgroup v2. Default: nil (not specified). + // Each key/value in the map refers to the cgroup v2. + // e.g. "memory.max": "6937202688" or "io.weight": "default 100". + Unified map[string]string `protobuf:"bytes,9,rep,name=unified,proto3" json:"unified,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Memory swap limit in bytes. Default 0 (not specified). + MemorySwapLimitInBytes int64 `protobuf:"varint,10,opt,name=memory_swap_limit_in_bytes,json=memorySwapLimitInBytes,proto3" json:"memory_swap_limit_in_bytes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *LinuxContainerResources) Reset() { *m = LinuxContainerResources{} } func (*LinuxContainerResources) ProtoMessage() {} func (*LinuxContainerResources) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{32} + return fileDescriptor_00212fb1f9d3bf1c, []int{44} } func (m *LinuxContainerResources) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2450,6 +3193,20 @@ func (m *LinuxContainerResources) GetHugepageLimits() []*HugepageLimit { return nil } +func (m *LinuxContainerResources) GetUnified() map[string]string { + if m != nil { + return m.Unified + } + return nil +} + +func (m *LinuxContainerResources) GetMemorySwapLimitInBytes() int64 { + if m != nil { + return m.MemorySwapLimitInBytes + } + return 0 +} + // HugepageLimit corresponds to the file`hugetlb..limit_in_byte` in container level cgroup. // For example, `PageSize=1GB`, `Limit=1073741824` means setting `1073741824` bytes to hugetlb.1GB.limit_in_bytes. type HugepageLimit struct { @@ -2466,7 +3223,7 @@ type HugepageLimit struct { func (m *HugepageLimit) Reset() { *m = HugepageLimit{} } func (*HugepageLimit) ProtoMessage() {} func (*HugepageLimit) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{33} + return fileDescriptor_00212fb1f9d3bf1c, []int{45} } func (m *HugepageLimit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2522,7 +3279,7 @@ type SELinuxOption struct { func (m *SELinuxOption) Reset() { *m = SELinuxOption{} } func (*SELinuxOption) ProtoMessage() {} func (*SELinuxOption) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{34} + return fileDescriptor_00212fb1f9d3bf1c, []int{46} } func (m *SELinuxOption) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2592,7 +3349,7 @@ type Capability struct { func (m *Capability) Reset() { *m = Capability{} } func (*Capability) ProtoMessage() {} func (*Capability) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{35} + return fileDescriptor_00212fb1f9d3bf1c, []int{47} } func (m *Capability) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2712,7 +3469,7 @@ type LinuxContainerSecurityContext struct { func (m *LinuxContainerSecurityContext) Reset() { *m = LinuxContainerSecurityContext{} } func (*LinuxContainerSecurityContext) ProtoMessage() {} func (*LinuxContainerSecurityContext) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{36} + return fileDescriptor_00212fb1f9d3bf1c, []int{48} } func (m *LinuxContainerSecurityContext) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2869,7 +3626,7 @@ type LinuxContainerConfig struct { func (m *LinuxContainerConfig) Reset() { *m = LinuxContainerConfig{} } func (*LinuxContainerConfig) ProtoMessage() {} func (*LinuxContainerConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{37} + return fileDescriptor_00212fb1f9d3bf1c, []int{49} } func (m *LinuxContainerConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2912,6 +3669,123 @@ func (m *LinuxContainerConfig) GetSecurityContext() *LinuxContainerSecurityConte return nil } +// WindowsSandboxSecurityContext holds platform-specific configurations that will be +// applied to a sandbox. +// These settings will only apply to the sandbox container. +type WindowsSandboxSecurityContext struct { + // User name to run the container process as. If specified, the user MUST + // exist in the container image and be resolved there by the runtime; + // otherwise, the runtime MUST return error. + RunAsUsername string `protobuf:"bytes,1,opt,name=run_as_username,json=runAsUsername,proto3" json:"run_as_username,omitempty"` + // The contents of the GMSA credential spec to use to run this container. + CredentialSpec string `protobuf:"bytes,2,opt,name=credential_spec,json=credentialSpec,proto3" json:"credential_spec,omitempty"` + // Indicates whether the container be asked to run as a HostProcess container. + HostProcess bool `protobuf:"varint,3,opt,name=host_process,json=hostProcess,proto3" json:"host_process,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *WindowsSandboxSecurityContext) Reset() { *m = WindowsSandboxSecurityContext{} } +func (*WindowsSandboxSecurityContext) ProtoMessage() {} +func (*WindowsSandboxSecurityContext) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{50} +} +func (m *WindowsSandboxSecurityContext) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WindowsSandboxSecurityContext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WindowsSandboxSecurityContext.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *WindowsSandboxSecurityContext) XXX_Merge(src proto.Message) { + xxx_messageInfo_WindowsSandboxSecurityContext.Merge(m, src) +} +func (m *WindowsSandboxSecurityContext) XXX_Size() int { + return m.Size() +} +func (m *WindowsSandboxSecurityContext) XXX_DiscardUnknown() { + xxx_messageInfo_WindowsSandboxSecurityContext.DiscardUnknown(m) +} + +var xxx_messageInfo_WindowsSandboxSecurityContext proto.InternalMessageInfo + +func (m *WindowsSandboxSecurityContext) GetRunAsUsername() string { + if m != nil { + return m.RunAsUsername + } + return "" +} + +func (m *WindowsSandboxSecurityContext) GetCredentialSpec() string { + if m != nil { + return m.CredentialSpec + } + return "" +} + +func (m *WindowsSandboxSecurityContext) GetHostProcess() bool { + if m != nil { + return m.HostProcess + } + return false +} + +// WindowsPodSandboxConfig holds platform-specific configurations for Windows +// host platforms and Windows-based containers. +type WindowsPodSandboxConfig struct { + // WindowsSandboxSecurityContext holds sandbox security attributes. + SecurityContext *WindowsSandboxSecurityContext `protobuf:"bytes,1,opt,name=security_context,json=securityContext,proto3" json:"security_context,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *WindowsPodSandboxConfig) Reset() { *m = WindowsPodSandboxConfig{} } +func (*WindowsPodSandboxConfig) ProtoMessage() {} +func (*WindowsPodSandboxConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{51} +} +func (m *WindowsPodSandboxConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WindowsPodSandboxConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WindowsPodSandboxConfig.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *WindowsPodSandboxConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_WindowsPodSandboxConfig.Merge(m, src) +} +func (m *WindowsPodSandboxConfig) XXX_Size() int { + return m.Size() +} +func (m *WindowsPodSandboxConfig) XXX_DiscardUnknown() { + xxx_messageInfo_WindowsPodSandboxConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_WindowsPodSandboxConfig proto.InternalMessageInfo + +func (m *WindowsPodSandboxConfig) GetSecurityContext() *WindowsSandboxSecurityContext { + if m != nil { + return m.SecurityContext + } + return nil +} + // WindowsContainerSecurityContext holds windows security configuration that will be applied to a container. type WindowsContainerSecurityContext struct { // User name to run the container process as. If specified, the user MUST @@ -2919,7 +3793,9 @@ type WindowsContainerSecurityContext struct { // otherwise, the runtime MUST return error. RunAsUsername string `protobuf:"bytes,1,opt,name=run_as_username,json=runAsUsername,proto3" json:"run_as_username,omitempty"` // The contents of the GMSA credential spec to use to run this container. - CredentialSpec string `protobuf:"bytes,2,opt,name=credential_spec,json=credentialSpec,proto3" json:"credential_spec,omitempty"` + CredentialSpec string `protobuf:"bytes,2,opt,name=credential_spec,json=credentialSpec,proto3" json:"credential_spec,omitempty"` + // Indicates whether a container is to be run as a HostProcess container. + HostProcess bool `protobuf:"varint,3,opt,name=host_process,json=hostProcess,proto3" json:"host_process,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } @@ -2927,7 +3803,7 @@ type WindowsContainerSecurityContext struct { func (m *WindowsContainerSecurityContext) Reset() { *m = WindowsContainerSecurityContext{} } func (*WindowsContainerSecurityContext) ProtoMessage() {} func (*WindowsContainerSecurityContext) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{38} + return fileDescriptor_00212fb1f9d3bf1c, []int{52} } func (m *WindowsContainerSecurityContext) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2970,6 +3846,13 @@ func (m *WindowsContainerSecurityContext) GetCredentialSpec() string { return "" } +func (m *WindowsContainerSecurityContext) GetHostProcess() bool { + if m != nil { + return m.HostProcess + } + return false +} + // WindowsContainerConfig contains platform-specific configuration for // Windows-based containers. type WindowsContainerConfig struct { @@ -2984,7 +3867,7 @@ type WindowsContainerConfig struct { func (m *WindowsContainerConfig) Reset() { *m = WindowsContainerConfig{} } func (*WindowsContainerConfig) ProtoMessage() {} func (*WindowsContainerConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{39} + return fileDescriptor_00212fb1f9d3bf1c, []int{53} } func (m *WindowsContainerConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3045,7 +3928,7 @@ type WindowsContainerResources struct { func (m *WindowsContainerResources) Reset() { *m = WindowsContainerResources{} } func (*WindowsContainerResources) ProtoMessage() {} func (*WindowsContainerResources) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{40} + return fileDescriptor_00212fb1f9d3bf1c, []int{54} } func (m *WindowsContainerResources) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3119,7 +4002,7 @@ type ContainerMetadata struct { func (m *ContainerMetadata) Reset() { *m = ContainerMetadata{} } func (*ContainerMetadata) ProtoMessage() {} func (*ContainerMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{41} + return fileDescriptor_00212fb1f9d3bf1c, []int{55} } func (m *ContainerMetadata) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3180,7 +4063,7 @@ type Device struct { func (m *Device) Reset() { *m = Device{} } func (*Device) ProtoMessage() {} func (*Device) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{42} + return fileDescriptor_00212fb1f9d3bf1c, []int{56} } func (m *Device) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3299,7 +4182,7 @@ type ContainerConfig struct { func (m *ContainerConfig) Reset() { *m = ContainerConfig{} } func (*ContainerConfig) ProtoMessage() {} func (*ContainerConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{43} + return fileDescriptor_00212fb1f9d3bf1c, []int{57} } func (m *ContainerConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3457,7 +4340,7 @@ type CreateContainerRequest struct { func (m *CreateContainerRequest) Reset() { *m = CreateContainerRequest{} } func (*CreateContainerRequest) ProtoMessage() {} func (*CreateContainerRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{44} + return fileDescriptor_00212fb1f9d3bf1c, []int{58} } func (m *CreateContainerRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3517,7 +4400,7 @@ type CreateContainerResponse struct { func (m *CreateContainerResponse) Reset() { *m = CreateContainerResponse{} } func (*CreateContainerResponse) ProtoMessage() {} func (*CreateContainerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{45} + return fileDescriptor_00212fb1f9d3bf1c, []int{59} } func (m *CreateContainerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3563,7 +4446,7 @@ type StartContainerRequest struct { func (m *StartContainerRequest) Reset() { *m = StartContainerRequest{} } func (*StartContainerRequest) ProtoMessage() {} func (*StartContainerRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{46} + return fileDescriptor_00212fb1f9d3bf1c, []int{60} } func (m *StartContainerRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3607,7 +4490,7 @@ type StartContainerResponse struct { func (m *StartContainerResponse) Reset() { *m = StartContainerResponse{} } func (*StartContainerResponse) ProtoMessage() {} func (*StartContainerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{47} + return fileDescriptor_00212fb1f9d3bf1c, []int{61} } func (m *StartContainerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3649,7 +4532,7 @@ type StopContainerRequest struct { func (m *StopContainerRequest) Reset() { *m = StopContainerRequest{} } func (*StopContainerRequest) ProtoMessage() {} func (*StopContainerRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{48} + return fileDescriptor_00212fb1f9d3bf1c, []int{62} } func (m *StopContainerRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3700,7 +4583,7 @@ type StopContainerResponse struct { func (m *StopContainerResponse) Reset() { *m = StopContainerResponse{} } func (*StopContainerResponse) ProtoMessage() {} func (*StopContainerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{49} + return fileDescriptor_00212fb1f9d3bf1c, []int{63} } func (m *StopContainerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3739,7 +4622,7 @@ type RemoveContainerRequest struct { func (m *RemoveContainerRequest) Reset() { *m = RemoveContainerRequest{} } func (*RemoveContainerRequest) ProtoMessage() {} func (*RemoveContainerRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{50} + return fileDescriptor_00212fb1f9d3bf1c, []int{64} } func (m *RemoveContainerRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3783,7 +4666,7 @@ type RemoveContainerResponse struct { func (m *RemoveContainerResponse) Reset() { *m = RemoveContainerResponse{} } func (*RemoveContainerResponse) ProtoMessage() {} func (*RemoveContainerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{51} + return fileDescriptor_00212fb1f9d3bf1c, []int{65} } func (m *RemoveContainerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3823,7 +4706,7 @@ type ContainerStateValue struct { func (m *ContainerStateValue) Reset() { *m = ContainerStateValue{} } func (*ContainerStateValue) ProtoMessage() {} func (*ContainerStateValue) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{52} + return fileDescriptor_00212fb1f9d3bf1c, []int{66} } func (m *ContainerStateValue) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3879,7 +4762,7 @@ type ContainerFilter struct { func (m *ContainerFilter) Reset() { *m = ContainerFilter{} } func (*ContainerFilter) ProtoMessage() {} func (*ContainerFilter) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{53} + return fileDescriptor_00212fb1f9d3bf1c, []int{67} } func (m *ContainerFilter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3945,7 +4828,7 @@ type ListContainersRequest struct { func (m *ListContainersRequest) Reset() { *m = ListContainersRequest{} } func (*ListContainersRequest) ProtoMessage() {} func (*ListContainersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{54} + return fileDescriptor_00212fb1f9d3bf1c, []int{68} } func (m *ListContainersRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4014,7 +4897,7 @@ type Container struct { func (m *Container) Reset() { *m = Container{} } func (*Container) ProtoMessage() {} func (*Container) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{55} + return fileDescriptor_00212fb1f9d3bf1c, []int{69} } func (m *Container) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4116,7 +4999,7 @@ type ListContainersResponse struct { func (m *ListContainersResponse) Reset() { *m = ListContainersResponse{} } func (*ListContainersResponse) ProtoMessage() {} func (*ListContainersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{56} + return fileDescriptor_00212fb1f9d3bf1c, []int{70} } func (m *ListContainersResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4164,7 +5047,7 @@ type ContainerStatusRequest struct { func (m *ContainerStatusRequest) Reset() { *m = ContainerStatusRequest{} } func (*ContainerStatusRequest) ProtoMessage() {} func (*ContainerStatusRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{57} + return fileDescriptor_00212fb1f9d3bf1c, []int{71} } func (m *ContainerStatusRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4251,7 +5134,7 @@ type ContainerStatus struct { func (m *ContainerStatus) Reset() { *m = ContainerStatus{} } func (*ContainerStatus) ProtoMessage() {} func (*ContainerStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{58} + return fileDescriptor_00212fb1f9d3bf1c, []int{72} } func (m *ContainerStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4400,7 +5283,7 @@ type ContainerStatusResponse struct { func (m *ContainerStatusResponse) Reset() { *m = ContainerStatusResponse{} } func (*ContainerStatusResponse) ProtoMessage() {} func (*ContainerStatusResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{59} + return fileDescriptor_00212fb1f9d3bf1c, []int{73} } func (m *ContainerStatusResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4461,7 +5344,7 @@ type UpdateContainerResourcesRequest struct { func (m *UpdateContainerResourcesRequest) Reset() { *m = UpdateContainerResourcesRequest{} } func (*UpdateContainerResourcesRequest) ProtoMessage() {} func (*UpdateContainerResourcesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{60} + return fileDescriptor_00212fb1f9d3bf1c, []int{74} } func (m *UpdateContainerResourcesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4526,7 +5409,7 @@ type UpdateContainerResourcesResponse struct { func (m *UpdateContainerResourcesResponse) Reset() { *m = UpdateContainerResourcesResponse{} } func (*UpdateContainerResourcesResponse) ProtoMessage() {} func (*UpdateContainerResourcesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{61} + return fileDescriptor_00212fb1f9d3bf1c, []int{75} } func (m *UpdateContainerResourcesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4569,7 +5452,7 @@ type ExecSyncRequest struct { func (m *ExecSyncRequest) Reset() { *m = ExecSyncRequest{} } func (*ExecSyncRequest) ProtoMessage() {} func (*ExecSyncRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{62} + return fileDescriptor_00212fb1f9d3bf1c, []int{76} } func (m *ExecSyncRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4633,7 +5516,7 @@ type ExecSyncResponse struct { func (m *ExecSyncResponse) Reset() { *m = ExecSyncResponse{} } func (*ExecSyncResponse) ProtoMessage() {} func (*ExecSyncResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{63} + return fileDescriptor_00212fb1f9d3bf1c, []int{77} } func (m *ExecSyncResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4709,7 +5592,7 @@ type ExecRequest struct { func (m *ExecRequest) Reset() { *m = ExecRequest{} } func (*ExecRequest) ProtoMessage() {} func (*ExecRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{64} + return fileDescriptor_00212fb1f9d3bf1c, []int{78} } func (m *ExecRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4790,7 +5673,7 @@ type ExecResponse struct { func (m *ExecResponse) Reset() { *m = ExecResponse{} } func (*ExecResponse) ProtoMessage() {} func (*ExecResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{65} + return fileDescriptor_00212fb1f9d3bf1c, []int{79} } func (m *ExecResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4851,7 +5734,7 @@ type AttachRequest struct { func (m *AttachRequest) Reset() { *m = AttachRequest{} } func (*AttachRequest) ProtoMessage() {} func (*AttachRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{66} + return fileDescriptor_00212fb1f9d3bf1c, []int{80} } func (m *AttachRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4925,7 +5808,7 @@ type AttachResponse struct { func (m *AttachResponse) Reset() { *m = AttachResponse{} } func (*AttachResponse) ProtoMessage() {} func (*AttachResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{67} + return fileDescriptor_00212fb1f9d3bf1c, []int{81} } func (m *AttachResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4973,7 +5856,7 @@ type PortForwardRequest struct { func (m *PortForwardRequest) Reset() { *m = PortForwardRequest{} } func (*PortForwardRequest) ProtoMessage() {} func (*PortForwardRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{68} + return fileDescriptor_00212fb1f9d3bf1c, []int{82} } func (m *PortForwardRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5026,7 +5909,7 @@ type PortForwardResponse struct { func (m *PortForwardResponse) Reset() { *m = PortForwardResponse{} } func (*PortForwardResponse) ProtoMessage() {} func (*PortForwardResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{69} + return fileDescriptor_00212fb1f9d3bf1c, []int{83} } func (m *PortForwardResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5072,7 +5955,7 @@ type ImageFilter struct { func (m *ImageFilter) Reset() { *m = ImageFilter{} } func (*ImageFilter) ProtoMessage() {} func (*ImageFilter) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{70} + return fileDescriptor_00212fb1f9d3bf1c, []int{84} } func (m *ImageFilter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5118,7 +6001,7 @@ type ListImagesRequest struct { func (m *ListImagesRequest) Reset() { *m = ListImagesRequest{} } func (*ListImagesRequest) ProtoMessage() {} func (*ListImagesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{71} + return fileDescriptor_00212fb1f9d3bf1c, []int{85} } func (m *ListImagesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5172,15 +6055,19 @@ type Image struct { // and no user is specified when creating container. Username string `protobuf:"bytes,6,opt,name=username,proto3" json:"username,omitempty"` // ImageSpec for image which includes annotations - Spec *ImageSpec `protobuf:"bytes,7,opt,name=spec,proto3" json:"spec,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_sizecache int32 `json:"-"` + Spec *ImageSpec `protobuf:"bytes,7,opt,name=spec,proto3" json:"spec,omitempty"` + // Recommendation on whether this image should be exempt from garbage collection. + // It must only be treated as a recommendation -- the client can still request that the image be deleted, + // and the runtime must oblige. + Pinned bool `protobuf:"varint,8,opt,name=pinned,proto3" json:"pinned,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Image) Reset() { *m = Image{} } func (*Image) ProtoMessage() {} func (*Image) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{72} + return fileDescriptor_00212fb1f9d3bf1c, []int{86} } func (m *Image) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5258,6 +6145,13 @@ func (m *Image) GetSpec() *ImageSpec { return nil } +func (m *Image) GetPinned() bool { + if m != nil { + return m.Pinned + } + return false +} + type ListImagesResponse struct { // List of images. Images []*Image `protobuf:"bytes,1,rep,name=images,proto3" json:"images,omitempty"` @@ -5268,7 +6162,7 @@ type ListImagesResponse struct { func (m *ListImagesResponse) Reset() { *m = ListImagesResponse{} } func (*ListImagesResponse) ProtoMessage() {} func (*ListImagesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{73} + return fileDescriptor_00212fb1f9d3bf1c, []int{87} } func (m *ListImagesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5316,7 +6210,7 @@ type ImageStatusRequest struct { func (m *ImageStatusRequest) Reset() { *m = ImageStatusRequest{} } func (*ImageStatusRequest) ProtoMessage() {} func (*ImageStatusRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{74} + return fileDescriptor_00212fb1f9d3bf1c, []int{88} } func (m *ImageStatusRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5374,7 +6268,7 @@ type ImageStatusResponse struct { func (m *ImageStatusResponse) Reset() { *m = ImageStatusResponse{} } func (*ImageStatusResponse) ProtoMessage() {} func (*ImageStatusResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{75} + return fileDescriptor_00212fb1f9d3bf1c, []int{89} } func (m *ImageStatusResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5435,7 +6329,7 @@ type AuthConfig struct { func (m *AuthConfig) Reset() { *m = AuthConfig{} } func (*AuthConfig) ProtoMessage() {} func (*AuthConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{76} + return fileDescriptor_00212fb1f9d3bf1c, []int{90} } func (m *AuthConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5520,7 +6414,7 @@ type PullImageRequest struct { func (m *PullImageRequest) Reset() { *m = PullImageRequest{} } func (*PullImageRequest) ProtoMessage() {} func (*PullImageRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{77} + return fileDescriptor_00212fb1f9d3bf1c, []int{91} } func (m *PullImageRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5581,7 +6475,7 @@ type PullImageResponse struct { func (m *PullImageResponse) Reset() { *m = PullImageResponse{} } func (*PullImageResponse) ProtoMessage() {} func (*PullImageResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{78} + return fileDescriptor_00212fb1f9d3bf1c, []int{92} } func (m *PullImageResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5627,7 +6521,7 @@ type RemoveImageRequest struct { func (m *RemoveImageRequest) Reset() { *m = RemoveImageRequest{} } func (*RemoveImageRequest) ProtoMessage() {} func (*RemoveImageRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{79} + return fileDescriptor_00212fb1f9d3bf1c, []int{93} } func (m *RemoveImageRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5671,7 +6565,7 @@ type RemoveImageResponse struct { func (m *RemoveImageResponse) Reset() { *m = RemoveImageResponse{} } func (*RemoveImageResponse) ProtoMessage() {} func (*RemoveImageResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{80} + return fileDescriptor_00212fb1f9d3bf1c, []int{94} } func (m *RemoveImageResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5711,7 +6605,7 @@ type NetworkConfig struct { func (m *NetworkConfig) Reset() { *m = NetworkConfig{} } func (*NetworkConfig) ProtoMessage() {} func (*NetworkConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{81} + return fileDescriptor_00212fb1f9d3bf1c, []int{95} } func (m *NetworkConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5756,7 +6650,7 @@ type RuntimeConfig struct { func (m *RuntimeConfig) Reset() { *m = RuntimeConfig{} } func (*RuntimeConfig) ProtoMessage() {} func (*RuntimeConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{82} + return fileDescriptor_00212fb1f9d3bf1c, []int{96} } func (m *RuntimeConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5801,7 +6695,7 @@ type UpdateRuntimeConfigRequest struct { func (m *UpdateRuntimeConfigRequest) Reset() { *m = UpdateRuntimeConfigRequest{} } func (*UpdateRuntimeConfigRequest) ProtoMessage() {} func (*UpdateRuntimeConfigRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{83} + return fileDescriptor_00212fb1f9d3bf1c, []int{97} } func (m *UpdateRuntimeConfigRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5845,7 +6739,7 @@ type UpdateRuntimeConfigResponse struct { func (m *UpdateRuntimeConfigResponse) Reset() { *m = UpdateRuntimeConfigResponse{} } func (*UpdateRuntimeConfigResponse) ProtoMessage() {} func (*UpdateRuntimeConfigResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{84} + return fileDescriptor_00212fb1f9d3bf1c, []int{98} } func (m *UpdateRuntimeConfigResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5903,7 +6797,7 @@ type RuntimeCondition struct { func (m *RuntimeCondition) Reset() { *m = RuntimeCondition{} } func (*RuntimeCondition) ProtoMessage() {} func (*RuntimeCondition) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{85} + return fileDescriptor_00212fb1f9d3bf1c, []int{99} } func (m *RuntimeCondition) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5971,7 +6865,7 @@ type RuntimeStatus struct { func (m *RuntimeStatus) Reset() { *m = RuntimeStatus{} } func (*RuntimeStatus) ProtoMessage() {} func (*RuntimeStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{86} + return fileDescriptor_00212fb1f9d3bf1c, []int{100} } func (m *RuntimeStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6017,7 +6911,7 @@ type StatusRequest struct { func (m *StatusRequest) Reset() { *m = StatusRequest{} } func (*StatusRequest) ProtoMessage() {} func (*StatusRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{87} + return fileDescriptor_00212fb1f9d3bf1c, []int{101} } func (m *StatusRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6068,7 +6962,7 @@ type StatusResponse struct { func (m *StatusResponse) Reset() { *m = StatusResponse{} } func (*StatusResponse) ProtoMessage() {} func (*StatusResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{88} + return fileDescriptor_00212fb1f9d3bf1c, []int{102} } func (m *StatusResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6119,7 +7013,7 @@ type ImageFsInfoRequest struct { func (m *ImageFsInfoRequest) Reset() { *m = ImageFsInfoRequest{} } func (*ImageFsInfoRequest) ProtoMessage() {} func (*ImageFsInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{89} + return fileDescriptor_00212fb1f9d3bf1c, []int{103} } func (m *ImageFsInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6159,7 +7053,7 @@ type UInt64Value struct { func (m *UInt64Value) Reset() { *m = UInt64Value{} } func (*UInt64Value) ProtoMessage() {} func (*UInt64Value) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{90} + return fileDescriptor_00212fb1f9d3bf1c, []int{104} } func (m *UInt64Value) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6206,7 +7100,7 @@ type FilesystemIdentifier struct { func (m *FilesystemIdentifier) Reset() { *m = FilesystemIdentifier{} } func (*FilesystemIdentifier) ProtoMessage() {} func (*FilesystemIdentifier) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{91} + return fileDescriptor_00212fb1f9d3bf1c, []int{105} } func (m *FilesystemIdentifier) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6263,7 +7157,7 @@ type FilesystemUsage struct { func (m *FilesystemUsage) Reset() { *m = FilesystemUsage{} } func (*FilesystemUsage) ProtoMessage() {} func (*FilesystemUsage) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{92} + return fileDescriptor_00212fb1f9d3bf1c, []int{106} } func (m *FilesystemUsage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6330,7 +7224,7 @@ type ImageFsInfoResponse struct { func (m *ImageFsInfoResponse) Reset() { *m = ImageFsInfoResponse{} } func (*ImageFsInfoResponse) ProtoMessage() {} func (*ImageFsInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{93} + return fileDescriptor_00212fb1f9d3bf1c, []int{107} } func (m *ImageFsInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6376,7 +7270,7 @@ type ContainerStatsRequest struct { func (m *ContainerStatsRequest) Reset() { *m = ContainerStatsRequest{} } func (*ContainerStatsRequest) ProtoMessage() {} func (*ContainerStatsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{94} + return fileDescriptor_00212fb1f9d3bf1c, []int{108} } func (m *ContainerStatsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6422,7 +7316,7 @@ type ContainerStatsResponse struct { func (m *ContainerStatsResponse) Reset() { *m = ContainerStatsResponse{} } func (*ContainerStatsResponse) ProtoMessage() {} func (*ContainerStatsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{95} + return fileDescriptor_00212fb1f9d3bf1c, []int{109} } func (m *ContainerStatsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6468,7 +7362,7 @@ type ListContainerStatsRequest struct { func (m *ListContainerStatsRequest) Reset() { *m = ListContainerStatsRequest{} } func (*ListContainerStatsRequest) ProtoMessage() {} func (*ListContainerStatsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{96} + return fileDescriptor_00212fb1f9d3bf1c, []int{110} } func (m *ListContainerStatsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6522,7 +7416,7 @@ type ContainerStatsFilter struct { func (m *ContainerStatsFilter) Reset() { *m = ContainerStatsFilter{} } func (*ContainerStatsFilter) ProtoMessage() {} func (*ContainerStatsFilter) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{97} + return fileDescriptor_00212fb1f9d3bf1c, []int{111} } func (m *ContainerStatsFilter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6582,7 +7476,7 @@ type ListContainerStatsResponse struct { func (m *ListContainerStatsResponse) Reset() { *m = ListContainerStatsResponse{} } func (*ListContainerStatsResponse) ProtoMessage() {} func (*ListContainerStatsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{98} + return fileDescriptor_00212fb1f9d3bf1c, []int{112} } func (m *ListContainerStatsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6638,7 +7532,7 @@ type ContainerAttributes struct { func (m *ContainerAttributes) Reset() { *m = ContainerAttributes{} } func (*ContainerAttributes) ProtoMessage() {} func (*ContainerAttributes) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{99} + return fileDescriptor_00212fb1f9d3bf1c, []int{113} } func (m *ContainerAttributes) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6712,7 +7606,7 @@ type ContainerStats struct { func (m *ContainerStats) Reset() { *m = ContainerStats{} } func (*ContainerStats) ProtoMessage() {} func (*ContainerStats) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{100} + return fileDescriptor_00212fb1f9d3bf1c, []int{114} } func (m *ContainerStats) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6775,6 +7669,9 @@ type CpuUsage struct { Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Cumulative CPU usage (sum across all cores) since object creation. UsageCoreNanoSeconds *UInt64Value `protobuf:"bytes,2,opt,name=usage_core_nano_seconds,json=usageCoreNanoSeconds,proto3" json:"usage_core_nano_seconds,omitempty"` + // Total CPU usage (sum of all cores) averaged over the sample window. + // The "core" unit can be interpreted as CPU core-nanoseconds per second. + UsageNanoCores *UInt64Value `protobuf:"bytes,3,opt,name=usage_nano_cores,json=usageNanoCores,proto3" json:"usage_nano_cores,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } @@ -6782,7 +7679,7 @@ type CpuUsage struct { func (m *CpuUsage) Reset() { *m = CpuUsage{} } func (*CpuUsage) ProtoMessage() {} func (*CpuUsage) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{101} + return fileDescriptor_00212fb1f9d3bf1c, []int{115} } func (m *CpuUsage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6825,12 +7722,29 @@ func (m *CpuUsage) GetUsageCoreNanoSeconds() *UInt64Value { return nil } +func (m *CpuUsage) GetUsageNanoCores() *UInt64Value { + if m != nil { + return m.UsageNanoCores + } + return nil +} + // MemoryUsage provides the memory usage information. type MemoryUsage struct { // Timestamp in nanoseconds at which the information were collected. Must be > 0. Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // The amount of working set memory in bytes. - WorkingSetBytes *UInt64Value `protobuf:"bytes,2,opt,name=working_set_bytes,json=workingSetBytes,proto3" json:"working_set_bytes,omitempty"` + WorkingSetBytes *UInt64Value `protobuf:"bytes,2,opt,name=working_set_bytes,json=workingSetBytes,proto3" json:"working_set_bytes,omitempty"` + // Available memory for use. This is defined as the memory limit = workingSetBytes. + AvailableBytes *UInt64Value `protobuf:"bytes,3,opt,name=available_bytes,json=availableBytes,proto3" json:"available_bytes,omitempty"` + // Total memory in use. This includes all memory regardless of when it was accessed. + UsageBytes *UInt64Value `protobuf:"bytes,4,opt,name=usage_bytes,json=usageBytes,proto3" json:"usage_bytes,omitempty"` + // The amount of anonymous and swap cache memory (includes transparent hugepages). + RssBytes *UInt64Value `protobuf:"bytes,5,opt,name=rss_bytes,json=rssBytes,proto3" json:"rss_bytes,omitempty"` + // Cumulative number of minor page faults. + PageFaults *UInt64Value `protobuf:"bytes,6,opt,name=page_faults,json=pageFaults,proto3" json:"page_faults,omitempty"` + // Cumulative number of major page faults. + MajorPageFaults *UInt64Value `protobuf:"bytes,7,opt,name=major_page_faults,json=majorPageFaults,proto3" json:"major_page_faults,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } @@ -6838,7 +7752,7 @@ type MemoryUsage struct { func (m *MemoryUsage) Reset() { *m = MemoryUsage{} } func (*MemoryUsage) ProtoMessage() {} func (*MemoryUsage) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{102} + return fileDescriptor_00212fb1f9d3bf1c, []int{116} } func (m *MemoryUsage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6881,6 +7795,41 @@ func (m *MemoryUsage) GetWorkingSetBytes() *UInt64Value { return nil } +func (m *MemoryUsage) GetAvailableBytes() *UInt64Value { + if m != nil { + return m.AvailableBytes + } + return nil +} + +func (m *MemoryUsage) GetUsageBytes() *UInt64Value { + if m != nil { + return m.UsageBytes + } + return nil +} + +func (m *MemoryUsage) GetRssBytes() *UInt64Value { + if m != nil { + return m.RssBytes + } + return nil +} + +func (m *MemoryUsage) GetPageFaults() *UInt64Value { + if m != nil { + return m.PageFaults + } + return nil +} + +func (m *MemoryUsage) GetMajorPageFaults() *UInt64Value { + if m != nil { + return m.MajorPageFaults + } + return nil +} + type ReopenContainerLogRequest struct { // ID of the container for which to reopen the log. ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` @@ -6891,7 +7840,7 @@ type ReopenContainerLogRequest struct { func (m *ReopenContainerLogRequest) Reset() { *m = ReopenContainerLogRequest{} } func (*ReopenContainerLogRequest) ProtoMessage() {} func (*ReopenContainerLogRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{103} + return fileDescriptor_00212fb1f9d3bf1c, []int{117} } func (m *ReopenContainerLogRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -6935,7 +7884,7 @@ type ReopenContainerLogResponse struct { func (m *ReopenContainerLogResponse) Reset() { *m = ReopenContainerLogResponse{} } func (*ReopenContainerLogResponse) ProtoMessage() {} func (*ReopenContainerLogResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{104} + return fileDescriptor_00212fb1f9d3bf1c, []int{118} } func (m *ReopenContainerLogResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -7010,15 +7959,33 @@ func init() { proto.RegisterMapType((map[string]string)(nil), "runtime.v1alpha2.PodSandbox.AnnotationsEntry") proto.RegisterMapType((map[string]string)(nil), "runtime.v1alpha2.PodSandbox.LabelsEntry") proto.RegisterType((*ListPodSandboxResponse)(nil), "runtime.v1alpha2.ListPodSandboxResponse") + proto.RegisterType((*PodSandboxStatsRequest)(nil), "runtime.v1alpha2.PodSandboxStatsRequest") + proto.RegisterType((*PodSandboxStatsResponse)(nil), "runtime.v1alpha2.PodSandboxStatsResponse") + proto.RegisterType((*PodSandboxStatsFilter)(nil), "runtime.v1alpha2.PodSandboxStatsFilter") + proto.RegisterMapType((map[string]string)(nil), "runtime.v1alpha2.PodSandboxStatsFilter.LabelSelectorEntry") + proto.RegisterType((*ListPodSandboxStatsRequest)(nil), "runtime.v1alpha2.ListPodSandboxStatsRequest") + proto.RegisterType((*ListPodSandboxStatsResponse)(nil), "runtime.v1alpha2.ListPodSandboxStatsResponse") + proto.RegisterType((*PodSandboxAttributes)(nil), "runtime.v1alpha2.PodSandboxAttributes") + proto.RegisterMapType((map[string]string)(nil), "runtime.v1alpha2.PodSandboxAttributes.AnnotationsEntry") + proto.RegisterMapType((map[string]string)(nil), "runtime.v1alpha2.PodSandboxAttributes.LabelsEntry") + proto.RegisterType((*PodSandboxStats)(nil), "runtime.v1alpha2.PodSandboxStats") + proto.RegisterType((*LinuxPodSandboxStats)(nil), "runtime.v1alpha2.LinuxPodSandboxStats") + proto.RegisterType((*WindowsPodSandboxStats)(nil), "runtime.v1alpha2.WindowsPodSandboxStats") + proto.RegisterType((*NetworkUsage)(nil), "runtime.v1alpha2.NetworkUsage") + proto.RegisterType((*NetworkInterfaceUsage)(nil), "runtime.v1alpha2.NetworkInterfaceUsage") + proto.RegisterType((*ProcessUsage)(nil), "runtime.v1alpha2.ProcessUsage") proto.RegisterType((*ImageSpec)(nil), "runtime.v1alpha2.ImageSpec") proto.RegisterMapType((map[string]string)(nil), "runtime.v1alpha2.ImageSpec.AnnotationsEntry") proto.RegisterType((*KeyValue)(nil), "runtime.v1alpha2.KeyValue") proto.RegisterType((*LinuxContainerResources)(nil), "runtime.v1alpha2.LinuxContainerResources") + proto.RegisterMapType((map[string]string)(nil), "runtime.v1alpha2.LinuxContainerResources.UnifiedEntry") proto.RegisterType((*HugepageLimit)(nil), "runtime.v1alpha2.HugepageLimit") proto.RegisterType((*SELinuxOption)(nil), "runtime.v1alpha2.SELinuxOption") proto.RegisterType((*Capability)(nil), "runtime.v1alpha2.Capability") proto.RegisterType((*LinuxContainerSecurityContext)(nil), "runtime.v1alpha2.LinuxContainerSecurityContext") proto.RegisterType((*LinuxContainerConfig)(nil), "runtime.v1alpha2.LinuxContainerConfig") + proto.RegisterType((*WindowsSandboxSecurityContext)(nil), "runtime.v1alpha2.WindowsSandboxSecurityContext") + proto.RegisterType((*WindowsPodSandboxConfig)(nil), "runtime.v1alpha2.WindowsPodSandboxConfig") proto.RegisterType((*WindowsContainerSecurityContext)(nil), "runtime.v1alpha2.WindowsContainerSecurityContext") proto.RegisterType((*WindowsContainerConfig)(nil), "runtime.v1alpha2.WindowsContainerConfig") proto.RegisterType((*WindowsContainerResources)(nil), "runtime.v1alpha2.WindowsContainerResources") @@ -7105,322 +8072,360 @@ func init() { func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } var fileDescriptor_00212fb1f9d3bf1c = []byte{ - // 5033 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x7c, 0x4d, 0x6c, 0x1b, 0x49, - 0x76, 0xbf, 0x9a, 0xa4, 0x24, 0xf2, 0x51, 0xa4, 0xa8, 0xb2, 0x6c, 0xd1, 0xf4, 0xd8, 0x63, 0xb7, - 0xc7, 0x9f, 0x33, 0x96, 0xd7, 0x9a, 0x59, 0xcf, 0xdf, 0xf6, 0x8c, 0x6d, 0x5a, 0x92, 0x6d, 0xfe, - 0xd7, 0xa6, 0x98, 0xa6, 0x34, 0x1f, 0x3b, 0x03, 0xf4, 0xb6, 0xd8, 0x25, 0xaa, 0xd7, 0x64, 0x77, - 0x4f, 0x77, 0xd3, 0xb6, 0x36, 0x40, 0xb0, 0xc0, 0x02, 0x7b, 0xc8, 0x29, 0xe7, 0x1c, 0x37, 0x87, - 0x1c, 0x72, 0xca, 0x21, 0xa7, 0x9c, 0x36, 0xc8, 0x61, 0x11, 0x20, 0x48, 0x4e, 0x9b, 0x04, 0xb9, - 0x64, 0x26, 0x08, 0xb0, 0x08, 0x90, 0x20, 0xc8, 0x39, 0x87, 0xa0, 0xbe, 0xfa, 0xbb, 0xf9, 0x61, - 0x7b, 0x76, 0x36, 0x27, 0xb1, 0x5e, 0xbf, 0xf7, 0xea, 0xf5, 0xab, 0x57, 0xaf, 0x5e, 0xfd, 0xaa, - 0x5a, 0x50, 0xd2, 0x6c, 0x63, 0xdd, 0x76, 0x2c, 0xcf, 0x42, 0x35, 0x67, 0x64, 0x7a, 0xc6, 0x10, - 0xaf, 0x3f, 0xbf, 0xa1, 0x0d, 0xec, 0x43, 0x6d, 0xa3, 0x71, 0xad, 0x6f, 0x78, 0x87, 0xa3, 0xfd, - 0xf5, 0x9e, 0x35, 0xbc, 0xde, 0xb7, 0xfa, 0xd6, 0x75, 0xca, 0xb8, 0x3f, 0x3a, 0xa0, 0x2d, 0xda, - 0xa0, 0xbf, 0x98, 0x02, 0xf9, 0x2a, 0x54, 0x3f, 0xc1, 0x8e, 0x6b, 0x58, 0xa6, 0x82, 0xbf, 0x1a, - 0x61, 0xd7, 0x43, 0x75, 0x58, 0x7c, 0xce, 0x28, 0x75, 0xe9, 0xac, 0x74, 0xb9, 0xa4, 0x88, 0xa6, - 0xfc, 0xa7, 0x12, 0x2c, 0xfb, 0xcc, 0xae, 0x6d, 0x99, 0x2e, 0xce, 0xe6, 0x46, 0xe7, 0x60, 0x89, - 0x1b, 0xa7, 0x9a, 0xda, 0x10, 0xd7, 0x73, 0xf4, 0x71, 0x99, 0xd3, 0xda, 0xda, 0x10, 0xa3, 0x4b, - 0xb0, 0x2c, 0x58, 0x84, 0x92, 0x3c, 0xe5, 0xaa, 0x72, 0x32, 0xef, 0x0d, 0xad, 0xc3, 0x31, 0xc1, - 0xa8, 0xd9, 0x86, 0xcf, 0x5c, 0xa0, 0xcc, 0x2b, 0xfc, 0x51, 0xd3, 0x36, 0x38, 0xbf, 0xfc, 0x05, - 0x94, 0xb6, 0xda, 0xdd, 0x4d, 0xcb, 0x3c, 0x30, 0xfa, 0xc4, 0x44, 0x17, 0x3b, 0x44, 0xa6, 0x2e, - 0x9d, 0xcd, 0x13, 0x13, 0x79, 0x13, 0x35, 0xa0, 0xe8, 0x62, 0xcd, 0xe9, 0x1d, 0x62, 0xb7, 0x9e, - 0xa3, 0x8f, 0xfc, 0x36, 0x91, 0xb2, 0x6c, 0xcf, 0xb0, 0x4c, 0xb7, 0x9e, 0x67, 0x52, 0xbc, 0x29, - 0xff, 0x42, 0x82, 0x72, 0xc7, 0x72, 0xbc, 0xa7, 0x9a, 0x6d, 0x1b, 0x66, 0x1f, 0xdd, 0x84, 0x22, - 0xf5, 0x65, 0xcf, 0x1a, 0x50, 0x1f, 0x54, 0x37, 0x1a, 0xeb, 0xf1, 0x61, 0x59, 0xef, 0x70, 0x0e, - 0xc5, 0xe7, 0x45, 0x17, 0xa0, 0xda, 0xb3, 0x4c, 0x4f, 0x33, 0x4c, 0xec, 0xa8, 0xb6, 0xe5, 0x78, - 0xd4, 0x45, 0xf3, 0x4a, 0xc5, 0xa7, 0x92, 0x5e, 0xd0, 0x29, 0x28, 0x1d, 0x5a, 0xae, 0xc7, 0x38, - 0xf2, 0x94, 0xa3, 0x48, 0x08, 0xf4, 0xe1, 0x1a, 0x2c, 0xd2, 0x87, 0x86, 0xcd, 0x9d, 0xb1, 0x40, - 0x9a, 0x2d, 0x5b, 0xfe, 0xb5, 0x04, 0xf3, 0x4f, 0xad, 0x91, 0xe9, 0xc5, 0xba, 0xd1, 0xbc, 0x43, - 0x3e, 0x50, 0xa1, 0x6e, 0x34, 0xef, 0x30, 0xe8, 0x86, 0x70, 0xb0, 0xb1, 0x62, 0xdd, 0x90, 0x87, - 0x0d, 0x28, 0x3a, 0x58, 0xd3, 0x2d, 0x73, 0x70, 0x44, 0x4d, 0x28, 0x2a, 0x7e, 0x9b, 0x0c, 0xa2, - 0x8b, 0x07, 0x86, 0x39, 0x7a, 0xa9, 0x3a, 0x78, 0xa0, 0xed, 0xe3, 0x01, 0x35, 0xa5, 0xa8, 0x54, - 0x39, 0x59, 0x61, 0x54, 0xb4, 0x05, 0x65, 0xdb, 0xb1, 0x6c, 0xad, 0xaf, 0x11, 0x3f, 0xd6, 0xe7, - 0xa9, 0xab, 0xe4, 0xa4, 0xab, 0xa8, 0xd9, 0x9d, 0x80, 0x53, 0x09, 0x8b, 0xc9, 0x7f, 0x27, 0xc1, - 0x32, 0x09, 0x1e, 0xd7, 0xd6, 0x7a, 0x78, 0x87, 0x0e, 0x09, 0xba, 0x05, 0x8b, 0x26, 0xf6, 0x5e, - 0x58, 0xce, 0x33, 0x3e, 0x00, 0x6f, 0x27, 0xb5, 0xfa, 0x32, 0x4f, 0x2d, 0x1d, 0x2b, 0x82, 0x1f, - 0xdd, 0x80, 0xbc, 0x6d, 0xe8, 0xf4, 0x85, 0xa7, 0x10, 0x23, 0xbc, 0x44, 0xc4, 0xb0, 0x7b, 0xd4, - 0x0f, 0xd3, 0x88, 0x18, 0x76, 0x8f, 0x38, 0xd7, 0xd3, 0x9c, 0x3e, 0xf6, 0x54, 0x43, 0xe7, 0x03, - 0x55, 0x64, 0x84, 0x96, 0x2e, 0xcb, 0x00, 0x2d, 0xd3, 0xbb, 0xf9, 0xc1, 0x27, 0xda, 0x60, 0x84, - 0xd1, 0x2a, 0xcc, 0x3f, 0x27, 0x3f, 0xe8, 0x9b, 0xe4, 0x15, 0xd6, 0x90, 0xbf, 0x2e, 0xc0, 0xa9, - 0x27, 0xc4, 0x99, 0x5d, 0xcd, 0xd4, 0xf7, 0xad, 0x97, 0x5d, 0xdc, 0x1b, 0x39, 0x86, 0x77, 0xb4, - 0x69, 0x99, 0x1e, 0x7e, 0xe9, 0xa1, 0x36, 0xac, 0x98, 0xa2, 0x5b, 0x55, 0xc4, 0x2d, 0xd1, 0x50, - 0xde, 0x38, 0x37, 0xc6, 0x42, 0xe6, 0x3f, 0xa5, 0x66, 0x46, 0x09, 0x2e, 0x7a, 0x1c, 0x0c, 0xaa, - 0xd0, 0x96, 0xa3, 0xda, 0x52, 0xde, 0xb7, 0xbb, 0x4d, 0x2d, 0xe3, 0xba, 0xc4, 0xa8, 0x0b, 0x4d, - 0x1f, 0x01, 0x99, 0xf2, 0xaa, 0xe6, 0xaa, 0x23, 0x17, 0x3b, 0xd4, 0x6b, 0xe5, 0x8d, 0xb7, 0x92, - 0x5a, 0x02, 0x17, 0x28, 0x25, 0x67, 0x64, 0x36, 0xdd, 0x3d, 0x17, 0x3b, 0xe8, 0x2e, 0x4d, 0x22, - 0x44, 0xba, 0xef, 0x58, 0x23, 0xbb, 0x5e, 0x9c, 0x42, 0x1c, 0xa8, 0xf8, 0x23, 0xc2, 0x4f, 0x33, - 0x0c, 0x0f, 0x54, 0xd5, 0xb1, 0x2c, 0xef, 0xc0, 0x15, 0xc1, 0x29, 0xc8, 0x0a, 0xa5, 0xa2, 0xeb, - 0x70, 0xcc, 0x1d, 0xd9, 0xf6, 0x00, 0x0f, 0xb1, 0xe9, 0x69, 0x03, 0xd6, 0x9d, 0x5b, 0x9f, 0x3f, - 0x9b, 0xbf, 0x9c, 0x57, 0x50, 0xf8, 0x11, 0x55, 0xec, 0xa2, 0x33, 0x00, 0xb6, 0x63, 0x3c, 0x37, - 0x06, 0xb8, 0x8f, 0xf5, 0xfa, 0x02, 0x55, 0x1a, 0xa2, 0xa0, 0x3b, 0x24, 0xeb, 0xf4, 0x7a, 0xd6, - 0xd0, 0xae, 0x97, 0xb2, 0xc6, 0x41, 0x8c, 0x62, 0xc7, 0xb1, 0x0e, 0x8c, 0x01, 0x56, 0x84, 0x04, - 0xfa, 0x18, 0x8a, 0x9a, 0x6d, 0x6b, 0xce, 0xd0, 0x72, 0xea, 0x30, 0xad, 0xb4, 0x2f, 0x82, 0x3e, - 0x80, 0x55, 0xae, 0x49, 0xb5, 0xd9, 0x43, 0x36, 0xad, 0x17, 0x49, 0xe4, 0x3d, 0xc8, 0xd5, 0x25, - 0x05, 0xf1, 0xe7, 0x5c, 0x96, 0x4c, 0x72, 0xf9, 0x6f, 0x24, 0x58, 0x8e, 0xe9, 0x44, 0x1d, 0x58, - 0x12, 0x1a, 0xbc, 0x23, 0x1b, 0xf3, 0xe9, 0x75, 0x6d, 0xa2, 0x31, 0xeb, 0xfc, 0xef, 0xee, 0x91, - 0x8d, 0xe9, 0xfc, 0x15, 0x0d, 0x74, 0x1e, 0x2a, 0x03, 0xab, 0xa7, 0x0d, 0x68, 0xb2, 0x71, 0xf0, - 0x01, 0xcf, 0x35, 0x4b, 0x3e, 0x51, 0xc1, 0x07, 0xf2, 0x7d, 0x28, 0x87, 0x14, 0x20, 0x04, 0x55, - 0x85, 0x75, 0xb8, 0x85, 0x0f, 0xb4, 0xd1, 0xc0, 0xab, 0xcd, 0xa1, 0x2a, 0xc0, 0x9e, 0xd9, 0x23, - 0x19, 0xde, 0xc4, 0x7a, 0x4d, 0x42, 0x15, 0x28, 0x3d, 0x11, 0x2a, 0x6a, 0x39, 0xf9, 0x17, 0x39, - 0x38, 0x4e, 0xc3, 0xb2, 0x63, 0xe9, 0x7c, 0xce, 0xf0, 0xe5, 0xe0, 0x3c, 0x54, 0x7a, 0x74, 0x74, - 0x55, 0x5b, 0x73, 0xb0, 0xe9, 0xf1, 0x74, 0xb8, 0xc4, 0x88, 0x1d, 0x4a, 0x43, 0x9f, 0x41, 0xcd, - 0xe5, 0x6f, 0xa4, 0xf6, 0xd8, 0x1c, 0xe3, 0x13, 0x20, 0xe5, 0xdd, 0xc7, 0x4c, 0x4c, 0x65, 0xd9, - 0x4d, 0xcc, 0xd4, 0x45, 0xf7, 0xc8, 0xed, 0x79, 0x03, 0xb6, 0xae, 0x94, 0x37, 0x3e, 0xc8, 0x50, - 0x18, 0x37, 0x7c, 0xbd, 0xcb, 0xc4, 0xb6, 0x4d, 0xcf, 0x39, 0x52, 0x84, 0x92, 0xc6, 0x6d, 0x58, - 0x0a, 0x3f, 0x40, 0x35, 0xc8, 0x3f, 0xc3, 0x47, 0xfc, 0xa5, 0xc8, 0xcf, 0x20, 0xa3, 0x30, 0x4f, - 0xb3, 0xc6, 0xed, 0xdc, 0xff, 0x93, 0x64, 0x07, 0x50, 0xd0, 0xcb, 0x53, 0xec, 0x69, 0xba, 0xe6, - 0x69, 0x08, 0x41, 0x81, 0x2e, 0xd8, 0x4c, 0x05, 0xfd, 0x4d, 0xb4, 0x8e, 0x78, 0x9a, 0x2c, 0x29, - 0xe4, 0x27, 0x7a, 0x0b, 0x4a, 0x7e, 0xd6, 0xe0, 0xab, 0x76, 0x40, 0x20, 0xab, 0xa7, 0xe6, 0x79, - 0x78, 0x68, 0x7b, 0x74, 0xbe, 0x55, 0x14, 0xd1, 0x94, 0xff, 0xb3, 0x00, 0xb5, 0xc4, 0x98, 0xdc, - 0x87, 0xe2, 0x90, 0x77, 0xcf, 0xb3, 0xd6, 0x3b, 0x29, 0x4b, 0x68, 0xc2, 0x54, 0xc5, 0x97, 0x22, - 0x2b, 0x14, 0x19, 0xf9, 0x50, 0xa5, 0xe1, 0xb7, 0x59, 0xc8, 0xf5, 0x55, 0xdd, 0x70, 0x70, 0xcf, - 0xb3, 0x9c, 0x23, 0x6e, 0xee, 0xd2, 0xc0, 0xea, 0x6f, 0x09, 0x1a, 0xba, 0x0d, 0xa0, 0x9b, 0xae, - 0x4a, 0x23, 0xaa, 0x4f, 0x8d, 0x2e, 0x6f, 0x9c, 0x4a, 0x1a, 0xe1, 0x97, 0x15, 0x4a, 0x49, 0x37, - 0x5d, 0x6e, 0xfe, 0x03, 0xa8, 0x90, 0xd5, 0x59, 0x1d, 0xb2, 0x8a, 0x80, 0xa5, 0x8d, 0xf2, 0xc6, - 0xe9, 0xb4, 0x77, 0xf0, 0xeb, 0x06, 0x65, 0xc9, 0x0e, 0x1a, 0x2e, 0x7a, 0x08, 0x0b, 0x74, 0x99, - 0x74, 0xeb, 0x0b, 0x54, 0x78, 0x7d, 0x9c, 0x03, 0x78, 0x44, 0x3c, 0xa1, 0x02, 0x2c, 0x20, 0xb8, - 0x34, 0xda, 0x83, 0xb2, 0x66, 0x9a, 0x96, 0xa7, 0xb1, 0xac, 0xbd, 0x48, 0x95, 0xbd, 0x3f, 0x85, - 0xb2, 0x66, 0x20, 0xc5, 0x34, 0x86, 0xf5, 0xa0, 0x8f, 0x61, 0x9e, 0xa6, 0x75, 0x9e, 0x81, 0x2f, - 0x4d, 0x19, 0xb4, 0x0a, 0x93, 0x6a, 0xdc, 0x82, 0x72, 0xc8, 0xd8, 0x59, 0x82, 0xb4, 0x71, 0x17, - 0x6a, 0x71, 0xd3, 0x66, 0x0a, 0xf2, 0xdf, 0x87, 0x55, 0x65, 0x64, 0x06, 0x86, 0x89, 0x3a, 0xf7, - 0x36, 0x2c, 0xf0, 0xc1, 0x66, 0x11, 0x27, 0x4f, 0xf6, 0x91, 0xc2, 0x25, 0xc2, 0x85, 0xeb, 0xa1, - 0x66, 0xea, 0x03, 0xec, 0xf0, 0x7e, 0x45, 0xe1, 0xfa, 0x98, 0x51, 0xe5, 0x8f, 0xe1, 0x78, 0xac, - 0x73, 0x5e, 0x37, 0xbf, 0x03, 0x55, 0xdb, 0xd2, 0x55, 0x97, 0x91, 0x49, 0x59, 0xc0, 0xd3, 0x90, - 0xed, 0xf3, 0xb6, 0x74, 0x22, 0xde, 0xf5, 0x2c, 0x3b, 0x69, 0xfc, 0x74, 0xe2, 0x75, 0x38, 0x11, - 0x17, 0x67, 0xdd, 0xcb, 0xf7, 0x60, 0x4d, 0xc1, 0x43, 0xeb, 0x39, 0x7e, 0x55, 0xd5, 0x0d, 0xa8, - 0x27, 0x15, 0x70, 0xe5, 0x9f, 0xc3, 0x5a, 0x40, 0xed, 0x7a, 0x9a, 0x37, 0x72, 0x67, 0x52, 0xce, - 0x37, 0x15, 0xfb, 0x96, 0xcb, 0x86, 0xb3, 0xa8, 0x88, 0xa6, 0xbc, 0x06, 0xf3, 0x1d, 0x4b, 0x6f, - 0x75, 0x50, 0x15, 0x72, 0x86, 0xcd, 0x85, 0x73, 0x86, 0x2d, 0x1b, 0xe1, 0x3e, 0xdb, 0xac, 0xb8, - 0x63, 0x5d, 0xc7, 0x59, 0xd1, 0x5d, 0xa8, 0x6a, 0xba, 0x6e, 0x90, 0x70, 0xd2, 0x06, 0xaa, 0x61, - 0xb3, 0xda, 0xbf, 0xbc, 0xb1, 0x96, 0x1a, 0x00, 0xad, 0x8e, 0x52, 0x09, 0xd8, 0x5b, 0xb6, 0x2b, - 0x3f, 0x86, 0x92, 0x5f, 0x40, 0x91, 0x65, 0x3e, 0x5a, 0x20, 0x4d, 0x51, 0x6e, 0xf9, 0x3b, 0x89, - 0xdd, 0xc4, 0x1a, 0xc5, 0x4d, 0xbe, 0x03, 0xe0, 0xe7, 0x52, 0x51, 0xc7, 0x9d, 0x1a, 0xa3, 0x58, - 0x09, 0xb1, 0xcb, 0x3f, 0x9b, 0x0f, 0x67, 0xd8, 0x90, 0x13, 0x74, 0xdf, 0x09, 0x7a, 0x24, 0xe3, - 0xe6, 0x5e, 0x29, 0xe3, 0x7e, 0x08, 0xf3, 0xae, 0xa7, 0x79, 0x98, 0x17, 0xc2, 0xe7, 0xc6, 0x89, - 0x13, 0x23, 0xb0, 0xc2, 0xf8, 0xd1, 0x69, 0x80, 0x9e, 0x83, 0x35, 0x0f, 0xeb, 0xaa, 0xc6, 0x96, - 0x87, 0xbc, 0x52, 0xe2, 0x94, 0xa6, 0x87, 0x36, 0x83, 0x62, 0x7e, 0x9e, 0x1a, 0x76, 0x65, 0x9c, - 0xe6, 0xc8, 0x50, 0x07, 0x65, 0xbd, 0x9f, 0xae, 0x16, 0xa6, 0x4c, 0x57, 0x5c, 0x01, 0x93, 0x0a, - 0x25, 0xe3, 0xc5, 0xc9, 0xc9, 0x98, 0x89, 0x4e, 0x93, 0x8c, 0x8b, 0x93, 0x93, 0x31, 0x57, 0x36, - 0x3e, 0x19, 0xa7, 0xa4, 0x9f, 0x52, 0x5a, 0xfa, 0xf9, 0x2e, 0xd3, 0xee, 0x3f, 0x49, 0x50, 0x4f, - 0x66, 0x01, 0x9e, 0xfd, 0x6e, 0xc3, 0x82, 0x4b, 0x29, 0xd3, 0xe4, 0x5e, 0x2e, 0xcb, 0x25, 0xd0, - 0x63, 0x28, 0x18, 0xe6, 0x81, 0xc5, 0x27, 0xed, 0x07, 0x53, 0x48, 0xf2, 0x5e, 0xd7, 0x5b, 0xe6, - 0x81, 0xc5, 0xbc, 0x49, 0x35, 0x34, 0x3e, 0x84, 0x92, 0x4f, 0x9a, 0xe9, 0xdd, 0x76, 0x60, 0x35, - 0x16, 0xdb, 0x6c, 0xef, 0xe6, 0x4f, 0x09, 0x69, 0xb6, 0x29, 0x21, 0xff, 0x34, 0x17, 0x9e, 0xb2, - 0x0f, 0x8d, 0x81, 0x87, 0x9d, 0xc4, 0x94, 0xfd, 0x48, 0x68, 0x67, 0xf3, 0xf5, 0xe2, 0x44, 0xed, - 0x6c, 0x3b, 0xc4, 0x67, 0xdd, 0x97, 0x50, 0xa5, 0x41, 0xa9, 0xba, 0x78, 0x40, 0x4b, 0x1e, 0x5e, - 0x7e, 0x7e, 0x7f, 0x9c, 0x1a, 0x66, 0x09, 0x0b, 0xed, 0x2e, 0x97, 0x63, 0x1e, 0xac, 0x0c, 0xc2, - 0xb4, 0xc6, 0x7d, 0x40, 0x49, 0xa6, 0x99, 0x7c, 0xda, 0x25, 0xb9, 0xd0, 0xf5, 0x52, 0xd7, 0xe9, - 0x03, 0x6a, 0xc6, 0x34, 0xb1, 0xc2, 0x0c, 0x56, 0xb8, 0x84, 0xfc, 0x1f, 0x79, 0x80, 0xe0, 0xe1, - 0xff, 0xa1, 0x24, 0x78, 0xdf, 0x4f, 0x40, 0xac, 0x94, 0xbc, 0x3c, 0x4e, 0x71, 0x6a, 0xea, 0xd9, - 0x89, 0xa6, 0x1e, 0x56, 0x54, 0x5e, 0x1b, 0xab, 0x66, 0xe6, 0xa4, 0xb3, 0xf8, 0xbb, 0x96, 0x74, - 0x9e, 0xc0, 0x89, 0x78, 0x10, 0xf1, 0x8c, 0xb3, 0x01, 0xf3, 0x86, 0x87, 0x87, 0x0c, 0x02, 0x4c, - 0x45, 0x10, 0x42, 0x42, 0x8c, 0x55, 0xfe, 0x73, 0x09, 0x4a, 0xad, 0xa1, 0xd6, 0xc7, 0x5d, 0x1b, - 0xf7, 0x48, 0xaf, 0x06, 0x69, 0x70, 0x4b, 0x58, 0x03, 0xb5, 0xa3, 0x6e, 0x66, 0x49, 0xe9, 0xbd, - 0x14, 0x7c, 0x42, 0xe8, 0x19, 0xef, 0xe5, 0xd7, 0xf6, 0xc0, 0x06, 0x14, 0x7f, 0x80, 0x8f, 0x58, - 0x3a, 0x9a, 0x52, 0x4e, 0xfe, 0x87, 0x1c, 0xac, 0xd1, 0xe5, 0x70, 0x53, 0x20, 0x82, 0x0a, 0x76, - 0xad, 0x91, 0xd3, 0xc3, 0x2e, 0x8d, 0x53, 0x7b, 0xa4, 0xda, 0xd8, 0x31, 0x2c, 0x9d, 0x63, 0x52, - 0xa5, 0x9e, 0x3d, 0xea, 0x50, 0x02, 0x3a, 0x05, 0xa4, 0xa1, 0x7e, 0x35, 0xb2, 0xf8, 0x14, 0xca, - 0x2b, 0xc5, 0x9e, 0x3d, 0xfa, 0x3d, 0xd2, 0x16, 0xb2, 0xee, 0xa1, 0xe6, 0x60, 0x97, 0xce, 0x10, - 0x26, 0xdb, 0xa5, 0x04, 0x74, 0x03, 0x8e, 0x0f, 0xf1, 0xd0, 0x72, 0x8e, 0xd4, 0x81, 0x31, 0x34, - 0x3c, 0xd5, 0x30, 0xd5, 0xfd, 0x23, 0x0f, 0xbb, 0x7c, 0x36, 0x20, 0xf6, 0xf0, 0x09, 0x79, 0xd6, - 0x32, 0x1f, 0x90, 0x27, 0x48, 0x86, 0x8a, 0x65, 0x0d, 0x55, 0xb7, 0x67, 0x39, 0x58, 0xd5, 0xf4, - 0x1f, 0xd3, 0x0a, 0x21, 0xaf, 0x94, 0x2d, 0x6b, 0xd8, 0x25, 0xb4, 0xa6, 0xfe, 0x63, 0xf4, 0x36, - 0x94, 0x7b, 0xf6, 0xc8, 0xc5, 0x9e, 0x4a, 0xfe, 0xd0, 0x02, 0xa0, 0xa4, 0x00, 0x23, 0x6d, 0xda, - 0x23, 0x37, 0xc4, 0x30, 0x24, 0x01, 0xb1, 0x18, 0x66, 0x78, 0x8a, 0x87, 0x14, 0xfc, 0x3a, 0x1c, - 0xf5, 0xb1, 0xad, 0xf5, 0x31, 0x33, 0x4d, 0xac, 0xdc, 0x29, 0xe0, 0xd7, 0x63, 0xce, 0x48, 0xcd, - 0x54, 0xaa, 0x87, 0xe1, 0xa6, 0x2b, 0x3f, 0x80, 0x4a, 0x84, 0x81, 0xf8, 0x8b, 0xaa, 0x75, 0x8d, - 0x9f, 0x88, 0x40, 0x2a, 0x12, 0x42, 0xd7, 0xf8, 0x09, 0x85, 0xfe, 0x68, 0x77, 0xd4, 0x91, 0x05, - 0x85, 0x35, 0x64, 0x0d, 0x2a, 0x11, 0x84, 0x8d, 0xec, 0xcf, 0x29, 0x94, 0xc6, 0xf7, 0xe7, 0xe4, - 0x37, 0xa1, 0x39, 0xd6, 0x40, 0x8c, 0x2b, 0xfd, 0x4d, 0x68, 0x14, 0xb3, 0x61, 0xbb, 0x5d, 0xfa, - 0x9b, 0x76, 0x81, 0x9f, 0x73, 0x88, 0xb6, 0xa4, 0xb0, 0x86, 0xac, 0x03, 0x6c, 0x6a, 0xb6, 0xb6, - 0x6f, 0x0c, 0x0c, 0xef, 0x08, 0x5d, 0x81, 0x9a, 0xa6, 0xeb, 0x6a, 0x4f, 0x50, 0x0c, 0x2c, 0x80, - 0xf3, 0x65, 0x4d, 0xd7, 0x37, 0x43, 0x64, 0xf4, 0x2e, 0xac, 0xe8, 0x8e, 0x65, 0x47, 0x79, 0x19, - 0x92, 0x5e, 0x23, 0x0f, 0xc2, 0xcc, 0xf2, 0x6f, 0x16, 0xe0, 0x74, 0x34, 0xcc, 0xe2, 0x28, 0xe6, - 0x7d, 0x58, 0x8a, 0xf5, 0x9a, 0x81, 0xf6, 0x05, 0xd6, 0x2a, 0x11, 0x89, 0x18, 0x2a, 0x97, 0x4b, - 0xa0, 0x72, 0xa9, 0x38, 0x69, 0xfe, 0x8d, 0xe2, 0xa4, 0x85, 0x37, 0x82, 0x93, 0xce, 0xbf, 0x1e, - 0x4e, 0xba, 0x34, 0x23, 0x4e, 0x7a, 0x91, 0x26, 0x77, 0xd1, 0x3b, 0x45, 0x51, 0xd8, 0xc4, 0xa9, - 0xf8, 0x7d, 0x98, 0xe2, 0xc4, 0x26, 0x86, 0xa7, 0x2e, 0xce, 0x82, 0xa7, 0x16, 0x33, 0xf1, 0xd4, - 0xb3, 0xb0, 0x64, 0x5a, 0xaa, 0x89, 0x5f, 0xa8, 0x64, 0xb8, 0xdc, 0x7a, 0x99, 0x8d, 0x9d, 0x69, - 0xb5, 0xf1, 0x8b, 0x0e, 0xa1, 0xa0, 0x73, 0xb0, 0x34, 0xd4, 0xdc, 0x67, 0x58, 0xa7, 0x60, 0xa6, - 0x5b, 0xaf, 0xd0, 0x38, 0x2b, 0x33, 0x5a, 0x87, 0x90, 0xd0, 0x05, 0xf0, 0xed, 0xe0, 0x4c, 0x55, - 0xca, 0x54, 0x11, 0x54, 0xc6, 0x16, 0xc2, 0x66, 0x97, 0x5f, 0x0b, 0x9b, 0xad, 0xcd, 0x8e, 0xcd, - 0x5e, 0x83, 0x9a, 0xf8, 0x2d, 0xc0, 0x59, 0x56, 0xbc, 0x53, 0x5c, 0x76, 0x59, 0x3c, 0x13, 0x00, - 0x6c, 0x16, 0x94, 0x0b, 0x63, 0xa1, 0xdc, 0xbf, 0x94, 0x60, 0x35, 0x3a, 0xd5, 0x38, 0x52, 0xf5, - 0x08, 0x4a, 0x8e, 0xc8, 0xed, 0x7c, 0x7a, 0x5d, 0xc9, 0xd8, 0x1b, 0x25, 0x17, 0x03, 0x25, 0x90, - 0x45, 0x3f, 0xcc, 0x04, 0x48, 0xaf, 0x4f, 0xd2, 0x37, 0x09, 0x22, 0x95, 0x1d, 0x78, 0xfb, 0x53, - 0xc3, 0xd4, 0xad, 0x17, 0x6e, 0x66, 0xa6, 0x48, 0x89, 0x57, 0x29, 0x23, 0x5e, 0x7b, 0x0e, 0xd6, - 0xb1, 0xe9, 0x19, 0xda, 0x40, 0x75, 0x6d, 0xdc, 0x13, 0x40, 0x4d, 0x40, 0x26, 0xab, 0xb2, 0xfc, - 0x4b, 0x09, 0x4e, 0xc4, 0x3b, 0xe5, 0x3e, 0x6b, 0x25, 0x7d, 0xf6, 0x6e, 0xf2, 0x1d, 0xe3, 0xc2, - 0xa9, 0x5e, 0xfb, 0x32, 0xd3, 0x6b, 0x37, 0x26, 0x6b, 0x9c, 0xe8, 0xb7, 0x3f, 0x93, 0xe0, 0x64, - 0xa6, 0x19, 0xb1, 0xd5, 0x58, 0x8a, 0xaf, 0xc6, 0x7c, 0x25, 0xef, 0x59, 0x23, 0xd3, 0x0b, 0xad, - 0xe4, 0x9b, 0xf4, 0x0c, 0x91, 0x2d, 0x99, 0xea, 0x50, 0x7b, 0x69, 0x0c, 0x47, 0x43, 0xbe, 0x94, - 0x13, 0x75, 0x4f, 0x19, 0xe5, 0x15, 0xd6, 0x72, 0xb9, 0x09, 0x2b, 0xbe, 0x95, 0x63, 0xb1, 0xe7, - 0x10, 0x96, 0x9c, 0x8b, 0x62, 0xc9, 0x26, 0x2c, 0x6c, 0xe1, 0xe7, 0x46, 0x0f, 0xbf, 0x91, 0x43, - 0xce, 0xb3, 0x50, 0xb6, 0xb1, 0x33, 0x34, 0x5c, 0xd7, 0x5f, 0x15, 0x4a, 0x4a, 0x98, 0x24, 0xff, - 0xdb, 0x02, 0x2c, 0xc7, 0xa3, 0xe3, 0x5e, 0x02, 0xba, 0x3e, 0x9f, 0xb2, 0x5e, 0xc5, 0x5f, 0x34, - 0xb4, 0x85, 0xb8, 0x21, 0xea, 0xca, 0x5c, 0x16, 0xcc, 0xe3, 0xd7, 0x8e, 0xa2, 0xe8, 0xac, 0xc3, - 0x62, 0xcf, 0x1a, 0x0e, 0x35, 0x53, 0x17, 0x67, 0xd3, 0xbc, 0x49, 0xfc, 0xa7, 0x39, 0x7d, 0xe2, - 0x76, 0x42, 0xa6, 0xbf, 0xc9, 0xe0, 0xbd, 0xb0, 0x9c, 0x67, 0x86, 0x49, 0x21, 0x70, 0xba, 0xb2, - 0x94, 0x14, 0xe0, 0xa4, 0x2d, 0xc3, 0x41, 0xeb, 0x50, 0xc0, 0xe6, 0x73, 0xb1, 0x47, 0x48, 0x39, - 0xbc, 0x16, 0x15, 0xa5, 0x42, 0xf9, 0xd0, 0x75, 0x58, 0x18, 0x92, 0xb0, 0x10, 0xe8, 0xc8, 0x5a, - 0xc6, 0x19, 0xae, 0xc2, 0xd9, 0xd0, 0x06, 0x2c, 0xea, 0x74, 0x9c, 0x44, 0x21, 0x55, 0x4f, 0x01, - 0xd6, 0x29, 0x83, 0x22, 0x18, 0xd1, 0xb6, 0xbf, 0x03, 0x2a, 0x65, 0x6d, 0x5d, 0x62, 0x43, 0x91, - 0xba, 0x0d, 0xda, 0x8d, 0xd6, 0xe7, 0x40, 0x75, 0x6d, 0x4c, 0xd6, 0x35, 0x7e, 0x2f, 0x74, 0x12, - 0x8a, 0x03, 0xab, 0xcf, 0xc2, 0xa8, 0xcc, 0xae, 0x3d, 0x0c, 0xac, 0x3e, 0x8d, 0xa2, 0x55, 0xb2, - 0x23, 0xd4, 0x0d, 0x93, 0x2e, 0xc1, 0x45, 0x85, 0x35, 0xc8, 0xe4, 0xa3, 0x3f, 0x54, 0xcb, 0xec, - 0xe1, 0x7a, 0x85, 0x3e, 0x2a, 0x51, 0xca, 0x8e, 0xd9, 0xa3, 0x95, 0xba, 0xe7, 0x1d, 0xd5, 0xab, - 0x94, 0x4e, 0x7e, 0x92, 0xcd, 0x3e, 0x03, 0xb0, 0x96, 0xb3, 0x36, 0xfb, 0x69, 0xf9, 0x5d, 0xe0, - 0x57, 0x0f, 0x60, 0xf1, 0x05, 0x4b, 0x04, 0x7c, 0x89, 0xba, 0x3c, 0x39, 0xbd, 0x70, 0x0d, 0x42, - 0xf0, 0xbb, 0xdc, 0xc6, 0xfd, 0xb5, 0x04, 0x27, 0x36, 0xe9, 0x5e, 0x38, 0x94, 0xc7, 0x66, 0x01, - 0x90, 0x6f, 0xf9, 0xd8, 0x7e, 0x26, 0x28, 0x1b, 0x7f, 0x6f, 0x01, 0xed, 0xb7, 0xa0, 0x2a, 0x94, - 0x73, 0x15, 0xf9, 0xa9, 0x8f, 0x07, 0x2a, 0x6e, 0xb8, 0x29, 0x7f, 0x04, 0x6b, 0x89, 0xb7, 0xe0, - 0xdb, 0xd1, 0x73, 0xb0, 0x14, 0xe4, 0x2b, 0xff, 0x25, 0xca, 0x3e, 0xad, 0xa5, 0xcb, 0xb7, 0xe1, - 0x78, 0xd7, 0xd3, 0x1c, 0x2f, 0xe1, 0x82, 0x29, 0x64, 0x29, 0xf0, 0x1f, 0x95, 0xe5, 0xd8, 0x7c, - 0x17, 0x56, 0xbb, 0x9e, 0x65, 0xbf, 0x82, 0x52, 0x92, 0x75, 0xc8, 0xfb, 0x5b, 0x23, 0xb1, 0x3e, - 0x88, 0xa6, 0xbc, 0xc6, 0x8e, 0x29, 0x92, 0xbd, 0xdd, 0x81, 0x13, 0xec, 0x94, 0xe0, 0x55, 0x5e, - 0xe2, 0xa4, 0x38, 0xa3, 0x48, 0xea, 0x7d, 0x0a, 0xc7, 0x82, 0x65, 0x31, 0xc0, 0xdf, 0x6e, 0x46, - 0xf1, 0xb7, 0xb3, 0x63, 0x46, 0x3d, 0x02, 0xbf, 0xfd, 0x49, 0x2e, 0x94, 0xd7, 0x33, 0xd0, 0xb7, - 0x3b, 0x51, 0xf4, 0xed, 0xc2, 0x24, 0xdd, 0x11, 0xf0, 0x2d, 0x19, 0xb5, 0xf9, 0x94, 0xa8, 0xfd, - 0x22, 0x01, 0xd1, 0x15, 0xb2, 0x30, 0xce, 0x98, 0xb5, 0xbf, 0x15, 0x84, 0x4e, 0x61, 0x08, 0x9d, - 0xdf, 0xb5, 0x7f, 0xa8, 0x73, 0x2b, 0x86, 0xd0, 0x9d, 0x9b, 0x68, 0xaf, 0x0f, 0xd0, 0xfd, 0x45, - 0x01, 0x4a, 0xfe, 0xb3, 0x84, 0xcf, 0x93, 0x6e, 0xcb, 0xa5, 0xb8, 0x2d, 0xbc, 0x02, 0xe7, 0x5f, - 0x6b, 0x05, 0x2e, 0x4c, 0xbd, 0x02, 0x9f, 0x82, 0x12, 0xfd, 0x41, 0x6f, 0x30, 0xb0, 0x15, 0xb5, - 0x48, 0x09, 0x0a, 0x3e, 0x08, 0xc2, 0x70, 0x61, 0xa6, 0x30, 0x8c, 0x61, 0x82, 0x8b, 0x71, 0x4c, - 0xf0, 0x9e, 0xbf, 0x22, 0xb2, 0x45, 0xf4, 0xd2, 0x18, 0xbd, 0xa9, 0x6b, 0x61, 0x0c, 0xab, 0x2a, - 0x65, 0x61, 0x55, 0x81, 0x96, 0xf1, 0x58, 0xd5, 0x77, 0xb8, 0x42, 0xec, 0x31, 0xa0, 0x2f, 0x1c, - 0x8b, 0x3c, 0xb3, 0xde, 0x01, 0xf0, 0x93, 0x88, 0x40, 0xfb, 0x4e, 0x8d, 0x79, 0x47, 0x25, 0xc4, - 0x4e, 0xd4, 0x46, 0x86, 0x26, 0x38, 0xb8, 0x9c, 0x2e, 0x3f, 0x66, 0x9c, 0x5a, 0xfe, 0xcf, 0x7c, - 0x28, 0xbf, 0x64, 0x1c, 0xc8, 0xdd, 0x4b, 0x60, 0xd1, 0x33, 0x46, 0xf1, 0xcd, 0x28, 0x14, 0xfd, - 0x8a, 0x51, 0x97, 0x40, 0xa2, 0x69, 0xe5, 0xa2, 0x39, 0xfc, 0x31, 0xc3, 0xdb, 0x4a, 0x9c, 0xd2, - 0xa4, 0x3b, 0x83, 0x03, 0xc3, 0x34, 0xdc, 0x43, 0xf6, 0x7c, 0x81, 0xed, 0x0c, 0x04, 0xa9, 0x49, - 0x11, 0x2f, 0xfc, 0xd2, 0xf0, 0xd4, 0x9e, 0xa5, 0x63, 0x1a, 0xd3, 0xf3, 0x4a, 0x91, 0x10, 0x36, - 0x2d, 0x1d, 0x07, 0x33, 0xaf, 0xf8, 0x6a, 0x33, 0xaf, 0x14, 0x9b, 0x79, 0x27, 0x60, 0xc1, 0xc1, - 0x9a, 0x6b, 0x99, 0x6c, 0x7f, 0xac, 0xf0, 0x16, 0x19, 0x9a, 0x21, 0x76, 0x5d, 0xd2, 0x13, 0x2f, - 0xd7, 0x78, 0x33, 0x54, 0x66, 0x2e, 0x4d, 0x2c, 0x33, 0xc7, 0x1c, 0xf4, 0xc5, 0xca, 0xcc, 0xca, - 0xc4, 0x32, 0x73, 0xaa, 0x73, 0xbe, 0xa0, 0xd0, 0xae, 0x4e, 0x57, 0x68, 0x87, 0xeb, 0xd2, 0xe5, - 0x48, 0x5d, 0xfa, 0x5d, 0x4e, 0xd6, 0x5f, 0x4b, 0xb0, 0x96, 0x98, 0x56, 0x7c, 0xba, 0xde, 0x8a, - 0x9d, 0x04, 0x9e, 0x9b, 0xe8, 0x33, 0xff, 0x20, 0xf0, 0x51, 0xe4, 0x20, 0xf0, 0xfd, 0xc9, 0x82, - 0x6f, 0xfc, 0x1c, 0xf0, 0xbf, 0x73, 0xf0, 0xf6, 0x9e, 0xad, 0xc7, 0x2a, 0x3c, 0xbe, 0xed, 0x9f, - 0x3e, 0x71, 0xdc, 0x13, 0xb5, 0x7e, 0x6e, 0x56, 0x40, 0x86, 0x97, 0xfb, 0xdb, 0x41, 0xb9, 0x9f, - 0x9f, 0x1d, 0x9f, 0x10, 0xb2, 0x48, 0x8f, 0x06, 0x31, 0x2b, 0x3e, 0x1e, 0x24, 0x55, 0x4d, 0x78, - 0xe5, 0x6f, 0xf9, 0x84, 0x43, 0x86, 0xb3, 0xd9, 0x06, 0xf0, 0xfa, 0xf0, 0x47, 0xb0, 0xbc, 0xfd, - 0x12, 0xf7, 0xba, 0x47, 0x66, 0x6f, 0x86, 0x71, 0xa8, 0x41, 0xbe, 0x37, 0xd4, 0x39, 0x7e, 0x4d, - 0x7e, 0x86, 0x4b, 0xde, 0x7c, 0xb4, 0xe4, 0x55, 0xa1, 0x16, 0xf4, 0xc0, 0x63, 0xf9, 0x04, 0x89, - 0x65, 0x9d, 0x30, 0x13, 0xe5, 0x4b, 0x0a, 0x6f, 0x71, 0x3a, 0x76, 0xd8, 0x25, 0x21, 0x46, 0xc7, - 0x8e, 0x13, 0x4d, 0x8d, 0xf9, 0x68, 0x6a, 0x94, 0xff, 0x58, 0x82, 0x32, 0xe9, 0xe1, 0xb5, 0xec, - 0xe7, 0xfb, 0xca, 0x7c, 0xb0, 0xaf, 0xf4, 0xb7, 0xa7, 0x85, 0xf0, 0xf6, 0x34, 0xb0, 0x7c, 0x9e, - 0x92, 0x93, 0x96, 0x2f, 0xf8, 0x74, 0xec, 0x38, 0xf2, 0x59, 0x58, 0x62, 0xb6, 0xf1, 0x37, 0xaf, - 0x41, 0x7e, 0xe4, 0x0c, 0xc4, 0xf8, 0x8d, 0x9c, 0x81, 0xfc, 0x87, 0x12, 0x54, 0x9a, 0x9e, 0xa7, - 0xf5, 0x0e, 0x67, 0x78, 0x01, 0xdf, 0xb8, 0x5c, 0xd8, 0xb8, 0xe4, 0x4b, 0x04, 0xe6, 0x16, 0x32, - 0xcc, 0x9d, 0x8f, 0x98, 0x2b, 0x43, 0x55, 0xd8, 0x92, 0x69, 0x70, 0x1b, 0x50, 0xc7, 0x72, 0xbc, - 0x87, 0x96, 0xf3, 0x42, 0x73, 0xf4, 0xd9, 0xb6, 0x9b, 0x08, 0x0a, 0xfc, 0xfe, 0x7e, 0xfe, 0xf2, - 0xbc, 0x42, 0x7f, 0xcb, 0x97, 0xe0, 0x58, 0x44, 0x5f, 0x66, 0xc7, 0xf7, 0xa1, 0x4c, 0x17, 0x39, - 0xbe, 0xef, 0xb8, 0x11, 0x3e, 0x66, 0x9c, 0x6a, 0x49, 0x94, 0xff, 0x3f, 0xac, 0x90, 0x62, 0x88, - 0xd2, 0xfd, 0xbc, 0xf3, 0xfd, 0x58, 0x51, 0x7e, 0x3a, 0x43, 0x51, 0xac, 0x20, 0xff, 0x8d, 0x04, - 0xf3, 0x94, 0x9e, 0x28, 0x50, 0x4e, 0x41, 0xc9, 0xc1, 0xb6, 0xa5, 0x7a, 0x5a, 0xdf, 0xff, 0x5a, - 0x82, 0x10, 0x76, 0xb5, 0x3e, 0xc5, 0xe6, 0xe9, 0x43, 0xdd, 0xe8, 0x63, 0xd7, 0x13, 0x9f, 0x4c, - 0x94, 0x09, 0x6d, 0x8b, 0x91, 0x88, 0x93, 0xe8, 0xa9, 0x57, 0x81, 0x1e, 0x6e, 0xd1, 0xdf, 0x68, - 0x9d, 0x5d, 0x2b, 0x9d, 0xe6, 0xb0, 0x83, 0x5e, 0x3a, 0x6d, 0x40, 0x31, 0x76, 0x3e, 0xe1, 0xb7, - 0xd1, 0x75, 0x28, 0x50, 0x7c, 0x77, 0x71, 0xb2, 0xdf, 0x28, 0xa3, 0xbc, 0x0d, 0x28, 0xec, 0x36, - 0x3e, 0x40, 0xd7, 0x61, 0x81, 0x7a, 0x55, 0xd4, 0x8e, 0x6b, 0x19, 0x8a, 0x14, 0xce, 0x26, 0x6b, - 0x80, 0x98, 0xe6, 0x48, 0xbd, 0x38, 0xfb, 0x30, 0x8e, 0xa9, 0x1f, 0xff, 0x4a, 0x82, 0x63, 0x91, - 0x3e, 0xb8, 0xad, 0xd7, 0xa2, 0x9d, 0x64, 0x9a, 0xca, 0x3b, 0xd8, 0x8c, 0x2c, 0x98, 0xd7, 0xb3, - 0x4c, 0xfa, 0x96, 0x16, 0xcb, 0xbf, 0x95, 0x00, 0x9a, 0x23, 0xef, 0x90, 0xe3, 0xa6, 0xe1, 0xa1, - 0x94, 0x62, 0x43, 0xd9, 0x80, 0xa2, 0xad, 0xb9, 0xee, 0x0b, 0xcb, 0x11, 0x3b, 0x3e, 0xbf, 0x4d, - 0x11, 0xce, 0x91, 0x77, 0x28, 0x4e, 0x35, 0xc9, 0x6f, 0x74, 0x01, 0xaa, 0xec, 0x93, 0x1e, 0x55, - 0xd3, 0x75, 0x07, 0xbb, 0x2e, 0x3f, 0xde, 0xac, 0x30, 0x6a, 0x93, 0x11, 0x09, 0x9b, 0x41, 0x31, - 0x7f, 0xef, 0x48, 0xf5, 0xac, 0x67, 0xd8, 0xe4, 0x3b, 0xb7, 0x8a, 0xa0, 0xee, 0x12, 0x22, 0x3b, - 0x44, 0xea, 0x1b, 0xae, 0xe7, 0x08, 0x36, 0x71, 0x14, 0xc6, 0xa9, 0x94, 0x8d, 0x0c, 0x4a, 0xad, - 0x33, 0x1a, 0x0c, 0x98, 0x8b, 0x5f, 0x7d, 0xd8, 0xbf, 0xc7, 0x5f, 0x28, 0x97, 0x35, 0x09, 0x02, - 0xa7, 0xf1, 0xd7, 0x7d, 0x83, 0x10, 0xd5, 0xf7, 0x60, 0x25, 0xf4, 0x0e, 0x3c, 0xac, 0x22, 0x25, - 0xb6, 0x14, 0x2d, 0xb1, 0xe5, 0x47, 0x80, 0x18, 0x2a, 0xf3, 0x9a, 0xef, 0x2d, 0x1f, 0x87, 0x63, - 0x11, 0x45, 0x7c, 0xe9, 0xbe, 0x0a, 0x15, 0x7e, 0xa7, 0x8f, 0x07, 0xca, 0x49, 0x28, 0x92, 0x14, - 0xdc, 0x33, 0x74, 0x71, 0xe4, 0xbd, 0x68, 0x5b, 0xfa, 0xa6, 0xa1, 0x3b, 0xf2, 0xa7, 0x50, 0xe1, - 0xdf, 0x05, 0x70, 0xde, 0x87, 0x50, 0xe5, 0x37, 0x00, 0xd5, 0xc8, 0xdd, 0xde, 0xb4, 0xaf, 0x74, - 0xc2, 0x9d, 0x28, 0x15, 0x33, 0xdc, 0x94, 0x75, 0x68, 0xb0, 0x1a, 0x23, 0xa2, 0x5e, 0xbc, 0xec, - 0x43, 0x10, 0x57, 0x5e, 0x26, 0xf6, 0x12, 0x95, 0xaf, 0x38, 0xe1, 0xa6, 0x7c, 0x1a, 0x4e, 0xa5, - 0xf6, 0xc2, 0x3d, 0x61, 0x43, 0x2d, 0x78, 0xc0, 0x2e, 0xa0, 0xfa, 0x67, 0xfa, 0x52, 0xe8, 0x4c, - 0xff, 0x84, 0x5f, 0x42, 0xe7, 0xc4, 0xaa, 0x47, 0xeb, 0xe3, 0x60, 0x33, 0x94, 0xcf, 0xda, 0x0c, - 0x15, 0x22, 0x9b, 0x21, 0xb9, 0xeb, 0xfb, 0x93, 0x6f, 0x52, 0x1f, 0xd0, 0xcd, 0x34, 0xeb, 0x5b, - 0x24, 0x44, 0x79, 0xdc, 0x5b, 0x32, 0x56, 0x25, 0x24, 0x25, 0x5f, 0x81, 0x4a, 0x34, 0x35, 0x86, - 0xf2, 0x9c, 0x94, 0xc8, 0x73, 0xd5, 0x58, 0x8a, 0xfb, 0x30, 0xb6, 0x3f, 0xc8, 0xf6, 0x71, 0x6c, - 0x77, 0x70, 0x37, 0x92, 0xec, 0xae, 0xa6, 0x1c, 0xd1, 0x7e, 0x4b, 0x79, 0x6e, 0x95, 0xaf, 0x07, - 0x0f, 0x5d, 0x22, 0xcf, 0x5f, 0x5a, 0x3e, 0x0f, 0xe5, 0xbd, 0xac, 0xaf, 0xbc, 0x0a, 0xe2, 0x22, - 0xce, 0x4d, 0x58, 0x7d, 0x68, 0x0c, 0xb0, 0x7b, 0xe4, 0x7a, 0x78, 0xd8, 0xa2, 0x49, 0xe9, 0xc0, - 0xc0, 0x0e, 0x3a, 0x03, 0x40, 0x37, 0x78, 0xb6, 0x65, 0xf8, 0xdf, 0xab, 0x84, 0x28, 0xf2, 0xbf, - 0x4b, 0xb0, 0x1c, 0x08, 0xee, 0xd1, 0x8d, 0xed, 0x5b, 0x50, 0x22, 0xef, 0xeb, 0x7a, 0xda, 0xd0, - 0x16, 0xa7, 0x7d, 0x3e, 0x01, 0xdd, 0x81, 0xf9, 0x03, 0x57, 0x00, 0x6a, 0xa9, 0xc7, 0x0b, 0x69, - 0x86, 0x28, 0x85, 0x03, 0xb7, 0xa5, 0xa3, 0x8f, 0x00, 0x46, 0x2e, 0xd6, 0xf9, 0x09, 0x5f, 0x3e, - 0xab, 0xbc, 0xd8, 0x0b, 0x5f, 0x55, 0x20, 0x02, 0xec, 0x0e, 0xcf, 0x5d, 0x28, 0x1b, 0xa6, 0xa5, - 0x63, 0x7a, 0x74, 0xab, 0x73, 0xcc, 0x6d, 0x82, 0x38, 0x30, 0x89, 0x3d, 0x17, 0xeb, 0x32, 0xe6, - 0x6b, 0xa1, 0xf0, 0x2f, 0x0f, 0x94, 0x36, 0xac, 0xb0, 0xa4, 0x75, 0xe0, 0x1b, 0x2e, 0x22, 0xf6, - 0xdc, 0xb8, 0xb7, 0xa3, 0xde, 0x52, 0x6a, 0x06, 0xaf, 0x85, 0x84, 0xa8, 0x7c, 0x1b, 0x8e, 0x47, - 0xf6, 0x8f, 0x33, 0x6c, 0xe8, 0xe4, 0x4e, 0x0c, 0x46, 0x0a, 0xc2, 0x99, 0x83, 0x34, 0x22, 0x9a, - 0x27, 0x81, 0x34, 0x2e, 0x03, 0x69, 0x5c, 0xf9, 0x0b, 0x38, 0x19, 0xc1, 0xbb, 0x22, 0x16, 0xdd, - 0x8d, 0x95, 0x7a, 0x17, 0x27, 0x69, 0x8d, 0xd5, 0x7c, 0xff, 0x25, 0xc1, 0x6a, 0x1a, 0xc3, 0x2b, - 0xe2, 0xb1, 0x3f, 0xca, 0xb8, 0x69, 0x7a, 0x6b, 0x3a, 0xb3, 0x7e, 0x2b, 0x58, 0xf6, 0x2e, 0x34, - 0xd2, 0xfc, 0x99, 0x1c, 0xa5, 0xfc, 0x2c, 0xa3, 0xf4, 0xf3, 0x7c, 0xe8, 0x5c, 0xa2, 0xe9, 0x79, - 0x8e, 0xb1, 0x3f, 0x22, 0x21, 0xff, 0xc6, 0xb1, 0xbe, 0x96, 0x8f, 0x5a, 0x31, 0xd7, 0xde, 0x18, - 0x23, 0x1e, 0xd8, 0x91, 0x8a, 0x5c, 0x7d, 0x96, 0xb6, 0xe9, 0xbf, 0x39, 0x9d, 0xbe, 0xdf, 0x59, - 0x78, 0xf8, 0xe7, 0x39, 0xa8, 0x46, 0x87, 0x08, 0x6d, 0x03, 0x68, 0xbe, 0xe5, 0x7c, 0xa2, 0x5c, - 0x98, 0xea, 0x35, 0x95, 0x90, 0x20, 0x7a, 0x0f, 0xf2, 0x3d, 0x7b, 0xc4, 0x47, 0x2d, 0xe5, 0xa8, - 0x7c, 0xd3, 0x1e, 0xb1, 0x8c, 0x42, 0xd8, 0xc8, 0x26, 0x8c, 0xdd, 0x7c, 0xc8, 0xce, 0x92, 0x4f, - 0xe9, 0x73, 0x26, 0xc3, 0x99, 0xd1, 0x63, 0xa8, 0xbe, 0x70, 0x0c, 0x4f, 0xdb, 0x1f, 0x60, 0x75, - 0xa0, 0x1d, 0x61, 0x87, 0x67, 0xc9, 0x29, 0x12, 0x59, 0x45, 0x08, 0x3e, 0x21, 0x72, 0xf2, 0x1f, - 0x40, 0x51, 0x58, 0x34, 0x61, 0x45, 0xd8, 0x85, 0xb5, 0x11, 0x61, 0x53, 0xe9, 0xdd, 0x4a, 0x53, - 0x33, 0x2d, 0xd5, 0xc5, 0x64, 0x19, 0x17, 0x1f, 0xb6, 0x4c, 0x48, 0xd1, 0xab, 0x54, 0x7a, 0xd3, - 0x72, 0x70, 0x5b, 0x33, 0xad, 0x2e, 0x13, 0x95, 0x9f, 0x43, 0x39, 0xf4, 0x82, 0x13, 0x4c, 0x68, - 0xc1, 0x8a, 0xb8, 0xa8, 0xe0, 0x62, 0x8f, 0x2f, 0x2f, 0x53, 0x75, 0xbe, 0xcc, 0xe5, 0xba, 0xd8, - 0x63, 0x97, 0x4b, 0xee, 0xc2, 0x49, 0x05, 0x5b, 0x36, 0x36, 0xfd, 0xf1, 0x7c, 0x62, 0xf5, 0x67, - 0xc8, 0xe0, 0x6f, 0x41, 0x23, 0x4d, 0x9e, 0xe5, 0x87, 0xab, 0x17, 0xa1, 0x28, 0xbe, 0xe7, 0x47, - 0x8b, 0x90, 0xdf, 0xdd, 0xec, 0xd4, 0xe6, 0xc8, 0x8f, 0xbd, 0xad, 0x4e, 0x4d, 0x42, 0x45, 0x28, - 0x74, 0x37, 0x77, 0x3b, 0xb5, 0xdc, 0xd5, 0x21, 0xd4, 0xe2, 0x1f, 0xb3, 0xa3, 0x35, 0x38, 0xd6, - 0x51, 0x76, 0x3a, 0xcd, 0x47, 0xcd, 0xdd, 0xd6, 0x4e, 0x5b, 0xed, 0x28, 0xad, 0x4f, 0x9a, 0xbb, - 0xdb, 0xb5, 0x39, 0x74, 0x0e, 0x4e, 0x87, 0x1f, 0x3c, 0xde, 0xe9, 0xee, 0xaa, 0xbb, 0x3b, 0xea, - 0xe6, 0x4e, 0x7b, 0xb7, 0xd9, 0x6a, 0x6f, 0x2b, 0x35, 0x09, 0x9d, 0x86, 0x93, 0x61, 0x96, 0x07, - 0xad, 0xad, 0x96, 0xb2, 0xbd, 0x49, 0x7e, 0x37, 0x9f, 0xd4, 0x72, 0x57, 0x3f, 0x86, 0x4a, 0xe4, - 0xdb, 0x73, 0x62, 0x52, 0x67, 0x67, 0xab, 0x36, 0x87, 0x2a, 0x50, 0x0a, 0xeb, 0x29, 0x42, 0xa1, - 0xbd, 0xb3, 0xb5, 0x5d, 0xcb, 0x21, 0x80, 0x85, 0xdd, 0xa6, 0xf2, 0x68, 0x7b, 0xb7, 0x96, 0xbf, - 0x7a, 0x1b, 0x96, 0x63, 0x97, 0xd5, 0xd1, 0x0a, 0x54, 0xba, 0xcd, 0xf6, 0xd6, 0x83, 0x9d, 0xcf, - 0x54, 0x65, 0xbb, 0xb9, 0xf5, 0x79, 0x6d, 0x0e, 0xad, 0x42, 0x4d, 0x90, 0xda, 0x3b, 0xbb, 0x8c, - 0x2a, 0x5d, 0x7d, 0x16, 0x9b, 0x6f, 0x18, 0x1d, 0x87, 0x15, 0xbf, 0x4b, 0x75, 0x53, 0xd9, 0x6e, - 0xee, 0x6e, 0x13, 0x4b, 0x22, 0x64, 0x65, 0xaf, 0xdd, 0x6e, 0xb5, 0x1f, 0xd5, 0x24, 0xa2, 0x35, - 0x20, 0x6f, 0x7f, 0xd6, 0x22, 0xcc, 0xb9, 0x28, 0xf3, 0x5e, 0xfb, 0x07, 0xed, 0x9d, 0x4f, 0xdb, - 0xb5, 0xfc, 0xc6, 0x2f, 0x57, 0xfc, 0xef, 0x81, 0xbb, 0xd8, 0xa1, 0xf7, 0x7f, 0x3a, 0xb0, 0x28, - 0xfe, 0x57, 0x44, 0x4a, 0xb6, 0x8e, 0xfe, 0x87, 0x8b, 0xc6, 0xb9, 0x31, 0x1c, 0xbc, 0xf6, 0x9e, - 0x43, 0xfb, 0xb4, 0x16, 0x0e, 0x7d, 0x3c, 0x70, 0x31, 0xb5, 0xf2, 0x4c, 0x7c, 0xaf, 0xd0, 0xb8, - 0x34, 0x91, 0xcf, 0xef, 0x03, 0x93, 0x72, 0x37, 0xfc, 0x7d, 0x1e, 0xba, 0x94, 0x56, 0xa7, 0xa6, - 0x7c, 0x00, 0xd8, 0xb8, 0x3c, 0x99, 0xd1, 0xef, 0xe6, 0x19, 0xd4, 0xe2, 0xdf, 0xea, 0xa1, 0x14, - 0x90, 0x39, 0xe3, 0x83, 0xc0, 0xc6, 0xd5, 0x69, 0x58, 0xc3, 0x9d, 0x25, 0x3e, 0x3e, 0xbb, 0x32, - 0xcd, 0x47, 0x3a, 0x99, 0x9d, 0x65, 0x7d, 0xcf, 0xc3, 0x1c, 0x18, 0xbd, 0xef, 0x8f, 0x52, 0xbf, - 0xf4, 0x4a, 0xf9, 0xac, 0x24, 0xcd, 0x81, 0xe9, 0x9f, 0x0e, 0xc8, 0x73, 0xe8, 0x10, 0x96, 0x63, - 0x17, 0x39, 0x50, 0x8a, 0x78, 0xfa, 0x8d, 0x95, 0xc6, 0x95, 0x29, 0x38, 0xa3, 0x11, 0x11, 0xbe, - 0xb8, 0x91, 0x1e, 0x11, 0x29, 0xd7, 0x42, 0xd2, 0x23, 0x22, 0xf5, 0x0e, 0x08, 0x0d, 0xee, 0xc8, - 0x85, 0x8d, 0xb4, 0xe0, 0x4e, 0xbb, 0x26, 0xd2, 0xb8, 0x34, 0x91, 0x2f, 0xec, 0xb4, 0xd8, 0xf5, - 0x8d, 0x34, 0xa7, 0xa5, 0x5f, 0x0f, 0x69, 0x5c, 0x99, 0x82, 0x33, 0x1e, 0x05, 0xc1, 0x61, 0x70, - 0x56, 0x14, 0x24, 0xae, 0x2e, 0x64, 0x45, 0x41, 0xf2, 0x5c, 0x99, 0x47, 0x41, 0xec, 0x10, 0xf7, - 0xf2, 0x14, 0x87, 0x4e, 0xd9, 0x51, 0x90, 0x7e, 0x3c, 0x25, 0xcf, 0xa1, 0x9f, 0x49, 0x50, 0xcf, - 0x3a, 0xe3, 0x40, 0x37, 0x66, 0x3e, 0x90, 0x69, 0x6c, 0xcc, 0x22, 0xe2, 0x5b, 0xf1, 0x15, 0xa0, - 0xe4, 0x1a, 0x88, 0xde, 0x4d, 0x1b, 0x99, 0x8c, 0x95, 0xb6, 0xf1, 0xde, 0x74, 0xcc, 0x7e, 0x97, - 0x5d, 0x28, 0x8a, 0x53, 0x15, 0x94, 0x92, 0xa5, 0x63, 0x67, 0x3a, 0x0d, 0x79, 0x1c, 0x8b, 0xaf, - 0xf4, 0x11, 0x14, 0x08, 0x15, 0x9d, 0x4e, 0xe7, 0x16, 0xca, 0xce, 0x64, 0x3d, 0xf6, 0x15, 0x3d, - 0x85, 0x05, 0x76, 0x8c, 0x80, 0x52, 0x50, 0x88, 0xc8, 0x61, 0x47, 0xe3, 0x6c, 0x36, 0x83, 0xaf, - 0xee, 0x4b, 0xf6, 0x6f, 0x84, 0xf8, 0x09, 0x01, 0x7a, 0x27, 0xfd, 0xbf, 0x05, 0x44, 0x0f, 0x24, - 0x1a, 0x17, 0x26, 0x70, 0x85, 0x27, 0x45, 0xac, 0x02, 0xbe, 0x34, 0x71, 0x1b, 0x93, 0x3d, 0x29, - 0xd2, 0x37, 0x4a, 0x2c, 0x48, 0x92, 0x1b, 0xa9, 0xb4, 0x20, 0xc9, 0xdc, 0xbe, 0xa6, 0x05, 0x49, - 0xf6, 0xde, 0x4c, 0x9e, 0x43, 0x1e, 0x1c, 0x4b, 0x81, 0xcd, 0xd0, 0x7b, 0x59, 0x41, 0x9e, 0x86, - 0xe1, 0x35, 0xae, 0x4d, 0xc9, 0x1d, 0x1e, 0x7c, 0x3e, 0xe9, 0xdf, 0xce, 0xc6, 0x92, 0x32, 0x07, - 0x3f, 0x3e, 0xc5, 0x37, 0xfe, 0x39, 0x0f, 0x4b, 0x0c, 0x12, 0xe5, 0x15, 0xcc, 0xe7, 0x00, 0xc1, - 0x69, 0x04, 0x3a, 0x9f, 0xee, 0x93, 0xc8, 0x11, 0x4f, 0xe3, 0x9d, 0xf1, 0x4c, 0xe1, 0x40, 0x0b, - 0x21, 0xfb, 0x69, 0x81, 0x96, 0x3c, 0xc0, 0x48, 0x0b, 0xb4, 0x94, 0xe3, 0x01, 0x79, 0x0e, 0x7d, - 0x02, 0x25, 0x1f, 0x42, 0x46, 0x69, 0x10, 0x74, 0x0c, 0x23, 0x6f, 0x9c, 0x1f, 0xcb, 0x13, 0xb6, - 0x3a, 0x84, 0x0f, 0xa7, 0x59, 0x9d, 0xc4, 0xa1, 0xd3, 0xac, 0x4e, 0x03, 0x99, 0x03, 0x9f, 0x30, - 0x14, 0x29, 0xd3, 0x27, 0x11, 0x10, 0x2f, 0xd3, 0x27, 0x51, 0x28, 0x4a, 0x9e, 0x7b, 0x70, 0xf1, - 0x57, 0x5f, 0x9f, 0x91, 0xfe, 0xf1, 0xeb, 0x33, 0x73, 0x3f, 0xfd, 0xe6, 0x8c, 0xf4, 0xab, 0x6f, - 0xce, 0x48, 0x7f, 0xff, 0xcd, 0x19, 0xe9, 0x5f, 0xbe, 0x39, 0x23, 0xfd, 0xd1, 0xbf, 0x9e, 0x99, - 0xfb, 0x61, 0x51, 0x48, 0xef, 0x2f, 0xd0, 0x7f, 0x06, 0xf6, 0xfe, 0xff, 0x06, 0x00, 0x00, 0xff, - 0xff, 0x9e, 0x13, 0x0f, 0x8c, 0xd2, 0x4d, 0x00, 0x00, + // 5644 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x3c, 0x4b, 0x6c, 0x1b, 0x59, + 0x72, 0x6a, 0x92, 0x92, 0xc8, 0xa2, 0x48, 0xd1, 0xcf, 0xb2, 0x45, 0xd3, 0x63, 0xd9, 0x6e, 0x8f, + 0xbf, 0x33, 0x96, 0xd7, 0x9a, 0x19, 0xcf, 0x58, 0x9e, 0xb1, 0x2d, 0x4b, 0xb2, 0xcd, 0x5d, 0x5b, + 0x62, 0x9a, 0xd2, 0x7c, 0x76, 0x26, 0xe8, 0x6d, 0xb1, 0x9f, 0xa8, 0x1e, 0x93, 0xdd, 0x3d, 0xdd, + 0x4d, 0xdb, 0xda, 0x5c, 0x06, 0x58, 0x60, 0x0f, 0x7b, 0x0a, 0x10, 0x04, 0x01, 0x72, 0xdb, 0xe4, + 0x90, 0x43, 0x4e, 0x9b, 0x20, 0xa7, 0x9c, 0x12, 0x24, 0xc8, 0x22, 0x1f, 0x24, 0xa7, 0x45, 0x82, + 0xbd, 0x64, 0x26, 0x08, 0x10, 0x04, 0x08, 0x10, 0xe4, 0x9c, 0x43, 0xf0, 0x7e, 0xfd, 0x63, 0x37, + 0xd9, 0xb4, 0xe7, 0x97, 0x13, 0xfb, 0x55, 0x57, 0xd5, 0xab, 0x57, 0xaf, 0x5e, 0xbd, 0x7a, 0xaf, + 0xaa, 0x09, 0x25, 0xcd, 0x36, 0x96, 0x6d, 0xc7, 0xf2, 0x2c, 0x54, 0x73, 0x06, 0xa6, 0x67, 0xf4, + 0xf1, 0xf2, 0xd3, 0xeb, 0x5a, 0xcf, 0x3e, 0xd0, 0x56, 0x1a, 0x57, 0xbb, 0x86, 0x77, 0x30, 0xd8, + 0x5b, 0xee, 0x58, 0xfd, 0x6b, 0x5d, 0xab, 0x6b, 0x5d, 0xa3, 0x88, 0x7b, 0x83, 0x7d, 0xda, 0xa2, + 0x0d, 0xfa, 0xc4, 0x18, 0xc8, 0x57, 0xa0, 0xfa, 0x3e, 0x76, 0x5c, 0xc3, 0x32, 0x15, 0xfc, 0xd9, + 0x00, 0xbb, 0x1e, 0xaa, 0xc3, 0xec, 0x53, 0x06, 0xa9, 0x4b, 0x67, 0xa4, 0x4b, 0x25, 0x45, 0x34, + 0xe5, 0x3f, 0x92, 0x60, 0xde, 0x47, 0x76, 0x6d, 0xcb, 0x74, 0x71, 0x3a, 0x36, 0x3a, 0x0b, 0x73, + 0x5c, 0x38, 0xd5, 0xd4, 0xfa, 0xb8, 0x9e, 0xa3, 0xaf, 0xcb, 0x1c, 0xb6, 0xa5, 0xf5, 0x31, 0xba, + 0x08, 0xf3, 0x02, 0x45, 0x30, 0xc9, 0x53, 0xac, 0x2a, 0x07, 0xf3, 0xde, 0xd0, 0x32, 0x1c, 0x15, + 0x88, 0x9a, 0x6d, 0xf8, 0xc8, 0x05, 0x8a, 0x7c, 0x84, 0xbf, 0x5a, 0xb3, 0x0d, 0x8e, 0x2f, 0x7f, + 0x0c, 0xa5, 0x8d, 0xad, 0xf6, 0xba, 0x65, 0xee, 0x1b, 0x5d, 0x22, 0xa2, 0x8b, 0x1d, 0x42, 0x53, + 0x97, 0xce, 0xe4, 0x89, 0x88, 0xbc, 0x89, 0x1a, 0x50, 0x74, 0xb1, 0xe6, 0x74, 0x0e, 0xb0, 0x5b, + 0xcf, 0xd1, 0x57, 0x7e, 0x9b, 0x50, 0x59, 0xb6, 0x67, 0x58, 0xa6, 0x5b, 0xcf, 0x33, 0x2a, 0xde, + 0x94, 0xff, 0x40, 0x82, 0x72, 0xcb, 0x72, 0xbc, 0xc7, 0x9a, 0x6d, 0x1b, 0x66, 0x17, 0xdd, 0x80, + 0x22, 0xd5, 0x65, 0xc7, 0xea, 0x51, 0x1d, 0x54, 0x57, 0x1a, 0xcb, 0xf1, 0x69, 0x59, 0x6e, 0x71, + 0x0c, 0xc5, 0xc7, 0x45, 0xe7, 0xa1, 0xda, 0xb1, 0x4c, 0x4f, 0x33, 0x4c, 0xec, 0xa8, 0xb6, 0xe5, + 0x78, 0x54, 0x45, 0xd3, 0x4a, 0xc5, 0x87, 0x92, 0x5e, 0xd0, 0x49, 0x28, 0x1d, 0x58, 0xae, 0xc7, + 0x30, 0xf2, 0x14, 0xa3, 0x48, 0x00, 0xf4, 0xe5, 0x22, 0xcc, 0xd2, 0x97, 0x86, 0xcd, 0x95, 0x31, + 0x43, 0x9a, 0x4d, 0x5b, 0xfe, 0x95, 0x04, 0xd3, 0x8f, 0xad, 0x81, 0xe9, 0xc5, 0xba, 0xd1, 0xbc, + 0x03, 0x3e, 0x51, 0xa1, 0x6e, 0x34, 0xef, 0x20, 0xe8, 0x86, 0x60, 0xb0, 0xb9, 0x62, 0xdd, 0x90, + 0x97, 0x0d, 0x28, 0x3a, 0x58, 0xd3, 0x2d, 0xb3, 0x77, 0x48, 0x45, 0x28, 0x2a, 0x7e, 0x9b, 0x4c, + 0xa2, 0x8b, 0x7b, 0x86, 0x39, 0x78, 0xae, 0x3a, 0xb8, 0xa7, 0xed, 0xe1, 0x1e, 0x15, 0xa5, 0xa8, + 0x54, 0x39, 0x58, 0x61, 0x50, 0xb4, 0x01, 0x65, 0xdb, 0xb1, 0x6c, 0xad, 0xab, 0x11, 0x3d, 0xd6, + 0xa7, 0xa9, 0xaa, 0xe4, 0x61, 0x55, 0x51, 0xb1, 0x5b, 0x01, 0xa6, 0x12, 0x26, 0x93, 0xff, 0x51, + 0x82, 0x79, 0x62, 0x3c, 0xae, 0xad, 0x75, 0xf0, 0x36, 0x9d, 0x12, 0x74, 0x13, 0x66, 0x4d, 0xec, + 0x3d, 0xb3, 0x9c, 0x27, 0x7c, 0x02, 0x4e, 0x0f, 0x73, 0xf5, 0x69, 0x1e, 0x5b, 0x3a, 0x56, 0x04, + 0x3e, 0xba, 0x0e, 0x79, 0xdb, 0xd0, 0xe9, 0x80, 0x33, 0x90, 0x11, 0x5c, 0x42, 0x62, 0xd8, 0x1d, + 0xaa, 0x87, 0x2c, 0x24, 0x86, 0xdd, 0x21, 0xca, 0xf5, 0x34, 0xa7, 0x8b, 0x3d, 0xd5, 0xd0, 0xf9, + 0x44, 0x15, 0x19, 0xa0, 0xa9, 0xcb, 0x32, 0x40, 0xd3, 0xf4, 0x6e, 0xbc, 0xf9, 0xbe, 0xd6, 0x1b, + 0x60, 0xb4, 0x00, 0xd3, 0x4f, 0xc9, 0x03, 0x1d, 0x49, 0x5e, 0x61, 0x0d, 0xf9, 0x8b, 0x02, 0x9c, + 0x7c, 0x44, 0x94, 0xd9, 0xd6, 0x4c, 0x7d, 0xcf, 0x7a, 0xde, 0xc6, 0x9d, 0x81, 0x63, 0x78, 0x87, + 0xeb, 0x96, 0xe9, 0xe1, 0xe7, 0x1e, 0xda, 0x82, 0x23, 0xa6, 0xe8, 0x56, 0x15, 0x76, 0x4b, 0x38, + 0x94, 0x57, 0xce, 0x8e, 0x90, 0x90, 0xe9, 0x4f, 0xa9, 0x99, 0x51, 0x80, 0x8b, 0x1e, 0x06, 0x93, + 0x2a, 0xb8, 0xe5, 0x28, 0xb7, 0x84, 0xf1, 0xb6, 0x37, 0xa9, 0x64, 0x9c, 0x97, 0x98, 0x75, 0xc1, + 0xe9, 0x5d, 0x20, 0x4b, 0x5e, 0xd5, 0x5c, 0x75, 0xe0, 0x62, 0x87, 0x6a, 0xad, 0xbc, 0xf2, 0xca, + 0x30, 0x97, 0x40, 0x05, 0x4a, 0xc9, 0x19, 0x98, 0x6b, 0xee, 0xae, 0x8b, 0x1d, 0x74, 0x9b, 0x3a, + 0x11, 0x42, 0xdd, 0x75, 0xac, 0x81, 0x5d, 0x2f, 0x66, 0x20, 0x07, 0x4a, 0xfe, 0x80, 0xe0, 0x53, + 0x0f, 0xc3, 0x0d, 0x55, 0x75, 0x2c, 0xcb, 0xdb, 0x77, 0x85, 0x71, 0x0a, 0xb0, 0x42, 0xa1, 0xe8, + 0x1a, 0x1c, 0x75, 0x07, 0xb6, 0xdd, 0xc3, 0x7d, 0x6c, 0x7a, 0x5a, 0x8f, 0x75, 0xe7, 0xd6, 0xa7, + 0xcf, 0xe4, 0x2f, 0xe5, 0x15, 0x14, 0x7e, 0x45, 0x19, 0xbb, 0x68, 0x09, 0xc0, 0x76, 0x8c, 0xa7, + 0x46, 0x0f, 0x77, 0xb1, 0x5e, 0x9f, 0xa1, 0x4c, 0x43, 0x10, 0x74, 0x8b, 0x78, 0x9d, 0x4e, 0xc7, + 0xea, 0xdb, 0xf5, 0x52, 0xda, 0x3c, 0x88, 0x59, 0x6c, 0x39, 0xd6, 0xbe, 0xd1, 0xc3, 0x8a, 0xa0, + 0x40, 0xef, 0x41, 0x51, 0xb3, 0x6d, 0xcd, 0xe9, 0x5b, 0x4e, 0x1d, 0xb2, 0x52, 0xfb, 0x24, 0xe8, + 0x4d, 0x58, 0xe0, 0x9c, 0x54, 0x9b, 0xbd, 0x64, 0xcb, 0x7a, 0x96, 0x58, 0xde, 0xbd, 0x5c, 0x5d, + 0x52, 0x10, 0x7f, 0xcf, 0x69, 0xc9, 0x22, 0x97, 0xff, 0x56, 0x82, 0xf9, 0x18, 0x4f, 0xd4, 0x82, + 0x39, 0xc1, 0xc1, 0x3b, 0xb4, 0x31, 0x5f, 0x5e, 0x57, 0xc7, 0x0a, 0xb3, 0xcc, 0x7f, 0x77, 0x0e, + 0x6d, 0x4c, 0xd7, 0xaf, 0x68, 0xa0, 0x73, 0x50, 0xe9, 0x59, 0x1d, 0xad, 0x47, 0x9d, 0x8d, 0x83, + 0xf7, 0xb9, 0xaf, 0x99, 0xf3, 0x81, 0x0a, 0xde, 0x97, 0xef, 0x42, 0x39, 0xc4, 0x00, 0x21, 0xa8, + 0x2a, 0xac, 0xc3, 0x0d, 0xbc, 0xaf, 0x0d, 0x7a, 0x5e, 0x6d, 0x0a, 0x55, 0x01, 0x76, 0xcd, 0x0e, + 0xf1, 0xf0, 0x26, 0xd6, 0x6b, 0x12, 0xaa, 0x40, 0xe9, 0x91, 0x60, 0x51, 0xcb, 0xc9, 0x7f, 0x92, + 0x87, 0x63, 0xd4, 0x2c, 0x5b, 0x96, 0xce, 0xd7, 0x0c, 0xdf, 0x0e, 0xce, 0x41, 0xa5, 0x43, 0x67, + 0x57, 0xb5, 0x35, 0x07, 0x9b, 0x1e, 0x77, 0x87, 0x73, 0x0c, 0xd8, 0xa2, 0x30, 0xf4, 0x21, 0xd4, + 0x5c, 0x3e, 0x22, 0xb5, 0xc3, 0xd6, 0x18, 0x5f, 0x00, 0x09, 0x63, 0x1f, 0xb1, 0x30, 0x95, 0x79, + 0x77, 0x68, 0xa5, 0xce, 0xba, 0x87, 0x6e, 0xc7, 0xeb, 0xb1, 0x7d, 0xa5, 0xbc, 0xf2, 0x66, 0x0a, + 0xc3, 0xb8, 0xe0, 0xcb, 0x6d, 0x46, 0xb6, 0x69, 0x7a, 0xce, 0xa1, 0x22, 0x98, 0xa0, 0x4d, 0x28, + 0x5a, 0x4f, 0xb1, 0x73, 0x80, 0x35, 0xe6, 0x59, 0xca, 0x2b, 0x97, 0x53, 0x18, 0xae, 0x0b, 0x7f, + 0xaf, 0x60, 0xd7, 0x1a, 0x38, 0x1d, 0xec, 0x2a, 0x3e, 0x29, 0x7a, 0x00, 0x25, 0x47, 0x80, 0xa9, + 0x6b, 0x9e, 0x88, 0x4f, 0x40, 0xdb, 0x58, 0x85, 0xb9, 0xb0, 0xa0, 0xa8, 0x06, 0xf9, 0x27, 0xf8, + 0x90, 0x2b, 0x99, 0x3c, 0x06, 0x1e, 0x8e, 0xcd, 0x3c, 0x6b, 0xac, 0xe6, 0xde, 0x91, 0x64, 0x07, + 0x50, 0x30, 0xea, 0xc7, 0xd8, 0xd3, 0x74, 0xcd, 0xd3, 0x10, 0x82, 0x02, 0x0d, 0x20, 0x18, 0x0b, + 0xfa, 0x4c, 0xb8, 0x0e, 0xb8, 0xdb, 0x2e, 0x29, 0xe4, 0x11, 0xbd, 0x02, 0x25, 0xdf, 0x8b, 0xf1, + 0x28, 0x22, 0x00, 0x90, 0xdd, 0x5c, 0xf3, 0x3c, 0xdc, 0xb7, 0x3d, 0xaa, 0xa4, 0x8a, 0x22, 0x9a, + 0xf2, 0x9f, 0x4e, 0x43, 0x6d, 0xc8, 0x46, 0xee, 0x42, 0xb1, 0xcf, 0xbb, 0xe7, 0x5e, 0xf4, 0xd5, + 0x84, 0x2d, 0x7d, 0x48, 0x54, 0xc5, 0xa7, 0x22, 0x3b, 0x26, 0xb1, 0xc4, 0x50, 0xe4, 0xe3, 0xb7, + 0xd9, 0x12, 0xe8, 0xaa, 0xba, 0xe1, 0xe0, 0x8e, 0x67, 0x39, 0x87, 0x5c, 0xdc, 0xb9, 0x9e, 0xd5, + 0xdd, 0x10, 0x30, 0xb4, 0x0a, 0xa0, 0x9b, 0xae, 0x4a, 0x2d, 0xbc, 0xcb, 0x67, 0xf6, 0xe4, 0xb0, + 0x10, 0x7e, 0x98, 0xa3, 0x94, 0x74, 0xd3, 0xe5, 0xe2, 0xdf, 0x83, 0x0a, 0x89, 0x16, 0xd4, 0x3e, + 0x8b, 0x50, 0x98, 0x1b, 0x2b, 0xaf, 0x9c, 0x4a, 0x1a, 0x83, 0x1f, 0xc7, 0x28, 0x73, 0x76, 0xd0, + 0x70, 0xd1, 0x7d, 0x98, 0xa1, 0xdb, 0xb6, 0x5b, 0x9f, 0xa1, 0xc4, 0xcb, 0xa3, 0x14, 0xc0, 0x2d, + 0xf4, 0x11, 0x25, 0x60, 0x06, 0xca, 0xa9, 0xd1, 0x2e, 0x94, 0x35, 0xd3, 0xb4, 0x3c, 0x8d, 0xed, + 0x22, 0xb3, 0x94, 0xd9, 0x1b, 0x19, 0x98, 0xad, 0x05, 0x54, 0x8c, 0x63, 0x98, 0x0f, 0x7a, 0x0f, + 0xa6, 0xe9, 0x36, 0xc3, 0x77, 0x84, 0x8b, 0x19, 0x17, 0x91, 0xc2, 0xa8, 0xd0, 0x3a, 0xcc, 0x3e, + 0x33, 0x4c, 0xdd, 0x7a, 0xe6, 0x72, 0xef, 0x9c, 0x60, 0xec, 0x1f, 0x30, 0x84, 0x21, 0x16, 0x82, + 0xb2, 0x71, 0x13, 0xca, 0xa1, 0x11, 0x4f, 0x62, 0xe9, 0x8d, 0xdb, 0x50, 0x8b, 0x8f, 0x6f, 0xa2, + 0x95, 0xf2, 0x5b, 0xb0, 0xa0, 0x0c, 0xcc, 0x40, 0x34, 0x11, 0xbc, 0xaf, 0xc2, 0x0c, 0xb7, 0x18, + 0x66, 0xb6, 0xf2, 0x78, 0x45, 0x2b, 0x9c, 0x22, 0x1c, 0x8d, 0x1f, 0x68, 0xa6, 0xde, 0xc3, 0x0e, + 0xef, 0x57, 0x44, 0xe3, 0x0f, 0x19, 0x54, 0x7e, 0x0f, 0x8e, 0xc5, 0x3a, 0xe7, 0x87, 0x81, 0x57, + 0xa1, 0x6a, 0x5b, 0xba, 0xea, 0x32, 0x30, 0x89, 0x75, 0xb8, 0x6f, 0xb5, 0x7d, 0xdc, 0xa6, 0x4e, + 0xc8, 0xdb, 0x9e, 0x65, 0x0f, 0x0b, 0x9f, 0x8d, 0xbc, 0x0e, 0xc7, 0xe3, 0xe4, 0xac, 0x7b, 0xf9, + 0x0e, 0x2c, 0x2a, 0xb8, 0x6f, 0x3d, 0xc5, 0x2f, 0xca, 0xba, 0x01, 0xf5, 0x61, 0x06, 0x9c, 0xf9, + 0x47, 0xb0, 0x18, 0x40, 0xdb, 0x9e, 0xe6, 0x0d, 0xdc, 0x89, 0x98, 0xf3, 0x93, 0xd2, 0x9e, 0xe5, + 0xb2, 0xe9, 0x2c, 0x2a, 0xa2, 0x29, 0x2f, 0xc2, 0x74, 0xcb, 0xd2, 0x9b, 0x2d, 0x54, 0x85, 0x9c, + 0x61, 0x73, 0xe2, 0x9c, 0x61, 0xcb, 0x46, 0xb8, 0xcf, 0x2d, 0x16, 0xb1, 0xb2, 0xae, 0xe3, 0xa8, + 0xe8, 0x36, 0x54, 0x35, 0x5d, 0x37, 0x88, 0x39, 0x69, 0x3d, 0xd5, 0xb0, 0xd9, 0x81, 0xa6, 0xbc, + 0xb2, 0x98, 0x68, 0x00, 0xcd, 0x96, 0x52, 0x09, 0xd0, 0x9b, 0xb6, 0x2b, 0x3f, 0x84, 0x92, 0x1f, + 0x15, 0x92, 0xd8, 0x25, 0x1a, 0xf5, 0x65, 0x88, 0x21, 0xfd, 0xe3, 0xd1, 0xce, 0xd0, 0xc6, 0xcb, + 0x45, 0xbe, 0x05, 0xe0, 0x3b, 0x64, 0x11, 0x9c, 0x9e, 0x1c, 0xc1, 0x58, 0x09, 0xa1, 0xcb, 0x3f, + 0x89, 0xb8, 0xe9, 0x90, 0x12, 0x74, 0x5f, 0x09, 0x7a, 0xc4, 0x6d, 0xe7, 0x5e, 0xc8, 0x6d, 0xbf, + 0x0d, 0xd3, 0xae, 0xa7, 0x79, 0x98, 0x47, 0xf7, 0x67, 0x47, 0x91, 0x13, 0x21, 0xb0, 0xc2, 0xf0, + 0xd1, 0x29, 0x80, 0x8e, 0x83, 0x35, 0x0f, 0xeb, 0xaa, 0xc6, 0xf6, 0x98, 0xbc, 0x52, 0xe2, 0x90, + 0x35, 0x8f, 0xf8, 0x1b, 0x71, 0x42, 0x49, 0xdd, 0x5c, 0x53, 0xa6, 0x3a, 0x38, 0xab, 0xf8, 0x3e, + 0x6f, 0x26, 0xa3, 0xcf, 0xe3, 0x0c, 0xb8, 0xcf, 0x0b, 0x3c, 0xfa, 0xec, 0x78, 0x8f, 0xce, 0x48, + 0xb3, 0x78, 0xf4, 0xe2, 0x78, 0x8f, 0xce, 0x99, 0x8d, 0xf6, 0xe8, 0x09, 0xee, 0xa7, 0x94, 0xe4, + 0x7e, 0xbe, 0x4d, 0xb7, 0xfb, 0x2f, 0x12, 0xd4, 0x87, 0xbd, 0x00, 0xf7, 0x7e, 0xab, 0x30, 0xe3, + 0x52, 0x48, 0x16, 0xdf, 0xcb, 0x69, 0x39, 0x05, 0x7a, 0x08, 0x05, 0xc3, 0xdc, 0xb7, 0xf8, 0xa2, + 0x7d, 0x33, 0x03, 0x25, 0xef, 0x75, 0xb9, 0x69, 0xee, 0x5b, 0x4c, 0x9b, 0x94, 0x43, 0xe3, 0x6d, + 0x28, 0xf9, 0xa0, 0x89, 0xc6, 0xb6, 0x0d, 0x0b, 0x31, 0xdb, 0x66, 0x07, 0x52, 0x7f, 0x49, 0x48, + 0x93, 0x2d, 0x09, 0xf9, 0xf3, 0x5c, 0x78, 0xc9, 0xde, 0x37, 0x7a, 0x1e, 0x76, 0x86, 0x96, 0xec, + 0xbb, 0x82, 0x3b, 0x5b, 0xaf, 0x17, 0xc6, 0x72, 0x67, 0x67, 0x3c, 0xbe, 0xea, 0x3e, 0x81, 0x2a, + 0x35, 0x4a, 0xd5, 0xc5, 0x3d, 0x1a, 0x37, 0xf1, 0x98, 0xfa, 0xad, 0x51, 0x6c, 0x98, 0x24, 0xcc, + 0xb4, 0xdb, 0x9c, 0x8e, 0x69, 0xb0, 0xd2, 0x0b, 0xc3, 0x1a, 0x77, 0x01, 0x0d, 0x23, 0x4d, 0xa4, + 0xd3, 0x36, 0xf1, 0x85, 0xae, 0x97, 0xb8, 0x4f, 0xef, 0x53, 0x31, 0xb2, 0xd8, 0x0a, 0x13, 0x58, + 0xe1, 0x14, 0xf2, 0x7f, 0xe5, 0x01, 0x82, 0x97, 0xff, 0x8f, 0x9c, 0xe0, 0x5d, 0xdf, 0x01, 0xb1, + 0x78, 0xf4, 0xd2, 0x28, 0xc6, 0x89, 0xae, 0x67, 0x3b, 0xea, 0x7a, 0x58, 0x64, 0x7a, 0x75, 0x24, + 0x9b, 0x89, 0x9d, 0xce, 0xec, 0x77, 0xcd, 0xe9, 0x3c, 0x82, 0xe3, 0x71, 0x23, 0xe2, 0x1e, 0x67, + 0x05, 0xa6, 0x0d, 0x0f, 0xf7, 0xd9, 0xbd, 0x66, 0xe2, 0xb5, 0x48, 0x88, 0x88, 0xa1, 0xca, 0xb7, + 0xe1, 0x78, 0x74, 0xf6, 0x26, 0x0b, 0x63, 0x64, 0x25, 0x1e, 0x07, 0x05, 0x0e, 0x90, 0xdb, 0xcd, + 0x88, 0x8b, 0xa7, 0x38, 0x25, 0xc3, 0x97, 0xff, 0x5e, 0x82, 0x63, 0xb1, 0x57, 0x29, 0xee, 0x42, + 0x1b, 0x5a, 0xf0, 0xcc, 0x63, 0xae, 0x8e, 0xed, 0xeb, 0x1b, 0x5c, 0xf5, 0xbf, 0x09, 0x8d, 0xe8, + 0x84, 0x45, 0xd4, 0x7c, 0x27, 0xb6, 0xf4, 0x2f, 0x66, 0x14, 0xdd, 0x5f, 0xff, 0xef, 0xc3, 0xc9, + 0x44, 0xf6, 0xc3, 0xb3, 0x90, 0x9f, 0x68, 0x16, 0x7e, 0x96, 0x0f, 0xef, 0x00, 0x6b, 0x9e, 0xe7, + 0x18, 0x7b, 0x03, 0x0f, 0x7f, 0x1d, 0x61, 0xd6, 0xf7, 0x7d, 0x4f, 0xc0, 0xfc, 0xf5, 0xca, 0x28, + 0xfa, 0x40, 0x92, 0x44, 0x9f, 0xf0, 0x51, 0xd4, 0x27, 0x14, 0x28, 0xc3, 0xb7, 0x33, 0x32, 0x1c, + 0xe9, 0x1d, 0xbe, 0xcd, 0x45, 0xff, 0x6b, 0x09, 0xe6, 0x63, 0xf3, 0x84, 0xee, 0x03, 0x68, 0xbe, + 0xe8, 0xdc, 0x7a, 0x2e, 0x64, 0x1b, 0xa8, 0x12, 0xa2, 0x24, 0x7b, 0x2e, 0x8b, 0x23, 0x53, 0xf7, + 0xdc, 0x84, 0x38, 0xd2, 0x0f, 0x23, 0xef, 0x05, 0x47, 0x67, 0x76, 0x99, 0x7b, 0x29, 0xc3, 0xd1, + 0x99, 0x71, 0x10, 0x84, 0xf2, 0x2f, 0x72, 0xb0, 0x90, 0xd4, 0x07, 0x7a, 0x1d, 0xf2, 0x1d, 0x7b, + 0xc0, 0xc7, 0x96, 0x90, 0x46, 0x59, 0xb7, 0x07, 0xbb, 0xae, 0xd6, 0xc5, 0x0a, 0x41, 0x43, 0x6f, + 0xc1, 0x4c, 0x1f, 0xf7, 0x2d, 0xe7, 0x90, 0x8f, 0x24, 0xe1, 0x82, 0xe3, 0x31, 0x7d, 0xcf, 0x68, + 0x38, 0x32, 0x7a, 0x27, 0x08, 0xc6, 0xd9, 0x08, 0x96, 0x12, 0x4e, 0x21, 0x0c, 0x81, 0x11, 0xfa, + 0x11, 0xf8, 0x3b, 0x30, 0x6b, 0x3b, 0x56, 0x07, 0xbb, 0x2e, 0xbf, 0x91, 0x59, 0x4a, 0xcc, 0xf4, + 0x10, 0x04, 0x4e, 0xc9, 0xd1, 0xd1, 0x5d, 0x00, 0x3f, 0xdf, 0x22, 0xf6, 0xbf, 0x33, 0x09, 0xe3, + 0x13, 0x38, 0x4c, 0x61, 0x21, 0x1a, 0x72, 0xee, 0x4d, 0x56, 0xab, 0xfc, 0x77, 0x12, 0xcc, 0x85, + 0xe5, 0x45, 0xaf, 0x40, 0x89, 0xb0, 0x75, 0x3d, 0xad, 0x6f, 0xf3, 0x3c, 0x42, 0x00, 0x40, 0x3b, + 0x70, 0x44, 0x67, 0xd7, 0xa8, 0xaa, 0x61, 0x7a, 0xd8, 0xd9, 0xd7, 0x3a, 0x22, 0xfc, 0xba, 0x98, + 0xaa, 0x88, 0xa6, 0xc0, 0x64, 0xe3, 0xaa, 0x71, 0x0e, 0x3e, 0x18, 0x3d, 0x00, 0xf0, 0xb9, 0x89, + 0x65, 0x9d, 0x99, 0x5d, 0x88, 0x54, 0xfe, 0xbd, 0x1c, 0x1c, 0x4b, 0xc4, 0x4a, 0xbc, 0x08, 0x7c, + 0x07, 0x8a, 0xce, 0x73, 0x75, 0xef, 0xd0, 0xc3, 0x6e, 0xba, 0x11, 0xec, 0x86, 0xb2, 0x03, 0xb3, + 0xce, 0xf3, 0x7b, 0x04, 0x1b, 0xad, 0x42, 0xc9, 0x79, 0xae, 0x62, 0xc7, 0xb1, 0x1c, 0x61, 0xc9, + 0x63, 0x48, 0x8b, 0xce, 0xf3, 0x4d, 0x8a, 0x4e, 0x7a, 0xf5, 0x44, 0xaf, 0x85, 0x4c, 0xbd, 0x7a, + 0x41, 0xaf, 0x9e, 0xdf, 0xeb, 0x74, 0xa6, 0x5e, 0x3d, 0xde, 0xab, 0x6c, 0xc3, 0x5c, 0xd8, 0xb8, + 0xc6, 0x4c, 0xf3, 0x3d, 0xa8, 0x70, 0xe3, 0x53, 0x3b, 0xd6, 0xc0, 0xf4, 0xb2, 0xa9, 0x67, 0x8e, + 0xd3, 0xac, 0x13, 0x12, 0xf9, 0x17, 0x12, 0x94, 0x9a, 0x7d, 0xad, 0x8b, 0xdb, 0x36, 0xee, 0x10, + 0x6f, 0x65, 0x90, 0x06, 0x9f, 0x00, 0xd6, 0x40, 0x5b, 0x51, 0xff, 0xcb, 0xf6, 0xe3, 0xd7, 0x13, + 0x32, 0x34, 0x82, 0xcf, 0x18, 0xa7, 0xfb, 0xb2, 0x9e, 0x73, 0x05, 0x8a, 0x3f, 0xc0, 0x87, 0xec, + 0xec, 0x92, 0x91, 0x4e, 0xfe, 0x79, 0x01, 0x16, 0x53, 0xee, 0xb6, 0x69, 0x50, 0x6b, 0x0f, 0x54, + 0x1b, 0x3b, 0x86, 0xa5, 0x0b, 0x35, 0x77, 0xec, 0x41, 0x8b, 0x02, 0xd0, 0x49, 0x20, 0x0d, 0xf5, + 0xb3, 0x81, 0xc5, 0x77, 0xc3, 0xbc, 0x52, 0xec, 0xd8, 0x83, 0xdf, 0x20, 0x6d, 0x41, 0xeb, 0x1e, + 0x68, 0x0e, 0x66, 0x46, 0xc6, 0x68, 0xdb, 0x14, 0x80, 0xae, 0xc3, 0x31, 0xe6, 0x92, 0xd4, 0x9e, + 0xd1, 0x37, 0xc8, 0x72, 0x0c, 0xd9, 0x54, 0x5e, 0x41, 0xec, 0xe5, 0x23, 0xf2, 0xae, 0x69, 0x32, + 0xfb, 0x91, 0xa1, 0x62, 0x59, 0x7d, 0xd5, 0xed, 0x58, 0x0e, 0x56, 0x35, 0xfd, 0x53, 0x6a, 0x43, + 0x79, 0xa5, 0x6c, 0x59, 0xfd, 0x36, 0x81, 0xad, 0xe9, 0x9f, 0xa2, 0xd3, 0x50, 0xee, 0xd8, 0x03, + 0x17, 0x7b, 0x2a, 0xf9, 0xa1, 0xb7, 0x05, 0x25, 0x05, 0x18, 0x68, 0xdd, 0x1e, 0xb8, 0x21, 0x84, + 0x3e, 0x89, 0x1e, 0x67, 0xc3, 0x08, 0x8f, 0x71, 0x9f, 0xa6, 0xff, 0x0e, 0x06, 0x5d, 0x6c, 0x6b, + 0x5d, 0xcc, 0x44, 0x13, 0xc7, 0xfc, 0x84, 0xf4, 0xdf, 0x43, 0x8e, 0x48, 0xc5, 0x54, 0xaa, 0x07, + 0xe1, 0xa6, 0x8b, 0x5a, 0x30, 0x3b, 0x30, 0x8d, 0x7d, 0x03, 0xeb, 0xf5, 0x12, 0xe5, 0x70, 0x23, + 0x73, 0x56, 0x61, 0x79, 0x97, 0x11, 0xf2, 0x84, 0x07, 0x67, 0x83, 0x56, 0xa1, 0xc1, 0x95, 0xe6, + 0x3e, 0xd3, 0xec, 0xb8, 0xe6, 0x80, 0xaa, 0xe3, 0x38, 0xc3, 0x68, 0x3f, 0xd3, 0xec, 0xb0, 0xf6, + 0x1a, 0xab, 0x30, 0x17, 0x66, 0x3a, 0x91, 0x5d, 0xdd, 0x83, 0x4a, 0x64, 0xa8, 0x64, 0xe6, 0xa9, + 0x82, 0x5c, 0xe3, 0xc7, 0x62, 0x49, 0x14, 0x09, 0xa0, 0x6d, 0xfc, 0x98, 0xa6, 0x71, 0xa9, 0x64, + 0x94, 0x4f, 0x41, 0x61, 0x0d, 0x59, 0x83, 0x4a, 0x24, 0x5b, 0x4a, 0x5c, 0x1a, 0x4d, 0x8b, 0x72, + 0x97, 0x46, 0x9e, 0x09, 0xcc, 0xb1, 0x7a, 0x42, 0x02, 0xfa, 0x4c, 0x60, 0x34, 0xff, 0xc6, 0x32, + 0x05, 0xf4, 0x99, 0x76, 0x81, 0x9f, 0xf2, 0x74, 0x7b, 0x49, 0x61, 0x0d, 0x59, 0x07, 0x58, 0xd7, + 0x6c, 0x6d, 0xcf, 0xe8, 0x19, 0xde, 0x21, 0xba, 0x0c, 0x35, 0x4d, 0xd7, 0xd5, 0x8e, 0x80, 0x18, + 0x58, 0x14, 0x41, 0xcc, 0x6b, 0xba, 0xbe, 0x1e, 0x02, 0xa3, 0xd7, 0xe0, 0x88, 0xee, 0x58, 0x76, + 0x14, 0x97, 0x55, 0x45, 0xd4, 0xc8, 0x8b, 0x30, 0xb2, 0xfc, 0x1f, 0x33, 0x70, 0x2a, 0x3a, 0x6d, + 0xf1, 0x8c, 0xf4, 0x5d, 0x98, 0x8b, 0xf5, 0x9a, 0x92, 0xb9, 0x0d, 0xa4, 0x55, 0x22, 0x14, 0xb1, + 0x0c, 0x6b, 0x6e, 0x28, 0xc3, 0x9a, 0x98, 0xf3, 0xce, 0x7f, 0xa5, 0x39, 0xef, 0xc2, 0x57, 0x92, + 0xf3, 0x9e, 0x7e, 0xb9, 0x9c, 0xf7, 0xdc, 0x84, 0x39, 0xef, 0x0b, 0xf4, 0x4c, 0x2b, 0x7a, 0xa7, + 0x3b, 0x26, 0x73, 0x01, 0x15, 0xbf, 0x0f, 0x53, 0x54, 0xdf, 0xc4, 0x72, 0xe3, 0xb3, 0x93, 0xe4, + 0xc6, 0x8b, 0xa9, 0xb9, 0xf1, 0x33, 0x30, 0x67, 0x5a, 0xaa, 0x89, 0x9f, 0xa9, 0x64, 0xba, 0xdc, + 0x7a, 0x99, 0xcd, 0x9d, 0x69, 0x6d, 0xe1, 0x67, 0x2d, 0x02, 0x41, 0x67, 0x61, 0xae, 0xaf, 0xb9, + 0x4f, 0xb0, 0x4e, 0x13, 0xd3, 0x6e, 0xbd, 0x42, 0xed, 0xac, 0xcc, 0x60, 0x2d, 0x02, 0x42, 0xe7, + 0xc1, 0x97, 0x83, 0x23, 0x55, 0x29, 0x52, 0x45, 0x40, 0x19, 0x5a, 0x28, 0xcf, 0x3e, 0xff, 0x52, + 0x79, 0xf6, 0xda, 0xe4, 0x79, 0xf6, 0xab, 0x50, 0x13, 0xcf, 0x22, 0xd1, 0xce, 0xee, 0x2c, 0x69, + 0x8e, 0x7d, 0x5e, 0xbc, 0x13, 0xc9, 0xf4, 0xb4, 0xb4, 0x3c, 0x8c, 0x4c, 0xcb, 0xff, 0xb9, 0xc4, + 0x63, 0x65, 0x7f, 0xa9, 0xf1, 0x2c, 0x5f, 0x24, 0x65, 0x2b, 0xbd, 0x78, 0xca, 0x16, 0xfd, 0x30, + 0x35, 0xd9, 0x7d, 0x6d, 0x1c, 0xbf, 0x71, 0xe9, 0x6e, 0xf9, 0x77, 0x24, 0x38, 0xc5, 0xc3, 0xd6, + 0x94, 0xd2, 0x95, 0x04, 0x73, 0x95, 0x52, 0xcc, 0xb5, 0xe3, 0x60, 0x1d, 0x9b, 0x9e, 0xa1, 0xf5, + 0x54, 0xd7, 0xc6, 0x1d, 0x91, 0x9e, 0x0a, 0xc0, 0x34, 0x4c, 0x39, 0x0b, 0x73, 0xac, 0x92, 0x89, + 0x47, 0xea, 0xac, 0x60, 0xa9, 0x4c, 0x8b, 0x99, 0x18, 0x48, 0x1e, 0xc0, 0x62, 0x4a, 0x76, 0x2f, + 0x51, 0x19, 0x52, 0x9a, 0x32, 0x46, 0x8e, 0x6c, 0x58, 0x19, 0xbf, 0x2b, 0xc1, 0x69, 0x4e, 0x92, + 0xea, 0x37, 0xbf, 0x0d, 0x75, 0xfc, 0x85, 0xe4, 0x9f, 0x2d, 0xe2, 0x46, 0xd6, 0x1c, 0x36, 0xb2, + 0xd7, 0x52, 0xf5, 0x30, 0xda, 0xcc, 0x3e, 0x49, 0x35, 0xb3, 0xeb, 0xe3, 0x39, 0x8e, 0xd5, 0xed, + 0x1f, 0x4b, 0x70, 0x22, 0x55, 0x8c, 0x58, 0x20, 0x26, 0xc5, 0x03, 0x31, 0x1e, 0xc4, 0x05, 0x71, + 0x32, 0x0b, 0xe2, 0x68, 0x10, 0xcc, 0xa3, 0x25, 0xb5, 0xaf, 0x3d, 0x37, 0xfa, 0x83, 0x3e, 0x8f, + 0xe2, 0x08, 0xbb, 0xc7, 0x0c, 0xf2, 0x02, 0x61, 0x9c, 0xbc, 0x06, 0x47, 0x7c, 0x29, 0x47, 0x16, + 0x3a, 0x84, 0x0a, 0x17, 0x72, 0xd1, 0xc2, 0x05, 0x13, 0x66, 0x36, 0xf0, 0x53, 0xa3, 0x83, 0xbf, + 0x92, 0x0a, 0xbf, 0x33, 0x50, 0xb6, 0xb1, 0xd3, 0x37, 0x5c, 0xd7, 0xdf, 0x46, 0x4b, 0x4a, 0x18, + 0x24, 0xff, 0xfb, 0x0c, 0xcc, 0xc7, 0xad, 0xe3, 0xce, 0x50, 0x9d, 0xc4, 0xb9, 0x11, 0x67, 0xda, + 0x84, 0x8b, 0xa0, 0xeb, 0xe2, 0x48, 0x91, 0x4b, 0x4b, 0x07, 0xfa, 0xc7, 0x06, 0x71, 0xde, 0xa8, + 0xc3, 0x6c, 0xc7, 0xea, 0xf7, 0x35, 0x53, 0x17, 0x85, 0x99, 0xbc, 0x49, 0xf4, 0xa7, 0x39, 0x5d, + 0x76, 0x05, 0x54, 0x52, 0xe8, 0x33, 0x99, 0x3c, 0x72, 0x92, 0x34, 0x4c, 0x5a, 0x6f, 0x41, 0xb7, + 0xe2, 0x92, 0x02, 0x1c, 0xb4, 0x61, 0x38, 0x68, 0x19, 0x0a, 0xd8, 0x7c, 0x2a, 0xee, 0x92, 0x13, + 0xae, 0x1c, 0xc4, 0x61, 0x42, 0xa1, 0x78, 0xe8, 0x1a, 0xcc, 0xf4, 0x89, 0x59, 0x88, 0x2c, 0xda, + 0x62, 0x4a, 0x01, 0xa3, 0xc2, 0xd1, 0xd0, 0x0a, 0xcc, 0xea, 0x74, 0x9e, 0x44, 0x0c, 0x5d, 0x4f, + 0xa8, 0xe2, 0xa0, 0x08, 0x8a, 0x40, 0x44, 0x9b, 0xfe, 0xfd, 0x58, 0x29, 0xed, 0x8a, 0x3b, 0x36, + 0x15, 0x89, 0x57, 0x63, 0x3b, 0xd1, 0xa3, 0x19, 0xa4, 0xdd, 0xb5, 0xc5, 0x79, 0x8d, 0xbe, 0x33, + 0x3f, 0x01, 0xc5, 0x9e, 0xd5, 0x65, 0x66, 0x54, 0x66, 0x35, 0xbf, 0x3d, 0xab, 0x4b, 0xad, 0x68, + 0x01, 0xa6, 0x5d, 0x4f, 0x37, 0x4c, 0x1a, 0xb3, 0x14, 0x15, 0xd6, 0x20, 0x8b, 0x8f, 0x3e, 0xa8, + 0x96, 0xd9, 0xc1, 0xf5, 0x0a, 0x7d, 0x55, 0xa2, 0x90, 0x6d, 0xb3, 0x43, 0x0f, 0x69, 0x9e, 0x77, + 0x58, 0xaf, 0x52, 0x38, 0x79, 0x0c, 0x2e, 0xa8, 0xe6, 0x47, 0x5e, 0x50, 0xc5, 0xc4, 0x4e, 0xb8, + 0xa0, 0xaa, 0x8d, 0xb9, 0xa0, 0x8a, 0x73, 0xf8, 0x2e, 0x94, 0x76, 0xfc, 0x95, 0x04, 0xc7, 0xd7, + 0x69, 0xce, 0x24, 0xe4, 0xc7, 0x26, 0x29, 0x34, 0xb8, 0xe9, 0xd7, 0x80, 0xa4, 0x26, 0xef, 0xe3, + 0xe3, 0x16, 0x25, 0x20, 0x4d, 0xa8, 0x0a, 0xe6, 0x9c, 0x45, 0x3e, 0x73, 0x19, 0x49, 0xc5, 0x0d, + 0x37, 0xe5, 0x77, 0x61, 0x71, 0x68, 0x14, 0xfc, 0x86, 0xfa, 0x2c, 0xcc, 0x05, 0xfe, 0xca, 0x1f, + 0x44, 0xd9, 0x87, 0x35, 0x75, 0x79, 0x15, 0x8e, 0xb5, 0x3d, 0xcd, 0xf1, 0x86, 0x54, 0x90, 0x81, + 0x96, 0x16, 0x88, 0x44, 0x69, 0x79, 0x0d, 0x47, 0x1b, 0x16, 0xda, 0x9e, 0x65, 0xbf, 0x00, 0x53, + 0xe2, 0x75, 0xc8, 0xf8, 0xad, 0x81, 0xd8, 0x1f, 0x44, 0x53, 0x5e, 0x64, 0xe5, 0x2c, 0xc3, 0xbd, + 0xdd, 0x82, 0xe3, 0xac, 0x9a, 0xe4, 0x45, 0x06, 0x71, 0x42, 0xd4, 0xb2, 0x0c, 0xf3, 0x7d, 0x0c, + 0x47, 0x23, 0xd7, 0x84, 0x3c, 0x4f, 0x7b, 0x23, 0x9a, 0xa7, 0x1d, 0x77, 0xb9, 0xe8, 0xa7, 0x69, + 0xff, 0x30, 0x17, 0xf2, 0xeb, 0x29, 0x69, 0x97, 0x5b, 0xd1, 0x2c, 0xed, 0xf9, 0x71, 0xbc, 0x23, + 0x49, 0xda, 0x61, 0xab, 0xcd, 0x27, 0x58, 0xed, 0xc7, 0x43, 0x99, 0x9d, 0x42, 0x5a, 0x2e, 0x3c, + 0x26, 0xed, 0x37, 0x92, 0xd3, 0x51, 0x58, 0x26, 0xd7, 0xef, 0xda, 0x4f, 0xe7, 0xdc, 0x8c, 0xa5, + 0x73, 0xce, 0x8e, 0x95, 0xd7, 0x4f, 0xe4, 0xfc, 0x59, 0x01, 0x4a, 0xfe, 0xbb, 0x21, 0x9d, 0x0f, + 0xab, 0x2d, 0x97, 0xa0, 0xb6, 0xf0, 0x0e, 0x9c, 0x7f, 0xa9, 0x1d, 0xb8, 0x90, 0x79, 0x07, 0x3e, + 0x09, 0x25, 0xfa, 0x40, 0xcb, 0x77, 0xd9, 0x8e, 0x5a, 0xa4, 0x00, 0x05, 0xef, 0x07, 0x66, 0x38, + 0x33, 0x91, 0x19, 0xc6, 0x72, 0xc7, 0xb3, 0xf1, 0xdc, 0xf1, 0x1d, 0x7f, 0x47, 0x2c, 0xa6, 0x5d, + 0x2d, 0xfb, 0x7c, 0x13, 0xf7, 0xc2, 0xd8, 0x35, 0x65, 0x29, 0xed, 0x9a, 0x32, 0xe0, 0xf2, 0x9d, + 0xcd, 0x0d, 0xed, 0xb2, 0x84, 0x70, 0xd8, 0x16, 0xb9, 0x67, 0xbd, 0x15, 0xc9, 0x32, 0xb0, 0x04, + 0xe0, 0xc9, 0x11, 0x63, 0x8c, 0x24, 0x18, 0x76, 0xe1, 0x78, 0x64, 0x6a, 0x82, 0x02, 0xb7, 0x6c, + 0xfe, 0x31, 0xa5, 0xba, 0xed, 0x7f, 0xa7, 0x43, 0xfe, 0x25, 0xa5, 0x70, 0xeb, 0xce, 0x50, 0x46, + 0x71, 0x42, 0x2b, 0xbe, 0x11, 0x2d, 0x59, 0x78, 0x41, 0xab, 0x1b, 0xaa, 0x58, 0xa0, 0x91, 0x8b, + 0xe6, 0xf0, 0xd7, 0xec, 0xaa, 0xb5, 0xc4, 0x21, 0x6b, 0xf4, 0x64, 0xb0, 0x6f, 0x98, 0x86, 0x7b, + 0xc0, 0xde, 0xcf, 0xb0, 0x93, 0x81, 0x00, 0xad, 0xd1, 0x2b, 0x42, 0xfc, 0xdc, 0xf0, 0xd4, 0x8e, + 0xa5, 0x63, 0x6a, 0xd3, 0xd3, 0x4a, 0x91, 0x00, 0xd6, 0x2d, 0x1d, 0x07, 0x2b, 0xaf, 0xf8, 0x62, + 0x2b, 0xaf, 0x14, 0x5b, 0x79, 0xc7, 0x61, 0xc6, 0xc1, 0x9a, 0x6b, 0x99, 0xec, 0x42, 0x41, 0xe1, + 0x2d, 0x32, 0x35, 0x7d, 0xec, 0xba, 0xa4, 0x27, 0x1e, 0xae, 0xf1, 0x66, 0x28, 0xcc, 0x9c, 0x1b, + 0x1b, 0x66, 0x8e, 0x28, 0x08, 0x8b, 0x85, 0x99, 0x95, 0xb1, 0x61, 0x66, 0xa6, 0x7a, 0xb0, 0x20, + 0xd0, 0xae, 0x66, 0x0b, 0xb4, 0xc3, 0x71, 0xe9, 0x7c, 0x24, 0x2e, 0xfd, 0x36, 0x17, 0xeb, 0xaf, + 0x24, 0x58, 0x1c, 0x5a, 0x56, 0x7c, 0xb9, 0xde, 0x8c, 0x55, 0x8c, 0x9d, 0x1d, 0xab, 0x33, 0xbf, + 0x60, 0xec, 0x41, 0xa4, 0x60, 0xec, 0x8d, 0xf1, 0x84, 0x5f, 0x79, 0xbd, 0xd8, 0xff, 0xe4, 0xe0, + 0xf4, 0xae, 0xad, 0xc7, 0x22, 0x3c, 0x7e, 0xec, 0xcf, 0xee, 0x38, 0xee, 0x44, 0x93, 0xd1, 0x13, + 0xdc, 0x60, 0xf1, 0x70, 0x7f, 0x33, 0x9e, 0x8f, 0x9e, 0xe8, 0x7e, 0x42, 0xd0, 0x22, 0x3d, 0xa9, + 0x8c, 0xe0, 0x5e, 0x42, 0xb2, 0x6c, 0xf4, 0x90, 0xbf, 0xe6, 0xe4, 0x96, 0x0c, 0x67, 0xd2, 0x05, + 0xe0, 0xf1, 0xe1, 0x8f, 0x60, 0x7e, 0xf3, 0x39, 0xee, 0xb4, 0x0f, 0xcd, 0xce, 0x04, 0xf3, 0x50, + 0x83, 0x7c, 0xa7, 0xaf, 0xf3, 0x0b, 0x7f, 0xf2, 0x18, 0x0e, 0x79, 0xf3, 0xd1, 0x90, 0x57, 0x85, + 0x5a, 0xd0, 0x03, 0xb7, 0xe5, 0xe3, 0xc4, 0x96, 0x75, 0x82, 0x4c, 0x98, 0xcf, 0x29, 0xbc, 0xc5, + 0xe1, 0xd8, 0x61, 0xc5, 0xe4, 0x0c, 0x8e, 0x1d, 0x27, 0xea, 0x1a, 0xf3, 0x51, 0xd7, 0x28, 0xff, + 0xbe, 0x04, 0x65, 0xd2, 0xc3, 0x4b, 0xc9, 0xcf, 0xcf, 0x95, 0xf9, 0xe0, 0x5c, 0xe9, 0x1f, 0x4f, + 0x0b, 0xe1, 0xe3, 0x69, 0x20, 0xf9, 0x34, 0x05, 0x0f, 0x4b, 0x3e, 0xe3, 0xc3, 0xb1, 0xe3, 0xc8, + 0x67, 0x60, 0x8e, 0xc9, 0xc6, 0x47, 0x5e, 0x83, 0xfc, 0xc0, 0xe9, 0x89, 0xf9, 0x1b, 0x38, 0x3d, + 0xf9, 0x67, 0x12, 0x54, 0xd6, 0x3c, 0x4f, 0xeb, 0x1c, 0x4c, 0x30, 0x00, 0x5f, 0xb8, 0x5c, 0x58, + 0xb8, 0xe1, 0x41, 0x04, 0xe2, 0x16, 0x52, 0xc4, 0x9d, 0x8e, 0x88, 0x2b, 0x43, 0x55, 0xc8, 0x92, + 0x2a, 0xf0, 0x16, 0xa0, 0x96, 0xe5, 0x78, 0xf7, 0x2d, 0xe7, 0x99, 0xe6, 0xe8, 0x93, 0x1d, 0x37, + 0x11, 0x14, 0xf8, 0xc7, 0xab, 0xf9, 0x4b, 0xd3, 0x0a, 0x7d, 0x96, 0x2f, 0xc2, 0xd1, 0x08, 0xbf, + 0xd4, 0x8e, 0xef, 0x42, 0x99, 0x6e, 0x72, 0xfc, 0xdc, 0x71, 0x3d, 0x9c, 0x61, 0xce, 0xb4, 0x25, + 0xca, 0xdf, 0x87, 0x23, 0x24, 0x18, 0xa2, 0x70, 0xdf, 0xef, 0xbc, 0x15, 0x0b, 0xca, 0x4f, 0xa5, + 0x30, 0x8a, 0x05, 0xe4, 0x9f, 0xe7, 0x60, 0x9a, 0xc2, 0x87, 0x02, 0x94, 0x93, 0x50, 0x72, 0xb0, + 0x6d, 0xa9, 0x9e, 0xd6, 0xf5, 0x3f, 0x15, 0x26, 0x80, 0x1d, 0xad, 0x4b, 0x93, 0x19, 0xf4, 0xa5, + 0x6e, 0x74, 0xb1, 0xeb, 0x89, 0xef, 0x85, 0xcb, 0x04, 0xb6, 0xc1, 0x40, 0x44, 0x49, 0x34, 0x4d, + 0x58, 0xa0, 0xd9, 0x40, 0xfa, 0x8c, 0x96, 0xd9, 0x37, 0x4c, 0x59, 0xb2, 0x43, 0xf4, 0x0b, 0xa7, + 0x06, 0x14, 0x63, 0x09, 0x1d, 0xbf, 0x8d, 0xae, 0x41, 0x81, 0x5e, 0x01, 0xcf, 0x8e, 0xd7, 0x1b, + 0x45, 0x24, 0xd6, 0x62, 0x1b, 0xa6, 0x89, 0x75, 0x1a, 0x7d, 0x14, 0x15, 0xde, 0x92, 0x37, 0x01, + 0x85, 0xd5, 0xc9, 0x27, 0xee, 0x1a, 0xcc, 0x50, 0x6d, 0x8b, 0x98, 0x72, 0x31, 0xa5, 0x03, 0x85, + 0xa3, 0xc9, 0x1a, 0x20, 0xd6, 0x63, 0x24, 0x8e, 0x9c, 0x7c, 0x7a, 0x47, 0xc4, 0x95, 0x7f, 0x29, + 0xc1, 0xd1, 0x48, 0x1f, 0x5c, 0xd6, 0xab, 0xd1, 0x4e, 0x52, 0x45, 0xe5, 0x1d, 0xac, 0x47, 0x36, + 0xd2, 0x6b, 0x69, 0x22, 0x7d, 0x4d, 0x9b, 0xe8, 0x3f, 0x48, 0x00, 0x6b, 0x03, 0xef, 0x80, 0xdf, + 0xa7, 0x86, 0xa7, 0x58, 0x8a, 0x4d, 0x71, 0x03, 0x8a, 0xb6, 0xe6, 0xba, 0xcf, 0x2c, 0x47, 0x9c, + 0x04, 0xfd, 0x36, 0xbd, 0xf9, 0x1c, 0x78, 0x07, 0x22, 0x3d, 0x4c, 0x9e, 0xd1, 0x79, 0xa8, 0xb2, + 0xef, 0xdc, 0x55, 0x4d, 0xd7, 0x1d, 0x51, 0xb2, 0x54, 0x52, 0x2a, 0x0c, 0xba, 0xc6, 0x80, 0x04, + 0xcd, 0xa0, 0xe9, 0x02, 0xef, 0x50, 0xf5, 0xac, 0x27, 0xd8, 0xe4, 0x27, 0xba, 0x8a, 0x80, 0xee, + 0x10, 0x20, 0xcb, 0xc6, 0x75, 0x0d, 0xd7, 0x73, 0x04, 0x9a, 0xc8, 0x29, 0x72, 0x28, 0x45, 0x23, + 0x93, 0x52, 0x6b, 0x0d, 0x7a, 0x3d, 0xa6, 0xe2, 0x17, 0x9f, 0xf6, 0xef, 0xf1, 0x01, 0xe5, 0xd2, + 0x16, 0x47, 0xa0, 0x34, 0x3e, 0xdc, 0xaf, 0xf0, 0xea, 0xea, 0x7b, 0x70, 0x24, 0x34, 0x06, 0x6e, + 0x56, 0x91, 0xd0, 0x5b, 0x8a, 0x86, 0xde, 0xf2, 0x03, 0x40, 0xec, 0xb6, 0xe6, 0x25, 0xc7, 0x2d, + 0x1f, 0x83, 0xa3, 0x11, 0x46, 0x7c, 0x4b, 0xbf, 0x02, 0x15, 0x5e, 0x12, 0xc5, 0x0d, 0xe5, 0x04, + 0x14, 0x89, 0x6b, 0xee, 0x18, 0xba, 0xa8, 0x1d, 0x98, 0xb5, 0x2d, 0x7d, 0xdd, 0xd0, 0x1d, 0xf9, + 0x03, 0xa8, 0xf0, 0x8f, 0x65, 0x39, 0xee, 0x7d, 0xa8, 0xf2, 0xfa, 0x35, 0x35, 0xf2, 0x6d, 0xd8, + 0xe9, 0xd4, 0xea, 0x2c, 0xa1, 0x16, 0x33, 0xdc, 0x94, 0x75, 0x68, 0xb0, 0xd8, 0x23, 0xc2, 0x5e, + 0x0c, 0xf6, 0x3e, 0x88, 0x92, 0xe9, 0xb1, 0xbd, 0x44, 0xe9, 0x2b, 0x4e, 0xb8, 0x29, 0x9f, 0x82, + 0x93, 0x89, 0xbd, 0x70, 0x4d, 0xd8, 0x50, 0x0b, 0x5e, 0xb0, 0x0f, 0x98, 0xfc, 0xe2, 0x08, 0x29, + 0x54, 0x1c, 0x71, 0xdc, 0x0f, 0xad, 0x73, 0x62, 0x37, 0xa4, 0x71, 0x73, 0x70, 0x48, 0xca, 0xa7, + 0x1d, 0x92, 0x0a, 0x91, 0x43, 0x92, 0xdc, 0xf6, 0xf5, 0xc9, 0x0f, 0xaf, 0xf7, 0xe8, 0x21, 0x9b, + 0xf5, 0x2d, 0x1c, 0xa2, 0x3c, 0x6a, 0x94, 0x0c, 0x55, 0x09, 0x51, 0xc9, 0x97, 0xa1, 0x12, 0x75, + 0x8d, 0x21, 0x3f, 0x27, 0x0d, 0xf9, 0xb9, 0x6a, 0xcc, 0xc5, 0xbd, 0x1d, 0x3b, 0x37, 0xa4, 0xeb, + 0x38, 0x76, 0x6a, 0xb8, 0x1d, 0x71, 0x76, 0x57, 0x12, 0x72, 0xdd, 0x5f, 0x93, 0x9f, 0x5b, 0xe0, + 0xfb, 0xc1, 0x7d, 0x97, 0xd0, 0xf3, 0x41, 0xcb, 0xe7, 0xa0, 0xbc, 0x9b, 0xf6, 0xd7, 0x07, 0x05, + 0x51, 0x9b, 0x75, 0x03, 0x16, 0xee, 0x1b, 0x3d, 0xec, 0x1e, 0xba, 0x1e, 0xee, 0x37, 0xa9, 0x53, + 0xda, 0x37, 0xb0, 0x83, 0x96, 0x00, 0xe8, 0xc1, 0xcf, 0xb6, 0x0c, 0xff, 0x23, 0xee, 0x10, 0x44, + 0xfe, 0x4f, 0x09, 0xe6, 0x03, 0xc2, 0x2c, 0x15, 0x73, 0xb7, 0x60, 0x7a, 0xdf, 0x15, 0x17, 0x6d, + 0x89, 0x69, 0x87, 0x24, 0x41, 0x94, 0xc2, 0xbe, 0xdb, 0xd4, 0xd1, 0xbb, 0x00, 0x03, 0x17, 0xeb, + 0x3c, 0xf3, 0x97, 0xa9, 0x9e, 0xb0, 0x44, 0x08, 0x58, 0x59, 0xd7, 0x6d, 0x28, 0x1b, 0xa6, 0xa5, + 0x63, 0x9a, 0xf5, 0xd5, 0xb3, 0xd5, 0x14, 0x02, 0xa3, 0xd8, 0x75, 0xb1, 0x2e, 0x63, 0xbe, 0x17, + 0x0a, 0xfd, 0x72, 0x43, 0xd9, 0x82, 0x23, 0xcc, 0x69, 0xed, 0xfb, 0x82, 0x8f, 0xa8, 0x0b, 0x8f, + 0x69, 0x4b, 0xa9, 0x19, 0x3c, 0x46, 0x12, 0xa4, 0xf2, 0x2a, 0x1c, 0x8b, 0x55, 0xa8, 0x66, 0xbf, + 0xd1, 0x6e, 0xc5, 0xae, 0x97, 0x02, 0x73, 0xbe, 0x11, 0xfd, 0x6e, 0x60, 0x7c, 0x59, 0x2c, 0x2f, + 0x58, 0xff, 0x18, 0x4e, 0x44, 0xee, 0xc1, 0x22, 0x12, 0xdd, 0x8e, 0x85, 0x80, 0x17, 0xc6, 0x71, + 0x8d, 0xc5, 0x82, 0xff, 0x2d, 0xc1, 0x42, 0x12, 0xc2, 0x0b, 0xde, 0xd3, 0xfe, 0x28, 0xe5, 0x4b, + 0xa5, 0x9b, 0xd9, 0xc4, 0xfa, 0x46, 0xee, 0xb8, 0x77, 0xd8, 0x77, 0x0b, 0xe3, 0x67, 0x29, 0x3f, + 0xc9, 0x2c, 0xfd, 0x34, 0x1f, 0xca, 0x57, 0x8c, 0xf8, 0xaa, 0xe0, 0xa5, 0xef, 0x00, 0x9b, 0xb1, + 0x8f, 0x0a, 0xae, 0x8f, 0x20, 0x1f, 0xf3, 0x4d, 0xc1, 0x87, 0x49, 0x97, 0x01, 0x37, 0xb2, 0xf1, + 0xfb, 0xce, 0x5e, 0x1b, 0xff, 0x34, 0x07, 0xd5, 0xe8, 0x14, 0xa1, 0xcd, 0x84, 0x2f, 0x0a, 0xce, + 0x67, 0x1a, 0x66, 0xe4, 0x83, 0x02, 0x5e, 0xb5, 0x9f, 0x9b, 0xb4, 0x6a, 0x3f, 0x3f, 0x49, 0xd5, + 0xfe, 0x43, 0xa8, 0x3e, 0x73, 0x0c, 0x4f, 0xdb, 0xeb, 0x61, 0xb5, 0xa7, 0x1d, 0x62, 0x87, 0x7b, + 0xc9, 0x0c, 0x8e, 0xac, 0x22, 0x08, 0x1f, 0x11, 0x3a, 0xf9, 0x6f, 0x24, 0x28, 0x0a, 0x91, 0xc6, + 0xd6, 0xca, 0x2f, 0x0e, 0x08, 0x9a, 0x4a, 0xeb, 0x6d, 0x4d, 0xcd, 0xb4, 0x54, 0x17, 0x93, 0x7d, + 0x3c, 0x63, 0xb5, 0xf9, 0x02, 0xa5, 0x5e, 0xb7, 0x1c, 0xbc, 0xa5, 0x99, 0x56, 0x9b, 0x91, 0xa2, + 0x07, 0x50, 0x63, 0x5c, 0x29, 0x43, 0xc2, 0x3a, 0xe3, 0x8e, 0x51, 0xa5, 0x64, 0x84, 0x15, 0x61, + 0xe9, 0xca, 0x7f, 0x9d, 0x87, 0x72, 0x48, 0x57, 0x63, 0x06, 0xd3, 0x84, 0x23, 0xa2, 0x16, 0xc2, + 0xc5, 0xde, 0x24, 0x45, 0xf3, 0xf3, 0x9c, 0xae, 0x8d, 0x3d, 0xb6, 0x5f, 0xdd, 0x87, 0x79, 0xed, + 0xa9, 0x66, 0xf4, 0xe8, 0x6c, 0x4c, 0xb0, 0xe5, 0x55, 0x7d, 0x2a, 0x7f, 0xdf, 0x63, 0x9a, 0x98, + 0xa0, 0x96, 0x1e, 0x28, 0x45, 0x50, 0xc4, 0xef, 0xba, 0x9c, 0x3a, 0x5b, 0x39, 0xbd, 0xe3, 0xba, + 0x7e, 0xdf, 0xb4, 0x7e, 0x97, 0x7e, 0xc8, 0xe0, 0xf2, 0x8f, 0xaa, 0xc7, 0xf5, 0x4d, 0x28, 0xee, + 0x53, 0x02, 0xa2, 0xce, 0xbe, 0xf6, 0xa9, 0xe5, 0xa8, 0x61, 0x2e, 0xb3, 0x99, 0xd4, 0x49, 0xe9, + 0x5a, 0x3e, 0x2b, 0xf9, 0x36, 0x9c, 0x50, 0xb0, 0x65, 0x63, 0xd3, 0x5f, 0x69, 0x8f, 0xac, 0xee, + 0x04, 0x7b, 0xeb, 0x2b, 0xd0, 0x48, 0xa2, 0x67, 0x9e, 0xfb, 0xca, 0x05, 0x28, 0x8a, 0xbf, 0x1f, + 0x43, 0xb3, 0x90, 0xdf, 0x59, 0x6f, 0xd5, 0xa6, 0xc8, 0xc3, 0xee, 0x46, 0xab, 0x26, 0xa1, 0x22, + 0x14, 0xda, 0xeb, 0x3b, 0xad, 0x5a, 0xee, 0x4a, 0x1f, 0x6a, 0xf1, 0xff, 0xde, 0x42, 0x8b, 0x70, + 0xb4, 0xa5, 0x6c, 0xb7, 0xd6, 0x1e, 0xac, 0xed, 0x34, 0xb7, 0xb7, 0xd4, 0x96, 0xd2, 0x7c, 0x7f, + 0x6d, 0x67, 0xb3, 0x36, 0x85, 0xce, 0xc2, 0xa9, 0xf0, 0x8b, 0x87, 0xdb, 0xed, 0x1d, 0x75, 0x67, + 0x5b, 0x5d, 0xdf, 0xde, 0xda, 0x59, 0x6b, 0x6e, 0x6d, 0x2a, 0x35, 0x09, 0x9d, 0x82, 0x13, 0x61, + 0x94, 0x7b, 0xcd, 0x8d, 0xa6, 0xb2, 0xb9, 0x4e, 0x9e, 0xd7, 0x1e, 0xd5, 0x72, 0x57, 0xde, 0x83, + 0x4a, 0xe4, 0xaf, 0xb2, 0x88, 0x48, 0xad, 0xed, 0x8d, 0xda, 0x14, 0xaa, 0x40, 0x29, 0xcc, 0xa7, + 0x08, 0x85, 0xad, 0xed, 0x8d, 0xcd, 0x5a, 0x0e, 0x01, 0xcc, 0xec, 0xac, 0x29, 0x0f, 0x36, 0x77, + 0x6a, 0xf9, 0x2b, 0xab, 0xf1, 0x0f, 0xa4, 0x30, 0x3a, 0x02, 0x95, 0xf6, 0xda, 0xd6, 0xc6, 0xbd, + 0xed, 0x0f, 0x55, 0x65, 0x73, 0x6d, 0xe3, 0xa3, 0xda, 0x14, 0x5a, 0x80, 0x9a, 0x00, 0x6d, 0x6d, + 0xef, 0x30, 0xa8, 0x74, 0xe5, 0x49, 0xcc, 0x13, 0x62, 0x74, 0x0c, 0x8e, 0xf8, 0x5d, 0xaa, 0xeb, + 0xca, 0xe6, 0xda, 0xce, 0x26, 0x91, 0x24, 0x02, 0x56, 0x76, 0xb7, 0xb6, 0x9a, 0x5b, 0x0f, 0x6a, + 0x12, 0xe1, 0x1a, 0x80, 0x37, 0x3f, 0x6c, 0x12, 0xe4, 0x5c, 0x14, 0x79, 0x77, 0xeb, 0x07, 0x5b, + 0xdb, 0x1f, 0x6c, 0xd5, 0xf2, 0x2b, 0x3f, 0x3f, 0xea, 0xff, 0x7d, 0x51, 0x1b, 0x3b, 0xb4, 0x62, + 0xab, 0x05, 0xb3, 0xe2, 0xaf, 0xed, 0x12, 0xf6, 0xd1, 0xe8, 0x1f, 0xf2, 0x35, 0xce, 0x8e, 0xc0, + 0xe0, 0xa7, 0xa2, 0x29, 0xb4, 0x47, 0x4f, 0x29, 0xa1, 0xcf, 0x82, 0x2f, 0x24, 0x9e, 0x09, 0x86, + 0xbe, 0x44, 0x6e, 0x5c, 0x1c, 0x8b, 0xe7, 0xf7, 0x81, 0xc9, 0x41, 0x24, 0xfc, 0xcf, 0x1b, 0xe8, + 0x62, 0xd2, 0x09, 0x22, 0xe1, 0xaf, 0x3d, 0x1a, 0x97, 0xc6, 0x23, 0xfa, 0xdd, 0x3c, 0x81, 0x5a, + 0xfc, 0x5f, 0x38, 0x50, 0x42, 0x5a, 0x20, 0xe5, 0xaf, 0x3e, 0x1a, 0x57, 0xb2, 0xa0, 0x86, 0x3b, + 0x1b, 0xfa, 0x5b, 0x89, 0xcb, 0x59, 0x3e, 0xbf, 0x4f, 0xed, 0x2c, 0xed, 0x4b, 0x7d, 0xa6, 0xc0, + 0xe8, 0x97, 0x9b, 0x28, 0xf1, 0x3f, 0x1c, 0x12, 0x3e, 0x18, 0x4f, 0x52, 0x60, 0xf2, 0x47, 0xc1, + 0xf2, 0x14, 0x3a, 0x80, 0xf9, 0x58, 0xe9, 0x0d, 0x4a, 0x20, 0x4f, 0xae, 0x31, 0x6a, 0x5c, 0xce, + 0x80, 0x19, 0xb5, 0x88, 0x70, 0xa9, 0x4d, 0xb2, 0x45, 0x24, 0x14, 0xf2, 0x24, 0x5b, 0x44, 0x62, + 0xd5, 0x0e, 0x35, 0xee, 0x48, 0x89, 0x4d, 0x92, 0x71, 0x27, 0x15, 0xf6, 0x34, 0x2e, 0x8e, 0xc5, + 0x0b, 0x2b, 0x2d, 0x56, 0x70, 0x93, 0xa4, 0xb4, 0xe4, 0x82, 0x9e, 0xc6, 0xe5, 0x0c, 0x98, 0x71, + 0x2b, 0x08, 0xd2, 0xf7, 0x69, 0x56, 0x30, 0x54, 0x6c, 0x92, 0x66, 0x05, 0xc3, 0x95, 0x00, 0xdc, + 0x0a, 0x62, 0x69, 0xf7, 0x4b, 0x19, 0xd2, 0x84, 0xe9, 0x56, 0x90, 0x9c, 0x50, 0x94, 0xa7, 0xd0, + 0x4f, 0x24, 0xa8, 0xa7, 0x65, 0xa5, 0xd0, 0xf5, 0x89, 0x53, 0x68, 0x8d, 0x95, 0x49, 0x48, 0x7c, + 0x29, 0x3e, 0x03, 0x34, 0xbc, 0x07, 0xa2, 0xd7, 0x92, 0x66, 0x26, 0x65, 0xa7, 0x6d, 0xbc, 0x9e, + 0x0d, 0xd9, 0xef, 0xb2, 0x0d, 0x45, 0x91, 0x07, 0x43, 0x09, 0x5e, 0x3a, 0x96, 0x85, 0x6b, 0xc8, + 0xa3, 0x50, 0x7c, 0xa6, 0x0f, 0xa0, 0x40, 0xa0, 0xe8, 0x54, 0x32, 0xb6, 0x60, 0xb6, 0x94, 0xf6, + 0xda, 0x67, 0xf4, 0x18, 0x66, 0x58, 0xe2, 0x07, 0x25, 0xdc, 0x0f, 0x45, 0xd2, 0x53, 0x8d, 0x33, + 0xe9, 0x08, 0x3e, 0xbb, 0x4f, 0xd8, 0xbf, 0x9e, 0xf2, 0x9c, 0x0e, 0x7a, 0x35, 0xf9, 0xcf, 0xc4, + 0xa2, 0x29, 0xa4, 0xc6, 0xf9, 0x31, 0x58, 0xe1, 0x45, 0x11, 0x3b, 0x9b, 0x5c, 0x1c, 0x7b, 0xc0, + 0x4c, 0x5f, 0x14, 0xc9, 0x47, 0x58, 0x66, 0x24, 0xc3, 0x47, 0xdc, 0x24, 0x23, 0x49, 0xbd, 0x58, + 0x48, 0x32, 0x92, 0xf4, 0x53, 0x33, 0x5b, 0x87, 0xf1, 0xaf, 0x9c, 0x2f, 0x8d, 0xff, 0x26, 0x3f, + 0x7d, 0x1d, 0xa6, 0x7c, 0xf7, 0x2f, 0x4f, 0x21, 0x0f, 0x8e, 0x26, 0xfc, 0x31, 0x00, 0x7a, 0x7d, + 0xdc, 0xd6, 0x11, 0xe9, 0xf1, 0x6a, 0x46, 0xec, 0x70, 0xaf, 0x09, 0x17, 0xb6, 0x49, 0xbd, 0xa6, + 0xdf, 0x1e, 0x27, 0xf5, 0x3a, 0xea, 0x16, 0x98, 0x1a, 0x37, 0x77, 0x6a, 0xa7, 0xd3, 0x6f, 0x31, + 0x53, 0x8d, 0x3b, 0xee, 0xc2, 0x56, 0x7e, 0x9d, 0x87, 0x39, 0x76, 0x19, 0xcf, 0x23, 0xb4, 0x8f, + 0x00, 0x82, 0x3c, 0x18, 0x3a, 0x97, 0xac, 0x94, 0x48, 0xd2, 0xb1, 0xf1, 0xea, 0x68, 0xa4, 0xf0, + 0x42, 0x0a, 0xe5, 0x94, 0x92, 0x16, 0xd2, 0x70, 0xea, 0x2c, 0x69, 0x21, 0x25, 0x24, 0xa6, 0xe4, + 0x29, 0xf4, 0x3e, 0x94, 0xfc, 0xe4, 0x05, 0x4a, 0x4a, 0x7e, 0xc4, 0xb2, 0x33, 0x8d, 0x73, 0x23, + 0x71, 0xc2, 0x52, 0x87, 0x32, 0x13, 0x49, 0x52, 0x0f, 0x67, 0x40, 0x92, 0xa4, 0x4e, 0x4a, 0x6f, + 0x04, 0x3a, 0x61, 0xf7, 0x97, 0xa9, 0x3a, 0x89, 0x5c, 0x1f, 0xa7, 0xea, 0x24, 0x7a, 0x09, 0x2a, + 0x4f, 0xdd, 0xbb, 0xf0, 0xcb, 0x2f, 0x96, 0xa4, 0x7f, 0xfe, 0x62, 0x69, 0xea, 0xf3, 0x2f, 0x97, + 0xa4, 0x5f, 0x7e, 0xb9, 0x24, 0xfd, 0xd3, 0x97, 0x4b, 0xd2, 0xbf, 0x7e, 0xb9, 0x24, 0xfd, 0xf6, + 0xbf, 0x2d, 0x4d, 0xfd, 0xb0, 0x28, 0xa8, 0xf7, 0x66, 0xe8, 0x7f, 0x33, 0xbf, 0xf1, 0x7f, 0x01, + 0x00, 0x00, 0xff, 0xff, 0x86, 0xde, 0xb4, 0x0e, 0x61, 0x5b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -7500,6 +8505,11 @@ type RuntimeServiceClient interface { ContainerStats(ctx context.Context, in *ContainerStatsRequest, opts ...grpc.CallOption) (*ContainerStatsResponse, error) // ListContainerStats returns stats of all running containers. ListContainerStats(ctx context.Context, in *ListContainerStatsRequest, opts ...grpc.CallOption) (*ListContainerStatsResponse, error) + // PodSandboxStats returns stats of the pod sandbox. If the pod sandbox does not + // exist, the call returns an error. + PodSandboxStats(ctx context.Context, in *PodSandboxStatsRequest, opts ...grpc.CallOption) (*PodSandboxStatsResponse, error) + // ListPodSandboxStats returns stats of the pod sandboxes matching a filter. + ListPodSandboxStats(ctx context.Context, in *ListPodSandboxStatsRequest, opts ...grpc.CallOption) (*ListPodSandboxStatsResponse, error) // UpdateRuntimeConfig updates the runtime configuration based on the given request. UpdateRuntimeConfig(ctx context.Context, in *UpdateRuntimeConfigRequest, opts ...grpc.CallOption) (*UpdateRuntimeConfigResponse, error) // Status returns the status of the runtime. @@ -7694,6 +8704,24 @@ func (c *runtimeServiceClient) ListContainerStats(ctx context.Context, in *ListC return out, nil } +func (c *runtimeServiceClient) PodSandboxStats(ctx context.Context, in *PodSandboxStatsRequest, opts ...grpc.CallOption) (*PodSandboxStatsResponse, error) { + out := new(PodSandboxStatsResponse) + err := c.cc.Invoke(ctx, "/runtime.v1alpha2.RuntimeService/PodSandboxStats", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeServiceClient) ListPodSandboxStats(ctx context.Context, in *ListPodSandboxStatsRequest, opts ...grpc.CallOption) (*ListPodSandboxStatsResponse, error) { + out := new(ListPodSandboxStatsResponse) + err := c.cc.Invoke(ctx, "/runtime.v1alpha2.RuntimeService/ListPodSandboxStats", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *runtimeServiceClient) UpdateRuntimeConfig(ctx context.Context, in *UpdateRuntimeConfigRequest, opts ...grpc.CallOption) (*UpdateRuntimeConfigResponse, error) { out := new(UpdateRuntimeConfigResponse) err := c.cc.Invoke(ctx, "/runtime.v1alpha2.RuntimeService/UpdateRuntimeConfig", in, out, opts...) @@ -7779,6 +8807,11 @@ type RuntimeServiceServer interface { ContainerStats(context.Context, *ContainerStatsRequest) (*ContainerStatsResponse, error) // ListContainerStats returns stats of all running containers. ListContainerStats(context.Context, *ListContainerStatsRequest) (*ListContainerStatsResponse, error) + // PodSandboxStats returns stats of the pod sandbox. If the pod sandbox does not + // exist, the call returns an error. + PodSandboxStats(context.Context, *PodSandboxStatsRequest) (*PodSandboxStatsResponse, error) + // ListPodSandboxStats returns stats of the pod sandboxes matching a filter. + ListPodSandboxStats(context.Context, *ListPodSandboxStatsRequest) (*ListPodSandboxStatsResponse, error) // UpdateRuntimeConfig updates the runtime configuration based on the given request. UpdateRuntimeConfig(context.Context, *UpdateRuntimeConfigRequest) (*UpdateRuntimeConfigResponse, error) // Status returns the status of the runtime. @@ -7849,6 +8882,12 @@ func (*UnimplementedRuntimeServiceServer) ContainerStats(ctx context.Context, re func (*UnimplementedRuntimeServiceServer) ListContainerStats(ctx context.Context, req *ListContainerStatsRequest) (*ListContainerStatsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListContainerStats not implemented") } +func (*UnimplementedRuntimeServiceServer) PodSandboxStats(ctx context.Context, req *PodSandboxStatsRequest) (*PodSandboxStatsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PodSandboxStats not implemented") +} +func (*UnimplementedRuntimeServiceServer) ListPodSandboxStats(ctx context.Context, req *ListPodSandboxStatsRequest) (*ListPodSandboxStatsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListPodSandboxStats not implemented") +} func (*UnimplementedRuntimeServiceServer) UpdateRuntimeConfig(ctx context.Context, req *UpdateRuntimeConfigRequest) (*UpdateRuntimeConfigResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateRuntimeConfig not implemented") } @@ -8220,6 +9259,42 @@ func _RuntimeService_ListContainerStats_Handler(srv interface{}, ctx context.Con return interceptor(ctx, in, info, handler) } +func _RuntimeService_PodSandboxStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PodSandboxStatsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeServiceServer).PodSandboxStats(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/runtime.v1alpha2.RuntimeService/PodSandboxStats", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeServiceServer).PodSandboxStats(ctx, req.(*PodSandboxStatsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RuntimeService_ListPodSandboxStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListPodSandboxStatsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeServiceServer).ListPodSandboxStats(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/runtime.v1alpha2.RuntimeService/ListPodSandboxStats", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeServiceServer).ListPodSandboxStats(ctx, req.(*ListPodSandboxStatsRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _RuntimeService_UpdateRuntimeConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UpdateRuntimeConfigRequest) if err := dec(in); err != nil { @@ -8340,6 +9415,14 @@ var _RuntimeService_serviceDesc = grpc.ServiceDesc{ MethodName: "ListContainerStats", Handler: _RuntimeService_ListContainerStats_Handler, }, + { + MethodName: "PodSandboxStats", + Handler: _RuntimeService_PodSandboxStats_Handler, + }, + { + MethodName: "ListPodSandboxStats", + Handler: _RuntimeService_ListPodSandboxStats_Handler, + }, { MethodName: "UpdateRuntimeConfig", Handler: _RuntimeService_UpdateRuntimeConfig_Handler, @@ -9094,6 +10177,30 @@ func (m *LinuxPodSandboxConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Resources != nil { + { + size, err := m.Resources.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.Overhead != nil { + { + size, err := m.Overhead.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } if len(m.Sysctls) > 0 { for k := range m.Sysctls { v := m.Sysctls[k] @@ -9204,6 +10311,18 @@ func (m *PodSandboxConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Windows != nil { + { + size, err := m.Windows.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } if m.Linux != nil { { size, err := m.Linux.MarshalToSizedBuffer(dAtA[:i]) @@ -10104,7 +11223,7 @@ func (m *ListPodSandboxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *ImageSpec) Marshal() (dAtA []byte, err error) { +func (m *PodSandboxStatsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -10114,46 +11233,27 @@ func (m *ImageSpec) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ImageSpec) MarshalTo(dAtA []byte) (int, error) { +func (m *PodSandboxStatsRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ImageSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *PodSandboxStatsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Annotations) > 0 { - for k := range m.Annotations { - v := m.Annotations[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintApi(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintApi(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintApi(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Image) > 0 { - i -= len(m.Image) - copy(dAtA[i:], m.Image) - i = encodeVarintApi(dAtA, i, uint64(len(m.Image))) + if len(m.PodSandboxId) > 0 { + i -= len(m.PodSandboxId) + copy(dAtA[i:], m.PodSandboxId) + i = encodeVarintApi(dAtA, i, uint64(len(m.PodSandboxId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *KeyValue) Marshal() (dAtA []byte, err error) { +func (m *PodSandboxStatsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -10163,34 +11263,32 @@ func (m *KeyValue) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *KeyValue) MarshalTo(dAtA []byte) (int, error) { +func (m *PodSandboxStatsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *KeyValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *PodSandboxStatsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintApi(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 = encodeVarintApi(dAtA, i, uint64(len(m.Key))) + if m.Stats != nil { + { + size, err := m.Stats.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *LinuxContainerResources) Marshal() (dAtA []byte, err error) { +func (m *PodSandboxStatsFilter) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -10200,73 +11298,46 @@ func (m *LinuxContainerResources) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *LinuxContainerResources) MarshalTo(dAtA []byte) (int, error) { +func (m *PodSandboxStatsFilter) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *LinuxContainerResources) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *PodSandboxStatsFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.HugepageLimits) > 0 { - for iNdEx := len(m.HugepageLimits) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.HugepageLimits[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } + if len(m.LabelSelector) > 0 { + for k := range m.LabelSelector { + v := m.LabelSelector[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintApi(dAtA, i, uint64(len(v))) i-- - dAtA[i] = 0x42 + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintApi(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintApi(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 } } - if len(m.CpusetMems) > 0 { - i -= len(m.CpusetMems) - copy(dAtA[i:], m.CpusetMems) - i = encodeVarintApi(dAtA, i, uint64(len(m.CpusetMems))) - i-- - dAtA[i] = 0x3a - } - if len(m.CpusetCpus) > 0 { - i -= len(m.CpusetCpus) - copy(dAtA[i:], m.CpusetCpus) - i = encodeVarintApi(dAtA, i, uint64(len(m.CpusetCpus))) - i-- - dAtA[i] = 0x32 - } - if m.OomScoreAdj != 0 { - i = encodeVarintApi(dAtA, i, uint64(m.OomScoreAdj)) - i-- - dAtA[i] = 0x28 - } - if m.MemoryLimitInBytes != 0 { - i = encodeVarintApi(dAtA, i, uint64(m.MemoryLimitInBytes)) - i-- - dAtA[i] = 0x20 - } - if m.CpuShares != 0 { - i = encodeVarintApi(dAtA, i, uint64(m.CpuShares)) - i-- - dAtA[i] = 0x18 - } - if m.CpuQuota != 0 { - i = encodeVarintApi(dAtA, i, uint64(m.CpuQuota)) - i-- - dAtA[i] = 0x10 - } - if m.CpuPeriod != 0 { - i = encodeVarintApi(dAtA, i, uint64(m.CpuPeriod)) + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) i-- - dAtA[i] = 0x8 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *HugepageLimit) Marshal() (dAtA []byte, err error) { +func (m *ListPodSandboxStatsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -10276,32 +11347,32 @@ func (m *HugepageLimit) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *HugepageLimit) MarshalTo(dAtA []byte) (int, error) { +func (m *ListPodSandboxStatsRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *HugepageLimit) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ListPodSandboxStatsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Limit != 0 { - i = encodeVarintApi(dAtA, i, uint64(m.Limit)) - i-- - dAtA[i] = 0x10 - } - if len(m.PageSize) > 0 { - i -= len(m.PageSize) - copy(dAtA[i:], m.PageSize) - i = encodeVarintApi(dAtA, i, uint64(len(m.PageSize))) + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *SELinuxOption) Marshal() (dAtA []byte, err error) { +func (m *ListPodSandboxStatsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -10311,48 +11382,34 @@ func (m *SELinuxOption) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SELinuxOption) MarshalTo(dAtA []byte) (int, error) { +func (m *ListPodSandboxStatsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SELinuxOption) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ListPodSandboxStatsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Level) > 0 { - i -= len(m.Level) - copy(dAtA[i:], m.Level) - i = encodeVarintApi(dAtA, i, uint64(len(m.Level))) - i-- - dAtA[i] = 0x22 - } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintApi(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0x1a - } - if len(m.Role) > 0 { - i -= len(m.Role) - copy(dAtA[i:], m.Role) - i = encodeVarintApi(dAtA, i, uint64(len(m.Role))) - i-- - dAtA[i] = 0x12 - } - if len(m.User) > 0 { - i -= len(m.User) - copy(dAtA[i:], m.User) - i = encodeVarintApi(dAtA, i, uint64(len(m.User))) - i-- - dAtA[i] = 0xa + if len(m.Stats) > 0 { + for iNdEx := len(m.Stats) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Stats[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } return len(dAtA) - i, nil } -func (m *Capability) Marshal() (dAtA []byte, err error) { +func (m *PodSandboxAttributes) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -10362,38 +11419,77 @@ func (m *Capability) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Capability) MarshalTo(dAtA []byte) (int, error) { +func (m *PodSandboxAttributes) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Capability) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *PodSandboxAttributes) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.DropCapabilities) > 0 { - for iNdEx := len(m.DropCapabilities) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.DropCapabilities[iNdEx]) - copy(dAtA[i:], m.DropCapabilities[iNdEx]) - i = encodeVarintApi(dAtA, i, uint64(len(m.DropCapabilities[iNdEx]))) + if len(m.Annotations) > 0 { + for k := range m.Annotations { + v := m.Annotations[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintApi(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintApi(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintApi(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x22 } } - if len(m.AddCapabilities) > 0 { - for iNdEx := len(m.AddCapabilities) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.AddCapabilities[iNdEx]) - copy(dAtA[i:], m.AddCapabilities[iNdEx]) - i = encodeVarintApi(dAtA, i, uint64(len(m.AddCapabilities[iNdEx]))) + if len(m.Labels) > 0 { + for k := range m.Labels { + v := m.Labels[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintApi(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa + i = encodeVarintApi(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a + } + } + if m.Metadata != nil { + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *LinuxContainerSecurityContext) Marshal() (dAtA []byte, err error) { +func (m *PodSandboxStats) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -10403,19 +11499,19 @@ func (m *LinuxContainerSecurityContext) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *LinuxContainerSecurityContext) MarshalTo(dAtA []byte) (int, error) { +func (m *PodSandboxStats) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *LinuxContainerSecurityContext) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *PodSandboxStats) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Apparmor != nil { + if m.Windows != nil { { - size, err := m.Apparmor.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Windows.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -10423,13 +11519,11 @@ func (m *LinuxContainerSecurityContext) MarshalToSizedBuffer(dAtA []byte) (int, i = encodeVarintApi(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 + dAtA[i] = 0x1a } - if m.Seccomp != nil { + if m.Linux != nil { { - size, err := m.Seccomp.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Linux.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -10437,29 +11531,11 @@ func (m *LinuxContainerSecurityContext) MarshalToSizedBuffer(dAtA []byte) (int, i = encodeVarintApi(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x7a - } - if len(m.ReadonlyPaths) > 0 { - for iNdEx := len(m.ReadonlyPaths) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ReadonlyPaths[iNdEx]) - copy(dAtA[i:], m.ReadonlyPaths[iNdEx]) - i = encodeVarintApi(dAtA, i, uint64(len(m.ReadonlyPaths[iNdEx]))) - i-- - dAtA[i] = 0x72 - } - } - if len(m.MaskedPaths) > 0 { - for iNdEx := len(m.MaskedPaths) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.MaskedPaths[iNdEx]) - copy(dAtA[i:], m.MaskedPaths[iNdEx]) - i = encodeVarintApi(dAtA, i, uint64(len(m.MaskedPaths[iNdEx]))) - i-- - dAtA[i] = 0x6a - } + dAtA[i] = 0x12 } - if m.RunAsGroup != nil { + if m.Attributes != nil { { - size, err := m.RunAsGroup.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Attributes.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -10467,71 +11543,48 @@ func (m *LinuxContainerSecurityContext) MarshalToSizedBuffer(dAtA []byte) (int, i = encodeVarintApi(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x62 - } - if m.NoNewPrivs { - i-- - if m.NoNewPrivs { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x58 - } - if len(m.SeccompProfilePath) > 0 { - i -= len(m.SeccompProfilePath) - copy(dAtA[i:], m.SeccompProfilePath) - i = encodeVarintApi(dAtA, i, uint64(len(m.SeccompProfilePath))) - i-- - dAtA[i] = 0x52 + dAtA[i] = 0xa } - if len(m.ApparmorProfile) > 0 { - i -= len(m.ApparmorProfile) - copy(dAtA[i:], m.ApparmorProfile) - i = encodeVarintApi(dAtA, i, uint64(len(m.ApparmorProfile))) - i-- - dAtA[i] = 0x4a + return len(dAtA) - i, nil +} + +func (m *LinuxPodSandboxStats) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - if len(m.SupplementalGroups) > 0 { - dAtA27 := make([]byte, len(m.SupplementalGroups)*10) - var j26 int - for _, num1 := range m.SupplementalGroups { - num := uint64(num1) - for num >= 1<<7 { - dAtA27[j26] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j26++ + return dAtA[:n], nil +} + +func (m *LinuxPodSandboxStats) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LinuxPodSandboxStats) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Containers) > 0 { + for iNdEx := len(m.Containers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Containers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) } - dAtA27[j26] = uint8(num) - j26++ - } - i -= j26 - copy(dAtA[i:], dAtA27[:j26]) - i = encodeVarintApi(dAtA, i, uint64(j26)) - i-- - dAtA[i] = 0x42 - } - if m.ReadonlyRootfs { - i-- - if m.ReadonlyRootfs { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + i-- + dAtA[i] = 0x2a } - i-- - dAtA[i] = 0x38 - } - if len(m.RunAsUsername) > 0 { - i -= len(m.RunAsUsername) - copy(dAtA[i:], m.RunAsUsername) - i = encodeVarintApi(dAtA, i, uint64(len(m.RunAsUsername))) - i-- - dAtA[i] = 0x32 } - if m.RunAsUser != nil { + if m.Process != nil { { - size, err := m.RunAsUser.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Process.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -10539,11 +11592,11 @@ func (m *LinuxContainerSecurityContext) MarshalToSizedBuffer(dAtA []byte) (int, i = encodeVarintApi(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x22 } - if m.SelinuxOptions != nil { + if m.Network != nil { { - size, err := m.SelinuxOptions.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Network.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -10551,11 +11604,11 @@ func (m *LinuxContainerSecurityContext) MarshalToSizedBuffer(dAtA []byte) (int, i = encodeVarintApi(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x1a } - if m.NamespaceOptions != nil { + if m.Memory != nil { { - size, err := m.NamespaceOptions.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Memory.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -10563,21 +11616,11 @@ func (m *LinuxContainerSecurityContext) MarshalToSizedBuffer(dAtA []byte) (int, i = encodeVarintApi(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a - } - if m.Privileged { - i-- - if m.Privileged { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 + dAtA[i] = 0x12 } - if m.Capabilities != nil { + if m.Cpu != nil { { - size, err := m.Capabilities.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Cpu.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -10590,7 +11633,7 @@ func (m *LinuxContainerSecurityContext) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func (m *LinuxContainerConfig) Marshal() (dAtA []byte, err error) { +func (m *WindowsPodSandboxStats) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -10600,44 +11643,20 @@ func (m *LinuxContainerConfig) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *LinuxContainerConfig) MarshalTo(dAtA []byte) (int, error) { +func (m *WindowsPodSandboxStats) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *LinuxContainerConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *WindowsPodSandboxStats) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.SecurityContext != nil { - { - size, err := m.SecurityContext.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Resources != nil { - { - size, err := m.Resources.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } return len(dAtA) - i, nil } -func (m *WindowsContainerSecurityContext) Marshal() (dAtA []byte, err error) { +func (m *NetworkUsage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -10647,34 +11666,51 @@ func (m *WindowsContainerSecurityContext) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *WindowsContainerSecurityContext) MarshalTo(dAtA []byte) (int, error) { +func (m *NetworkUsage) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *WindowsContainerSecurityContext) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *NetworkUsage) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.CredentialSpec) > 0 { - i -= len(m.CredentialSpec) - copy(dAtA[i:], m.CredentialSpec) - i = encodeVarintApi(dAtA, i, uint64(len(m.CredentialSpec))) + if len(m.Interfaces) > 0 { + for iNdEx := len(m.Interfaces) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Interfaces[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.DefaultInterface != nil { + { + size, err := m.DefaultInterface.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0x12 } - if len(m.RunAsUsername) > 0 { - i -= len(m.RunAsUsername) - copy(dAtA[i:], m.RunAsUsername) - i = encodeVarintApi(dAtA, i, uint64(len(m.RunAsUsername))) + if m.Timestamp != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.Timestamp)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *WindowsContainerConfig) Marshal() (dAtA []byte, err error) { +func (m *NetworkInterfaceUsage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -10684,19 +11720,19 @@ func (m *WindowsContainerConfig) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *WindowsContainerConfig) MarshalTo(dAtA []byte) (int, error) { +func (m *NetworkInterfaceUsage) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *WindowsContainerConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *NetworkInterfaceUsage) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.SecurityContext != nil { + if m.TxErrors != nil { { - size, err := m.SecurityContext.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.TxErrors.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -10704,11 +11740,35 @@ func (m *WindowsContainerConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) i = encodeVarintApi(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x2a } - if m.Resources != nil { + if m.TxBytes != nil { { - size, err := m.Resources.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.TxBytes.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.RxErrors != nil { + { + size, err := m.RxErrors.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.RxBytes != nil { + { + size, err := m.RxBytes.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -10716,12 +11776,19 @@ func (m *WindowsContainerConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) i = encodeVarintApi(dAtA, i, uint64(size)) } i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintApi(dAtA, i, uint64(len(m.Name))) + i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *WindowsContainerResources) Marshal() (dAtA []byte, err error) { +func (m *ProcessUsage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -10731,40 +11798,37 @@ func (m *WindowsContainerResources) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *WindowsContainerResources) MarshalTo(dAtA []byte) (int, error) { +func (m *ProcessUsage) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *WindowsContainerResources) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ProcessUsage) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.MemoryLimitInBytes != 0 { - i = encodeVarintApi(dAtA, i, uint64(m.MemoryLimitInBytes)) - i-- - dAtA[i] = 0x20 - } - if m.CpuMaximum != 0 { - i = encodeVarintApi(dAtA, i, uint64(m.CpuMaximum)) - i-- - dAtA[i] = 0x18 - } - if m.CpuCount != 0 { - i = encodeVarintApi(dAtA, i, uint64(m.CpuCount)) + if m.ProcessCount != nil { + { + size, err := m.ProcessCount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } i-- - dAtA[i] = 0x10 + dAtA[i] = 0x12 } - if m.CpuShares != 0 { - i = encodeVarintApi(dAtA, i, uint64(m.CpuShares)) + if m.Timestamp != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.Timestamp)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *ContainerMetadata) Marshal() (dAtA []byte, err error) { +func (m *ImageSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -10774,32 +11838,46 @@ func (m *ContainerMetadata) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ContainerMetadata) MarshalTo(dAtA []byte) (int, error) { +func (m *ImageSpec) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ContainerMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ImageSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Attempt != 0 { - i = encodeVarintApi(dAtA, i, uint64(m.Attempt)) - i-- - dAtA[i] = 0x10 + if len(m.Annotations) > 0 { + for k := range m.Annotations { + v := m.Annotations[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintApi(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintApi(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintApi(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintApi(dAtA, i, uint64(len(m.Name))) + if len(m.Image) > 0 { + i -= len(m.Image) + copy(dAtA[i:], m.Image) + i = encodeVarintApi(dAtA, i, uint64(len(m.Image))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *Device) Marshal() (dAtA []byte, err error) { +func (m *KeyValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -10809,41 +11887,34 @@ func (m *Device) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Device) MarshalTo(dAtA []byte) (int, error) { +func (m *KeyValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Device) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *KeyValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Permissions) > 0 { - i -= len(m.Permissions) - copy(dAtA[i:], m.Permissions) - i = encodeVarintApi(dAtA, i, uint64(len(m.Permissions))) - i-- - dAtA[i] = 0x1a - } - if len(m.HostPath) > 0 { - i -= len(m.HostPath) - copy(dAtA[i:], m.HostPath) - i = encodeVarintApi(dAtA, i, uint64(len(m.HostPath))) + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintApi(dAtA, i, uint64(len(m.Value))) i-- dAtA[i] = 0x12 } - if len(m.ContainerPath) > 0 { - i -= len(m.ContainerPath) - copy(dAtA[i:], m.ContainerPath) - i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerPath))) + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintApi(dAtA, i, uint64(len(m.Key))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *ContainerConfig) Marshal() (dAtA []byte, err error) { +func (m *LinuxContainerResources) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -10853,101 +11924,24 @@ func (m *ContainerConfig) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ContainerConfig) MarshalTo(dAtA []byte) (int, error) { +func (m *LinuxContainerResources) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ContainerConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *LinuxContainerResources) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Windows != nil { - { - size, err := m.Windows.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 - } - if m.Linux != nil { - { - size, err := m.Linux.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x7a - } - if m.Tty { - i-- - if m.Tty { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x70 - } - if m.StdinOnce { - i-- - if m.StdinOnce { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x68 - } - if m.Stdin { - i-- - if m.Stdin { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } + if m.MemorySwapLimitInBytes != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.MemorySwapLimitInBytes)) i-- - dAtA[i] = 0x60 - } - if len(m.LogPath) > 0 { - i -= len(m.LogPath) - copy(dAtA[i:], m.LogPath) - i = encodeVarintApi(dAtA, i, uint64(len(m.LogPath))) - i-- - dAtA[i] = 0x5a + dAtA[i] = 0x50 } - if len(m.Annotations) > 0 { - for k := range m.Annotations { - v := m.Annotations[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintApi(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintApi(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintApi(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x52 - } - } - if len(m.Labels) > 0 { - for k := range m.Labels { - v := m.Labels[k] + if len(m.Unified) > 0 { + for k := range m.Unified { + v := m.Unified[k] baseI := i i -= len(v) copy(dAtA[i:], v) @@ -10964,10 +11958,10 @@ func (m *ContainerConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x4a } } - if len(m.Devices) > 0 { - for iNdEx := len(m.Devices) - 1; iNdEx >= 0; iNdEx-- { + if len(m.HugepageLimits) > 0 { + for iNdEx := len(m.HugepageLimits) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Devices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.HugepageLimits[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -10978,87 +11972,49 @@ func (m *ContainerConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x42 } } - if len(m.Mounts) > 0 { - for iNdEx := len(m.Mounts) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Mounts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } + if len(m.CpusetMems) > 0 { + i -= len(m.CpusetMems) + copy(dAtA[i:], m.CpusetMems) + i = encodeVarintApi(dAtA, i, uint64(len(m.CpusetMems))) + i-- + dAtA[i] = 0x3a } - if len(m.Envs) > 0 { - for iNdEx := len(m.Envs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Envs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } + if len(m.CpusetCpus) > 0 { + i -= len(m.CpusetCpus) + copy(dAtA[i:], m.CpusetCpus) + i = encodeVarintApi(dAtA, i, uint64(len(m.CpusetCpus))) + i-- + dAtA[i] = 0x32 } - if len(m.WorkingDir) > 0 { - i -= len(m.WorkingDir) - copy(dAtA[i:], m.WorkingDir) - i = encodeVarintApi(dAtA, i, uint64(len(m.WorkingDir))) + if m.OomScoreAdj != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.OomScoreAdj)) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x28 } - 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 = encodeVarintApi(dAtA, i, uint64(len(m.Args[iNdEx]))) - i-- - dAtA[i] = 0x22 - } + if m.MemoryLimitInBytes != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.MemoryLimitInBytes)) + i-- + dAtA[i] = 0x20 } - if len(m.Command) > 0 { - for iNdEx := len(m.Command) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Command[iNdEx]) - copy(dAtA[i:], m.Command[iNdEx]) - i = encodeVarintApi(dAtA, i, uint64(len(m.Command[iNdEx]))) - i-- - dAtA[i] = 0x1a - } + if m.CpuShares != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.CpuShares)) + i-- + dAtA[i] = 0x18 } - if m.Image != nil { - { - size, err := m.Image.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } + if m.CpuQuota != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.CpuQuota)) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x10 } - if m.Metadata != nil { - { - size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } + if m.CpuPeriod != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.CpuPeriod)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *CreateContainerRequest) Marshal() (dAtA []byte, err error) { +func (m *HugepageLimit) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -11068,51 +12024,32 @@ func (m *CreateContainerRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *CreateContainerRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *HugepageLimit) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *CreateContainerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *HugepageLimit) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.SandboxConfig != nil { - { - size, err := m.SandboxConfig.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.Config != nil { - { - size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } + if m.Limit != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.Limit)) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x10 } - if len(m.PodSandboxId) > 0 { - i -= len(m.PodSandboxId) - copy(dAtA[i:], m.PodSandboxId) - i = encodeVarintApi(dAtA, i, uint64(len(m.PodSandboxId))) + if len(m.PageSize) > 0 { + i -= len(m.PageSize) + copy(dAtA[i:], m.PageSize) + i = encodeVarintApi(dAtA, i, uint64(len(m.PageSize))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *CreateContainerResponse) Marshal() (dAtA []byte, err error) { +func (m *SELinuxOption) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -11122,57 +12059,48 @@ func (m *CreateContainerResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *CreateContainerResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *SELinuxOption) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *CreateContainerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *SELinuxOption) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.ContainerId) > 0 { - i -= len(m.ContainerId) - copy(dAtA[i:], m.ContainerId) - i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) + if len(m.Level) > 0 { + i -= len(m.Level) + copy(dAtA[i:], m.Level) + i = encodeVarintApi(dAtA, i, uint64(len(m.Level))) i-- - dAtA[i] = 0xa + dAtA[i] = 0x22 } - return len(dAtA) - i, nil -} - -func (m *StartContainerRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintApi(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0x1a } - return dAtA[:n], nil -} - -func (m *StartContainerRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StartContainerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ContainerId) > 0 { - i -= len(m.ContainerId) - copy(dAtA[i:], m.ContainerId) - i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) + if len(m.Role) > 0 { + i -= len(m.Role) + copy(dAtA[i:], m.Role) + i = encodeVarintApi(dAtA, i, uint64(len(m.Role))) + i-- + dAtA[i] = 0x12 + } + if len(m.User) > 0 { + i -= len(m.User) + copy(dAtA[i:], m.User) + i = encodeVarintApi(dAtA, i, uint64(len(m.User))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *StartContainerResponse) Marshal() (dAtA []byte, err error) { +func (m *Capability) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -11182,20 +12110,38 @@ func (m *StartContainerResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *StartContainerResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *Capability) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *StartContainerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Capability) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.DropCapabilities) > 0 { + for iNdEx := len(m.DropCapabilities) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.DropCapabilities[iNdEx]) + copy(dAtA[i:], m.DropCapabilities[iNdEx]) + i = encodeVarintApi(dAtA, i, uint64(len(m.DropCapabilities[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.AddCapabilities) > 0 { + for iNdEx := len(m.AddCapabilities) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AddCapabilities[iNdEx]) + copy(dAtA[i:], m.AddCapabilities[iNdEx]) + i = encodeVarintApi(dAtA, i, uint64(len(m.AddCapabilities[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } return len(dAtA) - i, nil } -func (m *StopContainerRequest) Marshal() (dAtA []byte, err error) { +func (m *LinuxContainerSecurityContext) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -11205,55 +12151,194 @@ func (m *StopContainerRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *StopContainerRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *LinuxContainerSecurityContext) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *StopContainerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *LinuxContainerSecurityContext) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Timeout != 0 { - i = encodeVarintApi(dAtA, i, uint64(m.Timeout)) + if m.Apparmor != nil { + { + size, err := m.Apparmor.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } i-- - dAtA[i] = 0x10 + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 } - if len(m.ContainerId) > 0 { - i -= len(m.ContainerId) - copy(dAtA[i:], m.ContainerId) - i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) + if m.Seccomp != nil { + { + size, err := m.Seccomp.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } i-- - dAtA[i] = 0xa + dAtA[i] = 0x7a } - return len(dAtA) - i, nil -} - -func (m *StopContainerResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + if len(m.ReadonlyPaths) > 0 { + for iNdEx := len(m.ReadonlyPaths) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ReadonlyPaths[iNdEx]) + copy(dAtA[i:], m.ReadonlyPaths[iNdEx]) + i = encodeVarintApi(dAtA, i, uint64(len(m.ReadonlyPaths[iNdEx]))) + i-- + dAtA[i] = 0x72 + } + } + if len(m.MaskedPaths) > 0 { + for iNdEx := len(m.MaskedPaths) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.MaskedPaths[iNdEx]) + copy(dAtA[i:], m.MaskedPaths[iNdEx]) + i = encodeVarintApi(dAtA, i, uint64(len(m.MaskedPaths[iNdEx]))) + i-- + dAtA[i] = 0x6a + } + } + if m.RunAsGroup != nil { + { + size, err := m.RunAsGroup.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + if m.NoNewPrivs { + i-- + if m.NoNewPrivs { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x58 + } + if len(m.SeccompProfilePath) > 0 { + i -= len(m.SeccompProfilePath) + copy(dAtA[i:], m.SeccompProfilePath) + i = encodeVarintApi(dAtA, i, uint64(len(m.SeccompProfilePath))) + i-- + dAtA[i] = 0x52 + } + if len(m.ApparmorProfile) > 0 { + i -= len(m.ApparmorProfile) + copy(dAtA[i:], m.ApparmorProfile) + i = encodeVarintApi(dAtA, i, uint64(len(m.ApparmorProfile))) + i-- + dAtA[i] = 0x4a + } + if len(m.SupplementalGroups) > 0 { + dAtA46 := make([]byte, len(m.SupplementalGroups)*10) + var j45 int + for _, num1 := range m.SupplementalGroups { + num := uint64(num1) + for num >= 1<<7 { + dAtA46[j45] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j45++ + } + dAtA46[j45] = uint8(num) + j45++ + } + i -= j45 + copy(dAtA[i:], dAtA46[:j45]) + i = encodeVarintApi(dAtA, i, uint64(j45)) + i-- + dAtA[i] = 0x42 + } + if m.ReadonlyRootfs { + i-- + if m.ReadonlyRootfs { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } + if len(m.RunAsUsername) > 0 { + i -= len(m.RunAsUsername) + copy(dAtA[i:], m.RunAsUsername) + i = encodeVarintApi(dAtA, i, uint64(len(m.RunAsUsername))) + i-- + dAtA[i] = 0x32 + } + if m.RunAsUser != nil { + { + size, err := m.RunAsUser.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.SelinuxOptions != nil { + { + size, err := m.SelinuxOptions.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.NamespaceOptions != nil { + { + size, err := m.NamespaceOptions.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Privileged { + i-- + if m.Privileged { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.Capabilities != nil { + { + size, err := m.Capabilities.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return dAtA[:n], nil -} - -func (m *StopContainerResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StopContainerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l return len(dAtA) - i, nil } -func (m *RemoveContainerRequest) Marshal() (dAtA []byte, err error) { +func (m *LinuxContainerConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -11263,27 +12348,44 @@ func (m *RemoveContainerRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *RemoveContainerRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *LinuxContainerConfig) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *RemoveContainerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *LinuxContainerConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.ContainerId) > 0 { - i -= len(m.ContainerId) - copy(dAtA[i:], m.ContainerId) - i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) + if m.SecurityContext != nil { + { + size, err := m.SecurityContext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Resources != nil { + { + size, err := m.Resources.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *RemoveContainerResponse) Marshal() (dAtA []byte, err error) { +func (m *WindowsSandboxSecurityContext) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -11293,20 +12395,44 @@ func (m *RemoveContainerResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *RemoveContainerResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *WindowsSandboxSecurityContext) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *RemoveContainerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *WindowsSandboxSecurityContext) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if m.HostProcess { + i-- + if m.HostProcess { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if len(m.CredentialSpec) > 0 { + i -= len(m.CredentialSpec) + copy(dAtA[i:], m.CredentialSpec) + i = encodeVarintApi(dAtA, i, uint64(len(m.CredentialSpec))) + i-- + dAtA[i] = 0x12 + } + if len(m.RunAsUsername) > 0 { + i -= len(m.RunAsUsername) + copy(dAtA[i:], m.RunAsUsername) + i = encodeVarintApi(dAtA, i, uint64(len(m.RunAsUsername))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } -func (m *ContainerStateValue) Marshal() (dAtA []byte, err error) { +func (m *WindowsPodSandboxConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -11316,25 +12442,32 @@ func (m *ContainerStateValue) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ContainerStateValue) MarshalTo(dAtA []byte) (int, error) { +func (m *WindowsPodSandboxConfig) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ContainerStateValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *WindowsPodSandboxConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.State != 0 { - i = encodeVarintApi(dAtA, i, uint64(m.State)) + if m.SecurityContext != nil { + { + size, err := m.SecurityContext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } i-- - dAtA[i] = 0x8 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *ContainerFilter) Marshal() (dAtA []byte, err error) { +func (m *WindowsContainerSecurityContext) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -11344,65 +12477,44 @@ func (m *ContainerFilter) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ContainerFilter) MarshalTo(dAtA []byte) (int, error) { +func (m *WindowsContainerSecurityContext) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ContainerFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *WindowsContainerSecurityContext) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.LabelSelector) > 0 { - for k := range m.LabelSelector { - v := m.LabelSelector[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintApi(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintApi(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintApi(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x22 + if m.HostProcess { + i-- + if m.HostProcess { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } - } - if len(m.PodSandboxId) > 0 { - i -= len(m.PodSandboxId) - copy(dAtA[i:], m.PodSandboxId) - i = encodeVarintApi(dAtA, i, uint64(len(m.PodSandboxId))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x18 } - if m.State != nil { - { - size, err := m.State.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } + if len(m.CredentialSpec) > 0 { + i -= len(m.CredentialSpec) + copy(dAtA[i:], m.CredentialSpec) + i = encodeVarintApi(dAtA, i, uint64(len(m.CredentialSpec))) i-- dAtA[i] = 0x12 } - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) + if len(m.RunAsUsername) > 0 { + i -= len(m.RunAsUsername) + copy(dAtA[i:], m.RunAsUsername) + i = encodeVarintApi(dAtA, i, uint64(len(m.RunAsUsername))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *ListContainersRequest) Marshal() (dAtA []byte, err error) { +func (m *WindowsContainerConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -11412,19 +12524,31 @@ func (m *ListContainersRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ListContainersRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *WindowsContainerConfig) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ListContainersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *WindowsContainerConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Filter != nil { + if m.SecurityContext != nil { { - size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.SecurityContext.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Resources != nil { + { + size, err := m.Resources.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -11437,7 +12561,7 @@ func (m *ListContainersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *Container) Marshal() (dAtA []byte, err error) { +func (m *WindowsContainerResources) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -11447,113 +12571,40 @@ func (m *Container) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Container) MarshalTo(dAtA []byte) (int, error) { +func (m *WindowsContainerResources) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Container) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *WindowsContainerResources) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Annotations) > 0 { - for k := range m.Annotations { - v := m.Annotations[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintApi(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintApi(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintApi(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x4a - } - } - if len(m.Labels) > 0 { - for k := range m.Labels { - v := m.Labels[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintApi(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintApi(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintApi(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x42 - } - } - if m.CreatedAt != 0 { - i = encodeVarintApi(dAtA, i, uint64(m.CreatedAt)) - i-- - dAtA[i] = 0x38 - } - if m.State != 0 { - i = encodeVarintApi(dAtA, i, uint64(m.State)) - i-- - dAtA[i] = 0x30 - } - if len(m.ImageRef) > 0 { - i -= len(m.ImageRef) - copy(dAtA[i:], m.ImageRef) - i = encodeVarintApi(dAtA, i, uint64(len(m.ImageRef))) - i-- - dAtA[i] = 0x2a - } - if m.Image != nil { - { - size, err := m.Image.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } + if m.MemoryLimitInBytes != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.MemoryLimitInBytes)) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x20 } - if m.Metadata != nil { - { - size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } + if m.CpuMaximum != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.CpuMaximum)) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x18 } - if len(m.PodSandboxId) > 0 { - i -= len(m.PodSandboxId) - copy(dAtA[i:], m.PodSandboxId) - i = encodeVarintApi(dAtA, i, uint64(len(m.PodSandboxId))) + if m.CpuCount != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.CpuCount)) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x10 } - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) + if m.CpuShares != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.CpuShares)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *ListContainersResponse) Marshal() (dAtA []byte, err error) { +func (m *ContainerMetadata) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -11563,34 +12614,32 @@ func (m *ListContainersResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ListContainersResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *ContainerMetadata) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ListContainersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ContainerMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Containers) > 0 { - for iNdEx := len(m.Containers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Containers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } + if m.Attempt != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.Attempt)) + i-- + dAtA[i] = 0x10 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintApi(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *ContainerStatusRequest) Marshal() (dAtA []byte, err error) { +func (m *Device) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -11600,37 +12649,41 @@ func (m *ContainerStatusRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ContainerStatusRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *Device) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ContainerStatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Device) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Verbose { + if len(m.Permissions) > 0 { + i -= len(m.Permissions) + copy(dAtA[i:], m.Permissions) + i = encodeVarintApi(dAtA, i, uint64(len(m.Permissions))) i-- - if m.Verbose { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } + dAtA[i] = 0x1a + } + if len(m.HostPath) > 0 { + i -= len(m.HostPath) + copy(dAtA[i:], m.HostPath) + i = encodeVarintApi(dAtA, i, uint64(len(m.HostPath))) i-- - dAtA[i] = 0x10 + dAtA[i] = 0x12 } - if len(m.ContainerId) > 0 { - i -= len(m.ContainerId) - copy(dAtA[i:], m.ContainerId) - i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) + if len(m.ContainerPath) > 0 { + i -= len(m.ContainerPath) + copy(dAtA[i:], m.ContainerPath) + i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerPath))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *ContainerStatus) Marshal() (dAtA []byte, err error) { +func (m *ContainerConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -11640,38 +12693,80 @@ func (m *ContainerStatus) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ContainerStatus) MarshalTo(dAtA []byte) (int, error) { +func (m *ContainerConfig) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ContainerStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ContainerConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.LogPath) > 0 { - i -= len(m.LogPath) - copy(dAtA[i:], m.LogPath) - i = encodeVarintApi(dAtA, i, uint64(len(m.LogPath))) + if m.Windows != nil { + { + size, err := m.Windows.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } i-- - dAtA[i] = 0x7a + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 } - if len(m.Mounts) > 0 { - for iNdEx := len(m.Mounts) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Mounts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) + if m.Linux != nil { + { + size, err := m.Linux.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x72 + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x7a } - if len(m.Annotations) > 0 { + if m.Tty { + i-- + if m.Tty { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x70 + } + if m.StdinOnce { + i-- + if m.StdinOnce { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x68 + } + if m.Stdin { + i-- + if m.Stdin { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x60 + } + if len(m.LogPath) > 0 { + i -= len(m.LogPath) + copy(dAtA[i:], m.LogPath) + i = encodeVarintApi(dAtA, i, uint64(len(m.LogPath))) + i-- + dAtA[i] = 0x5a + } + if len(m.Annotations) > 0 { for k := range m.Annotations { v := m.Annotations[k] baseI := i @@ -11687,7 +12782,7 @@ func (m *ContainerStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- - dAtA[i] = 0x6a + dAtA[i] = 0x52 } } if len(m.Labels) > 0 { @@ -11706,70 +12801,79 @@ func (m *ContainerStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- - dAtA[i] = 0x62 + dAtA[i] = 0x4a } } - if len(m.Message) > 0 { - i -= len(m.Message) - copy(dAtA[i:], m.Message) - i = encodeVarintApi(dAtA, i, uint64(len(m.Message))) - i-- - dAtA[i] = 0x5a - } - if len(m.Reason) > 0 { - i -= len(m.Reason) - copy(dAtA[i:], m.Reason) - i = encodeVarintApi(dAtA, i, uint64(len(m.Reason))) - i-- - dAtA[i] = 0x52 - } - if len(m.ImageRef) > 0 { - i -= len(m.ImageRef) - copy(dAtA[i:], m.ImageRef) - i = encodeVarintApi(dAtA, i, uint64(len(m.ImageRef))) - i-- - dAtA[i] = 0x4a - } - if m.Image != nil { - { - size, err := m.Image.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.Devices) > 0 { + for iNdEx := len(m.Devices) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Devices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x42 } - i-- - dAtA[i] = 0x42 } - if m.ExitCode != 0 { - i = encodeVarintApi(dAtA, i, uint64(m.ExitCode)) - i-- - dAtA[i] = 0x38 + if len(m.Mounts) > 0 { + for iNdEx := len(m.Mounts) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Mounts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } } - if m.FinishedAt != 0 { - i = encodeVarintApi(dAtA, i, uint64(m.FinishedAt)) - i-- - dAtA[i] = 0x30 + if len(m.Envs) > 0 { + for iNdEx := len(m.Envs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Envs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } } - if m.StartedAt != 0 { - i = encodeVarintApi(dAtA, i, uint64(m.StartedAt)) + if len(m.WorkingDir) > 0 { + i -= len(m.WorkingDir) + copy(dAtA[i:], m.WorkingDir) + i = encodeVarintApi(dAtA, i, uint64(len(m.WorkingDir))) i-- - dAtA[i] = 0x28 + dAtA[i] = 0x2a } - if m.CreatedAt != 0 { - i = encodeVarintApi(dAtA, i, uint64(m.CreatedAt)) - i-- - dAtA[i] = 0x20 + 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 = encodeVarintApi(dAtA, i, uint64(len(m.Args[iNdEx]))) + i-- + dAtA[i] = 0x22 + } } - if m.State != 0 { - i = encodeVarintApi(dAtA, i, uint64(m.State)) - i-- - dAtA[i] = 0x18 + if len(m.Command) > 0 { + for iNdEx := len(m.Command) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Command[iNdEx]) + copy(dAtA[i:], m.Command[iNdEx]) + i = encodeVarintApi(dAtA, i, uint64(len(m.Command[iNdEx]))) + i-- + dAtA[i] = 0x1a + } } - if m.Metadata != nil { + if m.Image != nil { { - size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Image.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -11779,58 +12883,9 @@ func (m *ContainerStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ContainerStatusResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ContainerStatusResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ContainerStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Info) > 0 { - for k := range m.Info { - v := m.Info[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintApi(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintApi(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintApi(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x12 - } - } - if m.Status != nil { + if m.Metadata != nil { { - size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -11843,7 +12898,7 @@ func (m *ContainerStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *UpdateContainerResourcesRequest) Marshal() (dAtA []byte, err error) { +func (m *CreateContainerRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -11853,38 +12908,19 @@ func (m *UpdateContainerResourcesRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *UpdateContainerResourcesRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *CreateContainerRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *UpdateContainerResourcesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *CreateContainerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Annotations) > 0 { - for k := range m.Annotations { - v := m.Annotations[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintApi(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintApi(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintApi(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x22 - } - } - if m.Windows != nil { + if m.SandboxConfig != nil { { - size, err := m.Windows.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.SandboxConfig.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -11894,9 +12930,9 @@ func (m *UpdateContainerResourcesRequest) MarshalToSizedBuffer(dAtA []byte) (int i-- dAtA[i] = 0x1a } - if m.Linux != nil { + if m.Config != nil { { - size, err := m.Linux.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -11906,17 +12942,17 @@ func (m *UpdateContainerResourcesRequest) MarshalToSizedBuffer(dAtA []byte) (int i-- dAtA[i] = 0x12 } - if len(m.ContainerId) > 0 { - i -= len(m.ContainerId) - copy(dAtA[i:], m.ContainerId) - i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) + if len(m.PodSandboxId) > 0 { + i -= len(m.PodSandboxId) + copy(dAtA[i:], m.PodSandboxId) + i = encodeVarintApi(dAtA, i, uint64(len(m.PodSandboxId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *UpdateContainerResourcesResponse) Marshal() (dAtA []byte, err error) { +func (m *CreateContainerResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -11926,20 +12962,27 @@ func (m *UpdateContainerResourcesResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *UpdateContainerResourcesResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *CreateContainerResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *UpdateContainerResourcesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *CreateContainerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.ContainerId) > 0 { + i -= len(m.ContainerId) + copy(dAtA[i:], m.ContainerId) + i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } -func (m *ExecSyncRequest) Marshal() (dAtA []byte, err error) { +func (m *StartContainerRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -11949,30 +12992,16 @@ func (m *ExecSyncRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ExecSyncRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *StartContainerRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ExecSyncRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *StartContainerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Timeout != 0 { - i = encodeVarintApi(dAtA, i, uint64(m.Timeout)) - i-- - dAtA[i] = 0x18 - } - if len(m.Cmd) > 0 { - for iNdEx := len(m.Cmd) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Cmd[iNdEx]) - copy(dAtA[i:], m.Cmd[iNdEx]) - i = encodeVarintApi(dAtA, i, uint64(len(m.Cmd[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } if len(m.ContainerId) > 0 { i -= len(m.ContainerId) copy(dAtA[i:], m.ContainerId) @@ -11983,7 +13012,7 @@ func (m *ExecSyncRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ExecSyncResponse) Marshal() (dAtA []byte, err error) { +func (m *StartContainerResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -11993,39 +13022,20 @@ func (m *ExecSyncResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ExecSyncResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *StartContainerResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ExecSyncResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *StartContainerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.ExitCode != 0 { - i = encodeVarintApi(dAtA, i, uint64(m.ExitCode)) - i-- - dAtA[i] = 0x18 - } - if len(m.Stderr) > 0 { - i -= len(m.Stderr) - copy(dAtA[i:], m.Stderr) - i = encodeVarintApi(dAtA, i, uint64(len(m.Stderr))) - i-- - dAtA[i] = 0x12 - } - if len(m.Stdout) > 0 { - i -= len(m.Stdout) - copy(dAtA[i:], m.Stdout) - i = encodeVarintApi(dAtA, i, uint64(len(m.Stdout))) - i-- - dAtA[i] = 0xa - } return len(dAtA) - i, nil } -func (m *ExecRequest) Marshal() (dAtA []byte, err error) { +func (m *StopContainerRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -12035,64 +13045,20 @@ func (m *ExecRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ExecRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *StopContainerRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ExecRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *StopContainerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Stderr { - i-- - if m.Stderr { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x30 - } - if m.Stdout { - i-- - if m.Stdout { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } - if m.Stdin { - i-- - if m.Stdin { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if m.Tty { - i-- - if m.Tty { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } + if m.Timeout != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.Timeout)) i-- - dAtA[i] = 0x18 - } - if len(m.Cmd) > 0 { - for iNdEx := len(m.Cmd) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Cmd[iNdEx]) - copy(dAtA[i:], m.Cmd[iNdEx]) - i = encodeVarintApi(dAtA, i, uint64(len(m.Cmd[iNdEx]))) - i-- - dAtA[i] = 0x12 - } + dAtA[i] = 0x10 } if len(m.ContainerId) > 0 { i -= len(m.ContainerId) @@ -12104,7 +13070,7 @@ func (m *ExecRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ExecResponse) Marshal() (dAtA []byte, err error) { +func (m *StopContainerResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -12114,27 +13080,20 @@ func (m *ExecResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ExecResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *StopContainerResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ExecResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *StopContainerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Url) > 0 { - i -= len(m.Url) - copy(dAtA[i:], m.Url) - i = encodeVarintApi(dAtA, i, uint64(len(m.Url))) - i-- - dAtA[i] = 0xa - } return len(dAtA) - i, nil } -func (m *AttachRequest) Marshal() (dAtA []byte, err error) { +func (m *RemoveContainerRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -12144,56 +13103,16 @@ func (m *AttachRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *AttachRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *RemoveContainerRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *AttachRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RemoveContainerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Stderr { - i-- - if m.Stderr { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } - if m.Stdout { - i-- - if m.Stdout { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if m.Tty { - i-- - if m.Tty { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x18 - } - if m.Stdin { - i-- - if m.Stdin { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } if len(m.ContainerId) > 0 { i -= len(m.ContainerId) copy(dAtA[i:], m.ContainerId) @@ -12204,7 +13123,7 @@ func (m *AttachRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *AttachResponse) Marshal() (dAtA []byte, err error) { +func (m *RemoveContainerResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -12214,27 +13133,20 @@ func (m *AttachResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *AttachResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *RemoveContainerResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *AttachResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RemoveContainerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Url) > 0 { - i -= len(m.Url) - copy(dAtA[i:], m.Url) - i = encodeVarintApi(dAtA, i, uint64(len(m.Url))) - i-- - dAtA[i] = 0xa - } return len(dAtA) - i, nil } -func (m *PortForwardRequest) Marshal() (dAtA []byte, err error) { +func (m *ContainerStateValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -12244,46 +13156,25 @@ func (m *PortForwardRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PortForwardRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *ContainerStateValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PortForwardRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ContainerStateValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Port) > 0 { - dAtA52 := make([]byte, len(m.Port)*10) - var j51 int - for _, num1 := range m.Port { - num := uint64(num1) - for num >= 1<<7 { - dAtA52[j51] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j51++ - } - dAtA52[j51] = uint8(num) - j51++ - } - i -= j51 - copy(dAtA[i:], dAtA52[:j51]) - i = encodeVarintApi(dAtA, i, uint64(j51)) - i-- - dAtA[i] = 0x12 - } - if len(m.PodSandboxId) > 0 { - i -= len(m.PodSandboxId) - copy(dAtA[i:], m.PodSandboxId) - i = encodeVarintApi(dAtA, i, uint64(len(m.PodSandboxId))) + if m.State != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.State)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *PortForwardResponse) Marshal() (dAtA []byte, err error) { +func (m *ContainerFilter) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -12293,27 +13184,65 @@ func (m *PortForwardResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PortForwardResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *ContainerFilter) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PortForwardResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ContainerFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Url) > 0 { - i -= len(m.Url) - copy(dAtA[i:], m.Url) - i = encodeVarintApi(dAtA, i, uint64(len(m.Url))) + if len(m.LabelSelector) > 0 { + for k := range m.LabelSelector { + v := m.LabelSelector[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintApi(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintApi(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintApi(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x22 + } + } + if len(m.PodSandboxId) > 0 { + i -= len(m.PodSandboxId) + copy(dAtA[i:], m.PodSandboxId) + i = encodeVarintApi(dAtA, i, uint64(len(m.PodSandboxId))) + i-- + dAtA[i] = 0x1a + } + if m.State != nil { + { + size, err := m.State.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *ImageFilter) Marshal() (dAtA []byte, err error) { +func (m *ListContainersRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -12323,19 +13252,19 @@ func (m *ImageFilter) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ImageFilter) MarshalTo(dAtA []byte) (int, error) { +func (m *ListContainersRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ImageFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ListContainersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Image != nil { + if m.Filter != nil { { - size, err := m.Image.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -12348,7 +13277,7 @@ func (m *ImageFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ListImagesRequest) Marshal() (dAtA []byte, err error) { +func (m *Container) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -12358,54 +13287,74 @@ func (m *ListImagesRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ListImagesRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *Container) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ListImagesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Container) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Filter != nil { - { - size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) + if len(m.Annotations) > 0 { + for k := range m.Annotations { + v := m.Annotations[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintApi(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintApi(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintApi(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x4a + } + } + if len(m.Labels) > 0 { + for k := range m.Labels { + v := m.Labels[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintApi(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintApi(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintApi(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x42 } + } + if m.CreatedAt != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.CreatedAt)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x38 } - return len(dAtA) - i, nil -} - -func (m *Image) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + if m.State != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x30 } - return dAtA[:n], nil -} - -func (m *Image) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Image) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Spec != nil { + if len(m.ImageRef) > 0 { + i -= len(m.ImageRef) + copy(dAtA[i:], m.ImageRef) + i = encodeVarintApi(dAtA, i, uint64(len(m.ImageRef))) + i-- + dAtA[i] = 0x2a + } + if m.Image != nil { { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Image.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -12413,18 +13362,11 @@ func (m *Image) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintApi(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x3a - } - if len(m.Username) > 0 { - i -= len(m.Username) - copy(dAtA[i:], m.Username) - i = encodeVarintApi(dAtA, i, uint64(len(m.Username))) - i-- - dAtA[i] = 0x32 + dAtA[i] = 0x22 } - if m.Uid != nil { + if m.Metadata != nil { { - size, err := m.Uid.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -12432,30 +13374,14 @@ func (m *Image) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintApi(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x1a } - if m.Size_ != 0 { - i = encodeVarintApi(dAtA, i, uint64(m.Size_)) + if len(m.PodSandboxId) > 0 { + i -= len(m.PodSandboxId) + copy(dAtA[i:], m.PodSandboxId) + i = encodeVarintApi(dAtA, i, uint64(len(m.PodSandboxId))) i-- - dAtA[i] = 0x20 - } - if len(m.RepoDigests) > 0 { - for iNdEx := len(m.RepoDigests) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.RepoDigests[iNdEx]) - copy(dAtA[i:], m.RepoDigests[iNdEx]) - i = encodeVarintApi(dAtA, i, uint64(len(m.RepoDigests[iNdEx]))) - i-- - dAtA[i] = 0x1a - } - } - if len(m.RepoTags) > 0 { - for iNdEx := len(m.RepoTags) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.RepoTags[iNdEx]) - copy(dAtA[i:], m.RepoTags[iNdEx]) - i = encodeVarintApi(dAtA, i, uint64(len(m.RepoTags[iNdEx]))) - i-- - dAtA[i] = 0x12 - } + dAtA[i] = 0x12 } if len(m.Id) > 0 { i -= len(m.Id) @@ -12467,7 +13393,7 @@ func (m *Image) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ListImagesResponse) Marshal() (dAtA []byte, err error) { +func (m *ListContainersResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -12477,20 +13403,20 @@ func (m *ListImagesResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ListImagesResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *ListContainersResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ListImagesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ListContainersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Images) > 0 { - for iNdEx := len(m.Images) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Containers) > 0 { + for iNdEx := len(m.Containers) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Images[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Containers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -12504,7 +13430,7 @@ func (m *ListImagesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ImageStatusRequest) Marshal() (dAtA []byte, err error) { +func (m *ContainerStatusRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -12514,12 +13440,12 @@ func (m *ImageStatusRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ImageStatusRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *ContainerStatusRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ImageStatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ContainerStatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -12534,22 +13460,17 @@ func (m *ImageStatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x10 } - if m.Image != nil { - { - size, err := m.Image.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } + if len(m.ContainerId) > 0 { + i -= len(m.ContainerId) + copy(dAtA[i:], m.ContainerId) + i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *ImageStatusResponse) Marshal() (dAtA []byte, err error) { +func (m *ContainerStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -12559,19 +13480,40 @@ func (m *ImageStatusResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ImageStatusResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *ContainerStatus) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ImageStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ContainerStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Info) > 0 { - for k := range m.Info { - v := m.Info[k] + if len(m.LogPath) > 0 { + i -= len(m.LogPath) + copy(dAtA[i:], m.LogPath) + i = encodeVarintApi(dAtA, i, uint64(len(m.LogPath))) + i-- + dAtA[i] = 0x7a + } + if len(m.Mounts) > 0 { + for iNdEx := len(m.Mounts) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Mounts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + } + if len(m.Annotations) > 0 { + for k := range m.Annotations { + v := m.Annotations[k] baseI := i i -= len(v) copy(dAtA[i:], v) @@ -12585,9 +13527,49 @@ func (m *ImageStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- + dAtA[i] = 0x6a + } + } + if len(m.Labels) > 0 { + for k := range m.Labels { + v := m.Labels[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintApi(dAtA, i, uint64(len(v))) + i-- dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintApi(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintApi(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x62 } } + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintApi(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x5a + } + if len(m.Reason) > 0 { + i -= len(m.Reason) + copy(dAtA[i:], m.Reason) + i = encodeVarintApi(dAtA, i, uint64(len(m.Reason))) + i-- + dAtA[i] = 0x52 + } + if len(m.ImageRef) > 0 { + i -= len(m.ImageRef) + copy(dAtA[i:], m.ImageRef) + i = encodeVarintApi(dAtA, i, uint64(len(m.ImageRef))) + i-- + dAtA[i] = 0x4a + } if m.Image != nil { { size, err := m.Image.MarshalToSizedBuffer(dAtA[:i]) @@ -12598,12 +13580,56 @@ func (m *ImageStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintApi(dAtA, i, uint64(size)) } i-- + dAtA[i] = 0x42 + } + if m.ExitCode != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.ExitCode)) + i-- + dAtA[i] = 0x38 + } + if m.FinishedAt != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.FinishedAt)) + i-- + dAtA[i] = 0x30 + } + if m.StartedAt != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.StartedAt)) + i-- + dAtA[i] = 0x28 + } + if m.CreatedAt != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.CreatedAt)) + i-- + dAtA[i] = 0x20 + } + if m.State != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x18 + } + if m.Metadata != nil { + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) + i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *AuthConfig) Marshal() (dAtA []byte, err error) { +func (m *ContainerStatusResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -12613,62 +13639,51 @@ func (m *AuthConfig) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *AuthConfig) MarshalTo(dAtA []byte) (int, error) { +func (m *ContainerStatusResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *AuthConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ContainerStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.RegistryToken) > 0 { - i -= len(m.RegistryToken) - copy(dAtA[i:], m.RegistryToken) - i = encodeVarintApi(dAtA, i, uint64(len(m.RegistryToken))) - i-- - dAtA[i] = 0x32 - } - if len(m.IdentityToken) > 0 { - i -= len(m.IdentityToken) - copy(dAtA[i:], m.IdentityToken) - i = encodeVarintApi(dAtA, i, uint64(len(m.IdentityToken))) - i-- - dAtA[i] = 0x2a - } - if len(m.ServerAddress) > 0 { - i -= len(m.ServerAddress) - copy(dAtA[i:], m.ServerAddress) - i = encodeVarintApi(dAtA, i, uint64(len(m.ServerAddress))) - i-- - dAtA[i] = 0x22 - } - if len(m.Auth) > 0 { - i -= len(m.Auth) - copy(dAtA[i:], m.Auth) - i = encodeVarintApi(dAtA, i, uint64(len(m.Auth))) - i-- - dAtA[i] = 0x1a - } - if len(m.Password) > 0 { - i -= len(m.Password) - copy(dAtA[i:], m.Password) - i = encodeVarintApi(dAtA, i, uint64(len(m.Password))) - i-- - dAtA[i] = 0x12 + if len(m.Info) > 0 { + for k := range m.Info { + v := m.Info[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintApi(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintApi(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintApi(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } } - if len(m.Username) > 0 { - i -= len(m.Username) - copy(dAtA[i:], m.Username) - i = encodeVarintApi(dAtA, i, uint64(len(m.Username))) + if m.Status != nil { + { + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *PullImageRequest) Marshal() (dAtA []byte, err error) { +func (m *UpdateContainerResourcesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -12678,19 +13693,38 @@ func (m *PullImageRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PullImageRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *UpdateContainerResourcesRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PullImageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *UpdateContainerResourcesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.SandboxConfig != nil { + if len(m.Annotations) > 0 { + for k := range m.Annotations { + v := m.Annotations[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintApi(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintApi(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintApi(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x22 + } + } + if m.Windows != nil { { - size, err := m.SandboxConfig.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Windows.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -12700,9 +13734,9 @@ func (m *PullImageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x1a } - if m.Auth != nil { + if m.Linux != nil { { - size, err := m.Auth.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Linux.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -12712,22 +13746,17 @@ func (m *PullImageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if m.Image != nil { - { - size, err := m.Image.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } + if len(m.ContainerId) > 0 { + i -= len(m.ContainerId) + copy(dAtA[i:], m.ContainerId) + i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *PullImageResponse) Marshal() (dAtA []byte, err error) { +func (m *UpdateContainerResourcesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -12737,27 +13766,20 @@ func (m *PullImageResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PullImageResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *UpdateContainerResourcesResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PullImageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *UpdateContainerResourcesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.ImageRef) > 0 { - i -= len(m.ImageRef) - copy(dAtA[i:], m.ImageRef) - i = encodeVarintApi(dAtA, i, uint64(len(m.ImageRef))) - i-- - dAtA[i] = 0xa - } return len(dAtA) - i, nil } -func (m *RemoveImageRequest) Marshal() (dAtA []byte, err error) { +func (m *ExecSyncRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -12767,32 +13789,41 @@ func (m *RemoveImageRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *RemoveImageRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *ExecSyncRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *RemoveImageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ExecSyncRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Image != nil { - { - size, err := m.Image.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) + if m.Timeout != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.Timeout)) + i-- + dAtA[i] = 0x18 + } + if len(m.Cmd) > 0 { + for iNdEx := len(m.Cmd) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Cmd[iNdEx]) + copy(dAtA[i:], m.Cmd[iNdEx]) + i = encodeVarintApi(dAtA, i, uint64(len(m.Cmd[iNdEx]))) + i-- + dAtA[i] = 0x12 } + } + if len(m.ContainerId) > 0 { + i -= len(m.ContainerId) + copy(dAtA[i:], m.ContainerId) + i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *RemoveImageResponse) Marshal() (dAtA []byte, err error) { +func (m *ExecSyncResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -12802,50 +13833,39 @@ func (m *RemoveImageResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *RemoveImageResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *ExecSyncResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *RemoveImageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ExecSyncResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - return len(dAtA) - i, nil -} - -func (m *NetworkConfig) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + if m.ExitCode != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.ExitCode)) + i-- + dAtA[i] = 0x18 } - return dAtA[:n], nil -} - -func (m *NetworkConfig) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NetworkConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.PodCidr) > 0 { - i -= len(m.PodCidr) - copy(dAtA[i:], m.PodCidr) - i = encodeVarintApi(dAtA, i, uint64(len(m.PodCidr))) + if len(m.Stderr) > 0 { + i -= len(m.Stderr) + copy(dAtA[i:], m.Stderr) + i = encodeVarintApi(dAtA, i, uint64(len(m.Stderr))) + i-- + dAtA[i] = 0x12 + } + if len(m.Stdout) > 0 { + i -= len(m.Stdout) + copy(dAtA[i:], m.Stdout) + i = encodeVarintApi(dAtA, i, uint64(len(m.Stdout))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *RuntimeConfig) Marshal() (dAtA []byte, err error) { +func (m *ExecRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -12855,67 +13875,76 @@ func (m *RuntimeConfig) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *RuntimeConfig) MarshalTo(dAtA []byte) (int, error) { +func (m *ExecRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *RuntimeConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ExecRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.NetworkConfig != nil { - { - size, err := m.NetworkConfig.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } + if m.Stderr { i-- - dAtA[i] = 0xa + if m.Stderr { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 } - return len(dAtA) - i, nil -} - -func (m *UpdateRuntimeConfigRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + if m.Stdout { + i-- + if m.Stdout { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 } - return dAtA[:n], nil -} - -func (m *UpdateRuntimeConfigRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UpdateRuntimeConfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.RuntimeConfig != nil { - { - size, err := m.RuntimeConfig.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) + if m.Stdin { + i-- + if m.Stdin { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.Tty { + i-- + if m.Tty { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if len(m.Cmd) > 0 { + for iNdEx := len(m.Cmd) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Cmd[iNdEx]) + copy(dAtA[i:], m.Cmd[iNdEx]) + i = encodeVarintApi(dAtA, i, uint64(len(m.Cmd[iNdEx]))) + i-- + dAtA[i] = 0x12 } + } + if len(m.ContainerId) > 0 { + i -= len(m.ContainerId) + copy(dAtA[i:], m.ContainerId) + i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *UpdateRuntimeConfigResponse) Marshal() (dAtA []byte, err error) { +func (m *ExecResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -12925,20 +13954,27 @@ func (m *UpdateRuntimeConfigResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *UpdateRuntimeConfigResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *ExecResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *UpdateRuntimeConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ExecResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.Url) > 0 { + i -= len(m.Url) + copy(dAtA[i:], m.Url) + i = encodeVarintApi(dAtA, i, uint64(len(m.Url))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } -func (m *RuntimeCondition) Marshal() (dAtA []byte, err error) { +func (m *AttachRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -12948,33 +13984,49 @@ func (m *RuntimeCondition) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *RuntimeCondition) MarshalTo(dAtA []byte) (int, error) { +func (m *AttachRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *RuntimeCondition) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AttachRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Message) > 0 { - i -= len(m.Message) - copy(dAtA[i:], m.Message) - i = encodeVarintApi(dAtA, i, uint64(len(m.Message))) + if m.Stderr { i-- - dAtA[i] = 0x22 + if m.Stderr { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 } - if len(m.Reason) > 0 { - i -= len(m.Reason) - copy(dAtA[i:], m.Reason) - i = encodeVarintApi(dAtA, i, uint64(len(m.Reason))) + if m.Stdout { i-- - dAtA[i] = 0x1a + if m.Stdout { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 } - if m.Status { + if m.Tty { i-- - if m.Status { + if m.Tty { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.Stdin { + i-- + if m.Stdin { dAtA[i] = 1 } else { dAtA[i] = 0 @@ -12982,54 +14034,17 @@ func (m *RuntimeCondition) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x10 } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintApi(dAtA, i, uint64(len(m.Type))) + if len(m.ContainerId) > 0 { + i -= len(m.ContainerId) + copy(dAtA[i:], m.ContainerId) + i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *RuntimeStatus) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RuntimeStatus) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RuntimeStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Conditions) > 0 { - for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Conditions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *StatusRequest) Marshal() (dAtA []byte, err error) { +func (m *AttachResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -13039,30 +14054,27 @@ func (m *StatusRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *StatusRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *AttachResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *StatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AttachResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Verbose { - i-- - if m.Verbose { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } + if len(m.Url) > 0 { + i -= len(m.Url) + copy(dAtA[i:], m.Url) + i = encodeVarintApi(dAtA, i, uint64(len(m.Url))) i-- - dAtA[i] = 0x8 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *StatusResponse) Marshal() (dAtA []byte, err error) { +func (m *PortForwardRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -13072,51 +14084,46 @@ func (m *StatusResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *StatusResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *PortForwardRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *StatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *PortForwardRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Info) > 0 { - for k := range m.Info { - v := m.Info[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintApi(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintApi(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintApi(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x12 - } - } - if m.Status != nil { - { - size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.Port) > 0 { + dAtA72 := make([]byte, len(m.Port)*10) + var j71 int + for _, num1 := range m.Port { + num := uint64(num1) + for num >= 1<<7 { + dAtA72[j71] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j71++ } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) + dAtA72[j71] = uint8(num) + j71++ } + i -= j71 + copy(dAtA[i:], dAtA72[:j71]) + i = encodeVarintApi(dAtA, i, uint64(j71)) + i-- + dAtA[i] = 0x12 + } + if len(m.PodSandboxId) > 0 { + i -= len(m.PodSandboxId) + copy(dAtA[i:], m.PodSandboxId) + i = encodeVarintApi(dAtA, i, uint64(len(m.PodSandboxId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *ImageFsInfoRequest) Marshal() (dAtA []byte, err error) { +func (m *PortForwardResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -13126,20 +14133,27 @@ func (m *ImageFsInfoRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ImageFsInfoRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *PortForwardResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ImageFsInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *PortForwardResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.Url) > 0 { + i -= len(m.Url) + copy(dAtA[i:], m.Url) + i = encodeVarintApi(dAtA, i, uint64(len(m.Url))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } -func (m *UInt64Value) Marshal() (dAtA []byte, err error) { +func (m *ImageFilter) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -13149,25 +14163,32 @@ func (m *UInt64Value) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *UInt64Value) MarshalTo(dAtA []byte) (int, error) { +func (m *ImageFilter) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *UInt64Value) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ImageFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Value != 0 { - i = encodeVarintApi(dAtA, i, uint64(m.Value)) + if m.Image != nil { + { + size, err := m.Image.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } i-- - dAtA[i] = 0x8 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *FilesystemIdentifier) Marshal() (dAtA []byte, err error) { +func (m *ListImagesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -13177,27 +14198,32 @@ func (m *FilesystemIdentifier) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *FilesystemIdentifier) MarshalTo(dAtA []byte) (int, error) { +func (m *ListImagesRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *FilesystemIdentifier) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ListImagesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Mountpoint) > 0 { - i -= len(m.Mountpoint) - copy(dAtA[i:], m.Mountpoint) - i = encodeVarintApi(dAtA, i, uint64(len(m.Mountpoint))) + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *FilesystemUsage) Marshal() (dAtA []byte, err error) { +func (m *Image) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -13207,31 +14233,29 @@ func (m *FilesystemUsage) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *FilesystemUsage) MarshalTo(dAtA []byte) (int, error) { +func (m *Image) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *FilesystemUsage) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Image) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.InodesUsed != nil { - { - size, err := m.InodesUsed.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) + if m.Pinned { + i-- + if m.Pinned { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x40 } - if m.UsedBytes != nil { + if m.Spec != nil { { - size, err := m.UsedBytes.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -13239,11 +14263,18 @@ func (m *FilesystemUsage) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintApi(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x3a } - if m.FsId != nil { + if len(m.Username) > 0 { + i -= len(m.Username) + copy(dAtA[i:], m.Username) + i = encodeVarintApi(dAtA, i, uint64(len(m.Username))) + i-- + dAtA[i] = 0x32 + } + if m.Uid != nil { { - size, err := m.FsId.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Uid.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -13251,17 +14282,42 @@ func (m *FilesystemUsage) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintApi(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x2a } - if m.Timestamp != 0 { - i = encodeVarintApi(dAtA, i, uint64(m.Timestamp)) + if m.Size_ != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.Size_)) i-- - dAtA[i] = 0x8 + dAtA[i] = 0x20 + } + if len(m.RepoDigests) > 0 { + for iNdEx := len(m.RepoDigests) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RepoDigests[iNdEx]) + copy(dAtA[i:], m.RepoDigests[iNdEx]) + i = encodeVarintApi(dAtA, i, uint64(len(m.RepoDigests[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.RepoTags) > 0 { + for iNdEx := len(m.RepoTags) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RepoTags[iNdEx]) + copy(dAtA[i:], m.RepoTags[iNdEx]) + i = encodeVarintApi(dAtA, i, uint64(len(m.RepoTags[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *ImageFsInfoResponse) Marshal() (dAtA []byte, err error) { +func (m *ListImagesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -13271,20 +14327,20 @@ func (m *ImageFsInfoResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ImageFsInfoResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *ListImagesResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ImageFsInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ListImagesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.ImageFilesystems) > 0 { - for iNdEx := len(m.ImageFilesystems) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Images) > 0 { + for iNdEx := len(m.Images) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.ImageFilesystems[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Images[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -13298,7 +14354,7 @@ func (m *ImageFsInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ContainerStatsRequest) Marshal() (dAtA []byte, err error) { +func (m *ImageStatusRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -13308,27 +14364,42 @@ func (m *ContainerStatsRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ContainerStatsRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *ImageStatusRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ContainerStatsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ImageStatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.ContainerId) > 0 { - i -= len(m.ContainerId) - copy(dAtA[i:], m.ContainerId) - i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) + if m.Verbose { + i-- + if m.Verbose { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.Image != nil { + { + size, err := m.Image.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *ContainerStatsResponse) Marshal() (dAtA []byte, err error) { +func (m *ImageStatusResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -13338,19 +14409,38 @@ func (m *ContainerStatsResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ContainerStatsResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *ImageStatusResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ContainerStatsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ImageStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Stats != nil { + if len(m.Info) > 0 { + for k := range m.Info { + v := m.Info[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintApi(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintApi(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintApi(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if m.Image != nil { { - size, err := m.Stats.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Image.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -13363,7 +14453,7 @@ func (m *ContainerStatsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *ListContainerStatsRequest) Marshal() (dAtA []byte, err error) { +func (m *AuthConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -13373,32 +14463,62 @@ func (m *ListContainerStatsRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ListContainerStatsRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *AuthConfig) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ListContainerStatsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AuthConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Filter != nil { - { - size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } + if len(m.RegistryToken) > 0 { + i -= len(m.RegistryToken) + copy(dAtA[i:], m.RegistryToken) + i = encodeVarintApi(dAtA, i, uint64(len(m.RegistryToken))) + i-- + dAtA[i] = 0x32 + } + if len(m.IdentityToken) > 0 { + i -= len(m.IdentityToken) + copy(dAtA[i:], m.IdentityToken) + i = encodeVarintApi(dAtA, i, uint64(len(m.IdentityToken))) + i-- + dAtA[i] = 0x2a + } + if len(m.ServerAddress) > 0 { + i -= len(m.ServerAddress) + copy(dAtA[i:], m.ServerAddress) + i = encodeVarintApi(dAtA, i, uint64(len(m.ServerAddress))) + i-- + dAtA[i] = 0x22 + } + if len(m.Auth) > 0 { + i -= len(m.Auth) + copy(dAtA[i:], m.Auth) + i = encodeVarintApi(dAtA, i, uint64(len(m.Auth))) + i-- + dAtA[i] = 0x1a + } + if len(m.Password) > 0 { + i -= len(m.Password) + copy(dAtA[i:], m.Password) + i = encodeVarintApi(dAtA, i, uint64(len(m.Password))) + i-- + dAtA[i] = 0x12 + } + if len(m.Username) > 0 { + i -= len(m.Username) + copy(dAtA[i:], m.Username) + i = encodeVarintApi(dAtA, i, uint64(len(m.Username))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *ContainerStatsFilter) Marshal() (dAtA []byte, err error) { +func (m *PullImageRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -13408,53 +14528,56 @@ func (m *ContainerStatsFilter) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ContainerStatsFilter) MarshalTo(dAtA []byte) (int, error) { +func (m *PullImageRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ContainerStatsFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *PullImageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.LabelSelector) > 0 { - for k := range m.LabelSelector { - v := m.LabelSelector[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintApi(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintApi(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintApi(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1a + if m.SandboxConfig != nil { + { + size, err := m.SandboxConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x1a } - if len(m.PodSandboxId) > 0 { - i -= len(m.PodSandboxId) - copy(dAtA[i:], m.PodSandboxId) - i = encodeVarintApi(dAtA, i, uint64(len(m.PodSandboxId))) + if m.Auth != nil { + { + size, err := m.Auth.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0x12 } - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) + if m.Image != nil { + { + size, err := m.Image.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *ListContainerStatsResponse) Marshal() (dAtA []byte, err error) { +func (m *PullImageResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -13464,34 +14587,27 @@ func (m *ListContainerStatsResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ListContainerStatsResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *PullImageResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ListContainerStatsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *PullImageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Stats) > 0 { - for iNdEx := len(m.Stats) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Stats[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } + if len(m.ImageRef) > 0 { + i -= len(m.ImageRef) + copy(dAtA[i:], m.ImageRef) + i = encodeVarintApi(dAtA, i, uint64(len(m.ImageRef))) + i-- + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *ContainerAttributes) Marshal() (dAtA []byte, err error) { +func (m *RemoveImageRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -13501,57 +14617,19 @@ func (m *ContainerAttributes) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ContainerAttributes) MarshalTo(dAtA []byte) (int, error) { +func (m *RemoveImageRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ContainerAttributes) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RemoveImageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Annotations) > 0 { - for k := range m.Annotations { - v := m.Annotations[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintApi(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintApi(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintApi(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x22 - } - } - if len(m.Labels) > 0 { - for k := range m.Labels { - v := m.Labels[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintApi(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintApi(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintApi(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1a - } - } - if m.Metadata != nil { + if m.Image != nil { { - size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Image.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -13559,19 +14637,65 @@ func (m *ContainerAttributes) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintApi(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0xa } - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) + return len(dAtA) - i, nil +} + +func (m *RemoveImageResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RemoveImageResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemoveImageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *NetworkConfig) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *NetworkConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NetworkConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PodCidr) > 0 { + i -= len(m.PodCidr) + copy(dAtA[i:], m.PodCidr) + i = encodeVarintApi(dAtA, i, uint64(len(m.PodCidr))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *ContainerStats) Marshal() (dAtA []byte, err error) { +func (m *RuntimeConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -13581,19 +14705,19 @@ func (m *ContainerStats) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ContainerStats) MarshalTo(dAtA []byte) (int, error) { +func (m *RuntimeConfig) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ContainerStats) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RuntimeConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.WritableLayer != nil { + if m.NetworkConfig != nil { { - size, err := m.WritableLayer.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.NetworkConfig.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -13601,11 +14725,34 @@ func (m *ContainerStats) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintApi(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0xa } - if m.Memory != nil { + return len(dAtA) - i, nil +} + +func (m *UpdateRuntimeConfigRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UpdateRuntimeConfigRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateRuntimeConfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.RuntimeConfig != nil { { - size, err := m.Memory.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.RuntimeConfig.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -13613,36 +14760,89 @@ func (m *ContainerStats) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintApi(dAtA, i, uint64(size)) } i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UpdateRuntimeConfigResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UpdateRuntimeConfigResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UpdateRuntimeConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *RuntimeCondition) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RuntimeCondition) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RuntimeCondition) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintApi(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x22 + } + if len(m.Reason) > 0 { + i -= len(m.Reason) + copy(dAtA[i:], m.Reason) + i = encodeVarintApi(dAtA, i, uint64(len(m.Reason))) + i-- dAtA[i] = 0x1a } - if m.Cpu != nil { - { - size, err := m.Cpu.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) + if m.Status { + i-- + if m.Status { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x10 } - if m.Attributes != nil { - { - size, err := m.Attributes.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) - } + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintApi(dAtA, i, uint64(len(m.Type))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *CpuUsage) Marshal() (dAtA []byte, err error) { +func (m *RuntimeStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -13652,37 +14852,67 @@ func (m *CpuUsage) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *CpuUsage) MarshalTo(dAtA []byte) (int, error) { +func (m *RuntimeStatus) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *CpuUsage) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RuntimeStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.UsageCoreNanoSeconds != nil { - { - size, err := m.UsageCoreNanoSeconds.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.Conditions) > 0 { + for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Conditions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintApi(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0x12 } - if m.Timestamp != 0 { - i = encodeVarintApi(dAtA, i, uint64(m.Timestamp)) + return len(dAtA) - i, nil +} + +func (m *StatusRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StatusRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Verbose { + i-- + if m.Verbose { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *MemoryUsage) Marshal() (dAtA []byte, err error) { +func (m *StatusResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -13692,19 +14922,38 @@ func (m *MemoryUsage) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MemoryUsage) MarshalTo(dAtA []byte) (int, error) { +func (m *StatusResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MemoryUsage) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *StatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.WorkingSetBytes != nil { + if len(m.Info) > 0 { + for k := range m.Info { + v := m.Info[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintApi(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintApi(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintApi(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if m.Status != nil { { - size, err := m.WorkingSetBytes.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -13712,17 +14961,12 @@ func (m *MemoryUsage) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintApi(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 - } - if m.Timestamp != 0 { - i = encodeVarintApi(dAtA, i, uint64(m.Timestamp)) - i-- - dAtA[i] = 0x8 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *ReopenContainerLogRequest) Marshal() (dAtA []byte, err error) { +func (m *ImageFsInfoRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -13732,27 +14976,20 @@ func (m *ReopenContainerLogRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ReopenContainerLogRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *ImageFsInfoRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ReopenContainerLogRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ImageFsInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.ContainerId) > 0 { - i -= len(m.ContainerId) - copy(dAtA[i:], m.ContainerId) - i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) - i-- - dAtA[i] = 0xa - } return len(dAtA) - i, nil } -func (m *ReopenContainerLogResponse) Marshal() (dAtA []byte, err error) { +func (m *UInt64Value) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -13762,822 +14999,868 @@ func (m *ReopenContainerLogResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ReopenContainerLogResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *UInt64Value) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ReopenContainerLogResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *UInt64Value) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if m.Value != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.Value)) + i-- + dAtA[i] = 0x8 + } return len(dAtA) - i, nil } -func encodeVarintApi(dAtA []byte, offset int, v uint64) int { - offset -= sovApi(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *FilesystemIdentifier) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *VersionRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Version) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - return n + +func (m *FilesystemIdentifier) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *VersionResponse) Size() (n int) { - if m == nil { - return 0 - } +func (m *FilesystemIdentifier) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Version) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - l = len(m.RuntimeName) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - l = len(m.RuntimeVersion) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - l = len(m.RuntimeApiVersion) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) + if len(m.Mountpoint) > 0 { + i -= len(m.Mountpoint) + copy(dAtA[i:], m.Mountpoint) + i = encodeVarintApi(dAtA, i, uint64(len(m.Mountpoint))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *DNSConfig) Size() (n int) { - if m == nil { - return 0 +func (m *FilesystemUsage) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *FilesystemUsage) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FilesystemUsage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.Servers) > 0 { - for _, s := range m.Servers { - l = len(s) - n += 1 + l + sovApi(uint64(l)) + if m.InodesUsed != nil { + { + size, err := m.InodesUsed.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x22 } - if len(m.Searches) > 0 { - for _, s := range m.Searches { - l = len(s) - n += 1 + l + sovApi(uint64(l)) - } + if m.UsedBytes != nil { + { + size, err := m.UsedBytes.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } - if len(m.Options) > 0 { - for _, s := range m.Options { - l = len(s) - n += 1 + l + sovApi(uint64(l)) + if m.FsId != nil { + { + size, err := m.FsId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 } - return n + if m.Timestamp != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.Timestamp)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } -func (m *PortMapping) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Protocol != 0 { - n += 1 + sovApi(uint64(m.Protocol)) - } - if m.ContainerPort != 0 { - n += 1 + sovApi(uint64(m.ContainerPort)) - } - if m.HostPort != 0 { - n += 1 + sovApi(uint64(m.HostPort)) - } - l = len(m.HostIp) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) +func (m *ImageFsInfoResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *Mount) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ContainerPath) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - l = len(m.HostPath) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - if m.Readonly { - n += 2 - } - if m.SelinuxRelabel { - n += 2 - } - if m.Propagation != 0 { - n += 1 + sovApi(uint64(m.Propagation)) - } - return n +func (m *ImageFsInfoResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *NamespaceOption) Size() (n int) { - if m == nil { - return 0 - } +func (m *ImageFsInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.Network != 0 { - n += 1 + sovApi(uint64(m.Network)) - } - if m.Pid != 0 { - n += 1 + sovApi(uint64(m.Pid)) - } - if m.Ipc != 0 { - n += 1 + sovApi(uint64(m.Ipc)) - } - l = len(m.TargetId) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) + if len(m.ImageFilesystems) > 0 { + for iNdEx := len(m.ImageFilesystems) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ImageFilesystems[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } - return n + return len(dAtA) - i, nil } -func (m *Int64Value) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Value != 0 { - n += 1 + sovApi(uint64(m.Value)) +func (m *ContainerStatsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *LinuxSandboxSecurityContext) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.NamespaceOptions != nil { - l = m.NamespaceOptions.Size() - n += 1 + l + sovApi(uint64(l)) - } - if m.SelinuxOptions != nil { - l = m.SelinuxOptions.Size() - n += 1 + l + sovApi(uint64(l)) - } - if m.RunAsUser != nil { - l = m.RunAsUser.Size() - n += 1 + l + sovApi(uint64(l)) - } - if m.ReadonlyRootfs { - n += 2 - } - if len(m.SupplementalGroups) > 0 { - l = 0 - for _, e := range m.SupplementalGroups { - l += sovApi(uint64(e)) - } - n += 1 + sovApi(uint64(l)) + l - } - if m.Privileged { - n += 2 - } - l = len(m.SeccompProfilePath) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - if m.RunAsGroup != nil { - l = m.RunAsGroup.Size() - n += 1 + l + sovApi(uint64(l)) - } - if m.Seccomp != nil { - l = m.Seccomp.Size() - n += 1 + l + sovApi(uint64(l)) - } - if m.Apparmor != nil { - l = m.Apparmor.Size() - n += 1 + l + sovApi(uint64(l)) - } - return n +func (m *ContainerStatsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SecurityProfile) Size() (n int) { - if m == nil { - return 0 - } +func (m *ContainerStatsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.ProfileType != 0 { - n += 1 + sovApi(uint64(m.ProfileType)) - } - l = len(m.LocalhostRef) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) + if len(m.ContainerId) > 0 { + i -= len(m.ContainerId) + copy(dAtA[i:], m.ContainerId) + i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *LinuxPodSandboxConfig) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.CgroupParent) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - if m.SecurityContext != nil { - l = m.SecurityContext.Size() - n += 1 + l + sovApi(uint64(l)) - } - if len(m.Sysctls) > 0 { - for k, v := range m.Sysctls { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) - n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) - } +func (m *ContainerStatsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *PodSandboxMetadata) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - l = len(m.Uid) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - l = len(m.Namespace) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - if m.Attempt != 0 { - n += 1 + sovApi(uint64(m.Attempt)) - } - return n +func (m *ContainerStatsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PodSandboxConfig) Size() (n int) { - if m == nil { - return 0 - } +func (m *ContainerStatsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.Metadata != nil { - l = m.Metadata.Size() - n += 1 + l + sovApi(uint64(l)) - } - l = len(m.Hostname) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - l = len(m.LogDirectory) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - if m.DnsConfig != nil { - l = m.DnsConfig.Size() - n += 1 + l + sovApi(uint64(l)) - } - if len(m.PortMappings) > 0 { - for _, e := range m.PortMappings { - l = e.Size() - n += 1 + l + sovApi(uint64(l)) - } - } - if len(m.Labels) > 0 { - for k, v := range m.Labels { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) - n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) - } - } - if len(m.Annotations) > 0 { - for k, v := range m.Annotations { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) - n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) + if m.Stats != nil { + { + size, err := m.Stats.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - if m.Linux != nil { - l = m.Linux.Size() - n += 1 + l + sovApi(uint64(l)) - } - return n + return len(dAtA) - i, nil } -func (m *RunPodSandboxRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Config != nil { - l = m.Config.Size() - n += 1 + l + sovApi(uint64(l)) - } - l = len(m.RuntimeHandler) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) +func (m *ListContainerStatsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *RunPodSandboxResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.PodSandboxId) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - return n +func (m *ListContainerStatsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *StopPodSandboxRequest) Size() (n int) { - if m == nil { - return 0 - } +func (m *ListContainerStatsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.PodSandboxId) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *StopPodSandboxResponse) Size() (n int) { - if m == nil { - return 0 +func (m *ContainerStatsFilter) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - var l int - _ = l - return n + return dAtA[:n], nil } -func (m *RemovePodSandboxRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.PodSandboxId) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - return n +func (m *ContainerStatsFilter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *RemovePodSandboxResponse) Size() (n int) { - if m == nil { - return 0 - } +func (m *ContainerStatsFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - return n -} - -func (m *PodSandboxStatusRequest) Size() (n int) { - if m == nil { - return 0 + if len(m.LabelSelector) > 0 { + for k := range m.LabelSelector { + v := m.LabelSelector[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintApi(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintApi(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintApi(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a + } } - var l int - _ = l - l = len(m.PodSandboxId) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) + if len(m.PodSandboxId) > 0 { + i -= len(m.PodSandboxId) + copy(dAtA[i:], m.PodSandboxId) + i = encodeVarintApi(dAtA, i, uint64(len(m.PodSandboxId))) + i-- + dAtA[i] = 0x12 } - if m.Verbose { - n += 2 + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *PodIP) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Ip) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) +func (m *ListContainerStatsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *PodSandboxNetworkStatus) Size() (n int) { - if m == nil { - return 0 - } +func (m *ListContainerStatsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListContainerStatsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Ip) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - if len(m.AdditionalIps) > 0 { - for _, e := range m.AdditionalIps { - l = e.Size() - n += 1 + l + sovApi(uint64(l)) + if len(m.Stats) > 0 { + for iNdEx := len(m.Stats) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Stats[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } } - return n + return len(dAtA) - i, nil } -func (m *Namespace) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Options != nil { - l = m.Options.Size() - n += 1 + l + sovApi(uint64(l)) +func (m *ContainerAttributes) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *LinuxPodSandboxStatus) Size() (n int) { - if m == nil { - return 0 - } +func (m *ContainerAttributes) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ContainerAttributes) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.Namespaces != nil { - l = m.Namespaces.Size() - n += 1 + l + sovApi(uint64(l)) + if len(m.Annotations) > 0 { + for k := range m.Annotations { + v := m.Annotations[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintApi(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintApi(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintApi(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x22 + } } - return n + if len(m.Labels) > 0 { + for k := range m.Labels { + v := m.Labels[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintApi(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintApi(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintApi(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a + } + } + if m.Metadata != nil { + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *PodSandboxStatus) Size() (n int) { - if m == nil { - return 0 +func (m *ContainerStats) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *ContainerStats) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ContainerStats) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Id) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - if m.Metadata != nil { - l = m.Metadata.Size() - n += 1 + l + sovApi(uint64(l)) + if m.WritableLayer != nil { + { + size, err := m.WritableLayer.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } - if m.State != 0 { - n += 1 + sovApi(uint64(m.State)) + if m.Memory != nil { + { + size, err := m.Memory.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } - if m.CreatedAt != 0 { - n += 1 + sovApi(uint64(m.CreatedAt)) + if m.Cpu != nil { + { + size, err := m.Cpu.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - if m.Network != nil { - l = m.Network.Size() - n += 1 + l + sovApi(uint64(l)) + if m.Attributes != nil { + { + size, err := m.Attributes.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - if m.Linux != nil { - l = m.Linux.Size() - n += 1 + l + sovApi(uint64(l)) + return len(dAtA) - i, nil +} + +func (m *CpuUsage) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - if len(m.Labels) > 0 { - for k, v := range m.Labels { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) - n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) + return dAtA[:n], nil +} + +func (m *CpuUsage) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CpuUsage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.UsageNanoCores != nil { + { + size, err := m.UsageNanoCores.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x1a } - if len(m.Annotations) > 0 { - for k, v := range m.Annotations { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) - n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) + if m.UsageCoreNanoSeconds != nil { + { + size, err := m.UsageCoreNanoSeconds.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 } - l = len(m.RuntimeHandler) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) + if m.Timestamp != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.Timestamp)) + i-- + dAtA[i] = 0x8 } - return n + return len(dAtA) - i, nil } -func (m *PodSandboxStatusResponse) Size() (n int) { - if m == nil { - return 0 +func (m *MemoryUsage) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *MemoryUsage) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MemoryUsage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.Status != nil { - l = m.Status.Size() - n += 1 + l + sovApi(uint64(l)) + if m.MajorPageFaults != nil { + { + size, err := m.MajorPageFaults.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a } - if len(m.Info) > 0 { - for k, v := range m.Info { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) - n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) + if m.PageFaults != nil { + { + size, err := m.PageFaults.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x32 } - return n + if m.RssBytes != nil { + { + size, err := m.RssBytes.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.UsageBytes != nil { + { + size, err := m.UsageBytes.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.AvailableBytes != nil { + { + size, err := m.AvailableBytes.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.WorkingSetBytes != nil { + { + size, err := m.WorkingSetBytes.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintApi(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Timestamp != 0 { + i = encodeVarintApi(dAtA, i, uint64(m.Timestamp)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } -func (m *PodSandboxStateValue) Size() (n int) { - if m == nil { - return 0 +func (m *ReopenContainerLogRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *ReopenContainerLogRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ReopenContainerLogRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.State != 0 { - n += 1 + sovApi(uint64(m.State)) + if len(m.ContainerId) > 0 { + i -= len(m.ContainerId) + copy(dAtA[i:], m.ContainerId) + i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *PodSandboxFilter) Size() (n int) { - if m == nil { - return 0 +func (m *ReopenContainerLogResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *ReopenContainerLogResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ReopenContainerLogResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Id) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - if m.State != nil { - l = m.State.Size() - n += 1 + l + sovApi(uint64(l)) - } - if len(m.LabelSelector) > 0 { - for k, v := range m.LabelSelector { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) - n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) - } - } - return n + return len(dAtA) - i, nil } -func (m *ListPodSandboxRequest) Size() (n int) { +func encodeVarintApi(dAtA []byte, offset int, v uint64) int { + offset -= sovApi(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *VersionRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Filter != nil { - l = m.Filter.Size() + l = len(m.Version) + if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } -func (m *PodSandbox) Size() (n int) { +func (m *VersionResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Id) + l = len(m.Version) if l > 0 { n += 1 + l + sovApi(uint64(l)) } - if m.Metadata != nil { - l = m.Metadata.Size() + l = len(m.RuntimeName) + if l > 0 { n += 1 + l + sovApi(uint64(l)) } - if m.State != 0 { - n += 1 + sovApi(uint64(m.State)) - } - if m.CreatedAt != 0 { - n += 1 + sovApi(uint64(m.CreatedAt)) - } - if len(m.Labels) > 0 { - for k, v := range m.Labels { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) - n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) - } - } - if len(m.Annotations) > 0 { - for k, v := range m.Annotations { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) - n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) - } + l = len(m.RuntimeVersion) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) } - l = len(m.RuntimeHandler) + l = len(m.RuntimeApiVersion) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } -func (m *ListPodSandboxResponse) Size() (n int) { +func (m *DNSConfig) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.Items) > 0 { - for _, e := range m.Items { - l = e.Size() + if len(m.Servers) > 0 { + for _, s := range m.Servers { + l = len(s) + n += 1 + l + sovApi(uint64(l)) + } + } + if len(m.Searches) > 0 { + for _, s := range m.Searches { + l = len(s) + n += 1 + l + sovApi(uint64(l)) + } + } + if len(m.Options) > 0 { + for _, s := range m.Options { + l = len(s) n += 1 + l + sovApi(uint64(l)) } } return n } -func (m *ImageSpec) Size() (n int) { +func (m *PortMapping) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Image) + if m.Protocol != 0 { + n += 1 + sovApi(uint64(m.Protocol)) + } + if m.ContainerPort != 0 { + n += 1 + sovApi(uint64(m.ContainerPort)) + } + if m.HostPort != 0 { + n += 1 + sovApi(uint64(m.HostPort)) + } + l = len(m.HostIp) if l > 0 { n += 1 + l + sovApi(uint64(l)) } - if len(m.Annotations) > 0 { - for k, v := range m.Annotations { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) - n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) - } - } return n } -func (m *KeyValue) Size() (n int) { +func (m *Mount) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Key) + l = len(m.ContainerPath) if l > 0 { n += 1 + l + sovApi(uint64(l)) } - l = len(m.Value) + l = len(m.HostPath) if l > 0 { n += 1 + l + sovApi(uint64(l)) } + if m.Readonly { + n += 2 + } + if m.SelinuxRelabel { + n += 2 + } + if m.Propagation != 0 { + n += 1 + sovApi(uint64(m.Propagation)) + } return n } -func (m *LinuxContainerResources) Size() (n int) { +func (m *NamespaceOption) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.CpuPeriod != 0 { - n += 1 + sovApi(uint64(m.CpuPeriod)) + if m.Network != 0 { + n += 1 + sovApi(uint64(m.Network)) } - if m.CpuQuota != 0 { - n += 1 + sovApi(uint64(m.CpuQuota)) + if m.Pid != 0 { + n += 1 + sovApi(uint64(m.Pid)) } - if m.CpuShares != 0 { - n += 1 + sovApi(uint64(m.CpuShares)) + if m.Ipc != 0 { + n += 1 + sovApi(uint64(m.Ipc)) } - if m.MemoryLimitInBytes != 0 { - n += 1 + sovApi(uint64(m.MemoryLimitInBytes)) - } - if m.OomScoreAdj != 0 { - n += 1 + sovApi(uint64(m.OomScoreAdj)) - } - l = len(m.CpusetCpus) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - l = len(m.CpusetMems) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - if len(m.HugepageLimits) > 0 { - for _, e := range m.HugepageLimits { - l = e.Size() - n += 1 + l + sovApi(uint64(l)) - } - } - return n -} - -func (m *HugepageLimit) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.PageSize) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - if m.Limit != 0 { - n += 1 + sovApi(uint64(m.Limit)) - } - return n -} - -func (m *SELinuxOption) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.User) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - l = len(m.Role) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - l = len(m.Type) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - l = len(m.Level) + l = len(m.TargetId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } -func (m *Capability) Size() (n int) { +func (m *Int64Value) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.AddCapabilities) > 0 { - for _, s := range m.AddCapabilities { - l = len(s) - n += 1 + l + sovApi(uint64(l)) - } - } - if len(m.DropCapabilities) > 0 { - for _, s := range m.DropCapabilities { - l = len(s) - n += 1 + l + sovApi(uint64(l)) - } + if m.Value != 0 { + n += 1 + sovApi(uint64(m.Value)) } return n } -func (m *LinuxContainerSecurityContext) Size() (n int) { +func (m *LinuxSandboxSecurityContext) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Capabilities != nil { - l = m.Capabilities.Size() - n += 1 + l + sovApi(uint64(l)) - } - if m.Privileged { - n += 2 - } if m.NamespaceOptions != nil { l = m.NamespaceOptions.Size() n += 1 + l + sovApi(uint64(l)) @@ -14590,10 +15873,6 @@ func (m *LinuxContainerSecurityContext) Size() (n int) { l = m.RunAsUser.Size() n += 1 + l + sovApi(uint64(l)) } - l = len(m.RunAsUsername) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } if m.ReadonlyRootfs { n += 2 } @@ -14604,117 +15883,78 @@ func (m *LinuxContainerSecurityContext) Size() (n int) { } n += 1 + sovApi(uint64(l)) + l } - l = len(m.ApparmorProfile) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) + if m.Privileged { + n += 2 } l = len(m.SeccompProfilePath) if l > 0 { n += 1 + l + sovApi(uint64(l)) } - if m.NoNewPrivs { - n += 2 - } if m.RunAsGroup != nil { l = m.RunAsGroup.Size() n += 1 + l + sovApi(uint64(l)) } - if len(m.MaskedPaths) > 0 { - for _, s := range m.MaskedPaths { - l = len(s) - n += 1 + l + sovApi(uint64(l)) - } - } - if len(m.ReadonlyPaths) > 0 { - for _, s := range m.ReadonlyPaths { - l = len(s) - n += 1 + l + sovApi(uint64(l)) - } - } if m.Seccomp != nil { l = m.Seccomp.Size() n += 1 + l + sovApi(uint64(l)) } if m.Apparmor != nil { l = m.Apparmor.Size() - n += 2 + l + sovApi(uint64(l)) - } - return n -} - -func (m *LinuxContainerConfig) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Resources != nil { - l = m.Resources.Size() - n += 1 + l + sovApi(uint64(l)) - } - if m.SecurityContext != nil { - l = m.SecurityContext.Size() n += 1 + l + sovApi(uint64(l)) } return n } -func (m *WindowsContainerSecurityContext) Size() (n int) { +func (m *SecurityProfile) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.RunAsUsername) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) + if m.ProfileType != 0 { + n += 1 + sovApi(uint64(m.ProfileType)) } - l = len(m.CredentialSpec) + l = len(m.LocalhostRef) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } -func (m *WindowsContainerConfig) Size() (n int) { +func (m *LinuxPodSandboxConfig) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Resources != nil { - l = m.Resources.Size() + l = len(m.CgroupParent) + if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.SecurityContext != nil { l = m.SecurityContext.Size() n += 1 + l + sovApi(uint64(l)) } - return n -} - -func (m *WindowsContainerResources) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.CpuShares != 0 { - n += 1 + sovApi(uint64(m.CpuShares)) - } - if m.CpuCount != 0 { - n += 1 + sovApi(uint64(m.CpuCount)) + if len(m.Sysctls) > 0 { + for k, v := range m.Sysctls { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) + n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) + } } - if m.CpuMaximum != 0 { - n += 1 + sovApi(uint64(m.CpuMaximum)) + if m.Overhead != nil { + l = m.Overhead.Size() + n += 1 + l + sovApi(uint64(l)) } - if m.MemoryLimitInBytes != 0 { - n += 1 + sovApi(uint64(m.MemoryLimitInBytes)) + if m.Resources != nil { + l = m.Resources.Size() + n += 1 + l + sovApi(uint64(l)) } return n } -func (m *ContainerMetadata) Size() (n int) { +func (m *PodSandboxMetadata) Size() (n int) { if m == nil { return 0 } @@ -14724,34 +15964,21 @@ func (m *ContainerMetadata) Size() (n int) { if l > 0 { n += 1 + l + sovApi(uint64(l)) } - if m.Attempt != 0 { - n += 1 + sovApi(uint64(m.Attempt)) - } - return n -} - -func (m *Device) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ContainerPath) + l = len(m.Uid) if l > 0 { n += 1 + l + sovApi(uint64(l)) } - l = len(m.HostPath) + l = len(m.Namespace) if l > 0 { n += 1 + l + sovApi(uint64(l)) } - l = len(m.Permissions) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) + if m.Attempt != 0 { + n += 1 + sovApi(uint64(m.Attempt)) } return n } -func (m *ContainerConfig) Size() (n int) { +func (m *PodSandboxConfig) Size() (n int) { if m == nil { return 0 } @@ -14761,40 +15988,20 @@ func (m *ContainerConfig) Size() (n int) { l = m.Metadata.Size() n += 1 + l + sovApi(uint64(l)) } - if m.Image != nil { - l = m.Image.Size() + l = len(m.Hostname) + if l > 0 { n += 1 + l + sovApi(uint64(l)) } - if len(m.Command) > 0 { - for _, s := range m.Command { - l = len(s) - n += 1 + l + sovApi(uint64(l)) - } - } - if len(m.Args) > 0 { - for _, s := range m.Args { - l = len(s) - n += 1 + l + sovApi(uint64(l)) - } - } - l = len(m.WorkingDir) + l = len(m.LogDirectory) if l > 0 { n += 1 + l + sovApi(uint64(l)) } - if len(m.Envs) > 0 { - for _, e := range m.Envs { - l = e.Size() - n += 1 + l + sovApi(uint64(l)) - } - } - if len(m.Mounts) > 0 { - for _, e := range m.Mounts { - l = e.Size() - n += 1 + l + sovApi(uint64(l)) - } + if m.DnsConfig != nil { + l = m.DnsConfig.Size() + n += 1 + l + sovApi(uint64(l)) } - if len(m.Devices) > 0 { - for _, e := range m.Devices { + if len(m.PortMappings) > 0 { + for _, e := range m.PortMappings { l = e.Size() n += 1 + l + sovApi(uint64(l)) } @@ -14815,78 +16022,61 @@ func (m *ContainerConfig) Size() (n int) { n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } - l = len(m.LogPath) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - if m.Stdin { - n += 2 - } - if m.StdinOnce { - n += 2 - } - if m.Tty { - n += 2 - } if m.Linux != nil { l = m.Linux.Size() n += 1 + l + sovApi(uint64(l)) } if m.Windows != nil { l = m.Windows.Size() - n += 2 + l + sovApi(uint64(l)) + n += 1 + l + sovApi(uint64(l)) } return n } -func (m *CreateContainerRequest) Size() (n int) { +func (m *RunPodSandboxRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.PodSandboxId) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } if m.Config != nil { l = m.Config.Size() n += 1 + l + sovApi(uint64(l)) } - if m.SandboxConfig != nil { - l = m.SandboxConfig.Size() + l = len(m.RuntimeHandler) + if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } -func (m *CreateContainerResponse) Size() (n int) { +func (m *RunPodSandboxResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.ContainerId) + l = len(m.PodSandboxId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } -func (m *StartContainerRequest) Size() (n int) { +func (m *StopPodSandboxRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.ContainerId) + l = len(m.PodSandboxId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } -func (m *StartContainerResponse) Size() (n int) { +func (m *StopPodSandboxResponse) Size() (n int) { if m == nil { return 0 } @@ -14895,23 +16085,20 @@ func (m *StartContainerResponse) Size() (n int) { return n } -func (m *StopContainerRequest) Size() (n int) { +func (m *RemovePodSandboxRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.ContainerId) + l = len(m.PodSandboxId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } - if m.Timeout != 0 { - n += 1 + sovApi(uint64(m.Timeout)) - } return n } -func (m *StopContainerResponse) Size() (n int) { +func (m *RemovePodSandboxResponse) Size() (n int) { if m == nil { return 0 } @@ -14920,83 +16107,81 @@ func (m *StopContainerResponse) Size() (n int) { return n } -func (m *RemoveContainerRequest) Size() (n int) { +func (m *PodSandboxStatusRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.ContainerId) + l = len(m.PodSandboxId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } + if m.Verbose { + n += 2 + } return n } -func (m *RemoveContainerResponse) Size() (n int) { +func (m *PodIP) Size() (n int) { if m == nil { return 0 } var l int _ = l + l = len(m.Ip) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } return n } -func (m *ContainerStateValue) Size() (n int) { +func (m *PodSandboxNetworkStatus) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.State != 0 { - n += 1 + sovApi(uint64(m.State)) + l = len(m.Ip) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + if len(m.AdditionalIps) > 0 { + for _, e := range m.AdditionalIps { + l = e.Size() + n += 1 + l + sovApi(uint64(l)) + } } return n } -func (m *ContainerFilter) Size() (n int) { +func (m *Namespace) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Id) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - if m.State != nil { - l = m.State.Size() - n += 1 + l + sovApi(uint64(l)) - } - l = len(m.PodSandboxId) - if l > 0 { + if m.Options != nil { + l = m.Options.Size() n += 1 + l + sovApi(uint64(l)) } - if len(m.LabelSelector) > 0 { - for k, v := range m.LabelSelector { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) - n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) - } - } return n } -func (m *ListContainersRequest) Size() (n int) { +func (m *LinuxPodSandboxStatus) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Filter != nil { - l = m.Filter.Size() + if m.Namespaces != nil { + l = m.Namespaces.Size() n += 1 + l + sovApi(uint64(l)) } return n } -func (m *Container) Size() (n int) { +func (m *PodSandboxStatus) Size() (n int) { if m == nil { return 0 } @@ -15006,28 +16191,24 @@ func (m *Container) Size() (n int) { if l > 0 { n += 1 + l + sovApi(uint64(l)) } - l = len(m.PodSandboxId) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } if m.Metadata != nil { l = m.Metadata.Size() n += 1 + l + sovApi(uint64(l)) } - if m.Image != nil { - l = m.Image.Size() - n += 1 + l + sovApi(uint64(l)) - } - l = len(m.ImageRef) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } if m.State != 0 { n += 1 + sovApi(uint64(m.State)) } if m.CreatedAt != 0 { n += 1 + sovApi(uint64(m.CreatedAt)) } + if m.Network != nil { + l = m.Network.Size() + n += 1 + l + sovApi(uint64(l)) + } + if m.Linux != nil { + l = m.Linux.Size() + n += 1 + l + sovApi(uint64(l)) + } if len(m.Labels) > 0 { for k, v := range m.Labels { _ = k @@ -15044,41 +16225,85 @@ func (m *Container) Size() (n int) { n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } + l = len(m.RuntimeHandler) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } return n } -func (m *ListContainersResponse) Size() (n int) { +func (m *PodSandboxStatusResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.Containers) > 0 { - for _, e := range m.Containers { - l = e.Size() - n += 1 + l + sovApi(uint64(l)) + if m.Status != nil { + l = m.Status.Size() + n += 1 + l + sovApi(uint64(l)) + } + if len(m.Info) > 0 { + for k, v := range m.Info { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) + n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } return n } -func (m *ContainerStatusRequest) Size() (n int) { +func (m *PodSandboxStateValue) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.ContainerId) + if m.State != 0 { + n += 1 + sovApi(uint64(m.State)) + } + return n +} + +func (m *PodSandboxFilter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) if l > 0 { n += 1 + l + sovApi(uint64(l)) } - if m.Verbose { - n += 2 + if m.State != nil { + l = m.State.Size() + n += 1 + l + sovApi(uint64(l)) + } + if len(m.LabelSelector) > 0 { + for k, v := range m.LabelSelector { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) + n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) + } } return n } -func (m *ContainerStatus) Size() (n int) { +func (m *ListPodSandboxRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovApi(uint64(l)) + } + return n +} + +func (m *PodSandbox) Size() (n int) { if m == nil { return 0 } @@ -15098,31 +16323,6 @@ func (m *ContainerStatus) Size() (n int) { if m.CreatedAt != 0 { n += 1 + sovApi(uint64(m.CreatedAt)) } - if m.StartedAt != 0 { - n += 1 + sovApi(uint64(m.StartedAt)) - } - if m.FinishedAt != 0 { - n += 1 + sovApi(uint64(m.FinishedAt)) - } - if m.ExitCode != 0 { - n += 1 + sovApi(uint64(m.ExitCode)) - } - if m.Image != nil { - l = m.Image.Size() - n += 1 + l + sovApi(uint64(l)) - } - l = len(m.ImageRef) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - l = len(m.Reason) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - l = len(m.Message) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } if len(m.Labels) > 0 { for k, v := range m.Labels { _ = k @@ -15139,60 +16339,66 @@ func (m *ContainerStatus) Size() (n int) { n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } - if len(m.Mounts) > 0 { - for _, e := range m.Mounts { - l = e.Size() - n += 1 + l + sovApi(uint64(l)) - } - } - l = len(m.LogPath) + l = len(m.RuntimeHandler) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } -func (m *ContainerStatusResponse) Size() (n int) { +func (m *ListPodSandboxResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Status != nil { - l = m.Status.Size() - n += 1 + l + sovApi(uint64(l)) - } - if len(m.Info) > 0 { - for k, v := range m.Info { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) - n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) + if len(m.Items) > 0 { + for _, e := range m.Items { + l = e.Size() + n += 1 + l + sovApi(uint64(l)) } } return n } -func (m *UpdateContainerResourcesRequest) Size() (n int) { +func (m *PodSandboxStatsRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.ContainerId) + l = len(m.PodSandboxId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } - if m.Linux != nil { - l = m.Linux.Size() + return n +} + +func (m *PodSandboxStatsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Stats != nil { + l = m.Stats.Size() n += 1 + l + sovApi(uint64(l)) } - if m.Windows != nil { - l = m.Windows.Size() + return n +} + +func (m *PodSandboxStatsFilter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { n += 1 + l + sovApi(uint64(l)) } - if len(m.Annotations) > 0 { - for k, v := range m.Annotations { + if len(m.LabelSelector) > 0 { + for k, v := range m.LabelSelector { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) @@ -15202,599 +16408,799 @@ func (m *UpdateContainerResourcesRequest) Size() (n int) { return n } -func (m *UpdateContainerResourcesResponse) Size() (n int) { +func (m *ListPodSandboxStatsRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovApi(uint64(l)) + } return n } -func (m *ExecSyncRequest) Size() (n int) { +func (m *ListPodSandboxStatsResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.ContainerId) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - if len(m.Cmd) > 0 { - for _, s := range m.Cmd { - l = len(s) + if len(m.Stats) > 0 { + for _, e := range m.Stats { + l = e.Size() n += 1 + l + sovApi(uint64(l)) } } - if m.Timeout != 0 { - n += 1 + sovApi(uint64(m.Timeout)) - } return n } -func (m *ExecSyncResponse) Size() (n int) { +func (m *PodSandboxAttributes) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Stdout) + l = len(m.Id) if l > 0 { n += 1 + l + sovApi(uint64(l)) } - l = len(m.Stderr) - if l > 0 { + if m.Metadata != nil { + l = m.Metadata.Size() n += 1 + l + sovApi(uint64(l)) } - if m.ExitCode != 0 { - n += 1 + sovApi(uint64(m.ExitCode)) + if len(m.Labels) > 0 { + for k, v := range m.Labels { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) + n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) + } + } + if len(m.Annotations) > 0 { + for k, v := range m.Annotations { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) + n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) + } } return n } -func (m *ExecRequest) Size() (n int) { +func (m *PodSandboxStats) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.ContainerId) - if l > 0 { + if m.Attributes != nil { + l = m.Attributes.Size() n += 1 + l + sovApi(uint64(l)) } - if len(m.Cmd) > 0 { - for _, s := range m.Cmd { - l = len(s) - n += 1 + l + sovApi(uint64(l)) - } - } - if m.Tty { - n += 2 - } - if m.Stdin { - n += 2 - } - if m.Stdout { - n += 2 + if m.Linux != nil { + l = m.Linux.Size() + n += 1 + l + sovApi(uint64(l)) } - if m.Stderr { - n += 2 + if m.Windows != nil { + l = m.Windows.Size() + n += 1 + l + sovApi(uint64(l)) } return n } -func (m *ExecResponse) Size() (n int) { +func (m *LinuxPodSandboxStats) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Url) - if l > 0 { + if m.Cpu != nil { + l = m.Cpu.Size() + n += 1 + l + sovApi(uint64(l)) + } + if m.Memory != nil { + l = m.Memory.Size() + n += 1 + l + sovApi(uint64(l)) + } + if m.Network != nil { + l = m.Network.Size() n += 1 + l + sovApi(uint64(l)) } + if m.Process != nil { + l = m.Process.Size() + n += 1 + l + sovApi(uint64(l)) + } + if len(m.Containers) > 0 { + for _, e := range m.Containers { + l = e.Size() + n += 1 + l + sovApi(uint64(l)) + } + } return n } -func (m *AttachRequest) Size() (n int) { +func (m *WindowsPodSandboxStats) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.ContainerId) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) - } - if m.Stdin { - n += 2 - } - if m.Tty { - n += 2 - } - if m.Stdout { - n += 2 - } - if m.Stderr { - n += 2 - } return n } -func (m *AttachResponse) Size() (n int) { +func (m *NetworkUsage) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Url) - if l > 0 { + if m.Timestamp != 0 { + n += 1 + sovApi(uint64(m.Timestamp)) + } + if m.DefaultInterface != nil { + l = m.DefaultInterface.Size() n += 1 + l + sovApi(uint64(l)) } + if len(m.Interfaces) > 0 { + for _, e := range m.Interfaces { + l = e.Size() + n += 1 + l + sovApi(uint64(l)) + } + } return n } -func (m *PortForwardRequest) Size() (n int) { +func (m *NetworkInterfaceUsage) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.PodSandboxId) + l = len(m.Name) if l > 0 { n += 1 + l + sovApi(uint64(l)) } - if len(m.Port) > 0 { - l = 0 - for _, e := range m.Port { - l += sovApi(uint64(e)) - } - n += 1 + sovApi(uint64(l)) + l + if m.RxBytes != nil { + l = m.RxBytes.Size() + n += 1 + l + sovApi(uint64(l)) + } + if m.RxErrors != nil { + l = m.RxErrors.Size() + n += 1 + l + sovApi(uint64(l)) + } + if m.TxBytes != nil { + l = m.TxBytes.Size() + n += 1 + l + sovApi(uint64(l)) + } + if m.TxErrors != nil { + l = m.TxErrors.Size() + n += 1 + l + sovApi(uint64(l)) } return n } -func (m *PortForwardResponse) Size() (n int) { +func (m *ProcessUsage) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Url) - if l > 0 { + if m.Timestamp != 0 { + n += 1 + sovApi(uint64(m.Timestamp)) + } + if m.ProcessCount != nil { + l = m.ProcessCount.Size() n += 1 + l + sovApi(uint64(l)) } return n } -func (m *ImageFilter) Size() (n int) { +func (m *ImageSpec) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Image != nil { - l = m.Image.Size() + l = len(m.Image) + if l > 0 { n += 1 + l + sovApi(uint64(l)) } + if len(m.Annotations) > 0 { + for k, v := range m.Annotations { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) + n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) + } + } return n } -func (m *ListImagesRequest) Size() (n int) { +func (m *KeyValue) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Filter != nil { - l = m.Filter.Size() + l = len(m.Key) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + l = len(m.Value) + if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } -func (m *Image) Size() (n int) { +func (m *LinuxContainerResources) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Id) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) + if m.CpuPeriod != 0 { + n += 1 + sovApi(uint64(m.CpuPeriod)) } - if len(m.RepoTags) > 0 { - for _, s := range m.RepoTags { - l = len(s) - n += 1 + l + sovApi(uint64(l)) - } + if m.CpuQuota != 0 { + n += 1 + sovApi(uint64(m.CpuQuota)) } - if len(m.RepoDigests) > 0 { - for _, s := range m.RepoDigests { - l = len(s) - n += 1 + l + sovApi(uint64(l)) - } + if m.CpuShares != 0 { + n += 1 + sovApi(uint64(m.CpuShares)) } - if m.Size_ != 0 { - n += 1 + sovApi(uint64(m.Size_)) + if m.MemoryLimitInBytes != 0 { + n += 1 + sovApi(uint64(m.MemoryLimitInBytes)) } - if m.Uid != nil { - l = m.Uid.Size() - n += 1 + l + sovApi(uint64(l)) + if m.OomScoreAdj != 0 { + n += 1 + sovApi(uint64(m.OomScoreAdj)) } - l = len(m.Username) + l = len(m.CpusetCpus) if l > 0 { n += 1 + l + sovApi(uint64(l)) } - if m.Spec != nil { - l = m.Spec.Size() + l = len(m.CpusetMems) + if l > 0 { n += 1 + l + sovApi(uint64(l)) } + if len(m.HugepageLimits) > 0 { + for _, e := range m.HugepageLimits { + l = e.Size() + n += 1 + l + sovApi(uint64(l)) + } + } + if len(m.Unified) > 0 { + for k, v := range m.Unified { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) + n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) + } + } + if m.MemorySwapLimitInBytes != 0 { + n += 1 + sovApi(uint64(m.MemorySwapLimitInBytes)) + } return n } -func (m *ListImagesResponse) Size() (n int) { +func (m *HugepageLimit) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.Images) > 0 { - for _, e := range m.Images { - l = e.Size() - n += 1 + l + sovApi(uint64(l)) - } + l = len(m.PageSize) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + if m.Limit != 0 { + n += 1 + sovApi(uint64(m.Limit)) } return n } -func (m *ImageStatusRequest) Size() (n int) { +func (m *SELinuxOption) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Image != nil { - l = m.Image.Size() + l = len(m.User) + if l > 0 { n += 1 + l + sovApi(uint64(l)) } - if m.Verbose { - n += 2 + l = len(m.Role) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + l = len(m.Type) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + l = len(m.Level) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) } return n } -func (m *ImageStatusResponse) Size() (n int) { +func (m *Capability) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Image != nil { - l = m.Image.Size() - n += 1 + l + sovApi(uint64(l)) + if len(m.AddCapabilities) > 0 { + for _, s := range m.AddCapabilities { + l = len(s) + n += 1 + l + sovApi(uint64(l)) + } } - if len(m.Info) > 0 { - for k, v := range m.Info { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) - n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) + if len(m.DropCapabilities) > 0 { + for _, s := range m.DropCapabilities { + l = len(s) + n += 1 + l + sovApi(uint64(l)) } } return n } -func (m *AuthConfig) Size() (n int) { +func (m *LinuxContainerSecurityContext) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Username) - if l > 0 { + if m.Capabilities != nil { + l = m.Capabilities.Size() n += 1 + l + sovApi(uint64(l)) } - l = len(m.Password) - if l > 0 { + if m.Privileged { + n += 2 + } + if m.NamespaceOptions != nil { + l = m.NamespaceOptions.Size() n += 1 + l + sovApi(uint64(l)) } - l = len(m.Auth) - if l > 0 { + if m.SelinuxOptions != nil { + l = m.SelinuxOptions.Size() n += 1 + l + sovApi(uint64(l)) } - l = len(m.ServerAddress) + if m.RunAsUser != nil { + l = m.RunAsUser.Size() + n += 1 + l + sovApi(uint64(l)) + } + l = len(m.RunAsUsername) if l > 0 { n += 1 + l + sovApi(uint64(l)) } - l = len(m.IdentityToken) + if m.ReadonlyRootfs { + n += 2 + } + if len(m.SupplementalGroups) > 0 { + l = 0 + for _, e := range m.SupplementalGroups { + l += sovApi(uint64(e)) + } + n += 1 + sovApi(uint64(l)) + l + } + l = len(m.ApparmorProfile) if l > 0 { n += 1 + l + sovApi(uint64(l)) } - l = len(m.RegistryToken) + l = len(m.SeccompProfilePath) if l > 0 { n += 1 + l + sovApi(uint64(l)) } - return n -} - -func (m *PullImageRequest) Size() (n int) { - if m == nil { - return 0 + if m.NoNewPrivs { + n += 2 } - var l int - _ = l - if m.Image != nil { - l = m.Image.Size() + if m.RunAsGroup != nil { + l = m.RunAsGroup.Size() n += 1 + l + sovApi(uint64(l)) } - if m.Auth != nil { - l = m.Auth.Size() - n += 1 + l + sovApi(uint64(l)) + if len(m.MaskedPaths) > 0 { + for _, s := range m.MaskedPaths { + l = len(s) + n += 1 + l + sovApi(uint64(l)) + } } - if m.SandboxConfig != nil { - l = m.SandboxConfig.Size() + if len(m.ReadonlyPaths) > 0 { + for _, s := range m.ReadonlyPaths { + l = len(s) + n += 1 + l + sovApi(uint64(l)) + } + } + if m.Seccomp != nil { + l = m.Seccomp.Size() n += 1 + l + sovApi(uint64(l)) } + if m.Apparmor != nil { + l = m.Apparmor.Size() + n += 2 + l + sovApi(uint64(l)) + } return n } -func (m *PullImageResponse) Size() (n int) { +func (m *LinuxContainerConfig) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.ImageRef) - if l > 0 { + if m.Resources != nil { + l = m.Resources.Size() + n += 1 + l + sovApi(uint64(l)) + } + if m.SecurityContext != nil { + l = m.SecurityContext.Size() n += 1 + l + sovApi(uint64(l)) } return n } -func (m *RemoveImageRequest) Size() (n int) { +func (m *WindowsSandboxSecurityContext) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Image != nil { - l = m.Image.Size() + l = len(m.RunAsUsername) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + l = len(m.CredentialSpec) + if l > 0 { n += 1 + l + sovApi(uint64(l)) } + if m.HostProcess { + n += 2 + } return n } -func (m *RemoveImageResponse) Size() (n int) { +func (m *WindowsPodSandboxConfig) Size() (n int) { if m == nil { return 0 } var l int _ = l + if m.SecurityContext != nil { + l = m.SecurityContext.Size() + n += 1 + l + sovApi(uint64(l)) + } return n } -func (m *NetworkConfig) Size() (n int) { +func (m *WindowsContainerSecurityContext) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.PodCidr) + l = len(m.RunAsUsername) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + l = len(m.CredentialSpec) if l > 0 { n += 1 + l + sovApi(uint64(l)) } + if m.HostProcess { + n += 2 + } return n } -func (m *RuntimeConfig) Size() (n int) { +func (m *WindowsContainerConfig) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.NetworkConfig != nil { - l = m.NetworkConfig.Size() + if m.Resources != nil { + l = m.Resources.Size() + n += 1 + l + sovApi(uint64(l)) + } + if m.SecurityContext != nil { + l = m.SecurityContext.Size() n += 1 + l + sovApi(uint64(l)) } return n } -func (m *UpdateRuntimeConfigRequest) Size() (n int) { +func (m *WindowsContainerResources) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.RuntimeConfig != nil { - l = m.RuntimeConfig.Size() - n += 1 + l + sovApi(uint64(l)) + if m.CpuShares != 0 { + n += 1 + sovApi(uint64(m.CpuShares)) + } + if m.CpuCount != 0 { + n += 1 + sovApi(uint64(m.CpuCount)) + } + if m.CpuMaximum != 0 { + n += 1 + sovApi(uint64(m.CpuMaximum)) + } + if m.MemoryLimitInBytes != 0 { + n += 1 + sovApi(uint64(m.MemoryLimitInBytes)) } return n } -func (m *UpdateRuntimeConfigResponse) Size() (n int) { +func (m *ContainerMetadata) Size() (n int) { if m == nil { return 0 } var l int _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + if m.Attempt != 0 { + n += 1 + sovApi(uint64(m.Attempt)) + } return n } -func (m *RuntimeCondition) Size() (n int) { +func (m *Device) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Type) + l = len(m.ContainerPath) if l > 0 { n += 1 + l + sovApi(uint64(l)) } - if m.Status { - n += 2 - } - l = len(m.Reason) + l = len(m.HostPath) if l > 0 { n += 1 + l + sovApi(uint64(l)) } - l = len(m.Message) + l = len(m.Permissions) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } -func (m *RuntimeStatus) Size() (n int) { +func (m *ContainerConfig) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.Conditions) > 0 { - for _, e := range m.Conditions { + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovApi(uint64(l)) + } + if m.Image != nil { + l = m.Image.Size() + n += 1 + l + sovApi(uint64(l)) + } + if len(m.Command) > 0 { + for _, s := range m.Command { + l = len(s) + n += 1 + l + sovApi(uint64(l)) + } + } + if len(m.Args) > 0 { + for _, s := range m.Args { + l = len(s) + n += 1 + l + sovApi(uint64(l)) + } + } + l = len(m.WorkingDir) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + if len(m.Envs) > 0 { + for _, e := range m.Envs { + l = e.Size() + n += 1 + l + sovApi(uint64(l)) + } + } + if len(m.Mounts) > 0 { + for _, e := range m.Mounts { + l = e.Size() + n += 1 + l + sovApi(uint64(l)) + } + } + if len(m.Devices) > 0 { + for _, e := range m.Devices { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } + if len(m.Labels) > 0 { + for k, v := range m.Labels { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) + n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) + } + } + if len(m.Annotations) > 0 { + for k, v := range m.Annotations { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) + n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) + } + } + l = len(m.LogPath) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + if m.Stdin { + n += 2 + } + if m.StdinOnce { + n += 2 + } + if m.Tty { + n += 2 + } + if m.Linux != nil { + l = m.Linux.Size() + n += 1 + l + sovApi(uint64(l)) + } + if m.Windows != nil { + l = m.Windows.Size() + n += 2 + l + sovApi(uint64(l)) + } return n } -func (m *StatusRequest) Size() (n int) { +func (m *CreateContainerRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Verbose { - n += 2 + l = len(m.PodSandboxId) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + if m.Config != nil { + l = m.Config.Size() + n += 1 + l + sovApi(uint64(l)) + } + if m.SandboxConfig != nil { + l = m.SandboxConfig.Size() + n += 1 + l + sovApi(uint64(l)) } return n } -func (m *StatusResponse) Size() (n int) { +func (m *CreateContainerResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Status != nil { - l = m.Status.Size() + l = len(m.ContainerId) + if l > 0 { n += 1 + l + sovApi(uint64(l)) } - if len(m.Info) > 0 { - for k, v := range m.Info { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) - n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) - } - } return n } -func (m *ImageFsInfoRequest) Size() (n int) { +func (m *StartContainerRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - return n + l = len(m.ContainerId) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + return n } -func (m *UInt64Value) Size() (n int) { +func (m *StartContainerResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Value != 0 { - n += 1 + sovApi(uint64(m.Value)) - } return n } -func (m *FilesystemIdentifier) Size() (n int) { +func (m *StopContainerRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Mountpoint) + l = len(m.ContainerId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } + if m.Timeout != 0 { + n += 1 + sovApi(uint64(m.Timeout)) + } return n } -func (m *FilesystemUsage) Size() (n int) { +func (m *StopContainerResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Timestamp != 0 { - n += 1 + sovApi(uint64(m.Timestamp)) - } - if m.FsId != nil { - l = m.FsId.Size() - n += 1 + l + sovApi(uint64(l)) - } - if m.UsedBytes != nil { - l = m.UsedBytes.Size() - n += 1 + l + sovApi(uint64(l)) + return n +} + +func (m *RemoveContainerRequest) Size() (n int) { + if m == nil { + return 0 } - if m.InodesUsed != nil { - l = m.InodesUsed.Size() + var l int + _ = l + l = len(m.ContainerId) + if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } -func (m *ImageFsInfoResponse) Size() (n int) { +func (m *RemoveContainerResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.ImageFilesystems) > 0 { - for _, e := range m.ImageFilesystems { - l = e.Size() - n += 1 + l + sovApi(uint64(l)) - } - } return n } -func (m *ContainerStatsRequest) Size() (n int) { +func (m *ContainerStateValue) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.ContainerId) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) + if m.State != 0 { + n += 1 + sovApi(uint64(m.State)) } return n } -func (m *ContainerStatsResponse) Size() (n int) { +func (m *ContainerFilter) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Stats != nil { - l = m.Stats.Size() + l = len(m.Id) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + if m.State != nil { + l = m.State.Size() + n += 1 + l + sovApi(uint64(l)) + } + l = len(m.PodSandboxId) + if l > 0 { n += 1 + l + sovApi(uint64(l)) } + if len(m.LabelSelector) > 0 { + for k, v := range m.LabelSelector { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) + n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) + } + } return n } -func (m *ListContainerStatsRequest) Size() (n int) { +func (m *ListContainersRequest) Size() (n int) { if m == nil { return 0 } @@ -15807,7 +17213,7 @@ func (m *ListContainerStatsRequest) Size() (n int) { return n } -func (m *ContainerStatsFilter) Size() (n int) { +func (m *Container) Size() (n int) { if m == nil { return 0 } @@ -15821,8 +17227,34 @@ func (m *ContainerStatsFilter) Size() (n int) { if l > 0 { n += 1 + l + sovApi(uint64(l)) } - if len(m.LabelSelector) > 0 { - for k, v := range m.LabelSelector { + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovApi(uint64(l)) + } + if m.Image != nil { + l = m.Image.Size() + n += 1 + l + sovApi(uint64(l)) + } + l = len(m.ImageRef) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + if m.State != 0 { + n += 1 + sovApi(uint64(m.State)) + } + if m.CreatedAt != 0 { + n += 1 + sovApi(uint64(m.CreatedAt)) + } + if len(m.Labels) > 0 { + for k, v := range m.Labels { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) + n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) + } + } + if len(m.Annotations) > 0 { + for k, v := range m.Annotations { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) @@ -15832,14 +17264,14 @@ func (m *ContainerStatsFilter) Size() (n int) { return n } -func (m *ListContainerStatsResponse) Size() (n int) { +func (m *ListContainersResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.Stats) > 0 { - for _, e := range m.Stats { + if len(m.Containers) > 0 { + for _, e := range m.Containers { l = e.Size() n += 1 + l + sovApi(uint64(l)) } @@ -15847,7 +17279,23 @@ func (m *ListContainerStatsResponse) Size() (n int) { return n } -func (m *ContainerAttributes) Size() (n int) { +func (m *ContainerStatusRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ContainerId) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + if m.Verbose { + n += 2 + } + return n +} + +func (m *ContainerStatus) Size() (n int) { if m == nil { return 0 } @@ -15861,6 +17309,37 @@ func (m *ContainerAttributes) Size() (n int) { l = m.Metadata.Size() n += 1 + l + sovApi(uint64(l)) } + if m.State != 0 { + n += 1 + sovApi(uint64(m.State)) + } + if m.CreatedAt != 0 { + n += 1 + sovApi(uint64(m.CreatedAt)) + } + if m.StartedAt != 0 { + n += 1 + sovApi(uint64(m.StartedAt)) + } + if m.FinishedAt != 0 { + n += 1 + sovApi(uint64(m.FinishedAt)) + } + if m.ExitCode != 0 { + n += 1 + sovApi(uint64(m.ExitCode)) + } + if m.Image != nil { + l = m.Image.Size() + n += 1 + l + sovApi(uint64(l)) + } + l = len(m.ImageRef) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + l = len(m.Reason) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + l = len(m.Message) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } if len(m.Labels) > 0 { for k, v := range m.Labels { _ = k @@ -15877,67 +17356,121 @@ func (m *ContainerAttributes) Size() (n int) { n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } + if len(m.Mounts) > 0 { + for _, e := range m.Mounts { + l = e.Size() + n += 1 + l + sovApi(uint64(l)) + } + } + l = len(m.LogPath) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } return n } -func (m *ContainerStats) Size() (n int) { +func (m *ContainerStatusResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Attributes != nil { - l = m.Attributes.Size() + if m.Status != nil { + l = m.Status.Size() n += 1 + l + sovApi(uint64(l)) } - if m.Cpu != nil { - l = m.Cpu.Size() + if len(m.Info) > 0 { + for k, v := range m.Info { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) + n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) + } + } + return n +} + +func (m *UpdateContainerResourcesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ContainerId) + if l > 0 { n += 1 + l + sovApi(uint64(l)) } - if m.Memory != nil { - l = m.Memory.Size() + if m.Linux != nil { + l = m.Linux.Size() n += 1 + l + sovApi(uint64(l)) } - if m.WritableLayer != nil { - l = m.WritableLayer.Size() + if m.Windows != nil { + l = m.Windows.Size() n += 1 + l + sovApi(uint64(l)) } + if len(m.Annotations) > 0 { + for k, v := range m.Annotations { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) + n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) + } + } return n } -func (m *CpuUsage) Size() (n int) { +func (m *UpdateContainerResourcesResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Timestamp != 0 { - n += 1 + sovApi(uint64(m.Timestamp)) + return n +} + +func (m *ExecSyncRequest) Size() (n int) { + if m == nil { + return 0 } - if m.UsageCoreNanoSeconds != nil { - l = m.UsageCoreNanoSeconds.Size() + var l int + _ = l + l = len(m.ContainerId) + if l > 0 { n += 1 + l + sovApi(uint64(l)) } + if len(m.Cmd) > 0 { + for _, s := range m.Cmd { + l = len(s) + n += 1 + l + sovApi(uint64(l)) + } + } + if m.Timeout != 0 { + n += 1 + sovApi(uint64(m.Timeout)) + } return n } -func (m *MemoryUsage) Size() (n int) { +func (m *ExecSyncResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Timestamp != 0 { - n += 1 + sovApi(uint64(m.Timestamp)) + l = len(m.Stdout) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) } - if m.WorkingSetBytes != nil { - l = m.WorkingSetBytes.Size() + l = len(m.Stderr) + if l > 0 { n += 1 + l + sovApi(uint64(l)) } + if m.ExitCode != 0 { + n += 1 + sovApi(uint64(m.ExitCode)) + } return n } -func (m *ReopenContainerLogRequest) Size() (n int) { +func (m *ExecRequest) Size() (n int) { if m == nil { return 0 } @@ -15947,686 +17480,896 @@ func (m *ReopenContainerLogRequest) Size() (n int) { if l > 0 { n += 1 + l + sovApi(uint64(l)) } + if len(m.Cmd) > 0 { + for _, s := range m.Cmd { + l = len(s) + n += 1 + l + sovApi(uint64(l)) + } + } + if m.Tty { + n += 2 + } + if m.Stdin { + n += 2 + } + if m.Stdout { + n += 2 + } + if m.Stderr { + n += 2 + } return n } -func (m *ReopenContainerLogResponse) Size() (n int) { +func (m *ExecResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l + l = len(m.Url) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } return n } -func sovApi(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozApi(x uint64) (n int) { - return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *VersionRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&VersionRequest{`, - `Version:` + fmt.Sprintf("%v", this.Version) + `,`, - `}`, - }, "") - return s -} -func (this *VersionResponse) String() string { - if this == nil { - return "nil" +func (m *AttachRequest) Size() (n int) { + if m == nil { + return 0 } - s := strings.Join([]string{`&VersionResponse{`, - `Version:` + fmt.Sprintf("%v", this.Version) + `,`, - `RuntimeName:` + fmt.Sprintf("%v", this.RuntimeName) + `,`, - `RuntimeVersion:` + fmt.Sprintf("%v", this.RuntimeVersion) + `,`, - `RuntimeApiVersion:` + fmt.Sprintf("%v", this.RuntimeApiVersion) + `,`, - `}`, - }, "") - return s -} -func (this *DNSConfig) String() string { - if this == nil { - return "nil" + var l int + _ = l + l = len(m.ContainerId) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) } - s := strings.Join([]string{`&DNSConfig{`, - `Servers:` + fmt.Sprintf("%v", this.Servers) + `,`, - `Searches:` + fmt.Sprintf("%v", this.Searches) + `,`, - `Options:` + fmt.Sprintf("%v", this.Options) + `,`, - `}`, - }, "") - return s -} -func (this *PortMapping) String() string { - if this == nil { - return "nil" + if m.Stdin { + n += 2 } - s := strings.Join([]string{`&PortMapping{`, - `Protocol:` + fmt.Sprintf("%v", this.Protocol) + `,`, - `ContainerPort:` + fmt.Sprintf("%v", this.ContainerPort) + `,`, - `HostPort:` + fmt.Sprintf("%v", this.HostPort) + `,`, - `HostIp:` + fmt.Sprintf("%v", this.HostIp) + `,`, - `}`, - }, "") - return s -} -func (this *Mount) String() string { - if this == nil { - return "nil" + if m.Tty { + n += 2 } - s := strings.Join([]string{`&Mount{`, - `ContainerPath:` + fmt.Sprintf("%v", this.ContainerPath) + `,`, - `HostPath:` + fmt.Sprintf("%v", this.HostPath) + `,`, - `Readonly:` + fmt.Sprintf("%v", this.Readonly) + `,`, - `SelinuxRelabel:` + fmt.Sprintf("%v", this.SelinuxRelabel) + `,`, - `Propagation:` + fmt.Sprintf("%v", this.Propagation) + `,`, - `}`, - }, "") - return s -} -func (this *NamespaceOption) String() string { - if this == nil { - return "nil" + if m.Stdout { + n += 2 } - s := strings.Join([]string{`&NamespaceOption{`, - `Network:` + fmt.Sprintf("%v", this.Network) + `,`, - `Pid:` + fmt.Sprintf("%v", this.Pid) + `,`, - `Ipc:` + fmt.Sprintf("%v", this.Ipc) + `,`, - `TargetId:` + fmt.Sprintf("%v", this.TargetId) + `,`, - `}`, - }, "") - return s -} -func (this *Int64Value) String() string { - if this == nil { - return "nil" + if m.Stderr { + n += 2 } - s := strings.Join([]string{`&Int64Value{`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `}`, - }, "") - return s + return n } -func (this *LinuxSandboxSecurityContext) String() string { - if this == nil { - return "nil" + +func (m *AttachResponse) Size() (n int) { + if m == nil { + return 0 } - s := strings.Join([]string{`&LinuxSandboxSecurityContext{`, - `NamespaceOptions:` + strings.Replace(this.NamespaceOptions.String(), "NamespaceOption", "NamespaceOption", 1) + `,`, - `SelinuxOptions:` + strings.Replace(this.SelinuxOptions.String(), "SELinuxOption", "SELinuxOption", 1) + `,`, - `RunAsUser:` + strings.Replace(this.RunAsUser.String(), "Int64Value", "Int64Value", 1) + `,`, - `ReadonlyRootfs:` + fmt.Sprintf("%v", this.ReadonlyRootfs) + `,`, - `SupplementalGroups:` + fmt.Sprintf("%v", this.SupplementalGroups) + `,`, - `Privileged:` + fmt.Sprintf("%v", this.Privileged) + `,`, - `SeccompProfilePath:` + fmt.Sprintf("%v", this.SeccompProfilePath) + `,`, - `RunAsGroup:` + strings.Replace(this.RunAsGroup.String(), "Int64Value", "Int64Value", 1) + `,`, - `Seccomp:` + strings.Replace(this.Seccomp.String(), "SecurityProfile", "SecurityProfile", 1) + `,`, - `Apparmor:` + strings.Replace(this.Apparmor.String(), "SecurityProfile", "SecurityProfile", 1) + `,`, - `}`, - }, "") - return s -} -func (this *SecurityProfile) String() string { - if this == nil { - return "nil" + var l int + _ = l + l = len(m.Url) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) } - s := strings.Join([]string{`&SecurityProfile{`, - `ProfileType:` + fmt.Sprintf("%v", this.ProfileType) + `,`, - `LocalhostRef:` + fmt.Sprintf("%v", this.LocalhostRef) + `,`, - `}`, - }, "") - return s + return n } -func (this *LinuxPodSandboxConfig) String() string { - if this == nil { - return "nil" + +func (m *PortForwardRequest) Size() (n int) { + if m == nil { + return 0 } - keysForSysctls := make([]string, 0, len(this.Sysctls)) - for k := range this.Sysctls { - keysForSysctls = append(keysForSysctls, k) + var l int + _ = l + l = len(m.PodSandboxId) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) } - github_com_gogo_protobuf_sortkeys.Strings(keysForSysctls) - mapStringForSysctls := "map[string]string{" - for _, k := range keysForSysctls { - mapStringForSysctls += fmt.Sprintf("%v: %v,", k, this.Sysctls[k]) + if len(m.Port) > 0 { + l = 0 + for _, e := range m.Port { + l += sovApi(uint64(e)) + } + n += 1 + sovApi(uint64(l)) + l } - mapStringForSysctls += "}" - s := strings.Join([]string{`&LinuxPodSandboxConfig{`, - `CgroupParent:` + fmt.Sprintf("%v", this.CgroupParent) + `,`, - `SecurityContext:` + strings.Replace(this.SecurityContext.String(), "LinuxSandboxSecurityContext", "LinuxSandboxSecurityContext", 1) + `,`, - `Sysctls:` + mapStringForSysctls + `,`, - `}`, - }, "") - return s + return n } -func (this *PodSandboxMetadata) String() string { - if this == nil { - return "nil" + +func (m *PortForwardResponse) Size() (n int) { + if m == nil { + return 0 } - s := strings.Join([]string{`&PodSandboxMetadata{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Uid:` + fmt.Sprintf("%v", this.Uid) + `,`, - `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, - `Attempt:` + fmt.Sprintf("%v", this.Attempt) + `,`, - `}`, - }, "") - return s -} -func (this *PodSandboxConfig) String() string { - if this == nil { - return "nil" + var l int + _ = l + l = len(m.Url) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) } - repeatedStringForPortMappings := "[]*PortMapping{" - for _, f := range this.PortMappings { - repeatedStringForPortMappings += strings.Replace(f.String(), "PortMapping", "PortMapping", 1) + "," + return n +} + +func (m *ImageFilter) Size() (n int) { + if m == nil { + return 0 } - repeatedStringForPortMappings += "}" - keysForLabels := make([]string, 0, len(this.Labels)) - for k := range this.Labels { - keysForLabels = append(keysForLabels, k) + var l int + _ = l + if m.Image != nil { + l = m.Image.Size() + n += 1 + l + sovApi(uint64(l)) } - github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) - mapStringForLabels := "map[string]string{" - for _, k := range keysForLabels { - mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) + return n +} + +func (m *ListImagesRequest) Size() (n int) { + if m == nil { + return 0 } - mapStringForLabels += "}" - keysForAnnotations := make([]string, 0, len(this.Annotations)) - for k := range this.Annotations { - keysForAnnotations = append(keysForAnnotations, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) - mapStringForAnnotations := "map[string]string{" - for _, k := range keysForAnnotations { - mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) - } - mapStringForAnnotations += "}" - s := strings.Join([]string{`&PodSandboxConfig{`, - `Metadata:` + strings.Replace(this.Metadata.String(), "PodSandboxMetadata", "PodSandboxMetadata", 1) + `,`, - `Hostname:` + fmt.Sprintf("%v", this.Hostname) + `,`, - `LogDirectory:` + fmt.Sprintf("%v", this.LogDirectory) + `,`, - `DnsConfig:` + strings.Replace(this.DnsConfig.String(), "DNSConfig", "DNSConfig", 1) + `,`, - `PortMappings:` + repeatedStringForPortMappings + `,`, - `Labels:` + mapStringForLabels + `,`, - `Annotations:` + mapStringForAnnotations + `,`, - `Linux:` + strings.Replace(this.Linux.String(), "LinuxPodSandboxConfig", "LinuxPodSandboxConfig", 1) + `,`, - `}`, - }, "") - return s -} -func (this *RunPodSandboxRequest) String() string { - if this == nil { - return "nil" + var l int + _ = l + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovApi(uint64(l)) } - s := strings.Join([]string{`&RunPodSandboxRequest{`, - `Config:` + strings.Replace(this.Config.String(), "PodSandboxConfig", "PodSandboxConfig", 1) + `,`, - `RuntimeHandler:` + fmt.Sprintf("%v", this.RuntimeHandler) + `,`, - `}`, - }, "") - return s + return n } -func (this *RunPodSandboxResponse) String() string { - if this == nil { - return "nil" + +func (m *Image) Size() (n int) { + if m == nil { + return 0 } - s := strings.Join([]string{`&RunPodSandboxResponse{`, - `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, - `}`, - }, "") - return s -} -func (this *StopPodSandboxRequest) String() string { - if this == nil { - return "nil" + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) } - s := strings.Join([]string{`&StopPodSandboxRequest{`, - `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, - `}`, - }, "") - return s -} -func (this *StopPodSandboxResponse) String() string { - if this == nil { - return "nil" + if len(m.RepoTags) > 0 { + for _, s := range m.RepoTags { + l = len(s) + n += 1 + l + sovApi(uint64(l)) + } } - s := strings.Join([]string{`&StopPodSandboxResponse{`, - `}`, - }, "") - return s -} -func (this *RemovePodSandboxRequest) String() string { - if this == nil { - return "nil" + if len(m.RepoDigests) > 0 { + for _, s := range m.RepoDigests { + l = len(s) + n += 1 + l + sovApi(uint64(l)) + } } - s := strings.Join([]string{`&RemovePodSandboxRequest{`, - `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, - `}`, - }, "") - return s -} -func (this *RemovePodSandboxResponse) String() string { - if this == nil { - return "nil" + if m.Size_ != 0 { + n += 1 + sovApi(uint64(m.Size_)) } - s := strings.Join([]string{`&RemovePodSandboxResponse{`, - `}`, - }, "") - return s -} -func (this *PodSandboxStatusRequest) String() string { - if this == nil { - return "nil" + if m.Uid != nil { + l = m.Uid.Size() + n += 1 + l + sovApi(uint64(l)) } - s := strings.Join([]string{`&PodSandboxStatusRequest{`, - `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, - `Verbose:` + fmt.Sprintf("%v", this.Verbose) + `,`, - `}`, - }, "") - return s -} -func (this *PodIP) String() string { - if this == nil { - return "nil" + l = len(m.Username) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) } - s := strings.Join([]string{`&PodIP{`, - `Ip:` + fmt.Sprintf("%v", this.Ip) + `,`, - `}`, - }, "") - return s -} -func (this *PodSandboxNetworkStatus) String() string { - if this == nil { - return "nil" + if m.Spec != nil { + l = m.Spec.Size() + n += 1 + l + sovApi(uint64(l)) } - repeatedStringForAdditionalIps := "[]*PodIP{" - for _, f := range this.AdditionalIps { - repeatedStringForAdditionalIps += strings.Replace(f.String(), "PodIP", "PodIP", 1) + "," + if m.Pinned { + n += 2 } - repeatedStringForAdditionalIps += "}" - s := strings.Join([]string{`&PodSandboxNetworkStatus{`, - `Ip:` + fmt.Sprintf("%v", this.Ip) + `,`, - `AdditionalIps:` + repeatedStringForAdditionalIps + `,`, - `}`, - }, "") - return s + return n } -func (this *Namespace) String() string { - if this == nil { - return "nil" + +func (m *ListImagesResponse) Size() (n int) { + if m == nil { + return 0 } - s := strings.Join([]string{`&Namespace{`, - `Options:` + strings.Replace(this.Options.String(), "NamespaceOption", "NamespaceOption", 1) + `,`, - `}`, - }, "") - return s -} -func (this *LinuxPodSandboxStatus) String() string { - if this == nil { - return "nil" + var l int + _ = l + if len(m.Images) > 0 { + for _, e := range m.Images { + l = e.Size() + n += 1 + l + sovApi(uint64(l)) + } } - s := strings.Join([]string{`&LinuxPodSandboxStatus{`, - `Namespaces:` + strings.Replace(this.Namespaces.String(), "Namespace", "Namespace", 1) + `,`, - `}`, - }, "") - return s + return n } -func (this *PodSandboxStatus) String() string { - if this == nil { - return "nil" + +func (m *ImageStatusRequest) Size() (n int) { + if m == nil { + return 0 } - keysForLabels := make([]string, 0, len(this.Labels)) - for k := range this.Labels { - keysForLabels = append(keysForLabels, k) + var l int + _ = l + if m.Image != nil { + l = m.Image.Size() + n += 1 + l + sovApi(uint64(l)) } - github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) - mapStringForLabels := "map[string]string{" - for _, k := range keysForLabels { - mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) + if m.Verbose { + n += 2 } - mapStringForLabels += "}" - keysForAnnotations := make([]string, 0, len(this.Annotations)) - for k := range this.Annotations { - keysForAnnotations = append(keysForAnnotations, k) + return n +} + +func (m *ImageStatusResponse) Size() (n int) { + if m == nil { + return 0 } - github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) - mapStringForAnnotations := "map[string]string{" - for _, k := range keysForAnnotations { - mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) + var l int + _ = l + if m.Image != nil { + l = m.Image.Size() + n += 1 + l + sovApi(uint64(l)) } - mapStringForAnnotations += "}" - s := strings.Join([]string{`&PodSandboxStatus{`, - `Id:` + fmt.Sprintf("%v", this.Id) + `,`, - `Metadata:` + strings.Replace(this.Metadata.String(), "PodSandboxMetadata", "PodSandboxMetadata", 1) + `,`, - `State:` + fmt.Sprintf("%v", this.State) + `,`, - `CreatedAt:` + fmt.Sprintf("%v", this.CreatedAt) + `,`, - `Network:` + strings.Replace(this.Network.String(), "PodSandboxNetworkStatus", "PodSandboxNetworkStatus", 1) + `,`, - `Linux:` + strings.Replace(this.Linux.String(), "LinuxPodSandboxStatus", "LinuxPodSandboxStatus", 1) + `,`, - `Labels:` + mapStringForLabels + `,`, - `Annotations:` + mapStringForAnnotations + `,`, - `RuntimeHandler:` + fmt.Sprintf("%v", this.RuntimeHandler) + `,`, - `}`, - }, "") - return s + if len(m.Info) > 0 { + for k, v := range m.Info { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) + n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) + } + } + return n } -func (this *PodSandboxStatusResponse) String() string { - if this == nil { - return "nil" + +func (m *AuthConfig) Size() (n int) { + if m == nil { + return 0 } - keysForInfo := make([]string, 0, len(this.Info)) - for k := range this.Info { - keysForInfo = append(keysForInfo, k) + var l int + _ = l + l = len(m.Username) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) } - github_com_gogo_protobuf_sortkeys.Strings(keysForInfo) - mapStringForInfo := "map[string]string{" - for _, k := range keysForInfo { - mapStringForInfo += fmt.Sprintf("%v: %v,", k, this.Info[k]) + l = len(m.Password) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) } - mapStringForInfo += "}" - s := strings.Join([]string{`&PodSandboxStatusResponse{`, - `Status:` + strings.Replace(this.Status.String(), "PodSandboxStatus", "PodSandboxStatus", 1) + `,`, - `Info:` + mapStringForInfo + `,`, - `}`, - }, "") - return s -} -func (this *PodSandboxStateValue) String() string { - if this == nil { - return "nil" + l = len(m.Auth) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) } - s := strings.Join([]string{`&PodSandboxStateValue{`, - `State:` + fmt.Sprintf("%v", this.State) + `,`, - `}`, - }, "") - return s -} -func (this *PodSandboxFilter) String() string { - if this == nil { - return "nil" + l = len(m.ServerAddress) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) } - keysForLabelSelector := make([]string, 0, len(this.LabelSelector)) - for k := range this.LabelSelector { - keysForLabelSelector = append(keysForLabelSelector, k) + l = len(m.IdentityToken) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) } - github_com_gogo_protobuf_sortkeys.Strings(keysForLabelSelector) - mapStringForLabelSelector := "map[string]string{" - for _, k := range keysForLabelSelector { - mapStringForLabelSelector += fmt.Sprintf("%v: %v,", k, this.LabelSelector[k]) + l = len(m.RegistryToken) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) } - mapStringForLabelSelector += "}" - s := strings.Join([]string{`&PodSandboxFilter{`, - `Id:` + fmt.Sprintf("%v", this.Id) + `,`, - `State:` + strings.Replace(this.State.String(), "PodSandboxStateValue", "PodSandboxStateValue", 1) + `,`, - `LabelSelector:` + mapStringForLabelSelector + `,`, - `}`, - }, "") - return s + return n } -func (this *ListPodSandboxRequest) String() string { - if this == nil { - return "nil" + +func (m *PullImageRequest) Size() (n int) { + if m == nil { + return 0 } - s := strings.Join([]string{`&ListPodSandboxRequest{`, - `Filter:` + strings.Replace(this.Filter.String(), "PodSandboxFilter", "PodSandboxFilter", 1) + `,`, - `}`, - }, "") - return s -} -func (this *PodSandbox) String() string { - if this == nil { - return "nil" + var l int + _ = l + if m.Image != nil { + l = m.Image.Size() + n += 1 + l + sovApi(uint64(l)) } - keysForLabels := make([]string, 0, len(this.Labels)) - for k := range this.Labels { - keysForLabels = append(keysForLabels, k) + if m.Auth != nil { + l = m.Auth.Size() + n += 1 + l + sovApi(uint64(l)) } - github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) - mapStringForLabels := "map[string]string{" - for _, k := range keysForLabels { - mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) + if m.SandboxConfig != nil { + l = m.SandboxConfig.Size() + n += 1 + l + sovApi(uint64(l)) } - mapStringForLabels += "}" - keysForAnnotations := make([]string, 0, len(this.Annotations)) - for k := range this.Annotations { - keysForAnnotations = append(keysForAnnotations, k) + return n +} + +func (m *PullImageResponse) Size() (n int) { + if m == nil { + return 0 } - github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) - mapStringForAnnotations := "map[string]string{" - for _, k := range keysForAnnotations { - mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) + var l int + _ = l + l = len(m.ImageRef) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) } - mapStringForAnnotations += "}" - s := strings.Join([]string{`&PodSandbox{`, - `Id:` + fmt.Sprintf("%v", this.Id) + `,`, - `Metadata:` + strings.Replace(this.Metadata.String(), "PodSandboxMetadata", "PodSandboxMetadata", 1) + `,`, - `State:` + fmt.Sprintf("%v", this.State) + `,`, - `CreatedAt:` + fmt.Sprintf("%v", this.CreatedAt) + `,`, - `Labels:` + mapStringForLabels + `,`, - `Annotations:` + mapStringForAnnotations + `,`, - `RuntimeHandler:` + fmt.Sprintf("%v", this.RuntimeHandler) + `,`, - `}`, - }, "") - return s + return n } -func (this *ListPodSandboxResponse) String() string { - if this == nil { - return "nil" + +func (m *RemoveImageRequest) Size() (n int) { + if m == nil { + return 0 } - repeatedStringForItems := "[]*PodSandbox{" - for _, f := range this.Items { - repeatedStringForItems += strings.Replace(f.String(), "PodSandbox", "PodSandbox", 1) + "," + var l int + _ = l + if m.Image != nil { + l = m.Image.Size() + n += 1 + l + sovApi(uint64(l)) } - repeatedStringForItems += "}" - s := strings.Join([]string{`&ListPodSandboxResponse{`, - `Items:` + repeatedStringForItems + `,`, - `}`, - }, "") - return s + return n } -func (this *ImageSpec) String() string { - if this == nil { - return "nil" + +func (m *RemoveImageResponse) Size() (n int) { + if m == nil { + return 0 } - keysForAnnotations := make([]string, 0, len(this.Annotations)) - for k := range this.Annotations { - keysForAnnotations = append(keysForAnnotations, k) + var l int + _ = l + return n +} + +func (m *NetworkConfig) Size() (n int) { + if m == nil { + return 0 } - github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) - mapStringForAnnotations := "map[string]string{" - for _, k := range keysForAnnotations { - mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) + var l int + _ = l + l = len(m.PodCidr) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) } - mapStringForAnnotations += "}" - s := strings.Join([]string{`&ImageSpec{`, - `Image:` + fmt.Sprintf("%v", this.Image) + `,`, - `Annotations:` + mapStringForAnnotations + `,`, - `}`, - }, "") - return s + return n } -func (this *KeyValue) String() string { - if this == nil { - return "nil" + +func (m *RuntimeConfig) Size() (n int) { + if m == nil { + return 0 } - s := strings.Join([]string{`&KeyValue{`, - `Key:` + fmt.Sprintf("%v", this.Key) + `,`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, - `}`, - }, "") - return s + var l int + _ = l + if m.NetworkConfig != nil { + l = m.NetworkConfig.Size() + n += 1 + l + sovApi(uint64(l)) + } + return n } -func (this *LinuxContainerResources) String() string { - if this == nil { - return "nil" + +func (m *UpdateRuntimeConfigRequest) Size() (n int) { + if m == nil { + return 0 } - repeatedStringForHugepageLimits := "[]*HugepageLimit{" - for _, f := range this.HugepageLimits { - repeatedStringForHugepageLimits += strings.Replace(f.String(), "HugepageLimit", "HugepageLimit", 1) + "," + var l int + _ = l + if m.RuntimeConfig != nil { + l = m.RuntimeConfig.Size() + n += 1 + l + sovApi(uint64(l)) } - repeatedStringForHugepageLimits += "}" - s := strings.Join([]string{`&LinuxContainerResources{`, - `CpuPeriod:` + fmt.Sprintf("%v", this.CpuPeriod) + `,`, - `CpuQuota:` + fmt.Sprintf("%v", this.CpuQuota) + `,`, - `CpuShares:` + fmt.Sprintf("%v", this.CpuShares) + `,`, - `MemoryLimitInBytes:` + fmt.Sprintf("%v", this.MemoryLimitInBytes) + `,`, - `OomScoreAdj:` + fmt.Sprintf("%v", this.OomScoreAdj) + `,`, - `CpusetCpus:` + fmt.Sprintf("%v", this.CpusetCpus) + `,`, - `CpusetMems:` + fmt.Sprintf("%v", this.CpusetMems) + `,`, - `HugepageLimits:` + repeatedStringForHugepageLimits + `,`, - `}`, - }, "") - return s + return n } -func (this *HugepageLimit) String() string { - if this == nil { - return "nil" + +func (m *UpdateRuntimeConfigResponse) Size() (n int) { + if m == nil { + return 0 } - s := strings.Join([]string{`&HugepageLimit{`, - `PageSize:` + fmt.Sprintf("%v", this.PageSize) + `,`, - `Limit:` + fmt.Sprintf("%v", this.Limit) + `,`, - `}`, - }, "") - return s + var l int + _ = l + return n } -func (this *SELinuxOption) String() string { - if this == nil { - return "nil" + +func (m *RuntimeCondition) Size() (n int) { + if m == nil { + return 0 } - s := strings.Join([]string{`&SELinuxOption{`, - `User:` + fmt.Sprintf("%v", this.User) + `,`, - `Role:` + fmt.Sprintf("%v", this.Role) + `,`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `Level:` + fmt.Sprintf("%v", this.Level) + `,`, - `}`, - }, "") - return s -} -func (this *Capability) String() string { - if this == nil { - return "nil" + var l int + _ = l + l = len(m.Type) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) } - s := strings.Join([]string{`&Capability{`, - `AddCapabilities:` + fmt.Sprintf("%v", this.AddCapabilities) + `,`, - `DropCapabilities:` + fmt.Sprintf("%v", this.DropCapabilities) + `,`, + if m.Status { + n += 2 + } + l = len(m.Reason) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + l = len(m.Message) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + return n +} + +func (m *RuntimeStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Conditions) > 0 { + for _, e := range m.Conditions { + l = e.Size() + n += 1 + l + sovApi(uint64(l)) + } + } + return n +} + +func (m *StatusRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Verbose { + n += 2 + } + return n +} + +func (m *StatusResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Status != nil { + l = m.Status.Size() + n += 1 + l + sovApi(uint64(l)) + } + if len(m.Info) > 0 { + for k, v := range m.Info { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) + n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) + } + } + return n +} + +func (m *ImageFsInfoRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *UInt64Value) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Value != 0 { + n += 1 + sovApi(uint64(m.Value)) + } + return n +} + +func (m *FilesystemIdentifier) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Mountpoint) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + return n +} + +func (m *FilesystemUsage) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Timestamp != 0 { + n += 1 + sovApi(uint64(m.Timestamp)) + } + if m.FsId != nil { + l = m.FsId.Size() + n += 1 + l + sovApi(uint64(l)) + } + if m.UsedBytes != nil { + l = m.UsedBytes.Size() + n += 1 + l + sovApi(uint64(l)) + } + if m.InodesUsed != nil { + l = m.InodesUsed.Size() + n += 1 + l + sovApi(uint64(l)) + } + return n +} + +func (m *ImageFsInfoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ImageFilesystems) > 0 { + for _, e := range m.ImageFilesystems { + l = e.Size() + n += 1 + l + sovApi(uint64(l)) + } + } + return n +} + +func (m *ContainerStatsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ContainerId) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + return n +} + +func (m *ContainerStatsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Stats != nil { + l = m.Stats.Size() + n += 1 + l + sovApi(uint64(l)) + } + return n +} + +func (m *ListContainerStatsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovApi(uint64(l)) + } + return n +} + +func (m *ContainerStatsFilter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + l = len(m.PodSandboxId) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + if len(m.LabelSelector) > 0 { + for k, v := range m.LabelSelector { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) + n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) + } + } + return n +} + +func (m *ListContainerStatsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Stats) > 0 { + for _, e := range m.Stats { + l = e.Size() + n += 1 + l + sovApi(uint64(l)) + } + } + return n +} + +func (m *ContainerAttributes) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovApi(uint64(l)) + } + if len(m.Labels) > 0 { + for k, v := range m.Labels { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) + n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) + } + } + if len(m.Annotations) > 0 { + for k, v := range m.Annotations { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) + n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) + } + } + return n +} + +func (m *ContainerStats) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Attributes != nil { + l = m.Attributes.Size() + n += 1 + l + sovApi(uint64(l)) + } + if m.Cpu != nil { + l = m.Cpu.Size() + n += 1 + l + sovApi(uint64(l)) + } + if m.Memory != nil { + l = m.Memory.Size() + n += 1 + l + sovApi(uint64(l)) + } + if m.WritableLayer != nil { + l = m.WritableLayer.Size() + n += 1 + l + sovApi(uint64(l)) + } + return n +} + +func (m *CpuUsage) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Timestamp != 0 { + n += 1 + sovApi(uint64(m.Timestamp)) + } + if m.UsageCoreNanoSeconds != nil { + l = m.UsageCoreNanoSeconds.Size() + n += 1 + l + sovApi(uint64(l)) + } + if m.UsageNanoCores != nil { + l = m.UsageNanoCores.Size() + n += 1 + l + sovApi(uint64(l)) + } + return n +} + +func (m *MemoryUsage) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Timestamp != 0 { + n += 1 + sovApi(uint64(m.Timestamp)) + } + if m.WorkingSetBytes != nil { + l = m.WorkingSetBytes.Size() + n += 1 + l + sovApi(uint64(l)) + } + if m.AvailableBytes != nil { + l = m.AvailableBytes.Size() + n += 1 + l + sovApi(uint64(l)) + } + if m.UsageBytes != nil { + l = m.UsageBytes.Size() + n += 1 + l + sovApi(uint64(l)) + } + if m.RssBytes != nil { + l = m.RssBytes.Size() + n += 1 + l + sovApi(uint64(l)) + } + if m.PageFaults != nil { + l = m.PageFaults.Size() + n += 1 + l + sovApi(uint64(l)) + } + if m.MajorPageFaults != nil { + l = m.MajorPageFaults.Size() + n += 1 + l + sovApi(uint64(l)) + } + return n +} + +func (m *ReopenContainerLogRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ContainerId) + if l > 0 { + n += 1 + l + sovApi(uint64(l)) + } + return n +} + +func (m *ReopenContainerLogResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovApi(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozApi(x uint64) (n int) { + return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *VersionRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&VersionRequest{`, + `Version:` + fmt.Sprintf("%v", this.Version) + `,`, `}`, }, "") return s } -func (this *LinuxContainerSecurityContext) String() string { +func (this *VersionResponse) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&LinuxContainerSecurityContext{`, - `Capabilities:` + strings.Replace(this.Capabilities.String(), "Capability", "Capability", 1) + `,`, - `Privileged:` + fmt.Sprintf("%v", this.Privileged) + `,`, - `NamespaceOptions:` + strings.Replace(this.NamespaceOptions.String(), "NamespaceOption", "NamespaceOption", 1) + `,`, - `SelinuxOptions:` + strings.Replace(this.SelinuxOptions.String(), "SELinuxOption", "SELinuxOption", 1) + `,`, - `RunAsUser:` + strings.Replace(this.RunAsUser.String(), "Int64Value", "Int64Value", 1) + `,`, - `RunAsUsername:` + fmt.Sprintf("%v", this.RunAsUsername) + `,`, - `ReadonlyRootfs:` + fmt.Sprintf("%v", this.ReadonlyRootfs) + `,`, - `SupplementalGroups:` + fmt.Sprintf("%v", this.SupplementalGroups) + `,`, - `ApparmorProfile:` + fmt.Sprintf("%v", this.ApparmorProfile) + `,`, - `SeccompProfilePath:` + fmt.Sprintf("%v", this.SeccompProfilePath) + `,`, - `NoNewPrivs:` + fmt.Sprintf("%v", this.NoNewPrivs) + `,`, - `RunAsGroup:` + strings.Replace(this.RunAsGroup.String(), "Int64Value", "Int64Value", 1) + `,`, - `MaskedPaths:` + fmt.Sprintf("%v", this.MaskedPaths) + `,`, - `ReadonlyPaths:` + fmt.Sprintf("%v", this.ReadonlyPaths) + `,`, - `Seccomp:` + strings.Replace(this.Seccomp.String(), "SecurityProfile", "SecurityProfile", 1) + `,`, - `Apparmor:` + strings.Replace(this.Apparmor.String(), "SecurityProfile", "SecurityProfile", 1) + `,`, + s := strings.Join([]string{`&VersionResponse{`, + `Version:` + fmt.Sprintf("%v", this.Version) + `,`, + `RuntimeName:` + fmt.Sprintf("%v", this.RuntimeName) + `,`, + `RuntimeVersion:` + fmt.Sprintf("%v", this.RuntimeVersion) + `,`, + `RuntimeApiVersion:` + fmt.Sprintf("%v", this.RuntimeApiVersion) + `,`, `}`, }, "") return s } -func (this *LinuxContainerConfig) String() string { +func (this *DNSConfig) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&LinuxContainerConfig{`, - `Resources:` + strings.Replace(this.Resources.String(), "LinuxContainerResources", "LinuxContainerResources", 1) + `,`, - `SecurityContext:` + strings.Replace(this.SecurityContext.String(), "LinuxContainerSecurityContext", "LinuxContainerSecurityContext", 1) + `,`, + s := strings.Join([]string{`&DNSConfig{`, + `Servers:` + fmt.Sprintf("%v", this.Servers) + `,`, + `Searches:` + fmt.Sprintf("%v", this.Searches) + `,`, + `Options:` + fmt.Sprintf("%v", this.Options) + `,`, `}`, }, "") return s } -func (this *WindowsContainerSecurityContext) String() string { +func (this *PortMapping) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&WindowsContainerSecurityContext{`, - `RunAsUsername:` + fmt.Sprintf("%v", this.RunAsUsername) + `,`, - `CredentialSpec:` + fmt.Sprintf("%v", this.CredentialSpec) + `,`, + s := strings.Join([]string{`&PortMapping{`, + `Protocol:` + fmt.Sprintf("%v", this.Protocol) + `,`, + `ContainerPort:` + fmt.Sprintf("%v", this.ContainerPort) + `,`, + `HostPort:` + fmt.Sprintf("%v", this.HostPort) + `,`, + `HostIp:` + fmt.Sprintf("%v", this.HostIp) + `,`, `}`, }, "") return s } -func (this *WindowsContainerConfig) String() string { +func (this *Mount) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&WindowsContainerConfig{`, - `Resources:` + strings.Replace(this.Resources.String(), "WindowsContainerResources", "WindowsContainerResources", 1) + `,`, - `SecurityContext:` + strings.Replace(this.SecurityContext.String(), "WindowsContainerSecurityContext", "WindowsContainerSecurityContext", 1) + `,`, + s := strings.Join([]string{`&Mount{`, + `ContainerPath:` + fmt.Sprintf("%v", this.ContainerPath) + `,`, + `HostPath:` + fmt.Sprintf("%v", this.HostPath) + `,`, + `Readonly:` + fmt.Sprintf("%v", this.Readonly) + `,`, + `SelinuxRelabel:` + fmt.Sprintf("%v", this.SelinuxRelabel) + `,`, + `Propagation:` + fmt.Sprintf("%v", this.Propagation) + `,`, `}`, }, "") return s } -func (this *WindowsContainerResources) String() string { +func (this *NamespaceOption) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&WindowsContainerResources{`, - `CpuShares:` + fmt.Sprintf("%v", this.CpuShares) + `,`, - `CpuCount:` + fmt.Sprintf("%v", this.CpuCount) + `,`, - `CpuMaximum:` + fmt.Sprintf("%v", this.CpuMaximum) + `,`, - `MemoryLimitInBytes:` + fmt.Sprintf("%v", this.MemoryLimitInBytes) + `,`, + s := strings.Join([]string{`&NamespaceOption{`, + `Network:` + fmt.Sprintf("%v", this.Network) + `,`, + `Pid:` + fmt.Sprintf("%v", this.Pid) + `,`, + `Ipc:` + fmt.Sprintf("%v", this.Ipc) + `,`, + `TargetId:` + fmt.Sprintf("%v", this.TargetId) + `,`, `}`, }, "") return s } -func (this *ContainerMetadata) String() string { +func (this *Int64Value) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ContainerMetadata{`, - `Name:` + fmt.Sprintf("%v", this.Name) + `,`, - `Attempt:` + fmt.Sprintf("%v", this.Attempt) + `,`, + s := strings.Join([]string{`&Int64Value{`, + `Value:` + fmt.Sprintf("%v", this.Value) + `,`, `}`, }, "") return s } -func (this *Device) String() string { +func (this *LinuxSandboxSecurityContext) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&Device{`, - `ContainerPath:` + fmt.Sprintf("%v", this.ContainerPath) + `,`, - `HostPath:` + fmt.Sprintf("%v", this.HostPath) + `,`, - `Permissions:` + fmt.Sprintf("%v", this.Permissions) + `,`, + s := strings.Join([]string{`&LinuxSandboxSecurityContext{`, + `NamespaceOptions:` + strings.Replace(this.NamespaceOptions.String(), "NamespaceOption", "NamespaceOption", 1) + `,`, + `SelinuxOptions:` + strings.Replace(this.SelinuxOptions.String(), "SELinuxOption", "SELinuxOption", 1) + `,`, + `RunAsUser:` + strings.Replace(this.RunAsUser.String(), "Int64Value", "Int64Value", 1) + `,`, + `ReadonlyRootfs:` + fmt.Sprintf("%v", this.ReadonlyRootfs) + `,`, + `SupplementalGroups:` + fmt.Sprintf("%v", this.SupplementalGroups) + `,`, + `Privileged:` + fmt.Sprintf("%v", this.Privileged) + `,`, + `SeccompProfilePath:` + fmt.Sprintf("%v", this.SeccompProfilePath) + `,`, + `RunAsGroup:` + strings.Replace(this.RunAsGroup.String(), "Int64Value", "Int64Value", 1) + `,`, + `Seccomp:` + strings.Replace(this.Seccomp.String(), "SecurityProfile", "SecurityProfile", 1) + `,`, + `Apparmor:` + strings.Replace(this.Apparmor.String(), "SecurityProfile", "SecurityProfile", 1) + `,`, `}`, }, "") return s } -func (this *ContainerConfig) String() string { +func (this *SecurityProfile) String() string { if this == nil { return "nil" } - repeatedStringForEnvs := "[]*KeyValue{" - for _, f := range this.Envs { - repeatedStringForEnvs += strings.Replace(f.String(), "KeyValue", "KeyValue", 1) + "," + s := strings.Join([]string{`&SecurityProfile{`, + `ProfileType:` + fmt.Sprintf("%v", this.ProfileType) + `,`, + `LocalhostRef:` + fmt.Sprintf("%v", this.LocalhostRef) + `,`, + `}`, + }, "") + return s +} +func (this *LinuxPodSandboxConfig) String() string { + if this == nil { + return "nil" } - repeatedStringForEnvs += "}" - repeatedStringForMounts := "[]*Mount{" - for _, f := range this.Mounts { - repeatedStringForMounts += strings.Replace(f.String(), "Mount", "Mount", 1) + "," + keysForSysctls := make([]string, 0, len(this.Sysctls)) + for k := range this.Sysctls { + keysForSysctls = append(keysForSysctls, k) } - repeatedStringForMounts += "}" - repeatedStringForDevices := "[]*Device{" - for _, f := range this.Devices { - repeatedStringForDevices += strings.Replace(f.String(), "Device", "Device", 1) + "," + github_com_gogo_protobuf_sortkeys.Strings(keysForSysctls) + mapStringForSysctls := "map[string]string{" + for _, k := range keysForSysctls { + mapStringForSysctls += fmt.Sprintf("%v: %v,", k, this.Sysctls[k]) } - repeatedStringForDevices += "}" + mapStringForSysctls += "}" + s := strings.Join([]string{`&LinuxPodSandboxConfig{`, + `CgroupParent:` + fmt.Sprintf("%v", this.CgroupParent) + `,`, + `SecurityContext:` + strings.Replace(this.SecurityContext.String(), "LinuxSandboxSecurityContext", "LinuxSandboxSecurityContext", 1) + `,`, + `Sysctls:` + mapStringForSysctls + `,`, + `Overhead:` + strings.Replace(this.Overhead.String(), "LinuxContainerResources", "LinuxContainerResources", 1) + `,`, + `Resources:` + strings.Replace(this.Resources.String(), "LinuxContainerResources", "LinuxContainerResources", 1) + `,`, + `}`, + }, "") + return s +} +func (this *PodSandboxMetadata) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PodSandboxMetadata{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Uid:` + fmt.Sprintf("%v", this.Uid) + `,`, + `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, + `Attempt:` + fmt.Sprintf("%v", this.Attempt) + `,`, + `}`, + }, "") + return s +} +func (this *PodSandboxConfig) String() string { + if this == nil { + return "nil" + } + repeatedStringForPortMappings := "[]*PortMapping{" + for _, f := range this.PortMappings { + repeatedStringForPortMappings += strings.Replace(f.String(), "PortMapping", "PortMapping", 1) + "," + } + repeatedStringForPortMappings += "}" keysForLabels := make([]string, 0, len(this.Labels)) for k := range this.Labels { keysForLabels = append(keysForLabels, k) @@ -16647,151 +18390,137 @@ func (this *ContainerConfig) String() string { mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) } mapStringForAnnotations += "}" - s := strings.Join([]string{`&ContainerConfig{`, - `Metadata:` + strings.Replace(this.Metadata.String(), "ContainerMetadata", "ContainerMetadata", 1) + `,`, - `Image:` + strings.Replace(this.Image.String(), "ImageSpec", "ImageSpec", 1) + `,`, - `Command:` + fmt.Sprintf("%v", this.Command) + `,`, - `Args:` + fmt.Sprintf("%v", this.Args) + `,`, - `WorkingDir:` + fmt.Sprintf("%v", this.WorkingDir) + `,`, - `Envs:` + repeatedStringForEnvs + `,`, - `Mounts:` + repeatedStringForMounts + `,`, - `Devices:` + repeatedStringForDevices + `,`, + s := strings.Join([]string{`&PodSandboxConfig{`, + `Metadata:` + strings.Replace(this.Metadata.String(), "PodSandboxMetadata", "PodSandboxMetadata", 1) + `,`, + `Hostname:` + fmt.Sprintf("%v", this.Hostname) + `,`, + `LogDirectory:` + fmt.Sprintf("%v", this.LogDirectory) + `,`, + `DnsConfig:` + strings.Replace(this.DnsConfig.String(), "DNSConfig", "DNSConfig", 1) + `,`, + `PortMappings:` + repeatedStringForPortMappings + `,`, `Labels:` + mapStringForLabels + `,`, `Annotations:` + mapStringForAnnotations + `,`, - `LogPath:` + fmt.Sprintf("%v", this.LogPath) + `,`, - `Stdin:` + fmt.Sprintf("%v", this.Stdin) + `,`, - `StdinOnce:` + fmt.Sprintf("%v", this.StdinOnce) + `,`, - `Tty:` + fmt.Sprintf("%v", this.Tty) + `,`, - `Linux:` + strings.Replace(this.Linux.String(), "LinuxContainerConfig", "LinuxContainerConfig", 1) + `,`, - `Windows:` + strings.Replace(this.Windows.String(), "WindowsContainerConfig", "WindowsContainerConfig", 1) + `,`, + `Linux:` + strings.Replace(this.Linux.String(), "LinuxPodSandboxConfig", "LinuxPodSandboxConfig", 1) + `,`, + `Windows:` + strings.Replace(this.Windows.String(), "WindowsPodSandboxConfig", "WindowsPodSandboxConfig", 1) + `,`, `}`, }, "") return s } -func (this *CreateContainerRequest) String() string { +func (this *RunPodSandboxRequest) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&CreateContainerRequest{`, - `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, - `Config:` + strings.Replace(this.Config.String(), "ContainerConfig", "ContainerConfig", 1) + `,`, - `SandboxConfig:` + strings.Replace(this.SandboxConfig.String(), "PodSandboxConfig", "PodSandboxConfig", 1) + `,`, + s := strings.Join([]string{`&RunPodSandboxRequest{`, + `Config:` + strings.Replace(this.Config.String(), "PodSandboxConfig", "PodSandboxConfig", 1) + `,`, + `RuntimeHandler:` + fmt.Sprintf("%v", this.RuntimeHandler) + `,`, `}`, }, "") return s } -func (this *CreateContainerResponse) String() string { +func (this *RunPodSandboxResponse) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&CreateContainerResponse{`, - `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, + s := strings.Join([]string{`&RunPodSandboxResponse{`, + `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, `}`, }, "") return s } -func (this *StartContainerRequest) String() string { +func (this *StopPodSandboxRequest) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&StartContainerRequest{`, - `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, + s := strings.Join([]string{`&StopPodSandboxRequest{`, + `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, `}`, }, "") return s } -func (this *StartContainerResponse) String() string { +func (this *StopPodSandboxResponse) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&StartContainerResponse{`, + s := strings.Join([]string{`&StopPodSandboxResponse{`, `}`, }, "") return s } -func (this *StopContainerRequest) String() string { +func (this *RemovePodSandboxRequest) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&StopContainerRequest{`, - `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, - `Timeout:` + fmt.Sprintf("%v", this.Timeout) + `,`, + s := strings.Join([]string{`&RemovePodSandboxRequest{`, + `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, `}`, }, "") return s } -func (this *StopContainerResponse) String() string { +func (this *RemovePodSandboxResponse) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&StopContainerResponse{`, + s := strings.Join([]string{`&RemovePodSandboxResponse{`, `}`, }, "") return s } -func (this *RemoveContainerRequest) String() string { +func (this *PodSandboxStatusRequest) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&RemoveContainerRequest{`, - `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, + s := strings.Join([]string{`&PodSandboxStatusRequest{`, + `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, + `Verbose:` + fmt.Sprintf("%v", this.Verbose) + `,`, `}`, }, "") return s } -func (this *RemoveContainerResponse) String() string { +func (this *PodIP) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&RemoveContainerResponse{`, + s := strings.Join([]string{`&PodIP{`, + `Ip:` + fmt.Sprintf("%v", this.Ip) + `,`, `}`, }, "") return s } -func (this *ContainerStateValue) String() string { +func (this *PodSandboxNetworkStatus) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ContainerStateValue{`, - `State:` + fmt.Sprintf("%v", this.State) + `,`, + repeatedStringForAdditionalIps := "[]*PodIP{" + for _, f := range this.AdditionalIps { + repeatedStringForAdditionalIps += strings.Replace(f.String(), "PodIP", "PodIP", 1) + "," + } + repeatedStringForAdditionalIps += "}" + s := strings.Join([]string{`&PodSandboxNetworkStatus{`, + `Ip:` + fmt.Sprintf("%v", this.Ip) + `,`, + `AdditionalIps:` + repeatedStringForAdditionalIps + `,`, `}`, }, "") return s } -func (this *ContainerFilter) String() string { +func (this *Namespace) String() string { if this == nil { return "nil" } - keysForLabelSelector := make([]string, 0, len(this.LabelSelector)) - for k := range this.LabelSelector { - keysForLabelSelector = append(keysForLabelSelector, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForLabelSelector) - mapStringForLabelSelector := "map[string]string{" - for _, k := range keysForLabelSelector { - mapStringForLabelSelector += fmt.Sprintf("%v: %v,", k, this.LabelSelector[k]) - } - mapStringForLabelSelector += "}" - s := strings.Join([]string{`&ContainerFilter{`, - `Id:` + fmt.Sprintf("%v", this.Id) + `,`, - `State:` + strings.Replace(this.State.String(), "ContainerStateValue", "ContainerStateValue", 1) + `,`, - `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, - `LabelSelector:` + mapStringForLabelSelector + `,`, + s := strings.Join([]string{`&Namespace{`, + `Options:` + strings.Replace(this.Options.String(), "NamespaceOption", "NamespaceOption", 1) + `,`, `}`, }, "") return s } -func (this *ListContainersRequest) String() string { +func (this *LinuxPodSandboxStatus) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ListContainersRequest{`, - `Filter:` + strings.Replace(this.Filter.String(), "ContainerFilter", "ContainerFilter", 1) + `,`, + s := strings.Join([]string{`&LinuxPodSandboxStatus{`, + `Namespaces:` + strings.Replace(this.Namespaces.String(), "Namespace", "Namespace", 1) + `,`, `}`, }, "") return s } -func (this *Container) String() string { +func (this *PodSandboxStatus) String() string { if this == nil { return "nil" } @@ -16815,55 +18544,87 @@ func (this *Container) String() string { mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) } mapStringForAnnotations += "}" - s := strings.Join([]string{`&Container{`, + s := strings.Join([]string{`&PodSandboxStatus{`, `Id:` + fmt.Sprintf("%v", this.Id) + `,`, - `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, - `Metadata:` + strings.Replace(this.Metadata.String(), "ContainerMetadata", "ContainerMetadata", 1) + `,`, - `Image:` + strings.Replace(this.Image.String(), "ImageSpec", "ImageSpec", 1) + `,`, - `ImageRef:` + fmt.Sprintf("%v", this.ImageRef) + `,`, + `Metadata:` + strings.Replace(this.Metadata.String(), "PodSandboxMetadata", "PodSandboxMetadata", 1) + `,`, `State:` + fmt.Sprintf("%v", this.State) + `,`, `CreatedAt:` + fmt.Sprintf("%v", this.CreatedAt) + `,`, + `Network:` + strings.Replace(this.Network.String(), "PodSandboxNetworkStatus", "PodSandboxNetworkStatus", 1) + `,`, + `Linux:` + strings.Replace(this.Linux.String(), "LinuxPodSandboxStatus", "LinuxPodSandboxStatus", 1) + `,`, `Labels:` + mapStringForLabels + `,`, `Annotations:` + mapStringForAnnotations + `,`, + `RuntimeHandler:` + fmt.Sprintf("%v", this.RuntimeHandler) + `,`, `}`, }, "") return s } -func (this *ListContainersResponse) String() string { +func (this *PodSandboxStatusResponse) String() string { if this == nil { return "nil" } - repeatedStringForContainers := "[]*Container{" - for _, f := range this.Containers { - repeatedStringForContainers += strings.Replace(f.String(), "Container", "Container", 1) + "," + keysForInfo := make([]string, 0, len(this.Info)) + for k := range this.Info { + keysForInfo = append(keysForInfo, k) } - repeatedStringForContainers += "}" - s := strings.Join([]string{`&ListContainersResponse{`, - `Containers:` + repeatedStringForContainers + `,`, + github_com_gogo_protobuf_sortkeys.Strings(keysForInfo) + mapStringForInfo := "map[string]string{" + for _, k := range keysForInfo { + mapStringForInfo += fmt.Sprintf("%v: %v,", k, this.Info[k]) + } + mapStringForInfo += "}" + s := strings.Join([]string{`&PodSandboxStatusResponse{`, + `Status:` + strings.Replace(this.Status.String(), "PodSandboxStatus", "PodSandboxStatus", 1) + `,`, + `Info:` + mapStringForInfo + `,`, `}`, }, "") return s } -func (this *ContainerStatusRequest) String() string { +func (this *PodSandboxStateValue) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ContainerStatusRequest{`, - `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, - `Verbose:` + fmt.Sprintf("%v", this.Verbose) + `,`, + s := strings.Join([]string{`&PodSandboxStateValue{`, + `State:` + fmt.Sprintf("%v", this.State) + `,`, `}`, }, "") return s } -func (this *ContainerStatus) String() string { +func (this *PodSandboxFilter) String() string { if this == nil { return "nil" } - repeatedStringForMounts := "[]*Mount{" - for _, f := range this.Mounts { - repeatedStringForMounts += strings.Replace(f.String(), "Mount", "Mount", 1) + "," + keysForLabelSelector := make([]string, 0, len(this.LabelSelector)) + for k := range this.LabelSelector { + keysForLabelSelector = append(keysForLabelSelector, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForLabelSelector) + mapStringForLabelSelector := "map[string]string{" + for _, k := range keysForLabelSelector { + mapStringForLabelSelector += fmt.Sprintf("%v: %v,", k, this.LabelSelector[k]) + } + mapStringForLabelSelector += "}" + s := strings.Join([]string{`&PodSandboxFilter{`, + `Id:` + fmt.Sprintf("%v", this.Id) + `,`, + `State:` + strings.Replace(this.State.String(), "PodSandboxStateValue", "PodSandboxStateValue", 1) + `,`, + `LabelSelector:` + mapStringForLabelSelector + `,`, + `}`, + }, "") + return s +} +func (this *ListPodSandboxRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ListPodSandboxRequest{`, + `Filter:` + strings.Replace(this.Filter.String(), "PodSandboxFilter", "PodSandboxFilter", 1) + `,`, + `}`, + }, "") + return s +} +func (this *PodSandbox) String() string { + if this == nil { + return "nil" } - repeatedStringForMounts += "}" keysForLabels := make([]string, 0, len(this.Labels)) for k := range this.Labels { keysForLabels = append(keysForLabels, k) @@ -16884,498 +18645,583 @@ func (this *ContainerStatus) String() string { mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) } mapStringForAnnotations += "}" - s := strings.Join([]string{`&ContainerStatus{`, + s := strings.Join([]string{`&PodSandbox{`, `Id:` + fmt.Sprintf("%v", this.Id) + `,`, - `Metadata:` + strings.Replace(this.Metadata.String(), "ContainerMetadata", "ContainerMetadata", 1) + `,`, + `Metadata:` + strings.Replace(this.Metadata.String(), "PodSandboxMetadata", "PodSandboxMetadata", 1) + `,`, `State:` + fmt.Sprintf("%v", this.State) + `,`, `CreatedAt:` + fmt.Sprintf("%v", this.CreatedAt) + `,`, - `StartedAt:` + fmt.Sprintf("%v", this.StartedAt) + `,`, - `FinishedAt:` + fmt.Sprintf("%v", this.FinishedAt) + `,`, - `ExitCode:` + fmt.Sprintf("%v", this.ExitCode) + `,`, - `Image:` + strings.Replace(this.Image.String(), "ImageSpec", "ImageSpec", 1) + `,`, - `ImageRef:` + fmt.Sprintf("%v", this.ImageRef) + `,`, - `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, - `Message:` + fmt.Sprintf("%v", this.Message) + `,`, `Labels:` + mapStringForLabels + `,`, `Annotations:` + mapStringForAnnotations + `,`, - `Mounts:` + repeatedStringForMounts + `,`, - `LogPath:` + fmt.Sprintf("%v", this.LogPath) + `,`, + `RuntimeHandler:` + fmt.Sprintf("%v", this.RuntimeHandler) + `,`, `}`, }, "") return s } -func (this *ContainerStatusResponse) String() string { +func (this *ListPodSandboxResponse) String() string { if this == nil { return "nil" } - keysForInfo := make([]string, 0, len(this.Info)) - for k := range this.Info { - keysForInfo = append(keysForInfo, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForInfo) - mapStringForInfo := "map[string]string{" - for _, k := range keysForInfo { - mapStringForInfo += fmt.Sprintf("%v: %v,", k, this.Info[k]) + repeatedStringForItems := "[]*PodSandbox{" + for _, f := range this.Items { + repeatedStringForItems += strings.Replace(f.String(), "PodSandbox", "PodSandbox", 1) + "," } - mapStringForInfo += "}" - s := strings.Join([]string{`&ContainerStatusResponse{`, - `Status:` + strings.Replace(this.Status.String(), "ContainerStatus", "ContainerStatus", 1) + `,`, - `Info:` + mapStringForInfo + `,`, + repeatedStringForItems += "}" + s := strings.Join([]string{`&ListPodSandboxResponse{`, + `Items:` + repeatedStringForItems + `,`, `}`, }, "") return s } -func (this *UpdateContainerResourcesRequest) String() string { +func (this *PodSandboxStatsRequest) String() string { if this == nil { return "nil" } - keysForAnnotations := make([]string, 0, len(this.Annotations)) - for k := range this.Annotations { - keysForAnnotations = append(keysForAnnotations, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) - mapStringForAnnotations := "map[string]string{" - for _, k := range keysForAnnotations { - mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) - } - mapStringForAnnotations += "}" - s := strings.Join([]string{`&UpdateContainerResourcesRequest{`, - `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, - `Linux:` + strings.Replace(this.Linux.String(), "LinuxContainerResources", "LinuxContainerResources", 1) + `,`, - `Windows:` + strings.Replace(this.Windows.String(), "WindowsContainerResources", "WindowsContainerResources", 1) + `,`, - `Annotations:` + mapStringForAnnotations + `,`, + s := strings.Join([]string{`&PodSandboxStatsRequest{`, + `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, `}`, }, "") return s } -func (this *UpdateContainerResourcesResponse) String() string { +func (this *PodSandboxStatsResponse) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&UpdateContainerResourcesResponse{`, + s := strings.Join([]string{`&PodSandboxStatsResponse{`, + `Stats:` + strings.Replace(this.Stats.String(), "PodSandboxStats", "PodSandboxStats", 1) + `,`, `}`, }, "") return s } -func (this *ExecSyncRequest) String() string { +func (this *PodSandboxStatsFilter) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ExecSyncRequest{`, - `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, - `Cmd:` + fmt.Sprintf("%v", this.Cmd) + `,`, - `Timeout:` + fmt.Sprintf("%v", this.Timeout) + `,`, - `}`, - }, "") - return s -} -func (this *ExecSyncResponse) String() string { - if this == nil { - return "nil" + keysForLabelSelector := make([]string, 0, len(this.LabelSelector)) + for k := range this.LabelSelector { + keysForLabelSelector = append(keysForLabelSelector, k) } - s := strings.Join([]string{`&ExecSyncResponse{`, - `Stdout:` + fmt.Sprintf("%v", this.Stdout) + `,`, - `Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`, - `ExitCode:` + fmt.Sprintf("%v", this.ExitCode) + `,`, + github_com_gogo_protobuf_sortkeys.Strings(keysForLabelSelector) + mapStringForLabelSelector := "map[string]string{" + for _, k := range keysForLabelSelector { + mapStringForLabelSelector += fmt.Sprintf("%v: %v,", k, this.LabelSelector[k]) + } + mapStringForLabelSelector += "}" + s := strings.Join([]string{`&PodSandboxStatsFilter{`, + `Id:` + fmt.Sprintf("%v", this.Id) + `,`, + `LabelSelector:` + mapStringForLabelSelector + `,`, `}`, }, "") return s } -func (this *ExecRequest) String() string { +func (this *ListPodSandboxStatsRequest) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ExecRequest{`, - `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, - `Cmd:` + fmt.Sprintf("%v", this.Cmd) + `,`, - `Tty:` + fmt.Sprintf("%v", this.Tty) + `,`, - `Stdin:` + fmt.Sprintf("%v", this.Stdin) + `,`, - `Stdout:` + fmt.Sprintf("%v", this.Stdout) + `,`, - `Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`, + s := strings.Join([]string{`&ListPodSandboxStatsRequest{`, + `Filter:` + strings.Replace(this.Filter.String(), "PodSandboxStatsFilter", "PodSandboxStatsFilter", 1) + `,`, `}`, }, "") return s } -func (this *ExecResponse) String() string { +func (this *ListPodSandboxStatsResponse) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ExecResponse{`, - `Url:` + fmt.Sprintf("%v", this.Url) + `,`, + repeatedStringForStats := "[]*PodSandboxStats{" + for _, f := range this.Stats { + repeatedStringForStats += strings.Replace(f.String(), "PodSandboxStats", "PodSandboxStats", 1) + "," + } + repeatedStringForStats += "}" + s := strings.Join([]string{`&ListPodSandboxStatsResponse{`, + `Stats:` + repeatedStringForStats + `,`, `}`, }, "") return s } -func (this *AttachRequest) String() string { +func (this *PodSandboxAttributes) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&AttachRequest{`, - `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, - `Stdin:` + fmt.Sprintf("%v", this.Stdin) + `,`, - `Tty:` + fmt.Sprintf("%v", this.Tty) + `,`, - `Stdout:` + fmt.Sprintf("%v", this.Stdout) + `,`, - `Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`, + keysForLabels := make([]string, 0, len(this.Labels)) + for k := range this.Labels { + keysForLabels = append(keysForLabels, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) + mapStringForLabels := "map[string]string{" + for _, k := range keysForLabels { + mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) + } + mapStringForLabels += "}" + keysForAnnotations := make([]string, 0, len(this.Annotations)) + for k := range this.Annotations { + keysForAnnotations = append(keysForAnnotations, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) + mapStringForAnnotations := "map[string]string{" + for _, k := range keysForAnnotations { + mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) + } + mapStringForAnnotations += "}" + s := strings.Join([]string{`&PodSandboxAttributes{`, + `Id:` + fmt.Sprintf("%v", this.Id) + `,`, + `Metadata:` + strings.Replace(this.Metadata.String(), "PodSandboxMetadata", "PodSandboxMetadata", 1) + `,`, + `Labels:` + mapStringForLabels + `,`, + `Annotations:` + mapStringForAnnotations + `,`, `}`, }, "") return s } -func (this *AttachResponse) String() string { +func (this *PodSandboxStats) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&AttachResponse{`, - `Url:` + fmt.Sprintf("%v", this.Url) + `,`, + s := strings.Join([]string{`&PodSandboxStats{`, + `Attributes:` + strings.Replace(this.Attributes.String(), "PodSandboxAttributes", "PodSandboxAttributes", 1) + `,`, + `Linux:` + strings.Replace(this.Linux.String(), "LinuxPodSandboxStats", "LinuxPodSandboxStats", 1) + `,`, + `Windows:` + strings.Replace(this.Windows.String(), "WindowsPodSandboxStats", "WindowsPodSandboxStats", 1) + `,`, `}`, }, "") return s } -func (this *PortForwardRequest) String() string { +func (this *LinuxPodSandboxStats) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&PortForwardRequest{`, - `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, - `Port:` + fmt.Sprintf("%v", this.Port) + `,`, + repeatedStringForContainers := "[]*ContainerStats{" + for _, f := range this.Containers { + repeatedStringForContainers += strings.Replace(f.String(), "ContainerStats", "ContainerStats", 1) + "," + } + repeatedStringForContainers += "}" + s := strings.Join([]string{`&LinuxPodSandboxStats{`, + `Cpu:` + strings.Replace(this.Cpu.String(), "CpuUsage", "CpuUsage", 1) + `,`, + `Memory:` + strings.Replace(this.Memory.String(), "MemoryUsage", "MemoryUsage", 1) + `,`, + `Network:` + strings.Replace(this.Network.String(), "NetworkUsage", "NetworkUsage", 1) + `,`, + `Process:` + strings.Replace(this.Process.String(), "ProcessUsage", "ProcessUsage", 1) + `,`, + `Containers:` + repeatedStringForContainers + `,`, `}`, }, "") return s } -func (this *PortForwardResponse) String() string { +func (this *WindowsPodSandboxStats) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&PortForwardResponse{`, - `Url:` + fmt.Sprintf("%v", this.Url) + `,`, + s := strings.Join([]string{`&WindowsPodSandboxStats{`, `}`, }, "") return s } -func (this *ImageFilter) String() string { +func (this *NetworkUsage) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ImageFilter{`, - `Image:` + strings.Replace(this.Image.String(), "ImageSpec", "ImageSpec", 1) + `,`, + repeatedStringForInterfaces := "[]*NetworkInterfaceUsage{" + for _, f := range this.Interfaces { + repeatedStringForInterfaces += strings.Replace(f.String(), "NetworkInterfaceUsage", "NetworkInterfaceUsage", 1) + "," + } + repeatedStringForInterfaces += "}" + s := strings.Join([]string{`&NetworkUsage{`, + `Timestamp:` + fmt.Sprintf("%v", this.Timestamp) + `,`, + `DefaultInterface:` + strings.Replace(this.DefaultInterface.String(), "NetworkInterfaceUsage", "NetworkInterfaceUsage", 1) + `,`, + `Interfaces:` + repeatedStringForInterfaces + `,`, `}`, }, "") return s } -func (this *ListImagesRequest) String() string { +func (this *NetworkInterfaceUsage) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ListImagesRequest{`, - `Filter:` + strings.Replace(this.Filter.String(), "ImageFilter", "ImageFilter", 1) + `,`, + s := strings.Join([]string{`&NetworkInterfaceUsage{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `RxBytes:` + strings.Replace(this.RxBytes.String(), "UInt64Value", "UInt64Value", 1) + `,`, + `RxErrors:` + strings.Replace(this.RxErrors.String(), "UInt64Value", "UInt64Value", 1) + `,`, + `TxBytes:` + strings.Replace(this.TxBytes.String(), "UInt64Value", "UInt64Value", 1) + `,`, + `TxErrors:` + strings.Replace(this.TxErrors.String(), "UInt64Value", "UInt64Value", 1) + `,`, `}`, }, "") return s } -func (this *Image) String() string { +func (this *ProcessUsage) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&Image{`, - `Id:` + fmt.Sprintf("%v", this.Id) + `,`, - `RepoTags:` + fmt.Sprintf("%v", this.RepoTags) + `,`, - `RepoDigests:` + fmt.Sprintf("%v", this.RepoDigests) + `,`, - `Size_:` + fmt.Sprintf("%v", this.Size_) + `,`, - `Uid:` + strings.Replace(this.Uid.String(), "Int64Value", "Int64Value", 1) + `,`, - `Username:` + fmt.Sprintf("%v", this.Username) + `,`, - `Spec:` + strings.Replace(this.Spec.String(), "ImageSpec", "ImageSpec", 1) + `,`, + s := strings.Join([]string{`&ProcessUsage{`, + `Timestamp:` + fmt.Sprintf("%v", this.Timestamp) + `,`, + `ProcessCount:` + strings.Replace(this.ProcessCount.String(), "UInt64Value", "UInt64Value", 1) + `,`, `}`, }, "") return s } -func (this *ListImagesResponse) String() string { +func (this *ImageSpec) String() string { if this == nil { return "nil" } - repeatedStringForImages := "[]*Image{" - for _, f := range this.Images { - repeatedStringForImages += strings.Replace(f.String(), "Image", "Image", 1) + "," + keysForAnnotations := make([]string, 0, len(this.Annotations)) + for k := range this.Annotations { + keysForAnnotations = append(keysForAnnotations, k) } - repeatedStringForImages += "}" - s := strings.Join([]string{`&ListImagesResponse{`, - `Images:` + repeatedStringForImages + `,`, + github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) + mapStringForAnnotations := "map[string]string{" + for _, k := range keysForAnnotations { + mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) + } + mapStringForAnnotations += "}" + s := strings.Join([]string{`&ImageSpec{`, + `Image:` + fmt.Sprintf("%v", this.Image) + `,`, + `Annotations:` + mapStringForAnnotations + `,`, `}`, }, "") return s } -func (this *ImageStatusRequest) String() string { +func (this *KeyValue) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ImageStatusRequest{`, - `Image:` + strings.Replace(this.Image.String(), "ImageSpec", "ImageSpec", 1) + `,`, - `Verbose:` + fmt.Sprintf("%v", this.Verbose) + `,`, + s := strings.Join([]string{`&KeyValue{`, + `Key:` + fmt.Sprintf("%v", this.Key) + `,`, + `Value:` + fmt.Sprintf("%v", this.Value) + `,`, `}`, }, "") return s } -func (this *ImageStatusResponse) String() string { +func (this *LinuxContainerResources) String() string { if this == nil { return "nil" } - keysForInfo := make([]string, 0, len(this.Info)) - for k := range this.Info { - keysForInfo = append(keysForInfo, k) + repeatedStringForHugepageLimits := "[]*HugepageLimit{" + for _, f := range this.HugepageLimits { + repeatedStringForHugepageLimits += strings.Replace(f.String(), "HugepageLimit", "HugepageLimit", 1) + "," } - github_com_gogo_protobuf_sortkeys.Strings(keysForInfo) - mapStringForInfo := "map[string]string{" - for _, k := range keysForInfo { - mapStringForInfo += fmt.Sprintf("%v: %v,", k, this.Info[k]) + repeatedStringForHugepageLimits += "}" + keysForUnified := make([]string, 0, len(this.Unified)) + for k := range this.Unified { + keysForUnified = append(keysForUnified, k) } - mapStringForInfo += "}" - s := strings.Join([]string{`&ImageStatusResponse{`, - `Image:` + strings.Replace(this.Image.String(), "Image", "Image", 1) + `,`, - `Info:` + mapStringForInfo + `,`, + github_com_gogo_protobuf_sortkeys.Strings(keysForUnified) + mapStringForUnified := "map[string]string{" + for _, k := range keysForUnified { + mapStringForUnified += fmt.Sprintf("%v: %v,", k, this.Unified[k]) + } + mapStringForUnified += "}" + s := strings.Join([]string{`&LinuxContainerResources{`, + `CpuPeriod:` + fmt.Sprintf("%v", this.CpuPeriod) + `,`, + `CpuQuota:` + fmt.Sprintf("%v", this.CpuQuota) + `,`, + `CpuShares:` + fmt.Sprintf("%v", this.CpuShares) + `,`, + `MemoryLimitInBytes:` + fmt.Sprintf("%v", this.MemoryLimitInBytes) + `,`, + `OomScoreAdj:` + fmt.Sprintf("%v", this.OomScoreAdj) + `,`, + `CpusetCpus:` + fmt.Sprintf("%v", this.CpusetCpus) + `,`, + `CpusetMems:` + fmt.Sprintf("%v", this.CpusetMems) + `,`, + `HugepageLimits:` + repeatedStringForHugepageLimits + `,`, + `Unified:` + mapStringForUnified + `,`, + `MemorySwapLimitInBytes:` + fmt.Sprintf("%v", this.MemorySwapLimitInBytes) + `,`, `}`, }, "") return s } -func (this *AuthConfig) String() string { +func (this *HugepageLimit) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&AuthConfig{`, - `Username:` + fmt.Sprintf("%v", this.Username) + `,`, - `Password:` + fmt.Sprintf("%v", this.Password) + `,`, - `Auth:` + fmt.Sprintf("%v", this.Auth) + `,`, - `ServerAddress:` + fmt.Sprintf("%v", this.ServerAddress) + `,`, - `IdentityToken:` + fmt.Sprintf("%v", this.IdentityToken) + `,`, - `RegistryToken:` + fmt.Sprintf("%v", this.RegistryToken) + `,`, + s := strings.Join([]string{`&HugepageLimit{`, + `PageSize:` + fmt.Sprintf("%v", this.PageSize) + `,`, + `Limit:` + fmt.Sprintf("%v", this.Limit) + `,`, `}`, }, "") return s } -func (this *PullImageRequest) String() string { +func (this *SELinuxOption) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&PullImageRequest{`, - `Image:` + strings.Replace(this.Image.String(), "ImageSpec", "ImageSpec", 1) + `,`, - `Auth:` + strings.Replace(this.Auth.String(), "AuthConfig", "AuthConfig", 1) + `,`, - `SandboxConfig:` + strings.Replace(this.SandboxConfig.String(), "PodSandboxConfig", "PodSandboxConfig", 1) + `,`, + s := strings.Join([]string{`&SELinuxOption{`, + `User:` + fmt.Sprintf("%v", this.User) + `,`, + `Role:` + fmt.Sprintf("%v", this.Role) + `,`, + `Type:` + fmt.Sprintf("%v", this.Type) + `,`, + `Level:` + fmt.Sprintf("%v", this.Level) + `,`, `}`, }, "") return s } -func (this *PullImageResponse) String() string { +func (this *Capability) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&PullImageResponse{`, - `ImageRef:` + fmt.Sprintf("%v", this.ImageRef) + `,`, + s := strings.Join([]string{`&Capability{`, + `AddCapabilities:` + fmt.Sprintf("%v", this.AddCapabilities) + `,`, + `DropCapabilities:` + fmt.Sprintf("%v", this.DropCapabilities) + `,`, `}`, }, "") return s } -func (this *RemoveImageRequest) String() string { +func (this *LinuxContainerSecurityContext) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&RemoveImageRequest{`, - `Image:` + strings.Replace(this.Image.String(), "ImageSpec", "ImageSpec", 1) + `,`, + s := strings.Join([]string{`&LinuxContainerSecurityContext{`, + `Capabilities:` + strings.Replace(this.Capabilities.String(), "Capability", "Capability", 1) + `,`, + `Privileged:` + fmt.Sprintf("%v", this.Privileged) + `,`, + `NamespaceOptions:` + strings.Replace(this.NamespaceOptions.String(), "NamespaceOption", "NamespaceOption", 1) + `,`, + `SelinuxOptions:` + strings.Replace(this.SelinuxOptions.String(), "SELinuxOption", "SELinuxOption", 1) + `,`, + `RunAsUser:` + strings.Replace(this.RunAsUser.String(), "Int64Value", "Int64Value", 1) + `,`, + `RunAsUsername:` + fmt.Sprintf("%v", this.RunAsUsername) + `,`, + `ReadonlyRootfs:` + fmt.Sprintf("%v", this.ReadonlyRootfs) + `,`, + `SupplementalGroups:` + fmt.Sprintf("%v", this.SupplementalGroups) + `,`, + `ApparmorProfile:` + fmt.Sprintf("%v", this.ApparmorProfile) + `,`, + `SeccompProfilePath:` + fmt.Sprintf("%v", this.SeccompProfilePath) + `,`, + `NoNewPrivs:` + fmt.Sprintf("%v", this.NoNewPrivs) + `,`, + `RunAsGroup:` + strings.Replace(this.RunAsGroup.String(), "Int64Value", "Int64Value", 1) + `,`, + `MaskedPaths:` + fmt.Sprintf("%v", this.MaskedPaths) + `,`, + `ReadonlyPaths:` + fmt.Sprintf("%v", this.ReadonlyPaths) + `,`, + `Seccomp:` + strings.Replace(this.Seccomp.String(), "SecurityProfile", "SecurityProfile", 1) + `,`, + `Apparmor:` + strings.Replace(this.Apparmor.String(), "SecurityProfile", "SecurityProfile", 1) + `,`, `}`, }, "") return s } -func (this *RemoveImageResponse) String() string { +func (this *LinuxContainerConfig) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&RemoveImageResponse{`, + s := strings.Join([]string{`&LinuxContainerConfig{`, + `Resources:` + strings.Replace(this.Resources.String(), "LinuxContainerResources", "LinuxContainerResources", 1) + `,`, + `SecurityContext:` + strings.Replace(this.SecurityContext.String(), "LinuxContainerSecurityContext", "LinuxContainerSecurityContext", 1) + `,`, `}`, }, "") return s } -func (this *NetworkConfig) String() string { +func (this *WindowsSandboxSecurityContext) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&NetworkConfig{`, - `PodCidr:` + fmt.Sprintf("%v", this.PodCidr) + `,`, + s := strings.Join([]string{`&WindowsSandboxSecurityContext{`, + `RunAsUsername:` + fmt.Sprintf("%v", this.RunAsUsername) + `,`, + `CredentialSpec:` + fmt.Sprintf("%v", this.CredentialSpec) + `,`, + `HostProcess:` + fmt.Sprintf("%v", this.HostProcess) + `,`, `}`, }, "") return s } -func (this *RuntimeConfig) String() string { +func (this *WindowsPodSandboxConfig) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&RuntimeConfig{`, - `NetworkConfig:` + strings.Replace(this.NetworkConfig.String(), "NetworkConfig", "NetworkConfig", 1) + `,`, + s := strings.Join([]string{`&WindowsPodSandboxConfig{`, + `SecurityContext:` + strings.Replace(this.SecurityContext.String(), "WindowsSandboxSecurityContext", "WindowsSandboxSecurityContext", 1) + `,`, `}`, }, "") return s } -func (this *UpdateRuntimeConfigRequest) String() string { +func (this *WindowsContainerSecurityContext) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&UpdateRuntimeConfigRequest{`, - `RuntimeConfig:` + strings.Replace(this.RuntimeConfig.String(), "RuntimeConfig", "RuntimeConfig", 1) + `,`, + s := strings.Join([]string{`&WindowsContainerSecurityContext{`, + `RunAsUsername:` + fmt.Sprintf("%v", this.RunAsUsername) + `,`, + `CredentialSpec:` + fmt.Sprintf("%v", this.CredentialSpec) + `,`, + `HostProcess:` + fmt.Sprintf("%v", this.HostProcess) + `,`, `}`, }, "") return s } -func (this *UpdateRuntimeConfigResponse) String() string { +func (this *WindowsContainerConfig) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&UpdateRuntimeConfigResponse{`, + s := strings.Join([]string{`&WindowsContainerConfig{`, + `Resources:` + strings.Replace(this.Resources.String(), "WindowsContainerResources", "WindowsContainerResources", 1) + `,`, + `SecurityContext:` + strings.Replace(this.SecurityContext.String(), "WindowsContainerSecurityContext", "WindowsContainerSecurityContext", 1) + `,`, `}`, }, "") return s } -func (this *RuntimeCondition) String() string { +func (this *WindowsContainerResources) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&RuntimeCondition{`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `Status:` + fmt.Sprintf("%v", this.Status) + `,`, - `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, - `Message:` + fmt.Sprintf("%v", this.Message) + `,`, + s := strings.Join([]string{`&WindowsContainerResources{`, + `CpuShares:` + fmt.Sprintf("%v", this.CpuShares) + `,`, + `CpuCount:` + fmt.Sprintf("%v", this.CpuCount) + `,`, + `CpuMaximum:` + fmt.Sprintf("%v", this.CpuMaximum) + `,`, + `MemoryLimitInBytes:` + fmt.Sprintf("%v", this.MemoryLimitInBytes) + `,`, `}`, }, "") return s } -func (this *RuntimeStatus) String() string { +func (this *ContainerMetadata) String() string { if this == nil { return "nil" } - repeatedStringForConditions := "[]*RuntimeCondition{" - for _, f := range this.Conditions { - repeatedStringForConditions += strings.Replace(f.String(), "RuntimeCondition", "RuntimeCondition", 1) + "," - } - repeatedStringForConditions += "}" - s := strings.Join([]string{`&RuntimeStatus{`, - `Conditions:` + repeatedStringForConditions + `,`, + s := strings.Join([]string{`&ContainerMetadata{`, + `Name:` + fmt.Sprintf("%v", this.Name) + `,`, + `Attempt:` + fmt.Sprintf("%v", this.Attempt) + `,`, `}`, }, "") return s } -func (this *StatusRequest) String() string { +func (this *Device) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&StatusRequest{`, - `Verbose:` + fmt.Sprintf("%v", this.Verbose) + `,`, + s := strings.Join([]string{`&Device{`, + `ContainerPath:` + fmt.Sprintf("%v", this.ContainerPath) + `,`, + `HostPath:` + fmt.Sprintf("%v", this.HostPath) + `,`, + `Permissions:` + fmt.Sprintf("%v", this.Permissions) + `,`, `}`, }, "") return s } -func (this *StatusResponse) String() string { +func (this *ContainerConfig) String() string { if this == nil { return "nil" } - keysForInfo := make([]string, 0, len(this.Info)) - for k := range this.Info { - keysForInfo = append(keysForInfo, k) + repeatedStringForEnvs := "[]*KeyValue{" + for _, f := range this.Envs { + repeatedStringForEnvs += strings.Replace(f.String(), "KeyValue", "KeyValue", 1) + "," } - github_com_gogo_protobuf_sortkeys.Strings(keysForInfo) - mapStringForInfo := "map[string]string{" - for _, k := range keysForInfo { - mapStringForInfo += fmt.Sprintf("%v: %v,", k, this.Info[k]) + repeatedStringForEnvs += "}" + repeatedStringForMounts := "[]*Mount{" + for _, f := range this.Mounts { + repeatedStringForMounts += strings.Replace(f.String(), "Mount", "Mount", 1) + "," } - mapStringForInfo += "}" - s := strings.Join([]string{`&StatusResponse{`, - `Status:` + strings.Replace(this.Status.String(), "RuntimeStatus", "RuntimeStatus", 1) + `,`, - `Info:` + mapStringForInfo + `,`, + repeatedStringForMounts += "}" + repeatedStringForDevices := "[]*Device{" + for _, f := range this.Devices { + repeatedStringForDevices += strings.Replace(f.String(), "Device", "Device", 1) + "," + } + repeatedStringForDevices += "}" + keysForLabels := make([]string, 0, len(this.Labels)) + for k := range this.Labels { + keysForLabels = append(keysForLabels, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) + mapStringForLabels := "map[string]string{" + for _, k := range keysForLabels { + mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) + } + mapStringForLabels += "}" + keysForAnnotations := make([]string, 0, len(this.Annotations)) + for k := range this.Annotations { + keysForAnnotations = append(keysForAnnotations, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) + mapStringForAnnotations := "map[string]string{" + for _, k := range keysForAnnotations { + mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) + } + mapStringForAnnotations += "}" + s := strings.Join([]string{`&ContainerConfig{`, + `Metadata:` + strings.Replace(this.Metadata.String(), "ContainerMetadata", "ContainerMetadata", 1) + `,`, + `Image:` + strings.Replace(this.Image.String(), "ImageSpec", "ImageSpec", 1) + `,`, + `Command:` + fmt.Sprintf("%v", this.Command) + `,`, + `Args:` + fmt.Sprintf("%v", this.Args) + `,`, + `WorkingDir:` + fmt.Sprintf("%v", this.WorkingDir) + `,`, + `Envs:` + repeatedStringForEnvs + `,`, + `Mounts:` + repeatedStringForMounts + `,`, + `Devices:` + repeatedStringForDevices + `,`, + `Labels:` + mapStringForLabels + `,`, + `Annotations:` + mapStringForAnnotations + `,`, + `LogPath:` + fmt.Sprintf("%v", this.LogPath) + `,`, + `Stdin:` + fmt.Sprintf("%v", this.Stdin) + `,`, + `StdinOnce:` + fmt.Sprintf("%v", this.StdinOnce) + `,`, + `Tty:` + fmt.Sprintf("%v", this.Tty) + `,`, + `Linux:` + strings.Replace(this.Linux.String(), "LinuxContainerConfig", "LinuxContainerConfig", 1) + `,`, + `Windows:` + strings.Replace(this.Windows.String(), "WindowsContainerConfig", "WindowsContainerConfig", 1) + `,`, `}`, }, "") return s } -func (this *ImageFsInfoRequest) String() string { +func (this *CreateContainerRequest) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ImageFsInfoRequest{`, + s := strings.Join([]string{`&CreateContainerRequest{`, + `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, + `Config:` + strings.Replace(this.Config.String(), "ContainerConfig", "ContainerConfig", 1) + `,`, + `SandboxConfig:` + strings.Replace(this.SandboxConfig.String(), "PodSandboxConfig", "PodSandboxConfig", 1) + `,`, `}`, }, "") return s } -func (this *UInt64Value) String() string { +func (this *CreateContainerResponse) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&UInt64Value{`, - `Value:` + fmt.Sprintf("%v", this.Value) + `,`, + s := strings.Join([]string{`&CreateContainerResponse{`, + `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, `}`, }, "") return s } -func (this *FilesystemIdentifier) String() string { +func (this *StartContainerRequest) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&FilesystemIdentifier{`, - `Mountpoint:` + fmt.Sprintf("%v", this.Mountpoint) + `,`, + s := strings.Join([]string{`&StartContainerRequest{`, + `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, `}`, }, "") return s } -func (this *FilesystemUsage) String() string { +func (this *StartContainerResponse) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&FilesystemUsage{`, - `Timestamp:` + fmt.Sprintf("%v", this.Timestamp) + `,`, - `FsId:` + strings.Replace(this.FsId.String(), "FilesystemIdentifier", "FilesystemIdentifier", 1) + `,`, - `UsedBytes:` + strings.Replace(this.UsedBytes.String(), "UInt64Value", "UInt64Value", 1) + `,`, - `InodesUsed:` + strings.Replace(this.InodesUsed.String(), "UInt64Value", "UInt64Value", 1) + `,`, + s := strings.Join([]string{`&StartContainerResponse{`, `}`, }, "") return s } -func (this *ImageFsInfoResponse) String() string { +func (this *StopContainerRequest) String() string { if this == nil { return "nil" } - repeatedStringForImageFilesystems := "[]*FilesystemUsage{" - for _, f := range this.ImageFilesystems { - repeatedStringForImageFilesystems += strings.Replace(f.String(), "FilesystemUsage", "FilesystemUsage", 1) + "," + s := strings.Join([]string{`&StopContainerRequest{`, + `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, + `Timeout:` + fmt.Sprintf("%v", this.Timeout) + `,`, + `}`, + }, "") + return s +} +func (this *StopContainerResponse) String() string { + if this == nil { + return "nil" } - repeatedStringForImageFilesystems += "}" - s := strings.Join([]string{`&ImageFsInfoResponse{`, - `ImageFilesystems:` + repeatedStringForImageFilesystems + `,`, + s := strings.Join([]string{`&StopContainerResponse{`, `}`, }, "") return s } -func (this *ContainerStatsRequest) String() string { +func (this *RemoveContainerRequest) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ContainerStatsRequest{`, + s := strings.Join([]string{`&RemoveContainerRequest{`, `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, `}`, }, "") return s } -func (this *ContainerStatsResponse) String() string { +func (this *RemoveContainerResponse) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ContainerStatsResponse{`, - `Stats:` + strings.Replace(this.Stats.String(), "ContainerStats", "ContainerStats", 1) + `,`, + s := strings.Join([]string{`&RemoveContainerResponse{`, `}`, }, "") return s } -func (this *ListContainerStatsRequest) String() string { +func (this *ContainerStateValue) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ListContainerStatsRequest{`, - `Filter:` + strings.Replace(this.Filter.String(), "ContainerStatsFilter", "ContainerStatsFilter", 1) + `,`, + s := strings.Join([]string{`&ContainerStateValue{`, + `State:` + fmt.Sprintf("%v", this.State) + `,`, `}`, }, "") return s } -func (this *ContainerStatsFilter) String() string { +func (this *ContainerFilter) String() string { if this == nil { return "nil" } @@ -17389,33 +19235,98 @@ func (this *ContainerStatsFilter) String() string { mapStringForLabelSelector += fmt.Sprintf("%v: %v,", k, this.LabelSelector[k]) } mapStringForLabelSelector += "}" - s := strings.Join([]string{`&ContainerStatsFilter{`, + s := strings.Join([]string{`&ContainerFilter{`, `Id:` + fmt.Sprintf("%v", this.Id) + `,`, + `State:` + strings.Replace(this.State.String(), "ContainerStateValue", "ContainerStateValue", 1) + `,`, `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, `LabelSelector:` + mapStringForLabelSelector + `,`, `}`, }, "") return s } -func (this *ListContainerStatsResponse) String() string { +func (this *ListContainersRequest) String() string { if this == nil { return "nil" } - repeatedStringForStats := "[]*ContainerStats{" - for _, f := range this.Stats { - repeatedStringForStats += strings.Replace(f.String(), "ContainerStats", "ContainerStats", 1) + "," + s := strings.Join([]string{`&ListContainersRequest{`, + `Filter:` + strings.Replace(this.Filter.String(), "ContainerFilter", "ContainerFilter", 1) + `,`, + `}`, + }, "") + return s +} +func (this *Container) String() string { + if this == nil { + return "nil" } - repeatedStringForStats += "}" - s := strings.Join([]string{`&ListContainerStatsResponse{`, - `Stats:` + repeatedStringForStats + `,`, + keysForLabels := make([]string, 0, len(this.Labels)) + for k := range this.Labels { + keysForLabels = append(keysForLabels, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) + mapStringForLabels := "map[string]string{" + for _, k := range keysForLabels { + mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) + } + mapStringForLabels += "}" + keysForAnnotations := make([]string, 0, len(this.Annotations)) + for k := range this.Annotations { + keysForAnnotations = append(keysForAnnotations, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) + mapStringForAnnotations := "map[string]string{" + for _, k := range keysForAnnotations { + mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) + } + mapStringForAnnotations += "}" + s := strings.Join([]string{`&Container{`, + `Id:` + fmt.Sprintf("%v", this.Id) + `,`, + `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, + `Metadata:` + strings.Replace(this.Metadata.String(), "ContainerMetadata", "ContainerMetadata", 1) + `,`, + `Image:` + strings.Replace(this.Image.String(), "ImageSpec", "ImageSpec", 1) + `,`, + `ImageRef:` + fmt.Sprintf("%v", this.ImageRef) + `,`, + `State:` + fmt.Sprintf("%v", this.State) + `,`, + `CreatedAt:` + fmt.Sprintf("%v", this.CreatedAt) + `,`, + `Labels:` + mapStringForLabels + `,`, + `Annotations:` + mapStringForAnnotations + `,`, `}`, }, "") return s } -func (this *ContainerAttributes) String() string { +func (this *ListContainersResponse) String() string { + if this == nil { + return "nil" + } + repeatedStringForContainers := "[]*Container{" + for _, f := range this.Containers { + repeatedStringForContainers += strings.Replace(f.String(), "Container", "Container", 1) + "," + } + repeatedStringForContainers += "}" + s := strings.Join([]string{`&ListContainersResponse{`, + `Containers:` + repeatedStringForContainers + `,`, + `}`, + }, "") + return s +} +func (this *ContainerStatusRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ContainerStatusRequest{`, + `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, + `Verbose:` + fmt.Sprintf("%v", this.Verbose) + `,`, + `}`, + }, "") + return s +} +func (this *ContainerStatus) String() string { if this == nil { return "nil" } + repeatedStringForMounts := "[]*Mount{" + for _, f := range this.Mounts { + repeatedStringForMounts += strings.Replace(f.String(), "Mount", "Mount", 1) + "," + } + repeatedStringForMounts += "}" keysForLabels := make([]string, 0, len(this.Labels)) for k := range this.Labels { keysForLabels = append(keysForLabels, k) @@ -17436,111 +19347,3053 @@ func (this *ContainerAttributes) String() string { mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) } mapStringForAnnotations += "}" - s := strings.Join([]string{`&ContainerAttributes{`, + s := strings.Join([]string{`&ContainerStatus{`, `Id:` + fmt.Sprintf("%v", this.Id) + `,`, `Metadata:` + strings.Replace(this.Metadata.String(), "ContainerMetadata", "ContainerMetadata", 1) + `,`, + `State:` + fmt.Sprintf("%v", this.State) + `,`, + `CreatedAt:` + fmt.Sprintf("%v", this.CreatedAt) + `,`, + `StartedAt:` + fmt.Sprintf("%v", this.StartedAt) + `,`, + `FinishedAt:` + fmt.Sprintf("%v", this.FinishedAt) + `,`, + `ExitCode:` + fmt.Sprintf("%v", this.ExitCode) + `,`, + `Image:` + strings.Replace(this.Image.String(), "ImageSpec", "ImageSpec", 1) + `,`, + `ImageRef:` + fmt.Sprintf("%v", this.ImageRef) + `,`, + `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, + `Message:` + fmt.Sprintf("%v", this.Message) + `,`, `Labels:` + mapStringForLabels + `,`, `Annotations:` + mapStringForAnnotations + `,`, + `Mounts:` + repeatedStringForMounts + `,`, + `LogPath:` + fmt.Sprintf("%v", this.LogPath) + `,`, `}`, }, "") return s } -func (this *ContainerStats) String() string { +func (this *ContainerStatusResponse) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ContainerStats{`, - `Attributes:` + strings.Replace(this.Attributes.String(), "ContainerAttributes", "ContainerAttributes", 1) + `,`, - `Cpu:` + strings.Replace(this.Cpu.String(), "CpuUsage", "CpuUsage", 1) + `,`, - `Memory:` + strings.Replace(this.Memory.String(), "MemoryUsage", "MemoryUsage", 1) + `,`, - `WritableLayer:` + strings.Replace(this.WritableLayer.String(), "FilesystemUsage", "FilesystemUsage", 1) + `,`, + keysForInfo := make([]string, 0, len(this.Info)) + for k := range this.Info { + keysForInfo = append(keysForInfo, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForInfo) + mapStringForInfo := "map[string]string{" + for _, k := range keysForInfo { + mapStringForInfo += fmt.Sprintf("%v: %v,", k, this.Info[k]) + } + mapStringForInfo += "}" + s := strings.Join([]string{`&ContainerStatusResponse{`, + `Status:` + strings.Replace(this.Status.String(), "ContainerStatus", "ContainerStatus", 1) + `,`, + `Info:` + mapStringForInfo + `,`, `}`, }, "") return s } -func (this *CpuUsage) String() string { +func (this *UpdateContainerResourcesRequest) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&CpuUsage{`, - `Timestamp:` + fmt.Sprintf("%v", this.Timestamp) + `,`, - `UsageCoreNanoSeconds:` + strings.Replace(this.UsageCoreNanoSeconds.String(), "UInt64Value", "UInt64Value", 1) + `,`, + keysForAnnotations := make([]string, 0, len(this.Annotations)) + for k := range this.Annotations { + keysForAnnotations = append(keysForAnnotations, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) + mapStringForAnnotations := "map[string]string{" + for _, k := range keysForAnnotations { + mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) + } + mapStringForAnnotations += "}" + s := strings.Join([]string{`&UpdateContainerResourcesRequest{`, + `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, + `Linux:` + strings.Replace(this.Linux.String(), "LinuxContainerResources", "LinuxContainerResources", 1) + `,`, + `Windows:` + strings.Replace(this.Windows.String(), "WindowsContainerResources", "WindowsContainerResources", 1) + `,`, + `Annotations:` + mapStringForAnnotations + `,`, `}`, }, "") return s } -func (this *MemoryUsage) String() string { +func (this *UpdateContainerResourcesResponse) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&MemoryUsage{`, - `Timestamp:` + fmt.Sprintf("%v", this.Timestamp) + `,`, - `WorkingSetBytes:` + strings.Replace(this.WorkingSetBytes.String(), "UInt64Value", "UInt64Value", 1) + `,`, + s := strings.Join([]string{`&UpdateContainerResourcesResponse{`, `}`, }, "") return s } -func (this *ReopenContainerLogRequest) String() string { +func (this *ExecSyncRequest) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ReopenContainerLogRequest{`, + s := strings.Join([]string{`&ExecSyncRequest{`, `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, + `Cmd:` + fmt.Sprintf("%v", this.Cmd) + `,`, + `Timeout:` + fmt.Sprintf("%v", this.Timeout) + `,`, `}`, }, "") return s } -func (this *ReopenContainerLogResponse) String() string { +func (this *ExecSyncResponse) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&ReopenContainerLogResponse{`, + s := strings.Join([]string{`&ExecSyncResponse{`, + `Stdout:` + fmt.Sprintf("%v", this.Stdout) + `,`, + `Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`, + `ExitCode:` + fmt.Sprintf("%v", this.ExitCode) + `,`, `}`, }, "") return s } -func valueToStringApi(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { +func (this *ExecRequest) String() string { + if this == nil { return "nil" } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) + s := strings.Join([]string{`&ExecRequest{`, + `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, + `Cmd:` + fmt.Sprintf("%v", this.Cmd) + `,`, + `Tty:` + fmt.Sprintf("%v", this.Tty) + `,`, + `Stdin:` + fmt.Sprintf("%v", this.Stdin) + `,`, + `Stdout:` + fmt.Sprintf("%v", this.Stdout) + `,`, + `Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`, + `}`, + }, "") + return s } -func (m *VersionRequest) Unmarshal(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 ErrIntOverflowApi +func (this *ExecResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ExecResponse{`, + `Url:` + fmt.Sprintf("%v", this.Url) + `,`, + `}`, + }, "") + return s +} +func (this *AttachRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AttachRequest{`, + `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, + `Stdin:` + fmt.Sprintf("%v", this.Stdin) + `,`, + `Tty:` + fmt.Sprintf("%v", this.Tty) + `,`, + `Stdout:` + fmt.Sprintf("%v", this.Stdout) + `,`, + `Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`, + `}`, + }, "") + return s +} +func (this *AttachResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AttachResponse{`, + `Url:` + fmt.Sprintf("%v", this.Url) + `,`, + `}`, + }, "") + return s +} +func (this *PortForwardRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PortForwardRequest{`, + `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, + `Port:` + fmt.Sprintf("%v", this.Port) + `,`, + `}`, + }, "") + return s +} +func (this *PortForwardResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PortForwardResponse{`, + `Url:` + fmt.Sprintf("%v", this.Url) + `,`, + `}`, + }, "") + return s +} +func (this *ImageFilter) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ImageFilter{`, + `Image:` + strings.Replace(this.Image.String(), "ImageSpec", "ImageSpec", 1) + `,`, + `}`, + }, "") + return s +} +func (this *ListImagesRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ListImagesRequest{`, + `Filter:` + strings.Replace(this.Filter.String(), "ImageFilter", "ImageFilter", 1) + `,`, + `}`, + }, "") + return s +} +func (this *Image) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Image{`, + `Id:` + fmt.Sprintf("%v", this.Id) + `,`, + `RepoTags:` + fmt.Sprintf("%v", this.RepoTags) + `,`, + `RepoDigests:` + fmt.Sprintf("%v", this.RepoDigests) + `,`, + `Size_:` + fmt.Sprintf("%v", this.Size_) + `,`, + `Uid:` + strings.Replace(this.Uid.String(), "Int64Value", "Int64Value", 1) + `,`, + `Username:` + fmt.Sprintf("%v", this.Username) + `,`, + `Spec:` + strings.Replace(this.Spec.String(), "ImageSpec", "ImageSpec", 1) + `,`, + `Pinned:` + fmt.Sprintf("%v", this.Pinned) + `,`, + `}`, + }, "") + return s +} +func (this *ListImagesResponse) String() string { + if this == nil { + return "nil" + } + repeatedStringForImages := "[]*Image{" + for _, f := range this.Images { + repeatedStringForImages += strings.Replace(f.String(), "Image", "Image", 1) + "," + } + repeatedStringForImages += "}" + s := strings.Join([]string{`&ListImagesResponse{`, + `Images:` + repeatedStringForImages + `,`, + `}`, + }, "") + return s +} +func (this *ImageStatusRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ImageStatusRequest{`, + `Image:` + strings.Replace(this.Image.String(), "ImageSpec", "ImageSpec", 1) + `,`, + `Verbose:` + fmt.Sprintf("%v", this.Verbose) + `,`, + `}`, + }, "") + return s +} +func (this *ImageStatusResponse) String() string { + if this == nil { + return "nil" + } + keysForInfo := make([]string, 0, len(this.Info)) + for k := range this.Info { + keysForInfo = append(keysForInfo, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForInfo) + mapStringForInfo := "map[string]string{" + for _, k := range keysForInfo { + mapStringForInfo += fmt.Sprintf("%v: %v,", k, this.Info[k]) + } + mapStringForInfo += "}" + s := strings.Join([]string{`&ImageStatusResponse{`, + `Image:` + strings.Replace(this.Image.String(), "Image", "Image", 1) + `,`, + `Info:` + mapStringForInfo + `,`, + `}`, + }, "") + return s +} +func (this *AuthConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&AuthConfig{`, + `Username:` + fmt.Sprintf("%v", this.Username) + `,`, + `Password:` + fmt.Sprintf("%v", this.Password) + `,`, + `Auth:` + fmt.Sprintf("%v", this.Auth) + `,`, + `ServerAddress:` + fmt.Sprintf("%v", this.ServerAddress) + `,`, + `IdentityToken:` + fmt.Sprintf("%v", this.IdentityToken) + `,`, + `RegistryToken:` + fmt.Sprintf("%v", this.RegistryToken) + `,`, + `}`, + }, "") + return s +} +func (this *PullImageRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PullImageRequest{`, + `Image:` + strings.Replace(this.Image.String(), "ImageSpec", "ImageSpec", 1) + `,`, + `Auth:` + strings.Replace(this.Auth.String(), "AuthConfig", "AuthConfig", 1) + `,`, + `SandboxConfig:` + strings.Replace(this.SandboxConfig.String(), "PodSandboxConfig", "PodSandboxConfig", 1) + `,`, + `}`, + }, "") + return s +} +func (this *PullImageResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&PullImageResponse{`, + `ImageRef:` + fmt.Sprintf("%v", this.ImageRef) + `,`, + `}`, + }, "") + return s +} +func (this *RemoveImageRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&RemoveImageRequest{`, + `Image:` + strings.Replace(this.Image.String(), "ImageSpec", "ImageSpec", 1) + `,`, + `}`, + }, "") + return s +} +func (this *RemoveImageResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&RemoveImageResponse{`, + `}`, + }, "") + return s +} +func (this *NetworkConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&NetworkConfig{`, + `PodCidr:` + fmt.Sprintf("%v", this.PodCidr) + `,`, + `}`, + }, "") + return s +} +func (this *RuntimeConfig) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&RuntimeConfig{`, + `NetworkConfig:` + strings.Replace(this.NetworkConfig.String(), "NetworkConfig", "NetworkConfig", 1) + `,`, + `}`, + }, "") + return s +} +func (this *UpdateRuntimeConfigRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&UpdateRuntimeConfigRequest{`, + `RuntimeConfig:` + strings.Replace(this.RuntimeConfig.String(), "RuntimeConfig", "RuntimeConfig", 1) + `,`, + `}`, + }, "") + return s +} +func (this *UpdateRuntimeConfigResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&UpdateRuntimeConfigResponse{`, + `}`, + }, "") + return s +} +func (this *RuntimeCondition) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&RuntimeCondition{`, + `Type:` + fmt.Sprintf("%v", this.Type) + `,`, + `Status:` + fmt.Sprintf("%v", this.Status) + `,`, + `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, + `Message:` + fmt.Sprintf("%v", this.Message) + `,`, + `}`, + }, "") + return s +} +func (this *RuntimeStatus) String() string { + if this == nil { + return "nil" + } + repeatedStringForConditions := "[]*RuntimeCondition{" + for _, f := range this.Conditions { + repeatedStringForConditions += strings.Replace(f.String(), "RuntimeCondition", "RuntimeCondition", 1) + "," + } + repeatedStringForConditions += "}" + s := strings.Join([]string{`&RuntimeStatus{`, + `Conditions:` + repeatedStringForConditions + `,`, + `}`, + }, "") + return s +} +func (this *StatusRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&StatusRequest{`, + `Verbose:` + fmt.Sprintf("%v", this.Verbose) + `,`, + `}`, + }, "") + return s +} +func (this *StatusResponse) String() string { + if this == nil { + return "nil" + } + keysForInfo := make([]string, 0, len(this.Info)) + for k := range this.Info { + keysForInfo = append(keysForInfo, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForInfo) + mapStringForInfo := "map[string]string{" + for _, k := range keysForInfo { + mapStringForInfo += fmt.Sprintf("%v: %v,", k, this.Info[k]) + } + mapStringForInfo += "}" + s := strings.Join([]string{`&StatusResponse{`, + `Status:` + strings.Replace(this.Status.String(), "RuntimeStatus", "RuntimeStatus", 1) + `,`, + `Info:` + mapStringForInfo + `,`, + `}`, + }, "") + return s +} +func (this *ImageFsInfoRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ImageFsInfoRequest{`, + `}`, + }, "") + return s +} +func (this *UInt64Value) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&UInt64Value{`, + `Value:` + fmt.Sprintf("%v", this.Value) + `,`, + `}`, + }, "") + return s +} +func (this *FilesystemIdentifier) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&FilesystemIdentifier{`, + `Mountpoint:` + fmt.Sprintf("%v", this.Mountpoint) + `,`, + `}`, + }, "") + return s +} +func (this *FilesystemUsage) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&FilesystemUsage{`, + `Timestamp:` + fmt.Sprintf("%v", this.Timestamp) + `,`, + `FsId:` + strings.Replace(this.FsId.String(), "FilesystemIdentifier", "FilesystemIdentifier", 1) + `,`, + `UsedBytes:` + strings.Replace(this.UsedBytes.String(), "UInt64Value", "UInt64Value", 1) + `,`, + `InodesUsed:` + strings.Replace(this.InodesUsed.String(), "UInt64Value", "UInt64Value", 1) + `,`, + `}`, + }, "") + return s +} +func (this *ImageFsInfoResponse) String() string { + if this == nil { + return "nil" + } + repeatedStringForImageFilesystems := "[]*FilesystemUsage{" + for _, f := range this.ImageFilesystems { + repeatedStringForImageFilesystems += strings.Replace(f.String(), "FilesystemUsage", "FilesystemUsage", 1) + "," + } + repeatedStringForImageFilesystems += "}" + s := strings.Join([]string{`&ImageFsInfoResponse{`, + `ImageFilesystems:` + repeatedStringForImageFilesystems + `,`, + `}`, + }, "") + return s +} +func (this *ContainerStatsRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ContainerStatsRequest{`, + `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, + `}`, + }, "") + return s +} +func (this *ContainerStatsResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ContainerStatsResponse{`, + `Stats:` + strings.Replace(this.Stats.String(), "ContainerStats", "ContainerStats", 1) + `,`, + `}`, + }, "") + return s +} +func (this *ListContainerStatsRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ListContainerStatsRequest{`, + `Filter:` + strings.Replace(this.Filter.String(), "ContainerStatsFilter", "ContainerStatsFilter", 1) + `,`, + `}`, + }, "") + return s +} +func (this *ContainerStatsFilter) String() string { + if this == nil { + return "nil" + } + keysForLabelSelector := make([]string, 0, len(this.LabelSelector)) + for k := range this.LabelSelector { + keysForLabelSelector = append(keysForLabelSelector, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForLabelSelector) + mapStringForLabelSelector := "map[string]string{" + for _, k := range keysForLabelSelector { + mapStringForLabelSelector += fmt.Sprintf("%v: %v,", k, this.LabelSelector[k]) + } + mapStringForLabelSelector += "}" + s := strings.Join([]string{`&ContainerStatsFilter{`, + `Id:` + fmt.Sprintf("%v", this.Id) + `,`, + `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, + `LabelSelector:` + mapStringForLabelSelector + `,`, + `}`, + }, "") + return s +} +func (this *ListContainerStatsResponse) String() string { + if this == nil { + return "nil" + } + repeatedStringForStats := "[]*ContainerStats{" + for _, f := range this.Stats { + repeatedStringForStats += strings.Replace(f.String(), "ContainerStats", "ContainerStats", 1) + "," + } + repeatedStringForStats += "}" + s := strings.Join([]string{`&ListContainerStatsResponse{`, + `Stats:` + repeatedStringForStats + `,`, + `}`, + }, "") + return s +} +func (this *ContainerAttributes) String() string { + if this == nil { + return "nil" + } + keysForLabels := make([]string, 0, len(this.Labels)) + for k := range this.Labels { + keysForLabels = append(keysForLabels, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) + mapStringForLabels := "map[string]string{" + for _, k := range keysForLabels { + mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) + } + mapStringForLabels += "}" + keysForAnnotations := make([]string, 0, len(this.Annotations)) + for k := range this.Annotations { + keysForAnnotations = append(keysForAnnotations, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) + mapStringForAnnotations := "map[string]string{" + for _, k := range keysForAnnotations { + mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) + } + mapStringForAnnotations += "}" + s := strings.Join([]string{`&ContainerAttributes{`, + `Id:` + fmt.Sprintf("%v", this.Id) + `,`, + `Metadata:` + strings.Replace(this.Metadata.String(), "ContainerMetadata", "ContainerMetadata", 1) + `,`, + `Labels:` + mapStringForLabels + `,`, + `Annotations:` + mapStringForAnnotations + `,`, + `}`, + }, "") + return s +} +func (this *ContainerStats) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ContainerStats{`, + `Attributes:` + strings.Replace(this.Attributes.String(), "ContainerAttributes", "ContainerAttributes", 1) + `,`, + `Cpu:` + strings.Replace(this.Cpu.String(), "CpuUsage", "CpuUsage", 1) + `,`, + `Memory:` + strings.Replace(this.Memory.String(), "MemoryUsage", "MemoryUsage", 1) + `,`, + `WritableLayer:` + strings.Replace(this.WritableLayer.String(), "FilesystemUsage", "FilesystemUsage", 1) + `,`, + `}`, + }, "") + return s +} +func (this *CpuUsage) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&CpuUsage{`, + `Timestamp:` + fmt.Sprintf("%v", this.Timestamp) + `,`, + `UsageCoreNanoSeconds:` + strings.Replace(this.UsageCoreNanoSeconds.String(), "UInt64Value", "UInt64Value", 1) + `,`, + `UsageNanoCores:` + strings.Replace(this.UsageNanoCores.String(), "UInt64Value", "UInt64Value", 1) + `,`, + `}`, + }, "") + return s +} +func (this *MemoryUsage) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&MemoryUsage{`, + `Timestamp:` + fmt.Sprintf("%v", this.Timestamp) + `,`, + `WorkingSetBytes:` + strings.Replace(this.WorkingSetBytes.String(), "UInt64Value", "UInt64Value", 1) + `,`, + `AvailableBytes:` + strings.Replace(this.AvailableBytes.String(), "UInt64Value", "UInt64Value", 1) + `,`, + `UsageBytes:` + strings.Replace(this.UsageBytes.String(), "UInt64Value", "UInt64Value", 1) + `,`, + `RssBytes:` + strings.Replace(this.RssBytes.String(), "UInt64Value", "UInt64Value", 1) + `,`, + `PageFaults:` + strings.Replace(this.PageFaults.String(), "UInt64Value", "UInt64Value", 1) + `,`, + `MajorPageFaults:` + strings.Replace(this.MajorPageFaults.String(), "UInt64Value", "UInt64Value", 1) + `,`, + `}`, + }, "") + return s +} +func (this *ReopenContainerLogRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ReopenContainerLogRequest{`, + `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, + `}`, + }, "") + return s +} +func (this *ReopenContainerLogResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ReopenContainerLogResponse{`, + `}`, + }, "") + return s +} +func valueToStringApi(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *VersionRequest) Unmarshal(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 ErrIntOverflowApi + } + 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: VersionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VersionRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VersionResponse) Unmarshal(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 ErrIntOverflowApi + } + 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: VersionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VersionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = 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 ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + 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 ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RuntimeVersion = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RuntimeApiVersion", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RuntimeApiVersion = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DNSConfig) Unmarshal(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 ErrIntOverflowApi + } + 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: DNSConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DNSConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Servers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Servers = append(m.Servers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Searches", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Searches = append(m.Searches, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + 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 ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Options = append(m.Options, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PortMapping) Unmarshal(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 ErrIntOverflowApi + } + 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: PortMapping: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PortMapping: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType) + } + m.Protocol = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Protocol |= Protocol(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerPort", wireType) + } + m.ContainerPort = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ContainerPort |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HostPort", wireType) + } + m.HostPort = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.HostPort |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HostIp", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HostIp = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Mount) Unmarshal(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 ErrIntOverflowApi + } + 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 ContainerPath", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContainerPath = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HostPath", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HostPath = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Readonly", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Readonly = bool(v != 0) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SelinuxRelabel", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SelinuxRelabel = bool(v != 0) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Propagation", wireType) + } + m.Propagation = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Propagation |= MountPropagation(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NamespaceOption) Unmarshal(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 ErrIntOverflowApi + } + 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: NamespaceOption: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NamespaceOption: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType) + } + m.Network = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Network |= NamespaceMode(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + 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 ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Pid |= NamespaceMode(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Ipc", wireType) + } + m.Ipc = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Ipc |= NamespaceMode(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TargetId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TargetId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Int64Value) Unmarshal(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 ErrIntOverflowApi + } + 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: Int64Value: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Int64Value: 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 ErrIntOverflowApi + } + 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 := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LinuxSandboxSecurityContext) Unmarshal(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 ErrIntOverflowApi + } + 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: LinuxSandboxSecurityContext: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LinuxSandboxSecurityContext: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NamespaceOptions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NamespaceOptions == nil { + m.NamespaceOptions = &NamespaceOption{} + } + if err := m.NamespaceOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SelinuxOptions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SelinuxOptions == nil { + m.SelinuxOptions = &SELinuxOption{} + } + if err := m.SelinuxOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RunAsUser", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RunAsUser == nil { + m.RunAsUser = &Int64Value{} + } + if err := m.RunAsUser.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ReadonlyRootfs", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ReadonlyRootfs = bool(v != 0) + case 5: + if wireType == 0 { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SupplementalGroups = append(m.SupplementalGroups, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + 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.SupplementalGroups) == 0 { + m.SupplementalGroups = make([]int64, 0, elementCount) + } + for iNdEx < postIndex { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SupplementalGroups = append(m.SupplementalGroups, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field SupplementalGroups", wireType) + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Privileged", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Privileged = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SeccompProfilePath", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SeccompProfilePath = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RunAsGroup", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RunAsGroup == nil { + m.RunAsGroup = &Int64Value{} + } + if err := m.RunAsGroup.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Seccomp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Seccomp == nil { + m.Seccomp = &SecurityProfile{} + } + if err := m.Seccomp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Apparmor", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Apparmor == nil { + m.Apparmor = &SecurityProfile{} + } + if err := m.Apparmor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SecurityProfile) Unmarshal(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 ErrIntOverflowApi + } + 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 ErrIntOverflowApi + } + 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 ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LocalhostRef = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LinuxPodSandboxConfig) Unmarshal(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 ErrIntOverflowApi + } + 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: LinuxPodSandboxConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LinuxPodSandboxConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CgroupParent = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecurityContext", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SecurityContext == nil { + m.SecurityContext = &LinuxSandboxSecurityContext{} + } + if err := m.SecurityContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sysctls", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Sysctls == nil { + m.Sysctls = 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 ErrIntOverflowApi + } + 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 ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthApi + } + 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 ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthApi + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Sysctls[mapkey] = mapvalue + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Overhead", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Overhead == nil { + m.Overhead = &LinuxContainerResources{} + } + if err := m.Overhead.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + 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 ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Resources == nil { + m.Resources = &LinuxContainerResources{} + } + if err := m.Resources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodSandboxMetadata) Unmarshal(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 ErrIntOverflowApi + } + 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: PodSandboxMetadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodSandboxMetadata: 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 ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + 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 Uid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Uid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + 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 ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Namespace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Attempt", wireType) + } + m.Attempt = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Attempt |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodSandboxConfig) Unmarshal(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 ErrIntOverflowApi + } + 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: PodSandboxConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodSandboxConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = &PodSandboxMetadata{} + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hostname = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LogDirectory", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LogDirectory = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DnsConfig", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DnsConfig == nil { + m.DnsConfig = &DNSConfig{} + } + if err := m.DnsConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortMappings", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PortMappings = append(m.PortMappings, &PortMapping{}) + if err := m.PortMappings[len(m.PortMappings)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + 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 ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + 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 ErrIntOverflowApi + } + 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 ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthApi + } + 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 ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthApi + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Labels[mapkey] = mapvalue + iNdEx = postIndex + case 7: + 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 ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + 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 ErrIntOverflowApi + } + 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 ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthApi + } + 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 ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthApi + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } } - if iNdEx >= l { + m.Annotations[mapkey] = mapvalue + 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 ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + if m.Linux == nil { + m.Linux = &LinuxPodSandboxConfig{} } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: VersionRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VersionRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + if err := m.Linux.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Windows", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi @@ -17550,23 +22403,27 @@ func (m *VersionRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthApi } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } - m.Version = string(dAtA[iNdEx:postIndex]) + if m.Windows == nil { + m.Windows = &WindowsPodSandboxConfig{} + } + if err := m.Windows.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -17589,7 +22446,7 @@ func (m *VersionRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *VersionResponse) Unmarshal(dAtA []byte) error { +func (m *RunPodSandboxRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -17612,17 +22469,17 @@ func (m *VersionResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: VersionResponse: wiretype end group for non-group") + return fmt.Errorf("proto: RunPodSandboxRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: VersionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + 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 Version", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi @@ -17632,27 +22489,31 @@ func (m *VersionResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthApi } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } - m.Version = string(dAtA[iNdEx:postIndex]) + if m.Config == nil { + m.Config = &PodSandboxConfig{} + } + if err := m.Config.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RuntimeName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RuntimeHandler", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -17680,43 +22541,61 @@ func (m *VersionResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.RuntimeName = string(dAtA[iNdEx:postIndex]) + m.RuntimeHandler = 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 ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + default: + iNdEx = preIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err } - intStringLen := int(stringLen) - if intStringLen < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApi + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF } - if postIndex > l { + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RunPodSandboxResponse) Unmarshal(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 ErrIntOverflowApi + } + if iNdEx >= l { return io.ErrUnexpectedEOF } - m.RuntimeVersion = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: + 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 { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RuntimeApiVersion", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PodSandboxId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -17744,7 +22623,7 @@ func (m *VersionResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.RuntimeApiVersion = string(dAtA[iNdEx:postIndex]) + m.PodSandboxId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -17767,7 +22646,7 @@ func (m *VersionResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *DNSConfig) Unmarshal(dAtA []byte) error { +func (m *StopPodSandboxRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -17790,15 +22669,15 @@ func (m *DNSConfig) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DNSConfig: wiretype end group for non-group") + return fmt.Errorf("proto: StopPodSandboxRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DNSConfig: illegal tag %d (wire type %d)", fieldNum, wire) + 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 Servers", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PodSandboxId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -17826,43 +22705,111 @@ func (m *DNSConfig) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Servers = append(m.Servers, string(dAtA[iNdEx:postIndex])) + m.PodSandboxId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Searches", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + default: + iNdEx = preIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err } - intStringLen := int(stringLen) - if intStringLen < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } - postIndex := iNdEx + intStringLen - if postIndex < 0 { + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StopPodSandboxResponse) Unmarshal(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 ErrIntOverflowApi + } + 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 := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.Searches = append(m.Searches, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RemovePodSandboxRequest) Unmarshal(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 ErrIntOverflowApi + } + 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 Options", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PodSandboxId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -17890,7 +22837,7 @@ func (m *DNSConfig) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Options = append(m.Options, string(dAtA[iNdEx:postIndex])) + m.PodSandboxId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -17913,7 +22860,7 @@ func (m *DNSConfig) Unmarshal(dAtA []byte) error { } return nil } -func (m *PortMapping) Unmarshal(dAtA []byte) error { +func (m *RemovePodSandboxResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -17936,17 +22883,67 @@ func (m *PortMapping) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PortMapping: wiretype end group for non-group") + return fmt.Errorf("proto: RemovePodSandboxResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PortMapping: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RemovePodSandboxResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodSandboxStatusRequest) Unmarshal(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 ErrIntOverflowApi + } + 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: PodSandboxStatusRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodSandboxStatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PodSandboxId", wireType) } - m.Protocol = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi @@ -17956,16 +22953,29 @@ func (m *PortMapping) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Protocol |= Protocol(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PodSandboxId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerPort", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Verbose", wireType) } - m.ContainerPort = 0 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi @@ -17975,33 +22985,65 @@ func (m *PortMapping) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ContainerPort |= int32(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field HostPort", wireType) + m.Verbose = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err } - m.HostPort = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.HostPort |= int32(b&0x7F) << shift - if b < 0x80 { - break - } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodIP) Unmarshal(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 ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF } - case 4: + 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: PodIP: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodIP: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HostIp", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Ip", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -18029,7 +23071,7 @@ func (m *PortMapping) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.HostIp = string(dAtA[iNdEx:postIndex]) + m.Ip = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -18052,7 +23094,7 @@ func (m *PortMapping) Unmarshal(dAtA []byte) error { } return nil } -func (m *Mount) Unmarshal(dAtA []byte) error { +func (m *PodSandboxNetworkStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -18075,15 +23117,15 @@ func (m *Mount) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Mount: wiretype end group for non-group") + return fmt.Errorf("proto: PodSandboxNetworkStatus: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Mount: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PodSandboxNetworkStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerPath", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Ip", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -18111,13 +23153,13 @@ func (m *Mount) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ContainerPath = string(dAtA[iNdEx:postIndex]) + m.Ip = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HostPath", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AdditionalIps", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi @@ -18127,83 +23169,26 @@ func (m *Mount) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthApi } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } - m.HostPath = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Readonly", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Readonly = bool(v != 0) - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SelinuxRelabel", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.SelinuxRelabel = bool(v != 0) - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Propagation", wireType) - } - m.Propagation = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Propagation |= MountPropagation(b&0x7F) << shift - if b < 0x80 { - break - } + m.AdditionalIps = append(m.AdditionalIps, &PodIP{}) + if err := m.AdditionalIps[len(m.AdditionalIps)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) @@ -18225,7 +23210,7 @@ func (m *Mount) Unmarshal(dAtA []byte) error { } return nil } -func (m *NamespaceOption) Unmarshal(dAtA []byte) error { +func (m *Namespace) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -18248,74 +23233,17 @@ func (m *NamespaceOption) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: NamespaceOption: wiretype end group for non-group") + return fmt.Errorf("proto: Namespace: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: NamespaceOption: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Namespace: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType) - } - m.Network = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Network |= NamespaceMode(b&0x7F) << shift - if b < 0x80 { - break - } - } case 2: - 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 ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Pid |= NamespaceMode(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Ipc", wireType) - } - m.Ipc = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Ipc |= NamespaceMode(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TargetId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi @@ -18325,23 +23253,27 @@ func (m *NamespaceOption) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthApi } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } - m.TargetId = string(dAtA[iNdEx:postIndex]) + if m.Options == nil { + m.Options = &NamespaceOption{} + } + if err := m.Options.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -18364,7 +23296,7 @@ func (m *NamespaceOption) Unmarshal(dAtA []byte) error { } return nil } -func (m *Int64Value) Unmarshal(dAtA []byte) error { +func (m *LinuxPodSandboxStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -18387,17 +23319,17 @@ func (m *Int64Value) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Int64Value: wiretype end group for non-group") + return fmt.Errorf("proto: LinuxPodSandboxStatus: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Int64Value: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: LinuxPodSandboxStatus: 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) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Namespaces", wireType) } - m.Value = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi @@ -18407,11 +23339,28 @@ func (m *Int64Value) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Value |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Namespaces == nil { + m.Namespaces = &Namespace{} + } + if err := m.Namespaces.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) @@ -18433,7 +23382,7 @@ func (m *Int64Value) Unmarshal(dAtA []byte) error { } return nil } -func (m *LinuxSandboxSecurityContext) Unmarshal(dAtA []byte) error { +func (m *PodSandboxStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -18456,15 +23405,47 @@ func (m *LinuxSandboxSecurityContext) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: LinuxSandboxSecurityContext: wiretype end group for non-group") + return fmt.Errorf("proto: PodSandboxStatus: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: LinuxSandboxSecurityContext: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PodSandboxStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NamespaceOptions", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + 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 Metadata", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -18491,16 +23472,54 @@ func (m *LinuxSandboxSecurityContext) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.NamespaceOptions == nil { - m.NamespaceOptions = &NamespaceOption{} + if m.Metadata == nil { + m.Metadata = &PodSandboxMetadata{} } - if err := m.NamespaceOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: + case 3: + 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 ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.State |= PodSandboxState(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + 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 ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CreatedAt |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SelinuxOptions", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -18527,16 +23546,16 @@ func (m *LinuxSandboxSecurityContext) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.SelinuxOptions == nil { - m.SelinuxOptions = &SELinuxOption{} + if m.Network == nil { + m.Network = &PodSandboxNetworkStatus{} } - if err := m.SelinuxOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Network.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RunAsUser", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Linux", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -18563,18 +23582,18 @@ func (m *LinuxSandboxSecurityContext) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.RunAsUser == nil { - m.RunAsUser = &Int64Value{} + if m.Linux == nil { + m.Linux = &LinuxPodSandboxStatus{} } - if err := m.RunAsUser.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Linux.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ReadonlyRootfs", wireType) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi @@ -18584,15 +23603,29 @@ func (m *LinuxSandboxSecurityContext) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - m.ReadonlyRootfs = bool(v != 0) - case 5: - if wireType == 0 { - var v int64 + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + 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 ErrIntOverflowApi @@ -18602,14 +23635,124 @@ func (m *LinuxSandboxSecurityContext) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int64(b&0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } - m.SupplementalGroups = append(m.SupplementalGroups, v) - } else if wireType == 2 { - var packedLen int + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthApi + } + 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 ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthApi + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Labels[mapkey] = mapvalue + iNdEx = postIndex + case 8: + 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 ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + 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 ErrIntOverflowApi @@ -18619,34 +23762,43 @@ func (m *LinuxSandboxSecurityContext) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - packedLen |= int(b&0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if packedLen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthApi } - } - elementCount = count - if elementCount != 0 && len(m.SupplementalGroups) == 0 { - m.SupplementalGroups = make([]int64, 0, elementCount) - } - for iNdEx < postIndex { - var v int64 + 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 ErrIntOverflowApi @@ -18656,39 +23808,44 @@ func (m *LinuxSandboxSecurityContext) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int64(b&0x7F) << shift + stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } } - m.SupplementalGroups = append(m.SupplementalGroups, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field SupplementalGroups", wireType) - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Privileged", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthApi + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthApi + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy } } - m.Privileged = bool(v != 0) - case 7: + m.Annotations[mapkey] = mapvalue + iNdEx = postIndex + case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SeccompProfilePath", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RuntimeHandler", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -18716,47 +23873,61 @@ func (m *LinuxSandboxSecurityContext) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SeccompProfilePath = string(dAtA[iNdEx:postIndex]) + m.RuntimeHandler = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RunAsGroup", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApi + default: + iNdEx = preIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err } - postIndex := iNdEx + msglen - if postIndex < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - if m.RunAsGroup == nil { - m.RunAsGroup = &Int64Value{} + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PodSandboxStatusResponse) Unmarshal(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 ErrIntOverflowApi } - if err := m.RunAsGroup.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + if iNdEx >= l { + return io.ErrUnexpectedEOF } - iNdEx = postIndex - case 9: + 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: PodSandboxStatusResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PodSandboxStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Seccomp", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -18783,16 +23954,16 @@ func (m *LinuxSandboxSecurityContext) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Seccomp == nil { - m.Seccomp = &SecurityProfile{} + if m.Status == nil { + m.Status = &PodSandboxStatus{} } - if err := m.Seccomp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 10: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Apparmor", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -18819,12 +23990,103 @@ func (m *LinuxSandboxSecurityContext) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Apparmor == nil { - m.Apparmor = &SecurityProfile{} + if m.Info == nil { + m.Info = make(map[string]string) } - if err := m.Apparmor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + 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 ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthApi + } + 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 ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthApi + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } } + m.Info[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -18847,7 +24109,7 @@ func (m *LinuxSandboxSecurityContext) Unmarshal(dAtA []byte) error { } return nil } -func (m *SecurityProfile) Unmarshal(dAtA []byte) error { +func (m *PodSandboxStateValue) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -18870,36 +24132,17 @@ func (m *SecurityProfile) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: SecurityProfile: wiretype end group for non-group") + return fmt.Errorf("proto: PodSandboxStateValue: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: SecurityProfile: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PodSandboxStateValue: 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 ErrIntOverflowApi - } - 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) + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) } - var stringLen uint64 + m.State = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi @@ -18909,24 +24152,11 @@ func (m *SecurityProfile) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.State |= PodSandboxState(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LocalhostRef = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) @@ -18948,7 +24178,7 @@ func (m *SecurityProfile) Unmarshal(dAtA []byte) error { } return nil } -func (m *LinuxPodSandboxConfig) Unmarshal(dAtA []byte) error { +func (m *PodSandboxFilter) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -18971,15 +24201,15 @@ func (m *LinuxPodSandboxConfig) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: LinuxPodSandboxConfig: wiretype end group for non-group") + return fmt.Errorf("proto: PodSandboxFilter: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: LinuxPodSandboxConfig: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PodSandboxFilter: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CgroupParent", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -19007,11 +24237,11 @@ func (m *LinuxPodSandboxConfig) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.CgroupParent = string(dAtA[iNdEx:postIndex]) + m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SecurityContext", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -19038,16 +24268,16 @@ func (m *LinuxPodSandboxConfig) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.SecurityContext == nil { - m.SecurityContext = &LinuxSandboxSecurityContext{} + if m.State == nil { + m.State = &PodSandboxStateValue{} } - if err := m.SecurityContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.State.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sysctls", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field LabelSelector", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -19074,8 +24304,8 @@ func (m *LinuxPodSandboxConfig) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Sysctls == nil { - m.Sysctls = make(map[string]string) + if m.LabelSelector == nil { + m.LabelSelector = make(map[string]string) } var mapkey string var mapvalue string @@ -19170,7 +24400,7 @@ func (m *LinuxPodSandboxConfig) Unmarshal(dAtA []byte) error { iNdEx += skippy } } - m.Sysctls[mapkey] = mapvalue + m.LabelSelector[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -19193,7 +24423,7 @@ func (m *LinuxPodSandboxConfig) Unmarshal(dAtA []byte) error { } return nil } -func (m *PodSandboxMetadata) Unmarshal(dAtA []byte) error { +func (m *ListPodSandboxRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -19216,49 +24446,17 @@ func (m *PodSandboxMetadata) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodSandboxMetadata: wiretype end group for non-group") + return fmt.Errorf("proto: ListPodSandboxRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PodSandboxMetadata: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ListPodSandboxRequest: 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 ErrIntOverflowApi - } - 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 ErrInvalidLengthApi - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApi - } - 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 Uid", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi @@ -19268,75 +24466,28 @@ func (m *PodSandboxMetadata) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthApi } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } - m.Uid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - 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 ErrIntOverflowApi - } - 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 ErrInvalidLengthApi - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApi + if m.Filter == nil { + m.Filter = &PodSandboxFilter{} } - if postIndex > l { - return io.ErrUnexpectedEOF + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Namespace = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Attempt", wireType) - } - m.Attempt = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Attempt |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) @@ -19358,7 +24509,7 @@ func (m *PodSandboxMetadata) Unmarshal(dAtA []byte) error { } return nil } -func (m *PodSandboxConfig) Unmarshal(dAtA []byte) error { +func (m *PodSandbox) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -19381,83 +24532,15 @@ func (m *PodSandboxConfig) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodSandboxConfig: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PodSandboxConfig: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Metadata == nil { - m.Metadata = &PodSandboxMetadata{} - } - if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - 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 ErrInvalidLengthApi - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Hostname = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: + 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 LogDirectory", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -19485,11 +24568,11 @@ func (m *PodSandboxConfig) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.LogDirectory = string(dAtA[iNdEx:postIndex]) + m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DnsConfig", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -19516,18 +24599,18 @@ func (m *PodSandboxConfig) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.DnsConfig == nil { - m.DnsConfig = &DNSConfig{} + if m.Metadata == nil { + m.Metadata = &PodSandboxMetadata{} } - if err := m.DnsConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PortMappings", wireType) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) } - var msglen int + m.State = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi @@ -19537,27 +24620,31 @@ func (m *PodSandboxConfig) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.State |= PodSandboxState(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) } - m.PortMappings = append(m.PortMappings, &PortMapping{}) - if err := m.PortMappings[len(m.PortMappings)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.CreatedAt = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CreatedAt |= int64(b&0x7F) << shift + if b < 0x80 { + break + } } - iNdEx = postIndex - case 6: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) } @@ -19684,7 +24771,7 @@ func (m *PodSandboxConfig) Unmarshal(dAtA []byte) error { } m.Labels[mapkey] = mapvalue iNdEx = postIndex - case 7: + case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) } @@ -19811,129 +24898,7 @@ func (m *PodSandboxConfig) Unmarshal(dAtA []byte) error { } m.Annotations[mapkey] = mapvalue 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 ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Linux == nil { - m.Linux = &LinuxPodSandboxConfig{} - } - if err := m.Linux.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipApi(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RunPodSandboxRequest) Unmarshal(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 ErrIntOverflowApi - } - 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 Config", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Config == nil { - m.Config = &PodSandboxConfig{} - } - if err := m.Config.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RuntimeHandler", wireType) } @@ -19986,7 +24951,7 @@ func (m *RunPodSandboxRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *RunPodSandboxResponse) Unmarshal(dAtA []byte) error { +func (m *ListPodSandboxResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -20009,17 +24974,17 @@ func (m *RunPodSandboxResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RunPodSandboxResponse: wiretype end group for non-group") + return fmt.Errorf("proto: ListPodSandboxResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RunPodSandboxResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ListPodSandboxResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PodSandboxId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi @@ -20029,105 +24994,25 @@ func (m *RunPodSandboxResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthApi } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } - m.PodSandboxId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipApi(dAtA[iNdEx:]) - if err != nil { + m.Items = append(m.Items, &PodSandbox{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StopPodSandboxRequest) Unmarshal(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 ErrIntOverflowApi - } - 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 PodSandboxId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - 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 ErrInvalidLengthApi - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PodSandboxId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -20150,57 +25035,7 @@ func (m *StopPodSandboxRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *StopPodSandboxResponse) Unmarshal(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 ErrIntOverflowApi - } - 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 := skipApi(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RemovePodSandboxRequest) Unmarshal(dAtA []byte) error { +func (m *PodSandboxStatsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -20223,10 +25058,10 @@ func (m *RemovePodSandboxRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RemovePodSandboxRequest: wiretype end group for non-group") + return fmt.Errorf("proto: PodSandboxStatsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RemovePodSandboxRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PodSandboxStatsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -20282,57 +25117,7 @@ func (m *RemovePodSandboxRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *RemovePodSandboxResponse) Unmarshal(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 ErrIntOverflowApi - } - 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 := skipApi(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PodSandboxStatusRequest) Unmarshal(dAtA []byte) error { +func (m *PodSandboxStatsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -20355,17 +25140,17 @@ func (m *PodSandboxStatusRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodSandboxStatusRequest: wiretype end group for non-group") + return fmt.Errorf("proto: PodSandboxStatsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PodSandboxStatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PodSandboxStatsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PodSandboxId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Stats", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi @@ -20375,125 +25160,27 @@ func (m *PodSandboxStatusRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthApi } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } - m.PodSandboxId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Verbose", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } + if m.Stats == nil { + m.Stats = &PodSandboxStats{} } - m.Verbose = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipApi(dAtA[iNdEx:]) - if err != nil { + if err := m.Stats.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PodIP) Unmarshal(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 ErrIntOverflowApi - } - 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: PodIP: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PodIP: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ip", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - 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 ErrInvalidLengthApi - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Ip = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -20516,7 +25203,7 @@ func (m *PodIP) Unmarshal(dAtA []byte) error { } return nil } -func (m *PodSandboxNetworkStatus) Unmarshal(dAtA []byte) error { +func (m *PodSandboxStatsFilter) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -20539,15 +25226,15 @@ func (m *PodSandboxNetworkStatus) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodSandboxNetworkStatus: wiretype end group for non-group") + return fmt.Errorf("proto: PodSandboxStatsFilter: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PodSandboxNetworkStatus: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PodSandboxStatsFilter: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ip", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -20575,11 +25262,11 @@ func (m *PodSandboxNetworkStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Ip = string(dAtA[iNdEx:postIndex]) + m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AdditionalIps", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field LabelSelector", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -20606,10 +25293,103 @@ func (m *PodSandboxNetworkStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.AdditionalIps = append(m.AdditionalIps, &PodIP{}) - if err := m.AdditionalIps[len(m.AdditionalIps)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + if m.LabelSelector == nil { + m.LabelSelector = 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 ErrIntOverflowApi + } + 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 ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthApi + } + 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 ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthApi + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } } + m.LabelSelector[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -20632,7 +25412,7 @@ func (m *PodSandboxNetworkStatus) Unmarshal(dAtA []byte) error { } return nil } -func (m *Namespace) Unmarshal(dAtA []byte) error { +func (m *ListPodSandboxStatsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -20655,15 +25435,15 @@ func (m *Namespace) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Namespace: wiretype end group for non-group") + return fmt.Errorf("proto: ListPodSandboxStatsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Namespace: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ListPodSandboxStatsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 2: + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -20690,10 +25470,10 @@ func (m *Namespace) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Options == nil { - m.Options = &NamespaceOption{} + if m.Filter == nil { + m.Filter = &PodSandboxStatsFilter{} } - if err := m.Options.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -20718,7 +25498,7 @@ func (m *Namespace) Unmarshal(dAtA []byte) error { } return nil } -func (m *LinuxPodSandboxStatus) Unmarshal(dAtA []byte) error { +func (m *ListPodSandboxStatsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -20741,15 +25521,15 @@ func (m *LinuxPodSandboxStatus) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: LinuxPodSandboxStatus: wiretype end group for non-group") + return fmt.Errorf("proto: ListPodSandboxStatsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: LinuxPodSandboxStatus: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ListPodSandboxStatsResponse: 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) + return fmt.Errorf("proto: wrong wireType = %d for field Stats", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -20776,10 +25556,8 @@ func (m *LinuxPodSandboxStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Namespaces == nil { - m.Namespaces = &Namespace{} - } - if err := m.Namespaces.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Stats = append(m.Stats, &PodSandboxStats{}) + if err := m.Stats[len(m.Stats)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -20804,7 +25582,7 @@ func (m *LinuxPodSandboxStatus) Unmarshal(dAtA []byte) error { } return nil } -func (m *PodSandboxStatus) Unmarshal(dAtA []byte) error { +func (m *PodSandboxAttributes) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -20827,10 +25605,10 @@ func (m *PodSandboxStatus) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodSandboxStatus: wiretype end group for non-group") + return fmt.Errorf("proto: PodSandboxAttributes: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PodSandboxStatus: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PodSandboxAttributes: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -20902,116 +25680,6 @@ func (m *PodSandboxStatus) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 3: - 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 ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.State |= PodSandboxState(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - 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 ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CreatedAt |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Network == nil { - m.Network = &PodSandboxNetworkStatus{} - } - if err := m.Network.Unmarshal(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 ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Linux == nil { - m.Linux = &LinuxPodSandboxStatus{} - } - if err := m.Linux.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) } @@ -21090,302 +25758,57 @@ func (m *PodSandboxStatus) Unmarshal(dAtA []byte) error { 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 ErrIntOverflowApi - } - 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 ErrInvalidLengthApi - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthApi - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipApi(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Labels[mapkey] = mapvalue - iNdEx = postIndex - case 8: - 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 ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApi - } - 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 ErrIntOverflowApi - } - 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 ErrIntOverflowApi - } - 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 ErrInvalidLengthApi - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthApi - } - 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 ErrIntOverflowApi - } - 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 ErrInvalidLengthApi - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthApi - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipApi(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Annotations[mapkey] = mapvalue - iNdEx = postIndex - case 9: - 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 ErrIntOverflowApi - } - 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 ErrInvalidLengthApi - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RuntimeHandler = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipApi(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PodSandboxStatusResponse) Unmarshal(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 ErrIntOverflowApi - } - 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: PodSandboxStatusResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PodSandboxStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthApi + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy } } - if msglen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Status == nil { - m.Status = &PodSandboxStatus{} - } - if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Labels[mapkey] = mapvalue iNdEx = postIndex - case 2: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -21412,8 +25835,8 @@ func (m *PodSandboxStatusResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Info == nil { - m.Info = make(map[string]string) + if m.Annotations == nil { + m.Annotations = make(map[string]string) } var mapkey string var mapvalue string @@ -21508,7 +25931,7 @@ func (m *PodSandboxStatusResponse) Unmarshal(dAtA []byte) error { iNdEx += skippy } } - m.Info[mapkey] = mapvalue + m.Annotations[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -21531,7 +25954,7 @@ func (m *PodSandboxStatusResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *PodSandboxStateValue) Unmarshal(dAtA []byte) error { +func (m *PodSandboxStats) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -21554,17 +25977,17 @@ func (m *PodSandboxStateValue) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodSandboxStateValue: wiretype end group for non-group") + return fmt.Errorf("proto: PodSandboxStats: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PodSandboxStateValue: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PodSandboxStats: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) } - m.State = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi @@ -21574,11 +25997,100 @@ func (m *PodSandboxStateValue) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.State |= PodSandboxState(b&0x7F) << shift + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Attributes == nil { + m.Attributes = &PodSandboxAttributes{} + } + if err := m.Attributes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + 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 ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Linux == nil { + m.Linux = &LinuxPodSandboxStats{} + } + if err := m.Linux.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Windows", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Windows == nil { + m.Windows = &WindowsPodSandboxStats{} + } + if err := m.Windows.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) @@ -21600,7 +26112,7 @@ func (m *PodSandboxStateValue) Unmarshal(dAtA []byte) error { } return nil } -func (m *PodSandboxFilter) Unmarshal(dAtA []byte) error { +func (m *LinuxPodSandboxStats) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -21623,17 +26135,17 @@ func (m *PodSandboxFilter) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodSandboxFilter: wiretype end group for non-group") + return fmt.Errorf("proto: LinuxPodSandboxStats: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PodSandboxFilter: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: LinuxPodSandboxStats: 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) + return fmt.Errorf("proto: wrong wireType = %d for field Cpu", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi @@ -21643,27 +26155,31 @@ func (m *PodSandboxFilter) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthApi } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } - m.Id = string(dAtA[iNdEx:postIndex]) + if m.Cpu == nil { + m.Cpu = &CpuUsage{} + } + if err := m.Cpu.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Memory", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -21690,16 +26206,16 @@ func (m *PodSandboxFilter) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.State == nil { - m.State = &PodSandboxStateValue{} + if m.Memory == nil { + m.Memory = &MemoryUsage{} } - if err := m.State.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Memory.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LabelSelector", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -21726,103 +26242,82 @@ func (m *PodSandboxFilter) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.LabelSelector == nil { - m.LabelSelector = make(map[string]string) + if m.Network == nil { + m.Network = &NetworkUsage{} } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + if err := m.Network.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Process", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - 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 ErrInvalidLengthApi - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthApi - } - 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 ErrIntOverflowApi - } - 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 ErrInvalidLengthApi - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthApi - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipApi(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break } } - m.LabelSelector[mapkey] = mapvalue + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Process == nil { + m.Process = &ProcessUsage{} + } + if err := m.Process.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + 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 ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Containers = append(m.Containers, &ContainerStats{}) + if err := m.Containers[len(m.Containers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -21845,7 +26340,7 @@ func (m *PodSandboxFilter) Unmarshal(dAtA []byte) error { } return nil } -func (m *ListPodSandboxRequest) Unmarshal(dAtA []byte) error { +func (m *WindowsPodSandboxStats) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -21868,15 +26363,84 @@ func (m *ListPodSandboxRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ListPodSandboxRequest: wiretype end group for non-group") + return fmt.Errorf("proto: WindowsPodSandboxStats: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ListPodSandboxRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: WindowsPodSandboxStats: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NetworkUsage) Unmarshal(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 ErrIntOverflowApi + } + 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: NetworkUsage: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NetworkUsage: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + m.Timestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Timestamp |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DefaultInterface", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -21903,10 +26467,44 @@ func (m *ListPodSandboxRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Filter == nil { - m.Filter = &PodSandboxFilter{} + if m.DefaultInterface == nil { + m.DefaultInterface = &NetworkInterfaceUsage{} } - if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.DefaultInterface.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Interfaces", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Interfaces = append(m.Interfaces, &NetworkInterfaceUsage{}) + if err := m.Interfaces[len(m.Interfaces)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -21931,7 +26529,7 @@ func (m *ListPodSandboxRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *PodSandbox) Unmarshal(dAtA []byte) error { +func (m *NetworkInterfaceUsage) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -21954,15 +26552,15 @@ func (m *PodSandbox) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: PodSandbox: wiretype end group for non-group") + return fmt.Errorf("proto: NetworkInterfaceUsage: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: PodSandbox: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: NetworkInterfaceUsage: 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) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -21990,11 +26588,11 @@ func (m *PodSandbox) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Id = string(dAtA[iNdEx:postIndex]) + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RxBytes", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -22021,54 +26619,16 @@ func (m *PodSandbox) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Metadata == nil { - m.Metadata = &PodSandboxMetadata{} + if m.RxBytes == nil { + m.RxBytes = &UInt64Value{} } - if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.RxBytes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: - 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 ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.State |= PodSandboxState(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - 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 ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CreatedAt |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RxErrors", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -22095,107 +26655,16 @@ func (m *PodSandbox) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Labels == nil { - m.Labels = make(map[string]string) + if m.RxErrors == nil { + m.RxErrors = &UInt64Value{} } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - 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 ErrIntOverflowApi - } - 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 ErrInvalidLengthApi - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthApi - } - 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 ErrIntOverflowApi - } - 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 ErrInvalidLengthApi - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthApi - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipApi(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } + if err := m.RxErrors.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Labels[mapkey] = mapvalue iNdEx = postIndex - case 6: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TxBytes", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -22222,109 +26691,18 @@ func (m *PodSandbox) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Annotations == nil { - m.Annotations = make(map[string]string) + if m.TxBytes == nil { + m.TxBytes = &UInt64Value{} } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - 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 ErrIntOverflowApi - } - 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 ErrInvalidLengthApi - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthApi - } - 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 ErrIntOverflowApi - } - 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 ErrInvalidLengthApi - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthApi - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipApi(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } + if err := m.TxBytes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Annotations[mapkey] = mapvalue iNdEx = postIndex - case 7: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RuntimeHandler", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TxErrors", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi @@ -22334,23 +26712,27 @@ func (m *PodSandbox) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthApi } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } - m.RuntimeHandler = string(dAtA[iNdEx:postIndex]) + if m.TxErrors == nil { + m.TxErrors = &UInt64Value{} + } + if err := m.TxErrors.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -22373,7 +26755,7 @@ func (m *PodSandbox) Unmarshal(dAtA []byte) error { } return nil } -func (m *ListPodSandboxResponse) Unmarshal(dAtA []byte) error { +func (m *ProcessUsage) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -22396,15 +26778,34 @@ func (m *ListPodSandboxResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ListPodSandboxResponse: wiretype end group for non-group") + return fmt.Errorf("proto: ProcessUsage: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ListPodSandboxResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ProcessUsage: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + m.Timestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Timestamp |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ProcessCount", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -22431,8 +26832,10 @@ func (m *ListPodSandboxResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Items = append(m.Items, &PodSandbox{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.ProcessCount == nil { + m.ProcessCount = &UInt64Value{} + } + if err := m.ProcessCount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -22997,11 +27400,157 @@ func (m *LinuxContainerResources) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.HugepageLimits = append(m.HugepageLimits, &HugepageLimit{}) - if err := m.HugepageLimits[len(m.HugepageLimits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.HugepageLimits = append(m.HugepageLimits, &HugepageLimit{}) + if err := m.HugepageLimits[len(m.HugepageLimits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + 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 ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + 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 ErrIntOverflowApi + } + 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 ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthApi + } + 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 ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthApi + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Unified[mapkey] = mapvalue iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemorySwapLimitInBytes", wireType) + } + m.MemorySwapLimitInBytes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MemorySwapLimitInBytes |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) @@ -24037,49 +28586,269 @@ func (m *LinuxContainerConfig) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: LinuxContainerConfig: wiretype end group for non-group") + return fmt.Errorf("proto: LinuxContainerConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LinuxContainerConfig: 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 ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Resources == nil { + m.Resources = &LinuxContainerResources{} + } + if err := m.Resources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecurityContext", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SecurityContext == nil { + m.SecurityContext = &LinuxContainerSecurityContext{} + } + if err := m.SecurityContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WindowsSandboxSecurityContext) Unmarshal(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 ErrIntOverflowApi + } + 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: WindowsSandboxSecurityContext: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WindowsSandboxSecurityContext: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RunAsUsername", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RunAsUsername = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CredentialSpec", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + 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 ErrInvalidLengthApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CredentialSpec = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HostProcess", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.HostProcess = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApi + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WindowsPodSandboxConfig) Unmarshal(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 ErrIntOverflowApi + } + 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: WindowsPodSandboxConfig: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: LinuxContainerConfig: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: WindowsPodSandboxConfig: 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 ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Resources == nil { - m.Resources = &LinuxContainerResources{} - } - if err := m.Resources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SecurityContext", wireType) } @@ -24109,7 +28878,7 @@ func (m *LinuxContainerConfig) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.SecurityContext == nil { - m.SecurityContext = &LinuxContainerSecurityContext{} + m.SecurityContext = &WindowsSandboxSecurityContext{} } if err := m.SecurityContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -24229,6 +28998,26 @@ func (m *WindowsContainerSecurityContext) Unmarshal(dAtA []byte) error { } m.CredentialSpec = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HostProcess", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.HostProcess = bool(v != 0) default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) @@ -29921,6 +34710,26 @@ func (m *Image) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Pinned", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Pinned = bool(v != 0) default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) @@ -33491,6 +38300,42 @@ func (m *CpuUsage) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UsageNanoCores", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.UsageNanoCores == nil { + m.UsageNanoCores = &UInt64Value{} + } + if err := m.UsageNanoCores.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) @@ -33596,6 +38441,186 @@ func (m *MemoryUsage) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AvailableBytes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AvailableBytes == nil { + m.AvailableBytes = &UInt64Value{} + } + if err := m.AvailableBytes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UsageBytes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.UsageBytes == nil { + m.UsageBytes = &UInt64Value{} + } + if err := m.UsageBytes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RssBytes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RssBytes == nil { + m.RssBytes = &UInt64Value{} + } + if err := m.RssBytes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PageFaults", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PageFaults == nil { + m.PageFaults = &UInt64Value{} + } + if err := m.PageFaults.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MajorPageFaults", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthApi + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MajorPageFaults == nil { + m.MajorPageFaults = &UInt64Value{} + } + if err := m.MajorPageFaults.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) diff --git a/test/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.proto b/test/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.proto index a8701692f6..ba3230d183 100644 --- a/test/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.proto +++ b/test/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.proto @@ -102,6 +102,12 @@ service RuntimeService { // ListContainerStats returns stats of all running containers. rpc ListContainerStats(ListContainerStatsRequest) returns (ListContainerStatsResponse) {} + // PodSandboxStats returns stats of the pod sandbox. If the pod sandbox does not + // exist, the call returns an error. + rpc PodSandboxStats(PodSandboxStatsRequest) returns (PodSandboxStatsResponse) {} + // ListPodSandboxStats returns stats of the pod sandboxes matching a filter. + rpc ListPodSandboxStats(ListPodSandboxStatsRequest) returns (ListPodSandboxStatsResponse) {} + // UpdateRuntimeConfig updates the runtime configuration based on the given request. rpc UpdateRuntimeConfig(UpdateRuntimeConfigRequest) returns (UpdateRuntimeConfigResponse) {} @@ -323,6 +329,10 @@ message LinuxPodSandboxConfig { LinuxSandboxSecurityContext security_context = 2; // Sysctls holds linux sysctls config for the sandbox. map sysctls = 3; + // Optional overhead represents the overheads associated with this sandbox + LinuxContainerResources overhead = 4; + // Optional resources represents the sum of container resources for this sandbox + LinuxContainerResources resources = 5; } // PodSandboxMetadata holds all necessary information for building the sandbox name. @@ -392,6 +402,8 @@ message PodSandboxConfig { map annotations = 7; // Optional configurations specific to Linux hosts. LinuxPodSandboxConfig linux = 8; + // Optional configurations specific to Windows hosts. + WindowsPodSandboxConfig windows = 9; } message RunPodSandboxRequest { @@ -401,7 +413,7 @@ message RunPodSandboxRequest { // If the runtime handler is unknown, this request should be rejected. An // empty string should select the default handler, equivalent to the // behavior before this feature was added. - // See https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md + // See https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class string runtime_handler = 2; } @@ -547,6 +559,113 @@ message ListPodSandboxResponse { repeated PodSandbox items = 1; } +message PodSandboxStatsRequest { + // ID of the pod sandbox for which to retrieve stats. + string pod_sandbox_id = 1; +} + +message PodSandboxStatsResponse { + PodSandboxStats stats = 1; +} + +// PodSandboxStatsFilter is used to filter pod sandboxes. +// All those fields are combined with 'AND'. +message PodSandboxStatsFilter { + // ID of the pod sandbox. + string id = 1; + // LabelSelector to select matches. + // Only api.MatchLabels is supported for now and the requirements + // are ANDed. MatchExpressions is not supported yet. + map label_selector = 2; +} + +message ListPodSandboxStatsRequest { + // Filter for the list request. + PodSandboxStatsFilter filter = 1; +} + +message ListPodSandboxStatsResponse { + // Stats of the pod sandbox. + repeated PodSandboxStats stats = 1; +} + +// PodSandboxAttributes provides basic information of the pod sandbox. +message PodSandboxAttributes { + // ID of the pod sandbox. + string id = 1; + // Metadata of the pod sandbox. + PodSandboxMetadata metadata = 2; + // Key-value pairs that may be used to scope and select individual resources. + map labels = 3; + // Unstructured key-value map holding arbitrary metadata. + // Annotations MUST NOT be altered by the runtime; the value of this field + // MUST be identical to that of the corresponding PodSandboxStatus used to + // instantiate the PodSandbox this status represents. + map annotations = 4; +} + +// PodSandboxStats provides the resource usage statistics for a pod. +// The linux or windows field will be populated depending on the platform. +message PodSandboxStats { + // Information of the pod. + PodSandboxAttributes attributes = 1; + // Stats from linux. + LinuxPodSandboxStats linux = 2; + // Stats from windows. + WindowsPodSandboxStats windows = 3; +} + +// LinuxPodSandboxStats provides the resource usage statistics for a pod sandbox on linux. +message LinuxPodSandboxStats { + // CPU usage gathered for the pod sandbox. + CpuUsage cpu = 1; + // Memory usage gathered for the pod sandbox. + MemoryUsage memory = 2; + // Network usage gathered for the pod sandbox + NetworkUsage network = 3; + // Stats pertaining to processes in the pod sandbox. + ProcessUsage process = 4; + // Stats of containers in the measured pod sandbox. + repeated ContainerStats containers = 5; +} + +// WindowsPodSandboxStats provides the resource usage statistics for a pod sandbox on windows +message WindowsPodSandboxStats { + // TODO: Add stats relevant to windows. +} + +// NetworkUsage contains data about network resources. +message NetworkUsage { + // The time at which these stats were updated. + int64 timestamp = 1; + // Stats for the default network interface. + NetworkInterfaceUsage default_interface = 2; + // Stats for all found network interfaces, excluding the default. + repeated NetworkInterfaceUsage interfaces = 3; +} + +// NetworkInterfaceUsage contains resource value data about a network interface. +message NetworkInterfaceUsage { + // The name of the network interface. + string name = 1; + // Cumulative count of bytes received. + UInt64Value rx_bytes = 2; + // Cumulative count of receive errors encountered. + UInt64Value rx_errors = 3; + // Cumulative count of bytes transmitted. + UInt64Value tx_bytes = 4; + // Cumulative count of transmit errors encountered. + UInt64Value tx_errors = 5; +} + +// ProcessUsage are stats pertaining to processes. +message ProcessUsage { + // The time at which these stats were updated. + int64 timestamp = 1; + // Number of processes. + UInt64Value process_count = 2; +} + // ImageSpec is an internal representation of an image. message ImageSpec { // Container's Image field (e.g. imageID or imageDigest). @@ -583,6 +702,12 @@ message LinuxContainerResources { string cpuset_mems = 7; // List of HugepageLimits to limit the HugeTLB usage of container per page size. Default: nil (not specified). repeated HugepageLimit hugepage_limits = 8; + // Unified resources for cgroup v2. Default: nil (not specified). + // Each key/value in the map refers to the cgroup v2. + // e.g. "memory.max": "6937202688" or "io.weight": "default 100". + map unified = 9; + // Memory swap limit in bytes. Default 0 (not specified). + int64 memory_swap_limit_in_bytes = 10; } // HugepageLimit corresponds to the file`hugetlb..limit_in_byte` in container level cgroup. @@ -693,6 +818,29 @@ message LinuxContainerConfig { LinuxContainerSecurityContext security_context = 2; } +// WindowsSandboxSecurityContext holds platform-specific configurations that will be +// applied to a sandbox. +// These settings will only apply to the sandbox container. +message WindowsSandboxSecurityContext { + // User name to run the container process as. If specified, the user MUST + // exist in the container image and be resolved there by the runtime; + // otherwise, the runtime MUST return error. + string run_as_username = 1; + + // The contents of the GMSA credential spec to use to run this container. + string credential_spec = 2; + + // Indicates whether the container be asked to run as a HostProcess container. + bool host_process = 3; +} + +// WindowsPodSandboxConfig holds platform-specific configurations for Windows +// host platforms and Windows-based containers. +message WindowsPodSandboxConfig { + // WindowsSandboxSecurityContext holds sandbox security attributes. + WindowsSandboxSecurityContext security_context = 1; +} + // WindowsContainerSecurityContext holds windows security configuration that will be applied to a container. message WindowsContainerSecurityContext { // User name to run the container process as. If specified, the user MUST @@ -702,6 +850,9 @@ message WindowsContainerSecurityContext { // The contents of the GMSA credential spec to use to run this container. string credential_spec = 2; + + // Indicates whether a container is to be run as a HostProcess container. + bool host_process = 3; } // WindowsContainerConfig contains platform-specific configuration for @@ -1104,6 +1255,10 @@ message Image { string username = 6; // ImageSpec for image which includes annotations ImageSpec spec = 7; + // Recommendation on whether this image should be exempt from garbage collection. + // It must only be treated as a recommendation -- the client can still request that the image be deleted, + // and the runtime must oblige. + bool pinned = 8; } message ListImagesResponse { @@ -1325,6 +1480,9 @@ message CpuUsage { int64 timestamp = 1; // Cumulative CPU usage (sum across all cores) since object creation. UInt64Value usage_core_nano_seconds = 2; + // Total CPU usage (sum of all cores) averaged over the sample window. + // The "core" unit can be interpreted as CPU core-nanoseconds per second. + UInt64Value usage_nano_cores = 3; } // MemoryUsage provides the memory usage information. @@ -1333,6 +1491,16 @@ message MemoryUsage { int64 timestamp = 1; // The amount of working set memory in bytes. UInt64Value working_set_bytes = 2; + // Available memory for use. This is defined as the memory limit = workingSetBytes. + UInt64Value available_bytes = 3; + // Total memory in use. This includes all memory regardless of when it was accessed. + UInt64Value usage_bytes = 4; + // The amount of anonymous and swap cache memory (includes transparent hugepages). + UInt64Value rss_bytes = 5; + // Cumulative number of minor page faults. + UInt64Value page_faults = 6; + // Cumulative number of major page faults. + UInt64Value major_page_faults = 7; } message ReopenContainerLogRequest { diff --git a/test/vendor/modules.txt b/test/vendor/modules.txt index 8d322b44ee..8641870ac4 100644 --- a/test/vendor/modules.txt +++ b/test/vendor/modules.txt @@ -129,6 +129,8 @@ github.com/containerd/containerd/mount github.com/containerd/containerd/namespaces github.com/containerd/containerd/oci github.com/containerd/containerd/pkg/cap +github.com/containerd/containerd/pkg/cri/constants +github.com/containerd/containerd/pkg/cri/util github.com/containerd/containerd/pkg/dialer github.com/containerd/containerd/pkg/userns github.com/containerd/containerd/platforms @@ -138,6 +140,7 @@ github.com/containerd/containerd/reference/docker github.com/containerd/containerd/remotes github.com/containerd/containerd/remotes/docker github.com/containerd/containerd/remotes/docker/auth +github.com/containerd/containerd/remotes/docker/config github.com/containerd/containerd/remotes/docker/schema1 github.com/containerd/containerd/remotes/errors github.com/containerd/containerd/rootfs @@ -280,6 +283,9 @@ github.com/opencontainers/runtime-tools/validate github.com/opencontainers/selinux/go-selinux github.com/opencontainers/selinux/go-selinux/label github.com/opencontainers/selinux/pkg/pwalk +# github.com/pelletier/go-toml v1.8.1 +## explicit; go 1.12 +github.com/pelletier/go-toml # github.com/pkg/errors v0.9.1 ## explicit github.com/pkg/errors @@ -306,8 +312,9 @@ go.opencensus.io/trace go.opencensus.io/trace/internal go.opencensus.io/trace/propagation go.opencensus.io/trace/tracestate -# golang.org/x/net v0.0.0-20210825183410-e898025ed96a +# golang.org/x/net v0.0.0-20211209124913-491a49abca63 ## explicit; go 1.17 +golang.org/x/net/context golang.org/x/net/context/ctxhttp golang.org/x/net/http/httpguts golang.org/x/net/http2 @@ -327,13 +334,13 @@ golang.org/x/sys/windows golang.org/x/sys/windows/registry golang.org/x/sys/windows/svc golang.org/x/sys/windows/svc/mgr -# golang.org/x/text v0.3.6 -## explicit; go 1.11 +# golang.org/x/text v0.3.7 +## explicit; go 1.17 golang.org/x/text/secure/bidirule golang.org/x/text/transform golang.org/x/text/unicode/bidi golang.org/x/text/unicode/norm -# google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a => google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63 +# google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2 => google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63 ## explicit; go 1.11 google.golang.org/genproto/googleapis/rpc/status # google.golang.org/grpc v1.40.0 => google.golang.org/grpc v1.27.1 @@ -407,8 +414,8 @@ google.golang.org/protobuf/types/descriptorpb google.golang.org/protobuf/types/known/anypb google.golang.org/protobuf/types/known/durationpb google.golang.org/protobuf/types/known/timestamppb -# k8s.io/cri-api v0.20.6 -## explicit; go 1.15 +# k8s.io/cri-api v0.23.1 +## explicit; go 1.16 k8s.io/cri-api/pkg/apis/runtime/v1alpha2 # github.com/Microsoft/hcsshim => ../ # google.golang.org/genproto => google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63