diff --git a/.appveyor.yml b/.appveyor.yml
deleted file mode 100644
index 4912045ff..000000000
--- a/.appveyor.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-version: "{build}"
-
-image: Visual Studio 2019
-
-clone_folder: c:\gopath\src\github.com\containerd\cri
-
-environment:
- GOPATH: C:\gopath
- PATH: C:\go\bin;C:\tools\mingw64\bin;$(PATH)
- CGO_ENABLED: 1
- GO111MODULE: off
- matrix:
- - GO_VERSION: 1.13.15
-
-install:
- # Install Mingw
- - choco install -y mingw --version 5.3.0
- # Install Go
- - rd C:\Go /s /q
- - appveyor DownloadFile https://storage.googleapis.com/golang/go%GO_VERSION%.windows-amd64.zip
- - 7z x go%GO_VERSION%.windows-amd64.zip -oC:\ >nul
- - go version
- # Print powershell version
- - ps: $psversiontable
-
-build_script:
- - bash.exe -elc "mingw32-make.exe"
-
-test_script:
- - bash.exe -elc "mingw32-make.exe test"
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
deleted file mode 100644
index bc337ee94..000000000
--- a/.github/workflows/ci.yml
+++ /dev/null
@@ -1,177 +0,0 @@
-name: CI
-on: [push, pull_request]
-
-jobs:
- #
- # Project checks
- #
- project:
- name: Project Checks (DCO, Headers, Vendor)
- runs-on: ubuntu-18.04
- timeout-minutes: 5
-
- steps:
- - name: Install Go
- uses: actions/setup-go@v1
- with:
- go-version: '1.13.15'
-
- - name: Set env
- shell: bash
- run: |
- echo "::set-env name=GOPATH::${{ github.workspace }}"
- echo "::add-path::${{ github.workspace }}/bin"
-
- - name: Checkout cri repo
- uses: actions/checkout@v2
- with:
- path: ${{github.workspace}}/src/github.com/containerd/cri
- fetch-depth: 150
-
- - name: Checkout project repo
- uses: actions/checkout@v2
- with:
- repository: containerd/project
- path: src/github.com/containerd/project
-
- #
- # Go get dependencies
- #
- - name: Install go get dependencies
- env:
- GO111MODULE: off
- run: |
- go get -u github.com/vbatts/git-validation
- go get -u github.com/kunalkushwaha/ltag
- go get -u github.com/LK4D4/vndr
-
- #
- # DCO / File headers / Vendor directory validation
- #
- - name: DCO
- env:
- GITHUB_COMMIT_URL: ${{ github.event.pull_request.commits_url }}
- DCO_VERBOSITY: "-v"
- DCO_RANGE: ""
- working-directory: src/github.com/containerd/cri
- run: |
- set -x
- if [ -z "${GITHUB_COMMIT_URL}" ]; then
- DCO_RANGE=$(jq -r '.after + "..HEAD"' ${GITHUB_EVENT_PATH})
- else
- DCO_RANGE=$(curl ${GITHUB_COMMIT_URL} | jq -r '.[0].parents[0].sha +".."+ .[-1].sha')
- fi
- ../project/script/validate/dco
-
- - name: Headers
- working-directory: src/github.com/containerd/cri
- run: |
- ltag -t "../project/script/validate/template" --check -v
-
- - name: Vendor
- working-directory: src/github.com/containerd/cri
- run: ../project/script/validate/vendor
-
- #
- # build, unit, integration, and CRI tests
- #
- linux-build-and-test:
- name: Build, Unit, Integration, and CRI (linux amd64)
- runs-on: ubuntu-18.04
- steps:
- - name: Install Go
- uses: actions/setup-go@v1
- with:
- go-version: '1.13.15'
-
- - name: Set env
- shell: bash
- run: |
- echo "::set-env name=GOPATH::${{ github.workspace }}"
- echo "::add-path::${{ github.workspace }}/bin"
-
- - name: Checkout cri repo
- uses: actions/checkout@v2
- with:
- path: ${{github.workspace}}/src/github.com/containerd/cri
- fetch-depth: 150
-
- - name: Before install
- run: |
- sudo sysctl net.ipv6.conf.all.disable_ipv6=0
-
- - name: Install dependencies
- run: |
- sudo apt-get update
- sudo apt-get install -y \
- btrfs-tools \
- libseccomp2 \
- libseccomp-dev
- make install.deps
- working-directory: ${{github.workspace}}/src/github.com/containerd/cri
-
- - name: Install containerd
- run: |
- make containerd
- sudo PATH=$PATH GOPATH=$GOPATH make install-containerd
- working-directory: ${{github.workspace}}/src/github.com/containerd/cri
-
- - name: Unit Test
- run: |
- make test
- working-directory: ${{github.workspace}}/src/github.com/containerd/cri
-
- - name: Integration Test
- run: |
- make test-integration
- working-directory: ${{github.workspace}}/src/github.com/containerd/cri
-
- - name: Upload Integration Log File
- uses: actions/upload-artifact@v1
- with:
- name: integration-test-${{github.sha}}.log
- path: /tmp/test-integration/containerd.log
-
- - name: CRI Test
- run: |
- make test-cri
- working-directory: ${{github.workspace}}/src/github.com/containerd/cri
-
- - name: Upload CRI Test log file
- uses: actions/upload-artifact@v1
- with:
- name: cri-test-${{github.sha}}.log
- path: /tmp/test-cri/containerd.log
-
- test-windows:
- name: Build and CRI Test (Windows amd64)
- runs-on: windows-2016
- steps:
- - name: Set up Go 1.13.15
- uses: actions/setup-go@v1
- with:
- go-version: 1.13.15
-
- - name: Checkout cri repo
- uses: actions/checkout@v2
- with:
- path: ${{github.workspace}}\\src\\github.com\\containerd\\cri
-
- - name: Clone containerd repo
- run: |
- bash.exe -c "GO111MODULE=off go get github.com/containerd/containerd"
-
- - name: Configure Windows environment variables
- run: |
- echo "::set-env name=GOPATH::$env:GITHUB_WORKSPACE"
-
- - name: Build
- run: |
- bash.exe -c "pwd && ./test/windows/test.sh"
- working-directory: ${{github.workspace}}\\src\\github.com\\containerd\\cri
-
- - name: Upload containerd log file
- uses: actions/upload-artifact@v1
- with:
- name: cadvisor-${{github.sha}}.log
- path: c:\\_artifacts\\containerd.log
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index eaaf8de64..000000000
--- a/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-_output/*
diff --git a/.golangci.yml b/.golangci.yml
deleted file mode 100644
index e7d66f2e0..000000000
--- a/.golangci.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-linters:
- enable:
- - structcheck
- - varcheck
- - staticcheck
- - unconvert
- - gofmt
- - goimports
- - golint
- - ineffassign
- - vet
- - unused
- - misspell
- disable:
- - errcheck
-
-run:
- timeout: 3m
- skip-dirs:
- - docs
- skip-files:
- - ".*\\.pb.go"
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index 8dada3eda..000000000
--- a/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "{}"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright {yyyy} {name of copyright owner}
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/Makefile b/Makefile
deleted file mode 100644
index eea9d4253..000000000
--- a/Makefile
+++ /dev/null
@@ -1,222 +0,0 @@
-# Copyright The containerd Authors.
-
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-
-# http://www.apache.org/licenses/LICENSE-2.0
-
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-GO := go
-GOOS := $(shell $(GO) env GOOS)
-GOARCH := $(shell $(GO) env GOARCH)
-WHALE := "🇩"
-ONI := "👹"
-ifeq ($(GOOS),windows)
- WHALE = "+"
- ONI = "-"
-endif
-EPOCH_TEST_COMMIT := 67de3e4ccf2b2a69b8398798af7cfca01abf7a7e
-PROJECT := github.com/containerd/cri
-BINDIR := ${DESTDIR}/usr/local/bin
-BUILD_DIR := _output
-# VERSION is derived from the current commit for HEAD. Version is used
-# to set/overide the containerd version in vendor/github.com/containerd/containerd/version.
-VERSION := $(shell git rev-parse --short HEAD)
-TARBALL_PREFIX := cri-containerd
-TARBALL := $(TARBALL_PREFIX)-$(VERSION).$(GOOS)-$(GOARCH).tar.gz
-ifneq ($(GOOS),windows)
- BUILD_TAGS := seccomp apparmor selinux
-endif
-export BUILDTAGS := $(BUILD_TAGS)
-# Add `-TEST` suffix to indicate that all binaries built from this repo are for test.
-GO_LDFLAGS := -X $(PROJECT)/vendor/github.com/containerd/containerd/version.Version=$(VERSION)-TEST
-SOURCES := $(shell find cmd/ pkg/ vendor/ -name '*.go')
-PLUGIN_SOURCES := $(shell ls *.go)
-INTEGRATION_SOURCES := $(shell find integration/ -name '*.go')
-
-CONTAINERD_BIN := containerd
-ifeq ($(GOOS),windows)
- CONTAINERD_BIN := $(CONTAINERD_BIN).exe
-endif
-
-all: binaries
-
-help: ## this help
- @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9._-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort
-
-verify: lint gofmt check-vendor ## execute the source code verification tools
-
-version: ## print current cri plugin release version
- @echo $(VERSION)
-
-lint:
- @echo "$(WHALE) $@"
- golangci-lint run
-
-gofmt:
- @echo "$(WHALE) $@"
- @./hack/verify-gofmt.sh
-
-check-vendor:
- @echo "$(WHALE) $@"
- @./hack/verify-vendor.sh
-
-.PHONY: sort-vendor sync-vendor update-vendor
-
-sort-vendor:
- @echo "$(WHALE) $@"
- @./hack/sort-vendor.sh
-
-sync-vendor:
- @echo "$(WHALE) $@ from containerd"
- @./hack/sync-vendor.sh
-
-update-vendor: sync-vendor sort-vendor ## Syncs containerd/vendor.conf -> vendor.conf and sorts vendor.conf
- @echo "$(WHALE) $@"
-
-$(BUILD_DIR)/$(CONTAINERD_BIN): $(SOURCES) $(PLUGIN_SOURCES)
- @echo "$(WHALE) $@"
- $(GO) build -o $@ \
- -tags '$(BUILD_TAGS)' \
- -ldflags '$(GO_LDFLAGS)' \
- -gcflags '$(GO_GCFLAGS)' \
- $(PROJECT)/cmd/containerd
-
-test: ## unit test
- @echo "$(WHALE) $@"
- $(GO) test -timeout=10m -race ./pkg/... \
- -tags '$(BUILD_TAGS)' \
- -ldflags '$(GO_LDFLAGS)' \
- -gcflags '$(GO_GCFLAGS)'
-
-$(BUILD_DIR)/integration.test: $(INTEGRATION_SOURCES)
- @echo "$(WHALE) $@"
- $(GO) test -c $(PROJECT)/integration -o $(BUILD_DIR)/integration.test
-
-test-integration: $(BUILD_DIR)/integration.test binaries ## integration test
- @echo "$(WHALE) $@"
- @./hack/test-integration.sh
-
-test-cri: binaries ## critools CRI validation test
- @echo "$(WHALE) $@"
- @./hack/test-cri.sh
-
-test-e2e-node: binaries ## e2e node test
- @echo "$(WHALE) $@"
- @VERSION=$(VERSION) ./hack/test-e2e-node.sh
-
-clean: ## cleanup binaries
- @echo "$(WHALE) $@"
- @rm -rf $(BUILD_DIR)/*
-
-binaries: $(BUILD_DIR)/$(CONTAINERD_BIN) ## build a customized containerd (same result as make containerd)
- @echo "$(WHALE) $@"
-
-static-binaries: GO_LDFLAGS += -extldflags "-fno-PIC -static"
-static-binaries: $(BUILD_DIR)/$(CONTAINERD_BIN) ## build static containerd
- @echo "$(WHALE) $@"
-
-containerd: $(BUILD_DIR)/$(CONTAINERD_BIN) ## build a customized containerd with CRI plugin for testing
- @echo "$(WHALE) $@"
-
-install-containerd: containerd ## installs customized containerd to system location
- @echo "$(WHALE) $@"
- @install -D -m 755 $(BUILD_DIR)/$(CONTAINERD_BIN) "$(BINDIR)/$(CONTAINERD_BIN)"
-
-install: install-containerd ## installs customized containerd to system location
- @echo "$(WHALE) $@"
-
-uninstall: ## remove containerd from system location
- @echo "$(WHALE) $@"
- @rm -f "$(BINDIR)/$(CONTAINERD_BIN)"
-
-ifeq ($(GOOS),windows)
-$(BUILD_DIR)/$(TARBALL): static-binaries vendor.conf
- @BUILD_DIR=$(BUILD_DIR) TARBALL=$(TARBALL) VERSION=$(VERSION) ./hack/release-windows.sh
-else
-$(BUILD_DIR)/$(TARBALL): static-binaries vendor.conf
- @BUILD_DIR=$(BUILD_DIR) TARBALL=$(TARBALL) VERSION=$(VERSION) ./hack/release.sh
-endif
-
-release: $(BUILD_DIR)/$(TARBALL) ## build release tarball
-
-push: $(BUILD_DIR)/$(TARBALL) ## push release tarball to GCS
- @echo "$(WHALE) $@"
- @BUILD_DIR=$(BUILD_DIR) TARBALL=$(TARBALL) VERSION=$(VERSION) ./hack/push.sh
-
-proto: ## update protobuf of the cri plugin api
- @echo "$(WHALE) $@"
- @API_PATH=pkg/api/v1 hack/update-proto.sh
- @API_PATH=pkg/api/runtimeoptions/v1 hack/update-proto.sh
-
-.PHONY: install.deps .install.deps.linux .install.deps.windows
-
-ifeq ($(GOOS),windows)
-install.deps: .install.deps.windows ## install windows deps on windows
-else
-install.deps: .install.deps.linux ## install windows deps on linux
-endif
-
-.install.deps.linux: ## install dependencies of cri
- @echo "$(WHALE) $@"
- @./hack/install/install-deps.sh
-
-.install.deps.windows: ## install dependencies of cri on windows
- @echo "$(WHALE) $@"
- @./hack/install/windows/install-deps.sh
-
-.PHONY: .gitvalidation
-# make .gitvalidation is only used localy for manual testing
-# requires a clone of github.com/containerd/project
-# containerd/project DCO validation runs automatically with github actions in ci.yml for each pull
-.gitvalidation:
- @echo "$(WHALE) $@"
- DCO_VERBOSITY=-v DCO_RANGE=$(EPOCH_TEST_COMMIT)..HEAD ../project/script/validate/dco
-
-.PHONY: install.tools .install.gitvalidation .install.golangci-lint .install.vndr
-
-install.tools: .install.gitvalidation .install.golangci-lint .install.vndr ## install tools used by verify
- @echo "$(WHALE) $@"
-
-.install.gitvalidation:
- @echo "$(WHALE) $@"
- $(GO) get -u github.com/vbatts/git-validation
-
-.install.golangci-lint:
- @echo "$(WHALE) $@"
- $(GO) get -d github.com/golangci/golangci-lint/cmd/golangci-lint
- @cd $(GOPATH)/src/github.com/golangci/golangci-lint/cmd/golangci-lint; \
- git checkout v1.18.0; \
- go install
-
-.install.vndr:
- @echo "$(WHALE) $@"
- $(GO) get -u github.com/LK4D4/vndr
-
-.PHONY: \
- binaries \
- static-binaries \
- containerd \
- install-containerd \
- release \
- push \
- clean \
- default \
- gofmt \
- help \
- install \
- lint \
- test \
- test-integration \
- test-cri \
- test-e2e-node \
- uninstall \
- version \
- proto \
- check-vendor
diff --git a/OWNERS b/OWNERS
deleted file mode 100644
index 7e0740419..000000000
--- a/OWNERS
+++ /dev/null
@@ -1,15 +0,0 @@
-# cri approvers and reviewers
-#
-# As a containerd sub-project, containerd maintainers are also included from https://github.com/containerd/project/blob/master/MAINTAINERS.
-# See https://github.com/containerd/project/blob/master/GOVERNANCE.md for description of maintainer role
-#
-approvers:
- - Random-Liu
- - mikebrow
- - abhi
-reviewers:
- - Random-Liu
- - mikebrow
- - abhi
- - yanxuean
- - miaoyq
diff --git a/README.md b/README.md
deleted file mode 100644
index 9f80a26a1..000000000
--- a/README.md
+++ /dev/null
@@ -1,189 +0,0 @@
-# cri
-
-
-
-
-
-*Note: The standalone `cri-containerd` binary is end-of-life. `cri-containerd` is
-transitioning from a standalone binary that talks to containerd to a plugin within
-containerd. This github branch is for the `cri` plugin. See
-[standalone-cri-containerd branch](https://github.com/containerd/cri/tree/standalone-cri-containerd)
-for information about the standalone version of `cri-containerd`.*
-
-*Note: You need to [drain your node](https://kubernetes.io/docs/tasks/administer-cluster/safely-drain-node/) before upgrading from standalone `cri-containerd` to containerd with `cri` plugin.*
-
-[](https://travis-ci.org/containerd/cri)
-[](https://goreportcard.com/report/github.com/containerd/cri)
-
-`cri` is a [containerd](https://containerd.io/) plugin implementation of Kubernetes [container runtime interface (CRI)](https://github.com/kubernetes/cri-api/blob/master/pkg/apis/runtime/v1alpha2/api.proto).
-
-With it, you could run Kubernetes using containerd as the container runtime.
-
-## Current Status
-`cri` is a native plugin of containerd 1.1 and above. It is built into containerd and enabled by default.
-
-`cri` is in GA:
-* It is feature complete.
-* It (the GA version) works with Kubernetes 1.10 and above.
-* It has passed all [CRI validation tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-node/cri-validation.md).
-* It has passed all [node e2e tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-node/e2e-node-tests.md).
-* It has passed all [e2e tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-testing/e2e-tests.md).
-
-See [test dashboard](https://k8s-testgrid.appspot.com/sig-node-containerd)
-## Support Metrics
-| CRI-Containerd Version | Containerd Version | Kubernetes Version | CRI Version |
-|:----------------------:|:------------------:|:------------------:|:-----------:|
-| v1.0.0-alpha.x | | 1.7, 1.8 | v1alpha1 |
-| v1.0.0-beta.x | | 1.9 | v1alpha1 |
-| End-Of-Life | v1.1 (End-Of-Life) | 1.10+ | v1alpha2 |
-| | v1.2 (Extended) | 1.10+ | v1alpha2 |
-| | v1.3 | 1.12+ | v1alpha2 |
-| | v1.4 | 1.19+ (rc) | v1alpha2 |
-
-**Note:** The support table above specifies the Kubernetes Version that was supported at time of release of the containerd - cri integration.
-
-The following is the current support table for containerd CRI integration taking into account that Kubernetes only supports n-3 minor release versions.
-
-| Containerd Version | Kubernetes Version | CRI Version |
-|:------------------:|:------------------:|:-----------:|
-| v1.2 | 1.15+ | v1alpha2 |
-| v1.3 | 1.15+ | v1alpha2 |
-| v1.4 | 1.19+ (rc) | v1alpha2 |
-
-## Production Quality Cluster on GCE
-For a production quality cluster on GCE brought up with `kube-up.sh` refer [here](docs/kube-up.md).
-## Installing with Ansible and Kubeadm
-For a multi node cluster installer and bring up steps using ansible and kubeadm refer [here](contrib/ansible/README.md).
-## Custom Installation
-For non ansible users, you can download the `cri-containerd` release tarball and deploy
-kubernetes cluster using kubeadm as described [here](docs/installation.md).
-## Getting Started for Developers
-### Binary Dependencies and Specifications
-The current release of the `cri` plugin has the following dependencies:
-* [containerd](https://github.com/containerd/containerd)
-* [runc](https://github.com/opencontainers/runc)
-* [CNI](https://github.com/containernetworking/cni)
-
-See [versions](./vendor.conf) of these dependencies `cri` is tested with.
-
-As containerd and runc move to their respective general availability releases,
-we will do our best to rebase/retest `cri` with these releases on a
-weekly/monthly basis. Similarly, given that `cri` uses the Open
-Container Initiative (OCI) [image](https://github.com/opencontainers/image-spec)
-and [runtime](https://github.com/opencontainers/runtime-spec) specifications, we
-will also do our best to update `cri` to the latest releases of these
-specifications as appropriate.
-### Install Dependencies
-1. Install development libraries:
-* **libseccomp development library.** Required by `cri` and runc seccomp support. `libseccomp-dev` (Ubuntu, Debian) / `libseccomp-devel`
-(Fedora, CentOS, RHEL). On releases of Ubuntu <=Trusty and Debian <=jessie a
-backport version of `libseccomp-dev` is required. See [travis.yml](.travis.yml) for an example on trusty.
-* **btrfs development library.** Required by containerd btrfs support. `btrfs-tools`(Ubuntu, Debian) / `btrfs-progs-devel`(Fedora, CentOS, RHEL)
-2. Install **`pkg-config`** (required for linking with `libseccomp`).
-3. Install and setup a Go 1.13.15 development environment.
-4. Make a local clone of this repository.
-5. Install binary dependencies by running the following command from your cloned `cri/` project directory:
-```bash
-# Note: install.deps installs the above mentioned runc, containerd, and CNI
-# binary dependencies. install.deps is only provided for general use and ease of
-# testing. To customize `runc` and `containerd` build tags and/or to configure
-# `cni`, please follow instructions in their documents.
-make install.deps
-```
-### Build and Install `cri`
-To build and install a version of containerd with the `cri` plugin, enter the
-following commands from your `cri` project directory:
-```bash
-make
-sudo make install
-```
-*NOTE: The version of containerd built and installed from the `Makefile` is only for
-testing purposes. The version tag carries the suffix "-TEST".*
-#### Build Tags
-`cri` supports optional build tags for compiling support of various features.
-To add build tags to the make option the `BUILD_TAGS` variable must be set.
-
-```bash
-make BUILD_TAGS='seccomp apparmor selinux'
-```
-
-| Build Tag | Feature | Dependency |
-|-----------|------------------------------------|---------------------------------|
-| seccomp | syscall filtering | libseccomp development library |
-| selinux | selinux process and mount labeling | |
-| apparmor | apparmor profile support | |
-### Validate Your `cri` Setup
-A Kubernetes incubator project called [cri-tools](https://github.com/kubernetes-sigs/cri-tools)
-includes programs for exercising CRI implementations such as the `cri` plugin.
-More importantly, cri-tools includes the program `critest` which is used for running
-[CRI Validation Testing](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-node/cri-validation.md).
-
-Run the CRI Validation test to validate your installation of `containerd` with `cri` built in:
-```bash
-make test-cri
-```
-### Running a Kubernetes local cluster
-If you already have a working development environment for supported Kubernetes
-version, you can try `cri` in a local cluster:
-
-1. Start the version of `containerd` with `cri` plugin that you built and installed
-above as root in a first terminal:
-```bash
-sudo containerd
-```
-2. From the Kubernetes project directory startup a local cluster using `containerd`:
-```bash
-CONTAINER_RUNTIME=remote CONTAINER_RUNTIME_ENDPOINT='unix:///run/containerd/containerd.sock' ./hack/local-up-cluster.sh
-```
-### Test
-See [here](./docs/testing.md) for information about test.
-## Using crictl
-See [here](./docs/crictl.md) for information about using `crictl` to debug
-pods, containers, and images.
-## Configurations
-See [here](./docs/config.md) for information about how to configure cri plugins
-and [here](https://github.com/containerd/containerd/blob/master/docs/man/containerd-config.8.md)
-for information about how to configure containerd
-## Documentation
-See [here](./docs) for additional documentation.
-## Communication
-For async communication and long running discussions please use issues and pull
-requests on this github repo. This will be the best place to discuss design and
-implementation.
-
-For sync communication catch us in the `#containerd` and `#containerd-dev` slack
-channels on Cloud Native Computing Foundation's (CNCF) slack -
-`cloud-native.slack.com`. Everyone is welcome to join and chat.
-[Get Invite to CNCF slack.](https://slack.cncf.io)
-
-## Other Communications
-As this project is tightly coupled to CRI and CRI-Tools and they are Kubernetes
-projects, some of our project communications take place in the Kubernetes' SIG:
-`sig-node.`
-
-For more information about `sig-node`, `CRI`, and the `CRI-Tools` projects:
-* [sig-node community site](https://github.com/kubernetes/community/tree/master/sig-node)
-* Slack: `#sig-node` channel in Kubernetes (kubernetes.slack.com)
-* Mailing List: https://groups.google.com/forum/#!forum/kubernetes-sig-node
-
-### Reporting Security Issues
-
-__If you are reporting a security issue, please reach out discreetly at security@containerd.io__.
-
-## Licenses
-The containerd codebase is released under the [Apache 2.0 license](https://github.com/containerd/containerd/blob/master/LICENSE.code).
-The README.md file, and files in the "docs" folder are licensed under the
-Creative Commons Attribution 4.0 International License under the terms and
-conditions set forth in the file "[LICENSE.docs](https://github.com/containerd/containerd/blob/master/LICENSE.docs)". You may obtain a duplicate
-copy of the same license, titled CC-BY-4.0, at http://creativecommons.org/licenses/by/4.0/.
-
-## Project details
-cri is a containerd sub-project. This project was originally established in
-April of 2017 in the Kubernetes Incubator program. After reaching the Beta
-stage, In January of 2018, the project was merged into [containerd](https://github.com/containerd/containerd).
-As a containerd sub-project, you will find the:
-* [Project governance](https://github.com/containerd/project/blob/master/GOVERNANCE.md),
-* [Maintainers](https://github.com/containerd/project/blob/master/MAINTAINERS),
-* and [Contributing guidelines](https://github.com/containerd/project/blob/master/CONTRIBUTING.md)
-
-information in our [`containerd/project`](https://github.com/containerd/project) repository.
diff --git a/cluster/gce/cloud-init/master.yaml b/cluster/gce/cloud-init/master.yaml
deleted file mode 100644
index 35c869c5b..000000000
--- a/cluster/gce/cloud-init/master.yaml
+++ /dev/null
@@ -1,199 +0,0 @@
-#cloud-config
-
-users:
-- name: etcd
- homedir: /var/etcd
- lock_passwd: true
- ssh_redirect_user: true
-
-write_files:
-# Setup containerd.
- - path: /etc/systemd/system/containerd-installation.service
- permissions: 0644
- owner: root
- content: |
- # installed by cloud-init
- [Unit]
- Description=Download and install containerd binaries and configurations.
- After=network-online.target
-
- [Service]
- Type=oneshot
- RemainAfterExit=yes
- ExecStartPre=/bin/mkdir -p /home/containerd
- ExecStartPre=/bin/mount --bind /home/containerd /home/containerd
- ExecStartPre=/bin/mount -o remount,exec /home/containerd
- ExecStartPre=/usr/bin/curl --fail --retry 5 --retry-delay 3 --silent --show-error -H "X-Google-Metadata-Request: True" -o /home/containerd/configure.sh http://metadata.google.internal/computeMetadata/v1/instance/attributes/containerd-configure-sh
- ExecStartPre=/bin/chmod 544 /home/containerd/configure.sh
- ExecStart=/home/containerd/configure.sh
-
- [Install]
- WantedBy=containerd.target
-
- - path: /etc/systemd/system/containerd.service
- permissions: 0644
- owner: root
- content: |
- # installed by cloud-init
- [Unit]
- Description=containerd container runtime
- Documentation=https://containerd.io
- After=containerd-installation.service
-
- [Service]
- Restart=always
- RestartSec=5
- Delegate=yes
- KillMode=process
- OOMScoreAdjust=-999
- LimitNOFILE=1048576
- # Having non-zero Limit*s causes performance problems due to accounting overhead
- # in the kernel. We recommend using cgroups to do container-local accounting.
- LimitNPROC=infinity
- LimitCORE=infinity
- TasksMax=infinity
- ExecStartPre=/sbin/modprobe overlay
- ExecStart=/home/containerd/usr/local/bin/containerd
-
- [Install]
- WantedBy=containerd.target
-
- - path: /etc/systemd/system/containerd.target
- permissions: 0644
- owner: root
- content: |
- [Unit]
- Description=Containerd
-
- [Install]
- WantedBy=kubernetes.target
-
-# Setup kubernetes.
- - path: /etc/systemd/system/kube-master-installation.service
- permissions: 0644
- owner: root
- content: |
- [Unit]
- Description=Download and install k8s binaries and configurations
- After=network-online.target
-
- [Service]
- Type=oneshot
- RemainAfterExit=yes
- ExecStartPre=/bin/mkdir -p /home/kubernetes/bin
- ExecStartPre=/bin/mount --bind /home/kubernetes/bin /home/kubernetes/bin
- ExecStartPre=/bin/mount -o remount,exec /home/kubernetes/bin
- ExecStartPre=/usr/bin/curl --fail --retry 5 --retry-delay 3 --silent --show-error -H "X-Google-Metadata-Request: True" -o /home/kubernetes/bin/configure.sh http://metadata.google.internal/computeMetadata/v1/instance/attributes/configure-sh
- ExecStartPre=/bin/chmod 544 /home/kubernetes/bin/configure.sh
- ExecStart=/home/kubernetes/bin/configure.sh
-
- [Install]
- WantedBy=kubernetes.target
-
- - path: /etc/systemd/system/kube-master-configuration.service
- permissions: 0644
- owner: root
- content: |
- [Unit]
- Description=Configure kubernetes master
- After=kube-master-installation.service
-
- [Service]
- Type=oneshot
- RemainAfterExit=yes
- ExecStartPre=/bin/chmod 544 /home/kubernetes/bin/configure-helper.sh
- ExecStart=/home/kubernetes/bin/configure-helper.sh
-
- [Install]
- WantedBy=kubernetes.target
-
- - path: /etc/systemd/system/kube-container-runtime-monitor.service
- permissions: 0644
- owner: root
- content: |
- [Unit]
- Description=Kubernetes health monitoring for container runtime
- After=kube-master-configuration.service
- [Service]
- Restart=always
- RestartSec=10
- RemainAfterExit=yes
- RemainAfterExit=yes
- ExecStartPre=/bin/chmod 544 /home/kubernetes/bin/health-monitor.sh
- ExecStart=/home/kubernetes/bin/health-monitor.sh container-runtime
- [Install]
- WantedBy=kubernetes.target
-
- - path: /etc/systemd/system/kubelet-monitor.service
- permissions: 0644
- owner: root
- content: |
- [Unit]
- Description=Kubernetes health monitoring for kubelet
- After=kube-master-configuration.service
-
- [Service]
- Restart=always
- RestartSec=10
- RemainAfterExit=yes
- ExecStartPre=/bin/chmod 544 /home/kubernetes/bin/health-monitor.sh
- ExecStart=/home/kubernetes/bin/health-monitor.sh kubelet
-
- [Install]
- WantedBy=kubernetes.target
-
- - path: /etc/systemd/system/kube-logrotate.timer
- permissions: 0644
- owner: root
- content: |
- [Unit]
- Description=Hourly kube-logrotate invocation
-
- [Timer]
- OnCalendar=hourly
-
- [Install]
- WantedBy=kubernetes.target
-
- - path: /etc/systemd/system/kube-logrotate.service
- permissions: 0644
- owner: root
- content: |
- [Unit]
- Description=Kubernetes log rotation
- After=kube-master-configuration.service
-
- [Service]
- Type=oneshot
- ExecStart=-/usr/sbin/logrotate /etc/logrotate.conf
-
- [Install]
- WantedBy=kubernetes.target
-
- - path: /etc/systemd/system/kubernetes.target
- permissions: 0644
- owner: root
- content: |
- [Unit]
- Description=Kubernetes
-
- [Install]
- WantedBy=multi-user.target
-
-runcmd:
- # Stop the existing containerd service if there is one. (for Docker 18.09+)
- - systemctl is-active containerd && systemctl stop containerd
- - systemctl daemon-reload
- - systemctl enable containerd-installation.service
- - systemctl enable containerd.service
- - systemctl enable containerd.target
- - systemctl enable kube-master-installation.service
- - systemctl enable kube-master-configuration.service
- - systemctl enable kubelet-monitor.service
- - systemctl enable kube-container-runtime-monitor.service
- - systemctl enable kube-logrotate.timer
- - systemctl enable kube-logrotate.service
- - systemctl enable kubernetes.target
- - systemctl start kubernetes.target
- # Start docker after containerd is running. (for Docker 18.09+)
- - systemctl is-enabled docker && (systemctl is-active docker || systemctl start docker)
diff --git a/cluster/gce/cloud-init/node.yaml b/cluster/gce/cloud-init/node.yaml
deleted file mode 100644
index 97d7ad429..000000000
--- a/cluster/gce/cloud-init/node.yaml
+++ /dev/null
@@ -1,193 +0,0 @@
-#cloud-config
-
-write_files:
-# Setup containerd.
- - path: /etc/systemd/system/containerd-installation.service
- permissions: 0644
- owner: root
- content: |
- # installed by cloud-init
- [Unit]
- Description=Download and install containerd binaries and configurations.
- After=network-online.target
-
- [Service]
- Type=oneshot
- RemainAfterExit=yes
- ExecStartPre=/bin/mkdir -p /home/containerd
- ExecStartPre=/bin/mount --bind /home/containerd /home/containerd
- ExecStartPre=/bin/mount -o remount,exec /home/containerd
- ExecStartPre=/usr/bin/curl --fail --retry 5 --retry-delay 3 --silent --show-error -H "X-Google-Metadata-Request: True" -o /home/containerd/configure.sh http://metadata.google.internal/computeMetadata/v1/instance/attributes/containerd-configure-sh
- ExecStartPre=/bin/chmod 544 /home/containerd/configure.sh
- ExecStart=/home/containerd/configure.sh
-
- [Install]
- WantedBy=containerd.target
-
- - path: /etc/systemd/system/containerd.service
- permissions: 0644
- owner: root
- content: |
- # installed by cloud-init
- [Unit]
- Description=containerd container runtime
- Documentation=https://containerd.io
- After=containerd-installation.service
-
- [Service]
- Restart=always
- RestartSec=5
- Delegate=yes
- KillMode=process
- OOMScoreAdjust=-999
- LimitNOFILE=1048576
- # Having non-zero Limit*s causes performance problems due to accounting overhead
- # in the kernel. We recommend using cgroups to do container-local accounting.
- LimitNPROC=infinity
- LimitCORE=infinity
- TasksMax=infinity
- ExecStartPre=/sbin/modprobe overlay
- ExecStart=/home/containerd/usr/local/bin/containerd
-
- [Install]
- WantedBy=containerd.target
-
- - path: /etc/systemd/system/containerd.target
- permissions: 0644
- owner: root
- content: |
- [Unit]
- Description=Containerd
-
- [Install]
- WantedBy=kubernetes.target
-
-# Setup kubernetes.
- - path: /etc/systemd/system/kube-node-installation.service
- permissions: 0644
- owner: root
- content: |
- [Unit]
- Description=Download and install k8s binaries and configurations
- After=network-online.target
-
- [Service]
- Type=oneshot
- RemainAfterExit=yes
- ExecStartPre=/bin/mkdir -p /home/kubernetes/bin
- ExecStartPre=/bin/mount --bind /home/kubernetes/bin /home/kubernetes/bin
- ExecStartPre=/bin/mount -o remount,exec /home/kubernetes/bin
- ExecStartPre=/usr/bin/curl --fail --retry 5 --retry-delay 3 --silent --show-error -H "X-Google-Metadata-Request: True" -o /home/kubernetes/bin/configure.sh http://metadata.google.internal/computeMetadata/v1/instance/attributes/configure-sh
- ExecStartPre=/bin/chmod 544 /home/kubernetes/bin/configure.sh
- ExecStart=/home/kubernetes/bin/configure.sh
-
- [Install]
- WantedBy=kubernetes.target
-
- - path: /etc/systemd/system/kube-node-configuration.service
- permissions: 0644
- owner: root
- content: |
- [Unit]
- Description=Configure kubernetes node
- After=kube-node-installation.service
-
- [Service]
- Type=oneshot
- RemainAfterExit=yes
- ExecStartPre=/bin/chmod 544 /home/kubernetes/bin/configure-helper.sh
- ExecStart=/home/kubernetes/bin/configure-helper.sh
-
- [Install]
- WantedBy=kubernetes.target
-
- - path: /etc/systemd/system/kube-container-runtime-monitor.service
- permissions: 0644
- owner: root
- content: |
- [Unit]
- Description=Kubernetes health monitoring for container runtime
- After=kube-node-configuration.service
- [Service]
- Restart=always
- RestartSec=10
- RemainAfterExit=yes
- RemainAfterExit=yes
- ExecStartPre=/bin/chmod 544 /home/kubernetes/bin/health-monitor.sh
- ExecStart=/home/kubernetes/bin/health-monitor.sh container-runtime
- [Install]
- WantedBy=kubernetes.target
-
- - path: /etc/systemd/system/kubelet-monitor.service
- permissions: 0644
- owner: root
- content: |
- [Unit]
- Description=Kubernetes health monitoring for kubelet
- After=kube-node-configuration.service
-
- [Service]
- Restart=always
- RestartSec=10
- RemainAfterExit=yes
- ExecStartPre=/bin/chmod 544 /home/kubernetes/bin/health-monitor.sh
- ExecStart=/home/kubernetes/bin/health-monitor.sh kubelet
-
- [Install]
- WantedBy=kubernetes.target
-
- - path: /etc/systemd/system/kube-logrotate.timer
- permissions: 0644
- owner: root
- content: |
- [Unit]
- Description=Hourly kube-logrotate invocation
-
- [Timer]
- OnCalendar=hourly
-
- [Install]
- WantedBy=kubernetes.target
-
- - path: /etc/systemd/system/kube-logrotate.service
- permissions: 0644
- owner: root
- content: |
- [Unit]
- Description=Kubernetes log rotation
- After=kube-node-configuration.service
-
- [Service]
- Type=oneshot
- ExecStart=-/usr/sbin/logrotate /etc/logrotate.conf
-
- [Install]
- WantedBy=kubernetes.target
-
- - path: /etc/systemd/system/kubernetes.target
- permissions: 0644
- owner: root
- content: |
- [Unit]
- Description=Kubernetes
-
- [Install]
- WantedBy=multi-user.target
-
-runcmd:
- # Stop the existing containerd service if there is one. (for Docker 18.09+)
- - systemctl is-active containerd && systemctl stop containerd
- - systemctl daemon-reload
- - systemctl enable containerd-installation.service
- - systemctl enable containerd.service
- - systemctl enable containerd.target
- - systemctl enable kube-node-installation.service
- - systemctl enable kube-node-configuration.service
- - systemctl enable kubelet-monitor.service
- - systemctl enable kube-container-runtime-monitor.service
- - systemctl enable kube-logrotate.timer
- - systemctl enable kube-logrotate.service
- - systemctl enable kubernetes.target
- - systemctl start kubernetes.target
- # Start docker after containerd is running. (for Docker 18.09+)
- - systemctl is-enabled docker && (systemctl is-active docker || systemctl start docker)
diff --git a/cluster/gce/cni.template b/cluster/gce/cni.template
deleted file mode 100644
index c8c0d7f52..000000000
--- a/cluster/gce/cni.template
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "name": "k8s-pod-network",
- "cniVersion": "0.3.1",
- "plugins": [
- {
- "type": "ptp",
- "mtu": 1460,
- "ipam": {
- "type": "host-local",
- "ranges": [{{range $i, $range := .PodCIDRRanges}}{{if $i}}, {{end}}[{"subnet": "{{$range}}"}]{{end}}],
- "routes": [{{range $i, $route := .Routes}}{{if $i}}, {{end}}{"dst": "{{$route}}"}{{end}}]
- }
- },
- {
- "type": "portmap",
- "capabilities": {
- "portMappings": true
- }
- }
- ]
-}
diff --git a/cluster/gce/configure.sh b/cluster/gce/configure.sh
deleted file mode 100755
index 33528a9b8..000000000
--- a/cluster/gce/configure.sh
+++ /dev/null
@@ -1,235 +0,0 @@
-#!/bin/bash
-
-# 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.
-
-set -o xtrace
-set -o errexit
-set -o nounset
-set -o pipefail
-
-if [[ "$(python -V 2>&1)" =~ "Python 2" ]]; then
- # found python2, just use that
- PYTHON="python"
-elif [[ -f "/usr/bin/python2.7" ]]; then
- # System python not defaulted to python 2 but using 2.7 during migration
- PYTHON="/usr/bin/python2.7"
-else
- # No python2 either by default, let's see if we can find python3
- PYTHON="python3"
- if ! command -v ${PYTHON} >/dev/null 2>&1; then
- echo "ERROR Python not found. Aborting."
- exit 2
- fi
-fi
-echo "Version : " $(${PYTHON} -V 2>&1)
-
-# CONTAINERD_HOME is the directory for containerd.
-CONTAINERD_HOME="/home/containerd"
-cd "${CONTAINERD_HOME}"
-# KUBE_HOME is the directory for kubernetes.
-KUBE_HOME="/home/kubernetes"
-
-# fetch_metadata fetches metadata from GCE metadata server.
-# Var set:
-# 1. Metadata key: key of the metadata.
-fetch_metadata() {
- local -r key=$1
- local -r attributes="http://metadata.google.internal/computeMetadata/v1/instance/attributes"
- if curl --fail --retry 5 --retry-delay 3 --silent --show-error -H "X-Google-Metadata-Request: True" "${attributes}/" | \
- grep -q "^${key}$"; then
- curl --fail --retry 5 --retry-delay 3 --silent --show-error -H "X-Google-Metadata-Request: True" \
- "${attributes}/${key}"
- fi
-}
-
-# fetch_env fetches environment variables from GCE metadata server
-# and generate a env file under ${CONTAINERD_HOME}. It assumes that
-# the environment variables in metadata are in yaml format.
-fetch_env() {
- local -r env_file_name=$1
- (
- umask 077;
- local -r tmp_env_file="/tmp/${env_file_name}.yaml"
- tmp_env_content=$(fetch_metadata "${env_file_name}")
- if [ -z "${tmp_env_content}" ]; then
- echo "No environment variable is specified in ${env_file_name}"
- return
- fi
- echo "${tmp_env_content}" > "${tmp_env_file}"
- # Convert the yaml format file into a shell-style file.
- eval $(${PYTHON} -c '''
-import pipes,sys,yaml
-if sys.version_info[0] < 3:
- items = yaml.load(sys.stdin).iteritems()
-else:
- items = yaml.load(sys.stdin, Loader=yaml.BaseLoader).items()
-for k,v in items:
- print("readonly {var}={value}".format(var = k, value = pipes.quote(str(v))))
-''' < "${tmp_env_file}" > "${CONTAINERD_HOME}/${env_file_name}")
- rm -f "${tmp_env_file}"
- )
-}
-
-# is_preloaded checks whether a package has been preloaded in the image.
-is_preloaded() {
- local -r tar=$1
- local -r sha1=$2
- grep -qs "${tar},${sha1}" "${KUBE_HOME}/preload_info"
-}
-
-# KUBE_ENV_METADATA is the metadata key for kubernetes envs.
-KUBE_ENV_METADATA="kube-env"
-fetch_env ${KUBE_ENV_METADATA}
-if [ -f "${CONTAINERD_HOME}/${KUBE_ENV_METADATA}" ]; then
- source "${CONTAINERD_HOME}/${KUBE_ENV_METADATA}"
-fi
-
-# CONTAINERD_ENV_METADATA is the metadata key for containerd envs.
-CONTAINERD_ENV_METADATA="containerd-env"
-fetch_env ${CONTAINERD_ENV_METADATA}
-if [ -f "${CONTAINERD_HOME}/${CONTAINERD_ENV_METADATA}" ]; then
- source "${CONTAINERD_HOME}/${CONTAINERD_ENV_METADATA}"
-fi
-
-# CONTAINERD_PKG_PREFIX is the prefix of the cri-containerd tarball name.
-# By default use the release tarball with cni built in.
-pkg_prefix=${CONTAINERD_PKG_PREFIX:-"cri-containerd-cni"}
-# Behave differently for test and production.
-if [ "${CONTAINERD_TEST:-"false"}" != "true" ]; then
- # CONTAINERD_DEPLOY_PATH is the gcs path where cri-containerd tarball is stored.
- deploy_path=${CONTAINERD_DEPLOY_PATH:-"cri-containerd-release"}
- # CONTAINERD_VERSION is the cri-containerd version to use.
- version=${CONTAINERD_VERSION:-""}
-else
- deploy_path=${CONTAINERD_DEPLOY_PATH:-"cri-containerd-staging"}
-
- # PULL_REFS_METADATA is the metadata key of PULL_REFS from prow.
- PULL_REFS_METADATA="PULL_REFS"
- pull_refs=$(fetch_metadata "${PULL_REFS_METADATA}")
- if [ ! -z "${pull_refs}" ]; then
- deploy_dir=$(echo "${pull_refs}" | sha1sum | awk '{print $1}')
- deploy_path="${deploy_path}/${deploy_dir}"
- fi
-
- # TODO(random-liu): Put version into the metadata instead of
- # deciding it in cloud init. This may cause issue to reboot test.
- version=$(curl -f --ipv4 --retry 6 --retry-delay 3 --silent --show-error \
- https://storage.googleapis.com/${deploy_path}/latest)
-fi
-
-TARBALL_GCS_NAME="${pkg_prefix}-${version}.linux-amd64.tar.gz"
-# TARBALL_GCS_PATH is the path to download cri-containerd tarball for node e2e.
-TARBALL_GCS_PATH="https://storage.googleapis.com/${deploy_path}/${TARBALL_GCS_NAME}"
-# TARBALL is the name of the tarball after being downloaded.
-TARBALL="cri-containerd.tar.gz"
-# CONTAINERD_TAR_SHA1 is the sha1sum of containerd tarball.
-tar_sha1="${CONTAINERD_TAR_SHA1:-""}"
-
-if [ -z "${version}" ]; then
- # Try using preloaded containerd if version is not specified.
- tarball_gcs_pattern="${pkg_prefix}-.*.linux-amd64.tar.gz"
- if is_preloaded "${tarball_gcs_pattern}" "${tar_sha1}"; then
- echo "CONTAINERD_VERSION is not set, use preloaded containerd"
- else
- echo "CONTAINERD_VERSION is not set, and containerd is not preloaded"
- exit 1
- fi
-else
- if is_preloaded "${TARBALL_GCS_NAME}" "${tar_sha1}"; then
- echo "${TARBALL_GCS_NAME} is preloaded"
- else
- # Download and untar the release tar ball.
- curl -f --ipv4 -Lo "${TARBALL}" --connect-timeout 20 --max-time 300 --retry 6 --retry-delay 10 "${TARBALL_GCS_PATH}"
- tar xvf "${TARBALL}"
- rm -f "${TARBALL}"
- fi
-fi
-
-# Remove crictl shipped with containerd, use crictl installed
-# by kube-up.sh.
-rm -f "${CONTAINERD_HOME}/usr/local/bin/crictl"
-rm -f "${CONTAINERD_HOME}/etc/crictl.yaml"
-
-# Generate containerd config
-config_path="${CONTAINERD_CONFIG_PATH:-"/etc/containerd/config.toml"}"
-mkdir -p $(dirname ${config_path})
-cni_bin_dir="${CONTAINERD_HOME}/opt/cni/bin"
-cni_template_path="${CONTAINERD_HOME}/opt/containerd/cluster/gce/cni.template"
-if [ "${KUBERNETES_MASTER:-}" != "true" ]; then
- if [ "${NETWORK_POLICY_PROVIDER:-"none"}" != "none" ] || [ "${ENABLE_NETD:-}" == "true" ]; then
- # Use Kubernetes cni daemonset on node if network policy provider is specified
- # or netd is enabled.
- cni_bin_dir="${KUBE_HOME}/bin"
- cni_template_path=""
- fi
-fi
-log_level="${CONTAINERD_LOG_LEVEL:-"info"}"
-max_container_log_line="${CONTAINERD_MAX_CONTAINER_LOG_LINE:-16384}"
-cat > ${config_path} <> ${config_path} < \
- /etc/profile.d/containerd_env.sh
-
-# Run extra init script for test.
-if [ "${CONTAINERD_TEST:-"false"}" == "true" ]; then
- # EXTRA_INIT_SCRIPT is the name of the extra init script after being downloaded.
- EXTRA_INIT_SCRIPT="containerd-extra-init.sh"
- # EXTRA_INIT_SCRIPT_METADATA is the metadata key of init script.
- EXTRA_INIT_SCRIPT_METADATA="containerd-extra-init-sh"
- extra_init=$(fetch_metadata "${EXTRA_INIT_SCRIPT_METADATA}")
- # Return if containerd-extra-init-sh is not set.
- if [ -z "${extra_init}" ]; then
- exit 0
- fi
- echo "${extra_init}" > "${EXTRA_INIT_SCRIPT}"
- chmod 544 "${EXTRA_INIT_SCRIPT}"
- ./${EXTRA_INIT_SCRIPT}
-fi
diff --git a/cluster/gce/env b/cluster/gce/env
deleted file mode 100644
index 3e3bb01f9..000000000
--- a/cluster/gce/env
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-GCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-
-# TODO(random-liu): Upload release tarball to user's own GCS, and use it. We should
-# not let all nodes of all users download tarball from cri-containerd-release.
-version_file=${GCE_DIR}/../version
-if [ ! -f "${version_file}" ]; then
- echo "version file does not exist"
- exit 1
-fi
-export KUBE_MASTER_EXTRA_METADATA="user-data=${GCE_DIR}/cloud-init/master.yaml,containerd-configure-sh=${GCE_DIR}/configure.sh,containerd-env=${version_file}"
-export KUBE_NODE_EXTRA_METADATA="user-data=${GCE_DIR}/cloud-init/node.yaml,containerd-configure-sh=${GCE_DIR}/configure.sh,containerd-env=${version_file}"
-export KUBE_CONTAINER_RUNTIME="remote"
-export KUBE_CONTAINER_RUNTIME_ENDPOINT="unix:///run/containerd/containerd.sock"
-export KUBE_CONTAINER_RUNTIME_NAME=containerd
-export KUBE_LOAD_IMAGE_COMMAND="/home/containerd/usr/local/bin/ctr -n=k8s.io images import"
-export NETWORK_PROVIDER=""
-export NON_MASQUERADE_CIDR="0.0.0.0/0"
-export KUBE_KUBELET_EXTRA_ARGS="--runtime-cgroups=/system.slice/containerd.service"
-export KUBE_FEATURE_GATES="ExperimentalCriticalPodAnnotation=true,CRIContainerLogRotation=true"
diff --git a/cmd/containerd/builtins_linux.go b/cmd/containerd/builtins_linux.go
deleted file mode 100644
index 9d1916d71..000000000
--- a/cmd/containerd/builtins_linux.go
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package main
-
-import (
- _ "github.com/containerd/containerd/metrics/cgroups"
- _ "github.com/containerd/containerd/runtime/v1/linux"
- _ "github.com/containerd/containerd/snapshots/overlay"
-)
diff --git a/cmd/containerd/builtins_windows.go b/cmd/containerd/builtins_windows.go
deleted file mode 100644
index 60414c795..000000000
--- a/cmd/containerd/builtins_windows.go
+++ /dev/null
@@ -1,25 +0,0 @@
-// +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 main
-
-import (
- _ "github.com/containerd/containerd/diff/lcow"
- _ "github.com/containerd/containerd/diff/windows"
- _ "github.com/containerd/containerd/snapshots/windows"
-)
diff --git a/cmd/containerd/containerd.go b/cmd/containerd/containerd.go
deleted file mode 100644
index 15b249914..000000000
--- a/cmd/containerd/containerd.go
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package main
-
-import (
- "fmt"
- "math/rand"
- "os"
- "time"
-
- _ "github.com/containerd/containerd/diff/walking/plugin"
- _ "github.com/containerd/containerd/gc/scheduler"
- _ "github.com/containerd/containerd/runtime/v2"
- _ "github.com/containerd/containerd/services/containers"
- _ "github.com/containerd/containerd/services/content"
- _ "github.com/containerd/containerd/services/diff"
- _ "github.com/containerd/containerd/services/events"
- _ "github.com/containerd/containerd/services/healthcheck"
- _ "github.com/containerd/containerd/services/images"
- _ "github.com/containerd/containerd/services/introspection"
- _ "github.com/containerd/containerd/services/leases"
- _ "github.com/containerd/containerd/services/namespaces"
- _ "github.com/containerd/containerd/services/snapshots"
- _ "github.com/containerd/containerd/services/tasks"
- _ "github.com/containerd/containerd/services/version"
- _ "github.com/containerd/cri"
-
- "github.com/containerd/containerd/cmd/containerd/command"
- "github.com/sirupsen/logrus"
-)
-
-func init() {
- rand.Seed(time.Now().UnixNano())
-}
-
-func main() {
- app := command.App()
- logrus.Warn("This customized containerd is only for CI test, DO NOT use it for distribution.")
- if err := app.Run(os.Args); err != nil {
- fmt.Fprintf(os.Stderr, "containerd: %s\n", err)
- os.Exit(1)
- }
-}
diff --git a/code-of-conduct.md b/code-of-conduct.md
deleted file mode 100644
index 8ec69aabf..000000000
--- a/code-of-conduct.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# Code of Conduct
-
-This project follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).
diff --git a/cri.go b/pkg/cri/cri.go
similarity index 100%
rename from cri.go
rename to pkg/cri/cri.go
diff --git a/test/build-utils.sh b/test/build-utils.sh
deleted file mode 100755
index 0f859d2b7..000000000
--- a/test/build-utils.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/bash
-
-# 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.
-
-ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/..
-
-# PROJECT is the gce project to upload tarball.
-PROJECT=${PROJECT:-"k8s-cri-containerd"}
-
-# GOOGLE_APPLICATION_CREDENTIALS is the path of service account file.
-if [ -z ${GOOGLE_APPLICATION_CREDENTIALS} ]; then
- echo "GOOGLE_APPLICATION_CREDENTIALS is not set"
- exit 1
-fi
-
-# Activate gcloud service account.
-gcloud auth activate-service-account --key-file "${GOOGLE_APPLICATION_CREDENTIALS}" --project="${PROJECT}"
-
-# Install dependent libraries.
-apt-get update
-if apt-cache show libbtrfs-dev > /dev/null; then
- apt-get install -y libbtrfs-dev
-else
- apt-get install -y btrfs-tools
-fi
-
-# Kubernetes test infra uses jessie and stretch.
-if cat /etc/os-release | grep jessie; then
- sh -c "echo 'deb http://ftp.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/backports.list"
- apt-get update
- apt-get install -y libseccomp2/jessie-backports
- apt-get install -y libseccomp-dev/jessie-backports
-else
- apt-get install -y libseccomp2
- apt-get install -y libseccomp-dev
-fi
-
-# PULL_REFS is from prow.
-if [ ! -z "${PULL_REFS:-""}" ]; then
- DEPLOY_DIR=$(echo "${PULL_REFS}" | sha1sum | awk '{print $1}')
-fi
diff --git a/test/build.sh b/test/build.sh
deleted file mode 100755
index d1129a6cd..000000000
--- a/test/build.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-
-# 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.
-
-# This script is used to build and upload containerd with latest CRI plugin
-# from containerd/cri in gcr.io/k8s-testimages/kubekins-e2e.
-
-set -o xtrace
-set -o errexit
-set -o nounset
-set -o pipefail
-
-source $(dirname "${BASH_SOURCE[0]}")/build-utils.sh
-cd "${ROOT}"
-
-# Make sure output directory is clean.
-make clean
-# Build and push test tarball.
-PUSH_VERSION=true DEPLOY_DIR=${DEPLOY_DIR:-""} \
- make push TARBALL_PREFIX=cri-containerd-cni INCLUDE_CNI=true CUSTOM_CONTAINERD=true
diff --git a/test/containerd/build.sh b/test/containerd/build.sh
deleted file mode 100755
index 90c6c673b..000000000
--- a/test/containerd/build.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/bash
-
-# 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.
-
-# This script is used to build and upload latest containerd from
-# containerd/containerd in gcr.io/k8s-testimages/kubekins-e2e.
-
-set -o xtrace
-set -o errexit
-set -o nounset
-set -o pipefail
-
-source $(dirname "${BASH_SOURCE[0]}")/../build-utils.sh
-cd "${ROOT}"
-
-if [ -z "${GOPATH}" ]; then
- echo "GOPATH is not set"
- exit 1
-fi
-
-CONTAINERD_PATH=${GOPATH}/src/github.com/containerd/containerd
-if [ ! -d "${CONTAINERD_PATH}" ]; then
- echo "containerd repo does not exist"
- exit 1
-fi
-
-# Make sure output directory is clean.
-make clean
-# Build and push test tarball.
-PUSH_VERSION=true DEPLOY_DIR=${DEPLOY_DIR:-"containerd"} \
- make push TARBALL_PREFIX=containerd-cni \
- INCLUDE_CNI=true \
- CHECKOUT_CONTAINERD=false \
- VENDOR=${CONTAINERD_PATH}/vendor.conf
diff --git a/test/e2e b/test/e2e
deleted file mode 120000
index 0df40b8da..000000000
--- a/test/e2e
+++ /dev/null
@@ -1 +0,0 @@
-../cluster/gce/cloud-init/
\ No newline at end of file
diff --git a/test/e2e_node/gci-init.sh b/test/e2e_node/gci-init.sh
deleted file mode 100755
index 2ca97ef97..000000000
--- a/test/e2e_node/gci-init.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/bash
-
-# 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.
-
-# This script is used to do extra initialization on GCI.
-
-mount /tmp /tmp -o remount,exec,suid
-#TODO(random-liu): Stop docker and remove this docker thing.
-usermod -a -G docker jenkins
-#TODO(random-liu): Change current node e2e to use init script,
-# so that we don't need to copy this code everywhere.
-mkdir -p /var/lib/kubelet
-mkdir -p /home/kubernetes/containerized_mounter/rootfs
-mount --bind /home/kubernetes/containerized_mounter/ /home/kubernetes/containerized_mounter/
-mount -o remount, exec /home/kubernetes/containerized_mounter/
-wget https://storage.googleapis.com/kubernetes-release/gci-mounter/mounter.tar -O /tmp/mounter.tar
-tar xvf /tmp/mounter.tar -C /home/kubernetes/containerized_mounter/rootfs
-mkdir -p /home/kubernetes/containerized_mounter/rootfs/var/lib/kubelet
-mount --rbind /var/lib/kubelet /home/kubernetes/containerized_mounter/rootfs/var/lib/kubelet
-mount --make-rshared /home/kubernetes/containerized_mounter/rootfs/var/lib/kubelet
-mount --bind /proc /home/kubernetes/containerized_mounter/rootfs/proc
-mount --bind /dev /home/kubernetes/containerized_mounter/rootfs/dev
-rm /tmp/mounter.tar
diff --git a/test/e2e_node/init.yaml b/test/e2e_node/init.yaml
deleted file mode 100644
index 480689fbd..000000000
--- a/test/e2e_node/init.yaml
+++ /dev/null
@@ -1,73 +0,0 @@
-#cloud-config
-
-write_files:
- - path: /etc/systemd/system/containerd-installation.service
- permissions: 0644
- owner: root
- content: |
- # installed by cloud-init
- [Unit]
- Description=Download and install containerd binaries and configurations.
- After=network-online.target
-
- [Service]
- Type=oneshot
- RemainAfterExit=yes
- ExecStartPre=/bin/mkdir -p /home/containerd
- ExecStartPre=/bin/mount --bind /home/containerd /home/containerd
- ExecStartPre=/bin/mount -o remount,exec /home/containerd
- ExecStartPre=/usr/bin/curl --fail --retry 5 --retry-delay 3 --silent --show-error -H "X-Google-Metadata-Request: True" -o /home/containerd/configure.sh http://metadata.google.internal/computeMetadata/v1/instance/attributes/containerd-configure-sh
- ExecStartPre=/bin/chmod 544 /home/containerd/configure.sh
- ExecStart=/home/containerd/configure.sh
-
- [Install]
- WantedBy=containerd.target
-
- - path: /etc/systemd/system/containerd.service
- permissions: 0644
- owner: root
- content: |
- # installed by cloud-init
- [Unit]
- Description=containerd container runtime
- Documentation=https://containerd.io
- After=containerd-installation.service
-
- [Service]
- Restart=always
- RestartSec=5
- Delegate=yes
- KillMode=process
- OOMScoreAdjust=-999
- LimitNOFILE=1048576
- # Having non-zero Limit*s causes performance problems due to accounting overhead
- # in the kernel. We recommend using cgroups to do container-local accounting.
- LimitNPROC=infinity
- LimitCORE=infinity
- TasksMax=infinity
- ExecStartPre=/sbin/modprobe overlay
- ExecStart=/home/containerd/usr/local/bin/containerd
-
- [Install]
- WantedBy=containerd.target
-
- - path: /etc/systemd/system/containerd.target
- permissions: 0644
- owner: root
- content: |
- [Unit]
- Description=Containerd
-
- [Install]
- WantedBy=multi-user.target
-
-runcmd:
- # Stop the existing containerd service if there is one. (for Docker 18.09+)
- - systemctl is-active containerd && systemctl stop containerd
- - systemctl daemon-reload
- - systemctl enable containerd-installation.service
- - systemctl enable containerd.service
- - systemctl enable containerd.target
- - systemctl start containerd.target
- # Start docker after containerd is running. (for Docker 18.09+)
- - systemctl is-active docker || systemctl start docker
diff --git a/test/verify.sh b/test/verify.sh
deleted file mode 100755
index aadbbca71..000000000
--- a/test/verify.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-
-# 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.
-
-# This script is used to build and upload cri-containerd in gcr.io/k8s-testimages/kubekins-e2e.
-
-set -o xtrace
-set -o errexit
-set -o nounset
-set -o pipefail
-
-ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/..
-cd "${ROOT}"
-
-make install.tools
-make verify
-GOOS=macos make verify
-GOOS=windows make verify
diff --git a/test/windows/build.sh b/test/windows/build.sh
deleted file mode 100755
index 8b39f1af3..000000000
--- a/test/windows/build.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-
-# 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.
-
-# This script is used to build and upload containerd with latest CRI plugin
-# from containerd/cri in gcr.io/k8s-testimages/kubekins-e2e.
-
-set -o xtrace
-set -o errexit
-set -o nounset
-set -o pipefail
-
-source $(dirname "${BASH_SOURCE[0]}")/../build-utils.sh
-cd "${ROOT}"
-
-# Make sure output directory is clean.
-GOOS=windows make clean
-# Build and push test tarball.
-PUSH_VERSION=true DEPLOY_DIR=${DEPLOY_DIR:-"windows"} GOOS=windows \
- make push TARBALL_PREFIX=cri-containerd-cni INCLUDE_CNI=true CUSTOM_CONTAINERD=true
diff --git a/test/windows/runner.sh b/test/windows/runner.sh
deleted file mode 100755
index 287ef3db3..000000000
--- a/test/windows/runner.sh
+++ /dev/null
@@ -1,128 +0,0 @@
-#!/bin/bash
-
-# 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.
-
-set -o errexit
-set -o nounset
-set -o pipefail
-set -o xtrace
-
-GCE_PROJECT="${GCE_PROJECT:-"cri-containerd-node-e2e"}"
-GCE_IMAGE="${GCE_IMAGE:-"windows-server-1809-dc-core-for-containers-v20190827"}"
-GCE_IMAGE_PROJECT="${GCE_IMAGE_PROJECT:-"windows-cloud"}"
-ZONE="${ZONE:-"us-west1-b"}"
-ARTIFACTS="${ARTIFACTS:-"/tmp/test-cri-windows/_artifacts"}"
-CLEANUP="${CLEANUP:-"true"}"
-
-root="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/../..
-script_path="${root}/test/windows"
-node_name="windows-cri-$(cat /proc/sys/kernel/random/uuid)"
-tempdir="$(mktemp -d)"
-
-# log logs the test logs.
-function log() {
- echo "$(date) $1"
-}
-
-function cleanup() {
- rm -rf "$tempdir"
- if [[ "$CLEANUP" == "true" ]]; then
- log "Delete the test instance"
- gcloud compute instances delete -q "${node_name}"
- fi
-}
-
-function retry_anyway() {
- retry_on_error 36 5 "" "$@"
-}
-
-function retry_on_permission_error() {
- retry_on_error 36 5 "Permission denied" "$@"
-}
-
-function retry_on_error() {
- local -r MAX_ATTEMPTS="$1"
- local -r SLEEP_PERIOD="$2"
- local -r ON_ERROR="$3"
- shift 3
- local attempts=1
- local -r stderr="$(mktemp -p "$tempdir")"
- until "$@" 2>"$stderr"; do
- cat "$stderr"
- (( attempts++ ))
- if [[ -n "$ON_ERROR" ]] && (! grep "$ON_ERROR" "$stderr" > /dev/null); then
- log "$* failed with unexpected error!"
- exit 1
- elif (( attempts > MAX_ATTEMPTS )); then
- log "$* failed, $MAX_ATTEMPTS retry exceeded!"
- exit 1
- else
- log "$* failed, retry in ${SLEEP_PERIOD} second..."
- fi
- sleep "${SLEEP_PERIOD}"
- done
- rm "$stderr"
-}
-
-gcloud config set compute/zone "${ZONE}"
-gcloud config set project "${GCE_PROJECT}"
-
-log "Create the test instance"
-gcloud compute instances create "${node_name}" --machine-type=n1-standard-2 \
- --image="${GCE_IMAGE}" --image-project="${GCE_IMAGE_PROJECT}" \
- --metadata-from-file=windows-startup-script-ps1="${script_path}/setup-ssh.ps1"
-trap cleanup EXIT
-
-ssh=(gcloud compute ssh --ssh-flag="-ServerAliveInterval=30")
-scp=(gcloud compute scp)
-log "Wait for ssh to be ready"
-retry_anyway "${ssh[@]}" "${node_name}" --command="echo ssh ready"
-
-log "Setup test environment in the test instance"
-retry_on_permission_error "${scp[@]}" "${script_path}/setup-vm.ps1" "${node_name}":"C:/setup-vm.ps1"
-retry_on_permission_error "${ssh[@]}" "${node_name}" --command="powershell /c C:/setup-vm.ps1"
-
-log "Reboot the test instance to refresh environment variables"
-retry_on_permission_error "${ssh[@]}" "${node_name}" --command="powershell /c Restart-Computer"
-
-log "Wait for ssh to be ready"
-retry_anyway "${ssh[@]}" "${node_name}" --command="echo ssh ready"
-
-log "Run test on the test instance"
-cri_tar="/tmp/cri.tar.gz"
-tar -zcf "${cri_tar}" -C "${root}" . --owner=0 --group=0
-retry_on_permission_error "${scp[@]}" "${script_path}/test.sh" "${node_name}":"C:/test.sh"
-retry_on_permission_error "${scp[@]}" "${cri_tar}" "${node_name}":"C:/cri.tar.gz"
-rm "${cri_tar}"
-# git-bash doesn't return test exit code, the command should
-# succeed. We'll collect test exit code from _artifacts/.
-retry_on_permission_error "${ssh[@]}" "${node_name}" --command='powershell /c "Start-Process -FilePath \"C:\Program Files\Git\git-bash.exe\" -ArgumentList \"-elc\",\"`\"/c/test.sh &> /c/test.log`\"\" -Wait"'
-
-log "Collect test logs"
-mkdir -p "${ARTIFACTS}"
-retry_on_permission_error "${scp[@]}" "${node_name}":"C:/test.log" "${ARTIFACTS}"
-retry_on_permission_error "${scp[@]}" --recurse "${node_name}":"C:/_artifacts/*" "${ARTIFACTS}"
-
-log "Test output:"
-
-# Make sure stdout is not in O_NONBLOCK mode.
-# See https://github.com/kubernetes/test-infra/issues/14938 for more details.
-python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); print(flags&os.O_NONBLOCK);'
-python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);'
-
-cat "${ARTIFACTS}/test.log"
-
-exit_code="$(cat "${ARTIFACTS}/exitcode")"
-exit "${exit_code}"
diff --git a/test/windows/setup-ssh.ps1 b/test/windows/setup-ssh.ps1
deleted file mode 100644
index 4efcf20db..000000000
--- a/test/windows/setup-ssh.ps1
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright The containerd Authors.
-
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-
-# http://www.apache.org/licenses/LICENSE-2.0
-
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
-$ProgressPreference = 'SilentlyContinue'
-$k8sversion = ("v1.16.0-beta.2")
-
-$url = ("https://raw.githubusercontent.com/kubernetes/kubernetes/$k8sversion/cluster/gce/windows/testonly/user-profile.psm1")
-Invoke-WebRequest $url -OutFile C:\user-profile.psm1
-
-$url = ("https://raw.githubusercontent.com/kubernetes/kubernetes/$k8sversion/cluster/gce/windows/common.psm1")
-Invoke-WebRequest $url -OutFile C:\common.psm1
-
-$url = ("https://raw.githubusercontent.com/kubernetes/kubernetes/$k8sversion/cluster/gce/windows/testonly/install-ssh.psm1")
-Invoke-WebRequest $url -OutFile C:\install-ssh.psm1
-
-Import-Module -Force C:\install-ssh.psm1
-
-InstallAndStart-OpenSsh
-
-StartProcess-WriteSshKeys
diff --git a/test/windows/setup-vm.ps1 b/test/windows/setup-vm.ps1
deleted file mode 100644
index bef350c35..000000000
--- a/test/windows/setup-vm.ps1
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright The containerd Authors.
-
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-
-# http://www.apache.org/licenses/LICENSE-2.0
-
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
-
-choco install -y --no-progress git
-
-choco install -y --no-progress golang
-
-choco install -y --no-progress make
-
-choco install -y --no-progress mingw
diff --git a/test/windows/test.sh b/test/windows/test.sh
deleted file mode 100755
index 369c4def4..000000000
--- a/test/windows/test.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/bash
-
-# 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.
-
-set -o errexit
-set -o nounset
-set -o pipefail
-
-export PATH="/c/Program Files/Containerd:$PATH"
-FOCUS="${FOCUS:-"Conformance"}"
-SKIP="${SKIP:-""}"
-REPORT_DIR="${REPORT_DIR:-"/c/_artifacts"}"
-
-make install.deps
-make install -e BINDIR="/c/Program Files/Containerd"
-
-mkdir -p "${REPORT_DIR}"
-containerd -log-level debug &> "${REPORT_DIR}/containerd.log" &
-pid=$!
-ctr version
-
-set +o errexit
-critest --runtime-endpoint=npipe:////./pipe/containerd-containerd --ginkgo.focus="${FOCUS}" --ginkgo.skip="${SKIP}" --report-dir="${REPORT_DIR}" --report-prefix="windows"
-TEST_RC=$?
-set -o errexit
-kill -9 $pid
-echo -n "${TEST_RC}" > "${REPORT_DIR}/exitcode"
diff --git a/vendor.conf b/vendor.conf
deleted file mode 100644
index 3eafd2c6b..000000000
--- a/vendor.conf
+++ /dev/null
@@ -1,102 +0,0 @@
-# cri dependencies
-github.com/docker/docker 4634ce647cf2ce2c6031129ccd109e557244986f
-github.com/opencontainers/selinux v1.6.0
-github.com/tchap/go-patricia v2.2.6
-github.com/willf/bitset v1.1.11
-
-# containerd dependencies
-github.com/beorn7/perks v1.0.1
-github.com/BurntSushi/toml v0.3.1
-github.com/cespare/xxhash/v2 v2.1.1
-github.com/containerd/cgroups 318312a373405e5e91134d8063d04d59768a1bff
-github.com/containerd/console v1.0.0
-github.com/containerd/containerd v1.4.1
-github.com/containerd/continuity efbc4488d8fe1bdc16bde3b2d2990d9b3a899165
-github.com/containerd/fifo f15a3290365b9d2627d189e619ab4008e0069caf
-github.com/containerd/go-runc 7016d3ce2328dd2cb1192b2076ebd565c4e8df0c
-github.com/containerd/nri 0afc7f031eaf9c7d9c1a381b7ab5462e89c998fc
-github.com/containerd/ttrpc v1.0.1
-github.com/containerd/typeurl v1.0.1
-github.com/coreos/go-systemd/v22 v22.1.0
-github.com/cpuguy83/go-md2man/v2 v2.0.0
-github.com/docker/go-events e31b211e4f1cd09aa76fe4ac244571fab96ae47f
-github.com/docker/go-metrics v0.0.1
-github.com/docker/go-units v0.4.0
-github.com/godbus/dbus/v5 v5.0.3
-github.com/gogo/googleapis v1.3.2
-github.com/gogo/protobuf v1.3.1
-github.com/golang/protobuf v1.3.5
-github.com/google/uuid v1.1.1
-github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
-github.com/hashicorp/errwrap v1.0.0
-github.com/hashicorp/go-multierror v1.0.0
-github.com/hashicorp/golang-lru v0.5.3
-github.com/imdario/mergo v0.3.7
-github.com/konsorten/go-windows-terminal-sequences v1.0.3
-github.com/matttproud/golang_protobuf_extensions v1.0.1
-github.com/Microsoft/go-winio v0.4.14
-github.com/Microsoft/hcsshim v0.8.9
-github.com/opencontainers/go-digest v1.0.0
-github.com/opencontainers/image-spec v1.0.1
-github.com/opencontainers/runc v1.0.0-rc92
-github.com/opencontainers/runtime-spec 4d89ac9fbff6c455f46a5bb59c6b1bb7184a5e43 # v1.0.3-0.20200728170252-4d89ac9fbff6
-github.com/pkg/errors v0.9.1
-github.com/prometheus/client_golang v1.6.0
-github.com/prometheus/client_model v0.2.0
-github.com/prometheus/common v0.9.1
-github.com/prometheus/procfs v0.0.11
-github.com/russross/blackfriday/v2 v2.0.1
-github.com/shurcooL/sanitized_anchor_name v1.0.0
-github.com/sirupsen/logrus v1.6.0
-github.com/syndtr/gocapability d98352740cb2c55f81556b63d4a1ec64c5a319c2
-github.com/urfave/cli v1.22.1 # NOTE: urfave/cli must be <= v1.22.1 due to a regression: https://github.com/urfave/cli/issues/1092
-go.etcd.io/bbolt v1.3.5
-go.opencensus.io v0.22.0
-golang.org/x/net ab34263943818b32f575efc978a3d24e80b04bd7
-golang.org/x/sync 42b317875d0fa942474b76e1b46a6060d720ae6e
-golang.org/x/sys ed371f2e16b4b305ee99df548828de367527b76b
-golang.org/x/text v0.3.3
-google.golang.org/genproto e50cd9704f63023d62cd06a1994b98227fc4d21a
-google.golang.org/grpc v1.27.1
-
-# cgroups dependencies
-github.com/cilium/ebpf 1c8d4c9ef7759622653a1d319284a44652333b28
-
-# kubernetes dependencies
-github.com/davecgh/go-spew v1.1.1
-github.com/docker/spdystream 449fdfce4d962303d702fec724ef0ad181c92528
-github.com/emicklei/go-restful v2.9.5
-github.com/go-logr/logr v0.2.0
-github.com/google/gofuzz v1.1.0
-github.com/json-iterator/go v1.1.10
-github.com/modern-go/concurrent 1.0.3
-github.com/modern-go/reflect2 v1.0.1
-github.com/pmezard/go-difflib v1.0.0
-github.com/stretchr/testify v1.4.0
-golang.org/x/crypto 75b288015ac94e66e3d6715fb68a9b41bf046ec2
-golang.org/x/oauth2 858c2ad4c8b6c5d10852cb89079f6ca1c7309787
-golang.org/x/time 555d28b269f0569763d25dbe1a237ae74c6bcc82
-gopkg.in/inf.v0 v0.9.1
-gopkg.in/yaml.v2 v2.2.8
-k8s.io/api v0.19.2
-k8s.io/apiserver v0.19.2
-k8s.io/apimachinery v0.19.2
-k8s.io/client-go v0.19.2
-k8s.io/component-base v0.19.2
-k8s.io/cri-api v0.19.2
-k8s.io/klog/v2 v2.2.0
-k8s.io/utils d5654de09c73da55eb19ae4ab4f734f7a61747a6
-sigs.k8s.io/structured-merge-diff/v4 v4.0.1
-sigs.k8s.io/yaml v1.2.0
-
-# cni dependencies
-github.com/containerd/go-cni v1.0.1
-github.com/containernetworking/cni v0.8.0
-github.com/containernetworking/plugins v0.8.6
-github.com/fsnotify/fsnotify v1.4.9
-
-# image decrypt depedencies
-github.com/containerd/imgcrypt v1.0.1
-github.com/containers/ocicrypt v1.0.1
-github.com/fullsailor/pkcs7 8306686428a5fe132eac8cb7c4848af725098bd4
-gopkg.in/square/go-jose.v2 v2.3.1
diff --git a/vendor/github.com/BurntSushi/toml/COPYING b/vendor/github.com/BurntSushi/toml/COPYING
deleted file mode 100644
index 01b574320..000000000
--- a/vendor/github.com/BurntSushi/toml/COPYING
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2013 TOML authors
-
-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/vendor/github.com/BurntSushi/toml/README.md b/vendor/github.com/BurntSushi/toml/README.md
deleted file mode 100644
index 7c1b37ecc..000000000
--- a/vendor/github.com/BurntSushi/toml/README.md
+++ /dev/null
@@ -1,218 +0,0 @@
-## TOML parser and encoder for Go with reflection
-
-TOML stands for Tom's Obvious, Minimal Language. This Go package provides a
-reflection interface similar to Go's standard library `json` and `xml`
-packages. This package also supports the `encoding.TextUnmarshaler` and
-`encoding.TextMarshaler` interfaces so that you can define custom data
-representations. (There is an example of this below.)
-
-Spec: https://github.com/toml-lang/toml
-
-Compatible with TOML version
-[v0.4.0](https://github.com/toml-lang/toml/blob/master/versions/en/toml-v0.4.0.md)
-
-Documentation: https://godoc.org/github.com/BurntSushi/toml
-
-Installation:
-
-```bash
-go get github.com/BurntSushi/toml
-```
-
-Try the toml validator:
-
-```bash
-go get github.com/BurntSushi/toml/cmd/tomlv
-tomlv some-toml-file.toml
-```
-
-[](https://travis-ci.org/BurntSushi/toml) [](https://godoc.org/github.com/BurntSushi/toml)
-
-### Testing
-
-This package passes all tests in
-[toml-test](https://github.com/BurntSushi/toml-test) for both the decoder
-and the encoder.
-
-### Examples
-
-This package works similarly to how the Go standard library handles `XML`
-and `JSON`. Namely, data is loaded into Go values via reflection.
-
-For the simplest example, consider some TOML file as just a list of keys
-and values:
-
-```toml
-Age = 25
-Cats = [ "Cauchy", "Plato" ]
-Pi = 3.14
-Perfection = [ 6, 28, 496, 8128 ]
-DOB = 1987-07-05T05:45:00Z
-```
-
-Which could be defined in Go as:
-
-```go
-type Config struct {
- Age int
- Cats []string
- Pi float64
- Perfection []int
- DOB time.Time // requires `import time`
-}
-```
-
-And then decoded with:
-
-```go
-var conf Config
-if _, err := toml.Decode(tomlData, &conf); err != nil {
- // handle error
-}
-```
-
-You can also use struct tags if your struct field name doesn't map to a TOML
-key value directly:
-
-```toml
-some_key_NAME = "wat"
-```
-
-```go
-type TOML struct {
- ObscureKey string `toml:"some_key_NAME"`
-}
-```
-
-### Using the `encoding.TextUnmarshaler` interface
-
-Here's an example that automatically parses duration strings into
-`time.Duration` values:
-
-```toml
-[[song]]
-name = "Thunder Road"
-duration = "4m49s"
-
-[[song]]
-name = "Stairway to Heaven"
-duration = "8m03s"
-```
-
-Which can be decoded with:
-
-```go
-type song struct {
- Name string
- Duration duration
-}
-type songs struct {
- Song []song
-}
-var favorites songs
-if _, err := toml.Decode(blob, &favorites); err != nil {
- log.Fatal(err)
-}
-
-for _, s := range favorites.Song {
- fmt.Printf("%s (%s)\n", s.Name, s.Duration)
-}
-```
-
-And you'll also need a `duration` type that satisfies the
-`encoding.TextUnmarshaler` interface:
-
-```go
-type duration struct {
- time.Duration
-}
-
-func (d *duration) UnmarshalText(text []byte) error {
- var err error
- d.Duration, err = time.ParseDuration(string(text))
- return err
-}
-```
-
-### More complex usage
-
-Here's an example of how to load the example from the official spec page:
-
-```toml
-# 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
-
-# Line breaks are OK when inside arrays
-hosts = [
- "alpha",
- "omega"
-]
-```
-
-And the corresponding Go types are:
-
-```go
-type tomlConfig struct {
- Title string
- Owner ownerInfo
- DB database `toml:"database"`
- Servers map[string]server
- Clients clients
-}
-
-type ownerInfo struct {
- Name string
- Org string `toml:"organization"`
- Bio string
- DOB time.Time
-}
-
-type database struct {
- Server string
- Ports []int
- ConnMax int `toml:"connection_max"`
- Enabled bool
-}
-
-type server struct {
- IP string
- DC string
-}
-
-type clients struct {
- Data [][]interface{}
- Hosts []string
-}
-```
-
-Note that a case insensitive match will be tried if an exact match can't be
-found.
-
-A working example of the above can be found in `_examples/example.{go,toml}`.
diff --git a/vendor/github.com/BurntSushi/toml/decode.go b/vendor/github.com/BurntSushi/toml/decode.go
deleted file mode 100644
index b0fd51d5b..000000000
--- a/vendor/github.com/BurntSushi/toml/decode.go
+++ /dev/null
@@ -1,509 +0,0 @@
-package toml
-
-import (
- "fmt"
- "io"
- "io/ioutil"
- "math"
- "reflect"
- "strings"
- "time"
-)
-
-func e(format string, args ...interface{}) error {
- return fmt.Errorf("toml: "+format, args...)
-}
-
-// Unmarshaler is the interface implemented by objects that can unmarshal a
-// TOML description of themselves.
-type Unmarshaler interface {
- UnmarshalTOML(interface{}) error
-}
-
-// Unmarshal decodes the contents of `p` in TOML format into a pointer `v`.
-func Unmarshal(p []byte, v interface{}) error {
- _, err := Decode(string(p), v)
- return err
-}
-
-// Primitive is a TOML value that hasn't been decoded into a Go value.
-// When using the various `Decode*` functions, the type `Primitive` may
-// be given to any value, and its decoding will be delayed.
-//
-// A `Primitive` value can be decoded using the `PrimitiveDecode` function.
-//
-// The underlying representation of a `Primitive` value is subject to change.
-// Do not rely on it.
-//
-// N.B. Primitive values are still parsed, so using them will only avoid
-// the overhead of reflection. They can be useful when you don't know the
-// exact type of TOML data until run time.
-type Primitive struct {
- undecoded interface{}
- context Key
-}
-
-// DEPRECATED!
-//
-// Use MetaData.PrimitiveDecode instead.
-func PrimitiveDecode(primValue Primitive, v interface{}) error {
- md := MetaData{decoded: make(map[string]bool)}
- return md.unify(primValue.undecoded, rvalue(v))
-}
-
-// PrimitiveDecode is just like the other `Decode*` functions, except it
-// decodes a TOML value that has already been parsed. Valid primitive values
-// can *only* be obtained from values filled by the decoder functions,
-// including this method. (i.e., `v` may contain more `Primitive`
-// values.)
-//
-// Meta data for primitive values is included in the meta data returned by
-// the `Decode*` functions with one exception: keys returned by the Undecoded
-// method will only reflect keys that were decoded. Namely, any keys hidden
-// behind a Primitive will be considered undecoded. Executing this method will
-// update the undecoded keys in the meta data. (See the example.)
-func (md *MetaData) PrimitiveDecode(primValue Primitive, v interface{}) error {
- md.context = primValue.context
- defer func() { md.context = nil }()
- return md.unify(primValue.undecoded, rvalue(v))
-}
-
-// Decode will decode the contents of `data` in TOML format into a pointer
-// `v`.
-//
-// TOML hashes correspond to Go structs or maps. (Dealer's choice. They can be
-// used interchangeably.)
-//
-// TOML arrays of tables correspond to either a slice of structs or a slice
-// of maps.
-//
-// TOML datetimes correspond to Go `time.Time` values.
-//
-// All other TOML types (float, string, int, bool and array) correspond
-// to the obvious Go types.
-//
-// An exception to the above rules is if a type implements the
-// encoding.TextUnmarshaler interface. In this case, any primitive TOML value
-// (floats, strings, integers, booleans and datetimes) will be converted to
-// a byte string and given to the value's UnmarshalText method. See the
-// Unmarshaler example for a demonstration with time duration strings.
-//
-// Key mapping
-//
-// TOML keys can map to either keys in a Go map or field names in a Go
-// struct. The special `toml` struct tag may be used to map TOML keys to
-// struct fields that don't match the key name exactly. (See the example.)
-// A case insensitive match to struct names will be tried if an exact match
-// can't be found.
-//
-// The mapping between TOML values and Go values is loose. That is, there
-// may exist TOML values that cannot be placed into your representation, and
-// there may be parts of your representation that do not correspond to
-// TOML values. This loose mapping can be made stricter by using the IsDefined
-// and/or Undecoded methods on the MetaData returned.
-//
-// This decoder will not handle cyclic types. If a cyclic type is passed,
-// `Decode` will not terminate.
-func Decode(data string, v interface{}) (MetaData, error) {
- rv := reflect.ValueOf(v)
- if rv.Kind() != reflect.Ptr {
- return MetaData{}, e("Decode of non-pointer %s", reflect.TypeOf(v))
- }
- if rv.IsNil() {
- return MetaData{}, e("Decode of nil %s", reflect.TypeOf(v))
- }
- p, err := parse(data)
- if err != nil {
- return MetaData{}, err
- }
- md := MetaData{
- p.mapping, p.types, p.ordered,
- make(map[string]bool, len(p.ordered)), nil,
- }
- return md, md.unify(p.mapping, indirect(rv))
-}
-
-// DecodeFile is just like Decode, except it will automatically read the
-// contents of the file at `fpath` and decode it for you.
-func DecodeFile(fpath string, v interface{}) (MetaData, error) {
- bs, err := ioutil.ReadFile(fpath)
- if err != nil {
- return MetaData{}, err
- }
- return Decode(string(bs), v)
-}
-
-// DecodeReader is just like Decode, except it will consume all bytes
-// from the reader and decode it for you.
-func DecodeReader(r io.Reader, v interface{}) (MetaData, error) {
- bs, err := ioutil.ReadAll(r)
- if err != nil {
- return MetaData{}, err
- }
- return Decode(string(bs), v)
-}
-
-// unify performs a sort of type unification based on the structure of `rv`,
-// which is the client representation.
-//
-// Any type mismatch produces an error. Finding a type that we don't know
-// how to handle produces an unsupported type error.
-func (md *MetaData) unify(data interface{}, rv reflect.Value) error {
-
- // Special case. Look for a `Primitive` value.
- if rv.Type() == reflect.TypeOf((*Primitive)(nil)).Elem() {
- // Save the undecoded data and the key context into the primitive
- // value.
- context := make(Key, len(md.context))
- copy(context, md.context)
- rv.Set(reflect.ValueOf(Primitive{
- undecoded: data,
- context: context,
- }))
- return nil
- }
-
- // Special case. Unmarshaler Interface support.
- if rv.CanAddr() {
- if v, ok := rv.Addr().Interface().(Unmarshaler); ok {
- return v.UnmarshalTOML(data)
- }
- }
-
- // Special case. Handle time.Time values specifically.
- // TODO: Remove this code when we decide to drop support for Go 1.1.
- // This isn't necessary in Go 1.2 because time.Time satisfies the encoding
- // interfaces.
- if rv.Type().AssignableTo(rvalue(time.Time{}).Type()) {
- return md.unifyDatetime(data, rv)
- }
-
- // Special case. Look for a value satisfying the TextUnmarshaler interface.
- if v, ok := rv.Interface().(TextUnmarshaler); ok {
- return md.unifyText(data, v)
- }
- // BUG(burntsushi)
- // The behavior here is incorrect whenever a Go type satisfies the
- // encoding.TextUnmarshaler interface but also corresponds to a TOML
- // hash or array. In particular, the unmarshaler should only be applied
- // to primitive TOML values. But at this point, it will be applied to
- // all kinds of values and produce an incorrect error whenever those values
- // are hashes or arrays (including arrays of tables).
-
- k := rv.Kind()
-
- // laziness
- if k >= reflect.Int && k <= reflect.Uint64 {
- return md.unifyInt(data, rv)
- }
- switch k {
- case reflect.Ptr:
- elem := reflect.New(rv.Type().Elem())
- err := md.unify(data, reflect.Indirect(elem))
- if err != nil {
- return err
- }
- rv.Set(elem)
- return nil
- case reflect.Struct:
- return md.unifyStruct(data, rv)
- case reflect.Map:
- return md.unifyMap(data, rv)
- case reflect.Array:
- return md.unifyArray(data, rv)
- case reflect.Slice:
- return md.unifySlice(data, rv)
- case reflect.String:
- return md.unifyString(data, rv)
- case reflect.Bool:
- return md.unifyBool(data, rv)
- case reflect.Interface:
- // we only support empty interfaces.
- if rv.NumMethod() > 0 {
- return e("unsupported type %s", rv.Type())
- }
- return md.unifyAnything(data, rv)
- case reflect.Float32:
- fallthrough
- case reflect.Float64:
- return md.unifyFloat64(data, rv)
- }
- return e("unsupported type %s", rv.Kind())
-}
-
-func (md *MetaData) unifyStruct(mapping interface{}, rv reflect.Value) error {
- tmap, ok := mapping.(map[string]interface{})
- if !ok {
- if mapping == nil {
- return nil
- }
- return e("type mismatch for %s: expected table but found %T",
- rv.Type().String(), mapping)
- }
-
- for key, datum := range tmap {
- var f *field
- fields := cachedTypeFields(rv.Type())
- for i := range fields {
- ff := &fields[i]
- if ff.name == key {
- f = ff
- break
- }
- if f == nil && strings.EqualFold(ff.name, key) {
- f = ff
- }
- }
- if f != nil {
- subv := rv
- for _, i := range f.index {
- subv = indirect(subv.Field(i))
- }
- if isUnifiable(subv) {
- md.decoded[md.context.add(key).String()] = true
- md.context = append(md.context, key)
- if err := md.unify(datum, subv); err != nil {
- return err
- }
- md.context = md.context[0 : len(md.context)-1]
- } else if f.name != "" {
- // Bad user! No soup for you!
- return e("cannot write unexported field %s.%s",
- rv.Type().String(), f.name)
- }
- }
- }
- return nil
-}
-
-func (md *MetaData) unifyMap(mapping interface{}, rv reflect.Value) error {
- tmap, ok := mapping.(map[string]interface{})
- if !ok {
- if tmap == nil {
- return nil
- }
- return badtype("map", mapping)
- }
- if rv.IsNil() {
- rv.Set(reflect.MakeMap(rv.Type()))
- }
- for k, v := range tmap {
- md.decoded[md.context.add(k).String()] = true
- md.context = append(md.context, k)
-
- rvkey := indirect(reflect.New(rv.Type().Key()))
- rvval := reflect.Indirect(reflect.New(rv.Type().Elem()))
- if err := md.unify(v, rvval); err != nil {
- return err
- }
- md.context = md.context[0 : len(md.context)-1]
-
- rvkey.SetString(k)
- rv.SetMapIndex(rvkey, rvval)
- }
- return nil
-}
-
-func (md *MetaData) unifyArray(data interface{}, rv reflect.Value) error {
- datav := reflect.ValueOf(data)
- if datav.Kind() != reflect.Slice {
- if !datav.IsValid() {
- return nil
- }
- return badtype("slice", data)
- }
- sliceLen := datav.Len()
- if sliceLen != rv.Len() {
- return e("expected array length %d; got TOML array of length %d",
- rv.Len(), sliceLen)
- }
- return md.unifySliceArray(datav, rv)
-}
-
-func (md *MetaData) unifySlice(data interface{}, rv reflect.Value) error {
- datav := reflect.ValueOf(data)
- if datav.Kind() != reflect.Slice {
- if !datav.IsValid() {
- return nil
- }
- return badtype("slice", data)
- }
- n := datav.Len()
- if rv.IsNil() || rv.Cap() < n {
- rv.Set(reflect.MakeSlice(rv.Type(), n, n))
- }
- rv.SetLen(n)
- return md.unifySliceArray(datav, rv)
-}
-
-func (md *MetaData) unifySliceArray(data, rv reflect.Value) error {
- sliceLen := data.Len()
- for i := 0; i < sliceLen; i++ {
- v := data.Index(i).Interface()
- sliceval := indirect(rv.Index(i))
- if err := md.unify(v, sliceval); err != nil {
- return err
- }
- }
- return nil
-}
-
-func (md *MetaData) unifyDatetime(data interface{}, rv reflect.Value) error {
- if _, ok := data.(time.Time); ok {
- rv.Set(reflect.ValueOf(data))
- return nil
- }
- return badtype("time.Time", data)
-}
-
-func (md *MetaData) unifyString(data interface{}, rv reflect.Value) error {
- if s, ok := data.(string); ok {
- rv.SetString(s)
- return nil
- }
- return badtype("string", data)
-}
-
-func (md *MetaData) unifyFloat64(data interface{}, rv reflect.Value) error {
- if num, ok := data.(float64); ok {
- switch rv.Kind() {
- case reflect.Float32:
- fallthrough
- case reflect.Float64:
- rv.SetFloat(num)
- default:
- panic("bug")
- }
- return nil
- }
- return badtype("float", data)
-}
-
-func (md *MetaData) unifyInt(data interface{}, rv reflect.Value) error {
- if num, ok := data.(int64); ok {
- if rv.Kind() >= reflect.Int && rv.Kind() <= reflect.Int64 {
- switch rv.Kind() {
- case reflect.Int, reflect.Int64:
- // No bounds checking necessary.
- case reflect.Int8:
- if num < math.MinInt8 || num > math.MaxInt8 {
- return e("value %d is out of range for int8", num)
- }
- case reflect.Int16:
- if num < math.MinInt16 || num > math.MaxInt16 {
- return e("value %d is out of range for int16", num)
- }
- case reflect.Int32:
- if num < math.MinInt32 || num > math.MaxInt32 {
- return e("value %d is out of range for int32", num)
- }
- }
- rv.SetInt(num)
- } else if rv.Kind() >= reflect.Uint && rv.Kind() <= reflect.Uint64 {
- unum := uint64(num)
- switch rv.Kind() {
- case reflect.Uint, reflect.Uint64:
- // No bounds checking necessary.
- case reflect.Uint8:
- if num < 0 || unum > math.MaxUint8 {
- return e("value %d is out of range for uint8", num)
- }
- case reflect.Uint16:
- if num < 0 || unum > math.MaxUint16 {
- return e("value %d is out of range for uint16", num)
- }
- case reflect.Uint32:
- if num < 0 || unum > math.MaxUint32 {
- return e("value %d is out of range for uint32", num)
- }
- }
- rv.SetUint(unum)
- } else {
- panic("unreachable")
- }
- return nil
- }
- return badtype("integer", data)
-}
-
-func (md *MetaData) unifyBool(data interface{}, rv reflect.Value) error {
- if b, ok := data.(bool); ok {
- rv.SetBool(b)
- return nil
- }
- return badtype("boolean", data)
-}
-
-func (md *MetaData) unifyAnything(data interface{}, rv reflect.Value) error {
- rv.Set(reflect.ValueOf(data))
- return nil
-}
-
-func (md *MetaData) unifyText(data interface{}, v TextUnmarshaler) error {
- var s string
- switch sdata := data.(type) {
- case TextMarshaler:
- text, err := sdata.MarshalText()
- if err != nil {
- return err
- }
- s = string(text)
- case fmt.Stringer:
- s = sdata.String()
- case string:
- s = sdata
- case bool:
- s = fmt.Sprintf("%v", sdata)
- case int64:
- s = fmt.Sprintf("%d", sdata)
- case float64:
- s = fmt.Sprintf("%f", sdata)
- default:
- return badtype("primitive (string-like)", data)
- }
- if err := v.UnmarshalText([]byte(s)); err != nil {
- return err
- }
- return nil
-}
-
-// rvalue returns a reflect.Value of `v`. All pointers are resolved.
-func rvalue(v interface{}) reflect.Value {
- return indirect(reflect.ValueOf(v))
-}
-
-// indirect returns the value pointed to by a pointer.
-// Pointers are followed until the value is not a pointer.
-// New values are allocated for each nil pointer.
-//
-// An exception to this rule is if the value satisfies an interface of
-// interest to us (like encoding.TextUnmarshaler).
-func indirect(v reflect.Value) reflect.Value {
- if v.Kind() != reflect.Ptr {
- if v.CanSet() {
- pv := v.Addr()
- if _, ok := pv.Interface().(TextUnmarshaler); ok {
- return pv
- }
- }
- return v
- }
- if v.IsNil() {
- v.Set(reflect.New(v.Type().Elem()))
- }
- return indirect(reflect.Indirect(v))
-}
-
-func isUnifiable(rv reflect.Value) bool {
- if rv.CanSet() {
- return true
- }
- if _, ok := rv.Interface().(TextUnmarshaler); ok {
- return true
- }
- return false
-}
-
-func badtype(expected string, data interface{}) error {
- return e("cannot load TOML value of type %T into a Go %s", data, expected)
-}
diff --git a/vendor/github.com/BurntSushi/toml/decode_meta.go b/vendor/github.com/BurntSushi/toml/decode_meta.go
deleted file mode 100644
index b9914a679..000000000
--- a/vendor/github.com/BurntSushi/toml/decode_meta.go
+++ /dev/null
@@ -1,121 +0,0 @@
-package toml
-
-import "strings"
-
-// MetaData allows access to meta information about TOML data that may not
-// be inferrable via reflection. In particular, whether a key has been defined
-// and the TOML type of a key.
-type MetaData struct {
- mapping map[string]interface{}
- types map[string]tomlType
- keys []Key
- decoded map[string]bool
- context Key // Used only during decoding.
-}
-
-// IsDefined returns true if the key given exists in the TOML data. The key
-// should be specified hierarchially. e.g.,
-//
-// // access the TOML key 'a.b.c'
-// IsDefined("a", "b", "c")
-//
-// IsDefined will return false if an empty key given. Keys are case sensitive.
-func (md *MetaData) IsDefined(key ...string) bool {
- if len(key) == 0 {
- return false
- }
-
- var hash map[string]interface{}
- var ok bool
- var hashOrVal interface{} = md.mapping
- for _, k := range key {
- if hash, ok = hashOrVal.(map[string]interface{}); !ok {
- return false
- }
- if hashOrVal, ok = hash[k]; !ok {
- return false
- }
- }
- return true
-}
-
-// Type returns a string representation of the type of the key specified.
-//
-// Type will return the empty string if given an empty key or a key that
-// does not exist. Keys are case sensitive.
-func (md *MetaData) Type(key ...string) string {
- fullkey := strings.Join(key, ".")
- if typ, ok := md.types[fullkey]; ok {
- return typ.typeString()
- }
- return ""
-}
-
-// Key is the type of any TOML key, including key groups. Use (MetaData).Keys
-// to get values of this type.
-type Key []string
-
-func (k Key) String() string {
- return strings.Join(k, ".")
-}
-
-func (k Key) maybeQuotedAll() string {
- var ss []string
- for i := range k {
- ss = append(ss, k.maybeQuoted(i))
- }
- return strings.Join(ss, ".")
-}
-
-func (k Key) maybeQuoted(i int) string {
- quote := false
- for _, c := range k[i] {
- if !isBareKeyChar(c) {
- quote = true
- break
- }
- }
- if quote {
- return "\"" + strings.Replace(k[i], "\"", "\\\"", -1) + "\""
- }
- return k[i]
-}
-
-func (k Key) add(piece string) Key {
- newKey := make(Key, len(k)+1)
- copy(newKey, k)
- newKey[len(k)] = piece
- return newKey
-}
-
-// Keys returns a slice of every key in the TOML data, including key groups.
-// Each key is itself a slice, where the first element is the top of the
-// hierarchy and the last is the most specific.
-//
-// The list will have the same order as the keys appeared in the TOML data.
-//
-// All keys returned are non-empty.
-func (md *MetaData) Keys() []Key {
- return md.keys
-}
-
-// Undecoded returns all keys that have not been decoded in the order in which
-// they appear in the original TOML document.
-//
-// This includes keys that haven't been decoded because of a Primitive value.
-// Once the Primitive value is decoded, the keys will be considered decoded.
-//
-// Also note that decoding into an empty interface will result in no decoding,
-// and so no keys will be considered decoded.
-//
-// In this sense, the Undecoded keys correspond to keys in the TOML document
-// that do not have a concrete type in your representation.
-func (md *MetaData) Undecoded() []Key {
- undecoded := make([]Key, 0, len(md.keys))
- for _, key := range md.keys {
- if !md.decoded[key.String()] {
- undecoded = append(undecoded, key)
- }
- }
- return undecoded
-}
diff --git a/vendor/github.com/BurntSushi/toml/doc.go b/vendor/github.com/BurntSushi/toml/doc.go
deleted file mode 100644
index b371f396e..000000000
--- a/vendor/github.com/BurntSushi/toml/doc.go
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Package toml provides facilities for decoding and encoding TOML configuration
-files via reflection. There is also support for delaying decoding with
-the Primitive type, and querying the set of keys in a TOML document with the
-MetaData type.
-
-The specification implemented: https://github.com/toml-lang/toml
-
-The sub-command github.com/BurntSushi/toml/cmd/tomlv can be used to verify
-whether a file is a valid TOML document. It can also be used to print the
-type of each key in a TOML document.
-
-Testing
-
-There are two important types of tests used for this package. The first is
-contained inside '*_test.go' files and uses the standard Go unit testing
-framework. These tests are primarily devoted to holistically testing the
-decoder and encoder.
-
-The second type of testing is used to verify the implementation's adherence
-to the TOML specification. These tests have been factored into their own
-project: https://github.com/BurntSushi/toml-test
-
-The reason the tests are in a separate project is so that they can be used by
-any implementation of TOML. Namely, it is language agnostic.
-*/
-package toml
diff --git a/vendor/github.com/BurntSushi/toml/encode.go b/vendor/github.com/BurntSushi/toml/encode.go
deleted file mode 100644
index d905c21a2..000000000
--- a/vendor/github.com/BurntSushi/toml/encode.go
+++ /dev/null
@@ -1,568 +0,0 @@
-package toml
-
-import (
- "bufio"
- "errors"
- "fmt"
- "io"
- "reflect"
- "sort"
- "strconv"
- "strings"
- "time"
-)
-
-type tomlEncodeError struct{ error }
-
-var (
- errArrayMixedElementTypes = errors.New(
- "toml: cannot encode array with mixed element types")
- errArrayNilElement = errors.New(
- "toml: cannot encode array with nil element")
- errNonString = errors.New(
- "toml: cannot encode a map with non-string key type")
- errAnonNonStruct = errors.New(
- "toml: cannot encode an anonymous field that is not a struct")
- errArrayNoTable = errors.New(
- "toml: TOML array element cannot contain a table")
- errNoKey = errors.New(
- "toml: top-level values must be Go maps or structs")
- errAnything = errors.New("") // used in testing
-)
-
-var quotedReplacer = strings.NewReplacer(
- "\t", "\\t",
- "\n", "\\n",
- "\r", "\\r",
- "\"", "\\\"",
- "\\", "\\\\",
-)
-
-// Encoder controls the encoding of Go values to a TOML document to some
-// io.Writer.
-//
-// The indentation level can be controlled with the Indent field.
-type Encoder struct {
- // A single indentation level. By default it is two spaces.
- Indent string
-
- // hasWritten is whether we have written any output to w yet.
- hasWritten bool
- w *bufio.Writer
-}
-
-// NewEncoder returns a TOML encoder that encodes Go values to the io.Writer
-// given. By default, a single indentation level is 2 spaces.
-func NewEncoder(w io.Writer) *Encoder {
- return &Encoder{
- w: bufio.NewWriter(w),
- Indent: " ",
- }
-}
-
-// Encode writes a TOML representation of the Go value to the underlying
-// io.Writer. If the value given cannot be encoded to a valid TOML document,
-// then an error is returned.
-//
-// The mapping between Go values and TOML values should be precisely the same
-// as for the Decode* functions. Similarly, the TextMarshaler interface is
-// supported by encoding the resulting bytes as strings. (If you want to write
-// arbitrary binary data then you will need to use something like base64 since
-// TOML does not have any binary types.)
-//
-// When encoding TOML hashes (i.e., Go maps or structs), keys without any
-// sub-hashes are encoded first.
-//
-// If a Go map is encoded, then its keys are sorted alphabetically for
-// deterministic output. More control over this behavior may be provided if
-// there is demand for it.
-//
-// Encoding Go values without a corresponding TOML representation---like map
-// types with non-string keys---will cause an error to be returned. Similarly
-// for mixed arrays/slices, arrays/slices with nil elements, embedded
-// non-struct types and nested slices containing maps or structs.
-// (e.g., [][]map[string]string is not allowed but []map[string]string is OK
-// and so is []map[string][]string.)
-func (enc *Encoder) Encode(v interface{}) error {
- rv := eindirect(reflect.ValueOf(v))
- if err := enc.safeEncode(Key([]string{}), rv); err != nil {
- return err
- }
- return enc.w.Flush()
-}
-
-func (enc *Encoder) safeEncode(key Key, rv reflect.Value) (err error) {
- defer func() {
- if r := recover(); r != nil {
- if terr, ok := r.(tomlEncodeError); ok {
- err = terr.error
- return
- }
- panic(r)
- }
- }()
- enc.encode(key, rv)
- return nil
-}
-
-func (enc *Encoder) encode(key Key, rv reflect.Value) {
- // Special case. Time needs to be in ISO8601 format.
- // Special case. If we can marshal the type to text, then we used that.
- // Basically, this prevents the encoder for handling these types as
- // generic structs (or whatever the underlying type of a TextMarshaler is).
- switch rv.Interface().(type) {
- case time.Time, TextMarshaler:
- enc.keyEqElement(key, rv)
- return
- }
-
- k := rv.Kind()
- switch k {
- case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32,
- reflect.Int64,
- reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32,
- reflect.Uint64,
- reflect.Float32, reflect.Float64, reflect.String, reflect.Bool:
- enc.keyEqElement(key, rv)
- case reflect.Array, reflect.Slice:
- if typeEqual(tomlArrayHash, tomlTypeOfGo(rv)) {
- enc.eArrayOfTables(key, rv)
- } else {
- enc.keyEqElement(key, rv)
- }
- case reflect.Interface:
- if rv.IsNil() {
- return
- }
- enc.encode(key, rv.Elem())
- case reflect.Map:
- if rv.IsNil() {
- return
- }
- enc.eTable(key, rv)
- case reflect.Ptr:
- if rv.IsNil() {
- return
- }
- enc.encode(key, rv.Elem())
- case reflect.Struct:
- enc.eTable(key, rv)
- default:
- panic(e("unsupported type for key '%s': %s", key, k))
- }
-}
-
-// eElement encodes any value that can be an array element (primitives and
-// arrays).
-func (enc *Encoder) eElement(rv reflect.Value) {
- switch v := rv.Interface().(type) {
- case time.Time:
- // Special case time.Time as a primitive. Has to come before
- // TextMarshaler below because time.Time implements
- // encoding.TextMarshaler, but we need to always use UTC.
- enc.wf(v.UTC().Format("2006-01-02T15:04:05Z"))
- return
- case TextMarshaler:
- // Special case. Use text marshaler if it's available for this value.
- if s, err := v.MarshalText(); err != nil {
- encPanic(err)
- } else {
- enc.writeQuoted(string(s))
- }
- return
- }
- switch rv.Kind() {
- case reflect.Bool:
- enc.wf(strconv.FormatBool(rv.Bool()))
- case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32,
- reflect.Int64:
- enc.wf(strconv.FormatInt(rv.Int(), 10))
- case reflect.Uint, reflect.Uint8, reflect.Uint16,
- reflect.Uint32, reflect.Uint64:
- enc.wf(strconv.FormatUint(rv.Uint(), 10))
- case reflect.Float32:
- enc.wf(floatAddDecimal(strconv.FormatFloat(rv.Float(), 'f', -1, 32)))
- case reflect.Float64:
- enc.wf(floatAddDecimal(strconv.FormatFloat(rv.Float(), 'f', -1, 64)))
- case reflect.Array, reflect.Slice:
- enc.eArrayOrSliceElement(rv)
- case reflect.Interface:
- enc.eElement(rv.Elem())
- case reflect.String:
- enc.writeQuoted(rv.String())
- default:
- panic(e("unexpected primitive type: %s", rv.Kind()))
- }
-}
-
-// By the TOML spec, all floats must have a decimal with at least one
-// number on either side.
-func floatAddDecimal(fstr string) string {
- if !strings.Contains(fstr, ".") {
- return fstr + ".0"
- }
- return fstr
-}
-
-func (enc *Encoder) writeQuoted(s string) {
- enc.wf("\"%s\"", quotedReplacer.Replace(s))
-}
-
-func (enc *Encoder) eArrayOrSliceElement(rv reflect.Value) {
- length := rv.Len()
- enc.wf("[")
- for i := 0; i < length; i++ {
- elem := rv.Index(i)
- enc.eElement(elem)
- if i != length-1 {
- enc.wf(", ")
- }
- }
- enc.wf("]")
-}
-
-func (enc *Encoder) eArrayOfTables(key Key, rv reflect.Value) {
- if len(key) == 0 {
- encPanic(errNoKey)
- }
- for i := 0; i < rv.Len(); i++ {
- trv := rv.Index(i)
- if isNil(trv) {
- continue
- }
- panicIfInvalidKey(key)
- enc.newline()
- enc.wf("%s[[%s]]", enc.indentStr(key), key.maybeQuotedAll())
- enc.newline()
- enc.eMapOrStruct(key, trv)
- }
-}
-
-func (enc *Encoder) eTable(key Key, rv reflect.Value) {
- panicIfInvalidKey(key)
- if len(key) == 1 {
- // Output an extra newline between top-level tables.
- // (The newline isn't written if nothing else has been written though.)
- enc.newline()
- }
- if len(key) > 0 {
- enc.wf("%s[%s]", enc.indentStr(key), key.maybeQuotedAll())
- enc.newline()
- }
- enc.eMapOrStruct(key, rv)
-}
-
-func (enc *Encoder) eMapOrStruct(key Key, rv reflect.Value) {
- switch rv := eindirect(rv); rv.Kind() {
- case reflect.Map:
- enc.eMap(key, rv)
- case reflect.Struct:
- enc.eStruct(key, rv)
- default:
- panic("eTable: unhandled reflect.Value Kind: " + rv.Kind().String())
- }
-}
-
-func (enc *Encoder) eMap(key Key, rv reflect.Value) {
- rt := rv.Type()
- if rt.Key().Kind() != reflect.String {
- encPanic(errNonString)
- }
-
- // Sort keys so that we have deterministic output. And write keys directly
- // underneath this key first, before writing sub-structs or sub-maps.
- var mapKeysDirect, mapKeysSub []string
- for _, mapKey := range rv.MapKeys() {
- k := mapKey.String()
- if typeIsHash(tomlTypeOfGo(rv.MapIndex(mapKey))) {
- mapKeysSub = append(mapKeysSub, k)
- } else {
- mapKeysDirect = append(mapKeysDirect, k)
- }
- }
-
- var writeMapKeys = func(mapKeys []string) {
- sort.Strings(mapKeys)
- for _, mapKey := range mapKeys {
- mrv := rv.MapIndex(reflect.ValueOf(mapKey))
- if isNil(mrv) {
- // Don't write anything for nil fields.
- continue
- }
- enc.encode(key.add(mapKey), mrv)
- }
- }
- writeMapKeys(mapKeysDirect)
- writeMapKeys(mapKeysSub)
-}
-
-func (enc *Encoder) eStruct(key Key, rv reflect.Value) {
- // Write keys for fields directly under this key first, because if we write
- // a field that creates a new table, then all keys under it will be in that
- // table (not the one we're writing here).
- rt := rv.Type()
- var fieldsDirect, fieldsSub [][]int
- var addFields func(rt reflect.Type, rv reflect.Value, start []int)
- addFields = func(rt reflect.Type, rv reflect.Value, start []int) {
- for i := 0; i < rt.NumField(); i++ {
- f := rt.Field(i)
- // skip unexported fields
- if f.PkgPath != "" && !f.Anonymous {
- continue
- }
- frv := rv.Field(i)
- if f.Anonymous {
- t := f.Type
- switch t.Kind() {
- case reflect.Struct:
- // Treat anonymous struct fields with
- // tag names as though they are not
- // anonymous, like encoding/json does.
- if getOptions(f.Tag).name == "" {
- addFields(t, frv, f.Index)
- continue
- }
- case reflect.Ptr:
- if t.Elem().Kind() == reflect.Struct &&
- getOptions(f.Tag).name == "" {
- if !frv.IsNil() {
- addFields(t.Elem(), frv.Elem(), f.Index)
- }
- continue
- }
- // Fall through to the normal field encoding logic below
- // for non-struct anonymous fields.
- }
- }
-
- if typeIsHash(tomlTypeOfGo(frv)) {
- fieldsSub = append(fieldsSub, append(start, f.Index...))
- } else {
- fieldsDirect = append(fieldsDirect, append(start, f.Index...))
- }
- }
- }
- addFields(rt, rv, nil)
-
- var writeFields = func(fields [][]int) {
- for _, fieldIndex := range fields {
- sft := rt.FieldByIndex(fieldIndex)
- sf := rv.FieldByIndex(fieldIndex)
- if isNil(sf) {
- // Don't write anything for nil fields.
- continue
- }
-
- opts := getOptions(sft.Tag)
- if opts.skip {
- continue
- }
- keyName := sft.Name
- if opts.name != "" {
- keyName = opts.name
- }
- if opts.omitempty && isEmpty(sf) {
- continue
- }
- if opts.omitzero && isZero(sf) {
- continue
- }
-
- enc.encode(key.add(keyName), sf)
- }
- }
- writeFields(fieldsDirect)
- writeFields(fieldsSub)
-}
-
-// tomlTypeName returns the TOML type name of the Go value's type. It is
-// used to determine whether the types of array elements are mixed (which is
-// forbidden). If the Go value is nil, then it is illegal for it to be an array
-// element, and valueIsNil is returned as true.
-
-// Returns the TOML type of a Go value. The type may be `nil`, which means
-// no concrete TOML type could be found.
-func tomlTypeOfGo(rv reflect.Value) tomlType {
- if isNil(rv) || !rv.IsValid() {
- return nil
- }
- switch rv.Kind() {
- case reflect.Bool:
- return tomlBool
- case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32,
- reflect.Int64,
- reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32,
- reflect.Uint64:
- return tomlInteger
- case reflect.Float32, reflect.Float64:
- return tomlFloat
- case reflect.Array, reflect.Slice:
- if typeEqual(tomlHash, tomlArrayType(rv)) {
- return tomlArrayHash
- }
- return tomlArray
- case reflect.Ptr, reflect.Interface:
- return tomlTypeOfGo(rv.Elem())
- case reflect.String:
- return tomlString
- case reflect.Map:
- return tomlHash
- case reflect.Struct:
- switch rv.Interface().(type) {
- case time.Time:
- return tomlDatetime
- case TextMarshaler:
- return tomlString
- default:
- return tomlHash
- }
- default:
- panic("unexpected reflect.Kind: " + rv.Kind().String())
- }
-}
-
-// tomlArrayType returns the element type of a TOML array. The type returned
-// may be nil if it cannot be determined (e.g., a nil slice or a zero length
-// slize). This function may also panic if it finds a type that cannot be
-// expressed in TOML (such as nil elements, heterogeneous arrays or directly
-// nested arrays of tables).
-func tomlArrayType(rv reflect.Value) tomlType {
- if isNil(rv) || !rv.IsValid() || rv.Len() == 0 {
- return nil
- }
- firstType := tomlTypeOfGo(rv.Index(0))
- if firstType == nil {
- encPanic(errArrayNilElement)
- }
-
- rvlen := rv.Len()
- for i := 1; i < rvlen; i++ {
- elem := rv.Index(i)
- switch elemType := tomlTypeOfGo(elem); {
- case elemType == nil:
- encPanic(errArrayNilElement)
- case !typeEqual(firstType, elemType):
- encPanic(errArrayMixedElementTypes)
- }
- }
- // If we have a nested array, then we must make sure that the nested
- // array contains ONLY primitives.
- // This checks arbitrarily nested arrays.
- if typeEqual(firstType, tomlArray) || typeEqual(firstType, tomlArrayHash) {
- nest := tomlArrayType(eindirect(rv.Index(0)))
- if typeEqual(nest, tomlHash) || typeEqual(nest, tomlArrayHash) {
- encPanic(errArrayNoTable)
- }
- }
- return firstType
-}
-
-type tagOptions struct {
- skip bool // "-"
- name string
- omitempty bool
- omitzero bool
-}
-
-func getOptions(tag reflect.StructTag) tagOptions {
- t := tag.Get("toml")
- if t == "-" {
- return tagOptions{skip: true}
- }
- var opts tagOptions
- parts := strings.Split(t, ",")
- opts.name = parts[0]
- for _, s := range parts[1:] {
- switch s {
- case "omitempty":
- opts.omitempty = true
- case "omitzero":
- opts.omitzero = true
- }
- }
- return opts
-}
-
-func isZero(rv reflect.Value) bool {
- switch rv.Kind() {
- case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- return rv.Int() == 0
- case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
- return rv.Uint() == 0
- case reflect.Float32, reflect.Float64:
- return rv.Float() == 0.0
- }
- return false
-}
-
-func isEmpty(rv reflect.Value) bool {
- switch rv.Kind() {
- case reflect.Array, reflect.Slice, reflect.Map, reflect.String:
- return rv.Len() == 0
- case reflect.Bool:
- return !rv.Bool()
- }
- return false
-}
-
-func (enc *Encoder) newline() {
- if enc.hasWritten {
- enc.wf("\n")
- }
-}
-
-func (enc *Encoder) keyEqElement(key Key, val reflect.Value) {
- if len(key) == 0 {
- encPanic(errNoKey)
- }
- panicIfInvalidKey(key)
- enc.wf("%s%s = ", enc.indentStr(key), key.maybeQuoted(len(key)-1))
- enc.eElement(val)
- enc.newline()
-}
-
-func (enc *Encoder) wf(format string, v ...interface{}) {
- if _, err := fmt.Fprintf(enc.w, format, v...); err != nil {
- encPanic(err)
- }
- enc.hasWritten = true
-}
-
-func (enc *Encoder) indentStr(key Key) string {
- return strings.Repeat(enc.Indent, len(key)-1)
-}
-
-func encPanic(err error) {
- panic(tomlEncodeError{err})
-}
-
-func eindirect(v reflect.Value) reflect.Value {
- switch v.Kind() {
- case reflect.Ptr, reflect.Interface:
- return eindirect(v.Elem())
- default:
- return v
- }
-}
-
-func isNil(rv reflect.Value) bool {
- switch rv.Kind() {
- case reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice:
- return rv.IsNil()
- default:
- return false
- }
-}
-
-func panicIfInvalidKey(key Key) {
- for _, k := range key {
- if len(k) == 0 {
- encPanic(e("Key '%s' is not a valid table name. Key names "+
- "cannot be empty.", key.maybeQuotedAll()))
- }
- }
-}
-
-func isValidKeyName(s string) bool {
- return len(s) != 0
-}
diff --git a/vendor/github.com/BurntSushi/toml/encoding_types.go b/vendor/github.com/BurntSushi/toml/encoding_types.go
deleted file mode 100644
index d36e1dd60..000000000
--- a/vendor/github.com/BurntSushi/toml/encoding_types.go
+++ /dev/null
@@ -1,19 +0,0 @@
-// +build go1.2
-
-package toml
-
-// In order to support Go 1.1, we define our own TextMarshaler and
-// TextUnmarshaler types. For Go 1.2+, we just alias them with the
-// standard library interfaces.
-
-import (
- "encoding"
-)
-
-// TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here
-// so that Go 1.1 can be supported.
-type TextMarshaler encoding.TextMarshaler
-
-// TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined
-// here so that Go 1.1 can be supported.
-type TextUnmarshaler encoding.TextUnmarshaler
diff --git a/vendor/github.com/BurntSushi/toml/encoding_types_1.1.go b/vendor/github.com/BurntSushi/toml/encoding_types_1.1.go
deleted file mode 100644
index e8d503d04..000000000
--- a/vendor/github.com/BurntSushi/toml/encoding_types_1.1.go
+++ /dev/null
@@ -1,18 +0,0 @@
-// +build !go1.2
-
-package toml
-
-// These interfaces were introduced in Go 1.2, so we add them manually when
-// compiling for Go 1.1.
-
-// TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here
-// so that Go 1.1 can be supported.
-type TextMarshaler interface {
- MarshalText() (text []byte, err error)
-}
-
-// TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined
-// here so that Go 1.1 can be supported.
-type TextUnmarshaler interface {
- UnmarshalText(text []byte) error
-}
diff --git a/vendor/github.com/BurntSushi/toml/lex.go b/vendor/github.com/BurntSushi/toml/lex.go
deleted file mode 100644
index e0a742a88..000000000
--- a/vendor/github.com/BurntSushi/toml/lex.go
+++ /dev/null
@@ -1,953 +0,0 @@
-package toml
-
-import (
- "fmt"
- "strings"
- "unicode"
- "unicode/utf8"
-)
-
-type itemType int
-
-const (
- itemError itemType = iota
- itemNIL // used in the parser to indicate no type
- itemEOF
- itemText
- itemString
- itemRawString
- itemMultilineString
- itemRawMultilineString
- itemBool
- itemInteger
- itemFloat
- itemDatetime
- itemArray // the start of an array
- itemArrayEnd
- itemTableStart
- itemTableEnd
- itemArrayTableStart
- itemArrayTableEnd
- itemKeyStart
- itemCommentStart
- itemInlineTableStart
- itemInlineTableEnd
-)
-
-const (
- eof = 0
- comma = ','
- tableStart = '['
- tableEnd = ']'
- arrayTableStart = '['
- arrayTableEnd = ']'
- tableSep = '.'
- keySep = '='
- arrayStart = '['
- arrayEnd = ']'
- commentStart = '#'
- stringStart = '"'
- stringEnd = '"'
- rawStringStart = '\''
- rawStringEnd = '\''
- inlineTableStart = '{'
- inlineTableEnd = '}'
-)
-
-type stateFn func(lx *lexer) stateFn
-
-type lexer struct {
- input string
- start int
- pos int
- line int
- state stateFn
- items chan item
-
- // Allow for backing up up to three runes.
- // This is necessary because TOML contains 3-rune tokens (""" and ''').
- prevWidths [3]int
- nprev int // how many of prevWidths are in use
- // If we emit an eof, we can still back up, but it is not OK to call
- // next again.
- atEOF bool
-
- // A stack of state functions used to maintain context.
- // The idea is to reuse parts of the state machine in various places.
- // For example, values can appear at the top level or within arbitrarily
- // nested arrays. The last state on the stack is used after a value has
- // been lexed. Similarly for comments.
- stack []stateFn
-}
-
-type item struct {
- typ itemType
- val string
- line int
-}
-
-func (lx *lexer) nextItem() item {
- for {
- select {
- case item := <-lx.items:
- return item
- default:
- lx.state = lx.state(lx)
- }
- }
-}
-
-func lex(input string) *lexer {
- lx := &lexer{
- input: input,
- state: lexTop,
- line: 1,
- items: make(chan item, 10),
- stack: make([]stateFn, 0, 10),
- }
- return lx
-}
-
-func (lx *lexer) push(state stateFn) {
- lx.stack = append(lx.stack, state)
-}
-
-func (lx *lexer) pop() stateFn {
- if len(lx.stack) == 0 {
- return lx.errorf("BUG in lexer: no states to pop")
- }
- last := lx.stack[len(lx.stack)-1]
- lx.stack = lx.stack[0 : len(lx.stack)-1]
- return last
-}
-
-func (lx *lexer) current() string {
- return lx.input[lx.start:lx.pos]
-}
-
-func (lx *lexer) emit(typ itemType) {
- lx.items <- item{typ, lx.current(), lx.line}
- lx.start = lx.pos
-}
-
-func (lx *lexer) emitTrim(typ itemType) {
- lx.items <- item{typ, strings.TrimSpace(lx.current()), lx.line}
- lx.start = lx.pos
-}
-
-func (lx *lexer) next() (r rune) {
- if lx.atEOF {
- panic("next called after EOF")
- }
- if lx.pos >= len(lx.input) {
- lx.atEOF = true
- return eof
- }
-
- if lx.input[lx.pos] == '\n' {
- lx.line++
- }
- lx.prevWidths[2] = lx.prevWidths[1]
- lx.prevWidths[1] = lx.prevWidths[0]
- if lx.nprev < 3 {
- lx.nprev++
- }
- r, w := utf8.DecodeRuneInString(lx.input[lx.pos:])
- lx.prevWidths[0] = w
- lx.pos += w
- return r
-}
-
-// ignore skips over the pending input before this point.
-func (lx *lexer) ignore() {
- lx.start = lx.pos
-}
-
-// backup steps back one rune. Can be called only twice between calls to next.
-func (lx *lexer) backup() {
- if lx.atEOF {
- lx.atEOF = false
- return
- }
- if lx.nprev < 1 {
- panic("backed up too far")
- }
- w := lx.prevWidths[0]
- lx.prevWidths[0] = lx.prevWidths[1]
- lx.prevWidths[1] = lx.prevWidths[2]
- lx.nprev--
- lx.pos -= w
- if lx.pos < len(lx.input) && lx.input[lx.pos] == '\n' {
- lx.line--
- }
-}
-
-// accept consumes the next rune if it's equal to `valid`.
-func (lx *lexer) accept(valid rune) bool {
- if lx.next() == valid {
- return true
- }
- lx.backup()
- return false
-}
-
-// peek returns but does not consume the next rune in the input.
-func (lx *lexer) peek() rune {
- r := lx.next()
- lx.backup()
- return r
-}
-
-// skip ignores all input that matches the given predicate.
-func (lx *lexer) skip(pred func(rune) bool) {
- for {
- r := lx.next()
- if pred(r) {
- continue
- }
- lx.backup()
- lx.ignore()
- return
- }
-}
-
-// errorf stops all lexing by emitting an error and returning `nil`.
-// Note that any value that is a character is escaped if it's a special
-// character (newlines, tabs, etc.).
-func (lx *lexer) errorf(format string, values ...interface{}) stateFn {
- lx.items <- item{
- itemError,
- fmt.Sprintf(format, values...),
- lx.line,
- }
- return nil
-}
-
-// lexTop consumes elements at the top level of TOML data.
-func lexTop(lx *lexer) stateFn {
- r := lx.next()
- if isWhitespace(r) || isNL(r) {
- return lexSkip(lx, lexTop)
- }
- switch r {
- case commentStart:
- lx.push(lexTop)
- return lexCommentStart
- case tableStart:
- return lexTableStart
- case eof:
- if lx.pos > lx.start {
- return lx.errorf("unexpected EOF")
- }
- lx.emit(itemEOF)
- return nil
- }
-
- // At this point, the only valid item can be a key, so we back up
- // and let the key lexer do the rest.
- lx.backup()
- lx.push(lexTopEnd)
- return lexKeyStart
-}
-
-// lexTopEnd is entered whenever a top-level item has been consumed. (A value
-// or a table.) It must see only whitespace, and will turn back to lexTop
-// upon a newline. If it sees EOF, it will quit the lexer successfully.
-func lexTopEnd(lx *lexer) stateFn {
- r := lx.next()
- switch {
- case r == commentStart:
- // a comment will read to a newline for us.
- lx.push(lexTop)
- return lexCommentStart
- case isWhitespace(r):
- return lexTopEnd
- case isNL(r):
- lx.ignore()
- return lexTop
- case r == eof:
- lx.emit(itemEOF)
- return nil
- }
- return lx.errorf("expected a top-level item to end with a newline, "+
- "comment, or EOF, but got %q instead", r)
-}
-
-// lexTable lexes the beginning of a table. Namely, it makes sure that
-// it starts with a character other than '.' and ']'.
-// It assumes that '[' has already been consumed.
-// It also handles the case that this is an item in an array of tables.
-// e.g., '[[name]]'.
-func lexTableStart(lx *lexer) stateFn {
- if lx.peek() == arrayTableStart {
- lx.next()
- lx.emit(itemArrayTableStart)
- lx.push(lexArrayTableEnd)
- } else {
- lx.emit(itemTableStart)
- lx.push(lexTableEnd)
- }
- return lexTableNameStart
-}
-
-func lexTableEnd(lx *lexer) stateFn {
- lx.emit(itemTableEnd)
- return lexTopEnd
-}
-
-func lexArrayTableEnd(lx *lexer) stateFn {
- if r := lx.next(); r != arrayTableEnd {
- return lx.errorf("expected end of table array name delimiter %q, "+
- "but got %q instead", arrayTableEnd, r)
- }
- lx.emit(itemArrayTableEnd)
- return lexTopEnd
-}
-
-func lexTableNameStart(lx *lexer) stateFn {
- lx.skip(isWhitespace)
- switch r := lx.peek(); {
- case r == tableEnd || r == eof:
- return lx.errorf("unexpected end of table name " +
- "(table names cannot be empty)")
- case r == tableSep:
- return lx.errorf("unexpected table separator " +
- "(table names cannot be empty)")
- case r == stringStart || r == rawStringStart:
- lx.ignore()
- lx.push(lexTableNameEnd)
- return lexValue // reuse string lexing
- default:
- return lexBareTableName
- }
-}
-
-// lexBareTableName lexes the name of a table. It assumes that at least one
-// valid character for the table has already been read.
-func lexBareTableName(lx *lexer) stateFn {
- r := lx.next()
- if isBareKeyChar(r) {
- return lexBareTableName
- }
- lx.backup()
- lx.emit(itemText)
- return lexTableNameEnd
-}
-
-// lexTableNameEnd reads the end of a piece of a table name, optionally
-// consuming whitespace.
-func lexTableNameEnd(lx *lexer) stateFn {
- lx.skip(isWhitespace)
- switch r := lx.next(); {
- case isWhitespace(r):
- return lexTableNameEnd
- case r == tableSep:
- lx.ignore()
- return lexTableNameStart
- case r == tableEnd:
- return lx.pop()
- default:
- return lx.errorf("expected '.' or ']' to end table name, "+
- "but got %q instead", r)
- }
-}
-
-// lexKeyStart consumes a key name up until the first non-whitespace character.
-// lexKeyStart will ignore whitespace.
-func lexKeyStart(lx *lexer) stateFn {
- r := lx.peek()
- switch {
- case r == keySep:
- return lx.errorf("unexpected key separator %q", keySep)
- case isWhitespace(r) || isNL(r):
- lx.next()
- return lexSkip(lx, lexKeyStart)
- case r == stringStart || r == rawStringStart:
- lx.ignore()
- lx.emit(itemKeyStart)
- lx.push(lexKeyEnd)
- return lexValue // reuse string lexing
- default:
- lx.ignore()
- lx.emit(itemKeyStart)
- return lexBareKey
- }
-}
-
-// lexBareKey consumes the text of a bare key. Assumes that the first character
-// (which is not whitespace) has not yet been consumed.
-func lexBareKey(lx *lexer) stateFn {
- switch r := lx.next(); {
- case isBareKeyChar(r):
- return lexBareKey
- case isWhitespace(r):
- lx.backup()
- lx.emit(itemText)
- return lexKeyEnd
- case r == keySep:
- lx.backup()
- lx.emit(itemText)
- return lexKeyEnd
- default:
- return lx.errorf("bare keys cannot contain %q", r)
- }
-}
-
-// lexKeyEnd consumes the end of a key and trims whitespace (up to the key
-// separator).
-func lexKeyEnd(lx *lexer) stateFn {
- switch r := lx.next(); {
- case r == keySep:
- return lexSkip(lx, lexValue)
- case isWhitespace(r):
- return lexSkip(lx, lexKeyEnd)
- default:
- return lx.errorf("expected key separator %q, but got %q instead",
- keySep, r)
- }
-}
-
-// lexValue starts the consumption of a value anywhere a value is expected.
-// lexValue will ignore whitespace.
-// After a value is lexed, the last state on the next is popped and returned.
-func lexValue(lx *lexer) stateFn {
- // We allow whitespace to precede a value, but NOT newlines.
- // In array syntax, the array states are responsible for ignoring newlines.
- r := lx.next()
- switch {
- case isWhitespace(r):
- return lexSkip(lx, lexValue)
- case isDigit(r):
- lx.backup() // avoid an extra state and use the same as above
- return lexNumberOrDateStart
- }
- switch r {
- case arrayStart:
- lx.ignore()
- lx.emit(itemArray)
- return lexArrayValue
- case inlineTableStart:
- lx.ignore()
- lx.emit(itemInlineTableStart)
- return lexInlineTableValue
- case stringStart:
- if lx.accept(stringStart) {
- if lx.accept(stringStart) {
- lx.ignore() // Ignore """
- return lexMultilineString
- }
- lx.backup()
- }
- lx.ignore() // ignore the '"'
- return lexString
- case rawStringStart:
- if lx.accept(rawStringStart) {
- if lx.accept(rawStringStart) {
- lx.ignore() // Ignore """
- return lexMultilineRawString
- }
- lx.backup()
- }
- lx.ignore() // ignore the "'"
- return lexRawString
- case '+', '-':
- return lexNumberStart
- case '.': // special error case, be kind to users
- return lx.errorf("floats must start with a digit, not '.'")
- }
- if unicode.IsLetter(r) {
- // Be permissive here; lexBool will give a nice error if the
- // user wrote something like
- // x = foo
- // (i.e. not 'true' or 'false' but is something else word-like.)
- lx.backup()
- return lexBool
- }
- return lx.errorf("expected value but found %q instead", r)
-}
-
-// lexArrayValue consumes one value in an array. It assumes that '[' or ','
-// have already been consumed. All whitespace and newlines are ignored.
-func lexArrayValue(lx *lexer) stateFn {
- r := lx.next()
- switch {
- case isWhitespace(r) || isNL(r):
- return lexSkip(lx, lexArrayValue)
- case r == commentStart:
- lx.push(lexArrayValue)
- return lexCommentStart
- case r == comma:
- return lx.errorf("unexpected comma")
- case r == arrayEnd:
- // NOTE(caleb): The spec isn't clear about whether you can have
- // a trailing comma or not, so we'll allow it.
- return lexArrayEnd
- }
-
- lx.backup()
- lx.push(lexArrayValueEnd)
- return lexValue
-}
-
-// lexArrayValueEnd consumes everything between the end of an array value and
-// the next value (or the end of the array): it ignores whitespace and newlines
-// and expects either a ',' or a ']'.
-func lexArrayValueEnd(lx *lexer) stateFn {
- r := lx.next()
- switch {
- case isWhitespace(r) || isNL(r):
- return lexSkip(lx, lexArrayValueEnd)
- case r == commentStart:
- lx.push(lexArrayValueEnd)
- return lexCommentStart
- case r == comma:
- lx.ignore()
- return lexArrayValue // move on to the next value
- case r == arrayEnd:
- return lexArrayEnd
- }
- return lx.errorf(
- "expected a comma or array terminator %q, but got %q instead",
- arrayEnd, r,
- )
-}
-
-// lexArrayEnd finishes the lexing of an array.
-// It assumes that a ']' has just been consumed.
-func lexArrayEnd(lx *lexer) stateFn {
- lx.ignore()
- lx.emit(itemArrayEnd)
- return lx.pop()
-}
-
-// lexInlineTableValue consumes one key/value pair in an inline table.
-// It assumes that '{' or ',' have already been consumed. Whitespace is ignored.
-func lexInlineTableValue(lx *lexer) stateFn {
- r := lx.next()
- switch {
- case isWhitespace(r):
- return lexSkip(lx, lexInlineTableValue)
- case isNL(r):
- return lx.errorf("newlines not allowed within inline tables")
- case r == commentStart:
- lx.push(lexInlineTableValue)
- return lexCommentStart
- case r == comma:
- return lx.errorf("unexpected comma")
- case r == inlineTableEnd:
- return lexInlineTableEnd
- }
- lx.backup()
- lx.push(lexInlineTableValueEnd)
- return lexKeyStart
-}
-
-// lexInlineTableValueEnd consumes everything between the end of an inline table
-// key/value pair and the next pair (or the end of the table):
-// it ignores whitespace and expects either a ',' or a '}'.
-func lexInlineTableValueEnd(lx *lexer) stateFn {
- r := lx.next()
- switch {
- case isWhitespace(r):
- return lexSkip(lx, lexInlineTableValueEnd)
- case isNL(r):
- return lx.errorf("newlines not allowed within inline tables")
- case r == commentStart:
- lx.push(lexInlineTableValueEnd)
- return lexCommentStart
- case r == comma:
- lx.ignore()
- return lexInlineTableValue
- case r == inlineTableEnd:
- return lexInlineTableEnd
- }
- return lx.errorf("expected a comma or an inline table terminator %q, "+
- "but got %q instead", inlineTableEnd, r)
-}
-
-// lexInlineTableEnd finishes the lexing of an inline table.
-// It assumes that a '}' has just been consumed.
-func lexInlineTableEnd(lx *lexer) stateFn {
- lx.ignore()
- lx.emit(itemInlineTableEnd)
- return lx.pop()
-}
-
-// lexString consumes the inner contents of a string. It assumes that the
-// beginning '"' has already been consumed and ignored.
-func lexString(lx *lexer) stateFn {
- r := lx.next()
- switch {
- case r == eof:
- return lx.errorf("unexpected EOF")
- case isNL(r):
- return lx.errorf("strings cannot contain newlines")
- case r == '\\':
- lx.push(lexString)
- return lexStringEscape
- case r == stringEnd:
- lx.backup()
- lx.emit(itemString)
- lx.next()
- lx.ignore()
- return lx.pop()
- }
- return lexString
-}
-
-// lexMultilineString consumes the inner contents of a string. It assumes that
-// the beginning '"""' has already been consumed and ignored.
-func lexMultilineString(lx *lexer) stateFn {
- switch lx.next() {
- case eof:
- return lx.errorf("unexpected EOF")
- case '\\':
- return lexMultilineStringEscape
- case stringEnd:
- if lx.accept(stringEnd) {
- if lx.accept(stringEnd) {
- lx.backup()
- lx.backup()
- lx.backup()
- lx.emit(itemMultilineString)
- lx.next()
- lx.next()
- lx.next()
- lx.ignore()
- return lx.pop()
- }
- lx.backup()
- }
- }
- return lexMultilineString
-}
-
-// lexRawString consumes a raw string. Nothing can be escaped in such a string.
-// It assumes that the beginning "'" has already been consumed and ignored.
-func lexRawString(lx *lexer) stateFn {
- r := lx.next()
- switch {
- case r == eof:
- return lx.errorf("unexpected EOF")
- case isNL(r):
- return lx.errorf("strings cannot contain newlines")
- case r == rawStringEnd:
- lx.backup()
- lx.emit(itemRawString)
- lx.next()
- lx.ignore()
- return lx.pop()
- }
- return lexRawString
-}
-
-// lexMultilineRawString consumes a raw string. Nothing can be escaped in such
-// a string. It assumes that the beginning "'''" has already been consumed and
-// ignored.
-func lexMultilineRawString(lx *lexer) stateFn {
- switch lx.next() {
- case eof:
- return lx.errorf("unexpected EOF")
- case rawStringEnd:
- if lx.accept(rawStringEnd) {
- if lx.accept(rawStringEnd) {
- lx.backup()
- lx.backup()
- lx.backup()
- lx.emit(itemRawMultilineString)
- lx.next()
- lx.next()
- lx.next()
- lx.ignore()
- return lx.pop()
- }
- lx.backup()
- }
- }
- return lexMultilineRawString
-}
-
-// lexMultilineStringEscape consumes an escaped character. It assumes that the
-// preceding '\\' has already been consumed.
-func lexMultilineStringEscape(lx *lexer) stateFn {
- // Handle the special case first:
- if isNL(lx.next()) {
- return lexMultilineString
- }
- lx.backup()
- lx.push(lexMultilineString)
- return lexStringEscape(lx)
-}
-
-func lexStringEscape(lx *lexer) stateFn {
- r := lx.next()
- switch r {
- case 'b':
- fallthrough
- case 't':
- fallthrough
- case 'n':
- fallthrough
- case 'f':
- fallthrough
- case 'r':
- fallthrough
- case '"':
- fallthrough
- case '\\':
- return lx.pop()
- case 'u':
- return lexShortUnicodeEscape
- case 'U':
- return lexLongUnicodeEscape
- }
- return lx.errorf("invalid escape character %q; only the following "+
- "escape characters are allowed: "+
- `\b, \t, \n, \f, \r, \", \\, \uXXXX, and \UXXXXXXXX`, r)
-}
-
-func lexShortUnicodeEscape(lx *lexer) stateFn {
- var r rune
- for i := 0; i < 4; i++ {
- r = lx.next()
- if !isHexadecimal(r) {
- return lx.errorf(`expected four hexadecimal digits after '\u', `+
- "but got %q instead", lx.current())
- }
- }
- return lx.pop()
-}
-
-func lexLongUnicodeEscape(lx *lexer) stateFn {
- var r rune
- for i := 0; i < 8; i++ {
- r = lx.next()
- if !isHexadecimal(r) {
- return lx.errorf(`expected eight hexadecimal digits after '\U', `+
- "but got %q instead", lx.current())
- }
- }
- return lx.pop()
-}
-
-// lexNumberOrDateStart consumes either an integer, a float, or datetime.
-func lexNumberOrDateStart(lx *lexer) stateFn {
- r := lx.next()
- if isDigit(r) {
- return lexNumberOrDate
- }
- switch r {
- case '_':
- return lexNumber
- case 'e', 'E':
- return lexFloat
- case '.':
- return lx.errorf("floats must start with a digit, not '.'")
- }
- return lx.errorf("expected a digit but got %q", r)
-}
-
-// lexNumberOrDate consumes either an integer, float or datetime.
-func lexNumberOrDate(lx *lexer) stateFn {
- r := lx.next()
- if isDigit(r) {
- return lexNumberOrDate
- }
- switch r {
- case '-':
- return lexDatetime
- case '_':
- return lexNumber
- case '.', 'e', 'E':
- return lexFloat
- }
-
- lx.backup()
- lx.emit(itemInteger)
- return lx.pop()
-}
-
-// lexDatetime consumes a Datetime, to a first approximation.
-// The parser validates that it matches one of the accepted formats.
-func lexDatetime(lx *lexer) stateFn {
- r := lx.next()
- if isDigit(r) {
- return lexDatetime
- }
- switch r {
- case '-', 'T', ':', '.', 'Z', '+':
- return lexDatetime
- }
-
- lx.backup()
- lx.emit(itemDatetime)
- return lx.pop()
-}
-
-// lexNumberStart consumes either an integer or a float. It assumes that a sign
-// has already been read, but that *no* digits have been consumed.
-// lexNumberStart will move to the appropriate integer or float states.
-func lexNumberStart(lx *lexer) stateFn {
- // We MUST see a digit. Even floats have to start with a digit.
- r := lx.next()
- if !isDigit(r) {
- if r == '.' {
- return lx.errorf("floats must start with a digit, not '.'")
- }
- return lx.errorf("expected a digit but got %q", r)
- }
- return lexNumber
-}
-
-// lexNumber consumes an integer or a float after seeing the first digit.
-func lexNumber(lx *lexer) stateFn {
- r := lx.next()
- if isDigit(r) {
- return lexNumber
- }
- switch r {
- case '_':
- return lexNumber
- case '.', 'e', 'E':
- return lexFloat
- }
-
- lx.backup()
- lx.emit(itemInteger)
- return lx.pop()
-}
-
-// lexFloat consumes the elements of a float. It allows any sequence of
-// float-like characters, so floats emitted by the lexer are only a first
-// approximation and must be validated by the parser.
-func lexFloat(lx *lexer) stateFn {
- r := lx.next()
- if isDigit(r) {
- return lexFloat
- }
- switch r {
- case '_', '.', '-', '+', 'e', 'E':
- return lexFloat
- }
-
- lx.backup()
- lx.emit(itemFloat)
- return lx.pop()
-}
-
-// lexBool consumes a bool string: 'true' or 'false.
-func lexBool(lx *lexer) stateFn {
- var rs []rune
- for {
- r := lx.next()
- if !unicode.IsLetter(r) {
- lx.backup()
- break
- }
- rs = append(rs, r)
- }
- s := string(rs)
- switch s {
- case "true", "false":
- lx.emit(itemBool)
- return lx.pop()
- }
- return lx.errorf("expected value but found %q instead", s)
-}
-
-// lexCommentStart begins the lexing of a comment. It will emit
-// itemCommentStart and consume no characters, passing control to lexComment.
-func lexCommentStart(lx *lexer) stateFn {
- lx.ignore()
- lx.emit(itemCommentStart)
- return lexComment
-}
-
-// lexComment lexes an entire comment. It assumes that '#' has been consumed.
-// It will consume *up to* the first newline character, and pass control
-// back to the last state on the stack.
-func lexComment(lx *lexer) stateFn {
- r := lx.peek()
- if isNL(r) || r == eof {
- lx.emit(itemText)
- return lx.pop()
- }
- lx.next()
- return lexComment
-}
-
-// lexSkip ignores all slurped input and moves on to the next state.
-func lexSkip(lx *lexer, nextState stateFn) stateFn {
- return func(lx *lexer) stateFn {
- lx.ignore()
- return nextState
- }
-}
-
-// isWhitespace returns true if `r` is a whitespace character according
-// to the spec.
-func isWhitespace(r rune) bool {
- return r == '\t' || r == ' '
-}
-
-func isNL(r rune) bool {
- return r == '\n' || r == '\r'
-}
-
-func isDigit(r rune) bool {
- return r >= '0' && r <= '9'
-}
-
-func isHexadecimal(r rune) bool {
- return (r >= '0' && r <= '9') ||
- (r >= 'a' && r <= 'f') ||
- (r >= 'A' && r <= 'F')
-}
-
-func isBareKeyChar(r rune) bool {
- return (r >= 'A' && r <= 'Z') ||
- (r >= 'a' && r <= 'z') ||
- (r >= '0' && r <= '9') ||
- r == '_' ||
- r == '-'
-}
-
-func (itype itemType) String() string {
- switch itype {
- case itemError:
- return "Error"
- case itemNIL:
- return "NIL"
- case itemEOF:
- return "EOF"
- case itemText:
- return "Text"
- case itemString, itemRawString, itemMultilineString, itemRawMultilineString:
- return "String"
- case itemBool:
- return "Bool"
- case itemInteger:
- return "Integer"
- case itemFloat:
- return "Float"
- case itemDatetime:
- return "DateTime"
- case itemTableStart:
- return "TableStart"
- case itemTableEnd:
- return "TableEnd"
- case itemKeyStart:
- return "KeyStart"
- case itemArray:
- return "Array"
- case itemArrayEnd:
- return "ArrayEnd"
- case itemCommentStart:
- return "CommentStart"
- }
- panic(fmt.Sprintf("BUG: Unknown type '%d'.", int(itype)))
-}
-
-func (item item) String() string {
- return fmt.Sprintf("(%s, %s)", item.typ.String(), item.val)
-}
diff --git a/vendor/github.com/BurntSushi/toml/parse.go b/vendor/github.com/BurntSushi/toml/parse.go
deleted file mode 100644
index 50869ef92..000000000
--- a/vendor/github.com/BurntSushi/toml/parse.go
+++ /dev/null
@@ -1,592 +0,0 @@
-package toml
-
-import (
- "fmt"
- "strconv"
- "strings"
- "time"
- "unicode"
- "unicode/utf8"
-)
-
-type parser struct {
- mapping map[string]interface{}
- types map[string]tomlType
- lx *lexer
-
- // A list of keys in the order that they appear in the TOML data.
- ordered []Key
-
- // the full key for the current hash in scope
- context Key
-
- // the base key name for everything except hashes
- currentKey string
-
- // rough approximation of line number
- approxLine int
-
- // A map of 'key.group.names' to whether they were created implicitly.
- implicits map[string]bool
-}
-
-type parseError string
-
-func (pe parseError) Error() string {
- return string(pe)
-}
-
-func parse(data string) (p *parser, err error) {
- defer func() {
- if r := recover(); r != nil {
- var ok bool
- if err, ok = r.(parseError); ok {
- return
- }
- panic(r)
- }
- }()
-
- p = &parser{
- mapping: make(map[string]interface{}),
- types: make(map[string]tomlType),
- lx: lex(data),
- ordered: make([]Key, 0),
- implicits: make(map[string]bool),
- }
- for {
- item := p.next()
- if item.typ == itemEOF {
- break
- }
- p.topLevel(item)
- }
-
- return p, nil
-}
-
-func (p *parser) panicf(format string, v ...interface{}) {
- msg := fmt.Sprintf("Near line %d (last key parsed '%s'): %s",
- p.approxLine, p.current(), fmt.Sprintf(format, v...))
- panic(parseError(msg))
-}
-
-func (p *parser) next() item {
- it := p.lx.nextItem()
- if it.typ == itemError {
- p.panicf("%s", it.val)
- }
- return it
-}
-
-func (p *parser) bug(format string, v ...interface{}) {
- panic(fmt.Sprintf("BUG: "+format+"\n\n", v...))
-}
-
-func (p *parser) expect(typ itemType) item {
- it := p.next()
- p.assertEqual(typ, it.typ)
- return it
-}
-
-func (p *parser) assertEqual(expected, got itemType) {
- if expected != got {
- p.bug("Expected '%s' but got '%s'.", expected, got)
- }
-}
-
-func (p *parser) topLevel(item item) {
- switch item.typ {
- case itemCommentStart:
- p.approxLine = item.line
- p.expect(itemText)
- case itemTableStart:
- kg := p.next()
- p.approxLine = kg.line
-
- var key Key
- for ; kg.typ != itemTableEnd && kg.typ != itemEOF; kg = p.next() {
- key = append(key, p.keyString(kg))
- }
- p.assertEqual(itemTableEnd, kg.typ)
-
- p.establishContext(key, false)
- p.setType("", tomlHash)
- p.ordered = append(p.ordered, key)
- case itemArrayTableStart:
- kg := p.next()
- p.approxLine = kg.line
-
- var key Key
- for ; kg.typ != itemArrayTableEnd && kg.typ != itemEOF; kg = p.next() {
- key = append(key, p.keyString(kg))
- }
- p.assertEqual(itemArrayTableEnd, kg.typ)
-
- p.establishContext(key, true)
- p.setType("", tomlArrayHash)
- p.ordered = append(p.ordered, key)
- case itemKeyStart:
- kname := p.next()
- p.approxLine = kname.line
- p.currentKey = p.keyString(kname)
-
- val, typ := p.value(p.next())
- p.setValue(p.currentKey, val)
- p.setType(p.currentKey, typ)
- p.ordered = append(p.ordered, p.context.add(p.currentKey))
- p.currentKey = ""
- default:
- p.bug("Unexpected type at top level: %s", item.typ)
- }
-}
-
-// Gets a string for a key (or part of a key in a table name).
-func (p *parser) keyString(it item) string {
- switch it.typ {
- case itemText:
- return it.val
- case itemString, itemMultilineString,
- itemRawString, itemRawMultilineString:
- s, _ := p.value(it)
- return s.(string)
- default:
- p.bug("Unexpected key type: %s", it.typ)
- panic("unreachable")
- }
-}
-
-// value translates an expected value from the lexer into a Go value wrapped
-// as an empty interface.
-func (p *parser) value(it item) (interface{}, tomlType) {
- switch it.typ {
- case itemString:
- return p.replaceEscapes(it.val), p.typeOfPrimitive(it)
- case itemMultilineString:
- trimmed := stripFirstNewline(stripEscapedWhitespace(it.val))
- return p.replaceEscapes(trimmed), p.typeOfPrimitive(it)
- case itemRawString:
- return it.val, p.typeOfPrimitive(it)
- case itemRawMultilineString:
- return stripFirstNewline(it.val), p.typeOfPrimitive(it)
- case itemBool:
- switch it.val {
- case "true":
- return true, p.typeOfPrimitive(it)
- case "false":
- return false, p.typeOfPrimitive(it)
- }
- p.bug("Expected boolean value, but got '%s'.", it.val)
- case itemInteger:
- if !numUnderscoresOK(it.val) {
- p.panicf("Invalid integer %q: underscores must be surrounded by digits",
- it.val)
- }
- val := strings.Replace(it.val, "_", "", -1)
- num, err := strconv.ParseInt(val, 10, 64)
- if err != nil {
- // Distinguish integer values. Normally, it'd be a bug if the lexer
- // provides an invalid integer, but it's possible that the number is
- // out of range of valid values (which the lexer cannot determine).
- // So mark the former as a bug but the latter as a legitimate user
- // error.
- if e, ok := err.(*strconv.NumError); ok &&
- e.Err == strconv.ErrRange {
-
- p.panicf("Integer '%s' is out of the range of 64-bit "+
- "signed integers.", it.val)
- } else {
- p.bug("Expected integer value, but got '%s'.", it.val)
- }
- }
- return num, p.typeOfPrimitive(it)
- case itemFloat:
- parts := strings.FieldsFunc(it.val, func(r rune) bool {
- switch r {
- case '.', 'e', 'E':
- return true
- }
- return false
- })
- for _, part := range parts {
- if !numUnderscoresOK(part) {
- p.panicf("Invalid float %q: underscores must be "+
- "surrounded by digits", it.val)
- }
- }
- if !numPeriodsOK(it.val) {
- // As a special case, numbers like '123.' or '1.e2',
- // which are valid as far as Go/strconv are concerned,
- // must be rejected because TOML says that a fractional
- // part consists of '.' followed by 1+ digits.
- p.panicf("Invalid float %q: '.' must be followed "+
- "by one or more digits", it.val)
- }
- val := strings.Replace(it.val, "_", "", -1)
- num, err := strconv.ParseFloat(val, 64)
- if err != nil {
- if e, ok := err.(*strconv.NumError); ok &&
- e.Err == strconv.ErrRange {
-
- p.panicf("Float '%s' is out of the range of 64-bit "+
- "IEEE-754 floating-point numbers.", it.val)
- } else {
- p.panicf("Invalid float value: %q", it.val)
- }
- }
- return num, p.typeOfPrimitive(it)
- case itemDatetime:
- var t time.Time
- var ok bool
- var err error
- for _, format := range []string{
- "2006-01-02T15:04:05Z07:00",
- "2006-01-02T15:04:05",
- "2006-01-02",
- } {
- t, err = time.ParseInLocation(format, it.val, time.Local)
- if err == nil {
- ok = true
- break
- }
- }
- if !ok {
- p.panicf("Invalid TOML Datetime: %q.", it.val)
- }
- return t, p.typeOfPrimitive(it)
- case itemArray:
- array := make([]interface{}, 0)
- types := make([]tomlType, 0)
-
- for it = p.next(); it.typ != itemArrayEnd; it = p.next() {
- if it.typ == itemCommentStart {
- p.expect(itemText)
- continue
- }
-
- val, typ := p.value(it)
- array = append(array, val)
- types = append(types, typ)
- }
- return array, p.typeOfArray(types)
- case itemInlineTableStart:
- var (
- hash = make(map[string]interface{})
- outerContext = p.context
- outerKey = p.currentKey
- )
-
- p.context = append(p.context, p.currentKey)
- p.currentKey = ""
- for it := p.next(); it.typ != itemInlineTableEnd; it = p.next() {
- if it.typ != itemKeyStart {
- p.bug("Expected key start but instead found %q, around line %d",
- it.val, p.approxLine)
- }
- if it.typ == itemCommentStart {
- p.expect(itemText)
- continue
- }
-
- // retrieve key
- k := p.next()
- p.approxLine = k.line
- kname := p.keyString(k)
-
- // retrieve value
- p.currentKey = kname
- val, typ := p.value(p.next())
- // make sure we keep metadata up to date
- p.setType(kname, typ)
- p.ordered = append(p.ordered, p.context.add(p.currentKey))
- hash[kname] = val
- }
- p.context = outerContext
- p.currentKey = outerKey
- return hash, tomlHash
- }
- p.bug("Unexpected value type: %s", it.typ)
- panic("unreachable")
-}
-
-// numUnderscoresOK checks whether each underscore in s is surrounded by
-// characters that are not underscores.
-func numUnderscoresOK(s string) bool {
- accept := false
- for _, r := range s {
- if r == '_' {
- if !accept {
- return false
- }
- accept = false
- continue
- }
- accept = true
- }
- return accept
-}
-
-// numPeriodsOK checks whether every period in s is followed by a digit.
-func numPeriodsOK(s string) bool {
- period := false
- for _, r := range s {
- if period && !isDigit(r) {
- return false
- }
- period = r == '.'
- }
- return !period
-}
-
-// establishContext sets the current context of the parser,
-// where the context is either a hash or an array of hashes. Which one is
-// set depends on the value of the `array` parameter.
-//
-// Establishing the context also makes sure that the key isn't a duplicate, and
-// will create implicit hashes automatically.
-func (p *parser) establishContext(key Key, array bool) {
- var ok bool
-
- // Always start at the top level and drill down for our context.
- hashContext := p.mapping
- keyContext := make(Key, 0)
-
- // We only need implicit hashes for key[0:-1]
- for _, k := range key[0 : len(key)-1] {
- _, ok = hashContext[k]
- keyContext = append(keyContext, k)
-
- // No key? Make an implicit hash and move on.
- if !ok {
- p.addImplicit(keyContext)
- hashContext[k] = make(map[string]interface{})
- }
-
- // If the hash context is actually an array of tables, then set
- // the hash context to the last element in that array.
- //
- // Otherwise, it better be a table, since this MUST be a key group (by
- // virtue of it not being the last element in a key).
- switch t := hashContext[k].(type) {
- case []map[string]interface{}:
- hashContext = t[len(t)-1]
- case map[string]interface{}:
- hashContext = t
- default:
- p.panicf("Key '%s' was already created as a hash.", keyContext)
- }
- }
-
- p.context = keyContext
- if array {
- // If this is the first element for this array, then allocate a new
- // list of tables for it.
- k := key[len(key)-1]
- if _, ok := hashContext[k]; !ok {
- hashContext[k] = make([]map[string]interface{}, 0, 5)
- }
-
- // Add a new table. But make sure the key hasn't already been used
- // for something else.
- if hash, ok := hashContext[k].([]map[string]interface{}); ok {
- hashContext[k] = append(hash, make(map[string]interface{}))
- } else {
- p.panicf("Key '%s' was already created and cannot be used as "+
- "an array.", keyContext)
- }
- } else {
- p.setValue(key[len(key)-1], make(map[string]interface{}))
- }
- p.context = append(p.context, key[len(key)-1])
-}
-
-// setValue sets the given key to the given value in the current context.
-// It will make sure that the key hasn't already been defined, account for
-// implicit key groups.
-func (p *parser) setValue(key string, value interface{}) {
- var tmpHash interface{}
- var ok bool
-
- hash := p.mapping
- keyContext := make(Key, 0)
- for _, k := range p.context {
- keyContext = append(keyContext, k)
- if tmpHash, ok = hash[k]; !ok {
- p.bug("Context for key '%s' has not been established.", keyContext)
- }
- switch t := tmpHash.(type) {
- case []map[string]interface{}:
- // The context is a table of hashes. Pick the most recent table
- // defined as the current hash.
- hash = t[len(t)-1]
- case map[string]interface{}:
- hash = t
- default:
- p.bug("Expected hash to have type 'map[string]interface{}', but "+
- "it has '%T' instead.", tmpHash)
- }
- }
- keyContext = append(keyContext, key)
-
- if _, ok := hash[key]; ok {
- // Typically, if the given key has already been set, then we have
- // to raise an error since duplicate keys are disallowed. However,
- // it's possible that a key was previously defined implicitly. In this
- // case, it is allowed to be redefined concretely. (See the
- // `tests/valid/implicit-and-explicit-after.toml` test in `toml-test`.)
- //
- // But we have to make sure to stop marking it as an implicit. (So that
- // another redefinition provokes an error.)
- //
- // Note that since it has already been defined (as a hash), we don't
- // want to overwrite it. So our business is done.
- if p.isImplicit(keyContext) {
- p.removeImplicit(keyContext)
- return
- }
-
- // Otherwise, we have a concrete key trying to override a previous
- // key, which is *always* wrong.
- p.panicf("Key '%s' has already been defined.", keyContext)
- }
- hash[key] = value
-}
-
-// setType sets the type of a particular value at a given key.
-// It should be called immediately AFTER setValue.
-//
-// Note that if `key` is empty, then the type given will be applied to the
-// current context (which is either a table or an array of tables).
-func (p *parser) setType(key string, typ tomlType) {
- keyContext := make(Key, 0, len(p.context)+1)
- for _, k := range p.context {
- keyContext = append(keyContext, k)
- }
- if len(key) > 0 { // allow type setting for hashes
- keyContext = append(keyContext, key)
- }
- p.types[keyContext.String()] = typ
-}
-
-// addImplicit sets the given Key as having been created implicitly.
-func (p *parser) addImplicit(key Key) {
- p.implicits[key.String()] = true
-}
-
-// removeImplicit stops tagging the given key as having been implicitly
-// created.
-func (p *parser) removeImplicit(key Key) {
- p.implicits[key.String()] = false
-}
-
-// isImplicit returns true if the key group pointed to by the key was created
-// implicitly.
-func (p *parser) isImplicit(key Key) bool {
- return p.implicits[key.String()]
-}
-
-// current returns the full key name of the current context.
-func (p *parser) current() string {
- if len(p.currentKey) == 0 {
- return p.context.String()
- }
- if len(p.context) == 0 {
- return p.currentKey
- }
- return fmt.Sprintf("%s.%s", p.context, p.currentKey)
-}
-
-func stripFirstNewline(s string) string {
- if len(s) == 0 || s[0] != '\n' {
- return s
- }
- return s[1:]
-}
-
-func stripEscapedWhitespace(s string) string {
- esc := strings.Split(s, "\\\n")
- if len(esc) > 1 {
- for i := 1; i < len(esc); i++ {
- esc[i] = strings.TrimLeftFunc(esc[i], unicode.IsSpace)
- }
- }
- return strings.Join(esc, "")
-}
-
-func (p *parser) replaceEscapes(str string) string {
- var replaced []rune
- s := []byte(str)
- r := 0
- for r < len(s) {
- if s[r] != '\\' {
- c, size := utf8.DecodeRune(s[r:])
- r += size
- replaced = append(replaced, c)
- continue
- }
- r += 1
- if r >= len(s) {
- p.bug("Escape sequence at end of string.")
- return ""
- }
- switch s[r] {
- default:
- p.bug("Expected valid escape code after \\, but got %q.", s[r])
- return ""
- case 'b':
- replaced = append(replaced, rune(0x0008))
- r += 1
- case 't':
- replaced = append(replaced, rune(0x0009))
- r += 1
- case 'n':
- replaced = append(replaced, rune(0x000A))
- r += 1
- case 'f':
- replaced = append(replaced, rune(0x000C))
- r += 1
- case 'r':
- replaced = append(replaced, rune(0x000D))
- r += 1
- case '"':
- replaced = append(replaced, rune(0x0022))
- r += 1
- case '\\':
- replaced = append(replaced, rune(0x005C))
- r += 1
- case 'u':
- // At this point, we know we have a Unicode escape of the form
- // `uXXXX` at [r, r+5). (Because the lexer guarantees this
- // for us.)
- escaped := p.asciiEscapeToUnicode(s[r+1 : r+5])
- replaced = append(replaced, escaped)
- r += 5
- case 'U':
- // At this point, we know we have a Unicode escape of the form
- // `uXXXX` at [r, r+9). (Because the lexer guarantees this
- // for us.)
- escaped := p.asciiEscapeToUnicode(s[r+1 : r+9])
- replaced = append(replaced, escaped)
- r += 9
- }
- }
- return string(replaced)
-}
-
-func (p *parser) asciiEscapeToUnicode(bs []byte) rune {
- s := string(bs)
- hex, err := strconv.ParseUint(strings.ToLower(s), 16, 32)
- if err != nil {
- p.bug("Could not parse '%s' as a hexadecimal number, but the "+
- "lexer claims it's OK: %s", s, err)
- }
- if !utf8.ValidRune(rune(hex)) {
- p.panicf("Escaped character '\\u%s' is not valid UTF-8.", s)
- }
- return rune(hex)
-}
-
-func isStringType(ty itemType) bool {
- return ty == itemString || ty == itemMultilineString ||
- ty == itemRawString || ty == itemRawMultilineString
-}
diff --git a/vendor/github.com/BurntSushi/toml/type_check.go b/vendor/github.com/BurntSushi/toml/type_check.go
deleted file mode 100644
index c73f8afc1..000000000
--- a/vendor/github.com/BurntSushi/toml/type_check.go
+++ /dev/null
@@ -1,91 +0,0 @@
-package toml
-
-// tomlType represents any Go type that corresponds to a TOML type.
-// While the first draft of the TOML spec has a simplistic type system that
-// probably doesn't need this level of sophistication, we seem to be militating
-// toward adding real composite types.
-type tomlType interface {
- typeString() string
-}
-
-// typeEqual accepts any two types and returns true if they are equal.
-func typeEqual(t1, t2 tomlType) bool {
- if t1 == nil || t2 == nil {
- return false
- }
- return t1.typeString() == t2.typeString()
-}
-
-func typeIsHash(t tomlType) bool {
- return typeEqual(t, tomlHash) || typeEqual(t, tomlArrayHash)
-}
-
-type tomlBaseType string
-
-func (btype tomlBaseType) typeString() string {
- return string(btype)
-}
-
-func (btype tomlBaseType) String() string {
- return btype.typeString()
-}
-
-var (
- tomlInteger tomlBaseType = "Integer"
- tomlFloat tomlBaseType = "Float"
- tomlDatetime tomlBaseType = "Datetime"
- tomlString tomlBaseType = "String"
- tomlBool tomlBaseType = "Bool"
- tomlArray tomlBaseType = "Array"
- tomlHash tomlBaseType = "Hash"
- tomlArrayHash tomlBaseType = "ArrayHash"
-)
-
-// typeOfPrimitive returns a tomlType of any primitive value in TOML.
-// Primitive values are: Integer, Float, Datetime, String and Bool.
-//
-// Passing a lexer item other than the following will cause a BUG message
-// to occur: itemString, itemBool, itemInteger, itemFloat, itemDatetime.
-func (p *parser) typeOfPrimitive(lexItem item) tomlType {
- switch lexItem.typ {
- case itemInteger:
- return tomlInteger
- case itemFloat:
- return tomlFloat
- case itemDatetime:
- return tomlDatetime
- case itemString:
- return tomlString
- case itemMultilineString:
- return tomlString
- case itemRawString:
- return tomlString
- case itemRawMultilineString:
- return tomlString
- case itemBool:
- return tomlBool
- }
- p.bug("Cannot infer primitive type of lex item '%s'.", lexItem)
- panic("unreachable")
-}
-
-// typeOfArray returns a tomlType for an array given a list of types of its
-// values.
-//
-// In the current spec, if an array is homogeneous, then its type is always
-// "Array". If the array is not homogeneous, an error is generated.
-func (p *parser) typeOfArray(types []tomlType) tomlType {
- // Empty arrays are cool.
- if len(types) == 0 {
- return tomlArray
- }
-
- theType := types[0]
- for _, t := range types[1:] {
- if !typeEqual(theType, t) {
- p.panicf("Array contains values of type '%s' and '%s', but "+
- "arrays must be homogeneous.", theType, t)
- }
- }
- return tomlArray
-}
diff --git a/vendor/github.com/BurntSushi/toml/type_fields.go b/vendor/github.com/BurntSushi/toml/type_fields.go
deleted file mode 100644
index 608997c22..000000000
--- a/vendor/github.com/BurntSushi/toml/type_fields.go
+++ /dev/null
@@ -1,242 +0,0 @@
-package toml
-
-// Struct field handling is adapted from code in encoding/json:
-//
-// Copyright 2010 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the Go distribution.
-
-import (
- "reflect"
- "sort"
- "sync"
-)
-
-// A field represents a single field found in a struct.
-type field struct {
- name string // the name of the field (`toml` tag included)
- tag bool // whether field has a `toml` tag
- index []int // represents the depth of an anonymous field
- typ reflect.Type // the type of the field
-}
-
-// byName sorts field by name, breaking ties with depth,
-// then breaking ties with "name came from toml tag", then
-// breaking ties with index sequence.
-type byName []field
-
-func (x byName) Len() int { return len(x) }
-
-func (x byName) Swap(i, j int) { x[i], x[j] = x[j], x[i] }
-
-func (x byName) Less(i, j int) bool {
- if x[i].name != x[j].name {
- return x[i].name < x[j].name
- }
- if len(x[i].index) != len(x[j].index) {
- return len(x[i].index) < len(x[j].index)
- }
- if x[i].tag != x[j].tag {
- return x[i].tag
- }
- return byIndex(x).Less(i, j)
-}
-
-// byIndex sorts field by index sequence.
-type byIndex []field
-
-func (x byIndex) Len() int { return len(x) }
-
-func (x byIndex) Swap(i, j int) { x[i], x[j] = x[j], x[i] }
-
-func (x byIndex) Less(i, j int) bool {
- for k, xik := range x[i].index {
- if k >= len(x[j].index) {
- return false
- }
- if xik != x[j].index[k] {
- return xik < x[j].index[k]
- }
- }
- return len(x[i].index) < len(x[j].index)
-}
-
-// typeFields returns a list of fields that TOML should recognize for the given
-// type. The algorithm is breadth-first search over the set of structs to
-// include - the top struct and then any reachable anonymous structs.
-func typeFields(t reflect.Type) []field {
- // Anonymous fields to explore at the current level and the next.
- current := []field{}
- next := []field{{typ: t}}
-
- // Count of queued names for current level and the next.
- count := map[reflect.Type]int{}
- nextCount := map[reflect.Type]int{}
-
- // Types already visited at an earlier level.
- visited := map[reflect.Type]bool{}
-
- // Fields found.
- var fields []field
-
- for len(next) > 0 {
- current, next = next, current[:0]
- count, nextCount = nextCount, map[reflect.Type]int{}
-
- for _, f := range current {
- if visited[f.typ] {
- continue
- }
- visited[f.typ] = true
-
- // Scan f.typ for fields to include.
- for i := 0; i < f.typ.NumField(); i++ {
- sf := f.typ.Field(i)
- if sf.PkgPath != "" && !sf.Anonymous { // unexported
- continue
- }
- opts := getOptions(sf.Tag)
- if opts.skip {
- continue
- }
- index := make([]int, len(f.index)+1)
- copy(index, f.index)
- index[len(f.index)] = i
-
- ft := sf.Type
- if ft.Name() == "" && ft.Kind() == reflect.Ptr {
- // Follow pointer.
- ft = ft.Elem()
- }
-
- // Record found field and index sequence.
- if opts.name != "" || !sf.Anonymous || ft.Kind() != reflect.Struct {
- tagged := opts.name != ""
- name := opts.name
- if name == "" {
- name = sf.Name
- }
- fields = append(fields, field{name, tagged, index, ft})
- if count[f.typ] > 1 {
- // If there were multiple instances, add a second,
- // so that the annihilation code will see a duplicate.
- // It only cares about the distinction between 1 or 2,
- // so don't bother generating any more copies.
- fields = append(fields, fields[len(fields)-1])
- }
- continue
- }
-
- // Record new anonymous struct to explore in next round.
- nextCount[ft]++
- if nextCount[ft] == 1 {
- f := field{name: ft.Name(), index: index, typ: ft}
- next = append(next, f)
- }
- }
- }
- }
-
- sort.Sort(byName(fields))
-
- // Delete all fields that are hidden by the Go rules for embedded fields,
- // except that fields with TOML tags are promoted.
-
- // The fields are sorted in primary order of name, secondary order
- // of field index length. Loop over names; for each name, delete
- // hidden fields by choosing the one dominant field that survives.
- out := fields[:0]
- for advance, i := 0, 0; i < len(fields); i += advance {
- // One iteration per name.
- // Find the sequence of fields with the name of this first field.
- fi := fields[i]
- name := fi.name
- for advance = 1; i+advance < len(fields); advance++ {
- fj := fields[i+advance]
- if fj.name != name {
- break
- }
- }
- if advance == 1 { // Only one field with this name
- out = append(out, fi)
- continue
- }
- dominant, ok := dominantField(fields[i : i+advance])
- if ok {
- out = append(out, dominant)
- }
- }
-
- fields = out
- sort.Sort(byIndex(fields))
-
- return fields
-}
-
-// dominantField looks through the fields, all of which are known to
-// have the same name, to find the single field that dominates the
-// others using Go's embedding rules, modified by the presence of
-// TOML tags. If there are multiple top-level fields, the boolean
-// will be false: This condition is an error in Go and we skip all
-// the fields.
-func dominantField(fields []field) (field, bool) {
- // The fields are sorted in increasing index-length order. The winner
- // must therefore be one with the shortest index length. Drop all
- // longer entries, which is easy: just truncate the slice.
- length := len(fields[0].index)
- tagged := -1 // Index of first tagged field.
- for i, f := range fields {
- if len(f.index) > length {
- fields = fields[:i]
- break
- }
- if f.tag {
- if tagged >= 0 {
- // Multiple tagged fields at the same level: conflict.
- // Return no field.
- return field{}, false
- }
- tagged = i
- }
- }
- if tagged >= 0 {
- return fields[tagged], true
- }
- // All remaining fields have the same length. If there's more than one,
- // we have a conflict (two fields named "X" at the same level) and we
- // return no field.
- if len(fields) > 1 {
- return field{}, false
- }
- return fields[0], true
-}
-
-var fieldCache struct {
- sync.RWMutex
- m map[reflect.Type][]field
-}
-
-// cachedTypeFields is like typeFields but uses a cache to avoid repeated work.
-func cachedTypeFields(t reflect.Type) []field {
- fieldCache.RLock()
- f := fieldCache.m[t]
- fieldCache.RUnlock()
- if f != nil {
- return f
- }
-
- // Compute fields without lock.
- // Might duplicate effort but won't hold other computations back.
- f = typeFields(t)
- if f == nil {
- f = []field{}
- }
-
- fieldCache.Lock()
- if fieldCache.m == nil {
- fieldCache.m = map[reflect.Type][]field{}
- }
- fieldCache.m[t] = f
- fieldCache.Unlock()
- return f
-}
diff --git a/vendor/github.com/Microsoft/go-winio/LICENSE b/vendor/github.com/Microsoft/go-winio/LICENSE
deleted file mode 100644
index b8b569d77..000000000
--- a/vendor/github.com/Microsoft/go-winio/LICENSE
+++ /dev/null
@@ -1,22 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2015 Microsoft
-
-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/vendor/github.com/Microsoft/go-winio/README.md b/vendor/github.com/Microsoft/go-winio/README.md
deleted file mode 100644
index 568001057..000000000
--- a/vendor/github.com/Microsoft/go-winio/README.md
+++ /dev/null
@@ -1,22 +0,0 @@
-# go-winio
-
-This repository contains utilities for efficiently performing Win32 IO operations in
-Go. Currently, this is focused on accessing named pipes and other file handles, and
-for using named pipes as a net transport.
-
-This code relies on IO completion ports to avoid blocking IO on system threads, allowing Go
-to reuse the thread to schedule another goroutine. This limits support to Windows Vista and
-newer operating systems. This is similar to the implementation of network sockets in Go's net
-package.
-
-Please see the LICENSE file for licensing information.
-
-This project has adopted the [Microsoft Open Source Code of
-Conduct](https://opensource.microsoft.com/codeofconduct/). For more information
-see the [Code of Conduct
-FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact
-[opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional
-questions or comments.
-
-Thanks to natefinch for the inspiration for this library. See https://github.com/natefinch/npipe
-for another named pipe implementation.
diff --git a/vendor/github.com/Microsoft/go-winio/backup.go b/vendor/github.com/Microsoft/go-winio/backup.go
deleted file mode 100644
index 2be34af43..000000000
--- a/vendor/github.com/Microsoft/go-winio/backup.go
+++ /dev/null
@@ -1,280 +0,0 @@
-// +build windows
-
-package winio
-
-import (
- "encoding/binary"
- "errors"
- "fmt"
- "io"
- "io/ioutil"
- "os"
- "runtime"
- "syscall"
- "unicode/utf16"
-)
-
-//sys backupRead(h syscall.Handle, b []byte, bytesRead *uint32, abort bool, processSecurity bool, context *uintptr) (err error) = BackupRead
-//sys backupWrite(h syscall.Handle, b []byte, bytesWritten *uint32, abort bool, processSecurity bool, context *uintptr) (err error) = BackupWrite
-
-const (
- BackupData = uint32(iota + 1)
- BackupEaData
- BackupSecurity
- BackupAlternateData
- BackupLink
- BackupPropertyData
- BackupObjectId
- BackupReparseData
- BackupSparseBlock
- BackupTxfsData
-)
-
-const (
- StreamSparseAttributes = uint32(8)
-)
-
-const (
- WRITE_DAC = 0x40000
- WRITE_OWNER = 0x80000
- ACCESS_SYSTEM_SECURITY = 0x1000000
-)
-
-// BackupHeader represents a backup stream of a file.
-type BackupHeader struct {
- Id uint32 // The backup stream ID
- Attributes uint32 // Stream attributes
- Size int64 // The size of the stream in bytes
- Name string // The name of the stream (for BackupAlternateData only).
- Offset int64 // The offset of the stream in the file (for BackupSparseBlock only).
-}
-
-type win32StreamId struct {
- StreamId uint32
- Attributes uint32
- Size uint64
- NameSize uint32
-}
-
-// BackupStreamReader reads from a stream produced by the BackupRead Win32 API and produces a series
-// of BackupHeader values.
-type BackupStreamReader struct {
- r io.Reader
- bytesLeft int64
-}
-
-// NewBackupStreamReader produces a BackupStreamReader from any io.Reader.
-func NewBackupStreamReader(r io.Reader) *BackupStreamReader {
- return &BackupStreamReader{r, 0}
-}
-
-// Next returns the next backup stream and prepares for calls to Read(). It skips the remainder of the current stream if
-// it was not completely read.
-func (r *BackupStreamReader) Next() (*BackupHeader, error) {
- if r.bytesLeft > 0 {
- if s, ok := r.r.(io.Seeker); ok {
- // Make sure Seek on io.SeekCurrent sometimes succeeds
- // before trying the actual seek.
- if _, err := s.Seek(0, io.SeekCurrent); err == nil {
- if _, err = s.Seek(r.bytesLeft, io.SeekCurrent); err != nil {
- return nil, err
- }
- r.bytesLeft = 0
- }
- }
- if _, err := io.Copy(ioutil.Discard, r); err != nil {
- return nil, err
- }
- }
- var wsi win32StreamId
- if err := binary.Read(r.r, binary.LittleEndian, &wsi); err != nil {
- return nil, err
- }
- hdr := &BackupHeader{
- Id: wsi.StreamId,
- Attributes: wsi.Attributes,
- Size: int64(wsi.Size),
- }
- if wsi.NameSize != 0 {
- name := make([]uint16, int(wsi.NameSize/2))
- if err := binary.Read(r.r, binary.LittleEndian, name); err != nil {
- return nil, err
- }
- hdr.Name = syscall.UTF16ToString(name)
- }
- if wsi.StreamId == BackupSparseBlock {
- if err := binary.Read(r.r, binary.LittleEndian, &hdr.Offset); err != nil {
- return nil, err
- }
- hdr.Size -= 8
- }
- r.bytesLeft = hdr.Size
- return hdr, nil
-}
-
-// Read reads from the current backup stream.
-func (r *BackupStreamReader) Read(b []byte) (int, error) {
- if r.bytesLeft == 0 {
- return 0, io.EOF
- }
- if int64(len(b)) > r.bytesLeft {
- b = b[:r.bytesLeft]
- }
- n, err := r.r.Read(b)
- r.bytesLeft -= int64(n)
- if err == io.EOF {
- err = io.ErrUnexpectedEOF
- } else if r.bytesLeft == 0 && err == nil {
- err = io.EOF
- }
- return n, err
-}
-
-// BackupStreamWriter writes a stream compatible with the BackupWrite Win32 API.
-type BackupStreamWriter struct {
- w io.Writer
- bytesLeft int64
-}
-
-// NewBackupStreamWriter produces a BackupStreamWriter on top of an io.Writer.
-func NewBackupStreamWriter(w io.Writer) *BackupStreamWriter {
- return &BackupStreamWriter{w, 0}
-}
-
-// WriteHeader writes the next backup stream header and prepares for calls to Write().
-func (w *BackupStreamWriter) WriteHeader(hdr *BackupHeader) error {
- if w.bytesLeft != 0 {
- return fmt.Errorf("missing %d bytes", w.bytesLeft)
- }
- name := utf16.Encode([]rune(hdr.Name))
- wsi := win32StreamId{
- StreamId: hdr.Id,
- Attributes: hdr.Attributes,
- Size: uint64(hdr.Size),
- NameSize: uint32(len(name) * 2),
- }
- if hdr.Id == BackupSparseBlock {
- // Include space for the int64 block offset
- wsi.Size += 8
- }
- if err := binary.Write(w.w, binary.LittleEndian, &wsi); err != nil {
- return err
- }
- if len(name) != 0 {
- if err := binary.Write(w.w, binary.LittleEndian, name); err != nil {
- return err
- }
- }
- if hdr.Id == BackupSparseBlock {
- if err := binary.Write(w.w, binary.LittleEndian, hdr.Offset); err != nil {
- return err
- }
- }
- w.bytesLeft = hdr.Size
- return nil
-}
-
-// Write writes to the current backup stream.
-func (w *BackupStreamWriter) Write(b []byte) (int, error) {
- if w.bytesLeft < int64(len(b)) {
- return 0, fmt.Errorf("too many bytes by %d", int64(len(b))-w.bytesLeft)
- }
- n, err := w.w.Write(b)
- w.bytesLeft -= int64(n)
- return n, err
-}
-
-// BackupFileReader provides an io.ReadCloser interface on top of the BackupRead Win32 API.
-type BackupFileReader struct {
- f *os.File
- includeSecurity bool
- ctx uintptr
-}
-
-// NewBackupFileReader returns a new BackupFileReader from a file handle. If includeSecurity is true,
-// Read will attempt to read the security descriptor of the file.
-func NewBackupFileReader(f *os.File, includeSecurity bool) *BackupFileReader {
- r := &BackupFileReader{f, includeSecurity, 0}
- return r
-}
-
-// Read reads a backup stream from the file by calling the Win32 API BackupRead().
-func (r *BackupFileReader) Read(b []byte) (int, error) {
- var bytesRead uint32
- err := backupRead(syscall.Handle(r.f.Fd()), b, &bytesRead, false, r.includeSecurity, &r.ctx)
- if err != nil {
- return 0, &os.PathError{"BackupRead", r.f.Name(), err}
- }
- runtime.KeepAlive(r.f)
- if bytesRead == 0 {
- return 0, io.EOF
- }
- return int(bytesRead), nil
-}
-
-// Close frees Win32 resources associated with the BackupFileReader. It does not close
-// the underlying file.
-func (r *BackupFileReader) Close() error {
- if r.ctx != 0 {
- backupRead(syscall.Handle(r.f.Fd()), nil, nil, true, false, &r.ctx)
- runtime.KeepAlive(r.f)
- r.ctx = 0
- }
- return nil
-}
-
-// BackupFileWriter provides an io.WriteCloser interface on top of the BackupWrite Win32 API.
-type BackupFileWriter struct {
- f *os.File
- includeSecurity bool
- ctx uintptr
-}
-
-// NewBackupFileWriter returns a new BackupFileWriter from a file handle. If includeSecurity is true,
-// Write() will attempt to restore the security descriptor from the stream.
-func NewBackupFileWriter(f *os.File, includeSecurity bool) *BackupFileWriter {
- w := &BackupFileWriter{f, includeSecurity, 0}
- return w
-}
-
-// Write restores a portion of the file using the provided backup stream.
-func (w *BackupFileWriter) Write(b []byte) (int, error) {
- var bytesWritten uint32
- err := backupWrite(syscall.Handle(w.f.Fd()), b, &bytesWritten, false, w.includeSecurity, &w.ctx)
- if err != nil {
- return 0, &os.PathError{"BackupWrite", w.f.Name(), err}
- }
- runtime.KeepAlive(w.f)
- if int(bytesWritten) != len(b) {
- return int(bytesWritten), errors.New("not all bytes could be written")
- }
- return len(b), nil
-}
-
-// Close frees Win32 resources associated with the BackupFileWriter. It does not
-// close the underlying file.
-func (w *BackupFileWriter) Close() error {
- if w.ctx != 0 {
- backupWrite(syscall.Handle(w.f.Fd()), nil, nil, true, false, &w.ctx)
- runtime.KeepAlive(w.f)
- w.ctx = 0
- }
- return nil
-}
-
-// OpenForBackup opens a file or directory, potentially skipping access checks if the backup
-// or restore privileges have been acquired.
-//
-// If the file opened was a directory, it cannot be used with Readdir().
-func OpenForBackup(path string, access uint32, share uint32, createmode uint32) (*os.File, error) {
- winPath, err := syscall.UTF16FromString(path)
- if err != nil {
- return nil, err
- }
- h, err := syscall.CreateFile(&winPath[0], access, share, nil, createmode, syscall.FILE_FLAG_BACKUP_SEMANTICS|syscall.FILE_FLAG_OPEN_REPARSE_POINT, 0)
- if err != nil {
- err = &os.PathError{Op: "open", Path: path, Err: err}
- return nil, err
- }
- return os.NewFile(uintptr(h), path), nil
-}
diff --git a/vendor/github.com/Microsoft/go-winio/ea.go b/vendor/github.com/Microsoft/go-winio/ea.go
deleted file mode 100644
index 4051c1b33..000000000
--- a/vendor/github.com/Microsoft/go-winio/ea.go
+++ /dev/null
@@ -1,137 +0,0 @@
-package winio
-
-import (
- "bytes"
- "encoding/binary"
- "errors"
-)
-
-type fileFullEaInformation struct {
- NextEntryOffset uint32
- Flags uint8
- NameLength uint8
- ValueLength uint16
-}
-
-var (
- fileFullEaInformationSize = binary.Size(&fileFullEaInformation{})
-
- errInvalidEaBuffer = errors.New("invalid extended attribute buffer")
- errEaNameTooLarge = errors.New("extended attribute name too large")
- errEaValueTooLarge = errors.New("extended attribute value too large")
-)
-
-// ExtendedAttribute represents a single Windows EA.
-type ExtendedAttribute struct {
- Name string
- Value []byte
- Flags uint8
-}
-
-func parseEa(b []byte) (ea ExtendedAttribute, nb []byte, err error) {
- var info fileFullEaInformation
- err = binary.Read(bytes.NewReader(b), binary.LittleEndian, &info)
- if err != nil {
- err = errInvalidEaBuffer
- return
- }
-
- nameOffset := fileFullEaInformationSize
- nameLen := int(info.NameLength)
- valueOffset := nameOffset + int(info.NameLength) + 1
- valueLen := int(info.ValueLength)
- nextOffset := int(info.NextEntryOffset)
- if valueLen+valueOffset > len(b) || nextOffset < 0 || nextOffset > len(b) {
- err = errInvalidEaBuffer
- return
- }
-
- ea.Name = string(b[nameOffset : nameOffset+nameLen])
- ea.Value = b[valueOffset : valueOffset+valueLen]
- ea.Flags = info.Flags
- if info.NextEntryOffset != 0 {
- nb = b[info.NextEntryOffset:]
- }
- return
-}
-
-// DecodeExtendedAttributes decodes a list of EAs from a FILE_FULL_EA_INFORMATION
-// buffer retrieved from BackupRead, ZwQueryEaFile, etc.
-func DecodeExtendedAttributes(b []byte) (eas []ExtendedAttribute, err error) {
- for len(b) != 0 {
- ea, nb, err := parseEa(b)
- if err != nil {
- return nil, err
- }
-
- eas = append(eas, ea)
- b = nb
- }
- return
-}
-
-func writeEa(buf *bytes.Buffer, ea *ExtendedAttribute, last bool) error {
- if int(uint8(len(ea.Name))) != len(ea.Name) {
- return errEaNameTooLarge
- }
- if int(uint16(len(ea.Value))) != len(ea.Value) {
- return errEaValueTooLarge
- }
- entrySize := uint32(fileFullEaInformationSize + len(ea.Name) + 1 + len(ea.Value))
- withPadding := (entrySize + 3) &^ 3
- nextOffset := uint32(0)
- if !last {
- nextOffset = withPadding
- }
- info := fileFullEaInformation{
- NextEntryOffset: nextOffset,
- Flags: ea.Flags,
- NameLength: uint8(len(ea.Name)),
- ValueLength: uint16(len(ea.Value)),
- }
-
- err := binary.Write(buf, binary.LittleEndian, &info)
- if err != nil {
- return err
- }
-
- _, err = buf.Write([]byte(ea.Name))
- if err != nil {
- return err
- }
-
- err = buf.WriteByte(0)
- if err != nil {
- return err
- }
-
- _, err = buf.Write(ea.Value)
- if err != nil {
- return err
- }
-
- _, err = buf.Write([]byte{0, 0, 0}[0 : withPadding-entrySize])
- if err != nil {
- return err
- }
-
- return nil
-}
-
-// EncodeExtendedAttributes encodes a list of EAs into a FILE_FULL_EA_INFORMATION
-// buffer for use with BackupWrite, ZwSetEaFile, etc.
-func EncodeExtendedAttributes(eas []ExtendedAttribute) ([]byte, error) {
- var buf bytes.Buffer
- for i := range eas {
- last := false
- if i == len(eas)-1 {
- last = true
- }
-
- err := writeEa(&buf, &eas[i], last)
- if err != nil {
- return nil, err
- }
- }
- return buf.Bytes(), nil
-}
diff --git a/vendor/github.com/Microsoft/go-winio/file.go b/vendor/github.com/Microsoft/go-winio/file.go
deleted file mode 100644
index 0385e4108..000000000
--- a/vendor/github.com/Microsoft/go-winio/file.go
+++ /dev/null
@@ -1,323 +0,0 @@
-// +build windows
-
-package winio
-
-import (
- "errors"
- "io"
- "runtime"
- "sync"
- "sync/atomic"
- "syscall"
- "time"
-)
-
-//sys cancelIoEx(file syscall.Handle, o *syscall.Overlapped) (err error) = CancelIoEx
-//sys createIoCompletionPort(file syscall.Handle, port syscall.Handle, key uintptr, threadCount uint32) (newport syscall.Handle, err error) = CreateIoCompletionPort
-//sys getQueuedCompletionStatus(port syscall.Handle, bytes *uint32, key *uintptr, o **ioOperation, timeout uint32) (err error) = GetQueuedCompletionStatus
-//sys setFileCompletionNotificationModes(h syscall.Handle, flags uint8) (err error) = SetFileCompletionNotificationModes
-//sys wsaGetOverlappedResult(h syscall.Handle, o *syscall.Overlapped, bytes *uint32, wait bool, flags *uint32) (err error) = ws2_32.WSAGetOverlappedResult
-
-type atomicBool int32
-
-func (b *atomicBool) isSet() bool { return atomic.LoadInt32((*int32)(b)) != 0 }
-func (b *atomicBool) setFalse() { atomic.StoreInt32((*int32)(b), 0) }
-func (b *atomicBool) setTrue() { atomic.StoreInt32((*int32)(b), 1) }
-func (b *atomicBool) swap(new bool) bool {
- var newInt int32
- if new {
- newInt = 1
- }
- return atomic.SwapInt32((*int32)(b), newInt) == 1
-}
-
-const (
- cFILE_SKIP_COMPLETION_PORT_ON_SUCCESS = 1
- cFILE_SKIP_SET_EVENT_ON_HANDLE = 2
-)
-
-var (
- ErrFileClosed = errors.New("file has already been closed")
- ErrTimeout = &timeoutError{}
-)
-
-type timeoutError struct{}
-
-func (e *timeoutError) Error() string { return "i/o timeout" }
-func (e *timeoutError) Timeout() bool { return true }
-func (e *timeoutError) Temporary() bool { return true }
-
-type timeoutChan chan struct{}
-
-var ioInitOnce sync.Once
-var ioCompletionPort syscall.Handle
-
-// ioResult contains the result of an asynchronous IO operation
-type ioResult struct {
- bytes uint32
- err error
-}
-
-// ioOperation represents an outstanding asynchronous Win32 IO
-type ioOperation struct {
- o syscall.Overlapped
- ch chan ioResult
-}
-
-func initIo() {
- h, err := createIoCompletionPort(syscall.InvalidHandle, 0, 0, 0xffffffff)
- if err != nil {
- panic(err)
- }
- ioCompletionPort = h
- go ioCompletionProcessor(h)
-}
-
-// win32File implements Reader, Writer, and Closer on a Win32 handle without blocking in a syscall.
-// It takes ownership of this handle and will close it if it is garbage collected.
-type win32File struct {
- handle syscall.Handle
- wg sync.WaitGroup
- wgLock sync.RWMutex
- closing atomicBool
- socket bool
- readDeadline deadlineHandler
- writeDeadline deadlineHandler
-}
-
-type deadlineHandler struct {
- setLock sync.Mutex
- channel timeoutChan
- channelLock sync.RWMutex
- timer *time.Timer
- timedout atomicBool
-}
-
-// makeWin32File makes a new win32File from an existing file handle
-func makeWin32File(h syscall.Handle) (*win32File, error) {
- f := &win32File{handle: h}
- ioInitOnce.Do(initIo)
- _, err := createIoCompletionPort(h, ioCompletionPort, 0, 0xffffffff)
- if err != nil {
- return nil, err
- }
- err = setFileCompletionNotificationModes(h, cFILE_SKIP_COMPLETION_PORT_ON_SUCCESS|cFILE_SKIP_SET_EVENT_ON_HANDLE)
- if err != nil {
- return nil, err
- }
- f.readDeadline.channel = make(timeoutChan)
- f.writeDeadline.channel = make(timeoutChan)
- return f, nil
-}
-
-func MakeOpenFile(h syscall.Handle) (io.ReadWriteCloser, error) {
- // If we return the result of makeWin32File directly, it can result in an
- // interface-wrapped nil, rather than a nil interface value.
- f, err := makeWin32File(h)
- if err != nil {
- return nil, err
- }
- return f, nil
-}
-
-// closeHandle closes the resources associated with a Win32 handle
-func (f *win32File) closeHandle() {
- f.wgLock.Lock()
- // Atomically set that we are closing, releasing the resources only once.
- if !f.closing.swap(true) {
- f.wgLock.Unlock()
- // cancel all IO and wait for it to complete
- cancelIoEx(f.handle, nil)
- f.wg.Wait()
- // at this point, no new IO can start
- syscall.Close(f.handle)
- f.handle = 0
- } else {
- f.wgLock.Unlock()
- }
-}
-
-// Close closes a win32File.
-func (f *win32File) Close() error {
- f.closeHandle()
- return nil
-}
-
-// prepareIo prepares for a new IO operation.
-// The caller must call f.wg.Done() when the IO is finished, prior to Close() returning.
-func (f *win32File) prepareIo() (*ioOperation, error) {
- f.wgLock.RLock()
- if f.closing.isSet() {
- f.wgLock.RUnlock()
- return nil, ErrFileClosed
- }
- f.wg.Add(1)
- f.wgLock.RUnlock()
- c := &ioOperation{}
- c.ch = make(chan ioResult)
- return c, nil
-}
-
-// ioCompletionProcessor processes completed async IOs forever
-func ioCompletionProcessor(h syscall.Handle) {
- for {
- var bytes uint32
- var key uintptr
- var op *ioOperation
- err := getQueuedCompletionStatus(h, &bytes, &key, &op, syscall.INFINITE)
- if op == nil {
- panic(err)
- }
- op.ch <- ioResult{bytes, err}
- }
-}
-
-// asyncIo processes the return value from ReadFile or WriteFile, blocking until
-// the operation has actually completed.
-func (f *win32File) asyncIo(c *ioOperation, d *deadlineHandler, bytes uint32, err error) (int, error) {
- if err != syscall.ERROR_IO_PENDING {
- return int(bytes), err
- }
-
- if f.closing.isSet() {
- cancelIoEx(f.handle, &c.o)
- }
-
- var timeout timeoutChan
- if d != nil {
- d.channelLock.Lock()
- timeout = d.channel
- d.channelLock.Unlock()
- }
-
- var r ioResult
- select {
- case r = <-c.ch:
- err = r.err
- if err == syscall.ERROR_OPERATION_ABORTED {
- if f.closing.isSet() {
- err = ErrFileClosed
- }
- } else if err != nil && f.socket {
- // err is from Win32. Query the overlapped structure to get the winsock error.
- var bytes, flags uint32
- err = wsaGetOverlappedResult(f.handle, &c.o, &bytes, false, &flags)
- }
- case <-timeout:
- cancelIoEx(f.handle, &c.o)
- r = <-c.ch
- err = r.err
- if err == syscall.ERROR_OPERATION_ABORTED {
- err = ErrTimeout
- }
- }
-
- // runtime.KeepAlive is needed, as c is passed via native
- // code to ioCompletionProcessor, c must remain alive
- // until the channel read is complete.
- runtime.KeepAlive(c)
- return int(r.bytes), err
-}
-
-// Read reads from a file handle.
-func (f *win32File) Read(b []byte) (int, error) {
- c, err := f.prepareIo()
- if err != nil {
- return 0, err
- }
- defer f.wg.Done()
-
- if f.readDeadline.timedout.isSet() {
- return 0, ErrTimeout
- }
-
- var bytes uint32
- err = syscall.ReadFile(f.handle, b, &bytes, &c.o)
- n, err := f.asyncIo(c, &f.readDeadline, bytes, err)
- runtime.KeepAlive(b)
-
- // Handle EOF conditions.
- if err == nil && n == 0 && len(b) != 0 {
- return 0, io.EOF
- } else if err == syscall.ERROR_BROKEN_PIPE {
- return 0, io.EOF
- } else {
- return n, err
- }
-}
-
-// Write writes to a file handle.
-func (f *win32File) Write(b []byte) (int, error) {
- c, err := f.prepareIo()
- if err != nil {
- return 0, err
- }
- defer f.wg.Done()
-
- if f.writeDeadline.timedout.isSet() {
- return 0, ErrTimeout
- }
-
- var bytes uint32
- err = syscall.WriteFile(f.handle, b, &bytes, &c.o)
- n, err := f.asyncIo(c, &f.writeDeadline, bytes, err)
- runtime.KeepAlive(b)
- return n, err
-}
-
-func (f *win32File) SetReadDeadline(deadline time.Time) error {
- return f.readDeadline.set(deadline)
-}
-
-func (f *win32File) SetWriteDeadline(deadline time.Time) error {
- return f.writeDeadline.set(deadline)
-}
-
-func (f *win32File) Flush() error {
- return syscall.FlushFileBuffers(f.handle)
-}
-
-func (f *win32File) Fd() uintptr {
- return uintptr(f.handle)
-}
-
-func (d *deadlineHandler) set(deadline time.Time) error {
- d.setLock.Lock()
- defer d.setLock.Unlock()
-
- if d.timer != nil {
- if !d.timer.Stop() {
- <-d.channel
- }
- d.timer = nil
- }
- d.timedout.setFalse()
-
- select {
- case <-d.channel:
- d.channelLock.Lock()
- d.channel = make(chan struct{})
- d.channelLock.Unlock()
- default:
- }
-
- if deadline.IsZero() {
- return nil
- }
-
- timeoutIO := func() {
- d.timedout.setTrue()
- close(d.channel)
- }
-
- now := time.Now()
- duration := deadline.Sub(now)
- if deadline.After(now) {
- // Deadline is in the future, set a timer to wait
- d.timer = time.AfterFunc(duration, timeoutIO)
- } else {
- // Deadline is in the past. Cancel all pending IO now.
- timeoutIO()
- }
- return nil
-}
diff --git a/vendor/github.com/Microsoft/go-winio/fileinfo.go b/vendor/github.com/Microsoft/go-winio/fileinfo.go
deleted file mode 100644
index ada2fbab6..000000000
--- a/vendor/github.com/Microsoft/go-winio/fileinfo.go
+++ /dev/null
@@ -1,61 +0,0 @@
-// +build windows
-
-package winio
-
-import (
- "os"
- "runtime"
- "syscall"
- "unsafe"
-)
-
-//sys getFileInformationByHandleEx(h syscall.Handle, class uint32, buffer *byte, size uint32) (err error) = GetFileInformationByHandleEx
-//sys setFileInformationByHandle(h syscall.Handle, class uint32, buffer *byte, size uint32) (err error) = SetFileInformationByHandle
-
-const (
- fileBasicInfo = 0
- fileIDInfo = 0x12
-)
-
-// FileBasicInfo contains file access time and file attributes information.
-type FileBasicInfo struct {
- CreationTime, LastAccessTime, LastWriteTime, ChangeTime syscall.Filetime
- FileAttributes uint32
- pad uint32 // padding
-}
-
-// GetFileBasicInfo retrieves times and attributes for a file.
-func GetFileBasicInfo(f *os.File) (*FileBasicInfo, error) {
- bi := &FileBasicInfo{}
- if err := getFileInformationByHandleEx(syscall.Handle(f.Fd()), fileBasicInfo, (*byte)(unsafe.Pointer(bi)), uint32(unsafe.Sizeof(*bi))); err != nil {
- return nil, &os.PathError{Op: "GetFileInformationByHandleEx", Path: f.Name(), Err: err}
- }
- runtime.KeepAlive(f)
- return bi, nil
-}
-
-// SetFileBasicInfo sets times and attributes for a file.
-func SetFileBasicInfo(f *os.File, bi *FileBasicInfo) error {
- if err := setFileInformationByHandle(syscall.Handle(f.Fd()), fileBasicInfo, (*byte)(unsafe.Pointer(bi)), uint32(unsafe.Sizeof(*bi))); err != nil {
- return &os.PathError{Op: "SetFileInformationByHandle", Path: f.Name(), Err: err}
- }
- runtime.KeepAlive(f)
- return nil
-}
-
-// FileIDInfo contains the volume serial number and file ID for a file. This pair should be
-// unique on a system.
-type FileIDInfo struct {
- VolumeSerialNumber uint64
- FileID [16]byte
-}
-
-// GetFileID retrieves the unique (volume, file ID) pair for a file.
-func GetFileID(f *os.File) (*FileIDInfo, error) {
- fileID := &FileIDInfo{}
- if err := getFileInformationByHandleEx(syscall.Handle(f.Fd()), fileIDInfo, (*byte)(unsafe.Pointer(fileID)), uint32(unsafe.Sizeof(*fileID))); err != nil {
- return nil, &os.PathError{Op: "GetFileInformationByHandleEx", Path: f.Name(), Err: err}
- }
- runtime.KeepAlive(f)
- return fileID, nil
-}
diff --git a/vendor/github.com/Microsoft/go-winio/go.mod b/vendor/github.com/Microsoft/go-winio/go.mod
deleted file mode 100644
index b3846826b..000000000
--- a/vendor/github.com/Microsoft/go-winio/go.mod
+++ /dev/null
@@ -1,9 +0,0 @@
-module github.com/Microsoft/go-winio
-
-go 1.12
-
-require (
- github.com/pkg/errors v0.8.1
- github.com/sirupsen/logrus v1.4.1
- golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b
-)
diff --git a/vendor/github.com/Microsoft/go-winio/hvsock.go b/vendor/github.com/Microsoft/go-winio/hvsock.go
deleted file mode 100644
index dbfe790ee..000000000
--- a/vendor/github.com/Microsoft/go-winio/hvsock.go
+++ /dev/null
@@ -1,305 +0,0 @@
-package winio
-
-import (
- "fmt"
- "io"
- "net"
- "os"
- "syscall"
- "time"
- "unsafe"
-
- "github.com/Microsoft/go-winio/pkg/guid"
-)
-
-//sys bind(s syscall.Handle, name unsafe.Pointer, namelen int32) (err error) [failretval==socketError] = ws2_32.bind
-
-const (
- afHvSock = 34 // AF_HYPERV
-
- socketError = ^uintptr(0)
-)
-
-// An HvsockAddr is an address for a AF_HYPERV socket.
-type HvsockAddr struct {
- VMID guid.GUID
- ServiceID guid.GUID
-}
-
-type rawHvsockAddr struct {
- Family uint16
- _ uint16
- VMID guid.GUID
- ServiceID guid.GUID
-}
-
-// Network returns the address's network name, "hvsock".
-func (addr *HvsockAddr) Network() string {
- return "hvsock"
-}
-
-func (addr *HvsockAddr) String() string {
- return fmt.Sprintf("%s:%s", &addr.VMID, &addr.ServiceID)
-}
-
-// VsockServiceID returns an hvsock service ID corresponding to the specified AF_VSOCK port.
-func VsockServiceID(port uint32) guid.GUID {
- g, _ := guid.FromString("00000000-facb-11e6-bd58-64006a7986d3")
- g.Data1 = port
- return g
-}
-
-func (addr *HvsockAddr) raw() rawHvsockAddr {
- return rawHvsockAddr{
- Family: afHvSock,
- VMID: addr.VMID,
- ServiceID: addr.ServiceID,
- }
-}
-
-func (addr *HvsockAddr) fromRaw(raw *rawHvsockAddr) {
- addr.VMID = raw.VMID
- addr.ServiceID = raw.ServiceID
-}
-
-// HvsockListener is a socket listener for the AF_HYPERV address family.
-type HvsockListener struct {
- sock *win32File
- addr HvsockAddr
-}
-
-// HvsockConn is a connected socket of the AF_HYPERV address family.
-type HvsockConn struct {
- sock *win32File
- local, remote HvsockAddr
-}
-
-func newHvSocket() (*win32File, error) {
- fd, err := syscall.Socket(afHvSock, syscall.SOCK_STREAM, 1)
- if err != nil {
- return nil, os.NewSyscallError("socket", err)
- }
- f, err := makeWin32File(fd)
- if err != nil {
- syscall.Close(fd)
- return nil, err
- }
- f.socket = true
- return f, nil
-}
-
-// ListenHvsock listens for connections on the specified hvsock address.
-func ListenHvsock(addr *HvsockAddr) (_ *HvsockListener, err error) {
- l := &HvsockListener{addr: *addr}
- sock, err := newHvSocket()
- if err != nil {
- return nil, l.opErr("listen", err)
- }
- sa := addr.raw()
- err = bind(sock.handle, unsafe.Pointer(&sa), int32(unsafe.Sizeof(sa)))
- if err != nil {
- return nil, l.opErr("listen", os.NewSyscallError("socket", err))
- }
- err = syscall.Listen(sock.handle, 16)
- if err != nil {
- return nil, l.opErr("listen", os.NewSyscallError("listen", err))
- }
- return &HvsockListener{sock: sock, addr: *addr}, nil
-}
-
-func (l *HvsockListener) opErr(op string, err error) error {
- return &net.OpError{Op: op, Net: "hvsock", Addr: &l.addr, Err: err}
-}
-
-// Addr returns the listener's network address.
-func (l *HvsockListener) Addr() net.Addr {
- return &l.addr
-}
-
-// Accept waits for the next connection and returns it.
-func (l *HvsockListener) Accept() (_ net.Conn, err error) {
- sock, err := newHvSocket()
- if err != nil {
- return nil, l.opErr("accept", err)
- }
- defer func() {
- if sock != nil {
- sock.Close()
- }
- }()
- c, err := l.sock.prepareIo()
- if err != nil {
- return nil, l.opErr("accept", err)
- }
- defer l.sock.wg.Done()
-
- // AcceptEx, per documentation, requires an extra 16 bytes per address.
- const addrlen = uint32(16 + unsafe.Sizeof(rawHvsockAddr{}))
- var addrbuf [addrlen * 2]byte
-
- var bytes uint32
- err = syscall.AcceptEx(l.sock.handle, sock.handle, &addrbuf[0], 0, addrlen, addrlen, &bytes, &c.o)
- _, err = l.sock.asyncIo(c, nil, bytes, err)
- if err != nil {
- return nil, l.opErr("accept", os.NewSyscallError("acceptex", err))
- }
- conn := &HvsockConn{
- sock: sock,
- }
- conn.local.fromRaw((*rawHvsockAddr)(unsafe.Pointer(&addrbuf[0])))
- conn.remote.fromRaw((*rawHvsockAddr)(unsafe.Pointer(&addrbuf[addrlen])))
- sock = nil
- return conn, nil
-}
-
-// Close closes the listener, causing any pending Accept calls to fail.
-func (l *HvsockListener) Close() error {
- return l.sock.Close()
-}
-
-/* Need to finish ConnectEx handling
-func DialHvsock(ctx context.Context, addr *HvsockAddr) (*HvsockConn, error) {
- sock, err := newHvSocket()
- if err != nil {
- return nil, err
- }
- defer func() {
- if sock != nil {
- sock.Close()
- }
- }()
- c, err := sock.prepareIo()
- if err != nil {
- return nil, err
- }
- defer sock.wg.Done()
- var bytes uint32
- err = windows.ConnectEx(windows.Handle(sock.handle), sa, nil, 0, &bytes, &c.o)
- _, err = sock.asyncIo(ctx, c, nil, bytes, err)
- if err != nil {
- return nil, err
- }
- conn := &HvsockConn{
- sock: sock,
- remote: *addr,
- }
- sock = nil
- return conn, nil
-}
-*/
-
-func (conn *HvsockConn) opErr(op string, err error) error {
- return &net.OpError{Op: op, Net: "hvsock", Source: &conn.local, Addr: &conn.remote, Err: err}
-}
-
-func (conn *HvsockConn) Read(b []byte) (int, error) {
- c, err := conn.sock.prepareIo()
- if err != nil {
- return 0, conn.opErr("read", err)
- }
- defer conn.sock.wg.Done()
- buf := syscall.WSABuf{Buf: &b[0], Len: uint32(len(b))}
- var flags, bytes uint32
- err = syscall.WSARecv(conn.sock.handle, &buf, 1, &bytes, &flags, &c.o, nil)
- n, err := conn.sock.asyncIo(c, &conn.sock.readDeadline, bytes, err)
- if err != nil {
- if _, ok := err.(syscall.Errno); ok {
- err = os.NewSyscallError("wsarecv", err)
- }
- return 0, conn.opErr("read", err)
- } else if n == 0 {
- err = io.EOF
- }
- return n, err
-}
-
-func (conn *HvsockConn) Write(b []byte) (int, error) {
- t := 0
- for len(b) != 0 {
- n, err := conn.write(b)
- if err != nil {
- return t + n, err
- }
- t += n
- b = b[n:]
- }
- return t, nil
-}
-
-func (conn *HvsockConn) write(b []byte) (int, error) {
- c, err := conn.sock.prepareIo()
- if err != nil {
- return 0, conn.opErr("write", err)
- }
- defer conn.sock.wg.Done()
- buf := syscall.WSABuf{Buf: &b[0], Len: uint32(len(b))}
- var bytes uint32
- err = syscall.WSASend(conn.sock.handle, &buf, 1, &bytes, 0, &c.o, nil)
- n, err := conn.sock.asyncIo(c, &conn.sock.writeDeadline, bytes, err)
- if err != nil {
- if _, ok := err.(syscall.Errno); ok {
- err = os.NewSyscallError("wsasend", err)
- }
- return 0, conn.opErr("write", err)
- }
- return n, err
-}
-
-// Close closes the socket connection, failing any pending read or write calls.
-func (conn *HvsockConn) Close() error {
- return conn.sock.Close()
-}
-
-func (conn *HvsockConn) shutdown(how int) error {
- err := syscall.Shutdown(conn.sock.handle, syscall.SHUT_RD)
- if err != nil {
- return os.NewSyscallError("shutdown", err)
- }
- return nil
-}
-
-// CloseRead shuts down the read end of the socket.
-func (conn *HvsockConn) CloseRead() error {
- err := conn.shutdown(syscall.SHUT_RD)
- if err != nil {
- return conn.opErr("close", err)
- }
- return nil
-}
-
-// CloseWrite shuts down the write end of the socket, notifying the other endpoint that
-// no more data will be written.
-func (conn *HvsockConn) CloseWrite() error {
- err := conn.shutdown(syscall.SHUT_WR)
- if err != nil {
- return conn.opErr("close", err)
- }
- return nil
-}
-
-// LocalAddr returns the local address of the connection.
-func (conn *HvsockConn) LocalAddr() net.Addr {
- return &conn.local
-}
-
-// RemoteAddr returns the remote address of the connection.
-func (conn *HvsockConn) RemoteAddr() net.Addr {
- return &conn.remote
-}
-
-// SetDeadline implements the net.Conn SetDeadline method.
-func (conn *HvsockConn) SetDeadline(t time.Time) error {
- conn.SetReadDeadline(t)
- conn.SetWriteDeadline(t)
- return nil
-}
-
-// SetReadDeadline implements the net.Conn SetReadDeadline method.
-func (conn *HvsockConn) SetReadDeadline(t time.Time) error {
- return conn.sock.SetReadDeadline(t)
-}
-
-// SetWriteDeadline implements the net.Conn SetWriteDeadline method.
-func (conn *HvsockConn) SetWriteDeadline(t time.Time) error {
- return conn.sock.SetWriteDeadline(t)
-}
diff --git a/vendor/github.com/Microsoft/go-winio/pipe.go b/vendor/github.com/Microsoft/go-winio/pipe.go
deleted file mode 100644
index d6a46f6a2..000000000
--- a/vendor/github.com/Microsoft/go-winio/pipe.go
+++ /dev/null
@@ -1,510 +0,0 @@
-// +build windows
-
-package winio
-
-import (
- "context"
- "errors"
- "fmt"
- "io"
- "net"
- "os"
- "runtime"
- "syscall"
- "time"
- "unsafe"
-)
-
-//sys connectNamedPipe(pipe syscall.Handle, o *syscall.Overlapped) (err error) = ConnectNamedPipe
-//sys createNamedPipe(name string, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *syscall.SecurityAttributes) (handle syscall.Handle, err error) [failretval==syscall.InvalidHandle] = CreateNamedPipeW
-//sys createFile(name string, access uint32, mode uint32, sa *syscall.SecurityAttributes, createmode uint32, attrs uint32, templatefile syscall.Handle) (handle syscall.Handle, err error) [failretval==syscall.InvalidHandle] = CreateFileW
-//sys getNamedPipeInfo(pipe syscall.Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) = GetNamedPipeInfo
-//sys getNamedPipeHandleState(pipe syscall.Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) = GetNamedPipeHandleStateW
-//sys localAlloc(uFlags uint32, length uint32) (ptr uintptr) = LocalAlloc
-//sys ntCreateNamedPipeFile(pipe *syscall.Handle, access uint32, oa *objectAttributes, iosb *ioStatusBlock, share uint32, disposition uint32, options uint32, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (status ntstatus) = ntdll.NtCreateNamedPipeFile
-//sys rtlNtStatusToDosError(status ntstatus) (winerr error) = ntdll.RtlNtStatusToDosErrorNoTeb
-//sys rtlDosPathNameToNtPathName(name *uint16, ntName *unicodeString, filePart uintptr, reserved uintptr) (status ntstatus) = ntdll.RtlDosPathNameToNtPathName_U
-//sys rtlDefaultNpAcl(dacl *uintptr) (status ntstatus) = ntdll.RtlDefaultNpAcl
-
-type ioStatusBlock struct {
- Status, Information uintptr
-}
-
-type objectAttributes struct {
- Length uintptr
- RootDirectory uintptr
- ObjectName *unicodeString
- Attributes uintptr
- SecurityDescriptor *securityDescriptor
- SecurityQoS uintptr
-}
-
-type unicodeString struct {
- Length uint16
- MaximumLength uint16
- Buffer uintptr
-}
-
-type securityDescriptor struct {
- Revision byte
- Sbz1 byte
- Control uint16
- Owner uintptr
- Group uintptr
- Sacl uintptr
- Dacl uintptr
-}
-
-type ntstatus int32
-
-func (status ntstatus) Err() error {
- if status >= 0 {
- return nil
- }
- return rtlNtStatusToDosError(status)
-}
-
-const (
- cERROR_PIPE_BUSY = syscall.Errno(231)
- cERROR_NO_DATA = syscall.Errno(232)
- cERROR_PIPE_CONNECTED = syscall.Errno(535)
- cERROR_SEM_TIMEOUT = syscall.Errno(121)
-
- cSECURITY_SQOS_PRESENT = 0x100000
- cSECURITY_ANONYMOUS = 0
-
- cPIPE_TYPE_MESSAGE = 4
-
- cPIPE_READMODE_MESSAGE = 2
-
- cFILE_OPEN = 1
- cFILE_CREATE = 2
-
- cFILE_PIPE_MESSAGE_TYPE = 1
- cFILE_PIPE_REJECT_REMOTE_CLIENTS = 2
-
- cSE_DACL_PRESENT = 4
-)
-
-var (
- // ErrPipeListenerClosed is returned for pipe operations on listeners that have been closed.
- // This error should match net.errClosing since docker takes a dependency on its text.
- ErrPipeListenerClosed = errors.New("use of closed network connection")
-
- errPipeWriteClosed = errors.New("pipe has been closed for write")
-)
-
-type win32Pipe struct {
- *win32File
- path string
-}
-
-type win32MessageBytePipe struct {
- win32Pipe
- writeClosed bool
- readEOF bool
-}
-
-type pipeAddress string
-
-func (f *win32Pipe) LocalAddr() net.Addr {
- return pipeAddress(f.path)
-}
-
-func (f *win32Pipe) RemoteAddr() net.Addr {
- return pipeAddress(f.path)
-}
-
-func (f *win32Pipe) SetDeadline(t time.Time) error {
- f.SetReadDeadline(t)
- f.SetWriteDeadline(t)
- return nil
-}
-
-// CloseWrite closes the write side of a message pipe in byte mode.
-func (f *win32MessageBytePipe) CloseWrite() error {
- if f.writeClosed {
- return errPipeWriteClosed
- }
- err := f.win32File.Flush()
- if err != nil {
- return err
- }
- _, err = f.win32File.Write(nil)
- if err != nil {
- return err
- }
- f.writeClosed = true
- return nil
-}
-
-// Write writes bytes to a message pipe in byte mode. Zero-byte writes are ignored, since
-// they are used to implement CloseWrite().
-func (f *win32MessageBytePipe) Write(b []byte) (int, error) {
- if f.writeClosed {
- return 0, errPipeWriteClosed
- }
- if len(b) == 0 {
- return 0, nil
- }
- return f.win32File.Write(b)
-}
-
-// Read reads bytes from a message pipe in byte mode. A read of a zero-byte message on a message
-// mode pipe will return io.EOF, as will all subsequent reads.
-func (f *win32MessageBytePipe) Read(b []byte) (int, error) {
- if f.readEOF {
- return 0, io.EOF
- }
- n, err := f.win32File.Read(b)
- if err == io.EOF {
- // If this was the result of a zero-byte read, then
- // it is possible that the read was due to a zero-size
- // message. Since we are simulating CloseWrite with a
- // zero-byte message, ensure that all future Read() calls
- // also return EOF.
- f.readEOF = true
- } else if err == syscall.ERROR_MORE_DATA {
- // ERROR_MORE_DATA indicates that the pipe's read mode is message mode
- // and the message still has more bytes. Treat this as a success, since
- // this package presents all named pipes as byte streams.
- err = nil
- }
- return n, err
-}
-
-func (s pipeAddress) Network() string {
- return "pipe"
-}
-
-func (s pipeAddress) String() string {
- return string(s)
-}
-
-// tryDialPipe attempts to dial the pipe at `path` until `ctx` cancellation or timeout.
-func tryDialPipe(ctx context.Context, path *string) (syscall.Handle, error) {
- for {
- select {
- case <-ctx.Done():
- return syscall.Handle(0), ctx.Err()
- default:
- h, err := createFile(*path, syscall.GENERIC_READ|syscall.GENERIC_WRITE, 0, nil, syscall.OPEN_EXISTING, syscall.FILE_FLAG_OVERLAPPED|cSECURITY_SQOS_PRESENT|cSECURITY_ANONYMOUS, 0)
- if err == nil {
- return h, nil
- }
- if err != cERROR_PIPE_BUSY {
- return h, &os.PathError{Err: err, Op: "open", Path: *path}
- }
- // Wait 10 msec and try again. This is a rather simplistic
- // view, as we always try each 10 milliseconds.
- time.Sleep(time.Millisecond * 10)
- }
- }
-}
-
-// DialPipe connects to a named pipe by path, timing out if the connection
-// takes longer than the specified duration. If timeout is nil, then we use
-// a default timeout of 2 seconds. (We do not use WaitNamedPipe.)
-func DialPipe(path string, timeout *time.Duration) (net.Conn, error) {
- var absTimeout time.Time
- if timeout != nil {
- absTimeout = time.Now().Add(*timeout)
- } else {
- absTimeout = time.Now().Add(time.Second * 2)
- }
- ctx, _ := context.WithDeadline(context.Background(), absTimeout)
- conn, err := DialPipeContext(ctx, path)
- if err == context.DeadlineExceeded {
- return nil, ErrTimeout
- }
- return conn, err
-}
-
-// DialPipeContext attempts to connect to a named pipe by `path` until `ctx`
-// cancellation or timeout.
-func DialPipeContext(ctx context.Context, path string) (net.Conn, error) {
- var err error
- var h syscall.Handle
- h, err = tryDialPipe(ctx, &path)
- if err != nil {
- return nil, err
- }
-
- var flags uint32
- err = getNamedPipeInfo(h, &flags, nil, nil, nil)
- if err != nil {
- return nil, err
- }
-
- f, err := makeWin32File(h)
- if err != nil {
- syscall.Close(h)
- return nil, err
- }
-
- // If the pipe is in message mode, return a message byte pipe, which
- // supports CloseWrite().
- if flags&cPIPE_TYPE_MESSAGE != 0 {
- return &win32MessageBytePipe{
- win32Pipe: win32Pipe{win32File: f, path: path},
- }, nil
- }
- return &win32Pipe{win32File: f, path: path}, nil
-}
-
-type acceptResponse struct {
- f *win32File
- err error
-}
-
-type win32PipeListener struct {
- firstHandle syscall.Handle
- path string
- config PipeConfig
- acceptCh chan (chan acceptResponse)
- closeCh chan int
- doneCh chan int
-}
-
-func makeServerPipeHandle(path string, sd []byte, c *PipeConfig, first bool) (syscall.Handle, error) {
- path16, err := syscall.UTF16FromString(path)
- if err != nil {
- return 0, &os.PathError{Op: "open", Path: path, Err: err}
- }
-
- var oa objectAttributes
- oa.Length = unsafe.Sizeof(oa)
-
- var ntPath unicodeString
- if err := rtlDosPathNameToNtPathName(&path16[0], &ntPath, 0, 0).Err(); err != nil {
- return 0, &os.PathError{Op: "open", Path: path, Err: err}
- }
- defer localFree(ntPath.Buffer)
- oa.ObjectName = &ntPath
-
- // The security descriptor is only needed for the first pipe.
- if first {
- if sd != nil {
- len := uint32(len(sd))
- sdb := localAlloc(0, len)
- defer localFree(sdb)
- copy((*[0xffff]byte)(unsafe.Pointer(sdb))[:], sd)
- oa.SecurityDescriptor = (*securityDescriptor)(unsafe.Pointer(sdb))
- } else {
- // Construct the default named pipe security descriptor.
- var dacl uintptr
- if err := rtlDefaultNpAcl(&dacl).Err(); err != nil {
- return 0, fmt.Errorf("getting default named pipe ACL: %s", err)
- }
- defer localFree(dacl)
-
- sdb := &securityDescriptor{
- Revision: 1,
- Control: cSE_DACL_PRESENT,
- Dacl: dacl,
- }
- oa.SecurityDescriptor = sdb
- }
- }
-
- typ := uint32(cFILE_PIPE_REJECT_REMOTE_CLIENTS)
- if c.MessageMode {
- typ |= cFILE_PIPE_MESSAGE_TYPE
- }
-
- disposition := uint32(cFILE_OPEN)
- access := uint32(syscall.GENERIC_READ | syscall.GENERIC_WRITE | syscall.SYNCHRONIZE)
- if first {
- disposition = cFILE_CREATE
- // By not asking for read or write access, the named pipe file system
- // will put this pipe into an initially disconnected state, blocking
- // client connections until the next call with first == false.
- access = syscall.SYNCHRONIZE
- }
-
- timeout := int64(-50 * 10000) // 50ms
-
- var (
- h syscall.Handle
- iosb ioStatusBlock
- )
- err = ntCreateNamedPipeFile(&h, access, &oa, &iosb, syscall.FILE_SHARE_READ|syscall.FILE_SHARE_WRITE, disposition, 0, typ, 0, 0, 0xffffffff, uint32(c.InputBufferSize), uint32(c.OutputBufferSize), &timeout).Err()
- if err != nil {
- return 0, &os.PathError{Op: "open", Path: path, Err: err}
- }
-
- runtime.KeepAlive(ntPath)
- return h, nil
-}
-
-func (l *win32PipeListener) makeServerPipe() (*win32File, error) {
- h, err := makeServerPipeHandle(l.path, nil, &l.config, false)
- if err != nil {
- return nil, err
- }
- f, err := makeWin32File(h)
- if err != nil {
- syscall.Close(h)
- return nil, err
- }
- return f, nil
-}
-
-func (l *win32PipeListener) makeConnectedServerPipe() (*win32File, error) {
- p, err := l.makeServerPipe()
- if err != nil {
- return nil, err
- }
-
- // Wait for the client to connect.
- ch := make(chan error)
- go func(p *win32File) {
- ch <- connectPipe(p)
- }(p)
-
- select {
- case err = <-ch:
- if err != nil {
- p.Close()
- p = nil
- }
- case <-l.closeCh:
- // Abort the connect request by closing the handle.
- p.Close()
- p = nil
- err = <-ch
- if err == nil || err == ErrFileClosed {
- err = ErrPipeListenerClosed
- }
- }
- return p, err
-}
-
-func (l *win32PipeListener) listenerRoutine() {
- closed := false
- for !closed {
- select {
- case <-l.closeCh:
- closed = true
- case responseCh := <-l.acceptCh:
- var (
- p *win32File
- err error
- )
- for {
- p, err = l.makeConnectedServerPipe()
- // If the connection was immediately closed by the client, try
- // again.
- if err != cERROR_NO_DATA {
- break
- }
- }
- responseCh <- acceptResponse{p, err}
- closed = err == ErrPipeListenerClosed
- }
- }
- syscall.Close(l.firstHandle)
- l.firstHandle = 0
- // Notify Close() and Accept() callers that the handle has been closed.
- close(l.doneCh)
-}
-
-// PipeConfig contain configuration for the pipe listener.
-type PipeConfig struct {
- // SecurityDescriptor contains a Windows security descriptor in SDDL format.
- SecurityDescriptor string
-
- // MessageMode determines whether the pipe is in byte or message mode. In either
- // case the pipe is read in byte mode by default. The only practical difference in
- // this implementation is that CloseWrite() is only supported for message mode pipes;
- // CloseWrite() is implemented as a zero-byte write, but zero-byte writes are only
- // transferred to the reader (and returned as io.EOF in this implementation)
- // when the pipe is in message mode.
- MessageMode bool
-
- // InputBufferSize specifies the size the input buffer, in bytes.
- InputBufferSize int32
-
- // OutputBufferSize specifies the size the input buffer, in bytes.
- OutputBufferSize int32
-}
-
-// ListenPipe creates a listener on a Windows named pipe path, e.g. \\.\pipe\mypipe.
-// The pipe must not already exist.
-func ListenPipe(path string, c *PipeConfig) (net.Listener, error) {
- var (
- sd []byte
- err error
- )
- if c == nil {
- c = &PipeConfig{}
- }
- if c.SecurityDescriptor != "" {
- sd, err = SddlToSecurityDescriptor(c.SecurityDescriptor)
- if err != nil {
- return nil, err
- }
- }
- h, err := makeServerPipeHandle(path, sd, c, true)
- if err != nil {
- return nil, err
- }
- l := &win32PipeListener{
- firstHandle: h,
- path: path,
- config: *c,
- acceptCh: make(chan (chan acceptResponse)),
- closeCh: make(chan int),
- doneCh: make(chan int),
- }
- go l.listenerRoutine()
- return l, nil
-}
-
-func connectPipe(p *win32File) error {
- c, err := p.prepareIo()
- if err != nil {
- return err
- }
- defer p.wg.Done()
-
- err = connectNamedPipe(p.handle, &c.o)
- _, err = p.asyncIo(c, nil, 0, err)
- if err != nil && err != cERROR_PIPE_CONNECTED {
- return err
- }
- return nil
-}
-
-func (l *win32PipeListener) Accept() (net.Conn, error) {
- ch := make(chan acceptResponse)
- select {
- case l.acceptCh <- ch:
- response := <-ch
- err := response.err
- if err != nil {
- return nil, err
- }
- if l.config.MessageMode {
- return &win32MessageBytePipe{
- win32Pipe: win32Pipe{win32File: response.f, path: l.path},
- }, nil
- }
- return &win32Pipe{win32File: response.f, path: l.path}, nil
- case <-l.doneCh:
- return nil, ErrPipeListenerClosed
- }
-}
-
-func (l *win32PipeListener) Close() error {
- select {
- case l.closeCh <- 1:
- <-l.doneCh
- case <-l.doneCh:
- }
- return nil
-}
-
-func (l *win32PipeListener) Addr() net.Addr {
- return pipeAddress(l.path)
-}
diff --git a/vendor/github.com/Microsoft/go-winio/pkg/etw/etw.go b/vendor/github.com/Microsoft/go-winio/pkg/etw/etw.go
deleted file mode 100644
index 10cd08d84..000000000
--- a/vendor/github.com/Microsoft/go-winio/pkg/etw/etw.go
+++ /dev/null
@@ -1,20 +0,0 @@
-// Package etw provides support for TraceLogging-based ETW (Event Tracing
-// for Windows). TraceLogging is a format of ETW events that are self-describing
-// (the event contains information on its own schema). This allows them to be
-// decoded without needing a separate manifest with event information. The
-// implementation here is based on the information found in
-// TraceLoggingProvider.h in the Windows SDK, which implements TraceLogging as a
-// set of C macros.
-package etw
-
-//go:generate go run mksyscall_windows.go -output zsyscall_windows.go etw.go
-
-//sys eventRegister(providerId *windows.GUID, callback uintptr, callbackContext uintptr, providerHandle *providerHandle) (win32err error) = advapi32.EventRegister
-
-//sys eventUnregister_64(providerHandle providerHandle) (win32err error) = advapi32.EventUnregister
-//sys eventWriteTransfer_64(providerHandle providerHandle, descriptor *eventDescriptor, activityID *windows.GUID, relatedActivityID *windows.GUID, dataDescriptorCount uint32, dataDescriptors *eventDataDescriptor) (win32err error) = advapi32.EventWriteTransfer
-//sys eventSetInformation_64(providerHandle providerHandle, class eventInfoClass, information uintptr, length uint32) (win32err error) = advapi32.EventSetInformation
-
-//sys eventUnregister_32(providerHandle_low uint32, providerHandle_high uint32) (win32err error) = advapi32.EventUnregister
-//sys eventWriteTransfer_32(providerHandle_low uint32, providerHandle_high uint32, descriptor *eventDescriptor, activityID *windows.GUID, relatedActivityID *windows.GUID, dataDescriptorCount uint32, dataDescriptors *eventDataDescriptor) (win32err error) = advapi32.EventWriteTransfer
-//sys eventSetInformation_32(providerHandle_low uint32, providerHandle_high uint32, class eventInfoClass, information uintptr, length uint32) (win32err error) = advapi32.EventSetInformation
diff --git a/vendor/github.com/Microsoft/go-winio/pkg/etw/eventdata.go b/vendor/github.com/Microsoft/go-winio/pkg/etw/eventdata.go
deleted file mode 100644
index a524d8920..000000000
--- a/vendor/github.com/Microsoft/go-winio/pkg/etw/eventdata.go
+++ /dev/null
@@ -1,71 +0,0 @@
-package etw
-
-import (
- "bytes"
- "encoding/binary"
- "syscall"
-)
-
-// eventData maintains a buffer which builds up the data for an ETW event. It
-// needs to be paired with EventMetadata which describes the event.
-type eventData struct {
- buffer bytes.Buffer
-}
-
-// bytes returns the raw binary data containing the event data. The returned
-// value is not copied from the internal buffer, so it can be mutated by the
-// eventData object after it is returned.
-func (ed *eventData) bytes() []byte {
- return ed.buffer.Bytes()
-}
-
-// writeString appends a string, including the null terminator, to the buffer.
-func (ed *eventData) writeString(data string) {
- ed.buffer.WriteString(data)
- ed.buffer.WriteByte(0)
-}
-
-// writeInt8 appends a int8 to the buffer.
-func (ed *eventData) writeInt8(value int8) {
- ed.buffer.WriteByte(uint8(value))
-}
-
-// writeInt16 appends a int16 to the buffer.
-func (ed *eventData) writeInt16(value int16) {
- binary.Write(&ed.buffer, binary.LittleEndian, value)
-}
-
-// writeInt32 appends a int32 to the buffer.
-func (ed *eventData) writeInt32(value int32) {
- binary.Write(&ed.buffer, binary.LittleEndian, value)
-}
-
-// writeInt64 appends a int64 to the buffer.
-func (ed *eventData) writeInt64(value int64) {
- binary.Write(&ed.buffer, binary.LittleEndian, value)
-}
-
-// writeUint8 appends a uint8 to the buffer.
-func (ed *eventData) writeUint8(value uint8) {
- ed.buffer.WriteByte(value)
-}
-
-// writeUint16 appends a uint16 to the buffer.
-func (ed *eventData) writeUint16(value uint16) {
- binary.Write(&ed.buffer, binary.LittleEndian, value)
-}
-
-// writeUint32 appends a uint32 to the buffer.
-func (ed *eventData) writeUint32(value uint32) {
- binary.Write(&ed.buffer, binary.LittleEndian, value)
-}
-
-// writeUint64 appends a uint64 to the buffer.
-func (ed *eventData) writeUint64(value uint64) {
- binary.Write(&ed.buffer, binary.LittleEndian, value)
-}
-
-// writeFiletime appends a FILETIME to the buffer.
-func (ed *eventData) writeFiletime(value syscall.Filetime) {
- binary.Write(&ed.buffer, binary.LittleEndian, value)
-}
diff --git a/vendor/github.com/Microsoft/go-winio/pkg/etw/eventdatadescriptor.go b/vendor/github.com/Microsoft/go-winio/pkg/etw/eventdatadescriptor.go
deleted file mode 100644
index 8b0ad4816..000000000
--- a/vendor/github.com/Microsoft/go-winio/pkg/etw/eventdatadescriptor.go
+++ /dev/null
@@ -1,29 +0,0 @@
-package etw
-
-import (
- "unsafe"
-)
-
-type eventDataDescriptorType uint8
-
-const (
- eventDataDescriptorTypeUserData eventDataDescriptorType = iota
- eventDataDescriptorTypeEventMetadata
- eventDataDescriptorTypeProviderMetadata
-)
-
-type eventDataDescriptor struct {
- ptr ptr64
- size uint32
- dataType eventDataDescriptorType
- reserved1 uint8
- reserved2 uint16
-}
-
-func newEventDataDescriptor(dataType eventDataDescriptorType, buffer []byte) eventDataDescriptor {
- return eventDataDescriptor{
- ptr: ptr64{ptr: unsafe.Pointer(&buffer[0])},
- size: uint32(len(buffer)),
- dataType: dataType,
- }
-}
diff --git a/vendor/github.com/Microsoft/go-winio/pkg/etw/eventdescriptor.go b/vendor/github.com/Microsoft/go-winio/pkg/etw/eventdescriptor.go
deleted file mode 100644
index cc41f1599..000000000
--- a/vendor/github.com/Microsoft/go-winio/pkg/etw/eventdescriptor.go
+++ /dev/null
@@ -1,84 +0,0 @@
-package etw
-
-// Channel represents the ETW logging channel that is used. It can be used by
-// event consumers to give an event special treatment.
-type Channel uint8
-
-const (
- // ChannelTraceLogging is the default channel for TraceLogging events. It is
- // not required to be used for TraceLogging, but will prevent decoding
- // issues for these events on older operating systems.
- ChannelTraceLogging Channel = 11
-)
-
-// Level represents the ETW logging level. There are several predefined levels
-// that are commonly used, but technically anything from 0-255 is allowed.
-// Lower levels indicate more important events, and 0 indicates an event that
-// will always be collected.
-type Level uint8
-
-// Predefined ETW log levels from winmeta.xml in the Windows SDK.
-const (
- LevelAlways Level = iota
- LevelCritical
- LevelError
- LevelWarning
- LevelInfo
- LevelVerbose
-)
-
-// Opcode represents the operation that the event indicates is being performed.
-type Opcode uint8
-
-// Predefined ETW opcodes from winmeta.xml in the Windows SDK.
-const (
- // OpcodeInfo indicates an informational event.
- OpcodeInfo Opcode = iota
- // OpcodeStart indicates the start of an operation.
- OpcodeStart
- // OpcodeStop indicates the end of an operation.
- OpcodeStop
- // OpcodeDCStart indicates the start of a provider capture state operation.
- OpcodeDCStart
- // OpcodeDCStop indicates the end of a provider capture state operation.
- OpcodeDCStop
-)
-
-// EventDescriptor represents various metadata for an ETW event.
-type eventDescriptor struct {
- id uint16
- version uint8
- channel Channel
- level Level
- opcode Opcode
- task uint16
- keyword uint64
-}
-
-// NewEventDescriptor returns an EventDescriptor initialized for use with
-// TraceLogging.
-func newEventDescriptor() *eventDescriptor {
- // Standard TraceLogging events default to the TraceLogging channel, and
- // verbose level.
- return &eventDescriptor{
- channel: ChannelTraceLogging,
- level: LevelVerbose,
- }
-}
-
-// Identity returns the identity of the event. If the identity is not 0, it
-// should uniquely identify the other event metadata (contained in
-// EventDescriptor, and field metadata). Only the lower 24 bits of this value
-// are relevant.
-func (ed *eventDescriptor) identity() uint32 {
- return (uint32(ed.version) << 16) | uint32(ed.id)
-}
-
-// SetIdentity sets the identity of the event. If the identity is not 0, it
-// should uniquely identify the other event metadata (contained in
-// EventDescriptor, and field metadata). Only the lower 24 bits of this value
-// are relevant.
-func (ed *eventDescriptor) setIdentity(identity uint32) {
- ed.id = uint16(identity)
- ed.version = uint8(identity >> 16)
-}
diff --git a/vendor/github.com/Microsoft/go-winio/pkg/etw/eventmetadata.go b/vendor/github.com/Microsoft/go-winio/pkg/etw/eventmetadata.go
deleted file mode 100644
index 6fdc126cc..000000000
--- a/vendor/github.com/Microsoft/go-winio/pkg/etw/eventmetadata.go
+++ /dev/null
@@ -1,177 +0,0 @@
-package etw
-
-import (
- "bytes"
- "encoding/binary"
-)
-
-// inType indicates the type of data contained in the ETW event.
-type inType byte
-
-// Various inType definitions for TraceLogging. These must match the definitions
-// found in TraceLoggingProvider.h in the Windows SDK.
-const (
- inTypeNull inType = iota
- inTypeUnicodeString
- inTypeANSIString
- inTypeInt8
- inTypeUint8
- inTypeInt16
- inTypeUint16
- inTypeInt32
- inTypeUint32
- inTypeInt64
- inTypeUint64
- inTypeFloat
- inTypeDouble
- inTypeBool32
- inTypeBinary
- inTypeGUID
- inTypePointerUnsupported
- inTypeFileTime
- inTypeSystemTime
- inTypeSID
- inTypeHexInt32
- inTypeHexInt64
- inTypeCountedString
- inTypeCountedANSIString
- inTypeStruct
- inTypeCountedBinary
- inTypeCountedArray inType = 32
- inTypeArray inType = 64
-)
-
-// outType specifies a hint to the event decoder for how the value should be
-// formatted.
-type outType byte
-
-// Various outType definitions for TraceLogging. These must match the
-// definitions found in TraceLoggingProvider.h in the Windows SDK.
-const (
- // outTypeDefault indicates that the default formatting for the inType will
- // be used by the event decoder.
- outTypeDefault outType = iota
- outTypeNoPrint
- outTypeString
- outTypeBoolean
- outTypeHex
- outTypePID
- outTypeTID
- outTypePort
- outTypeIPv4
- outTypeIPv6
- outTypeSocketAddress
- outTypeXML
- outTypeJSON
- outTypeWin32Error
- outTypeNTStatus
- outTypeHResult
- outTypeFileTime
- outTypeSigned
- outTypeUnsigned
- outTypeUTF8 outType = 35
- outTypePKCS7WithTypeInfo outType = 36
- outTypeCodePointer outType = 37
- outTypeDateTimeUTC outType = 38
-)
-
-// eventMetadata maintains a buffer which builds up the metadata for an ETW
-// event. It needs to be paired with EventData which describes the event.
-type eventMetadata struct {
- buffer bytes.Buffer
-}
-
-// bytes returns the raw binary data containing the event metadata. Before being
-// returned, the current size of the buffer is written to the start of the
-// buffer. The returned value is not copied from the internal buffer, so it can
-// be mutated by the eventMetadata object after it is returned.
-func (em *eventMetadata) bytes() []byte {
- // Finalize the event metadata buffer by filling in the buffer length at the
- // beginning.
- binary.LittleEndian.PutUint16(em.buffer.Bytes(), uint16(em.buffer.Len()))
- return em.buffer.Bytes()
-}
-
-// writeEventHeader writes the metadata for the start of an event to the buffer.
-// This specifies the event name and tags.
-func (em *eventMetadata) writeEventHeader(name string, tags uint32) {
- binary.Write(&em.buffer, binary.LittleEndian, uint16(0)) // Length placeholder
- em.writeTags(tags)
- em.buffer.WriteString(name)
- em.buffer.WriteByte(0) // Null terminator for name
-}
-
-func (em *eventMetadata) writeFieldInner(name string, inType inType, outType outType, tags uint32, arrSize uint16) {
- em.buffer.WriteString(name)
- em.buffer.WriteByte(0) // Null terminator for name
-
- if outType == outTypeDefault && tags == 0 {
- em.buffer.WriteByte(byte(inType))
- } else {
- em.buffer.WriteByte(byte(inType | 128))
- if tags == 0 {
- em.buffer.WriteByte(byte(outType))
- } else {
- em.buffer.WriteByte(byte(outType | 128))
- em.writeTags(tags)
- }
- }
-
- if arrSize != 0 {
- binary.Write(&em.buffer, binary.LittleEndian, arrSize)
- }
-}
-
-// writeTags writes out the tags value to the event metadata. Tags is a 28-bit
-// value, interpreted as bit flags, which are only relevant to the event
-// consumer. The event consumer may choose to attribute special meaning to tags
-// (e.g. 0x4 could mean the field contains PII). Tags are written as a series of
-// bytes, each containing 7 bits of tag value, with the high bit set if there is
-// more tag data in the following byte. This allows for a more compact
-// representation when not all of the tag bits are needed.
-func (em *eventMetadata) writeTags(tags uint32) {
- // Only use the top 28 bits of the tags value.
- tags &= 0xfffffff
-
- for {
- // Tags are written with the most significant bits (e.g. 21-27) first.
- val := tags >> 21
-
- if tags&0x1fffff == 0 {
- // If there is no more data to write after this, write this value
- // without the high bit set, and return.
- em.buffer.WriteByte(byte(val & 0x7f))
- return
- }
-
- em.buffer.WriteByte(byte(val | 0x80))
-
- tags <<= 7
- }
-}
-
-// writeField writes the metadata for a simple field to the buffer.
-func (em *eventMetadata) writeField(name string, inType inType, outType outType, tags uint32) {
- em.writeFieldInner(name, inType, outType, tags, 0)
-}
-
-// writeArray writes the metadata for an array field to the buffer. The number
-// of elements in the array must be written as a uint16 in the event data,
-// immediately preceeding the event data.
-func (em *eventMetadata) writeArray(name string, inType inType, outType outType, tags uint32) {
- em.writeFieldInner(name, inType|inTypeArray, outType, tags, 0)
-}
-
-// writeCountedArray writes the metadata for an array field to the buffer. The
-// size of a counted array is fixed, and the size is written into the metadata
-// directly.
-func (em *eventMetadata) writeCountedArray(name string, count uint16, inType inType, outType outType, tags uint32) {
- em.writeFieldInner(name, inType|inTypeCountedArray, outType, tags, count)
-}
-
-// writeStruct writes the metadata for a nested struct to the buffer. The struct
-// contains the next N fields in the metadata, where N is specified by the
-// fieldCount argument.
-func (em *eventMetadata) writeStruct(name string, fieldCount uint8, tags uint32) {
- em.writeFieldInner(name, inTypeStruct, outType(fieldCount), tags, 0)
-}
diff --git a/vendor/github.com/Microsoft/go-winio/pkg/etw/eventopt.go b/vendor/github.com/Microsoft/go-winio/pkg/etw/eventopt.go
deleted file mode 100644
index fb6ac7dbc..000000000
--- a/vendor/github.com/Microsoft/go-winio/pkg/etw/eventopt.go
+++ /dev/null
@@ -1,73 +0,0 @@
-package etw
-
-import (
- "github.com/Microsoft/go-winio/pkg/guid"
-)
-
-type eventOptions struct {
- descriptor *eventDescriptor
- activityID guid.GUID
- relatedActivityID guid.GUID
- tags uint32
-}
-
-// EventOpt defines the option function type that can be passed to
-// Provider.WriteEvent to specify general event options, such as level and
-// keyword.
-type EventOpt func(options *eventOptions)
-
-// WithEventOpts returns the variadic arguments as a single slice.
-func WithEventOpts(opts ...EventOpt) []EventOpt {
- return opts
-}
-
-// WithLevel specifies the level of the event to be written.
-func WithLevel(level Level) EventOpt {
- return func(options *eventOptions) {
- options.descriptor.level = level
- }
-}
-
-// WithKeyword specifies the keywords of the event to be written. Multiple uses
-// of this option are OR'd together.
-func WithKeyword(keyword uint64) EventOpt {
- return func(options *eventOptions) {
- options.descriptor.keyword |= keyword
- }
-}
-
-// WithChannel specifies the channel of the event to be written.
-func WithChannel(channel Channel) EventOpt {
- return func(options *eventOptions) {
- options.descriptor.channel = channel
- }
-}
-
-// WithOpcode specifies the opcode of the event to be written.
-func WithOpcode(opcode Opcode) EventOpt {
- return func(options *eventOptions) {
- options.descriptor.opcode = opcode
- }
-}
-
-// WithTags specifies the tags of the event to be written. Tags is a 28-bit
-// value (top 4 bits are ignored) which are interpreted by the event consumer.
-func WithTags(newTags uint32) EventOpt {
- return func(options *eventOptions) {
- options.tags |= newTags
- }
-}
-
-// WithActivityID specifies the activity ID of the event to be written.
-func WithActivityID(activityID guid.GUID) EventOpt {
- return func(options *eventOptions) {
- options.activityID = activityID
- }
-}
-
-// WithRelatedActivityID specifies the parent activity ID of the event to be written.
-func WithRelatedActivityID(activityID guid.GUID) EventOpt {
- return func(options *eventOptions) {
- options.relatedActivityID = activityID
- }
-}
diff --git a/vendor/github.com/Microsoft/go-winio/pkg/etw/fieldopt.go b/vendor/github.com/Microsoft/go-winio/pkg/etw/fieldopt.go
deleted file mode 100644
index d544a2998..000000000
--- a/vendor/github.com/Microsoft/go-winio/pkg/etw/fieldopt.go
+++ /dev/null
@@ -1,514 +0,0 @@
-package etw
-
-import (
- "fmt"
- "math"
- "reflect"
- "syscall"
- "time"
- "unsafe"
-)
-
-// FieldOpt defines the option function type that can be passed to
-// Provider.WriteEvent to add fields to the event.
-type FieldOpt func(em *eventMetadata, ed *eventData)
-
-// WithFields returns the variadic arguments as a single slice.
-func WithFields(opts ...FieldOpt) []FieldOpt {
- return opts
-}
-
-// BoolField adds a single bool field to the event.
-func BoolField(name string, value bool) FieldOpt {
- return func(em *eventMetadata, ed *eventData) {
- em.writeField(name, inTypeUint8, outTypeBoolean, 0)
- bool8 := uint8(0)
- if value {
- bool8 = uint8(1)
- }
- ed.writeUint8(bool8)
- }
-}
-
-// BoolArray adds an array of bool to the event.
-func BoolArray(name string, values []bool) FieldOpt {
- return func(em *eventMetadata, ed *eventData) {
- em.writeArray(name, inTypeUint8, outTypeBoolean, 0)
- ed.writeUint16(uint16(len(values)))
- for _, v := range values {
- bool8 := uint8(0)
- if v {
- bool8 = uint8(1)
- }
- ed.writeUint8(bool8)
- }
- }
-}
-
-// StringField adds a single string field to the event.
-func StringField(name string, value string) FieldOpt {
- return func(em *eventMetadata, ed *eventData) {
- em.writeField(name, inTypeANSIString, outTypeUTF8, 0)
- ed.writeString(value)
- }
-}
-
-// StringArray adds an array of string to the event.
-func StringArray(name string, values []string) FieldOpt {
- return func(em *eventMetadata, ed *eventData) {
- em.writeArray(name, inTypeANSIString, outTypeUTF8, 0)
- ed.writeUint16(uint16(len(values)))
- for _, v := range values {
- ed.writeString(v)
- }
- }
-}
-
-// IntField adds a single int field to the event.
-func IntField(name string, value int) FieldOpt {
- switch unsafe.Sizeof(value) {
- case 4:
- return Int32Field(name, int32(value))
- case 8:
- return Int64Field(name, int64(value))
- default:
- panic("Unsupported int size")
- }
-}
-
-// IntArray adds an array of int to the event.
-func IntArray(name string, values []int) FieldOpt {
- inType := inTypeNull
- var writeItem func(*eventData, int)
- switch unsafe.Sizeof(values[0]) {
- case 4:
- inType = inTypeInt32
- writeItem = func(ed *eventData, item int) { ed.writeInt32(int32(item)) }
- case 8:
- inType = inTypeInt64
- writeItem = func(ed *eventData, item int) { ed.writeInt64(int64(item)) }
- default:
- panic("Unsupported int size")
- }
-
- return func(em *eventMetadata, ed *eventData) {
- em.writeArray(name, inType, outTypeDefault, 0)
- ed.writeUint16(uint16(len(values)))
- for _, v := range values {
- writeItem(ed, v)
- }
- }
-}
-
-// Int8Field adds a single int8 field to the event.
-func Int8Field(name string, value int8) FieldOpt {
- return func(em *eventMetadata, ed *eventData) {
- em.writeField(name, inTypeInt8, outTypeDefault, 0)
- ed.writeInt8(value)
- }
-}
-
-// Int8Array adds an array of int8 to the event.
-func Int8Array(name string, values []int8) FieldOpt {
- return func(em *eventMetadata, ed *eventData) {
- em.writeArray(name, inTypeInt8, outTypeDefault, 0)
- ed.writeUint16(uint16(len(values)))
- for _, v := range values {
- ed.writeInt8(v)
- }
- }
-}
-
-// Int16Field adds a single int16 field to the event.
-func Int16Field(name string, value int16) FieldOpt {
- return func(em *eventMetadata, ed *eventData) {
- em.writeField(name, inTypeInt16, outTypeDefault, 0)
- ed.writeInt16(value)
- }
-}
-
-// Int16Array adds an array of int16 to the event.
-func Int16Array(name string, values []int16) FieldOpt {
- return func(em *eventMetadata, ed *eventData) {
- em.writeArray(name, inTypeInt16, outTypeDefault, 0)
- ed.writeUint16(uint16(len(values)))
- for _, v := range values {
- ed.writeInt16(v)
- }
- }
-}
-
-// Int32Field adds a single int32 field to the event.
-func Int32Field(name string, value int32) FieldOpt {
- return func(em *eventMetadata, ed *eventData) {
- em.writeField(name, inTypeInt32, outTypeDefault, 0)
- ed.writeInt32(value)
- }
-}
-
-// Int32Array adds an array of int32 to the event.
-func Int32Array(name string, values []int32) FieldOpt {
- return func(em *eventMetadata, ed *eventData) {
- em.writeArray(name, inTypeInt32, outTypeDefault, 0)
- ed.writeUint16(uint16(len(values)))
- for _, v := range values {
- ed.writeInt32(v)
- }
- }
-}
-
-// Int64Field adds a single int64 field to the event.
-func Int64Field(name string, value int64) FieldOpt {
- return func(em *eventMetadata, ed *eventData) {
- em.writeField(name, inTypeInt64, outTypeDefault, 0)
- ed.writeInt64(value)
- }
-}
-
-// Int64Array adds an array of int64 to the event.
-func Int64Array(name string, values []int64) FieldOpt {
- return func(em *eventMetadata, ed *eventData) {
- em.writeArray(name, inTypeInt64, outTypeDefault, 0)
- ed.writeUint16(uint16(len(values)))
- for _, v := range values {
- ed.writeInt64(v)
- }
- }
-}
-
-// UintField adds a single uint field to the event.
-func UintField(name string, value uint) FieldOpt {
- switch unsafe.Sizeof(value) {
- case 4:
- return Uint32Field(name, uint32(value))
- case 8:
- return Uint64Field(name, uint64(value))
- default:
- panic("Unsupported uint size")
- }
-}
-
-// UintArray adds an array of uint to the event.
-func UintArray(name string, values []uint) FieldOpt {
- inType := inTypeNull
- var writeItem func(*eventData, uint)
- switch unsafe.Sizeof(values[0]) {
- case 4:
- inType = inTypeUint32
- writeItem = func(ed *eventData, item uint) { ed.writeUint32(uint32(item)) }
- case 8:
- inType = inTypeUint64
- writeItem = func(ed *eventData, item uint) { ed.writeUint64(uint64(item)) }
- default:
- panic("Unsupported uint size")
- }
-
- return func(em *eventMetadata, ed *eventData) {
- em.writeArray(name, inType, outTypeDefault, 0)
- ed.writeUint16(uint16(len(values)))
- for _, v := range values {
- writeItem(ed, v)
- }
- }
-}
-
-// Uint8Field adds a single uint8 field to the event.
-func Uint8Field(name string, value uint8) FieldOpt {
- return func(em *eventMetadata, ed *eventData) {
- em.writeField(name, inTypeUint8, outTypeDefault, 0)
- ed.writeUint8(value)
- }
-}
-
-// Uint8Array adds an array of uint8 to the event.
-func Uint8Array(name string, values []uint8) FieldOpt {
- return func(em *eventMetadata, ed *eventData) {
- em.writeArray(name, inTypeUint8, outTypeDefault, 0)
- ed.writeUint16(uint16(len(values)))
- for _, v := range values {
- ed.writeUint8(v)
- }
- }
-}
-
-// Uint16Field adds a single uint16 field to the event.
-func Uint16Field(name string, value uint16) FieldOpt {
- return func(em *eventMetadata, ed *eventData) {
- em.writeField(name, inTypeUint16, outTypeDefault, 0)
- ed.writeUint16(value)
- }
-}
-
-// Uint16Array adds an array of uint16 to the event.
-func Uint16Array(name string, values []uint16) FieldOpt {
- return func(em *eventMetadata, ed *eventData) {
- em.writeArray(name, inTypeUint16, outTypeDefault, 0)
- ed.writeUint16(uint16(len(values)))
- for _, v := range values {
- ed.writeUint16(v)
- }
- }
-}
-
-// Uint32Field adds a single uint32 field to the event.
-func Uint32Field(name string, value uint32) FieldOpt {
- return func(em *eventMetadata, ed *eventData) {
- em.writeField(name, inTypeUint32, outTypeDefault, 0)
- ed.writeUint32(value)
- }
-}
-
-// Uint32Array adds an array of uint32 to the event.
-func Uint32Array(name string, values []uint32) FieldOpt {
- return func(em *eventMetadata, ed *eventData) {
- em.writeArray(name, inTypeUint32, outTypeDefault, 0)
- ed.writeUint16(uint16(len(values)))
- for _, v := range values {
- ed.writeUint32(v)
- }
- }
-}
-
-// Uint64Field adds a single uint64 field to the event.
-func Uint64Field(name string, value uint64) FieldOpt {
- return func(em *eventMetadata, ed *eventData) {
- em.writeField(name, inTypeUint64, outTypeDefault, 0)
- ed.writeUint64(value)
- }
-}
-
-// Uint64Array adds an array of uint64 to the event.
-func Uint64Array(name string, values []uint64) FieldOpt {
- return func(em *eventMetadata, ed *eventData) {
- em.writeArray(name, inTypeUint64, outTypeDefault, 0)
- ed.writeUint16(uint16(len(values)))
- for _, v := range values {
- ed.writeUint64(v)
- }
- }
-}
-
-// UintptrField adds a single uintptr field to the event.
-func UintptrField(name string, value uintptr) FieldOpt {
- inType := inTypeNull
- var writeItem func(*eventData, uintptr)
- switch unsafe.Sizeof(value) {
- case 4:
- inType = inTypeHexInt32
- writeItem = func(ed *eventData, item uintptr) { ed.writeUint32(uint32(item)) }
- case 8:
- inType = inTypeHexInt64
- writeItem = func(ed *eventData, item uintptr) { ed.writeUint64(uint64(item)) }
- default:
- panic("Unsupported uintptr size")
- }
-
- return func(em *eventMetadata, ed *eventData) {
- em.writeField(name, inType, outTypeDefault, 0)
- writeItem(ed, value)
- }
-}
-
-// UintptrArray adds an array of uintptr to the event.
-func UintptrArray(name string, values []uintptr) FieldOpt {
- inType := inTypeNull
- var writeItem func(*eventData, uintptr)
- switch unsafe.Sizeof(values[0]) {
- case 4:
- inType = inTypeHexInt32
- writeItem = func(ed *eventData, item uintptr) { ed.writeUint32(uint32(item)) }
- case 8:
- inType = inTypeHexInt64
- writeItem = func(ed *eventData, item uintptr) { ed.writeUint64(uint64(item)) }
- default:
- panic("Unsupported uintptr size")
- }
-
- return func(em *eventMetadata, ed *eventData) {
- em.writeArray(name, inType, outTypeDefault, 0)
- ed.writeUint16(uint16(len(values)))
- for _, v := range values {
- writeItem(ed, v)
- }
- }
-}
-
-// Float32Field adds a single float32 field to the event.
-func Float32Field(name string, value float32) FieldOpt {
- return func(em *eventMetadata, ed *eventData) {
- em.writeField(name, inTypeFloat, outTypeDefault, 0)
- ed.writeUint32(math.Float32bits(value))
- }
-}
-
-// Float32Array adds an array of float32 to the event.
-func Float32Array(name string, values []float32) FieldOpt {
- return func(em *eventMetadata, ed *eventData) {
- em.writeArray(name, inTypeFloat, outTypeDefault, 0)
- ed.writeUint16(uint16(len(values)))
- for _, v := range values {
- ed.writeUint32(math.Float32bits(v))
- }
- }
-}
-
-// Float64Field adds a single float64 field to the event.
-func Float64Field(name string, value float64) FieldOpt {
- return func(em *eventMetadata, ed *eventData) {
- em.writeField(name, inTypeDouble, outTypeDefault, 0)
- ed.writeUint64(math.Float64bits(value))
- }
-}
-
-// Float64Array adds an array of float64 to the event.
-func Float64Array(name string, values []float64) FieldOpt {
- return func(em *eventMetadata, ed *eventData) {
- em.writeArray(name, inTypeDouble, outTypeDefault, 0)
- ed.writeUint16(uint16(len(values)))
- for _, v := range values {
- ed.writeUint64(math.Float64bits(v))
- }
- }
-}
-
-// Struct adds a nested struct to the event, the FieldOpts in the opts argument
-// are used to specify the fields of the struct.
-func Struct(name string, opts ...FieldOpt) FieldOpt {
- return func(em *eventMetadata, ed *eventData) {
- em.writeStruct(name, uint8(len(opts)), 0)
- for _, opt := range opts {
- opt(em, ed)
- }
- }
-}
-
-// Time adds a time to the event.
-func Time(name string, value time.Time) FieldOpt {
- return func(em *eventMetadata, ed *eventData) {
- em.writeField(name, inTypeFileTime, outTypeDateTimeUTC, 0)
- ed.writeFiletime(syscall.NsecToFiletime(value.UTC().UnixNano()))
- }
-}
-
-// Currently, we support logging basic builtin types (int, string, etc), slices
-// of basic builtin types, error, types derived from the basic types (e.g. "type
-// foo int"), and structs (recursively logging their fields). We do not support
-// slices of derived types (e.g. "[]foo").
-//
-// For types that we don't support, the value is formatted via fmt.Sprint, and
-// we also log a message that the type is unsupported along with the formatted
-// type. The intent of this is to make it easier to see which types are not
-// supported in traces, so we can evaluate adding support for more types in the
-// future.
-func SmartField(name string, v interface{}) FieldOpt {
- switch v := v.(type) {
- case bool:
- return BoolField(name, v)
- case []bool:
- return BoolArray(name, v)
- case string:
- return StringField(name, v)
- case []string:
- return StringArray(name, v)
- case int:
- return IntField(name, v)
- case []int:
- return IntArray(name, v)
- case int8:
- return Int8Field(name, v)
- case []int8:
- return Int8Array(name, v)
- case int16:
- return Int16Field(name, v)
- case []int16:
- return Int16Array(name, v)
- case int32:
- return Int32Field(name, v)
- case []int32:
- return Int32Array(name, v)
- case int64:
- return Int64Field(name, v)
- case []int64:
- return Int64Array(name, v)
- case uint:
- return UintField(name, v)
- case []uint:
- return UintArray(name, v)
- case uint8:
- return Uint8Field(name, v)
- case []uint8:
- return Uint8Array(name, v)
- case uint16:
- return Uint16Field(name, v)
- case []uint16:
- return Uint16Array(name, v)
- case uint32:
- return Uint32Field(name, v)
- case []uint32:
- return Uint32Array(name, v)
- case uint64:
- return Uint64Field(name, v)
- case []uint64:
- return Uint64Array(name, v)
- case uintptr:
- return UintptrField(name, v)
- case []uintptr:
- return UintptrArray(name, v)
- case float32:
- return Float32Field(name, v)
- case []float32:
- return Float32Array(name, v)
- case float64:
- return Float64Field(name, v)
- case []float64:
- return Float64Array(name, v)
- case error:
- return StringField(name, v.Error())
- case time.Time:
- return Time(name, v)
- default:
- switch rv := reflect.ValueOf(v); rv.Kind() {
- case reflect.Bool:
- return SmartField(name, rv.Bool())
- case reflect.Int:
- return SmartField(name, int(rv.Int()))
- case reflect.Int8:
- return SmartField(name, int8(rv.Int()))
- case reflect.Int16:
- return SmartField(name, int16(rv.Int()))
- case reflect.Int32:
- return SmartField(name, int32(rv.Int()))
- case reflect.Int64:
- return SmartField(name, int64(rv.Int()))
- case reflect.Uint:
- return SmartField(name, uint(rv.Uint()))
- case reflect.Uint8:
- return SmartField(name, uint8(rv.Uint()))
- case reflect.Uint16:
- return SmartField(name, uint16(rv.Uint()))
- case reflect.Uint32:
- return SmartField(name, uint32(rv.Uint()))
- case reflect.Uint64:
- return SmartField(name, uint64(rv.Uint()))
- case reflect.Uintptr:
- return SmartField(name, uintptr(rv.Uint()))
- case reflect.Float32:
- return SmartField(name, float32(rv.Float()))
- case reflect.Float64:
- return SmartField(name, float64(rv.Float()))
- case reflect.String:
- return SmartField(name, rv.String())
- case reflect.Struct:
- fields := make([]FieldOpt, 0, rv.NumField())
- for i := 0; i < rv.NumField(); i++ {
- field := rv.Field(i)
- if field.CanInterface() {
- fields = append(fields, SmartField(name, field.Interface()))
- }
- }
- return Struct(name, fields...)
- }
- }
-
- return StringField(name, fmt.Sprintf("(Unsupported: %T) %v", v, v))
-}
diff --git a/vendor/github.com/Microsoft/go-winio/pkg/etw/newprovider.go b/vendor/github.com/Microsoft/go-winio/pkg/etw/newprovider.go
deleted file mode 100644
index f344fb65f..000000000
--- a/vendor/github.com/Microsoft/go-winio/pkg/etw/newprovider.go
+++ /dev/null
@@ -1,53 +0,0 @@
-// +build amd64 arm64 386
-
-package etw
-
-import (
- "bytes"
- "encoding/binary"
- "unsafe"
-
- "github.com/Microsoft/go-winio/pkg/guid"
- "golang.org/x/sys/windows"
-)
-
-// NewProviderWithID creates and registers a new ETW provider, allowing the
-// provider ID to be manually specified. This is most useful when there is an
-// existing provider ID that must be used to conform to existing diagnostic
-// infrastructure.
-func NewProviderWithID(name string, id guid.GUID, callback EnableCallback) (provider *Provider, err error) {
- providerCallbackOnce.Do(func() {
- globalProviderCallback = windows.NewCallback(providerCallbackAdapter)
- })
-
- provider = providers.newProvider()
- defer func(provider *Provider) {
- if err != nil {
- providers.removeProvider(provider)
- }
- }(provider)
- provider.ID = id
- provider.callback = callback
-
- if err := eventRegister((*windows.GUID)(&provider.ID), globalProviderCallback, uintptr(provider.index), &provider.handle); err != nil {
- return nil, err
- }
-
- metadata := &bytes.Buffer{}
- binary.Write(metadata, binary.LittleEndian, uint16(0)) // Write empty size for buffer (to update later)
- metadata.WriteString(name)
- metadata.WriteByte(0) // Null terminator for name
- binary.LittleEndian.PutUint16(metadata.Bytes(), uint16(metadata.Len())) // Update the size at the beginning of the buffer
- provider.metadata = metadata.Bytes()
-
- if err := eventSetInformation(
- provider.handle,
- eventInfoClassProviderSetTraits,
- uintptr(unsafe.Pointer(&provider.metadata[0])),
- uint32(len(provider.metadata))); err != nil {
-
- return nil, err
- }
-
- return provider, nil
-}
diff --git a/vendor/github.com/Microsoft/go-winio/pkg/etw/newprovider_unsupported.go b/vendor/github.com/Microsoft/go-winio/pkg/etw/newprovider_unsupported.go
deleted file mode 100644
index 808455cc2..000000000
--- a/vendor/github.com/Microsoft/go-winio/pkg/etw/newprovider_unsupported.go
+++ /dev/null
@@ -1,12 +0,0 @@
-// +build arm
-
-package etw
-
-import (
- "github.com/Microsoft/go-winio/pkg/guid"
-)
-
-// NewProviderWithID returns a nil provider on unsupported platforms.
-func NewProviderWithID(name string, id guid.GUID, callback EnableCallback) (provider *Provider, err error) {
- return nil, nil
-}
diff --git a/vendor/github.com/Microsoft/go-winio/pkg/etw/provider.go b/vendor/github.com/Microsoft/go-winio/pkg/etw/provider.go
deleted file mode 100644
index 236960182..000000000
--- a/vendor/github.com/Microsoft/go-winio/pkg/etw/provider.go
+++ /dev/null
@@ -1,240 +0,0 @@
-package etw
-
-import (
- "crypto/sha1"
- "encoding/binary"
- "strings"
- "unicode/utf16"
-
- "github.com/Microsoft/go-winio/pkg/guid"
- "golang.org/x/sys/windows"
-)
-
-// Provider represents an ETW event provider. It is identified by a provider
-// name and ID (GUID), which should always have a 1:1 mapping to each other
-// (e.g. don't use multiple provider names with the same ID, or vice versa).
-type Provider struct {
- ID guid.GUID
- handle providerHandle
- metadata []byte
- callback EnableCallback
- index uint
- enabled bool
- level Level
- keywordAny uint64
- keywordAll uint64
-}
-
-// String returns the `provider`.ID as a string
-func (provider *Provider) String() string {
- if provider == nil {
- return ""
- }
-
- return provider.ID.String()
-}
-
-type providerHandle uint64
-
-// ProviderState informs the provider EnableCallback what action is being
-// performed.
-type ProviderState uint32
-
-const (
- // ProviderStateDisable indicates the provider is being disabled.
- ProviderStateDisable ProviderState = iota
- // ProviderStateEnable indicates the provider is being enabled.
- ProviderStateEnable
- // ProviderStateCaptureState indicates the provider is having its current
- // state snap-shotted.
- ProviderStateCaptureState
-)
-
-type eventInfoClass uint32
-
-const (
- eventInfoClassProviderBinaryTrackInfo eventInfoClass = iota
- eventInfoClassProviderSetReserved1
- eventInfoClassProviderSetTraits
- eventInfoClassProviderUseDescriptorType
-)
-
-// EnableCallback is the form of the callback function that receives provider
-// enable/disable notifications from ETW.
-type EnableCallback func(guid.GUID, ProviderState, Level, uint64, uint64, uintptr)
-
-func providerCallback(sourceID guid.GUID, state ProviderState, level Level, matchAnyKeyword uint64, matchAllKeyword uint64, filterData uintptr, i uintptr) {
- provider := providers.getProvider(uint(i))
-
- switch state {
- case ProviderStateDisable:
- provider.enabled = false
- case ProviderStateEnable:
- provider.enabled = true
- provider.level = level
- provider.keywordAny = matchAnyKeyword
- provider.keywordAll = matchAllKeyword
- }
-
- if provider.callback != nil {
- provider.callback(sourceID, state, level, matchAnyKeyword, matchAllKeyword, filterData)
- }
-}
-
-// providerCallbackAdapter acts as the first-level callback from the C/ETW side
-// for provider notifications. Because Go has trouble with callback arguments of
-// different size, it has only pointer-sized arguments, which are then cast to
-// the appropriate types when calling providerCallback.
-func providerCallbackAdapter(sourceID *guid.GUID, state uintptr, level uintptr, matchAnyKeyword uintptr, matchAllKeyword uintptr, filterData uintptr, i uintptr) uintptr {
- providerCallback(*sourceID, ProviderState(state), Level(level), uint64(matchAnyKeyword), uint64(matchAllKeyword), filterData, i)
- return 0
-}
-
-// providerIDFromName generates a provider ID based on the provider name. It
-// uses the same algorithm as used by .NET's EventSource class, which is based
-// on RFC 4122. More information on the algorithm can be found here:
-// https://blogs.msdn.microsoft.com/dcook/2015/09/08/etw-provider-names-and-guids/
-//
-// The algorithm is roughly the RFC 4122 algorithm for a V5 UUID, but differs in
-// the following ways:
-// - The input name is first upper-cased, UTF16-encoded, and converted to
-// big-endian.
-// - No variant is set on the result UUID.
-// - The result UUID is treated as being in little-endian format, rather than
-// big-endian.
-func providerIDFromName(name string) guid.GUID {
- buffer := sha1.New()
- namespace := guid.GUID{0x482C2DB2, 0xC390, 0x47C8, [8]byte{0x87, 0xF8, 0x1A, 0x15, 0xBF, 0xC1, 0x30, 0xFB}}
- namespaceBytes := namespace.ToArray()
- buffer.Write(namespaceBytes[:])
- binary.Write(buffer, binary.BigEndian, utf16.Encode([]rune(strings.ToUpper(name))))
-
- sum := buffer.Sum(nil)
- sum[7] = (sum[7] & 0xf) | 0x50
-
- a := [16]byte{}
- copy(a[:], sum)
- return guid.FromWindowsArray(a)
-}
-
-// NewProvider creates and registers a new ETW provider. The provider ID is
-// generated based on the provider name.
-func NewProvider(name string, callback EnableCallback) (provider *Provider, err error) {
- return NewProviderWithID(name, providerIDFromName(name), callback)
-}
-
-// Close unregisters the provider.
-func (provider *Provider) Close() error {
- if provider == nil {
- return nil
- }
-
- providers.removeProvider(provider)
- return eventUnregister(provider.handle)
-}
-
-// IsEnabled calls IsEnabledForLevelAndKeywords with LevelAlways and all
-// keywords set.
-func (provider *Provider) IsEnabled() bool {
- return provider.IsEnabledForLevelAndKeywords(LevelAlways, ^uint64(0))
-}
-
-// IsEnabledForLevel calls IsEnabledForLevelAndKeywords with the specified level
-// and all keywords set.
-func (provider *Provider) IsEnabledForLevel(level Level) bool {
- return provider.IsEnabledForLevelAndKeywords(level, ^uint64(0))
-}
-
-// IsEnabledForLevelAndKeywords allows event producer code to check if there are
-// any event sessions that are interested in an event, based on the event level
-// and keywords. Although this check happens automatically in the ETW
-// infrastructure, it can be useful to check if an event will actually be
-// consumed before doing expensive work to build the event data.
-func (provider *Provider) IsEnabledForLevelAndKeywords(level Level, keywords uint64) bool {
- if provider == nil {
- return false
- }
-
- if !provider.enabled {
- return false
- }
-
- // ETW automatically sets the level to 255 if it is specified as 0, so we
- // don't need to worry about the level=0 (all events) case.
- if level > provider.level {
- return false
- }
-
- if keywords != 0 && (keywords&provider.keywordAny == 0 || keywords&provider.keywordAll != provider.keywordAll) {
- return false
- }
-
- return true
-}
-
-// WriteEvent writes a single ETW event from the provider. The event is
-// constructed based on the EventOpt and FieldOpt values that are passed as
-// opts.
-func (provider *Provider) WriteEvent(name string, eventOpts []EventOpt, fieldOpts []FieldOpt) error {
- if provider == nil {
- return nil
- }
-
- options := eventOptions{descriptor: newEventDescriptor()}
- em := &eventMetadata{}
- ed := &eventData{}
-
- // We need to evaluate the EventOpts first since they might change tags, and
- // we write out the tags before evaluating FieldOpts.
- for _, opt := range eventOpts {
- opt(&options)
- }
-
- if !provider.IsEnabledForLevelAndKeywords(options.descriptor.level, options.descriptor.keyword) {
- return nil
- }
-
- em.writeEventHeader(name, options.tags)
-
- for _, opt := range fieldOpts {
- opt(em, ed)
- }
-
- // Don't pass a data blob if there is no event data. There will always be
- // event metadata (e.g. for the name) so we don't need to do this check for
- // the metadata.
- dataBlobs := [][]byte{}
- if len(ed.bytes()) > 0 {
- dataBlobs = [][]byte{ed.bytes()}
- }
-
- return provider.writeEventRaw(options.descriptor, options.activityID, options.relatedActivityID, [][]byte{em.bytes()}, dataBlobs)
-}
-
-// writeEventRaw writes a single ETW event from the provider. This function is
-// less abstracted than WriteEvent, and presents a fairly direct interface to
-// the event writing functionality. It expects a series of event metadata and
-// event data blobs to be passed in, which must conform to the TraceLogging
-// schema. The functions on EventMetadata and EventData can help with creating
-// these blobs. The blobs of each type are effectively concatenated together by
-// the ETW infrastructure.
-func (provider *Provider) writeEventRaw(
- descriptor *eventDescriptor,
- activityID guid.GUID,
- relatedActivityID guid.GUID,
- metadataBlobs [][]byte,
- dataBlobs [][]byte) error {
-
- dataDescriptorCount := uint32(1 + len(metadataBlobs) + len(dataBlobs))
- dataDescriptors := make([]eventDataDescriptor, 0, dataDescriptorCount)
-
- dataDescriptors = append(dataDescriptors, newEventDataDescriptor(eventDataDescriptorTypeProviderMetadata, provider.metadata))
- for _, blob := range metadataBlobs {
- dataDescriptors = append(dataDescriptors, newEventDataDescriptor(eventDataDescriptorTypeEventMetadata, blob))
- }
- for _, blob := range dataBlobs {
- dataDescriptors = append(dataDescriptors, newEventDataDescriptor(eventDataDescriptorTypeUserData, blob))
- }
-
- return eventWriteTransfer(provider.handle, descriptor, (*windows.GUID)(&activityID), (*windows.GUID)(&relatedActivityID), dataDescriptorCount, &dataDescriptors[0])
-}
diff --git a/vendor/github.com/Microsoft/go-winio/pkg/etw/providerglobal.go b/vendor/github.com/Microsoft/go-winio/pkg/etw/providerglobal.go
deleted file mode 100644
index 6c7331d99..000000000
--- a/vendor/github.com/Microsoft/go-winio/pkg/etw/providerglobal.go
+++ /dev/null
@@ -1,52 +0,0 @@
-package etw
-
-import (
- "sync"
-)
-
-// Because the provider callback function needs to be able to access the
-// provider data when it is invoked by ETW, we need to keep provider data stored
-// in a global map based on an index. The index is passed as the callback
-// context to ETW.
-type providerMap struct {
- m map[uint]*Provider
- i uint
- lock sync.Mutex
- once sync.Once
-}
-
-var providers = providerMap{
- m: make(map[uint]*Provider),
-}
-
-func (p *providerMap) newProvider() *Provider {
- p.lock.Lock()
- defer p.lock.Unlock()
-
- i := p.i
- p.i++
-
- provider := &Provider{
- index: i,
- }
-
- p.m[i] = provider
- return provider
-}
-
-func (p *providerMap) removeProvider(provider *Provider) {
- p.lock.Lock()
- defer p.lock.Unlock()
-
- delete(p.m, provider.index)
-}
-
-func (p *providerMap) getProvider(index uint) *Provider {
- p.lock.Lock()
- defer p.lock.Unlock()
-
- return p.m[index]
-}
-
-var providerCallbackOnce sync.Once
-var globalProviderCallback uintptr
diff --git a/vendor/github.com/Microsoft/go-winio/pkg/etw/ptr64_32.go b/vendor/github.com/Microsoft/go-winio/pkg/etw/ptr64_32.go
deleted file mode 100644
index d1a76125d..000000000
--- a/vendor/github.com/Microsoft/go-winio/pkg/etw/ptr64_32.go
+++ /dev/null
@@ -1,16 +0,0 @@
-// +build 386 arm
-
-package etw
-
-import (
- "unsafe"
-)
-
-// byteptr64 defines a struct containing a pointer. The struct is guaranteed to
-// be 64 bits, regardless of the actual size of a pointer on the platform. This
-// is intended for use with certain Windows APIs that expect a pointer as a
-// ULONGLONG.
-type ptr64 struct {
- ptr unsafe.Pointer
- _ uint32
-}
diff --git a/vendor/github.com/Microsoft/go-winio/pkg/etw/ptr64_64.go b/vendor/github.com/Microsoft/go-winio/pkg/etw/ptr64_64.go
deleted file mode 100644
index b86c8f2bd..000000000
--- a/vendor/github.com/Microsoft/go-winio/pkg/etw/ptr64_64.go
+++ /dev/null
@@ -1,15 +0,0 @@
-// +build amd64 arm64
-
-package etw
-
-import (
- "unsafe"
-)
-
-// byteptr64 defines a struct containing a pointer. The struct is guaranteed to
-// be 64 bits, regardless of the actual size of a pointer on the platform. This
-// is intended for use with certain Windows APIs that expect a pointer as a
-// ULONGLONG.
-type ptr64 struct {
- ptr unsafe.Pointer
-}
diff --git a/vendor/github.com/Microsoft/go-winio/pkg/etw/wrapper_32.go b/vendor/github.com/Microsoft/go-winio/pkg/etw/wrapper_32.go
deleted file mode 100644
index d0a7dac0c..000000000
--- a/vendor/github.com/Microsoft/go-winio/pkg/etw/wrapper_32.go
+++ /dev/null
@@ -1,51 +0,0 @@
-// +build 386 arm
-
-package etw
-
-import (
- "golang.org/x/sys/windows"
-)
-
-func low(v providerHandle) uint32 {
- return uint32(v & 0xffffffff)
-}
-
-func high(v providerHandle) uint32 {
- return low(v >> 32)
-}
-
-func eventUnregister(providerHandle providerHandle) (win32err error) {
- return eventUnregister_32(low(providerHandle), high(providerHandle))
-}
-
-func eventWriteTransfer(
- providerHandle providerHandle,
- descriptor *eventDescriptor,
- activityID *windows.GUID,
- relatedActivityID *windows.GUID,
- dataDescriptorCount uint32,
- dataDescriptors *eventDataDescriptor) (win32err error) {
-
- return eventWriteTransfer_32(
- low(providerHandle),
- high(providerHandle),
- descriptor,
- activityID,
- relatedActivityID,
- dataDescriptorCount,
- dataDescriptors)
-}
-
-func eventSetInformation(
- providerHandle providerHandle,
- class eventInfoClass,
- information uintptr,
- length uint32) (win32err error) {
-
- return eventSetInformation_32(
- low(providerHandle),
- high(providerHandle),
- class,
- information,
- length)
-}
diff --git a/vendor/github.com/Microsoft/go-winio/pkg/etw/wrapper_64.go b/vendor/github.com/Microsoft/go-winio/pkg/etw/wrapper_64.go
deleted file mode 100644
index ef8b599a6..000000000
--- a/vendor/github.com/Microsoft/go-winio/pkg/etw/wrapper_64.go
+++ /dev/null
@@ -1,41 +0,0 @@
-// +build amd64 arm64
-
-package etw
-
-import (
- "golang.org/x/sys/windows"
-)
-
-func eventUnregister(providerHandle providerHandle) (win32err error) {
- return eventUnregister_64(providerHandle)
-}
-
-func eventWriteTransfer(
- providerHandle providerHandle,
- descriptor *eventDescriptor,
- activityID *windows.GUID,
- relatedActivityID *windows.GUID,
- dataDescriptorCount uint32,
- dataDescriptors *eventDataDescriptor) (win32err error) {
-
- return eventWriteTransfer_64(
- providerHandle,
- descriptor,
- activityID,
- relatedActivityID,
- dataDescriptorCount,
- dataDescriptors)
-}
-
-func eventSetInformation(
- providerHandle providerHandle,
- class eventInfoClass,
- information uintptr,
- length uint32) (win32err error) {
-
- return eventSetInformation_64(
- providerHandle,
- class,
- information,
- length)
-}
diff --git a/vendor/github.com/Microsoft/go-winio/pkg/etw/zsyscall_windows.go b/vendor/github.com/Microsoft/go-winio/pkg/etw/zsyscall_windows.go
deleted file mode 100644
index 4e8a71922..000000000
--- a/vendor/github.com/Microsoft/go-winio/pkg/etw/zsyscall_windows.go
+++ /dev/null
@@ -1,102 +0,0 @@
-// Code generated by 'go generate'; DO NOT EDIT.
-
-package etw
-
-import (
- "syscall"
- "unsafe"
-
- "golang.org/x/sys/windows"
-)
-
-var _ unsafe.Pointer
-
-// Do the interface allocations only once for common
-// Errno values.
-const (
- errnoERROR_IO_PENDING = 997
-)
-
-var (
- errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING)
-)
-
-// errnoErr returns common boxed Errno values, to prevent
-// allocations at runtime.
-func errnoErr(e syscall.Errno) error {
- switch e {
- case 0:
- return nil
- case errnoERROR_IO_PENDING:
- return errERROR_IO_PENDING
- }
- // TODO: add more here, after collecting data on the common
- // error values see on Windows. (perhaps when running
- // all.bat?)
- return e
-}
-
-var (
- modadvapi32 = windows.NewLazySystemDLL("advapi32.dll")
-
- procEventRegister = modadvapi32.NewProc("EventRegister")
- procEventUnregister = modadvapi32.NewProc("EventUnregister")
- procEventWriteTransfer = modadvapi32.NewProc("EventWriteTransfer")
- procEventSetInformation = modadvapi32.NewProc("EventSetInformation")
-)
-
-func eventRegister(providerId *windows.GUID, callback uintptr, callbackContext uintptr, providerHandle *providerHandle) (win32err error) {
- r0, _, _ := syscall.Syscall6(procEventRegister.Addr(), 4, uintptr(unsafe.Pointer(providerId)), uintptr(callback), uintptr(callbackContext), uintptr(unsafe.Pointer(providerHandle)), 0, 0)
- if r0 != 0 {
- win32err = syscall.Errno(r0)
- }
- return
-}
-
-func eventUnregister_64(providerHandle providerHandle) (win32err error) {
- r0, _, _ := syscall.Syscall(procEventUnregister.Addr(), 1, uintptr(providerHandle), 0, 0)
- if r0 != 0 {
- win32err = syscall.Errno(r0)
- }
- return
-}
-
-func eventWriteTransfer_64(providerHandle providerHandle, descriptor *eventDescriptor, activityID *windows.GUID, relatedActivityID *windows.GUID, dataDescriptorCount uint32, dataDescriptors *eventDataDescriptor) (win32err error) {
- r0, _, _ := syscall.Syscall6(procEventWriteTransfer.Addr(), 6, uintptr(providerHandle), uintptr(unsafe.Pointer(descriptor)), uintptr(unsafe.Pointer(activityID)), uintptr(unsafe.Pointer(relatedActivityID)), uintptr(dataDescriptorCount), uintptr(unsafe.Pointer(dataDescriptors)))
- if r0 != 0 {
- win32err = syscall.Errno(r0)
- }
- return
-}
-
-func eventSetInformation_64(providerHandle providerHandle, class eventInfoClass, information uintptr, length uint32) (win32err error) {
- r0, _, _ := syscall.Syscall6(procEventSetInformation.Addr(), 4, uintptr(providerHandle), uintptr(class), uintptr(information), uintptr(length), 0, 0)
- if r0 != 0 {
- win32err = syscall.Errno(r0)
- }
- return
-}
-
-func eventUnregister_32(providerHandle_low uint32, providerHandle_high uint32) (win32err error) {
- r0, _, _ := syscall.Syscall(procEventUnregister.Addr(), 2, uintptr(providerHandle_low), uintptr(providerHandle_high), 0)
- if r0 != 0 {
- win32err = syscall.Errno(r0)
- }
- return
-}
-
-func eventWriteTransfer_32(providerHandle_low uint32, providerHandle_high uint32, descriptor *eventDescriptor, activityID *windows.GUID, relatedActivityID *windows.GUID, dataDescriptorCount uint32, dataDescriptors *eventDataDescriptor) (win32err error) {
- r0, _, _ := syscall.Syscall9(procEventWriteTransfer.Addr(), 7, uintptr(providerHandle_low), uintptr(providerHandle_high), uintptr(unsafe.Pointer(descriptor)), uintptr(unsafe.Pointer(activityID)), uintptr(unsafe.Pointer(relatedActivityID)), uintptr(dataDescriptorCount), uintptr(unsafe.Pointer(dataDescriptors)), 0, 0)
- if r0 != 0 {
- win32err = syscall.Errno(r0)
- }
- return
-}
-
-func eventSetInformation_32(providerHandle_low uint32, providerHandle_high uint32, class eventInfoClass, information uintptr, length uint32) (win32err error) {
- r0, _, _ := syscall.Syscall6(procEventSetInformation.Addr(), 5, uintptr(providerHandle_low), uintptr(providerHandle_high), uintptr(class), uintptr(information), uintptr(length), 0)
- if r0 != 0 {
- win32err = syscall.Errno(r0)
- }
- return
-}
diff --git a/vendor/github.com/Microsoft/go-winio/pkg/etwlogrus/hook.go b/vendor/github.com/Microsoft/go-winio/pkg/etwlogrus/hook.go
deleted file mode 100644
index 38228c39c..000000000
--- a/vendor/github.com/Microsoft/go-winio/pkg/etwlogrus/hook.go
+++ /dev/null
@@ -1,105 +0,0 @@
-package etwlogrus
-
-import (
- "sort"
-
- "github.com/Microsoft/go-winio/pkg/etw"
- "github.com/sirupsen/logrus"
-)
-
-// Hook is a Logrus hook which logs received events to ETW.
-type Hook struct {
- provider *etw.Provider
- closeProvider bool
-}
-
-// NewHook registers a new ETW provider and returns a hook to log from it. The
-// provider will be closed when the hook is closed.
-func NewHook(providerName string) (*Hook, error) {
- provider, err := etw.NewProvider(providerName, nil)
- if err != nil {
- return nil, err
- }
-
- return &Hook{provider, true}, nil
-}
-
-// NewHookFromProvider creates a new hook based on an existing ETW provider. The
-// provider will not be closed when the hook is closed.
-func NewHookFromProvider(provider *etw.Provider) (*Hook, error) {
- return &Hook{provider, false}, nil
-}
-
-// Levels returns the set of levels that this hook wants to receive log entries
-// for.
-func (h *Hook) Levels() []logrus.Level {
- return logrus.AllLevels
-}
-
-var logrusToETWLevelMap = map[logrus.Level]etw.Level{
- logrus.PanicLevel: etw.LevelAlways,
- logrus.FatalLevel: etw.LevelCritical,
- logrus.ErrorLevel: etw.LevelError,
- logrus.WarnLevel: etw.LevelWarning,
- logrus.InfoLevel: etw.LevelInfo,
- logrus.DebugLevel: etw.LevelVerbose,
- logrus.TraceLevel: etw.LevelVerbose,
-}
-
-// Fire receives each Logrus entry as it is logged, and logs it to ETW.
-func (h *Hook) Fire(e *logrus.Entry) error {
- // Logrus defines more levels than ETW typically uses, but analysis is
- // easiest when using a consistent set of levels across ETW providers, so we
- // map the Logrus levels to ETW levels.
- level := logrusToETWLevelMap[e.Level]
- if !h.provider.IsEnabledForLevel(level) {
- return nil
- }
-
- // Sort the fields by name so they are consistent in each instance
- // of an event. Otherwise, the fields don't line up in WPA.
- names := make([]string, 0, len(e.Data))
- hasError := false
- for k := range e.Data {
- if k == logrus.ErrorKey {
- // Always put the error last because it is optional in some events.
- hasError = true
- } else {
- names = append(names, k)
- }
- }
- sort.Strings(names)
-
- // Reserve extra space for the message and time fields.
- fields := make([]etw.FieldOpt, 0, len(e.Data)+2)
- fields = append(fields, etw.StringField("Message", e.Message))
- fields = append(fields, etw.Time("Time", e.Time))
- for _, k := range names {
- fields = append(fields, etw.SmartField(k, e.Data[k]))
- }
- if hasError {
- fields = append(fields, etw.SmartField(logrus.ErrorKey, e.Data[logrus.ErrorKey]))
- }
-
- // Firing an ETW event is essentially best effort, as the event write can
- // fail for reasons completely out of the control of the event writer (such
- // as a session listening for the event having no available space in its
- // buffers). Therefore, we don't return the error from WriteEvent, as it is
- // just noise in many cases.
- h.provider.WriteEvent(
- "LogrusEntry",
- etw.WithEventOpts(etw.WithLevel(level)),
- fields)
-
- return nil
-}
-
-// Close cleans up the hook and closes the ETW provider. If the provder was
-// registered by etwlogrus, it will be closed as part of `Close`. If the
-// provider was passed in, it will not be closed.
-func (h *Hook) Close() error {
- if h.closeProvider {
- return h.provider.Close()
- }
- return nil
-}
diff --git a/vendor/github.com/Microsoft/go-winio/pkg/fs/fs_windows.go b/vendor/github.com/Microsoft/go-winio/pkg/fs/fs_windows.go
deleted file mode 100644
index cf7de6d91..000000000
--- a/vendor/github.com/Microsoft/go-winio/pkg/fs/fs_windows.go
+++ /dev/null
@@ -1,47 +0,0 @@
-package fs
-
-import (
- "errors"
- "path/filepath"
- "syscall"
- "unsafe"
-
- "golang.org/x/sys/windows"
-)
-
-var (
- // ErrInvalidPath is returned when the location of a file path doesn't begin with a driver letter.
- ErrInvalidPath = errors.New("the path provided to GetFileSystemType must start with a drive letter")
-)
-
-// GetFileSystemType obtains the type of a file system through GetVolumeInformation.
-// https://msdn.microsoft.com/en-us/library/windows/desktop/aa364993(v=vs.85).aspx
-func GetFileSystemType(path string) (fsType string, hr error) {
- drive := filepath.VolumeName(path)
- if len(drive) != 2 {
- return "", ErrInvalidPath
- }
-
- var (
- modkernel32 = windows.NewLazySystemDLL("kernel32.dll")
- procGetVolumeInformation = modkernel32.NewProc("GetVolumeInformationW")
- buf = make([]uint16, 255)
- size = windows.MAX_PATH + 1
- )
- drive += `\`
- n := uintptr(unsafe.Pointer(nil))
- r0, _, _ := syscall.Syscall9(procGetVolumeInformation.Addr(), 8, uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(drive))), n, n, n, n, n, uintptr(unsafe.Pointer(&buf[0])), uintptr(size), 0)
- if int32(r0) < 0 {
- hr = syscall.Errno(win32FromHresult(r0))
- }
- fsType = windows.UTF16ToString(buf)
- return
-}
-
-// win32FromHresult is a helper function to get the win32 error code from an HRESULT.
-func win32FromHresult(hr uintptr) uintptr {
- if hr&0x1fff0000 == 0x00070000 {
- return hr & 0xffff
- }
- return hr
-}
diff --git a/vendor/github.com/Microsoft/go-winio/pkg/guid/guid.go b/vendor/github.com/Microsoft/go-winio/pkg/guid/guid.go
deleted file mode 100644
index 586406577..000000000
--- a/vendor/github.com/Microsoft/go-winio/pkg/guid/guid.go
+++ /dev/null
@@ -1,235 +0,0 @@
-// Package guid provides a GUID type. The backing structure for a GUID is
-// identical to that used by the golang.org/x/sys/windows GUID type.
-// There are two main binary encodings used for a GUID, the big-endian encoding,
-// and the Windows (mixed-endian) encoding. See here for details:
-// https://en.wikipedia.org/wiki/Universally_unique_identifier#Encoding
-package guid
-
-import (
- "crypto/rand"
- "crypto/sha1"
- "encoding"
- "encoding/binary"
- "fmt"
- "strconv"
-
- "golang.org/x/sys/windows"
-)
-
-// Variant specifies which GUID variant (or "type") of the GUID. It determines
-// how the entirety of the rest of the GUID is interpreted.
-type Variant uint8
-
-// The variants specified by RFC 4122.
-const (
- // VariantUnknown specifies a GUID variant which does not conform to one of
- // the variant encodings specified in RFC 4122.
- VariantUnknown Variant = iota
- VariantNCS
- VariantRFC4122
- VariantMicrosoft
- VariantFuture
-)
-
-// Version specifies how the bits in the GUID were generated. For instance, a
-// version 4 GUID is randomly generated, and a version 5 is generated from the
-// hash of an input string.
-type Version uint8
-
-var _ = (encoding.TextMarshaler)(GUID{})
-var _ = (encoding.TextUnmarshaler)(&GUID{})
-
-// GUID represents a GUID/UUID. It has the same structure as
-// golang.org/x/sys/windows.GUID so that it can be used with functions expecting
-// that type. It is defined as its own type so that stringification and
-// marshaling can be supported. The representation matches that used by native
-// Windows code.
-type GUID windows.GUID
-
-// NewV4 returns a new version 4 (pseudorandom) GUID, as defined by RFC 4122.
-func NewV4() (GUID, error) {
- var b [16]byte
- if _, err := rand.Read(b[:]); err != nil {
- return GUID{}, err
- }
-
- g := FromArray(b)
- g.setVersion(4) // Version 4 means randomly generated.
- g.setVariant(VariantRFC4122)
-
- return g, nil
-}
-
-// NewV5 returns a new version 5 (generated from a string via SHA-1 hashing)
-// GUID, as defined by RFC 4122. The RFC is unclear on the encoding of the name,
-// and the sample code treats it as a series of bytes, so we do the same here.
-//
-// Some implementations, such as those found on Windows, treat the name as a
-// big-endian UTF16 stream of bytes. If that is desired, the string can be
-// encoded as such before being passed to this function.
-func NewV5(namespace GUID, name []byte) (GUID, error) {
- b := sha1.New()
- namespaceBytes := namespace.ToArray()
- b.Write(namespaceBytes[:])
- b.Write(name)
-
- a := [16]byte{}
- copy(a[:], b.Sum(nil))
-
- g := FromArray(a)
- g.setVersion(5) // Version 5 means generated from a string.
- g.setVariant(VariantRFC4122)
-
- return g, nil
-}
-
-func fromArray(b [16]byte, order binary.ByteOrder) GUID {
- var g GUID
- g.Data1 = order.Uint32(b[0:4])
- g.Data2 = order.Uint16(b[4:6])
- g.Data3 = order.Uint16(b[6:8])
- copy(g.Data4[:], b[8:16])
- return g
-}
-
-func (g GUID) toArray(order binary.ByteOrder) [16]byte {
- b := [16]byte{}
- order.PutUint32(b[0:4], g.Data1)
- order.PutUint16(b[4:6], g.Data2)
- order.PutUint16(b[6:8], g.Data3)
- copy(b[8:16], g.Data4[:])
- return b
-}
-
-// FromArray constructs a GUID from a big-endian encoding array of 16 bytes.
-func FromArray(b [16]byte) GUID {
- return fromArray(b, binary.BigEndian)
-}
-
-// ToArray returns an array of 16 bytes representing the GUID in big-endian
-// encoding.
-func (g GUID) ToArray() [16]byte {
- return g.toArray(binary.BigEndian)
-}
-
-// FromWindowsArray constructs a GUID from a Windows encoding array of bytes.
-func FromWindowsArray(b [16]byte) GUID {
- return fromArray(b, binary.LittleEndian)
-}
-
-// ToWindowsArray returns an array of 16 bytes representing the GUID in Windows
-// encoding.
-func (g GUID) ToWindowsArray() [16]byte {
- return g.toArray(binary.LittleEndian)
-}
-
-func (g GUID) String() string {
- return fmt.Sprintf(
- "%08x-%04x-%04x-%04x-%012x",
- g.Data1,
- g.Data2,
- g.Data3,
- g.Data4[:2],
- g.Data4[2:])
-}
-
-// FromString parses a string containing a GUID and returns the GUID. The only
-// format currently supported is the `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`
-// format.
-func FromString(s string) (GUID, error) {
- if len(s) != 36 {
- return GUID{}, fmt.Errorf("invalid GUID %q", s)
- }
- if s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-' {
- return GUID{}, fmt.Errorf("invalid GUID %q", s)
- }
-
- var g GUID
-
- data1, err := strconv.ParseUint(s[0:8], 16, 32)
- if err != nil {
- return GUID{}, fmt.Errorf("invalid GUID %q", s)
- }
- g.Data1 = uint32(data1)
-
- data2, err := strconv.ParseUint(s[9:13], 16, 16)
- if err != nil {
- return GUID{}, fmt.Errorf("invalid GUID %q", s)
- }
- g.Data2 = uint16(data2)
-
- data3, err := strconv.ParseUint(s[14:18], 16, 16)
- if err != nil {
- return GUID{}, fmt.Errorf("invalid GUID %q", s)
- }
- g.Data3 = uint16(data3)
-
- for i, x := range []int{19, 21, 24, 26, 28, 30, 32, 34} {
- v, err := strconv.ParseUint(s[x:x+2], 16, 8)
- if err != nil {
- return GUID{}, fmt.Errorf("invalid GUID %q", s)
- }
- g.Data4[i] = uint8(v)
- }
-
- return g, nil
-}
-
-func (g *GUID) setVariant(v Variant) {
- d := g.Data4[0]
- switch v {
- case VariantNCS:
- d = (d & 0x7f)
- case VariantRFC4122:
- d = (d & 0x3f) | 0x80
- case VariantMicrosoft:
- d = (d & 0x1f) | 0xc0
- case VariantFuture:
- d = (d & 0x0f) | 0xe0
- case VariantUnknown:
- fallthrough
- default:
- panic(fmt.Sprintf("invalid variant: %d", v))
- }
- g.Data4[0] = d
-}
-
-// Variant returns the GUID variant, as defined in RFC 4122.
-func (g GUID) Variant() Variant {
- b := g.Data4[0]
- if b&0x80 == 0 {
- return VariantNCS
- } else if b&0xc0 == 0x80 {
- return VariantRFC4122
- } else if b&0xe0 == 0xc0 {
- return VariantMicrosoft
- } else if b&0xe0 == 0xe0 {
- return VariantFuture
- }
- return VariantUnknown
-}
-
-func (g *GUID) setVersion(v Version) {
- g.Data3 = (g.Data3 & 0x0fff) | (uint16(v) << 12)
-}
-
-// Version returns the GUID version, as defined in RFC 4122.
-func (g GUID) Version() Version {
- return Version((g.Data3 & 0xF000) >> 12)
-}
-
-// MarshalText returns the textual representation of the GUID.
-func (g GUID) MarshalText() ([]byte, error) {
- return []byte(g.String()), nil
-}
-
-// UnmarshalText takes the textual representation of a GUID, and unmarhals it
-// into this GUID.
-func (g *GUID) UnmarshalText(text []byte) error {
- g2, err := FromString(string(text))
- if err != nil {
- return err
- }
- *g = g2
- return nil
-}
diff --git a/vendor/github.com/Microsoft/go-winio/pkg/security/grantvmgroupaccess.go b/vendor/github.com/Microsoft/go-winio/pkg/security/grantvmgroupaccess.go
deleted file mode 100644
index 2df31b660..000000000
--- a/vendor/github.com/Microsoft/go-winio/pkg/security/grantvmgroupaccess.go
+++ /dev/null
@@ -1,159 +0,0 @@
-package security
-
-import (
- "os"
- "syscall"
- "unsafe"
-
- "github.com/pkg/errors"
-)
-
-type (
- accessMask uint32
- accessMode uint32
- desiredAccess uint32
- inheritMode uint32
- objectType uint32
- shareMode uint32
- securityInformation uint32
- trusteeForm uint32
- trusteeType uint32
-
- explicitAccess struct {
- accessPermissions accessMask
- accessMode accessMode
- inheritance inheritMode
- trustee trustee
- }
-
- trustee struct {
- multipleTrustee *trustee
- multipleTrusteeOperation int32
- trusteeForm trusteeForm
- trusteeType trusteeType
- name uintptr
- }
-)
-
-const (
- accessMaskDesiredPermission accessMask = 1 << 31 // GENERIC_READ
-
- accessModeGrant accessMode = 1
-
- desiredAccessReadControl desiredAccess = 0x20000
- desiredAccessWriteDac desiredAccess = 0x40000
-
- gvmga = "GrantVmGroupAccess:"
-
- inheritModeNoInheritance inheritMode = 0x0
- inheritModeSubContainersAndObjectsInherit inheritMode = 0x3
-
- objectTypeFileObject objectType = 0x1
-
- securityInformationDACL securityInformation = 0x4
-
- shareModeRead shareMode = 0x1
- shareModeWrite shareMode = 0x2
-
- sidVmGroup = "S-1-5-83-0"
-
- trusteeFormIsSid trusteeForm = 0
-
- trusteeTypeWellKnownGroup trusteeType = 5
-)
-
-// GrantVMGroupAccess sets the DACL for a specified file or directory to
-// include Grant ACE entries for the VM Group SID. This is a golang re-
-// implementation of the same function in vmcompute, just not exported in
-// RS5. Which kind of sucks. Sucks a lot :/
-func GrantVmGroupAccess(name string) error {
- // Stat (to determine if `name` is a directory).
- s, err := os.Stat(name)
- if err != nil {
- return errors.Wrapf(err, "%s os.Stat %s", gvmga, name)
- }
-
- // Get a handle to the file/directory. Must defer Close on success.
- fd, err := createFile(name, s.IsDir())
- if err != nil {
- return err // Already wrapped
- }
- defer syscall.CloseHandle(fd)
-
- // Get the current DACL and Security Descriptor. Must defer LocalFree on success.
- ot := objectTypeFileObject
- si := securityInformationDACL
- sd := uintptr(0)
- origDACL := uintptr(0)
- if err := getSecurityInfo(fd, uint32(ot), uint32(si), nil, nil, &origDACL, nil, &sd); err != nil {
- return errors.Wrapf(err, "%s GetSecurityInfo %s", gvmga, name)
- }
- defer syscall.LocalFree((syscall.Handle)(unsafe.Pointer(sd)))
-
- // Generate a new DACL which is the current DACL with the required ACEs added.
- // Must defer LocalFree on success.
- newDACL, err := generateDACLWithAcesAdded(name, s.IsDir(), origDACL)
- if err != nil {
- return err // Already wrapped
- }
- defer syscall.LocalFree((syscall.Handle)(unsafe.Pointer(newDACL)))
-
- // And finally use SetSecurityInfo to apply the updated DACL.
- if err := setSecurityInfo(fd, uint32(ot), uint32(si), uintptr(0), uintptr(0), newDACL, uintptr(0)); err != nil {
- return errors.Wrapf(err, "%s SetSecurityInfo %s", gvmga, name)
- }
-
- return nil
-}
-
-// createFile is a helper function to call [Nt]CreateFile to get a handle to
-// the file or directory.
-func createFile(name string, isDir bool) (syscall.Handle, error) {
- namep := syscall.StringToUTF16(name)
- da := uint32(desiredAccessReadControl | desiredAccessWriteDac)
- sm := uint32(shareModeRead | shareModeWrite)
- fa := uint32(syscall.FILE_ATTRIBUTE_NORMAL)
- if isDir {
- fa = uint32(fa | syscall.FILE_FLAG_BACKUP_SEMANTICS)
- }
- fd, err := syscall.CreateFile(&namep[0], da, sm, nil, syscall.OPEN_EXISTING, fa, 0)
- if err != nil {
- return 0, errors.Wrapf(err, "%s syscall.CreateFile %s", gvmga, name)
- }
- return fd, nil
-}
-
-// generateDACLWithAcesAdded generates a new DACL with the two needed ACEs added.
-// The caller is responsible for LocalFree of the returned DACL on success.
-func generateDACLWithAcesAdded(name string, isDir bool, origDACL uintptr) (uintptr, error) {
- // Generate pointers to the SIDs based on the string SIDs
- sid, err := syscall.StringToSid(sidVmGroup)
- if err != nil {
- return 0, errors.Wrapf(err, "%s syscall.StringToSid %s %s", gvmga, name, sidVmGroup)
- }
-
- inheritance := inheritModeNoInheritance
- if isDir {
- inheritance = inheritModeSubContainersAndObjectsInherit
- }
-
- eaArray := []explicitAccess{
- explicitAccess{
- accessPermissions: accessMaskDesiredPermission,
- accessMode: accessModeGrant,
- inheritance: inheritance,
- trustee: trustee{
- trusteeForm: trusteeFormIsSid,
- trusteeType: trusteeTypeWellKnownGroup,
- name: uintptr(unsafe.Pointer(sid)),
- },
- },
- }
-
- modifiedDACL := uintptr(0)
- if err := setEntriesInAcl(uintptr(uint32(1)), uintptr(unsafe.Pointer(&eaArray[0])), origDACL, &modifiedDACL); err != nil {
- return 0, errors.Wrapf(err, "%s SetEntriesInAcl %s", gvmga, name)
- }
-
- return modifiedDACL, nil
-}
diff --git a/vendor/github.com/Microsoft/go-winio/pkg/security/syscall_windows.go b/vendor/github.com/Microsoft/go-winio/pkg/security/syscall_windows.go
deleted file mode 100644
index c40c2739b..000000000
--- a/vendor/github.com/Microsoft/go-winio/pkg/security/syscall_windows.go
+++ /dev/null
@@ -1,7 +0,0 @@
-package security
-
-//go:generate go run mksyscall_windows.go -output zsyscall_windows.go syscall_windows.go
-
-//sys getSecurityInfo(handle syscall.Handle, objectType uint32, si uint32, ppsidOwner **uintptr, ppsidGroup **uintptr, ppDacl *uintptr, ppSacl *uintptr, ppSecurityDescriptor *uintptr) (err error) [failretval!=0] = advapi32.GetSecurityInfo
-//sys setSecurityInfo(handle syscall.Handle, objectType uint32, si uint32, psidOwner uintptr, psidGroup uintptr, pDacl uintptr, pSacl uintptr) (err error) [failretval!=0] = advapi32.SetSecurityInfo
-//sys setEntriesInAcl(count uintptr, pListOfEEs uintptr, oldAcl uintptr, newAcl *uintptr) (err error) [failretval!=0] = advapi32.SetEntriesInAclW
diff --git a/vendor/github.com/Microsoft/go-winio/pkg/security/zsyscall_windows.go b/vendor/github.com/Microsoft/go-winio/pkg/security/zsyscall_windows.go
deleted file mode 100644
index 0f0c0deff..000000000
--- a/vendor/github.com/Microsoft/go-winio/pkg/security/zsyscall_windows.go
+++ /dev/null
@@ -1,81 +0,0 @@
-// Code generated mksyscall_windows.exe DO NOT EDIT
-
-package security
-
-import (
- "syscall"
- "unsafe"
-
- "golang.org/x/sys/windows"
-)
-
-var _ unsafe.Pointer
-
-// Do the interface allocations only once for common
-// Errno values.
-const (
- errnoERROR_IO_PENDING = 997
-)
-
-var (
- errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING)
-)
-
-// errnoErr returns common boxed Errno values, to prevent
-// allocations at runtime.
-func errnoErr(e syscall.Errno) error {
- switch e {
- case 0:
- return nil
- case errnoERROR_IO_PENDING:
- return errERROR_IO_PENDING
- }
- // TODO: add more here, after collecting data on the common
- // error values see on Windows. (perhaps when running
- // all.bat?)
- return e
-}
-
-var (
- modadvapi32 = windows.NewLazySystemDLL("advapi32.dll")
-
- procGetSecurityInfo = modadvapi32.NewProc("GetSecurityInfo")
- procSetSecurityInfo = modadvapi32.NewProc("SetSecurityInfo")
- procSetEntriesInAclW = modadvapi32.NewProc("SetEntriesInAclW")
-)
-
-func getSecurityInfo(handle syscall.Handle, objectType uint32, si uint32, ppsidOwner **uintptr, ppsidGroup **uintptr, ppDacl *uintptr, ppSacl *uintptr, ppSecurityDescriptor *uintptr) (err error) {
- r1, _, e1 := syscall.Syscall9(procGetSecurityInfo.Addr(), 8, uintptr(handle), uintptr(objectType), uintptr(si), uintptr(unsafe.Pointer(ppsidOwner)), uintptr(unsafe.Pointer(ppsidGroup)), uintptr(unsafe.Pointer(ppDacl)), uintptr(unsafe.Pointer(ppSacl)), uintptr(unsafe.Pointer(ppSecurityDescriptor)), 0)
- if r1 != 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func setSecurityInfo(handle syscall.Handle, objectType uint32, si uint32, psidOwner uintptr, psidGroup uintptr, pDacl uintptr, pSacl uintptr) (err error) {
- r1, _, e1 := syscall.Syscall9(procSetSecurityInfo.Addr(), 7, uintptr(handle), uintptr(objectType), uintptr(si), uintptr(psidOwner), uintptr(psidGroup), uintptr(pDacl), uintptr(pSacl), 0, 0)
- if r1 != 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func setEntriesInAcl(count uintptr, pListOfEEs uintptr, oldAcl uintptr, newAcl *uintptr) (err error) {
- r1, _, e1 := syscall.Syscall6(procSetEntriesInAclW.Addr(), 4, uintptr(count), uintptr(pListOfEEs), uintptr(oldAcl), uintptr(unsafe.Pointer(newAcl)), 0, 0)
- if r1 != 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
diff --git a/vendor/github.com/Microsoft/go-winio/privilege.go b/vendor/github.com/Microsoft/go-winio/privilege.go
deleted file mode 100644
index 9c83d36fe..000000000
--- a/vendor/github.com/Microsoft/go-winio/privilege.go
+++ /dev/null
@@ -1,202 +0,0 @@
-// +build windows
-
-package winio
-
-import (
- "bytes"
- "encoding/binary"
- "fmt"
- "runtime"
- "sync"
- "syscall"
- "unicode/utf16"
-
- "golang.org/x/sys/windows"
-)
-
-//sys adjustTokenPrivileges(token windows.Token, releaseAll bool, input *byte, outputSize uint32, output *byte, requiredSize *uint32) (success bool, err error) [true] = advapi32.AdjustTokenPrivileges
-//sys impersonateSelf(level uint32) (err error) = advapi32.ImpersonateSelf
-//sys revertToSelf() (err error) = advapi32.RevertToSelf
-//sys openThreadToken(thread syscall.Handle, accessMask uint32, openAsSelf bool, token *windows.Token) (err error) = advapi32.OpenThreadToken
-//sys getCurrentThread() (h syscall.Handle) = GetCurrentThread
-//sys lookupPrivilegeValue(systemName string, name string, luid *uint64) (err error) = advapi32.LookupPrivilegeValueW
-//sys lookupPrivilegeName(systemName string, luid *uint64, buffer *uint16, size *uint32) (err error) = advapi32.LookupPrivilegeNameW
-//sys lookupPrivilegeDisplayName(systemName string, name *uint16, buffer *uint16, size *uint32, languageId *uint32) (err error) = advapi32.LookupPrivilegeDisplayNameW
-
-const (
- SE_PRIVILEGE_ENABLED = 2
-
- ERROR_NOT_ALL_ASSIGNED syscall.Errno = 1300
-
- SeBackupPrivilege = "SeBackupPrivilege"
- SeRestorePrivilege = "SeRestorePrivilege"
-)
-
-const (
- securityAnonymous = iota
- securityIdentification
- securityImpersonation
- securityDelegation
-)
-
-var (
- privNames = make(map[string]uint64)
- privNameMutex sync.Mutex
-)
-
-// PrivilegeError represents an error enabling privileges.
-type PrivilegeError struct {
- privileges []uint64
-}
-
-func (e *PrivilegeError) Error() string {
- s := ""
- if len(e.privileges) > 1 {
- s = "Could not enable privileges "
- } else {
- s = "Could not enable privilege "
- }
- for i, p := range e.privileges {
- if i != 0 {
- s += ", "
- }
- s += `"`
- s += getPrivilegeName(p)
- s += `"`
- }
- return s
-}
-
-// RunWithPrivilege enables a single privilege for a function call.
-func RunWithPrivilege(name string, fn func() error) error {
- return RunWithPrivileges([]string{name}, fn)
-}
-
-// RunWithPrivileges enables privileges for a function call.
-func RunWithPrivileges(names []string, fn func() error) error {
- privileges, err := mapPrivileges(names)
- if err != nil {
- return err
- }
- runtime.LockOSThread()
- defer runtime.UnlockOSThread()
- token, err := newThreadToken()
- if err != nil {
- return err
- }
- defer releaseThreadToken(token)
- err = adjustPrivileges(token, privileges, SE_PRIVILEGE_ENABLED)
- if err != nil {
- return err
- }
- return fn()
-}
-
-func mapPrivileges(names []string) ([]uint64, error) {
- var privileges []uint64
- privNameMutex.Lock()
- defer privNameMutex.Unlock()
- for _, name := range names {
- p, ok := privNames[name]
- if !ok {
- err := lookupPrivilegeValue("", name, &p)
- if err != nil {
- return nil, err
- }
- privNames[name] = p
- }
- privileges = append(privileges, p)
- }
- return privileges, nil
-}
-
-// EnableProcessPrivileges enables privileges globally for the process.
-func EnableProcessPrivileges(names []string) error {
- return enableDisableProcessPrivilege(names, SE_PRIVILEGE_ENABLED)
-}
-
-// DisableProcessPrivileges disables privileges globally for the process.
-func DisableProcessPrivileges(names []string) error {
- return enableDisableProcessPrivilege(names, 0)
-}
-
-func enableDisableProcessPrivilege(names []string, action uint32) error {
- privileges, err := mapPrivileges(names)
- if err != nil {
- return err
- }
-
- p, _ := windows.GetCurrentProcess()
- var token windows.Token
- err = windows.OpenProcessToken(p, windows.TOKEN_ADJUST_PRIVILEGES|windows.TOKEN_QUERY, &token)
- if err != nil {
- return err
- }
-
- defer token.Close()
- return adjustPrivileges(token, privileges, action)
-}
-
-func adjustPrivileges(token windows.Token, privileges []uint64, action uint32) error {
- var b bytes.Buffer
- binary.Write(&b, binary.LittleEndian, uint32(len(privileges)))
- for _, p := range privileges {
- binary.Write(&b, binary.LittleEndian, p)
- binary.Write(&b, binary.LittleEndian, action)
- }
- prevState := make([]byte, b.Len())
- reqSize := uint32(0)
- success, err := adjustTokenPrivileges(token, false, &b.Bytes()[0], uint32(len(prevState)), &prevState[0], &reqSize)
- if !success {
- return err
- }
- if err == ERROR_NOT_ALL_ASSIGNED {
- return &PrivilegeError{privileges}
- }
- return nil
-}
-
-func getPrivilegeName(luid uint64) string {
- var nameBuffer [256]uint16
- bufSize := uint32(len(nameBuffer))
- err := lookupPrivilegeName("", &luid, &nameBuffer[0], &bufSize)
- if err != nil {
- return fmt.Sprintf("", luid)
- }
-
- var displayNameBuffer [256]uint16
- displayBufSize := uint32(len(displayNameBuffer))
- var langID uint32
- err = lookupPrivilegeDisplayName("", &nameBuffer[0], &displayNameBuffer[0], &displayBufSize, &langID)
- if err != nil {
- return fmt.Sprintf("", string(utf16.Decode(nameBuffer[:bufSize])))
- }
-
- return string(utf16.Decode(displayNameBuffer[:displayBufSize]))
-}
-
-func newThreadToken() (windows.Token, error) {
- err := impersonateSelf(securityImpersonation)
- if err != nil {
- return 0, err
- }
-
- var token windows.Token
- err = openThreadToken(getCurrentThread(), syscall.TOKEN_ADJUST_PRIVILEGES|syscall.TOKEN_QUERY, false, &token)
- if err != nil {
- rerr := revertToSelf()
- if rerr != nil {
- panic(rerr)
- }
- return 0, err
- }
- return token, nil
-}
-
-func releaseThreadToken(h windows.Token) {
- err := revertToSelf()
- if err != nil {
- panic(err)
- }
- h.Close()
-}
diff --git a/vendor/github.com/Microsoft/go-winio/reparse.go b/vendor/github.com/Microsoft/go-winio/reparse.go
deleted file mode 100644
index fc1ee4d3a..000000000
--- a/vendor/github.com/Microsoft/go-winio/reparse.go
+++ /dev/null
@@ -1,128 +0,0 @@
-package winio
-
-import (
- "bytes"
- "encoding/binary"
- "fmt"
- "strings"
- "unicode/utf16"
- "unsafe"
-)
-
-const (
- reparseTagMountPoint = 0xA0000003
- reparseTagSymlink = 0xA000000C
-)
-
-type reparseDataBuffer struct {
- ReparseTag uint32
- ReparseDataLength uint16
- Reserved uint16
- SubstituteNameOffset uint16
- SubstituteNameLength uint16
- PrintNameOffset uint16
- PrintNameLength uint16
-}
-
-// ReparsePoint describes a Win32 symlink or mount point.
-type ReparsePoint struct {
- Target string
- IsMountPoint bool
-}
-
-// UnsupportedReparsePointError is returned when trying to decode a non-symlink or
-// mount point reparse point.
-type UnsupportedReparsePointError struct {
- Tag uint32
-}
-
-func (e *UnsupportedReparsePointError) Error() string {
- return fmt.Sprintf("unsupported reparse point %x", e.Tag)
-}
-
-// DecodeReparsePoint decodes a Win32 REPARSE_DATA_BUFFER structure containing either a symlink
-// or a mount point.
-func DecodeReparsePoint(b []byte) (*ReparsePoint, error) {
- tag := binary.LittleEndian.Uint32(b[0:4])
- return DecodeReparsePointData(tag, b[8:])
-}
-
-func DecodeReparsePointData(tag uint32, b []byte) (*ReparsePoint, error) {
- isMountPoint := false
- switch tag {
- case reparseTagMountPoint:
- isMountPoint = true
- case reparseTagSymlink:
- default:
- return nil, &UnsupportedReparsePointError{tag}
- }
- nameOffset := 8 + binary.LittleEndian.Uint16(b[4:6])
- if !isMountPoint {
- nameOffset += 4
- }
- nameLength := binary.LittleEndian.Uint16(b[6:8])
- name := make([]uint16, nameLength/2)
- err := binary.Read(bytes.NewReader(b[nameOffset:nameOffset+nameLength]), binary.LittleEndian, &name)
- if err != nil {
- return nil, err
- }
- return &ReparsePoint{string(utf16.Decode(name)), isMountPoint}, nil
-}
-
-func isDriveLetter(c byte) bool {
- return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')
-}
-
-// EncodeReparsePoint encodes a Win32 REPARSE_DATA_BUFFER structure describing a symlink or
-// mount point.
-func EncodeReparsePoint(rp *ReparsePoint) []byte {
- // Generate an NT path and determine if this is a relative path.
- var ntTarget string
- relative := false
- if strings.HasPrefix(rp.Target, `\\?\`) {
- ntTarget = `\??\` + rp.Target[4:]
- } else if strings.HasPrefix(rp.Target, `\\`) {
- ntTarget = `\??\UNC\` + rp.Target[2:]
- } else if len(rp.Target) >= 2 && isDriveLetter(rp.Target[0]) && rp.Target[1] == ':' {
- ntTarget = `\??\` + rp.Target
- } else {
- ntTarget = rp.Target
- relative = true
- }
-
- // The paths must be NUL-terminated even though they are counted strings.
- target16 := utf16.Encode([]rune(rp.Target + "\x00"))
- ntTarget16 := utf16.Encode([]rune(ntTarget + "\x00"))
-
- size := int(unsafe.Sizeof(reparseDataBuffer{})) - 8
- size += len(ntTarget16)*2 + len(target16)*2
-
- tag := uint32(reparseTagMountPoint)
- if !rp.IsMountPoint {
- tag = reparseTagSymlink
- size += 4 // Add room for symlink flags
- }
-
- data := reparseDataBuffer{
- ReparseTag: tag,
- ReparseDataLength: uint16(size),
- SubstituteNameOffset: 0,
- SubstituteNameLength: uint16((len(ntTarget16) - 1) * 2),
- PrintNameOffset: uint16(len(ntTarget16) * 2),
- PrintNameLength: uint16((len(target16) - 1) * 2),
- }
-
- var b bytes.Buffer
- binary.Write(&b, binary.LittleEndian, &data)
- if !rp.IsMountPoint {
- flags := uint32(0)
- if relative {
- flags |= 1
- }
- binary.Write(&b, binary.LittleEndian, flags)
- }
-
- binary.Write(&b, binary.LittleEndian, ntTarget16)
- binary.Write(&b, binary.LittleEndian, target16)
- return b.Bytes()
-}
diff --git a/vendor/github.com/Microsoft/go-winio/sd.go b/vendor/github.com/Microsoft/go-winio/sd.go
deleted file mode 100644
index db1b370a1..000000000
--- a/vendor/github.com/Microsoft/go-winio/sd.go
+++ /dev/null
@@ -1,98 +0,0 @@
-// +build windows
-
-package winio
-
-import (
- "syscall"
- "unsafe"
-)
-
-//sys lookupAccountName(systemName *uint16, accountName string, sid *byte, sidSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) = advapi32.LookupAccountNameW
-//sys convertSidToStringSid(sid *byte, str **uint16) (err error) = advapi32.ConvertSidToStringSidW
-//sys convertStringSecurityDescriptorToSecurityDescriptor(str string, revision uint32, sd *uintptr, size *uint32) (err error) = advapi32.ConvertStringSecurityDescriptorToSecurityDescriptorW
-//sys convertSecurityDescriptorToStringSecurityDescriptor(sd *byte, revision uint32, secInfo uint32, sddl **uint16, sddlSize *uint32) (err error) = advapi32.ConvertSecurityDescriptorToStringSecurityDescriptorW
-//sys localFree(mem uintptr) = LocalFree
-//sys getSecurityDescriptorLength(sd uintptr) (len uint32) = advapi32.GetSecurityDescriptorLength
-
-const (
- cERROR_NONE_MAPPED = syscall.Errno(1332)
-)
-
-type AccountLookupError struct {
- Name string
- Err error
-}
-
-func (e *AccountLookupError) Error() string {
- if e.Name == "" {
- return "lookup account: empty account name specified"
- }
- var s string
- switch e.Err {
- case cERROR_NONE_MAPPED:
- s = "not found"
- default:
- s = e.Err.Error()
- }
- return "lookup account " + e.Name + ": " + s
-}
-
-type SddlConversionError struct {
- Sddl string
- Err error
-}
-
-func (e *SddlConversionError) Error() string {
- return "convert " + e.Sddl + ": " + e.Err.Error()
-}
-
-// LookupSidByName looks up the SID of an account by name
-func LookupSidByName(name string) (sid string, err error) {
- if name == "" {
- return "", &AccountLookupError{name, cERROR_NONE_MAPPED}
- }
-
- var sidSize, sidNameUse, refDomainSize uint32
- err = lookupAccountName(nil, name, nil, &sidSize, nil, &refDomainSize, &sidNameUse)
- if err != nil && err != syscall.ERROR_INSUFFICIENT_BUFFER {
- return "", &AccountLookupError{name, err}
- }
- sidBuffer := make([]byte, sidSize)
- refDomainBuffer := make([]uint16, refDomainSize)
- err = lookupAccountName(nil, name, &sidBuffer[0], &sidSize, &refDomainBuffer[0], &refDomainSize, &sidNameUse)
- if err != nil {
- return "", &AccountLookupError{name, err}
- }
- var strBuffer *uint16
- err = convertSidToStringSid(&sidBuffer[0], &strBuffer)
- if err != nil {
- return "", &AccountLookupError{name, err}
- }
- sid = syscall.UTF16ToString((*[0xffff]uint16)(unsafe.Pointer(strBuffer))[:])
- localFree(uintptr(unsafe.Pointer(strBuffer)))
- return sid, nil
-}
-
-func SddlToSecurityDescriptor(sddl string) ([]byte, error) {
- var sdBuffer uintptr
- err := convertStringSecurityDescriptorToSecurityDescriptor(sddl, 1, &sdBuffer, nil)
- if err != nil {
- return nil, &SddlConversionError{sddl, err}
- }
- defer localFree(sdBuffer)
- sd := make([]byte, getSecurityDescriptorLength(sdBuffer))
- copy(sd, (*[0xffff]byte)(unsafe.Pointer(sdBuffer))[:len(sd)])
- return sd, nil
-}
-
-func SecurityDescriptorToSddl(sd []byte) (string, error) {
- var sddl *uint16
- // The returned string length seems to including an aribtrary number of terminating NULs.
- // Don't use it.
- err := convertSecurityDescriptorToStringSecurityDescriptor(&sd[0], 1, 0xff, &sddl, nil)
- if err != nil {
- return "", err
- }
- defer localFree(uintptr(unsafe.Pointer(sddl)))
- return syscall.UTF16ToString((*[0xffff]uint16)(unsafe.Pointer(sddl))[:]), nil
-}
diff --git a/vendor/github.com/Microsoft/go-winio/syscall.go b/vendor/github.com/Microsoft/go-winio/syscall.go
deleted file mode 100644
index 5cb52bc74..000000000
--- a/vendor/github.com/Microsoft/go-winio/syscall.go
+++ /dev/null
@@ -1,3 +0,0 @@
-package winio
-
-//go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go file.go pipe.go sd.go fileinfo.go privilege.go backup.go hvsock.go
diff --git a/vendor/github.com/Microsoft/go-winio/vhd/vhd.go b/vendor/github.com/Microsoft/go-winio/vhd/vhd.go
deleted file mode 100644
index 229ac2556..000000000
--- a/vendor/github.com/Microsoft/go-winio/vhd/vhd.go
+++ /dev/null
@@ -1,151 +0,0 @@
-// +build windows
-
-package vhd
-
-import "syscall"
-
-//go:generate go run mksyscall_windows.go -output zvhd.go vhd.go
-
-//sys createVirtualDisk(virtualStorageType *virtualStorageType, path string, virtualDiskAccessMask uint32, securityDescriptor *uintptr, flags uint32, providerSpecificFlags uint32, parameters *createVirtualDiskParameters, o *syscall.Overlapped, handle *syscall.Handle) (err error) [failretval != 0] = VirtDisk.CreateVirtualDisk
-//sys openVirtualDisk(virtualStorageType *virtualStorageType, path string, virtualDiskAccessMask uint32, flags uint32, parameters *openVirtualDiskParameters, handle *syscall.Handle) (err error) [failretval != 0] = VirtDisk.OpenVirtualDisk
-//sys detachVirtualDisk(handle syscall.Handle, flags uint32, providerSpecificFlags uint32) (err error) [failretval != 0] = VirtDisk.DetachVirtualDisk
-
-type virtualStorageType struct {
- DeviceID uint32
- VendorID [16]byte
-}
-
-type (
- createVirtualDiskFlag uint32
- VirtualDiskAccessMask uint32
- VirtualDiskFlag uint32
-)
-
-const (
- // Flags for creating a VHD (not exported)
- createVirtualDiskFlagNone createVirtualDiskFlag = 0
- createVirtualDiskFlagFullPhysicalAllocation createVirtualDiskFlag = 1
- createVirtualDiskFlagPreventWritesToSourceDisk createVirtualDiskFlag = 2
- createVirtualDiskFlagDoNotCopyMetadataFromParent createVirtualDiskFlag = 4
-
- // Access Mask for opening a VHD
- VirtualDiskAccessNone VirtualDiskAccessMask = 0
- VirtualDiskAccessAttachRO VirtualDiskAccessMask = 65536
- VirtualDiskAccessAttachRW VirtualDiskAccessMask = 131072
- VirtualDiskAccessDetach VirtualDiskAccessMask = 262144
- VirtualDiskAccessGetInfo VirtualDiskAccessMask = 524288
- VirtualDiskAccessCreate VirtualDiskAccessMask = 1048576
- VirtualDiskAccessMetaOps VirtualDiskAccessMask = 2097152
- VirtualDiskAccessRead VirtualDiskAccessMask = 851968
- VirtualDiskAccessAll VirtualDiskAccessMask = 4128768
- VirtualDiskAccessWritable VirtualDiskAccessMask = 3276800
-
- // Flags for opening a VHD
- OpenVirtualDiskFlagNone VirtualDiskFlag = 0
- OpenVirtualDiskFlagNoParents VirtualDiskFlag = 0x1
- OpenVirtualDiskFlagBlankFile VirtualDiskFlag = 0x2
- OpenVirtualDiskFlagBootDrive VirtualDiskFlag = 0x4
- OpenVirtualDiskFlagCachedIO VirtualDiskFlag = 0x8
- OpenVirtualDiskFlagCustomDiffChain VirtualDiskFlag = 0x10
- OpenVirtualDiskFlagParentCachedIO VirtualDiskFlag = 0x20
- OpenVirtualDiskFlagVhdSetFileOnly VirtualDiskFlag = 0x40
- OpenVirtualDiskFlagIgnoreRelativeParentLocator VirtualDiskFlag = 0x80
- OpenVirtualDiskFlagNoWriteHardening VirtualDiskFlag = 0x100
-)
-
-type createVersion2 struct {
- UniqueID [16]byte // GUID
- MaximumSize uint64
- BlockSizeInBytes uint32
- SectorSizeInBytes uint32
- ParentPath *uint16 // string
- SourcePath *uint16 // string
- OpenFlags uint32
- ParentVirtualStorageType virtualStorageType
- SourceVirtualStorageType virtualStorageType
- ResiliencyGUID [16]byte // GUID
-}
-
-type createVirtualDiskParameters struct {
- Version uint32 // Must always be set to 2
- Version2 createVersion2
-}
-
-type openVersion2 struct {
- GetInfoOnly int32 // bool but 4-byte aligned
- ReadOnly int32 // bool but 4-byte aligned
- ResiliencyGUID [16]byte // GUID
-}
-
-type openVirtualDiskParameters struct {
- Version uint32 // Must always be set to 2
- Version2 openVersion2
-}
-
-// CreateVhdx will create a simple vhdx file at the given path using default values.
-func CreateVhdx(path string, maxSizeInGb, blockSizeInMb uint32) error {
- var (
- defaultType virtualStorageType
- handle syscall.Handle
- )
-
- parameters := createVirtualDiskParameters{
- Version: 2,
- Version2: createVersion2{
- MaximumSize: uint64(maxSizeInGb) * 1024 * 1024 * 1024,
- BlockSizeInBytes: blockSizeInMb * 1024 * 1024,
- },
- }
-
- if err := createVirtualDisk(
- &defaultType,
- path,
- uint32(VirtualDiskAccessNone),
- nil,
- uint32(createVirtualDiskFlagNone),
- 0,
- ¶meters,
- nil,
- &handle); err != nil {
- return err
- }
-
- if err := syscall.CloseHandle(handle); err != nil {
- return err
- }
-
- return nil
-}
-
-// DetachVhd detaches a mounted container layer vhd found at `path`.
-func DetachVhd(path string) error {
- handle, err := OpenVirtualDisk(
- path,
- VirtualDiskAccessNone,
- OpenVirtualDiskFlagCachedIO|OpenVirtualDiskFlagIgnoreRelativeParentLocator)
-
- if err != nil {
- return err
- }
- defer syscall.CloseHandle(handle)
- return detachVirtualDisk(handle, 0, 0)
-}
-
-// OpenVirtualDisk obtains a handle to a VHD opened with supplied access mask and flags.
-func OpenVirtualDisk(path string, accessMask VirtualDiskAccessMask, flag VirtualDiskFlag) (syscall.Handle, error) {
- var (
- defaultType virtualStorageType
- handle syscall.Handle
- )
- parameters := openVirtualDiskParameters{Version: 2}
- if err := openVirtualDisk(
- &defaultType,
- path,
- uint32(accessMask),
- uint32(flag),
- ¶meters,
- &handle); err != nil {
- return 0, err
- }
- return handle, nil
-}
diff --git a/vendor/github.com/Microsoft/go-winio/vhd/zvhd.go b/vendor/github.com/Microsoft/go-winio/vhd/zvhd.go
deleted file mode 100644
index 00599ea49..000000000
--- a/vendor/github.com/Microsoft/go-winio/vhd/zvhd.go
+++ /dev/null
@@ -1,99 +0,0 @@
-// MACHINE GENERATED BY 'go generate' COMMAND; DO NOT EDIT
-
-package vhd
-
-import (
- "syscall"
- "unsafe"
-
- "golang.org/x/sys/windows"
-)
-
-var _ unsafe.Pointer
-
-// Do the interface allocations only once for common
-// Errno values.
-const (
- errnoERROR_IO_PENDING = 997
-)
-
-var (
- errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING)
-)
-
-// errnoErr returns common boxed Errno values, to prevent
-// allocations at runtime.
-func errnoErr(e syscall.Errno) error {
- switch e {
- case 0:
- return nil
- case errnoERROR_IO_PENDING:
- return errERROR_IO_PENDING
- }
- // TODO: add more here, after collecting data on the common
- // error values see on Windows. (perhaps when running
- // all.bat?)
- return e
-}
-
-var (
- modVirtDisk = windows.NewLazySystemDLL("VirtDisk.dll")
-
- procCreateVirtualDisk = modVirtDisk.NewProc("CreateVirtualDisk")
- procOpenVirtualDisk = modVirtDisk.NewProc("OpenVirtualDisk")
- procDetachVirtualDisk = modVirtDisk.NewProc("DetachVirtualDisk")
-)
-
-func createVirtualDisk(virtualStorageType *virtualStorageType, path string, virtualDiskAccessMask uint32, securityDescriptor *uintptr, flags uint32, providerSpecificFlags uint32, parameters *createVirtualDiskParameters, o *syscall.Overlapped, handle *syscall.Handle) (err error) {
- var _p0 *uint16
- _p0, err = syscall.UTF16PtrFromString(path)
- if err != nil {
- return
- }
- return _createVirtualDisk(virtualStorageType, _p0, virtualDiskAccessMask, securityDescriptor, flags, providerSpecificFlags, parameters, o, handle)
-}
-
-func _createVirtualDisk(virtualStorageType *virtualStorageType, path *uint16, virtualDiskAccessMask uint32, securityDescriptor *uintptr, flags uint32, providerSpecificFlags uint32, parameters *createVirtualDiskParameters, o *syscall.Overlapped, handle *syscall.Handle) (err error) {
- r1, _, e1 := syscall.Syscall9(procCreateVirtualDisk.Addr(), 9, uintptr(unsafe.Pointer(virtualStorageType)), uintptr(unsafe.Pointer(path)), uintptr(virtualDiskAccessMask), uintptr(unsafe.Pointer(securityDescriptor)), uintptr(flags), uintptr(providerSpecificFlags), uintptr(unsafe.Pointer(parameters)), uintptr(unsafe.Pointer(o)), uintptr(unsafe.Pointer(handle)))
- if r1 != 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func openVirtualDisk(virtualStorageType *virtualStorageType, path string, virtualDiskAccessMask uint32, flags uint32, parameters *openVirtualDiskParameters, handle *syscall.Handle) (err error) {
- var _p0 *uint16
- _p0, err = syscall.UTF16PtrFromString(path)
- if err != nil {
- return
- }
- return _openVirtualDisk(virtualStorageType, _p0, virtualDiskAccessMask, flags, parameters, handle)
-}
-
-func _openVirtualDisk(virtualStorageType *virtualStorageType, path *uint16, virtualDiskAccessMask uint32, flags uint32, parameters *openVirtualDiskParameters, handle *syscall.Handle) (err error) {
- r1, _, e1 := syscall.Syscall6(procOpenVirtualDisk.Addr(), 6, uintptr(unsafe.Pointer(virtualStorageType)), uintptr(unsafe.Pointer(path)), uintptr(virtualDiskAccessMask), uintptr(flags), uintptr(unsafe.Pointer(parameters)), uintptr(unsafe.Pointer(handle)))
- if r1 != 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func detachVirtualDisk(handle syscall.Handle, flags uint32, providerSpecificFlags uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procDetachVirtualDisk.Addr(), 3, uintptr(handle), uintptr(flags), uintptr(providerSpecificFlags))
- if r1 != 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
diff --git a/vendor/github.com/Microsoft/go-winio/zsyscall_windows.go b/vendor/github.com/Microsoft/go-winio/zsyscall_windows.go
deleted file mode 100644
index e26b01faf..000000000
--- a/vendor/github.com/Microsoft/go-winio/zsyscall_windows.go
+++ /dev/null
@@ -1,562 +0,0 @@
-// Code generated by 'go generate'; DO NOT EDIT.
-
-package winio
-
-import (
- "syscall"
- "unsafe"
-
- "golang.org/x/sys/windows"
-)
-
-var _ unsafe.Pointer
-
-// Do the interface allocations only once for common
-// Errno values.
-const (
- errnoERROR_IO_PENDING = 997
-)
-
-var (
- errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING)
-)
-
-// errnoErr returns common boxed Errno values, to prevent
-// allocations at runtime.
-func errnoErr(e syscall.Errno) error {
- switch e {
- case 0:
- return nil
- case errnoERROR_IO_PENDING:
- return errERROR_IO_PENDING
- }
- // TODO: add more here, after collecting data on the common
- // error values see on Windows. (perhaps when running
- // all.bat?)
- return e
-}
-
-var (
- modkernel32 = windows.NewLazySystemDLL("kernel32.dll")
- modws2_32 = windows.NewLazySystemDLL("ws2_32.dll")
- modntdll = windows.NewLazySystemDLL("ntdll.dll")
- modadvapi32 = windows.NewLazySystemDLL("advapi32.dll")
-
- procCancelIoEx = modkernel32.NewProc("CancelIoEx")
- procCreateIoCompletionPort = modkernel32.NewProc("CreateIoCompletionPort")
- procGetQueuedCompletionStatus = modkernel32.NewProc("GetQueuedCompletionStatus")
- procSetFileCompletionNotificationModes = modkernel32.NewProc("SetFileCompletionNotificationModes")
- procWSAGetOverlappedResult = modws2_32.NewProc("WSAGetOverlappedResult")
- procConnectNamedPipe = modkernel32.NewProc("ConnectNamedPipe")
- procCreateNamedPipeW = modkernel32.NewProc("CreateNamedPipeW")
- procCreateFileW = modkernel32.NewProc("CreateFileW")
- procGetNamedPipeInfo = modkernel32.NewProc("GetNamedPipeInfo")
- procGetNamedPipeHandleStateW = modkernel32.NewProc("GetNamedPipeHandleStateW")
- procLocalAlloc = modkernel32.NewProc("LocalAlloc")
- procNtCreateNamedPipeFile = modntdll.NewProc("NtCreateNamedPipeFile")
- procRtlNtStatusToDosErrorNoTeb = modntdll.NewProc("RtlNtStatusToDosErrorNoTeb")
- procRtlDosPathNameToNtPathName_U = modntdll.NewProc("RtlDosPathNameToNtPathName_U")
- procRtlDefaultNpAcl = modntdll.NewProc("RtlDefaultNpAcl")
- procLookupAccountNameW = modadvapi32.NewProc("LookupAccountNameW")
- procConvertSidToStringSidW = modadvapi32.NewProc("ConvertSidToStringSidW")
- procConvertStringSecurityDescriptorToSecurityDescriptorW = modadvapi32.NewProc("ConvertStringSecurityDescriptorToSecurityDescriptorW")
- procConvertSecurityDescriptorToStringSecurityDescriptorW = modadvapi32.NewProc("ConvertSecurityDescriptorToStringSecurityDescriptorW")
- procLocalFree = modkernel32.NewProc("LocalFree")
- procGetSecurityDescriptorLength = modadvapi32.NewProc("GetSecurityDescriptorLength")
- procGetFileInformationByHandleEx = modkernel32.NewProc("GetFileInformationByHandleEx")
- procSetFileInformationByHandle = modkernel32.NewProc("SetFileInformationByHandle")
- procAdjustTokenPrivileges = modadvapi32.NewProc("AdjustTokenPrivileges")
- procImpersonateSelf = modadvapi32.NewProc("ImpersonateSelf")
- procRevertToSelf = modadvapi32.NewProc("RevertToSelf")
- procOpenThreadToken = modadvapi32.NewProc("OpenThreadToken")
- procGetCurrentThread = modkernel32.NewProc("GetCurrentThread")
- procLookupPrivilegeValueW = modadvapi32.NewProc("LookupPrivilegeValueW")
- procLookupPrivilegeNameW = modadvapi32.NewProc("LookupPrivilegeNameW")
- procLookupPrivilegeDisplayNameW = modadvapi32.NewProc("LookupPrivilegeDisplayNameW")
- procBackupRead = modkernel32.NewProc("BackupRead")
- procBackupWrite = modkernel32.NewProc("BackupWrite")
- procbind = modws2_32.NewProc("bind")
-)
-
-func cancelIoEx(file syscall.Handle, o *syscall.Overlapped) (err error) {
- r1, _, e1 := syscall.Syscall(procCancelIoEx.Addr(), 2, uintptr(file), uintptr(unsafe.Pointer(o)), 0)
- if r1 == 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func createIoCompletionPort(file syscall.Handle, port syscall.Handle, key uintptr, threadCount uint32) (newport syscall.Handle, err error) {
- r0, _, e1 := syscall.Syscall6(procCreateIoCompletionPort.Addr(), 4, uintptr(file), uintptr(port), uintptr(key), uintptr(threadCount), 0, 0)
- newport = syscall.Handle(r0)
- if newport == 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func getQueuedCompletionStatus(port syscall.Handle, bytes *uint32, key *uintptr, o **ioOperation, timeout uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procGetQueuedCompletionStatus.Addr(), 5, uintptr(port), uintptr(unsafe.Pointer(bytes)), uintptr(unsafe.Pointer(key)), uintptr(unsafe.Pointer(o)), uintptr(timeout), 0)
- if r1 == 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func setFileCompletionNotificationModes(h syscall.Handle, flags uint8) (err error) {
- r1, _, e1 := syscall.Syscall(procSetFileCompletionNotificationModes.Addr(), 2, uintptr(h), uintptr(flags), 0)
- if r1 == 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func wsaGetOverlappedResult(h syscall.Handle, o *syscall.Overlapped, bytes *uint32, wait bool, flags *uint32) (err error) {
- var _p0 uint32
- if wait {
- _p0 = 1
- } else {
- _p0 = 0
- }
- r1, _, e1 := syscall.Syscall6(procWSAGetOverlappedResult.Addr(), 5, uintptr(h), uintptr(unsafe.Pointer(o)), uintptr(unsafe.Pointer(bytes)), uintptr(_p0), uintptr(unsafe.Pointer(flags)), 0)
- if r1 == 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func connectNamedPipe(pipe syscall.Handle, o *syscall.Overlapped) (err error) {
- r1, _, e1 := syscall.Syscall(procConnectNamedPipe.Addr(), 2, uintptr(pipe), uintptr(unsafe.Pointer(o)), 0)
- if r1 == 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func createNamedPipe(name string, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *syscall.SecurityAttributes) (handle syscall.Handle, err error) {
- var _p0 *uint16
- _p0, err = syscall.UTF16PtrFromString(name)
- if err != nil {
- return
- }
- return _createNamedPipe(_p0, flags, pipeMode, maxInstances, outSize, inSize, defaultTimeout, sa)
-}
-
-func _createNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *syscall.SecurityAttributes) (handle syscall.Handle, err error) {
- r0, _, e1 := syscall.Syscall9(procCreateNamedPipeW.Addr(), 8, uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(pipeMode), uintptr(maxInstances), uintptr(outSize), uintptr(inSize), uintptr(defaultTimeout), uintptr(unsafe.Pointer(sa)), 0)
- handle = syscall.Handle(r0)
- if handle == syscall.InvalidHandle {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func createFile(name string, access uint32, mode uint32, sa *syscall.SecurityAttributes, createmode uint32, attrs uint32, templatefile syscall.Handle) (handle syscall.Handle, err error) {
- var _p0 *uint16
- _p0, err = syscall.UTF16PtrFromString(name)
- if err != nil {
- return
- }
- return _createFile(_p0, access, mode, sa, createmode, attrs, templatefile)
-}
-
-func _createFile(name *uint16, access uint32, mode uint32, sa *syscall.SecurityAttributes, createmode uint32, attrs uint32, templatefile syscall.Handle) (handle syscall.Handle, err error) {
- r0, _, e1 := syscall.Syscall9(procCreateFileW.Addr(), 7, uintptr(unsafe.Pointer(name)), uintptr(access), uintptr(mode), uintptr(unsafe.Pointer(sa)), uintptr(createmode), uintptr(attrs), uintptr(templatefile), 0, 0)
- handle = syscall.Handle(r0)
- if handle == syscall.InvalidHandle {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func getNamedPipeInfo(pipe syscall.Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procGetNamedPipeInfo.Addr(), 5, uintptr(pipe), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(outSize)), uintptr(unsafe.Pointer(inSize)), uintptr(unsafe.Pointer(maxInstances)), 0)
- if r1 == 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func getNamedPipeHandleState(pipe syscall.Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) {
- r1, _, e1 := syscall.Syscall9(procGetNamedPipeHandleStateW.Addr(), 7, uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(curInstances)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout)), uintptr(unsafe.Pointer(userName)), uintptr(maxUserNameSize), 0, 0)
- if r1 == 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func localAlloc(uFlags uint32, length uint32) (ptr uintptr) {
- r0, _, _ := syscall.Syscall(procLocalAlloc.Addr(), 2, uintptr(uFlags), uintptr(length), 0)
- ptr = uintptr(r0)
- return
-}
-
-func ntCreateNamedPipeFile(pipe *syscall.Handle, access uint32, oa *objectAttributes, iosb *ioStatusBlock, share uint32, disposition uint32, options uint32, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (status ntstatus) {
- r0, _, _ := syscall.Syscall15(procNtCreateNamedPipeFile.Addr(), 14, uintptr(unsafe.Pointer(pipe)), uintptr(access), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(share), uintptr(disposition), uintptr(options), uintptr(typ), uintptr(readMode), uintptr(completionMode), uintptr(maxInstances), uintptr(inboundQuota), uintptr(outputQuota), uintptr(unsafe.Pointer(timeout)), 0)
- status = ntstatus(r0)
- return
-}
-
-func rtlNtStatusToDosError(status ntstatus) (winerr error) {
- r0, _, _ := syscall.Syscall(procRtlNtStatusToDosErrorNoTeb.Addr(), 1, uintptr(status), 0, 0)
- if r0 != 0 {
- winerr = syscall.Errno(r0)
- }
- return
-}
-
-func rtlDosPathNameToNtPathName(name *uint16, ntName *unicodeString, filePart uintptr, reserved uintptr) (status ntstatus) {
- r0, _, _ := syscall.Syscall6(procRtlDosPathNameToNtPathName_U.Addr(), 4, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(ntName)), uintptr(filePart), uintptr(reserved), 0, 0)
- status = ntstatus(r0)
- return
-}
-
-func rtlDefaultNpAcl(dacl *uintptr) (status ntstatus) {
- r0, _, _ := syscall.Syscall(procRtlDefaultNpAcl.Addr(), 1, uintptr(unsafe.Pointer(dacl)), 0, 0)
- status = ntstatus(r0)
- return
-}
-
-func lookupAccountName(systemName *uint16, accountName string, sid *byte, sidSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) {
- var _p0 *uint16
- _p0, err = syscall.UTF16PtrFromString(accountName)
- if err != nil {
- return
- }
- return _lookupAccountName(systemName, _p0, sid, sidSize, refDomain, refDomainSize, sidNameUse)
-}
-
-func _lookupAccountName(systemName *uint16, accountName *uint16, sid *byte, sidSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) {
- r1, _, e1 := syscall.Syscall9(procLookupAccountNameW.Addr(), 7, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(accountName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sidSize)), uintptr(unsafe.Pointer(refDomain)), uintptr(unsafe.Pointer(refDomainSize)), uintptr(unsafe.Pointer(sidNameUse)), 0, 0)
- if r1 == 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func convertSidToStringSid(sid *byte, str **uint16) (err error) {
- r1, _, e1 := syscall.Syscall(procConvertSidToStringSidW.Addr(), 2, uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(str)), 0)
- if r1 == 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func convertStringSecurityDescriptorToSecurityDescriptor(str string, revision uint32, sd *uintptr, size *uint32) (err error) {
- var _p0 *uint16
- _p0, err = syscall.UTF16PtrFromString(str)
- if err != nil {
- return
- }
- return _convertStringSecurityDescriptorToSecurityDescriptor(_p0, revision, sd, size)
-}
-
-func _convertStringSecurityDescriptorToSecurityDescriptor(str *uint16, revision uint32, sd *uintptr, size *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procConvertStringSecurityDescriptorToSecurityDescriptorW.Addr(), 4, uintptr(unsafe.Pointer(str)), uintptr(revision), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(size)), 0, 0)
- if r1 == 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func convertSecurityDescriptorToStringSecurityDescriptor(sd *byte, revision uint32, secInfo uint32, sddl **uint16, sddlSize *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procConvertSecurityDescriptorToStringSecurityDescriptorW.Addr(), 5, uintptr(unsafe.Pointer(sd)), uintptr(revision), uintptr(secInfo), uintptr(unsafe.Pointer(sddl)), uintptr(unsafe.Pointer(sddlSize)), 0)
- if r1 == 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func localFree(mem uintptr) {
- syscall.Syscall(procLocalFree.Addr(), 1, uintptr(mem), 0, 0)
- return
-}
-
-func getSecurityDescriptorLength(sd uintptr) (len uint32) {
- r0, _, _ := syscall.Syscall(procGetSecurityDescriptorLength.Addr(), 1, uintptr(sd), 0, 0)
- len = uint32(r0)
- return
-}
-
-func getFileInformationByHandleEx(h syscall.Handle, class uint32, buffer *byte, size uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procGetFileInformationByHandleEx.Addr(), 4, uintptr(h), uintptr(class), uintptr(unsafe.Pointer(buffer)), uintptr(size), 0, 0)
- if r1 == 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func setFileInformationByHandle(h syscall.Handle, class uint32, buffer *byte, size uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procSetFileInformationByHandle.Addr(), 4, uintptr(h), uintptr(class), uintptr(unsafe.Pointer(buffer)), uintptr(size), 0, 0)
- if r1 == 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func adjustTokenPrivileges(token windows.Token, releaseAll bool, input *byte, outputSize uint32, output *byte, requiredSize *uint32) (success bool, err error) {
- var _p0 uint32
- if releaseAll {
- _p0 = 1
- } else {
- _p0 = 0
- }
- r0, _, e1 := syscall.Syscall6(procAdjustTokenPrivileges.Addr(), 6, uintptr(token), uintptr(_p0), uintptr(unsafe.Pointer(input)), uintptr(outputSize), uintptr(unsafe.Pointer(output)), uintptr(unsafe.Pointer(requiredSize)))
- success = r0 != 0
- if true {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func impersonateSelf(level uint32) (err error) {
- r1, _, e1 := syscall.Syscall(procImpersonateSelf.Addr(), 1, uintptr(level), 0, 0)
- if r1 == 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func revertToSelf() (err error) {
- r1, _, e1 := syscall.Syscall(procRevertToSelf.Addr(), 0, 0, 0, 0)
- if r1 == 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func openThreadToken(thread syscall.Handle, accessMask uint32, openAsSelf bool, token *windows.Token) (err error) {
- var _p0 uint32
- if openAsSelf {
- _p0 = 1
- } else {
- _p0 = 0
- }
- r1, _, e1 := syscall.Syscall6(procOpenThreadToken.Addr(), 4, uintptr(thread), uintptr(accessMask), uintptr(_p0), uintptr(unsafe.Pointer(token)), 0, 0)
- if r1 == 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func getCurrentThread() (h syscall.Handle) {
- r0, _, _ := syscall.Syscall(procGetCurrentThread.Addr(), 0, 0, 0, 0)
- h = syscall.Handle(r0)
- return
-}
-
-func lookupPrivilegeValue(systemName string, name string, luid *uint64) (err error) {
- var _p0 *uint16
- _p0, err = syscall.UTF16PtrFromString(systemName)
- if err != nil {
- return
- }
- var _p1 *uint16
- _p1, err = syscall.UTF16PtrFromString(name)
- if err != nil {
- return
- }
- return _lookupPrivilegeValue(_p0, _p1, luid)
-}
-
-func _lookupPrivilegeValue(systemName *uint16, name *uint16, luid *uint64) (err error) {
- r1, _, e1 := syscall.Syscall(procLookupPrivilegeValueW.Addr(), 3, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(luid)))
- if r1 == 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func lookupPrivilegeName(systemName string, luid *uint64, buffer *uint16, size *uint32) (err error) {
- var _p0 *uint16
- _p0, err = syscall.UTF16PtrFromString(systemName)
- if err != nil {
- return
- }
- return _lookupPrivilegeName(_p0, luid, buffer, size)
-}
-
-func _lookupPrivilegeName(systemName *uint16, luid *uint64, buffer *uint16, size *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procLookupPrivilegeNameW.Addr(), 4, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(luid)), uintptr(unsafe.Pointer(buffer)), uintptr(unsafe.Pointer(size)), 0, 0)
- if r1 == 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func lookupPrivilegeDisplayName(systemName string, name *uint16, buffer *uint16, size *uint32, languageId *uint32) (err error) {
- var _p0 *uint16
- _p0, err = syscall.UTF16PtrFromString(systemName)
- if err != nil {
- return
- }
- return _lookupPrivilegeDisplayName(_p0, name, buffer, size, languageId)
-}
-
-func _lookupPrivilegeDisplayName(systemName *uint16, name *uint16, buffer *uint16, size *uint32, languageId *uint32) (err error) {
- r1, _, e1 := syscall.Syscall6(procLookupPrivilegeDisplayNameW.Addr(), 5, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buffer)), uintptr(unsafe.Pointer(size)), uintptr(unsafe.Pointer(languageId)), 0)
- if r1 == 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func backupRead(h syscall.Handle, b []byte, bytesRead *uint32, abort bool, processSecurity bool, context *uintptr) (err error) {
- var _p0 *byte
- if len(b) > 0 {
- _p0 = &b[0]
- }
- var _p1 uint32
- if abort {
- _p1 = 1
- } else {
- _p1 = 0
- }
- var _p2 uint32
- if processSecurity {
- _p2 = 1
- } else {
- _p2 = 0
- }
- r1, _, e1 := syscall.Syscall9(procBackupRead.Addr(), 7, uintptr(h), uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(unsafe.Pointer(bytesRead)), uintptr(_p1), uintptr(_p2), uintptr(unsafe.Pointer(context)), 0, 0)
- if r1 == 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func backupWrite(h syscall.Handle, b []byte, bytesWritten *uint32, abort bool, processSecurity bool, context *uintptr) (err error) {
- var _p0 *byte
- if len(b) > 0 {
- _p0 = &b[0]
- }
- var _p1 uint32
- if abort {
- _p1 = 1
- } else {
- _p1 = 0
- }
- var _p2 uint32
- if processSecurity {
- _p2 = 1
- } else {
- _p2 = 0
- }
- r1, _, e1 := syscall.Syscall9(procBackupWrite.Addr(), 7, uintptr(h), uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(unsafe.Pointer(bytesWritten)), uintptr(_p1), uintptr(_p2), uintptr(unsafe.Pointer(context)), 0, 0)
- if r1 == 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func bind(s syscall.Handle, name unsafe.Pointer, namelen int32) (err error) {
- r1, _, e1 := syscall.Syscall(procbind.Addr(), 3, uintptr(s), uintptr(name), uintptr(namelen))
- if r1 == socketError {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/LICENSE b/vendor/github.com/Microsoft/hcsshim/LICENSE
deleted file mode 100644
index 49d21669a..000000000
--- a/vendor/github.com/Microsoft/hcsshim/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2015 Microsoft
-
-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.
\ No newline at end of file
diff --git a/vendor/github.com/Microsoft/hcsshim/README.md b/vendor/github.com/Microsoft/hcsshim/README.md
deleted file mode 100644
index d504f1889..000000000
--- a/vendor/github.com/Microsoft/hcsshim/README.md
+++ /dev/null
@@ -1,46 +0,0 @@
-# hcsshim
-
-[](https://ci.appveyor.com/project/WindowsVirtualization/hcsshim/branch/master)
-
-This package contains the Golang interface for using the Windows [Host Compute Service](https://techcommunity.microsoft.com/t5/containers/introducing-the-host-compute-service-hcs/ba-p/382332) (HCS) to launch and manage [Windows Containers](https://docs.microsoft.com/en-us/virtualization/windowscontainers/about/). It also contains other helpers and functions for managing Windows Containers such as the Golang interface for the Host Network Service (HNS).
-
-It is primarily used in the [Moby Project](https://github.com/moby/moby), but it can be freely used by other projects as well.
-
-## Contributing
-
-This project welcomes contributions and suggestions. Most contributions require you to agree to a
-Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
-the rights to use your contribution. For details, visit https://cla.microsoft.com.
-
-When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
-a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions
-provided by the bot. You will only need to do this once across all repos using our CLA.
-
-We also ask that contributors [sign their commits](https://git-scm.com/docs/git-commit) using `git commit -s` or `git commit --signoff` to certify they either authored the work themselves or otherwise have permission to use it in this project.
-
-
-## Code of Conduct
-
-This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
-For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
-contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
-
-## Dependencies
-
-This project requires Golang 1.9 or newer to build.
-
-For system requirements to run this project, see the Microsoft docs on [Windows Container requirements](https://docs.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/system-requirements).
-
-## Reporting Security Issues
-
-Security issues and bugs should be reported privately, via email, to the Microsoft Security
-Response Center (MSRC) at [secure@microsoft.com](mailto:secure@microsoft.com). You should
-receive a response within 24 hours. If for some reason you do not, please follow up via
-email to ensure we received your original message. Further information, including the
-[MSRC PGP](https://technet.microsoft.com/en-us/security/dn606155) key, can be found in
-the [Security TechCenter](https://technet.microsoft.com/en-us/security/default).
-
-For additional details, see [Report a Computer Security Vulnerability](https://technet.microsoft.com/en-us/security/ff852094.aspx) on Technet
-
----------------
-Copyright (c) 2018 Microsoft Corp. All rights reserved.
diff --git a/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/doc.go b/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/doc.go
deleted file mode 100644
index 0684d0596..000000000
--- a/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/doc.go
+++ /dev/null
@@ -1 +0,0 @@
-package options
diff --git a/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go b/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go
deleted file mode 100644
index 2190e56a7..000000000
--- a/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go
+++ /dev/null
@@ -1,1261 +0,0 @@
-// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.proto
-
-package options
-
-import (
- fmt "fmt"
- proto "github.com/gogo/protobuf/proto"
- _ "github.com/gogo/protobuf/types"
- github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
- io "io"
- math "math"
- reflect "reflect"
- strings "strings"
- time "time"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-var _ = time.Kitchen
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
-
-type Options_DebugType int32
-
-const (
- Options_NPIPE Options_DebugType = 0
- Options_FILE Options_DebugType = 1
- Options_ETW Options_DebugType = 2
-)
-
-var Options_DebugType_name = map[int32]string{
- 0: "NPIPE",
- 1: "FILE",
- 2: "ETW",
-}
-
-var Options_DebugType_value = map[string]int32{
- "NPIPE": 0,
- "FILE": 1,
- "ETW": 2,
-}
-
-func (x Options_DebugType) String() string {
- return proto.EnumName(Options_DebugType_name, int32(x))
-}
-
-func (Options_DebugType) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_b643df6839c75082, []int{0, 0}
-}
-
-type Options_SandboxIsolation int32
-
-const (
- Options_PROCESS Options_SandboxIsolation = 0
- Options_HYPERVISOR Options_SandboxIsolation = 1
-)
-
-var Options_SandboxIsolation_name = map[int32]string{
- 0: "PROCESS",
- 1: "HYPERVISOR",
-}
-
-var Options_SandboxIsolation_value = map[string]int32{
- "PROCESS": 0,
- "HYPERVISOR": 1,
-}
-
-func (x Options_SandboxIsolation) String() string {
- return proto.EnumName(Options_SandboxIsolation_name, int32(x))
-}
-
-func (Options_SandboxIsolation) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_b643df6839c75082, []int{0, 1}
-}
-
-// Options are the set of customizations that can be passed at Create time.
-type Options struct {
- // enable debug tracing
- Debug bool `protobuf:"varint,1,opt,name=debug,proto3" json:"debug,omitempty"`
- // debug tracing output type
- DebugType Options_DebugType `protobuf:"varint,2,opt,name=debug_type,json=debugType,proto3,enum=containerd.runhcs.v1.Options_DebugType" json:"debug_type,omitempty"`
- // registry key root for storage of the runhcs container state
- RegistryRoot string `protobuf:"bytes,3,opt,name=registry_root,json=registryRoot,proto3" json:"registry_root,omitempty"`
- // sandbox_image is the image to use for the sandbox that matches the
- // sandbox_platform.
- SandboxImage string `protobuf:"bytes,4,opt,name=sandbox_image,json=sandboxImage,proto3" json:"sandbox_image,omitempty"`
- // sandbox_platform is a CRI setting that specifies the platform
- // architecture for all sandbox's in this runtime. Values are
- // 'windows/amd64' and 'linux/amd64'.
- SandboxPlatform string `protobuf:"bytes,5,opt,name=sandbox_platform,json=sandboxPlatform,proto3" json:"sandbox_platform,omitempty"`
- // sandbox_isolation is a CRI setting that specifies the isolation level of
- // the sandbox. For Windows runtime PROCESS and HYPERVISOR are valid. For
- // LCOW only HYPERVISOR is valid and default if omitted.
- SandboxIsolation Options_SandboxIsolation `protobuf:"varint,6,opt,name=sandbox_isolation,json=sandboxIsolation,proto3,enum=containerd.runhcs.v1.Options_SandboxIsolation" json:"sandbox_isolation,omitempty"`
- // boot_files_root_path is the path to the directory containing the LCOW
- // kernel and root FS files.
- BootFilesRootPath string `protobuf:"bytes,7,opt,name=boot_files_root_path,json=bootFilesRootPath,proto3" json:"boot_files_root_path,omitempty"`
- // vm_processor_count is the default number of processors to create for the
- // hypervisor isolated utility vm.
- //
- // The platform default if omitted is 2, unless the host only has a single
- // core in which case it is 1.
- VmProcessorCount int32 `protobuf:"varint,8,opt,name=vm_processor_count,json=vmProcessorCount,proto3" json:"vm_processor_count,omitempty"`
- // vm_memory_size_in_mb is the default amount of memory to assign to the
- // hypervisor isolated utility vm.
- //
- // The platform default is 1024MB if omitted.
- VmMemorySizeInMb int32 `protobuf:"varint,9,opt,name=vm_memory_size_in_mb,json=vmMemorySizeInMb,proto3" json:"vm_memory_size_in_mb,omitempty"`
- // GPUVHDPath is the path to the gpu vhd to add to the uvm
- // when a container requests a gpu
- GPUVHDPath string `protobuf:"bytes,10,opt,name=GPUVHDPath,json=gPUVHDPath,proto3" json:"GPUVHDPath,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Options) Reset() { *m = Options{} }
-func (*Options) ProtoMessage() {}
-func (*Options) Descriptor() ([]byte, []int) {
- return fileDescriptor_b643df6839c75082, []int{0}
-}
-func (m *Options) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Options) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_Options.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *Options) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Options.Merge(m, src)
-}
-func (m *Options) XXX_Size() int {
- return m.Size()
-}
-func (m *Options) XXX_DiscardUnknown() {
- xxx_messageInfo_Options.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Options proto.InternalMessageInfo
-
-// ProcessDetails contains additional information about a process. This is the additional
-// info returned in the Pids query.
-type ProcessDetails struct {
- ImageName string `protobuf:"bytes,1,opt,name=image_name,json=imageName,proto3" json:"image_name,omitempty"`
- CreatedAt time.Time `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at"`
- KernelTime_100Ns uint64 `protobuf:"varint,3,opt,name=kernel_time_100_ns,json=kernelTime100Ns,proto3" json:"kernel_time_100_ns,omitempty"`
- MemoryCommitBytes uint64 `protobuf:"varint,4,opt,name=memory_commit_bytes,json=memoryCommitBytes,proto3" json:"memory_commit_bytes,omitempty"`
- MemoryWorkingSetPrivateBytes uint64 `protobuf:"varint,5,opt,name=memory_working_set_private_bytes,json=memoryWorkingSetPrivateBytes,proto3" json:"memory_working_set_private_bytes,omitempty"`
- MemoryWorkingSetSharedBytes uint64 `protobuf:"varint,6,opt,name=memory_working_set_shared_bytes,json=memoryWorkingSetSharedBytes,proto3" json:"memory_working_set_shared_bytes,omitempty"`
- ProcessID uint32 `protobuf:"varint,7,opt,name=process_id,json=processId,proto3" json:"process_id,omitempty"`
- UserTime_100Ns uint64 `protobuf:"varint,8,opt,name=user_time_100_ns,json=userTime100Ns,proto3" json:"user_time_100_ns,omitempty"`
- ExecID string `protobuf:"bytes,9,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ProcessDetails) Reset() { *m = ProcessDetails{} }
-func (*ProcessDetails) ProtoMessage() {}
-func (*ProcessDetails) Descriptor() ([]byte, []int) {
- return fileDescriptor_b643df6839c75082, []int{1}
-}
-func (m *ProcessDetails) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ProcessDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ProcessDetails.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *ProcessDetails) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ProcessDetails.Merge(m, src)
-}
-func (m *ProcessDetails) XXX_Size() int {
- return m.Size()
-}
-func (m *ProcessDetails) XXX_DiscardUnknown() {
- xxx_messageInfo_ProcessDetails.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ProcessDetails proto.InternalMessageInfo
-
-func init() {
- proto.RegisterEnum("containerd.runhcs.v1.Options_DebugType", Options_DebugType_name, Options_DebugType_value)
- proto.RegisterEnum("containerd.runhcs.v1.Options_SandboxIsolation", Options_SandboxIsolation_name, Options_SandboxIsolation_value)
- proto.RegisterType((*Options)(nil), "containerd.runhcs.v1.Options")
- proto.RegisterType((*ProcessDetails)(nil), "containerd.runhcs.v1.ProcessDetails")
-}
-
-func init() {
- proto.RegisterFile("github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.proto", fileDescriptor_b643df6839c75082)
-}
-
-var fileDescriptor_b643df6839c75082 = []byte{
- // 777 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xcd, 0x6f, 0xdb, 0x36,
- 0x1c, 0xb5, 0x9a, 0xf8, 0x43, 0xbf, 0x2e, 0xa9, 0xc2, 0xf9, 0x20, 0x64, 0x9b, 0x6d, 0xa4, 0x87,
- 0xa6, 0x58, 0x23, 0x25, 0xdd, 0x71, 0xa7, 0x39, 0x76, 0x56, 0x0d, 0x4b, 0x22, 0xc8, 0x59, 0xbb,
- 0x8f, 0x03, 0xa1, 0x0f, 0x46, 0x26, 0x6a, 0x8a, 0x02, 0x49, 0x7b, 0x71, 0x4f, 0xfb, 0x13, 0xf6,
- 0x47, 0xed, 0x90, 0xe3, 0x8e, 0x03, 0x06, 0x64, 0xab, 0xff, 0x92, 0x81, 0x94, 0x94, 0x62, 0x45,
- 0xb1, 0xcb, 0x4e, 0xa6, 0xde, 0x7b, 0x7c, 0xbf, 0x0f, 0x3e, 0x18, 0x2e, 0x73, 0xaa, 0xe6, 0xcb,
- 0xc4, 0x4b, 0x39, 0xf3, 0xcf, 0x69, 0x2a, 0xb8, 0xe4, 0xd7, 0xca, 0x9f, 0xa7, 0x52, 0xce, 0x29,
- 0xf3, 0x53, 0x96, 0xf9, 0x29, 0x2f, 0x54, 0x4c, 0x0b, 0x22, 0xb2, 0x23, 0x8d, 0x1d, 0x89, 0x65,
- 0x31, 0x4f, 0xe5, 0xd1, 0xea, 0xc4, 0xe7, 0xa5, 0xa2, 0xbc, 0x90, 0x7e, 0x85, 0x78, 0xa5, 0xe0,
- 0x8a, 0xa3, 0xfe, 0x3b, 0xbd, 0x57, 0x13, 0xab, 0x93, 0xfd, 0x7e, 0xce, 0x73, 0x6e, 0x04, 0xbe,
- 0x3e, 0x55, 0xda, 0xfd, 0x61, 0xce, 0x79, 0xbe, 0x20, 0xbe, 0xf9, 0x4a, 0x96, 0xd7, 0xbe, 0xa2,
- 0x8c, 0x48, 0x15, 0xb3, 0xb2, 0x12, 0x1c, 0xfc, 0xb6, 0x0d, 0xdd, 0xcb, 0xaa, 0x0a, 0xea, 0x43,
- 0x3b, 0x23, 0xc9, 0x32, 0x77, 0xad, 0x91, 0x75, 0xd8, 0x8b, 0xaa, 0x0f, 0x74, 0x06, 0x60, 0x0e,
- 0x58, 0xad, 0x4b, 0xe2, 0x3e, 0x18, 0x59, 0x87, 0xbb, 0xcf, 0x9f, 0x78, 0x1f, 0xea, 0xc1, 0xab,
- 0x8d, 0xbc, 0x89, 0xd6, 0x5f, 0xad, 0x4b, 0x12, 0xd9, 0x59, 0x73, 0x44, 0x8f, 0x61, 0x47, 0x90,
- 0x9c, 0x4a, 0x25, 0xd6, 0x58, 0x70, 0xae, 0xdc, 0xad, 0x91, 0x75, 0x68, 0x47, 0x1f, 0x35, 0x60,
- 0xc4, 0xb9, 0xd2, 0x22, 0x19, 0x17, 0x59, 0xc2, 0x6f, 0x30, 0x65, 0x71, 0x4e, 0xdc, 0xed, 0x4a,
- 0x54, 0x83, 0x81, 0xc6, 0xd0, 0x53, 0x70, 0x1a, 0x51, 0xb9, 0x88, 0xd5, 0x35, 0x17, 0xcc, 0x6d,
- 0x1b, 0xdd, 0xa3, 0x1a, 0x0f, 0x6b, 0x18, 0xfd, 0x04, 0x7b, 0xf7, 0x7e, 0x92, 0x2f, 0x62, 0xdd,
- 0x9f, 0xdb, 0x31, 0x33, 0x78, 0xff, 0x3d, 0xc3, 0xac, 0xae, 0xd8, 0xdc, 0x8a, 0x9a, 0x9a, 0xf7,
- 0x08, 0xf2, 0xa1, 0x9f, 0x70, 0xae, 0xf0, 0x35, 0x5d, 0x10, 0x69, 0x66, 0xc2, 0x65, 0xac, 0xe6,
- 0x6e, 0xd7, 0xf4, 0xb2, 0xa7, 0xb9, 0x33, 0x4d, 0xe9, 0xc9, 0xc2, 0x58, 0xcd, 0xd1, 0x33, 0x40,
- 0x2b, 0x86, 0x4b, 0xc1, 0x53, 0x22, 0x25, 0x17, 0x38, 0xe5, 0xcb, 0x42, 0xb9, 0xbd, 0x91, 0x75,
- 0xd8, 0x8e, 0x9c, 0x15, 0x0b, 0x1b, 0xe2, 0x54, 0xe3, 0xc8, 0x83, 0xfe, 0x8a, 0x61, 0x46, 0x18,
- 0x17, 0x6b, 0x2c, 0xe9, 0x1b, 0x82, 0x69, 0x81, 0x59, 0xe2, 0xda, 0x8d, 0xfe, 0xdc, 0x50, 0x33,
- 0xfa, 0x86, 0x04, 0xc5, 0x79, 0x82, 0x06, 0x00, 0x5f, 0x87, 0xdf, 0xbd, 0x7c, 0x31, 0xd1, 0xb5,
- 0x5c, 0x30, 0x4d, 0x40, 0x7e, 0x8f, 0x1c, 0x3c, 0x05, 0xfb, 0xfe, 0x61, 0x90, 0x0d, 0xed, 0x8b,
- 0x30, 0x08, 0xa7, 0x4e, 0x0b, 0xf5, 0x60, 0xfb, 0x2c, 0xf8, 0x76, 0xea, 0x58, 0xa8, 0x0b, 0x5b,
- 0xd3, 0xab, 0x57, 0xce, 0x83, 0x03, 0x1f, 0x9c, 0xf7, 0xe7, 0x47, 0x0f, 0xa1, 0x1b, 0x46, 0x97,
- 0xa7, 0xd3, 0xd9, 0xcc, 0x69, 0xa1, 0x5d, 0x80, 0x17, 0x3f, 0x84, 0xd3, 0xe8, 0x65, 0x30, 0xbb,
- 0x8c, 0x1c, 0xeb, 0xe0, 0xcf, 0x2d, 0xd8, 0xad, 0xdb, 0x9f, 0x10, 0x15, 0xd3, 0x85, 0x44, 0x9f,
- 0x01, 0x98, 0x27, 0xc4, 0x45, 0xcc, 0x88, 0x89, 0x94, 0x1d, 0xd9, 0x06, 0xb9, 0x88, 0x19, 0x41,
- 0xa7, 0x00, 0xa9, 0x20, 0xb1, 0x22, 0x19, 0x8e, 0x95, 0x89, 0xd5, 0xc3, 0xe7, 0xfb, 0x5e, 0x15,
- 0x57, 0xaf, 0x89, 0xab, 0x77, 0xd5, 0xc4, 0x75, 0xdc, 0xbb, 0xbd, 0x1b, 0xb6, 0x7e, 0xfd, 0x6b,
- 0x68, 0x45, 0x76, 0x7d, 0xef, 0x2b, 0x85, 0x3e, 0x07, 0xf4, 0x9a, 0x88, 0x82, 0x2c, 0xb0, 0xce,
- 0x35, 0x3e, 0x39, 0x3e, 0xc6, 0x85, 0x34, 0xc1, 0xda, 0x8e, 0x1e, 0x55, 0x8c, 0x76, 0x38, 0x39,
- 0x3e, 0xbe, 0x90, 0xc8, 0x83, 0x8f, 0xeb, 0x65, 0xa6, 0x9c, 0x31, 0xaa, 0x70, 0xb2, 0x56, 0x44,
- 0x9a, 0x84, 0x6d, 0x47, 0x7b, 0x15, 0x75, 0x6a, 0x98, 0xb1, 0x26, 0xd0, 0x19, 0x8c, 0x6a, 0xfd,
- 0xcf, 0x5c, 0xbc, 0xa6, 0x45, 0x8e, 0x25, 0x51, 0xb8, 0x14, 0x74, 0x15, 0x2b, 0x52, 0x5f, 0x6e,
- 0x9b, 0xcb, 0x9f, 0x56, 0xba, 0x57, 0x95, 0x6c, 0x46, 0x54, 0x58, 0x89, 0x2a, 0x9f, 0x09, 0x0c,
- 0x3f, 0xe0, 0x23, 0xe7, 0xb1, 0x20, 0x59, 0x6d, 0xd3, 0x31, 0x36, 0x9f, 0xbc, 0x6f, 0x33, 0x33,
- 0x9a, 0xca, 0xe5, 0x19, 0x40, 0x1d, 0x1c, 0x4c, 0x33, 0x13, 0xb1, 0x9d, 0xf1, 0xce, 0xe6, 0x6e,
- 0x68, 0xd7, 0x6b, 0x0f, 0x26, 0x91, 0x5d, 0x0b, 0x82, 0x0c, 0x3d, 0x01, 0x67, 0x29, 0x89, 0xf8,
- 0xd7, 0x5a, 0x7a, 0xa6, 0xc8, 0x8e, 0xc6, 0xdf, 0x2d, 0xe5, 0x31, 0x74, 0xc9, 0x0d, 0x49, 0xb5,
- 0xa7, 0xce, 0x95, 0x3d, 0x86, 0xcd, 0xdd, 0xb0, 0x33, 0xbd, 0x21, 0x69, 0x30, 0x89, 0x3a, 0x9a,
- 0x0a, 0xb2, 0x71, 0x76, 0xfb, 0x76, 0xd0, 0xfa, 0xe3, 0xed, 0xa0, 0xf5, 0xcb, 0x66, 0x60, 0xdd,
- 0x6e, 0x06, 0xd6, 0xef, 0x9b, 0x81, 0xf5, 0xf7, 0x66, 0x60, 0xfd, 0xf8, 0xcd, 0xff, 0xff, 0x73,
- 0xfb, 0xb2, 0xfe, 0xfd, 0xbe, 0x95, 0x74, 0xcc, 0xbb, 0x7f, 0xf1, 0x4f, 0x00, 0x00, 0x00, 0xff,
- 0xff, 0xc9, 0xeb, 0xae, 0x6f, 0x33, 0x05, 0x00, 0x00,
-}
-
-func (m *Options) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *Options) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Debug {
- dAtA[i] = 0x8
- i++
- if m.Debug {
- dAtA[i] = 1
- } else {
- dAtA[i] = 0
- }
- i++
- }
- if m.DebugType != 0 {
- dAtA[i] = 0x10
- i++
- i = encodeVarintRunhcs(dAtA, i, uint64(m.DebugType))
- }
- if len(m.RegistryRoot) > 0 {
- dAtA[i] = 0x1a
- i++
- i = encodeVarintRunhcs(dAtA, i, uint64(len(m.RegistryRoot)))
- i += copy(dAtA[i:], m.RegistryRoot)
- }
- if len(m.SandboxImage) > 0 {
- dAtA[i] = 0x22
- i++
- i = encodeVarintRunhcs(dAtA, i, uint64(len(m.SandboxImage)))
- i += copy(dAtA[i:], m.SandboxImage)
- }
- if len(m.SandboxPlatform) > 0 {
- dAtA[i] = 0x2a
- i++
- i = encodeVarintRunhcs(dAtA, i, uint64(len(m.SandboxPlatform)))
- i += copy(dAtA[i:], m.SandboxPlatform)
- }
- if m.SandboxIsolation != 0 {
- dAtA[i] = 0x30
- i++
- i = encodeVarintRunhcs(dAtA, i, uint64(m.SandboxIsolation))
- }
- if len(m.BootFilesRootPath) > 0 {
- dAtA[i] = 0x3a
- i++
- i = encodeVarintRunhcs(dAtA, i, uint64(len(m.BootFilesRootPath)))
- i += copy(dAtA[i:], m.BootFilesRootPath)
- }
- if m.VmProcessorCount != 0 {
- dAtA[i] = 0x40
- i++
- i = encodeVarintRunhcs(dAtA, i, uint64(m.VmProcessorCount))
- }
- if m.VmMemorySizeInMb != 0 {
- dAtA[i] = 0x48
- i++
- i = encodeVarintRunhcs(dAtA, i, uint64(m.VmMemorySizeInMb))
- }
- if len(m.GPUVHDPath) > 0 {
- dAtA[i] = 0x52
- i++
- i = encodeVarintRunhcs(dAtA, i, uint64(len(m.GPUVHDPath)))
- i += copy(dAtA[i:], m.GPUVHDPath)
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *ProcessDetails) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *ProcessDetails) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if len(m.ImageName) > 0 {
- dAtA[i] = 0xa
- i++
- i = encodeVarintRunhcs(dAtA, i, uint64(len(m.ImageName)))
- i += copy(dAtA[i:], m.ImageName)
- }
- dAtA[i] = 0x12
- i++
- i = encodeVarintRunhcs(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt)))
- n1, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreatedAt, dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n1
- if m.KernelTime_100Ns != 0 {
- dAtA[i] = 0x18
- i++
- i = encodeVarintRunhcs(dAtA, i, uint64(m.KernelTime_100Ns))
- }
- if m.MemoryCommitBytes != 0 {
- dAtA[i] = 0x20
- i++
- i = encodeVarintRunhcs(dAtA, i, uint64(m.MemoryCommitBytes))
- }
- if m.MemoryWorkingSetPrivateBytes != 0 {
- dAtA[i] = 0x28
- i++
- i = encodeVarintRunhcs(dAtA, i, uint64(m.MemoryWorkingSetPrivateBytes))
- }
- if m.MemoryWorkingSetSharedBytes != 0 {
- dAtA[i] = 0x30
- i++
- i = encodeVarintRunhcs(dAtA, i, uint64(m.MemoryWorkingSetSharedBytes))
- }
- if m.ProcessID != 0 {
- dAtA[i] = 0x38
- i++
- i = encodeVarintRunhcs(dAtA, i, uint64(m.ProcessID))
- }
- if m.UserTime_100Ns != 0 {
- dAtA[i] = 0x40
- i++
- i = encodeVarintRunhcs(dAtA, i, uint64(m.UserTime_100Ns))
- }
- if len(m.ExecID) > 0 {
- dAtA[i] = 0x4a
- i++
- i = encodeVarintRunhcs(dAtA, i, uint64(len(m.ExecID)))
- i += copy(dAtA[i:], m.ExecID)
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func encodeVarintRunhcs(dAtA []byte, offset int, v uint64) int {
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return offset + 1
-}
-func (m *Options) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Debug {
- n += 2
- }
- if m.DebugType != 0 {
- n += 1 + sovRunhcs(uint64(m.DebugType))
- }
- l = len(m.RegistryRoot)
- if l > 0 {
- n += 1 + l + sovRunhcs(uint64(l))
- }
- l = len(m.SandboxImage)
- if l > 0 {
- n += 1 + l + sovRunhcs(uint64(l))
- }
- l = len(m.SandboxPlatform)
- if l > 0 {
- n += 1 + l + sovRunhcs(uint64(l))
- }
- if m.SandboxIsolation != 0 {
- n += 1 + sovRunhcs(uint64(m.SandboxIsolation))
- }
- l = len(m.BootFilesRootPath)
- if l > 0 {
- n += 1 + l + sovRunhcs(uint64(l))
- }
- if m.VmProcessorCount != 0 {
- n += 1 + sovRunhcs(uint64(m.VmProcessorCount))
- }
- if m.VmMemorySizeInMb != 0 {
- n += 1 + sovRunhcs(uint64(m.VmMemorySizeInMb))
- }
- l = len(m.GPUVHDPath)
- if l > 0 {
- n += 1 + l + sovRunhcs(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ProcessDetails) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ImageName)
- if l > 0 {
- n += 1 + l + sovRunhcs(uint64(l))
- }
- l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt)
- n += 1 + l + sovRunhcs(uint64(l))
- if m.KernelTime_100Ns != 0 {
- n += 1 + sovRunhcs(uint64(m.KernelTime_100Ns))
- }
- if m.MemoryCommitBytes != 0 {
- n += 1 + sovRunhcs(uint64(m.MemoryCommitBytes))
- }
- if m.MemoryWorkingSetPrivateBytes != 0 {
- n += 1 + sovRunhcs(uint64(m.MemoryWorkingSetPrivateBytes))
- }
- if m.MemoryWorkingSetSharedBytes != 0 {
- n += 1 + sovRunhcs(uint64(m.MemoryWorkingSetSharedBytes))
- }
- if m.ProcessID != 0 {
- n += 1 + sovRunhcs(uint64(m.ProcessID))
- }
- if m.UserTime_100Ns != 0 {
- n += 1 + sovRunhcs(uint64(m.UserTime_100Ns))
- }
- l = len(m.ExecID)
- if l > 0 {
- n += 1 + l + sovRunhcs(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func sovRunhcs(x uint64) (n int) {
- for {
- n++
- x >>= 7
- if x == 0 {
- break
- }
- }
- return n
-}
-func sozRunhcs(x uint64) (n int) {
- return sovRunhcs(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-func (this *Options) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&Options{`,
- `Debug:` + fmt.Sprintf("%v", this.Debug) + `,`,
- `DebugType:` + fmt.Sprintf("%v", this.DebugType) + `,`,
- `RegistryRoot:` + fmt.Sprintf("%v", this.RegistryRoot) + `,`,
- `SandboxImage:` + fmt.Sprintf("%v", this.SandboxImage) + `,`,
- `SandboxPlatform:` + fmt.Sprintf("%v", this.SandboxPlatform) + `,`,
- `SandboxIsolation:` + fmt.Sprintf("%v", this.SandboxIsolation) + `,`,
- `BootFilesRootPath:` + fmt.Sprintf("%v", this.BootFilesRootPath) + `,`,
- `VmProcessorCount:` + fmt.Sprintf("%v", this.VmProcessorCount) + `,`,
- `VmMemorySizeInMb:` + fmt.Sprintf("%v", this.VmMemorySizeInMb) + `,`,
- `GPUVHDPath:` + fmt.Sprintf("%v", this.GPUVHDPath) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ProcessDetails) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ProcessDetails{`,
- `ImageName:` + fmt.Sprintf("%v", this.ImageName) + `,`,
- `CreatedAt:` + strings.Replace(strings.Replace(this.CreatedAt.String(), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`,
- `KernelTime_100Ns:` + fmt.Sprintf("%v", this.KernelTime_100Ns) + `,`,
- `MemoryCommitBytes:` + fmt.Sprintf("%v", this.MemoryCommitBytes) + `,`,
- `MemoryWorkingSetPrivateBytes:` + fmt.Sprintf("%v", this.MemoryWorkingSetPrivateBytes) + `,`,
- `MemoryWorkingSetSharedBytes:` + fmt.Sprintf("%v", this.MemoryWorkingSetSharedBytes) + `,`,
- `ProcessID:` + fmt.Sprintf("%v", this.ProcessID) + `,`,
- `UserTime_100Ns:` + fmt.Sprintf("%v", this.UserTime_100Ns) + `,`,
- `ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func valueToStringRunhcs(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
-}
-func (m *Options) 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 ErrIntOverflowRunhcs
- }
- 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: Options: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: Options: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Debug", wireType)
- }
- var v int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowRunhcs
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.Debug = bool(v != 0)
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field DebugType", wireType)
- }
- m.DebugType = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowRunhcs
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.DebugType |= Options_DebugType(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field RegistryRoot", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowRunhcs
- }
- 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 ErrInvalidLengthRunhcs
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthRunhcs
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.RegistryRoot = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 4:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field SandboxImage", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowRunhcs
- }
- 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 ErrInvalidLengthRunhcs
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthRunhcs
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.SandboxImage = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 5:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field SandboxPlatform", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowRunhcs
- }
- 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 ErrInvalidLengthRunhcs
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthRunhcs
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.SandboxPlatform = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 6:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field SandboxIsolation", wireType)
- }
- m.SandboxIsolation = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowRunhcs
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.SandboxIsolation |= Options_SandboxIsolation(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 7:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field BootFilesRootPath", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowRunhcs
- }
- 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 ErrInvalidLengthRunhcs
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthRunhcs
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.BootFilesRootPath = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 8:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field VmProcessorCount", wireType)
- }
- m.VmProcessorCount = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowRunhcs
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.VmProcessorCount |= int32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 9:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field VmMemorySizeInMb", wireType)
- }
- m.VmMemorySizeInMb = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowRunhcs
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.VmMemorySizeInMb |= int32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 10:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field GPUVHDPath", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowRunhcs
- }
- 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 ErrInvalidLengthRunhcs
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthRunhcs
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.GPUVHDPath = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipRunhcs(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthRunhcs
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthRunhcs
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ProcessDetails) 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 ErrIntOverflowRunhcs
- }
- 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: ProcessDetails: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ProcessDetails: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ImageName", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowRunhcs
- }
- 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 ErrInvalidLengthRunhcs
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthRunhcs
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ImageName = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowRunhcs
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthRunhcs
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthRunhcs
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CreatedAt, dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field KernelTime_100Ns", wireType)
- }
- m.KernelTime_100Ns = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowRunhcs
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.KernelTime_100Ns |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field MemoryCommitBytes", wireType)
- }
- m.MemoryCommitBytes = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowRunhcs
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.MemoryCommitBytes |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 5:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field MemoryWorkingSetPrivateBytes", wireType)
- }
- m.MemoryWorkingSetPrivateBytes = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowRunhcs
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.MemoryWorkingSetPrivateBytes |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 6:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field MemoryWorkingSetSharedBytes", wireType)
- }
- m.MemoryWorkingSetSharedBytes = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowRunhcs
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.MemoryWorkingSetSharedBytes |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 7:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field ProcessID", wireType)
- }
- m.ProcessID = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowRunhcs
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.ProcessID |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 8:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field UserTime_100Ns", wireType)
- }
- m.UserTime_100Ns = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowRunhcs
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.UserTime_100Ns |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 9:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ExecID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowRunhcs
- }
- 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 ErrInvalidLengthRunhcs
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthRunhcs
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ExecID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipRunhcs(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthRunhcs
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthRunhcs
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func skipRunhcs(dAtA []byte) (n int, err error) {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowRunhcs
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowRunhcs
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if dAtA[iNdEx-1] < 0x80 {
- break
- }
- }
- return iNdEx, nil
- case 1:
- iNdEx += 8
- return iNdEx, nil
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowRunhcs
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if length < 0 {
- return 0, ErrInvalidLengthRunhcs
- }
- iNdEx += length
- if iNdEx < 0 {
- return 0, ErrInvalidLengthRunhcs
- }
- return iNdEx, nil
- case 3:
- for {
- var innerWire uint64
- var start int = iNdEx
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowRunhcs
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- innerWire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- innerWireType := int(innerWire & 0x7)
- if innerWireType == 4 {
- break
- }
- next, err := skipRunhcs(dAtA[start:])
- if err != nil {
- return 0, err
- }
- iNdEx = start + next
- if iNdEx < 0 {
- return 0, ErrInvalidLengthRunhcs
- }
- }
- return iNdEx, nil
- case 4:
- return iNdEx, nil
- case 5:
- iNdEx += 4
- return iNdEx, nil
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- }
- panic("unreachable")
-}
-
-var (
- ErrInvalidLengthRunhcs = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowRunhcs = fmt.Errorf("proto: integer overflow")
-)
diff --git a/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.proto b/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.proto
deleted file mode 100644
index ed6132f76..000000000
--- a/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.proto
+++ /dev/null
@@ -1,80 +0,0 @@
-syntax = "proto3";
-
-package containerd.runhcs.v1;
-
-import weak "gogoproto/gogo.proto";
-import "google/protobuf/timestamp.proto";
-
-option go_package = "github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options;options";
-
-// Options are the set of customizations that can be passed at Create time.
-message Options {
- // enable debug tracing
- bool debug = 1;
-
- enum DebugType {
- NPIPE = 0;
- FILE = 1;
- ETW = 2;
- }
-
- // debug tracing output type
- DebugType debug_type = 2;
-
- // registry key root for storage of the runhcs container state
- string registry_root = 3;
-
- // sandbox_image is the image to use for the sandbox that matches the
- // sandbox_platform.
- string sandbox_image = 4;
-
- // sandbox_platform is a CRI setting that specifies the platform
- // architecture for all sandbox's in this runtime. Values are
- // 'windows/amd64' and 'linux/amd64'.
- string sandbox_platform = 5;
-
- enum SandboxIsolation {
- PROCESS = 0;
- HYPERVISOR = 1;
- }
-
- // sandbox_isolation is a CRI setting that specifies the isolation level of
- // the sandbox. For Windows runtime PROCESS and HYPERVISOR are valid. For
- // LCOW only HYPERVISOR is valid and default if omitted.
- SandboxIsolation sandbox_isolation = 6;
-
- // boot_files_root_path is the path to the directory containing the LCOW
- // kernel and root FS files.
- string boot_files_root_path = 7;
-
- // vm_processor_count is the default number of processors to create for the
- // hypervisor isolated utility vm.
- //
- // The platform default if omitted is 2, unless the host only has a single
- // core in which case it is 1.
- int32 vm_processor_count = 8;
-
- // vm_memory_size_in_mb is the default amount of memory to assign to the
- // hypervisor isolated utility vm.
- //
- // The platform default is 1024MB if omitted.
- int32 vm_memory_size_in_mb = 9;
-
- // GPUVHDPath is the path to the gpu vhd to add to the uvm
- // when a container requests a gpu
- string GPUVHDPath = 10;
-}
-
-// ProcessDetails contains additional information about a process. This is the additional
-// info returned in the Pids query.
-message ProcessDetails {
- string image_name = 1;
- google.protobuf.Timestamp created_at = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
- uint64 kernel_time_100_ns = 3;
- uint64 memory_commit_bytes = 4;
- uint64 memory_working_set_private_bytes = 5;
- uint64 memory_working_set_shared_bytes = 6;
- uint32 process_id = 7;
- uint64 user_time_100_ns = 8;
- string exec_id = 9;
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/stats/doc.go b/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/stats/doc.go
deleted file mode 100644
index 26b4d6b34..000000000
--- a/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/stats/doc.go
+++ /dev/null
@@ -1,6 +0,0 @@
-package stats
-
-import (
- // go mod will not vendor without an import for metrics.proto
- _ "github.com/containerd/cgroups/stats/v1"
-)
diff --git a/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/stats/stats.pb.go b/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/stats/stats.pb.go
deleted file mode 100644
index 0b41b11b0..000000000
--- a/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/stats/stats.pb.go
+++ /dev/null
@@ -1,2819 +0,0 @@
-// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/stats/stats.proto
-
-package stats
-
-import (
- fmt "fmt"
- v1 "github.com/containerd/cgroups/stats/v1"
- proto "github.com/gogo/protobuf/proto"
- _ "github.com/gogo/protobuf/types"
- github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
- io "io"
- math "math"
- reflect "reflect"
- strings "strings"
- time "time"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-var _ = time.Kitchen
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
-
-type Statistics struct {
- // Types that are valid to be assigned to Container:
- // *Statistics_Windows
- // *Statistics_Linux
- Container isStatistics_Container `protobuf_oneof:"container"`
- VM *VirtualMachineStatistics `protobuf:"bytes,3,opt,name=vm,proto3" json:"vm,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Statistics) Reset() { *m = Statistics{} }
-func (*Statistics) ProtoMessage() {}
-func (*Statistics) Descriptor() ([]byte, []int) {
- return fileDescriptor_23217f96da3a05cc, []int{0}
-}
-func (m *Statistics) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Statistics) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_Statistics.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *Statistics) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Statistics.Merge(m, src)
-}
-func (m *Statistics) XXX_Size() int {
- return m.Size()
-}
-func (m *Statistics) XXX_DiscardUnknown() {
- xxx_messageInfo_Statistics.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Statistics proto.InternalMessageInfo
-
-type isStatistics_Container interface {
- isStatistics_Container()
- MarshalTo([]byte) (int, error)
- Size() int
-}
-
-type Statistics_Windows struct {
- Windows *WindowsContainerStatistics `protobuf:"bytes,1,opt,name=windows,proto3,oneof"`
-}
-type Statistics_Linux struct {
- Linux *v1.Metrics `protobuf:"bytes,2,opt,name=linux,proto3,oneof"`
-}
-
-func (*Statistics_Windows) isStatistics_Container() {}
-func (*Statistics_Linux) isStatistics_Container() {}
-
-func (m *Statistics) GetContainer() isStatistics_Container {
- if m != nil {
- return m.Container
- }
- return nil
-}
-
-func (m *Statistics) GetWindows() *WindowsContainerStatistics {
- if x, ok := m.GetContainer().(*Statistics_Windows); ok {
- return x.Windows
- }
- return nil
-}
-
-func (m *Statistics) GetLinux() *v1.Metrics {
- if x, ok := m.GetContainer().(*Statistics_Linux); ok {
- return x.Linux
- }
- return nil
-}
-
-// XXX_OneofFuncs is for the internal use of the proto package.
-func (*Statistics) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
- return _Statistics_OneofMarshaler, _Statistics_OneofUnmarshaler, _Statistics_OneofSizer, []interface{}{
- (*Statistics_Windows)(nil),
- (*Statistics_Linux)(nil),
- }
-}
-
-func _Statistics_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
- m := msg.(*Statistics)
- // container
- switch x := m.Container.(type) {
- case *Statistics_Windows:
- _ = b.EncodeVarint(1<<3 | proto.WireBytes)
- if err := b.EncodeMessage(x.Windows); err != nil {
- return err
- }
- case *Statistics_Linux:
- _ = b.EncodeVarint(2<<3 | proto.WireBytes)
- if err := b.EncodeMessage(x.Linux); err != nil {
- return err
- }
- case nil:
- default:
- return fmt.Errorf("Statistics.Container has unexpected type %T", x)
- }
- return nil
-}
-
-func _Statistics_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
- m := msg.(*Statistics)
- switch tag {
- case 1: // container.windows
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- msg := new(WindowsContainerStatistics)
- err := b.DecodeMessage(msg)
- m.Container = &Statistics_Windows{msg}
- return true, err
- case 2: // container.linux
- if wire != proto.WireBytes {
- return true, proto.ErrInternalBadWireType
- }
- msg := new(v1.Metrics)
- err := b.DecodeMessage(msg)
- m.Container = &Statistics_Linux{msg}
- return true, err
- default:
- return false, nil
- }
-}
-
-func _Statistics_OneofSizer(msg proto.Message) (n int) {
- m := msg.(*Statistics)
- // container
- switch x := m.Container.(type) {
- case *Statistics_Windows:
- s := proto.Size(x.Windows)
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(s))
- n += s
- case *Statistics_Linux:
- s := proto.Size(x.Linux)
- n += 1 // tag and wire
- n += proto.SizeVarint(uint64(s))
- n += s
- case nil:
- default:
- panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
- }
- return n
-}
-
-type WindowsContainerStatistics struct {
- Timestamp time.Time `protobuf:"bytes,1,opt,name=timestamp,proto3,stdtime" json:"timestamp"`
- ContainerStartTime time.Time `protobuf:"bytes,2,opt,name=container_start_time,json=containerStartTime,proto3,stdtime" json:"container_start_time"`
- UptimeNS uint64 `protobuf:"varint,3,opt,name=uptime_ns,json=uptimeNs,proto3" json:"uptime_ns,omitempty"`
- Processor *WindowsContainerProcessorStatistics `protobuf:"bytes,4,opt,name=processor,proto3" json:"processor,omitempty"`
- Memory *WindowsContainerMemoryStatistics `protobuf:"bytes,5,opt,name=memory,proto3" json:"memory,omitempty"`
- Storage *WindowsContainerStorageStatistics `protobuf:"bytes,6,opt,name=storage,proto3" json:"storage,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *WindowsContainerStatistics) Reset() { *m = WindowsContainerStatistics{} }
-func (*WindowsContainerStatistics) ProtoMessage() {}
-func (*WindowsContainerStatistics) Descriptor() ([]byte, []int) {
- return fileDescriptor_23217f96da3a05cc, []int{1}
-}
-func (m *WindowsContainerStatistics) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *WindowsContainerStatistics) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_WindowsContainerStatistics.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *WindowsContainerStatistics) XXX_Merge(src proto.Message) {
- xxx_messageInfo_WindowsContainerStatistics.Merge(m, src)
-}
-func (m *WindowsContainerStatistics) XXX_Size() int {
- return m.Size()
-}
-func (m *WindowsContainerStatistics) XXX_DiscardUnknown() {
- xxx_messageInfo_WindowsContainerStatistics.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_WindowsContainerStatistics proto.InternalMessageInfo
-
-type WindowsContainerProcessorStatistics struct {
- TotalRuntimeNS uint64 `protobuf:"varint,1,opt,name=total_runtime_ns,json=totalRuntimeNs,proto3" json:"total_runtime_ns,omitempty"`
- RuntimeUserNS uint64 `protobuf:"varint,2,opt,name=runtime_user_ns,json=runtimeUserNs,proto3" json:"runtime_user_ns,omitempty"`
- RuntimeKernelNS uint64 `protobuf:"varint,3,opt,name=runtime_kernel_ns,json=runtimeKernelNs,proto3" json:"runtime_kernel_ns,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *WindowsContainerProcessorStatistics) Reset() { *m = WindowsContainerProcessorStatistics{} }
-func (*WindowsContainerProcessorStatistics) ProtoMessage() {}
-func (*WindowsContainerProcessorStatistics) Descriptor() ([]byte, []int) {
- return fileDescriptor_23217f96da3a05cc, []int{2}
-}
-func (m *WindowsContainerProcessorStatistics) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *WindowsContainerProcessorStatistics) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_WindowsContainerProcessorStatistics.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *WindowsContainerProcessorStatistics) XXX_Merge(src proto.Message) {
- xxx_messageInfo_WindowsContainerProcessorStatistics.Merge(m, src)
-}
-func (m *WindowsContainerProcessorStatistics) XXX_Size() int {
- return m.Size()
-}
-func (m *WindowsContainerProcessorStatistics) XXX_DiscardUnknown() {
- xxx_messageInfo_WindowsContainerProcessorStatistics.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_WindowsContainerProcessorStatistics proto.InternalMessageInfo
-
-type WindowsContainerMemoryStatistics struct {
- MemoryUsageCommitBytes uint64 `protobuf:"varint,1,opt,name=memory_usage_commit_bytes,json=memoryUsageCommitBytes,proto3" json:"memory_usage_commit_bytes,omitempty"`
- MemoryUsageCommitPeakBytes uint64 `protobuf:"varint,2,opt,name=memory_usage_commit_peak_bytes,json=memoryUsageCommitPeakBytes,proto3" json:"memory_usage_commit_peak_bytes,omitempty"`
- MemoryUsagePrivateWorkingSetBytes uint64 `protobuf:"varint,3,opt,name=memory_usage_private_working_set_bytes,json=memoryUsagePrivateWorkingSetBytes,proto3" json:"memory_usage_private_working_set_bytes,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *WindowsContainerMemoryStatistics) Reset() { *m = WindowsContainerMemoryStatistics{} }
-func (*WindowsContainerMemoryStatistics) ProtoMessage() {}
-func (*WindowsContainerMemoryStatistics) Descriptor() ([]byte, []int) {
- return fileDescriptor_23217f96da3a05cc, []int{3}
-}
-func (m *WindowsContainerMemoryStatistics) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *WindowsContainerMemoryStatistics) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_WindowsContainerMemoryStatistics.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *WindowsContainerMemoryStatistics) XXX_Merge(src proto.Message) {
- xxx_messageInfo_WindowsContainerMemoryStatistics.Merge(m, src)
-}
-func (m *WindowsContainerMemoryStatistics) XXX_Size() int {
- return m.Size()
-}
-func (m *WindowsContainerMemoryStatistics) XXX_DiscardUnknown() {
- xxx_messageInfo_WindowsContainerMemoryStatistics.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_WindowsContainerMemoryStatistics proto.InternalMessageInfo
-
-type WindowsContainerStorageStatistics struct {
- ReadCountNormalized uint64 `protobuf:"varint,1,opt,name=read_count_normalized,json=readCountNormalized,proto3" json:"read_count_normalized,omitempty"`
- ReadSizeBytes uint64 `protobuf:"varint,2,opt,name=read_size_bytes,json=readSizeBytes,proto3" json:"read_size_bytes,omitempty"`
- WriteCountNormalized uint64 `protobuf:"varint,3,opt,name=write_count_normalized,json=writeCountNormalized,proto3" json:"write_count_normalized,omitempty"`
- WriteSizeBytes uint64 `protobuf:"varint,4,opt,name=write_size_bytes,json=writeSizeBytes,proto3" json:"write_size_bytes,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *WindowsContainerStorageStatistics) Reset() { *m = WindowsContainerStorageStatistics{} }
-func (*WindowsContainerStorageStatistics) ProtoMessage() {}
-func (*WindowsContainerStorageStatistics) Descriptor() ([]byte, []int) {
- return fileDescriptor_23217f96da3a05cc, []int{4}
-}
-func (m *WindowsContainerStorageStatistics) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *WindowsContainerStorageStatistics) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_WindowsContainerStorageStatistics.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *WindowsContainerStorageStatistics) XXX_Merge(src proto.Message) {
- xxx_messageInfo_WindowsContainerStorageStatistics.Merge(m, src)
-}
-func (m *WindowsContainerStorageStatistics) XXX_Size() int {
- return m.Size()
-}
-func (m *WindowsContainerStorageStatistics) XXX_DiscardUnknown() {
- xxx_messageInfo_WindowsContainerStorageStatistics.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_WindowsContainerStorageStatistics proto.InternalMessageInfo
-
-type VirtualMachineStatistics struct {
- Processor *VirtualMachineProcessorStatistics `protobuf:"bytes,1,opt,name=processor,proto3" json:"processor,omitempty"`
- Memory *VirtualMachineMemoryStatistics `protobuf:"bytes,2,opt,name=memory,proto3" json:"memory,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *VirtualMachineStatistics) Reset() { *m = VirtualMachineStatistics{} }
-func (*VirtualMachineStatistics) ProtoMessage() {}
-func (*VirtualMachineStatistics) Descriptor() ([]byte, []int) {
- return fileDescriptor_23217f96da3a05cc, []int{5}
-}
-func (m *VirtualMachineStatistics) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *VirtualMachineStatistics) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_VirtualMachineStatistics.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *VirtualMachineStatistics) XXX_Merge(src proto.Message) {
- xxx_messageInfo_VirtualMachineStatistics.Merge(m, src)
-}
-func (m *VirtualMachineStatistics) XXX_Size() int {
- return m.Size()
-}
-func (m *VirtualMachineStatistics) XXX_DiscardUnknown() {
- xxx_messageInfo_VirtualMachineStatistics.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_VirtualMachineStatistics proto.InternalMessageInfo
-
-type VirtualMachineProcessorStatistics struct {
- TotalRuntimeNS uint64 `protobuf:"varint,1,opt,name=total_runtime_ns,json=totalRuntimeNs,proto3" json:"total_runtime_ns,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *VirtualMachineProcessorStatistics) Reset() { *m = VirtualMachineProcessorStatistics{} }
-func (*VirtualMachineProcessorStatistics) ProtoMessage() {}
-func (*VirtualMachineProcessorStatistics) Descriptor() ([]byte, []int) {
- return fileDescriptor_23217f96da3a05cc, []int{6}
-}
-func (m *VirtualMachineProcessorStatistics) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *VirtualMachineProcessorStatistics) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_VirtualMachineProcessorStatistics.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *VirtualMachineProcessorStatistics) XXX_Merge(src proto.Message) {
- xxx_messageInfo_VirtualMachineProcessorStatistics.Merge(m, src)
-}
-func (m *VirtualMachineProcessorStatistics) XXX_Size() int {
- return m.Size()
-}
-func (m *VirtualMachineProcessorStatistics) XXX_DiscardUnknown() {
- xxx_messageInfo_VirtualMachineProcessorStatistics.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_VirtualMachineProcessorStatistics proto.InternalMessageInfo
-
-type VirtualMachineMemoryStatistics struct {
- WorkingSetBytes uint64 `protobuf:"varint,1,opt,name=working_set_bytes,json=workingSetBytes,proto3" json:"working_set_bytes,omitempty"`
- VirtualNodeCount uint32 `protobuf:"varint,2,opt,name=virtual_node_count,json=virtualNodeCount,proto3" json:"virtual_node_count,omitempty"`
- VmMemory *VirtualMachineMemory `protobuf:"bytes,3,opt,name=vm_memory,json=vmMemory,proto3" json:"vm_memory,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *VirtualMachineMemoryStatistics) Reset() { *m = VirtualMachineMemoryStatistics{} }
-func (*VirtualMachineMemoryStatistics) ProtoMessage() {}
-func (*VirtualMachineMemoryStatistics) Descriptor() ([]byte, []int) {
- return fileDescriptor_23217f96da3a05cc, []int{7}
-}
-func (m *VirtualMachineMemoryStatistics) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *VirtualMachineMemoryStatistics) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_VirtualMachineMemoryStatistics.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *VirtualMachineMemoryStatistics) XXX_Merge(src proto.Message) {
- xxx_messageInfo_VirtualMachineMemoryStatistics.Merge(m, src)
-}
-func (m *VirtualMachineMemoryStatistics) XXX_Size() int {
- return m.Size()
-}
-func (m *VirtualMachineMemoryStatistics) XXX_DiscardUnknown() {
- xxx_messageInfo_VirtualMachineMemoryStatistics.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_VirtualMachineMemoryStatistics proto.InternalMessageInfo
-
-type VirtualMachineMemory struct {
- AvailableMemory int32 `protobuf:"varint,1,opt,name=available_memory,json=availableMemory,proto3" json:"available_memory,omitempty"`
- AvailableMemoryBuffer int32 `protobuf:"varint,2,opt,name=available_memory_buffer,json=availableMemoryBuffer,proto3" json:"available_memory_buffer,omitempty"`
- ReservedMemory uint64 `protobuf:"varint,3,opt,name=reserved_memory,json=reservedMemory,proto3" json:"reserved_memory,omitempty"`
- AssignedMemory uint64 `protobuf:"varint,4,opt,name=assigned_memory,json=assignedMemory,proto3" json:"assigned_memory,omitempty"`
- SlpActive bool `protobuf:"varint,5,opt,name=slp_active,json=slpActive,proto3" json:"slp_active,omitempty"`
- BalancingEnabled bool `protobuf:"varint,6,opt,name=balancing_enabled,json=balancingEnabled,proto3" json:"balancing_enabled,omitempty"`
- DmOperationInProgress bool `protobuf:"varint,7,opt,name=dm_operation_in_progress,json=dmOperationInProgress,proto3" json:"dm_operation_in_progress,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *VirtualMachineMemory) Reset() { *m = VirtualMachineMemory{} }
-func (*VirtualMachineMemory) ProtoMessage() {}
-func (*VirtualMachineMemory) Descriptor() ([]byte, []int) {
- return fileDescriptor_23217f96da3a05cc, []int{8}
-}
-func (m *VirtualMachineMemory) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *VirtualMachineMemory) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_VirtualMachineMemory.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *VirtualMachineMemory) XXX_Merge(src proto.Message) {
- xxx_messageInfo_VirtualMachineMemory.Merge(m, src)
-}
-func (m *VirtualMachineMemory) XXX_Size() int {
- return m.Size()
-}
-func (m *VirtualMachineMemory) XXX_DiscardUnknown() {
- xxx_messageInfo_VirtualMachineMemory.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_VirtualMachineMemory proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*Statistics)(nil), "containerd.runhcs.stats.v1.Statistics")
- proto.RegisterType((*WindowsContainerStatistics)(nil), "containerd.runhcs.stats.v1.WindowsContainerStatistics")
- proto.RegisterType((*WindowsContainerProcessorStatistics)(nil), "containerd.runhcs.stats.v1.WindowsContainerProcessorStatistics")
- proto.RegisterType((*WindowsContainerMemoryStatistics)(nil), "containerd.runhcs.stats.v1.WindowsContainerMemoryStatistics")
- proto.RegisterType((*WindowsContainerStorageStatistics)(nil), "containerd.runhcs.stats.v1.WindowsContainerStorageStatistics")
- proto.RegisterType((*VirtualMachineStatistics)(nil), "containerd.runhcs.stats.v1.VirtualMachineStatistics")
- proto.RegisterType((*VirtualMachineProcessorStatistics)(nil), "containerd.runhcs.stats.v1.VirtualMachineProcessorStatistics")
- proto.RegisterType((*VirtualMachineMemoryStatistics)(nil), "containerd.runhcs.stats.v1.VirtualMachineMemoryStatistics")
- proto.RegisterType((*VirtualMachineMemory)(nil), "containerd.runhcs.stats.v1.VirtualMachineMemory")
-}
-
-func init() {
- proto.RegisterFile("github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/stats/stats.proto", fileDescriptor_23217f96da3a05cc)
-}
-
-var fileDescriptor_23217f96da3a05cc = []byte{
- // 1037 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x6d, 0x6f, 0xdb, 0x44,
- 0x1c, 0x8f, 0xb3, 0x3e, 0x24, 0x37, 0xda, 0xb4, 0xb7, 0x76, 0x84, 0x48, 0x24, 0x6b, 0x90, 0xf6,
- 0x00, 0x34, 0xa1, 0xa3, 0x1a, 0x1a, 0x0c, 0x4d, 0xa4, 0x02, 0x0d, 0xb1, 0x84, 0x72, 0xe9, 0x03,
- 0x02, 0x21, 0x73, 0xb1, 0xaf, 0xee, 0xa9, 0xb6, 0xcf, 0xba, 0x3b, 0xbb, 0xac, 0xaf, 0xf8, 0x08,
- 0x7c, 0xac, 0x22, 0xde, 0xec, 0x25, 0xaf, 0x32, 0x96, 0x6f, 0x80, 0x84, 0x78, 0x3d, 0xf9, 0xee,
- 0x9c, 0xb8, 0xed, 0xba, 0xb6, 0xda, 0x9b, 0xc8, 0xfe, 0xff, 0x1e, 0xee, 0xff, 0x70, 0xe7, 0x0b,
- 0x78, 0xea, 0x51, 0xb9, 0x1f, 0x0f, 0x5a, 0x0e, 0x0b, 0xda, 0x5d, 0xea, 0x70, 0x26, 0xd8, 0x9e,
- 0x6c, 0xef, 0x3b, 0x42, 0xec, 0xd3, 0xa0, 0xed, 0x04, 0x6e, 0xdb, 0x61, 0xa1, 0xc4, 0x34, 0x24,
- 0xdc, 0x5d, 0x4d, 0x63, 0xab, 0x3c, 0x0e, 0xf7, 0x1d, 0xb1, 0x9a, 0xac, 0xb5, 0x85, 0xc4, 0x52,
- 0xe8, 0xdf, 0x56, 0xc4, 0x99, 0x64, 0xb0, 0x36, 0x21, 0xb7, 0x34, 0xaf, 0xa5, 0xe1, 0x64, 0xad,
- 0xb6, 0xe4, 0x31, 0x8f, 0x29, 0x5a, 0x3b, 0x7d, 0xd2, 0x8a, 0x5a, 0xc3, 0x63, 0xcc, 0xf3, 0x49,
- 0x5b, 0xbd, 0x0d, 0xe2, 0xbd, 0xb6, 0xa4, 0x01, 0x11, 0x12, 0x07, 0x91, 0x21, 0xac, 0xe7, 0x12,
- 0x9c, 0xb8, 0xb7, 0x1d, 0x8f, 0xb3, 0x38, 0x32, 0xab, 0xb7, 0x93, 0xb5, 0x76, 0x40, 0x24, 0xa7,
- 0x8e, 0x49, 0xa4, 0xf9, 0xbf, 0x05, 0x40, 0x5f, 0x62, 0x49, 0x85, 0xa4, 0x8e, 0x80, 0x08, 0xcc,
- 0x1e, 0xd2, 0xd0, 0x65, 0x87, 0xa2, 0x6a, 0xdd, 0xb2, 0xee, 0x5e, 0xbf, 0xff, 0xa0, 0x75, 0x7e,
- 0xa6, 0xad, 0x5d, 0x4d, 0xdd, 0xc8, 0x18, 0x13, 0xa3, 0x27, 0x05, 0x94, 0x19, 0xc1, 0x87, 0x60,
- 0xda, 0xa7, 0x61, 0xfc, 0x5b, 0xb5, 0xa8, 0x1c, 0x57, 0x5a, 0x94, 0xe5, 0x4d, 0x4d, 0x82, 0xa9,
- 0x5f, 0x57, 0xa7, 0xf6, 0xa4, 0x80, 0xb4, 0x02, 0x3e, 0x05, 0xc5, 0x24, 0xa8, 0x5e, 0x53, 0xba,
- 0xf5, 0x37, 0x65, 0xb2, 0x43, 0xb9, 0x8c, 0xb1, 0xdf, 0xc5, 0xce, 0x3e, 0x0d, 0xc9, 0x24, 0x8f,
- 0xce, 0xcc, 0x68, 0xd8, 0x28, 0xee, 0x74, 0x51, 0x31, 0x09, 0x3a, 0xd7, 0x41, 0x79, 0x6c, 0xd1,
- 0xfc, 0xf7, 0x1a, 0xa8, 0x9d, 0x9f, 0x3f, 0xec, 0x80, 0xf2, 0xb8, 0xc1, 0xa6, 0x15, 0xb5, 0x96,
- 0x1e, 0x41, 0x2b, 0x1b, 0x41, 0x6b, 0x2b, 0x63, 0x74, 0x4a, 0xc7, 0xc3, 0x46, 0xe1, 0x8f, 0x17,
- 0x0d, 0x0b, 0x4d, 0x64, 0x70, 0x07, 0x2c, 0x8d, 0xd7, 0xb3, 0x85, 0xc4, 0x5c, 0xda, 0x29, 0x68,
- 0xfa, 0x70, 0x39, 0x3b, 0xe8, 0xe4, 0x92, 0xe3, 0x32, 0xa5, 0xc0, 0x7b, 0xa0, 0x1c, 0x47, 0xa9,
- 0x93, 0x1d, 0x0a, 0xd5, 0x9c, 0xa9, 0xce, 0x3b, 0xa3, 0x61, 0xa3, 0xb4, 0xad, 0x82, 0xbd, 0x3e,
- 0x2a, 0x69, 0xb8, 0x27, 0xe0, 0x2f, 0xa0, 0x1c, 0x71, 0xe6, 0x10, 0x21, 0x18, 0xaf, 0x4e, 0xa9,
- 0x75, 0x1f, 0x5f, 0x65, 0xa2, 0x9b, 0x99, 0x78, 0xd2, 0x1a, 0x34, 0x71, 0x84, 0x5b, 0x60, 0x26,
- 0x20, 0x01, 0xe3, 0xcf, 0xaa, 0xd3, 0xca, 0xfb, 0xd1, 0x55, 0xbc, 0xbb, 0x4a, 0x99, 0x33, 0x36,
- 0x5e, 0x70, 0x17, 0xcc, 0x0a, 0xc9, 0x38, 0xf6, 0x48, 0x75, 0x46, 0xd9, 0x7e, 0x79, 0xb5, 0x4d,
- 0xa8, 0xa4, 0x39, 0xdf, 0xcc, 0xad, 0xf9, 0xc2, 0x02, 0x1f, 0x5c, 0xa2, 0x42, 0xf8, 0x08, 0x2c,
- 0x48, 0x26, 0xb1, 0x6f, 0xf3, 0x38, 0xcc, 0xfa, 0x6c, 0xa9, 0x3e, 0xc3, 0xd1, 0xb0, 0x31, 0xbf,
- 0x95, 0x62, 0x48, 0x43, 0xbd, 0x3e, 0x9a, 0x97, 0xf9, 0xf7, 0x74, 0xbf, 0x57, 0x32, 0x5d, 0x2c,
- 0x08, 0x4f, 0xc5, 0x45, 0x25, 0x5e, 0x1c, 0x0d, 0x1b, 0x73, 0x86, 0xb7, 0x2d, 0x08, 0xef, 0xf5,
- 0xd1, 0x1c, 0xcf, 0xbd, 0x0a, 0xf8, 0x18, 0x2c, 0x66, 0xd2, 0x03, 0xc2, 0x43, 0xe2, 0x4f, 0x26,
- 0x7c, 0x63, 0x34, 0x6c, 0x54, 0x8c, 0xf8, 0x3b, 0x85, 0xf5, 0xfa, 0x28, 0x5b, 0xc8, 0x04, 0x44,
- 0xf3, 0x3f, 0x0b, 0xdc, 0xba, 0xa8, 0xcf, 0xf0, 0x21, 0x78, 0x4f, 0x77, 0xda, 0x8e, 0x05, 0xf6,
- 0x88, 0xed, 0xb0, 0x20, 0xa0, 0xd2, 0x1e, 0x3c, 0x93, 0xc4, 0xd4, 0x89, 0x6e, 0x6a, 0xc2, 0x76,
- 0x8a, 0x6f, 0x28, 0xb8, 0x93, 0xa2, 0xb0, 0x03, 0xea, 0xaf, 0x93, 0x46, 0x04, 0x1f, 0x18, 0xbd,
- 0x2a, 0x15, 0xd5, 0xce, 0xe8, 0x37, 0x09, 0x3e, 0xd0, 0x1e, 0x3f, 0x80, 0xdb, 0x27, 0x3c, 0x22,
- 0x4e, 0x13, 0x2c, 0x89, 0x7d, 0xc8, 0xf8, 0x01, 0x0d, 0x3d, 0x5b, 0x90, 0x2c, 0x17, 0x55, 0x39,
- 0x5a, 0xc9, 0x79, 0x6d, 0x6a, 0xee, 0xae, 0xa6, 0xf6, 0x89, 0x4e, 0x2b, 0x1d, 0xec, 0xca, 0x85,
- 0xfb, 0x00, 0xde, 0x07, 0xcb, 0x9c, 0x60, 0xd7, 0x76, 0x58, 0x1c, 0x4a, 0x3b, 0x64, 0x3c, 0xc0,
- 0x3e, 0x3d, 0x22, 0xae, 0xa9, 0xf9, 0x46, 0x0a, 0x6e, 0xa4, 0x58, 0x6f, 0x0c, 0xc1, 0xdb, 0xa0,
- 0xa2, 0x34, 0x82, 0x1e, 0x91, 0x13, 0x15, 0xce, 0xa5, 0xe1, 0x3e, 0x3d, 0x22, 0xba, 0xa8, 0x75,
- 0x70, 0xf3, 0x90, 0x53, 0x49, 0xce, 0x9a, 0xeb, 0x22, 0x96, 0x14, 0x7a, 0xda, 0xfd, 0x2e, 0x58,
- 0xd0, 0xaa, 0x9c, 0xfd, 0x94, 0xe2, 0xcf, 0xab, 0xf8, 0xd8, 0xbf, 0xf9, 0x97, 0x05, 0xaa, 0xe7,
- 0x7d, 0xe4, 0xe0, 0xcf, 0xf9, 0x53, 0x6e, 0x5d, 0x7c, 0x64, 0x4e, 0x1a, 0x5d, 0x70, 0xc6, 0xd1,
- 0xf8, 0x8c, 0xeb, 0xef, 0xd6, 0xe7, 0x97, 0x77, 0x3e, 0xef, 0x84, 0x37, 0x31, 0x58, 0xb9, 0x30,
- 0x87, 0xb7, 0x3b, 0x85, 0xcd, 0x3f, 0x2d, 0x50, 0x7f, 0x73, 0x36, 0xf0, 0x43, 0xb0, 0x78, 0x76,
- 0xcf, 0xe9, 0xbd, 0x50, 0x39, 0x3c, 0xb9, 0xc3, 0xe0, 0xc7, 0x00, 0x26, 0xda, 0xcd, 0x0e, 0x99,
- 0x6b, 0xc6, 0xac, 0x3a, 0x32, 0x87, 0x16, 0x0c, 0xd2, 0x63, 0xae, 0x9e, 0x30, 0xec, 0x82, 0x72,
- 0x12, 0xd8, 0xa6, 0x6d, 0xfa, 0xfa, 0xfa, 0xe4, 0xaa, 0x6d, 0x43, 0xa5, 0x24, 0xd0, 0x4f, 0xcd,
- 0xe7, 0x45, 0xb0, 0xf4, 0x3a, 0x0a, 0xbc, 0x07, 0x16, 0x70, 0x82, 0xa9, 0x8f, 0x07, 0x3e, 0xc9,
- 0x96, 0x4b, 0x0b, 0x98, 0x46, 0x95, 0x71, 0xdc, 0x50, 0x1f, 0x80, 0x77, 0x4f, 0x53, 0xed, 0x41,
- 0xbc, 0xb7, 0x47, 0xb8, 0xaa, 0x62, 0x1a, 0x2d, 0x9f, 0x52, 0x74, 0x14, 0x08, 0xef, 0xa4, 0x07,
- 0x40, 0x10, 0x9e, 0x10, 0x37, 0x5f, 0xd0, 0x14, 0x9a, 0xcf, 0xc2, 0x66, 0x81, 0x3b, 0xa0, 0x82,
- 0x85, 0xa0, 0x5e, 0x38, 0x21, 0x9a, 0xad, 0x9c, 0x85, 0x0d, 0xf1, 0x7d, 0x00, 0x84, 0x1f, 0xd9,
- 0xd8, 0x91, 0x34, 0x21, 0xea, 0xe2, 0x28, 0xa1, 0xb2, 0xf0, 0xa3, 0xaf, 0x54, 0x00, 0x7e, 0x04,
- 0x16, 0x07, 0xd8, 0xc7, 0xa1, 0x93, 0xce, 0x85, 0x84, 0x69, 0x42, 0xae, 0xba, 0x07, 0x4a, 0x68,
- 0x61, 0x0c, 0x7c, 0xad, 0xe3, 0xf0, 0x33, 0x50, 0x75, 0x03, 0x9b, 0x45, 0x84, 0x63, 0x49, 0x59,
- 0x68, 0xd3, 0xd0, 0x8e, 0x38, 0xf3, 0x38, 0x11, 0xa2, 0x3a, 0xab, 0x34, 0xcb, 0x6e, 0xf0, 0x7d,
- 0x06, 0x7f, 0x1b, 0x6e, 0x1a, 0xb0, 0xf3, 0xeb, 0xf1, 0xcb, 0x7a, 0xe1, 0xef, 0x97, 0xf5, 0xc2,
- 0xef, 0xa3, 0xba, 0x75, 0x3c, 0xaa, 0x5b, 0xcf, 0x47, 0x75, 0xeb, 0x9f, 0x51, 0xdd, 0xfa, 0xe9,
- 0x9b, 0xb7, 0xfd, 0xa3, 0xf7, 0x85, 0xfa, 0xfd, 0xb1, 0x30, 0x98, 0x51, 0x37, 0xfb, 0xa7, 0xaf,
- 0x02, 0x00, 0x00, 0xff, 0xff, 0xb6, 0xe8, 0x0f, 0x6d, 0x3b, 0x0a, 0x00, 0x00,
-}
-
-func (m *Statistics) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *Statistics) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Container != nil {
- nn1, err := m.Container.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += nn1
- }
- if m.VM != nil {
- dAtA[i] = 0x1a
- i++
- i = encodeVarintStats(dAtA, i, uint64(m.VM.Size()))
- n2, err := m.VM.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n2
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *Statistics_Windows) MarshalTo(dAtA []byte) (int, error) {
- i := 0
- if m.Windows != nil {
- dAtA[i] = 0xa
- i++
- i = encodeVarintStats(dAtA, i, uint64(m.Windows.Size()))
- n3, err := m.Windows.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n3
- }
- return i, nil
-}
-func (m *Statistics_Linux) MarshalTo(dAtA []byte) (int, error) {
- i := 0
- if m.Linux != nil {
- dAtA[i] = 0x12
- i++
- i = encodeVarintStats(dAtA, i, uint64(m.Linux.Size()))
- n4, err := m.Linux.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n4
- }
- return i, nil
-}
-func (m *WindowsContainerStatistics) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *WindowsContainerStatistics) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- dAtA[i] = 0xa
- i++
- i = encodeVarintStats(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp)))
- n5, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n5
- dAtA[i] = 0x12
- i++
- i = encodeVarintStats(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.ContainerStartTime)))
- n6, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ContainerStartTime, dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n6
- if m.UptimeNS != 0 {
- dAtA[i] = 0x18
- i++
- i = encodeVarintStats(dAtA, i, uint64(m.UptimeNS))
- }
- if m.Processor != nil {
- dAtA[i] = 0x22
- i++
- i = encodeVarintStats(dAtA, i, uint64(m.Processor.Size()))
- n7, err := m.Processor.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n7
- }
- if m.Memory != nil {
- dAtA[i] = 0x2a
- i++
- i = encodeVarintStats(dAtA, i, uint64(m.Memory.Size()))
- n8, err := m.Memory.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n8
- }
- if m.Storage != nil {
- dAtA[i] = 0x32
- i++
- i = encodeVarintStats(dAtA, i, uint64(m.Storage.Size()))
- n9, err := m.Storage.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n9
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *WindowsContainerProcessorStatistics) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *WindowsContainerProcessorStatistics) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.TotalRuntimeNS != 0 {
- dAtA[i] = 0x8
- i++
- i = encodeVarintStats(dAtA, i, uint64(m.TotalRuntimeNS))
- }
- if m.RuntimeUserNS != 0 {
- dAtA[i] = 0x10
- i++
- i = encodeVarintStats(dAtA, i, uint64(m.RuntimeUserNS))
- }
- if m.RuntimeKernelNS != 0 {
- dAtA[i] = 0x18
- i++
- i = encodeVarintStats(dAtA, i, uint64(m.RuntimeKernelNS))
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *WindowsContainerMemoryStatistics) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *WindowsContainerMemoryStatistics) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.MemoryUsageCommitBytes != 0 {
- dAtA[i] = 0x8
- i++
- i = encodeVarintStats(dAtA, i, uint64(m.MemoryUsageCommitBytes))
- }
- if m.MemoryUsageCommitPeakBytes != 0 {
- dAtA[i] = 0x10
- i++
- i = encodeVarintStats(dAtA, i, uint64(m.MemoryUsageCommitPeakBytes))
- }
- if m.MemoryUsagePrivateWorkingSetBytes != 0 {
- dAtA[i] = 0x18
- i++
- i = encodeVarintStats(dAtA, i, uint64(m.MemoryUsagePrivateWorkingSetBytes))
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *WindowsContainerStorageStatistics) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *WindowsContainerStorageStatistics) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.ReadCountNormalized != 0 {
- dAtA[i] = 0x8
- i++
- i = encodeVarintStats(dAtA, i, uint64(m.ReadCountNormalized))
- }
- if m.ReadSizeBytes != 0 {
- dAtA[i] = 0x10
- i++
- i = encodeVarintStats(dAtA, i, uint64(m.ReadSizeBytes))
- }
- if m.WriteCountNormalized != 0 {
- dAtA[i] = 0x18
- i++
- i = encodeVarintStats(dAtA, i, uint64(m.WriteCountNormalized))
- }
- if m.WriteSizeBytes != 0 {
- dAtA[i] = 0x20
- i++
- i = encodeVarintStats(dAtA, i, uint64(m.WriteSizeBytes))
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *VirtualMachineStatistics) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *VirtualMachineStatistics) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Processor != nil {
- dAtA[i] = 0xa
- i++
- i = encodeVarintStats(dAtA, i, uint64(m.Processor.Size()))
- n10, err := m.Processor.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n10
- }
- if m.Memory != nil {
- dAtA[i] = 0x12
- i++
- i = encodeVarintStats(dAtA, i, uint64(m.Memory.Size()))
- n11, err := m.Memory.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n11
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *VirtualMachineProcessorStatistics) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *VirtualMachineProcessorStatistics) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.TotalRuntimeNS != 0 {
- dAtA[i] = 0x8
- i++
- i = encodeVarintStats(dAtA, i, uint64(m.TotalRuntimeNS))
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *VirtualMachineMemoryStatistics) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *VirtualMachineMemoryStatistics) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.WorkingSetBytes != 0 {
- dAtA[i] = 0x8
- i++
- i = encodeVarintStats(dAtA, i, uint64(m.WorkingSetBytes))
- }
- if m.VirtualNodeCount != 0 {
- dAtA[i] = 0x10
- i++
- i = encodeVarintStats(dAtA, i, uint64(m.VirtualNodeCount))
- }
- if m.VmMemory != nil {
- dAtA[i] = 0x1a
- i++
- i = encodeVarintStats(dAtA, i, uint64(m.VmMemory.Size()))
- n12, err := m.VmMemory.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n12
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *VirtualMachineMemory) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *VirtualMachineMemory) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.AvailableMemory != 0 {
- dAtA[i] = 0x8
- i++
- i = encodeVarintStats(dAtA, i, uint64(m.AvailableMemory))
- }
- if m.AvailableMemoryBuffer != 0 {
- dAtA[i] = 0x10
- i++
- i = encodeVarintStats(dAtA, i, uint64(m.AvailableMemoryBuffer))
- }
- if m.ReservedMemory != 0 {
- dAtA[i] = 0x18
- i++
- i = encodeVarintStats(dAtA, i, uint64(m.ReservedMemory))
- }
- if m.AssignedMemory != 0 {
- dAtA[i] = 0x20
- i++
- i = encodeVarintStats(dAtA, i, uint64(m.AssignedMemory))
- }
- if m.SlpActive {
- dAtA[i] = 0x28
- i++
- if m.SlpActive {
- dAtA[i] = 1
- } else {
- dAtA[i] = 0
- }
- i++
- }
- if m.BalancingEnabled {
- dAtA[i] = 0x30
- i++
- if m.BalancingEnabled {
- dAtA[i] = 1
- } else {
- dAtA[i] = 0
- }
- i++
- }
- if m.DmOperationInProgress {
- dAtA[i] = 0x38
- i++
- if m.DmOperationInProgress {
- dAtA[i] = 1
- } else {
- dAtA[i] = 0
- }
- i++
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func encodeVarintStats(dAtA []byte, offset int, v uint64) int {
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return offset + 1
-}
-func (m *Statistics) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Container != nil {
- n += m.Container.Size()
- }
- if m.VM != nil {
- l = m.VM.Size()
- n += 1 + l + sovStats(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *Statistics_Windows) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Windows != nil {
- l = m.Windows.Size()
- n += 1 + l + sovStats(uint64(l))
- }
- return n
-}
-func (m *Statistics_Linux) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Linux != nil {
- l = m.Linux.Size()
- n += 1 + l + sovStats(uint64(l))
- }
- return n
-}
-func (m *WindowsContainerStatistics) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp)
- n += 1 + l + sovStats(uint64(l))
- l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ContainerStartTime)
- n += 1 + l + sovStats(uint64(l))
- if m.UptimeNS != 0 {
- n += 1 + sovStats(uint64(m.UptimeNS))
- }
- if m.Processor != nil {
- l = m.Processor.Size()
- n += 1 + l + sovStats(uint64(l))
- }
- if m.Memory != nil {
- l = m.Memory.Size()
- n += 1 + l + sovStats(uint64(l))
- }
- if m.Storage != nil {
- l = m.Storage.Size()
- n += 1 + l + sovStats(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *WindowsContainerProcessorStatistics) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.TotalRuntimeNS != 0 {
- n += 1 + sovStats(uint64(m.TotalRuntimeNS))
- }
- if m.RuntimeUserNS != 0 {
- n += 1 + sovStats(uint64(m.RuntimeUserNS))
- }
- if m.RuntimeKernelNS != 0 {
- n += 1 + sovStats(uint64(m.RuntimeKernelNS))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *WindowsContainerMemoryStatistics) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.MemoryUsageCommitBytes != 0 {
- n += 1 + sovStats(uint64(m.MemoryUsageCommitBytes))
- }
- if m.MemoryUsageCommitPeakBytes != 0 {
- n += 1 + sovStats(uint64(m.MemoryUsageCommitPeakBytes))
- }
- if m.MemoryUsagePrivateWorkingSetBytes != 0 {
- n += 1 + sovStats(uint64(m.MemoryUsagePrivateWorkingSetBytes))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *WindowsContainerStorageStatistics) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.ReadCountNormalized != 0 {
- n += 1 + sovStats(uint64(m.ReadCountNormalized))
- }
- if m.ReadSizeBytes != 0 {
- n += 1 + sovStats(uint64(m.ReadSizeBytes))
- }
- if m.WriteCountNormalized != 0 {
- n += 1 + sovStats(uint64(m.WriteCountNormalized))
- }
- if m.WriteSizeBytes != 0 {
- n += 1 + sovStats(uint64(m.WriteSizeBytes))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *VirtualMachineStatistics) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Processor != nil {
- l = m.Processor.Size()
- n += 1 + l + sovStats(uint64(l))
- }
- if m.Memory != nil {
- l = m.Memory.Size()
- n += 1 + l + sovStats(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *VirtualMachineProcessorStatistics) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.TotalRuntimeNS != 0 {
- n += 1 + sovStats(uint64(m.TotalRuntimeNS))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *VirtualMachineMemoryStatistics) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.WorkingSetBytes != 0 {
- n += 1 + sovStats(uint64(m.WorkingSetBytes))
- }
- if m.VirtualNodeCount != 0 {
- n += 1 + sovStats(uint64(m.VirtualNodeCount))
- }
- if m.VmMemory != nil {
- l = m.VmMemory.Size()
- n += 1 + l + sovStats(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *VirtualMachineMemory) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.AvailableMemory != 0 {
- n += 1 + sovStats(uint64(m.AvailableMemory))
- }
- if m.AvailableMemoryBuffer != 0 {
- n += 1 + sovStats(uint64(m.AvailableMemoryBuffer))
- }
- if m.ReservedMemory != 0 {
- n += 1 + sovStats(uint64(m.ReservedMemory))
- }
- if m.AssignedMemory != 0 {
- n += 1 + sovStats(uint64(m.AssignedMemory))
- }
- if m.SlpActive {
- n += 2
- }
- if m.BalancingEnabled {
- n += 2
- }
- if m.DmOperationInProgress {
- n += 2
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func sovStats(x uint64) (n int) {
- for {
- n++
- x >>= 7
- if x == 0 {
- break
- }
- }
- return n
-}
-func sozStats(x uint64) (n int) {
- return sovStats(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-func (this *Statistics) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&Statistics{`,
- `Container:` + fmt.Sprintf("%v", this.Container) + `,`,
- `VM:` + strings.Replace(fmt.Sprintf("%v", this.VM), "VirtualMachineStatistics", "VirtualMachineStatistics", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *Statistics_Windows) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&Statistics_Windows{`,
- `Windows:` + strings.Replace(fmt.Sprintf("%v", this.Windows), "WindowsContainerStatistics", "WindowsContainerStatistics", 1) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *Statistics_Linux) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&Statistics_Linux{`,
- `Linux:` + strings.Replace(fmt.Sprintf("%v", this.Linux), "Metrics", "v1.Metrics", 1) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *WindowsContainerStatistics) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&WindowsContainerStatistics{`,
- `Timestamp:` + strings.Replace(strings.Replace(this.Timestamp.String(), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`,
- `ContainerStartTime:` + strings.Replace(strings.Replace(this.ContainerStartTime.String(), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`,
- `UptimeNS:` + fmt.Sprintf("%v", this.UptimeNS) + `,`,
- `Processor:` + strings.Replace(fmt.Sprintf("%v", this.Processor), "WindowsContainerProcessorStatistics", "WindowsContainerProcessorStatistics", 1) + `,`,
- `Memory:` + strings.Replace(fmt.Sprintf("%v", this.Memory), "WindowsContainerMemoryStatistics", "WindowsContainerMemoryStatistics", 1) + `,`,
- `Storage:` + strings.Replace(fmt.Sprintf("%v", this.Storage), "WindowsContainerStorageStatistics", "WindowsContainerStorageStatistics", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *WindowsContainerProcessorStatistics) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&WindowsContainerProcessorStatistics{`,
- `TotalRuntimeNS:` + fmt.Sprintf("%v", this.TotalRuntimeNS) + `,`,
- `RuntimeUserNS:` + fmt.Sprintf("%v", this.RuntimeUserNS) + `,`,
- `RuntimeKernelNS:` + fmt.Sprintf("%v", this.RuntimeKernelNS) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *WindowsContainerMemoryStatistics) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&WindowsContainerMemoryStatistics{`,
- `MemoryUsageCommitBytes:` + fmt.Sprintf("%v", this.MemoryUsageCommitBytes) + `,`,
- `MemoryUsageCommitPeakBytes:` + fmt.Sprintf("%v", this.MemoryUsageCommitPeakBytes) + `,`,
- `MemoryUsagePrivateWorkingSetBytes:` + fmt.Sprintf("%v", this.MemoryUsagePrivateWorkingSetBytes) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *WindowsContainerStorageStatistics) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&WindowsContainerStorageStatistics{`,
- `ReadCountNormalized:` + fmt.Sprintf("%v", this.ReadCountNormalized) + `,`,
- `ReadSizeBytes:` + fmt.Sprintf("%v", this.ReadSizeBytes) + `,`,
- `WriteCountNormalized:` + fmt.Sprintf("%v", this.WriteCountNormalized) + `,`,
- `WriteSizeBytes:` + fmt.Sprintf("%v", this.WriteSizeBytes) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *VirtualMachineStatistics) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&VirtualMachineStatistics{`,
- `Processor:` + strings.Replace(fmt.Sprintf("%v", this.Processor), "VirtualMachineProcessorStatistics", "VirtualMachineProcessorStatistics", 1) + `,`,
- `Memory:` + strings.Replace(fmt.Sprintf("%v", this.Memory), "VirtualMachineMemoryStatistics", "VirtualMachineMemoryStatistics", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *VirtualMachineProcessorStatistics) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&VirtualMachineProcessorStatistics{`,
- `TotalRuntimeNS:` + fmt.Sprintf("%v", this.TotalRuntimeNS) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *VirtualMachineMemoryStatistics) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&VirtualMachineMemoryStatistics{`,
- `WorkingSetBytes:` + fmt.Sprintf("%v", this.WorkingSetBytes) + `,`,
- `VirtualNodeCount:` + fmt.Sprintf("%v", this.VirtualNodeCount) + `,`,
- `VmMemory:` + strings.Replace(fmt.Sprintf("%v", this.VmMemory), "VirtualMachineMemory", "VirtualMachineMemory", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *VirtualMachineMemory) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&VirtualMachineMemory{`,
- `AvailableMemory:` + fmt.Sprintf("%v", this.AvailableMemory) + `,`,
- `AvailableMemoryBuffer:` + fmt.Sprintf("%v", this.AvailableMemoryBuffer) + `,`,
- `ReservedMemory:` + fmt.Sprintf("%v", this.ReservedMemory) + `,`,
- `AssignedMemory:` + fmt.Sprintf("%v", this.AssignedMemory) + `,`,
- `SlpActive:` + fmt.Sprintf("%v", this.SlpActive) + `,`,
- `BalancingEnabled:` + fmt.Sprintf("%v", this.BalancingEnabled) + `,`,
- `DmOperationInProgress:` + fmt.Sprintf("%v", this.DmOperationInProgress) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func valueToStringStats(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
-}
-func (m *Statistics) 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 ErrIntOverflowStats
- }
- 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: Statistics: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: Statistics: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- 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 ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthStats
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthStats
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- v := &WindowsContainerStatistics{}
- if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- m.Container = &Statistics_Windows{v}
- 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 ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthStats
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthStats
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- v := &v1.Metrics{}
- if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- m.Container = &Statistics_Linux{v}
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field VM", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthStats
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthStats
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.VM == nil {
- m.VM = &VirtualMachineStatistics{}
- }
- if err := m.VM.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipStats(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthStats
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthStats
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *WindowsContainerStatistics) 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 ErrIntOverflowStats
- }
- 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: WindowsContainerStatistics: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: WindowsContainerStatistics: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthStats
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthStats
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ContainerStartTime", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthStats
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthStats
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ContainerStartTime, dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field UptimeNS", wireType)
- }
- m.UptimeNS = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.UptimeNS |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Processor", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthStats
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthStats
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Processor == nil {
- m.Processor = &WindowsContainerProcessorStatistics{}
- }
- if err := m.Processor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 5:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Memory", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthStats
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthStats
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Memory == nil {
- m.Memory = &WindowsContainerMemoryStatistics{}
- }
- if err := m.Memory.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 6:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Storage", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthStats
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthStats
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Storage == nil {
- m.Storage = &WindowsContainerStorageStatistics{}
- }
- if err := m.Storage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipStats(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthStats
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthStats
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *WindowsContainerProcessorStatistics) 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 ErrIntOverflowStats
- }
- 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: WindowsContainerProcessorStatistics: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: WindowsContainerProcessorStatistics: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field TotalRuntimeNS", wireType)
- }
- m.TotalRuntimeNS = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.TotalRuntimeNS |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field RuntimeUserNS", wireType)
- }
- m.RuntimeUserNS = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.RuntimeUserNS |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field RuntimeKernelNS", wireType)
- }
- m.RuntimeKernelNS = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.RuntimeKernelNS |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipStats(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthStats
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthStats
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *WindowsContainerMemoryStatistics) 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 ErrIntOverflowStats
- }
- 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: WindowsContainerMemoryStatistics: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: WindowsContainerMemoryStatistics: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field MemoryUsageCommitBytes", wireType)
- }
- m.MemoryUsageCommitBytes = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.MemoryUsageCommitBytes |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field MemoryUsageCommitPeakBytes", wireType)
- }
- m.MemoryUsageCommitPeakBytes = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.MemoryUsageCommitPeakBytes |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field MemoryUsagePrivateWorkingSetBytes", wireType)
- }
- m.MemoryUsagePrivateWorkingSetBytes = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.MemoryUsagePrivateWorkingSetBytes |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipStats(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthStats
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthStats
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *WindowsContainerStorageStatistics) 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 ErrIntOverflowStats
- }
- 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: WindowsContainerStorageStatistics: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: WindowsContainerStorageStatistics: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field ReadCountNormalized", wireType)
- }
- m.ReadCountNormalized = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.ReadCountNormalized |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field ReadSizeBytes", wireType)
- }
- m.ReadSizeBytes = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.ReadSizeBytes |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field WriteCountNormalized", wireType)
- }
- m.WriteCountNormalized = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.WriteCountNormalized |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field WriteSizeBytes", wireType)
- }
- m.WriteSizeBytes = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.WriteSizeBytes |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipStats(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthStats
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthStats
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *VirtualMachineStatistics) 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 ErrIntOverflowStats
- }
- 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: VirtualMachineStatistics: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: VirtualMachineStatistics: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Processor", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthStats
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthStats
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Processor == nil {
- m.Processor = &VirtualMachineProcessorStatistics{}
- }
- if err := m.Processor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Memory", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthStats
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthStats
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Memory == nil {
- m.Memory = &VirtualMachineMemoryStatistics{}
- }
- if err := m.Memory.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipStats(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthStats
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthStats
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *VirtualMachineProcessorStatistics) 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 ErrIntOverflowStats
- }
- 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: VirtualMachineProcessorStatistics: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: VirtualMachineProcessorStatistics: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field TotalRuntimeNS", wireType)
- }
- m.TotalRuntimeNS = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.TotalRuntimeNS |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipStats(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthStats
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthStats
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *VirtualMachineMemoryStatistics) 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 ErrIntOverflowStats
- }
- 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: VirtualMachineMemoryStatistics: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: VirtualMachineMemoryStatistics: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field WorkingSetBytes", wireType)
- }
- m.WorkingSetBytes = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.WorkingSetBytes |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field VirtualNodeCount", wireType)
- }
- m.VirtualNodeCount = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.VirtualNodeCount |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field VmMemory", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthStats
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthStats
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.VmMemory == nil {
- m.VmMemory = &VirtualMachineMemory{}
- }
- if err := m.VmMemory.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipStats(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthStats
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthStats
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *VirtualMachineMemory) 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 ErrIntOverflowStats
- }
- 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: VirtualMachineMemory: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: VirtualMachineMemory: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field AvailableMemory", wireType)
- }
- m.AvailableMemory = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.AvailableMemory |= int32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field AvailableMemoryBuffer", wireType)
- }
- m.AvailableMemoryBuffer = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.AvailableMemoryBuffer |= int32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field ReservedMemory", wireType)
- }
- m.ReservedMemory = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.ReservedMemory |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field AssignedMemory", wireType)
- }
- m.AssignedMemory = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.AssignedMemory |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 5:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field SlpActive", wireType)
- }
- var v int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.SlpActive = bool(v != 0)
- case 6:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field BalancingEnabled", wireType)
- }
- var v int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.BalancingEnabled = bool(v != 0)
- case 7:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field DmOperationInProgress", wireType)
- }
- var v int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowStats
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.DmOperationInProgress = bool(v != 0)
- default:
- iNdEx = preIndex
- skippy, err := skipStats(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthStats
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthStats
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func skipStats(dAtA []byte) (n int, err error) {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowStats
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowStats
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if dAtA[iNdEx-1] < 0x80 {
- break
- }
- }
- return iNdEx, nil
- case 1:
- iNdEx += 8
- return iNdEx, nil
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowStats
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if length < 0 {
- return 0, ErrInvalidLengthStats
- }
- iNdEx += length
- if iNdEx < 0 {
- return 0, ErrInvalidLengthStats
- }
- return iNdEx, nil
- case 3:
- for {
- var innerWire uint64
- var start int = iNdEx
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowStats
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- innerWire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- innerWireType := int(innerWire & 0x7)
- if innerWireType == 4 {
- break
- }
- next, err := skipStats(dAtA[start:])
- if err != nil {
- return 0, err
- }
- iNdEx = start + next
- if iNdEx < 0 {
- return 0, ErrInvalidLengthStats
- }
- }
- return iNdEx, nil
- case 4:
- return iNdEx, nil
- case 5:
- iNdEx += 4
- return iNdEx, nil
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- }
- panic("unreachable")
-}
-
-var (
- ErrInvalidLengthStats = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowStats = fmt.Errorf("proto: integer overflow")
-)
diff --git a/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/stats/stats.proto b/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/stats/stats.proto
deleted file mode 100644
index ea0b6b6b3..000000000
--- a/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/stats/stats.proto
+++ /dev/null
@@ -1,70 +0,0 @@
-syntax = "proto3";
-
-package containerd.runhcs.stats.v1;
-
-import weak "gogoproto/gogo.proto";
-import "google/protobuf/timestamp.proto";
-import "github.com/containerd/cgroups/stats/v1/metrics.proto";
-
-option go_package = "github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/stats;stats";
-
-message Statistics {
- oneof container {
- WindowsContainerStatistics windows = 1;
- io.containerd.cgroups.v1.Metrics linux = 2;
- }
- VirtualMachineStatistics vm = 3 [(gogoproto.customname) = "VM"];
-}
-
-message WindowsContainerStatistics {
- google.protobuf.Timestamp timestamp = 1 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
- google.protobuf.Timestamp container_start_time = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
- uint64 uptime_ns = 3 [(gogoproto.customname) = "UptimeNS"];
- WindowsContainerProcessorStatistics processor = 4;
- WindowsContainerMemoryStatistics memory = 5;
- WindowsContainerStorageStatistics storage = 6;
-}
-
-message WindowsContainerProcessorStatistics {
- uint64 total_runtime_ns = 1 [(gogoproto.customname) = "TotalRuntimeNS"];
- uint64 runtime_user_ns = 2 [(gogoproto.customname) = "RuntimeUserNS"];
- uint64 runtime_kernel_ns = 3 [(gogoproto.customname) = "RuntimeKernelNS"];
-}
-
-message WindowsContainerMemoryStatistics {
- uint64 memory_usage_commit_bytes = 1;
- uint64 memory_usage_commit_peak_bytes = 2;
- uint64 memory_usage_private_working_set_bytes = 3;
-}
-
-message WindowsContainerStorageStatistics {
- uint64 read_count_normalized = 1;
- uint64 read_size_bytes = 2;
- uint64 write_count_normalized = 3;
- uint64 write_size_bytes = 4;
-}
-
-message VirtualMachineStatistics {
- VirtualMachineProcessorStatistics processor = 1;
- VirtualMachineMemoryStatistics memory = 2;
-}
-
-message VirtualMachineProcessorStatistics {
- uint64 total_runtime_ns = 1 [(gogoproto.customname) = "TotalRuntimeNS"];
-}
-
-message VirtualMachineMemoryStatistics {
- uint64 working_set_bytes = 1;
- uint32 virtual_node_count = 2;
- VirtualMachineMemory vm_memory = 3;
-}
-
-message VirtualMachineMemory {
- int32 available_memory = 1;
- int32 available_memory_buffer = 2;
- uint64 reserved_memory = 3;
- uint64 assigned_memory = 4;
- bool slp_active = 5;
- bool balancing_enabled = 6;
- bool dm_operation_in_progress = 7;
-}
\ No newline at end of file
diff --git a/vendor/github.com/Microsoft/hcsshim/container.go b/vendor/github.com/Microsoft/hcsshim/container.go
deleted file mode 100644
index 7205a62c5..000000000
--- a/vendor/github.com/Microsoft/hcsshim/container.go
+++ /dev/null
@@ -1,223 +0,0 @@
-package hcsshim
-
-import (
- "context"
- "fmt"
- "os"
- "sync"
- "time"
-
- "github.com/Microsoft/hcsshim/internal/hcs"
- "github.com/Microsoft/hcsshim/internal/mergemaps"
- "github.com/Microsoft/hcsshim/internal/schema1"
-)
-
-// ContainerProperties holds the properties for a container and the processes running in that container
-type ContainerProperties = schema1.ContainerProperties
-
-// MemoryStats holds the memory statistics for a container
-type MemoryStats = schema1.MemoryStats
-
-// ProcessorStats holds the processor statistics for a container
-type ProcessorStats = schema1.ProcessorStats
-
-// StorageStats holds the storage statistics for a container
-type StorageStats = schema1.StorageStats
-
-// NetworkStats holds the network statistics for a container
-type NetworkStats = schema1.NetworkStats
-
-// Statistics is the structure returned by a statistics call on a container
-type Statistics = schema1.Statistics
-
-// ProcessList is the structure of an item returned by a ProcessList call on a container
-type ProcessListItem = schema1.ProcessListItem
-
-// MappedVirtualDiskController is the structure of an item returned by a MappedVirtualDiskList call on a container
-type MappedVirtualDiskController = schema1.MappedVirtualDiskController
-
-// Type of Request Support in ModifySystem
-type RequestType = schema1.RequestType
-
-// Type of Resource Support in ModifySystem
-type ResourceType = schema1.ResourceType
-
-// RequestType const
-const (
- Add = schema1.Add
- Remove = schema1.Remove
- Network = schema1.Network
-)
-
-// ResourceModificationRequestResponse is the structure used to send request to the container to modify the system
-// Supported resource types are Network and Request Types are Add/Remove
-type ResourceModificationRequestResponse = schema1.ResourceModificationRequestResponse
-
-type container struct {
- system *hcs.System
- waitOnce sync.Once
- waitErr error
- waitCh chan struct{}
-}
-
-// createComputeSystemAdditionalJSON is read from the environment at initialisation
-// time. It allows an environment variable to define additional JSON which
-// is merged in the CreateComputeSystem call to HCS.
-var createContainerAdditionalJSON []byte
-
-func init() {
- createContainerAdditionalJSON = ([]byte)(os.Getenv("HCSSHIM_CREATECONTAINER_ADDITIONALJSON"))
-}
-
-// CreateContainer creates a new container with the given configuration but does not start it.
-func CreateContainer(id string, c *ContainerConfig) (Container, error) {
- fullConfig, err := mergemaps.MergeJSON(c, createContainerAdditionalJSON)
- if err != nil {
- return nil, fmt.Errorf("failed to merge additional JSON '%s': %s", createContainerAdditionalJSON, err)
- }
-
- system, err := hcs.CreateComputeSystem(context.Background(), id, fullConfig)
- if err != nil {
- return nil, err
- }
- return &container{system: system}, err
-}
-
-// OpenContainer opens an existing container by ID.
-func OpenContainer(id string) (Container, error) {
- system, err := hcs.OpenComputeSystem(context.Background(), id)
- if err != nil {
- return nil, err
- }
- return &container{system: system}, err
-}
-
-// GetContainers gets a list of the containers on the system that match the query
-func GetContainers(q ComputeSystemQuery) ([]ContainerProperties, error) {
- return hcs.GetComputeSystems(context.Background(), q)
-}
-
-// Start synchronously starts the container.
-func (container *container) Start() error {
- return convertSystemError(container.system.Start(context.Background()), container)
-}
-
-// Shutdown requests a container shutdown, but it may not actually be shutdown until Wait() succeeds.
-func (container *container) Shutdown() error {
- err := container.system.Shutdown(context.Background())
- if err != nil {
- return convertSystemError(err, container)
- }
- return &ContainerError{Container: container, Err: ErrVmcomputeOperationPending, Operation: "hcsshim::ComputeSystem::Shutdown"}
-}
-
-// Terminate requests a container terminate, but it may not actually be terminated until Wait() succeeds.
-func (container *container) Terminate() error {
- err := container.system.Terminate(context.Background())
- if err != nil {
- return convertSystemError(err, container)
- }
- return &ContainerError{Container: container, Err: ErrVmcomputeOperationPending, Operation: "hcsshim::ComputeSystem::Terminate"}
-}
-
-// Waits synchronously waits for the container to shutdown or terminate.
-func (container *container) Wait() error {
- err := container.system.Wait()
- if err == nil {
- err = container.system.ExitError()
- }
- return convertSystemError(err, container)
-}
-
-// WaitTimeout synchronously waits for the container to terminate or the duration to elapse. It
-// returns false if timeout occurs.
-func (container *container) WaitTimeout(timeout time.Duration) error {
- container.waitOnce.Do(func() {
- container.waitCh = make(chan struct{})
- go func() {
- container.waitErr = container.Wait()
- close(container.waitCh)
- }()
- })
- t := time.NewTimer(timeout)
- defer t.Stop()
- select {
- case <-t.C:
- return &ContainerError{Container: container, Err: ErrTimeout, Operation: "hcsshim::ComputeSystem::Wait"}
- case <-container.waitCh:
- return container.waitErr
- }
-}
-
-// Pause pauses the execution of a container.
-func (container *container) Pause() error {
- return convertSystemError(container.system.Pause(context.Background()), container)
-}
-
-// Resume resumes the execution of a container.
-func (container *container) Resume() error {
- return convertSystemError(container.system.Resume(context.Background()), container)
-}
-
-// HasPendingUpdates returns true if the container has updates pending to install
-func (container *container) HasPendingUpdates() (bool, error) {
- return false, nil
-}
-
-// Statistics returns statistics for the container. This is a legacy v1 call
-func (container *container) Statistics() (Statistics, error) {
- properties, err := container.system.Properties(context.Background(), schema1.PropertyTypeStatistics)
- if err != nil {
- return Statistics{}, convertSystemError(err, container)
- }
-
- return properties.Statistics, nil
-}
-
-// ProcessList returns an array of ProcessListItems for the container. This is a legacy v1 call
-func (container *container) ProcessList() ([]ProcessListItem, error) {
- properties, err := container.system.Properties(context.Background(), schema1.PropertyTypeProcessList)
- if err != nil {
- return nil, convertSystemError(err, container)
- }
-
- return properties.ProcessList, nil
-}
-
-// This is a legacy v1 call
-func (container *container) MappedVirtualDisks() (map[int]MappedVirtualDiskController, error) {
- properties, err := container.system.Properties(context.Background(), schema1.PropertyTypeMappedVirtualDisk)
- if err != nil {
- return nil, convertSystemError(err, container)
- }
-
- return properties.MappedVirtualDiskControllers, nil
-}
-
-// CreateProcess launches a new process within the container.
-func (container *container) CreateProcess(c *ProcessConfig) (Process, error) {
- p, err := container.system.CreateProcess(context.Background(), c)
- if err != nil {
- return nil, convertSystemError(err, container)
- }
- return &process{p: p.(*hcs.Process)}, nil
-}
-
-// OpenProcess gets an interface to an existing process within the container.
-func (container *container) OpenProcess(pid int) (Process, error) {
- p, err := container.system.OpenProcess(context.Background(), pid)
- if err != nil {
- return nil, convertSystemError(err, container)
- }
- return &process{p: p}, nil
-}
-
-// Close cleans up any state associated with the container but does not terminate or wait for it.
-func (container *container) Close() error {
- return convertSystemError(container.system.Close(), container)
-}
-
-// Modify the System
-func (container *container) Modify(config *ResourceModificationRequestResponse) error {
- return convertSystemError(container.system.Modify(context.Background(), config), container)
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/errors.go b/vendor/github.com/Microsoft/hcsshim/errors.go
deleted file mode 100644
index 63efa23c7..000000000
--- a/vendor/github.com/Microsoft/hcsshim/errors.go
+++ /dev/null
@@ -1,257 +0,0 @@
-package hcsshim
-
-import (
- "fmt"
- "syscall"
-
- "github.com/Microsoft/hcsshim/internal/hns"
-
- "github.com/Microsoft/hcsshim/internal/hcs"
- "github.com/Microsoft/hcsshim/internal/hcserror"
-)
-
-var (
- // ErrComputeSystemDoesNotExist is an error encountered when the container being operated on no longer exists = hcs.exist
- ErrComputeSystemDoesNotExist = hcs.ErrComputeSystemDoesNotExist
-
- // ErrElementNotFound is an error encountered when the object being referenced does not exist
- ErrElementNotFound = hcs.ErrElementNotFound
-
- // ErrElementNotFound is an error encountered when the object being referenced does not exist
- ErrNotSupported = hcs.ErrNotSupported
-
- // ErrInvalidData is an error encountered when the request being sent to hcs is invalid/unsupported
- // decimal -2147024883 / hex 0x8007000d
- ErrInvalidData = hcs.ErrInvalidData
-
- // ErrHandleClose is an error encountered when the handle generating the notification being waited on has been closed
- ErrHandleClose = hcs.ErrHandleClose
-
- // ErrAlreadyClosed is an error encountered when using a handle that has been closed by the Close method
- ErrAlreadyClosed = hcs.ErrAlreadyClosed
-
- // ErrInvalidNotificationType is an error encountered when an invalid notification type is used
- ErrInvalidNotificationType = hcs.ErrInvalidNotificationType
-
- // ErrInvalidProcessState is an error encountered when the process is not in a valid state for the requested operation
- ErrInvalidProcessState = hcs.ErrInvalidProcessState
-
- // ErrTimeout is an error encountered when waiting on a notification times out
- ErrTimeout = hcs.ErrTimeout
-
- // ErrUnexpectedContainerExit is the error encountered when a container exits while waiting for
- // a different expected notification
- ErrUnexpectedContainerExit = hcs.ErrUnexpectedContainerExit
-
- // ErrUnexpectedProcessAbort is the error encountered when communication with the compute service
- // is lost while waiting for a notification
- ErrUnexpectedProcessAbort = hcs.ErrUnexpectedProcessAbort
-
- // ErrUnexpectedValue is an error encountered when hcs returns an invalid value
- ErrUnexpectedValue = hcs.ErrUnexpectedValue
-
- // ErrVmcomputeAlreadyStopped is an error encountered when a shutdown or terminate request is made on a stopped container
- ErrVmcomputeAlreadyStopped = hcs.ErrVmcomputeAlreadyStopped
-
- // ErrVmcomputeOperationPending is an error encountered when the operation is being completed asynchronously
- ErrVmcomputeOperationPending = hcs.ErrVmcomputeOperationPending
-
- // ErrVmcomputeOperationInvalidState is an error encountered when the compute system is not in a valid state for the requested operation
- ErrVmcomputeOperationInvalidState = hcs.ErrVmcomputeOperationInvalidState
-
- // ErrProcNotFound is an error encountered when the the process cannot be found
- ErrProcNotFound = hcs.ErrProcNotFound
-
- // ErrVmcomputeOperationAccessIsDenied is an error which can be encountered when enumerating compute systems in RS1/RS2
- // builds when the underlying silo might be in the process of terminating. HCS was fixed in RS3.
- ErrVmcomputeOperationAccessIsDenied = hcs.ErrVmcomputeOperationAccessIsDenied
-
- // ErrVmcomputeInvalidJSON is an error encountered when the compute system does not support/understand the messages sent by management
- ErrVmcomputeInvalidJSON = hcs.ErrVmcomputeInvalidJSON
-
- // ErrVmcomputeUnknownMessage is an error encountered guest compute system doesn't support the message
- ErrVmcomputeUnknownMessage = hcs.ErrVmcomputeUnknownMessage
-
- // ErrNotSupported is an error encountered when hcs doesn't support the request
- ErrPlatformNotSupported = hcs.ErrPlatformNotSupported
-)
-
-type EndpointNotFoundError = hns.EndpointNotFoundError
-type NetworkNotFoundError = hns.NetworkNotFoundError
-
-// ProcessError is an error encountered in HCS during an operation on a Process object
-type ProcessError struct {
- Process *process
- Operation string
- ExtraInfo string
- Err error
- Events []hcs.ErrorEvent
-}
-
-// ContainerError is an error encountered in HCS during an operation on a Container object
-type ContainerError struct {
- Container *container
- Operation string
- ExtraInfo string
- Err error
- Events []hcs.ErrorEvent
-}
-
-func (e *ContainerError) Error() string {
- if e == nil {
- return ""
- }
-
- if e.Container == nil {
- return "unexpected nil container for error: " + e.Err.Error()
- }
-
- s := "container " + e.Container.system.ID()
-
- if e.Operation != "" {
- s += " encountered an error during " + e.Operation
- }
-
- switch e.Err.(type) {
- case nil:
- break
- case syscall.Errno:
- s += fmt.Sprintf(": failure in a Windows system call: %s (0x%x)", e.Err, hcserror.Win32FromError(e.Err))
- default:
- s += fmt.Sprintf(": %s", e.Err.Error())
- }
-
- for _, ev := range e.Events {
- s += "\n" + ev.String()
- }
-
- if e.ExtraInfo != "" {
- s += " extra info: " + e.ExtraInfo
- }
-
- return s
-}
-
-func makeContainerError(container *container, operation string, extraInfo string, err error) error {
- // Don't double wrap errors
- if _, ok := err.(*ContainerError); ok {
- return err
- }
- containerError := &ContainerError{Container: container, Operation: operation, ExtraInfo: extraInfo, Err: err}
- return containerError
-}
-
-func (e *ProcessError) Error() string {
- if e == nil {
- return ""
- }
-
- if e.Process == nil {
- return "Unexpected nil process for error: " + e.Err.Error()
- }
-
- s := fmt.Sprintf("process %d in container %s", e.Process.p.Pid(), e.Process.p.SystemID())
- if e.Operation != "" {
- s += " encountered an error during " + e.Operation
- }
-
- switch e.Err.(type) {
- case nil:
- break
- case syscall.Errno:
- s += fmt.Sprintf(": failure in a Windows system call: %s (0x%x)", e.Err, hcserror.Win32FromError(e.Err))
- default:
- s += fmt.Sprintf(": %s", e.Err.Error())
- }
-
- for _, ev := range e.Events {
- s += "\n" + ev.String()
- }
-
- return s
-}
-
-func makeProcessError(process *process, operation string, extraInfo string, err error) error {
- // Don't double wrap errors
- if _, ok := err.(*ProcessError); ok {
- return err
- }
- processError := &ProcessError{Process: process, Operation: operation, ExtraInfo: extraInfo, Err: err}
- return processError
-}
-
-// IsNotExist checks if an error is caused by the Container or Process not existing.
-// Note: Currently, ErrElementNotFound can mean that a Process has either
-// already exited, or does not exist. Both IsAlreadyStopped and IsNotExist
-// will currently return true when the error is ErrElementNotFound or ErrProcNotFound.
-func IsNotExist(err error) bool {
- if _, ok := err.(EndpointNotFoundError); ok {
- return true
- }
- if _, ok := err.(NetworkNotFoundError); ok {
- return true
- }
- return hcs.IsNotExist(getInnerError(err))
-}
-
-// IsAlreadyClosed checks if an error is caused by the Container or Process having been
-// already closed by a call to the Close() method.
-func IsAlreadyClosed(err error) bool {
- return hcs.IsAlreadyClosed(getInnerError(err))
-}
-
-// IsPending returns a boolean indicating whether the error is that
-// the requested operation is being completed in the background.
-func IsPending(err error) bool {
- return hcs.IsPending(getInnerError(err))
-}
-
-// IsTimeout returns a boolean indicating whether the error is caused by
-// a timeout waiting for the operation to complete.
-func IsTimeout(err error) bool {
- return hcs.IsTimeout(getInnerError(err))
-}
-
-// IsAlreadyStopped returns a boolean indicating whether the error is caused by
-// a Container or Process being already stopped.
-// Note: Currently, ErrElementNotFound can mean that a Process has either
-// already exited, or does not exist. Both IsAlreadyStopped and IsNotExist
-// will currently return true when the error is ErrElementNotFound or ErrProcNotFound.
-func IsAlreadyStopped(err error) bool {
- return hcs.IsAlreadyStopped(getInnerError(err))
-}
-
-// IsNotSupported returns a boolean indicating whether the error is caused by
-// unsupported platform requests
-// Note: Currently Unsupported platform requests can be mean either
-// ErrVmcomputeInvalidJSON, ErrInvalidData, ErrNotSupported or ErrVmcomputeUnknownMessage
-// is thrown from the Platform
-func IsNotSupported(err error) bool {
- return hcs.IsNotSupported(getInnerError(err))
-}
-
-func getInnerError(err error) error {
- switch pe := err.(type) {
- case nil:
- return nil
- case *ContainerError:
- err = pe.Err
- case *ProcessError:
- err = pe.Err
- }
- return err
-}
-
-func convertSystemError(err error, c *container) error {
- if serr, ok := err.(*hcs.SystemError); ok {
- return &ContainerError{Container: c, Operation: serr.Op, ExtraInfo: serr.Extra, Err: serr.Err, Events: serr.Events}
- }
- return err
-}
-
-func convertProcessError(err error, p *process) error {
- if perr, ok := err.(*hcs.ProcessError); ok {
- return &ProcessError{Process: p, Operation: perr.Op, Err: perr.Err, Events: perr.Events}
- }
- return err
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/ext4/internal/compactext4/compact.go b/vendor/github.com/Microsoft/hcsshim/ext4/internal/compactext4/compact.go
deleted file mode 100644
index f2274fd4c..000000000
--- a/vendor/github.com/Microsoft/hcsshim/ext4/internal/compactext4/compact.go
+++ /dev/null
@@ -1,1263 +0,0 @@
-package compactext4
-
-import (
- "bufio"
- "bytes"
- "encoding/binary"
- "errors"
- "fmt"
- "io"
- "path"
- "sort"
- "strings"
- "time"
-
- "github.com/Microsoft/hcsshim/ext4/internal/format"
-)
-
-// Writer writes a compact ext4 file system.
-type Writer struct {
- f io.ReadWriteSeeker
- bw *bufio.Writer
- inodes []*inode
- curName string
- curInode *inode
- pos int64
- dataWritten, dataMax int64
- err error
- initialized bool
- supportInlineData bool
- maxDiskSize int64
- gdBlocks uint32
-}
-
-// Mode flags for Linux files.
-const (
- S_IXOTH = format.S_IXOTH
- S_IWOTH = format.S_IWOTH
- S_IROTH = format.S_IROTH
- S_IXGRP = format.S_IXGRP
- S_IWGRP = format.S_IWGRP
- S_IRGRP = format.S_IRGRP
- S_IXUSR = format.S_IXUSR
- S_IWUSR = format.S_IWUSR
- S_IRUSR = format.S_IRUSR
- S_ISVTX = format.S_ISVTX
- S_ISGID = format.S_ISGID
- S_ISUID = format.S_ISUID
- S_IFIFO = format.S_IFIFO
- S_IFCHR = format.S_IFCHR
- S_IFDIR = format.S_IFDIR
- S_IFBLK = format.S_IFBLK
- S_IFREG = format.S_IFREG
- S_IFLNK = format.S_IFLNK
- S_IFSOCK = format.S_IFSOCK
-
- TypeMask = format.TypeMask
-)
-
-type inode struct {
- Size int64
- Atime, Ctime, Mtime, Crtime uint64
- Number format.InodeNumber
- Mode uint16
- Uid, Gid uint32
- LinkCount uint32
- XattrBlock uint32
- BlockCount uint32
- Devmajor, Devminor uint32
- Flags format.InodeFlag
- Data []byte
- XattrInline []byte
- Children directory
-}
-
-func (node *inode) FileType() uint16 {
- return node.Mode & format.TypeMask
-}
-
-func (node *inode) IsDir() bool {
- return node.FileType() == S_IFDIR
-}
-
-// A File represents a file to be added to an ext4 file system.
-type File struct {
- Linkname string
- Size int64
- Mode uint16
- Uid, Gid uint32
- Atime, Ctime, Mtime, Crtime time.Time
- Devmajor, Devminor uint32
- Xattrs map[string][]byte
-}
-
-const (
- inodeFirst = 11
- inodeLostAndFound = inodeFirst
-
- blockSize = 4096
- blocksPerGroup = blockSize * 8
- inodeSize = 256
- maxInodesPerGroup = blockSize * 8 // Limited by the inode bitmap
- inodesPerGroupIncrement = blockSize / inodeSize
-
- defaultMaxDiskSize = 16 * 1024 * 1024 * 1024 // 16GB
- maxMaxDiskSize = 16 * 1024 * 1024 * 1024 * 1024 // 16TB
-
- groupDescriptorSize = 32 // Use the small group descriptor
- groupsPerDescriptorBlock = blockSize / groupDescriptorSize
-
- maxFileSize = 128 * 1024 * 1024 * 1024 // 128GB file size maximum for now
- smallSymlinkSize = 59 // max symlink size that goes directly in the inode
- maxBlocksPerExtent = 0x8000 // maximum number of blocks in an extent
- inodeDataSize = 60
- inodeUsedSize = 152 // fields through CrtimeExtra
- inodeExtraSize = inodeSize - inodeUsedSize
- xattrInodeOverhead = 4 + 4 // magic number + empty next entry value
- xattrBlockOverhead = 32 + 4 // header + empty next entry value
- inlineDataXattrOverhead = xattrInodeOverhead + 16 + 4 // entry + "data"
- inlineDataSize = inodeDataSize + inodeExtraSize - inlineDataXattrOverhead
-)
-
-type exceededMaxSizeError struct {
- Size int64
-}
-
-func (err exceededMaxSizeError) Error() string {
- return fmt.Sprintf("disk exceeded maximum size of %d bytes", err.Size)
-}
-
-var directoryEntrySize = binary.Size(format.DirectoryEntry{})
-var extraIsize = uint16(inodeUsedSize - 128)
-
-type directory map[string]*inode
-
-func splitFirst(p string) (string, string) {
- n := strings.IndexByte(p, '/')
- if n >= 0 {
- return p[:n], p[n+1:]
- }
- return p, ""
-}
-
-func (w *Writer) findPath(root *inode, p string) *inode {
- inode := root
- for inode != nil && len(p) != 0 {
- name, rest := splitFirst(p)
- p = rest
- inode = inode.Children[name]
- }
- return inode
-}
-
-func timeToFsTime(t time.Time) uint64 {
- if t.IsZero() {
- return 0
- }
- s := t.Unix()
- if s < -0x80000000 {
- return 0x80000000
- }
- if s > 0x37fffffff {
- return 0x37fffffff
- }
- return uint64(s) | uint64(t.Nanosecond())<<34
-}
-
-func fsTimeToTime(t uint64) time.Time {
- if t == 0 {
- return time.Time{}
- }
- s := int64(t & 0x3ffffffff)
- if s > 0x7fffffff && s < 0x100000000 {
- s = int64(int32(uint32(s)))
- }
- return time.Unix(s, int64(t>>34))
-}
-
-func (w *Writer) getInode(i format.InodeNumber) *inode {
- if i == 0 || int(i) > len(w.inodes) {
- return nil
- }
- return w.inodes[i-1]
-}
-
-var xattrPrefixes = []struct {
- Index uint8
- Prefix string
-}{
- {2, "system.posix_acl_access"},
- {3, "system.posix_acl_default"},
- {8, "system.richacl"},
- {7, "system."},
- {1, "user."},
- {4, "trusted."},
- {6, "security."},
-}
-
-func compressXattrName(name string) (uint8, string) {
- for _, p := range xattrPrefixes {
- if strings.HasPrefix(name, p.Prefix) {
- return p.Index, name[len(p.Prefix):]
- }
- }
- return 0, name
-}
-
-func decompressXattrName(index uint8, name string) string {
- for _, p := range xattrPrefixes {
- if index == p.Index {
- return p.Prefix + name
- }
- }
- return name
-}
-
-func hashXattrEntry(name string, value []byte) uint32 {
- var hash uint32
- for i := 0; i < len(name); i++ {
- hash = (hash << 5) ^ (hash >> 27) ^ uint32(name[i])
- }
-
- for i := 0; i+3 < len(value); i += 4 {
- hash = (hash << 16) ^ (hash >> 16) ^ binary.LittleEndian.Uint32(value[i:i+4])
- }
-
- if len(value)%4 != 0 {
- var last [4]byte
- copy(last[:], value[len(value)&^3:])
- hash = (hash << 16) ^ (hash >> 16) ^ binary.LittleEndian.Uint32(last[:])
- }
- return hash
-}
-
-type xattr struct {
- Name string
- Index uint8
- Value []byte
-}
-
-func (x *xattr) EntryLen() int {
- return (len(x.Name)+3)&^3 + 16
-}
-
-func (x *xattr) ValueLen() int {
- return (len(x.Value) + 3) &^ 3
-}
-
-type xattrState struct {
- inode, block []xattr
- inodeLeft, blockLeft int
-}
-
-func (s *xattrState) init() {
- s.inodeLeft = inodeExtraSize - xattrInodeOverhead
- s.blockLeft = blockSize - xattrBlockOverhead
-}
-
-func (s *xattrState) addXattr(name string, value []byte) bool {
- index, name := compressXattrName(name)
- x := xattr{
- Index: index,
- Name: name,
- Value: value,
- }
- length := x.EntryLen() + x.ValueLen()
- if s.inodeLeft >= length {
- s.inode = append(s.inode, x)
- s.inodeLeft -= length
- } else if s.blockLeft >= length {
- s.block = append(s.block, x)
- s.blockLeft -= length
- } else {
- return false
- }
- return true
-}
-
-func putXattrs(xattrs []xattr, b []byte, offsetDelta uint16) {
- offset := uint16(len(b)) + offsetDelta
- eb := b
- db := b
- for _, xattr := range xattrs {
- vl := xattr.ValueLen()
- offset -= uint16(vl)
- eb[0] = uint8(len(xattr.Name))
- eb[1] = xattr.Index
- binary.LittleEndian.PutUint16(eb[2:], offset)
- binary.LittleEndian.PutUint32(eb[8:], uint32(len(xattr.Value)))
- binary.LittleEndian.PutUint32(eb[12:], hashXattrEntry(xattr.Name, xattr.Value))
- copy(eb[16:], xattr.Name)
- eb = eb[xattr.EntryLen():]
- copy(db[len(db)-vl:], xattr.Value)
- db = db[:len(db)-vl]
- }
-}
-
-func getXattrs(b []byte, xattrs map[string][]byte, offsetDelta uint16) {
- eb := b
- for len(eb) != 0 {
- nameLen := eb[0]
- if nameLen == 0 {
- break
- }
- index := eb[1]
- offset := binary.LittleEndian.Uint16(eb[2:]) - offsetDelta
- valueLen := binary.LittleEndian.Uint32(eb[8:])
- attr := xattr{
- Index: index,
- Name: string(eb[16 : 16+nameLen]),
- Value: b[offset : uint32(offset)+valueLen],
- }
- xattrs[decompressXattrName(index, attr.Name)] = attr.Value
- eb = eb[attr.EntryLen():]
- }
-}
-
-func (w *Writer) writeXattrs(inode *inode, state *xattrState) error {
- // Write the inline attributes.
- if len(state.inode) != 0 {
- inode.XattrInline = make([]byte, inodeExtraSize)
- binary.LittleEndian.PutUint32(inode.XattrInline[0:], format.XAttrHeaderMagic) // Magic
- putXattrs(state.inode, inode.XattrInline[4:], 0)
- }
-
- // Write the block attributes. If there was previously an xattr block, then
- // rewrite it even if it is now empty.
- if len(state.block) != 0 || inode.XattrBlock != 0 {
- sort.Slice(state.block, func(i, j int) bool {
- return state.block[i].Index < state.block[j].Index ||
- len(state.block[i].Name) < len(state.block[j].Name) ||
- state.block[i].Name < state.block[j].Name
- })
-
- var b [blockSize]byte
- binary.LittleEndian.PutUint32(b[0:], format.XAttrHeaderMagic) // Magic
- binary.LittleEndian.PutUint32(b[4:], 1) // ReferenceCount
- binary.LittleEndian.PutUint32(b[8:], 1) // Blocks
- putXattrs(state.block, b[32:], 32)
-
- orig := w.block()
- if inode.XattrBlock == 0 {
- inode.XattrBlock = orig
- inode.BlockCount++
- } else {
- // Reuse the original block.
- w.seekBlock(inode.XattrBlock)
- defer w.seekBlock(orig)
- }
-
- if _, err := w.write(b[:]); err != nil {
- return err
- }
- }
-
- return nil
-}
-
-func (w *Writer) write(b []byte) (int, error) {
- if w.err != nil {
- return 0, w.err
- }
- if w.pos+int64(len(b)) > w.maxDiskSize {
- w.err = exceededMaxSizeError{w.maxDiskSize}
- return 0, w.err
- }
- n, err := w.bw.Write(b)
- w.pos += int64(n)
- w.err = err
- return n, err
-}
-
-func (w *Writer) zero(n int64) (int64, error) {
- if w.err != nil {
- return 0, w.err
- }
- if w.pos+int64(n) > w.maxDiskSize {
- w.err = exceededMaxSizeError{w.maxDiskSize}
- return 0, w.err
- }
- n, err := io.CopyN(w.bw, zero, n)
- w.pos += n
- w.err = err
- return n, err
-}
-
-func (w *Writer) makeInode(f *File, node *inode) (*inode, error) {
- mode := f.Mode
- if mode&format.TypeMask == 0 {
- mode |= format.S_IFREG
- }
- typ := mode & format.TypeMask
- ino := format.InodeNumber(len(w.inodes) + 1)
- if node == nil {
- node = &inode{
- Number: ino,
- }
- if typ == S_IFDIR {
- node.Children = make(directory)
- node.LinkCount = 1 // A directory is linked to itself.
- }
- } else if node.Flags&format.InodeFlagExtents != 0 {
- // Since we cannot deallocate or reuse blocks, don't allow updates that
- // would invalidate data that has already been written.
- return nil, errors.New("cannot overwrite file with non-inline data")
- }
- node.Mode = mode
- node.Uid = f.Uid
- node.Gid = f.Gid
- node.Flags = format.InodeFlagHugeFile
- node.Atime = timeToFsTime(f.Atime)
- node.Ctime = timeToFsTime(f.Ctime)
- node.Mtime = timeToFsTime(f.Mtime)
- node.Crtime = timeToFsTime(f.Crtime)
- node.Devmajor = f.Devmajor
- node.Devminor = f.Devminor
- node.Data = nil
- node.XattrInline = nil
-
- var xstate xattrState
- xstate.init()
-
- var size int64
- switch typ {
- case format.S_IFREG:
- size = f.Size
- if f.Size > maxFileSize {
- return nil, fmt.Errorf("file too big: %d > %d", f.Size, int64(maxFileSize))
- }
- if f.Size <= inlineDataSize && w.supportInlineData {
- node.Data = make([]byte, f.Size)
- extra := 0
- if f.Size > inodeDataSize {
- extra = int(f.Size - inodeDataSize)
- }
- // Add a dummy entry for now.
- if !xstate.addXattr("system.data", node.Data[:extra]) {
- panic("not enough room for inline data")
- }
- node.Flags |= format.InodeFlagInlineData
- }
- case format.S_IFLNK:
- node.Mode |= 0777 // Symlinks should appear as ugw rwx
- size = int64(len(f.Linkname))
- if size <= smallSymlinkSize {
- // Special case: small symlinks go directly in Block without setting
- // an inline data flag.
- node.Data = make([]byte, len(f.Linkname))
- copy(node.Data, f.Linkname)
- }
- case format.S_IFDIR, format.S_IFIFO, format.S_IFSOCK, format.S_IFCHR, format.S_IFBLK:
- default:
- return nil, fmt.Errorf("invalid mode %o", mode)
- }
-
- // Accumulate the extended attributes.
- if len(f.Xattrs) != 0 {
- // Sort the xattrs to avoid non-determinism in map iteration.
- var xattrs []string
- for name := range f.Xattrs {
- xattrs = append(xattrs, name)
- }
- sort.Strings(xattrs)
- for _, name := range xattrs {
- if !xstate.addXattr(name, f.Xattrs[name]) {
- return nil, fmt.Errorf("could not fit xattr %s", name)
- }
- }
- }
-
- if err := w.writeXattrs(node, &xstate); err != nil {
- return nil, err
- }
-
- node.Size = size
- if typ == format.S_IFLNK && size > smallSymlinkSize {
- // Write the link name as data.
- w.startInode("", node, size)
- if _, err := w.Write([]byte(f.Linkname)); err != nil {
- return nil, err
- }
- if err := w.finishInode(); err != nil {
- return nil, err
- }
- }
-
- if int(node.Number-1) >= len(w.inodes) {
- w.inodes = append(w.inodes, node)
- }
- return node, nil
-}
-
-func (w *Writer) root() *inode {
- return w.getInode(format.InodeRoot)
-}
-
-func (w *Writer) lookup(name string, mustExist bool) (*inode, *inode, string, error) {
- root := w.root()
- cleanname := path.Clean("/" + name)[1:]
- if len(cleanname) == 0 {
- return root, root, "", nil
- }
- dirname, childname := path.Split(cleanname)
- if len(childname) == 0 || len(childname) > 0xff {
- return nil, nil, "", fmt.Errorf("%s: invalid name", name)
- }
- dir := w.findPath(root, dirname)
- if dir == nil || !dir.IsDir() {
- return nil, nil, "", fmt.Errorf("%s: path not found", name)
- }
- child := dir.Children[childname]
- if child == nil && mustExist {
- return nil, nil, "", fmt.Errorf("%s: file not found", name)
- }
- return dir, child, childname, nil
-}
-
-// Create adds a file to the file system.
-func (w *Writer) Create(name string, f *File) error {
- if err := w.finishInode(); err != nil {
- return err
- }
- dir, existing, childname, err := w.lookup(name, false)
- if err != nil {
- return err
- }
- var reuse *inode
- if existing != nil {
- if existing.IsDir() {
- if f.Mode&TypeMask != S_IFDIR {
- return fmt.Errorf("%s: cannot replace a directory with a file", name)
- }
- reuse = existing
- } else if f.Mode&TypeMask == S_IFDIR {
- return fmt.Errorf("%s: cannot replace a file with a directory", name)
- } else if existing.LinkCount < 2 {
- reuse = existing
- }
- } else {
- if f.Mode&TypeMask == S_IFDIR && dir.LinkCount >= format.MaxLinks {
- return fmt.Errorf("%s: exceeded parent directory maximum link count", name)
- }
- }
- child, err := w.makeInode(f, reuse)
- if err != nil {
- return fmt.Errorf("%s: %s", name, err)
- }
- if existing != child {
- if existing != nil {
- existing.LinkCount--
- }
- dir.Children[childname] = child
- child.LinkCount++
- if child.IsDir() {
- dir.LinkCount++
- }
- }
- if child.Mode&format.TypeMask == format.S_IFREG {
- w.startInode(name, child, f.Size)
- }
- return nil
-}
-
-// Link adds a hard link to the file system.
-func (w *Writer) Link(oldname, newname string) error {
- if err := w.finishInode(); err != nil {
- return err
- }
- newdir, existing, newchildname, err := w.lookup(newname, false)
- if err != nil {
- return err
- }
- if existing != nil && (existing.IsDir() || existing.LinkCount < 2) {
- return fmt.Errorf("%s: cannot orphan existing file or directory", newname)
- }
-
- _, oldfile, _, err := w.lookup(oldname, true)
- if err != nil {
- return err
- }
- switch oldfile.Mode & format.TypeMask {
- case format.S_IFDIR, format.S_IFLNK:
- return fmt.Errorf("%s: link target cannot be a directory or symlink: %s", newname, oldname)
- }
-
- if existing != oldfile && oldfile.LinkCount >= format.MaxLinks {
- return fmt.Errorf("%s: link target would exceed maximum link count: %s", newname, oldname)
- }
-
- if existing != nil {
- existing.LinkCount--
- }
- oldfile.LinkCount++
- newdir.Children[newchildname] = oldfile
- return nil
-}
-
-// Stat returns information about a file that has been written.
-func (w *Writer) Stat(name string) (*File, error) {
- if err := w.finishInode(); err != nil {
- return nil, err
- }
- _, node, _, err := w.lookup(name, true)
- if err != nil {
- return nil, err
- }
- f := &File{
- Size: node.Size,
- Mode: node.Mode,
- Uid: node.Uid,
- Gid: node.Gid,
- Atime: fsTimeToTime(node.Atime),
- Ctime: fsTimeToTime(node.Ctime),
- Mtime: fsTimeToTime(node.Mtime),
- Crtime: fsTimeToTime(node.Crtime),
- Devmajor: node.Devmajor,
- Devminor: node.Devminor,
- }
- f.Xattrs = make(map[string][]byte)
- if node.XattrBlock != 0 || len(node.XattrInline) != 0 {
- if node.XattrBlock != 0 {
- orig := w.block()
- w.seekBlock(node.XattrBlock)
- if w.err != nil {
- return nil, w.err
- }
- var b [blockSize]byte
- _, err := w.f.Read(b[:])
- w.seekBlock(orig)
- if err != nil {
- return nil, err
- }
- getXattrs(b[32:], f.Xattrs, 32)
- }
- if len(node.XattrInline) != 0 {
- getXattrs(node.XattrInline[4:], f.Xattrs, 0)
- delete(f.Xattrs, "system.data")
- }
- }
- if node.FileType() == S_IFLNK {
- if node.Size > smallSymlinkSize {
- return nil, fmt.Errorf("%s: cannot retrieve link information", name)
- }
- f.Linkname = string(node.Data)
- }
- return f, nil
-}
-
-func (w *Writer) Write(b []byte) (int, error) {
- if len(b) == 0 {
- return 0, nil
- }
- if w.dataWritten+int64(len(b)) > w.dataMax {
- return 0, fmt.Errorf("%s: wrote too much: %d > %d", w.curName, w.dataWritten+int64(len(b)), w.dataMax)
- }
-
- if w.curInode.Flags&format.InodeFlagInlineData != 0 {
- copy(w.curInode.Data[w.dataWritten:], b)
- w.dataWritten += int64(len(b))
- return len(b), nil
- }
-
- n, err := w.write(b)
- w.dataWritten += int64(n)
- return n, err
-}
-
-func (w *Writer) startInode(name string, inode *inode, size int64) {
- if w.curInode != nil {
- panic("inode already in progress")
- }
- w.curName = name
- w.curInode = inode
- w.dataWritten = 0
- w.dataMax = size
-}
-
-func (w *Writer) block() uint32 {
- return uint32(w.pos / blockSize)
-}
-
-func (w *Writer) seekBlock(block uint32) {
- w.pos = int64(block) * blockSize
- if w.err != nil {
- return
- }
- w.err = w.bw.Flush()
- if w.err != nil {
- return
- }
- _, w.err = w.f.Seek(w.pos, io.SeekStart)
-}
-
-func (w *Writer) nextBlock() {
- if w.pos%blockSize != 0 {
- // Simplify callers; w.err is updated on failure.
- w.zero(blockSize - w.pos%blockSize)
- }
-}
-
-func fillExtents(hdr *format.ExtentHeader, extents []format.ExtentLeafNode, startBlock, offset, inodeSize uint32) {
- *hdr = format.ExtentHeader{
- Magic: format.ExtentHeaderMagic,
- Entries: uint16(len(extents)),
- Max: uint16(cap(extents)),
- Depth: 0,
- }
- for i := range extents {
- block := offset + uint32(i)*maxBlocksPerExtent
- length := inodeSize - block
- if length > maxBlocksPerExtent {
- length = maxBlocksPerExtent
- }
- start := startBlock + block
- extents[i] = format.ExtentLeafNode{
- Block: block,
- Length: uint16(length),
- StartLow: start,
- }
- }
-}
-
-func (w *Writer) writeExtents(inode *inode) error {
- start := w.pos - w.dataWritten
- if start%blockSize != 0 {
- panic("unaligned")
- }
- w.nextBlock()
-
- startBlock := uint32(start / blockSize)
- blocks := w.block() - startBlock
- usedBlocks := blocks
-
- const extentNodeSize = 12
- const extentsPerBlock = blockSize/extentNodeSize - 1
-
- extents := (blocks + maxBlocksPerExtent - 1) / maxBlocksPerExtent
- var b bytes.Buffer
- if extents == 0 {
- // Nothing to do.
- } else if extents <= 4 {
- var root struct {
- hdr format.ExtentHeader
- extents [4]format.ExtentLeafNode
- }
- fillExtents(&root.hdr, root.extents[:extents], startBlock, 0, blocks)
- binary.Write(&b, binary.LittleEndian, root)
- } else if extents <= 4*extentsPerBlock {
- const extentsPerBlock = blockSize/extentNodeSize - 1
- extentBlocks := extents/extentsPerBlock + 1
- usedBlocks += extentBlocks
- var b2 bytes.Buffer
-
- var root struct {
- hdr format.ExtentHeader
- nodes [4]format.ExtentIndexNode
- }
- root.hdr = format.ExtentHeader{
- Magic: format.ExtentHeaderMagic,
- Entries: uint16(extentBlocks),
- Max: 4,
- Depth: 1,
- }
- for i := uint32(0); i < extentBlocks; i++ {
- root.nodes[i] = format.ExtentIndexNode{
- Block: i * extentsPerBlock * maxBlocksPerExtent,
- LeafLow: w.block(),
- }
- extentsInBlock := extents - i*extentBlocks
- if extentsInBlock > extentsPerBlock {
- extentsInBlock = extentsPerBlock
- }
-
- var node struct {
- hdr format.ExtentHeader
- extents [extentsPerBlock]format.ExtentLeafNode
- _ [blockSize - (extentsPerBlock+1)*extentNodeSize]byte
- }
-
- offset := i * extentsPerBlock * maxBlocksPerExtent
- fillExtents(&node.hdr, node.extents[:extentsInBlock], startBlock+offset, offset, blocks)
- binary.Write(&b2, binary.LittleEndian, node)
- if _, err := w.write(b2.Next(blockSize)); err != nil {
- return err
- }
- }
- binary.Write(&b, binary.LittleEndian, root)
- } else {
- panic("file too big")
- }
-
- inode.Data = b.Bytes()
- inode.Flags |= format.InodeFlagExtents
- inode.BlockCount += usedBlocks
- return w.err
-}
-
-func (w *Writer) finishInode() error {
- if !w.initialized {
- if err := w.init(); err != nil {
- return err
- }
- }
- if w.curInode == nil {
- return nil
- }
- if w.dataWritten != w.dataMax {
- return fmt.Errorf("did not write the right amount: %d != %d", w.dataWritten, w.dataMax)
- }
-
- if w.dataMax != 0 && w.curInode.Flags&format.InodeFlagInlineData == 0 {
- if err := w.writeExtents(w.curInode); err != nil {
- return err
- }
- }
-
- w.dataWritten = 0
- w.dataMax = 0
- w.curInode = nil
- return w.err
-}
-
-func modeToFileType(mode uint16) format.FileType {
- switch mode & format.TypeMask {
- default:
- return format.FileTypeUnknown
- case format.S_IFREG:
- return format.FileTypeRegular
- case format.S_IFDIR:
- return format.FileTypeDirectory
- case format.S_IFCHR:
- return format.FileTypeCharacter
- case format.S_IFBLK:
- return format.FileTypeBlock
- case format.S_IFIFO:
- return format.FileTypeFIFO
- case format.S_IFSOCK:
- return format.FileTypeSocket
- case format.S_IFLNK:
- return format.FileTypeSymbolicLink
- }
-}
-
-type constReader byte
-
-var zero = constReader(0)
-
-func (r constReader) Read(b []byte) (int, error) {
- for i := range b {
- b[i] = byte(r)
- }
- return len(b), nil
-}
-
-func (w *Writer) writeDirectory(dir, parent *inode) error {
- if err := w.finishInode(); err != nil {
- return err
- }
-
- // The size of the directory is not known yet.
- w.startInode("", dir, 0x7fffffffffffffff)
- left := blockSize
- finishBlock := func() error {
- if left > 0 {
- e := format.DirectoryEntry{
- RecordLength: uint16(left),
- }
- err := binary.Write(w, binary.LittleEndian, e)
- if err != nil {
- return err
- }
- left -= directoryEntrySize
- if left < 4 {
- panic("not enough space for trailing entry")
- }
- _, err = io.CopyN(w, zero, int64(left))
- if err != nil {
- return err
- }
- }
- left = blockSize
- return nil
- }
-
- writeEntry := func(ino format.InodeNumber, name string) error {
- rlb := directoryEntrySize + len(name)
- rl := (rlb + 3) & ^3
- if left < rl+12 {
- if err := finishBlock(); err != nil {
- return err
- }
- }
- e := format.DirectoryEntry{
- Inode: ino,
- RecordLength: uint16(rl),
- NameLength: uint8(len(name)),
- FileType: modeToFileType(w.getInode(ino).Mode),
- }
- err := binary.Write(w, binary.LittleEndian, e)
- if err != nil {
- return err
- }
- _, err = w.Write([]byte(name))
- if err != nil {
- return err
- }
- var zero [4]byte
- _, err = w.Write(zero[:rl-rlb])
- if err != nil {
- return err
- }
- left -= rl
- return nil
- }
- if err := writeEntry(dir.Number, "."); err != nil {
- return err
- }
- if err := writeEntry(parent.Number, ".."); err != nil {
- return err
- }
-
- // Follow e2fsck's convention and sort the children by inode number.
- var children []string
- for name := range dir.Children {
- children = append(children, name)
- }
- sort.Slice(children, func(i, j int) bool {
- return dir.Children[children[i]].Number < dir.Children[children[j]].Number
- })
-
- for _, name := range children {
- child := dir.Children[name]
- if err := writeEntry(child.Number, name); err != nil {
- return err
- }
- }
- if err := finishBlock(); err != nil {
- return err
- }
- w.curInode.Size = w.dataWritten
- w.dataMax = w.dataWritten
- return nil
-}
-
-func (w *Writer) writeDirectoryRecursive(dir, parent *inode) error {
- if err := w.writeDirectory(dir, parent); err != nil {
- return err
- }
- for _, child := range dir.Children {
- if child.IsDir() {
- if err := w.writeDirectoryRecursive(child, dir); err != nil {
- return err
- }
- }
- }
- return nil
-}
-
-func (w *Writer) writeInodeTable(tableSize uint32) error {
- var b bytes.Buffer
- for _, inode := range w.inodes {
- if inode != nil {
- binode := format.Inode{
- Mode: inode.Mode,
- Uid: uint16(inode.Uid & 0xffff),
- Gid: uint16(inode.Gid & 0xffff),
- SizeLow: uint32(inode.Size & 0xffffffff),
- SizeHigh: uint32(inode.Size >> 32),
- LinksCount: uint16(inode.LinkCount),
- BlocksLow: inode.BlockCount,
- Flags: inode.Flags,
- XattrBlockLow: inode.XattrBlock,
- UidHigh: uint16(inode.Uid >> 16),
- GidHigh: uint16(inode.Gid >> 16),
- ExtraIsize: uint16(inodeUsedSize - 128),
- Atime: uint32(inode.Atime),
- AtimeExtra: uint32(inode.Atime >> 32),
- Ctime: uint32(inode.Ctime),
- CtimeExtra: uint32(inode.Ctime >> 32),
- Mtime: uint32(inode.Mtime),
- MtimeExtra: uint32(inode.Mtime >> 32),
- Crtime: uint32(inode.Crtime),
- CrtimeExtra: uint32(inode.Crtime >> 32),
- }
- switch inode.Mode & format.TypeMask {
- case format.S_IFDIR, format.S_IFREG, format.S_IFLNK:
- n := copy(binode.Block[:], inode.Data)
- if n < len(inode.Data) {
- // Rewrite the first xattr with the data.
- xattr := [1]xattr{{
- Name: "data",
- Index: 7, // "system."
- Value: inode.Data[n:],
- }}
- putXattrs(xattr[:], inode.XattrInline[4:], 0)
- }
- case format.S_IFBLK, format.S_IFCHR:
- dev := inode.Devminor&0xff | inode.Devmajor<<8 | (inode.Devminor&0xffffff00)<<12
- binary.LittleEndian.PutUint32(binode.Block[4:], dev)
- }
-
- binary.Write(&b, binary.LittleEndian, binode)
- b.Truncate(inodeUsedSize)
- n, _ := b.Write(inode.XattrInline)
- io.CopyN(&b, zero, int64(inodeExtraSize-n))
- } else {
- io.CopyN(&b, zero, inodeSize)
- }
- if _, err := w.write(b.Next(inodeSize)); err != nil {
- return err
- }
- }
- rest := tableSize - uint32(len(w.inodes)*inodeSize)
- if _, err := w.zero(int64(rest)); err != nil {
- return err
- }
- return nil
-}
-
-// NewWriter returns a Writer that writes an ext4 file system to the provided
-// WriteSeeker.
-func NewWriter(f io.ReadWriteSeeker, opts ...Option) *Writer {
- w := &Writer{
- f: f,
- bw: bufio.NewWriterSize(f, 65536*8),
- maxDiskSize: defaultMaxDiskSize,
- }
- for _, opt := range opts {
- opt(w)
- }
- return w
-}
-
-// An Option provides extra options to NewWriter.
-type Option func(*Writer)
-
-// InlineData instructs the Writer to write small files into the inode
-// structures directly. This creates smaller images but currently is not
-// compatible with DAX.
-func InlineData(w *Writer) {
- w.supportInlineData = true
-}
-
-// MaximumDiskSize instructs the writer to reserve enough metadata space for the
-// specified disk size. If not provided, then 16GB is the default.
-func MaximumDiskSize(size int64) Option {
- return func(w *Writer) {
- if size < 0 || size > maxMaxDiskSize {
- w.maxDiskSize = maxMaxDiskSize
- } else if size == 0 {
- w.maxDiskSize = defaultMaxDiskSize
- } else {
- w.maxDiskSize = (size + blockSize - 1) &^ (blockSize - 1)
- }
- }
-}
-
-func (w *Writer) init() error {
- // Skip the defective block inode.
- w.inodes = make([]*inode, 1, 32)
- // Create the root directory.
- root, _ := w.makeInode(&File{
- Mode: format.S_IFDIR | 0755,
- }, nil)
- root.LinkCount++ // The root is linked to itself.
- // Skip until the first non-reserved inode.
- w.inodes = append(w.inodes, make([]*inode, inodeFirst-len(w.inodes)-1)...)
- maxBlocks := (w.maxDiskSize-1)/blockSize + 1
- maxGroups := (maxBlocks-1)/blocksPerGroup + 1
- w.gdBlocks = uint32((maxGroups-1)/groupsPerDescriptorBlock + 1)
-
- // Skip past the superblock and block descriptor table.
- w.seekBlock(1 + w.gdBlocks)
- w.initialized = true
-
- // The lost+found directory is required to exist for e2fsck to pass.
- if err := w.Create("lost+found", &File{Mode: format.S_IFDIR | 0700}); err != nil {
- return err
- }
- return w.err
-}
-
-func groupCount(blocks uint32, inodes uint32, inodesPerGroup uint32) uint32 {
- inodeBlocksPerGroup := inodesPerGroup * inodeSize / blockSize
- dataBlocksPerGroup := blocksPerGroup - inodeBlocksPerGroup - 2 // save room for the bitmaps
-
- // Increase the block count to ensure there are enough groups for all the
- // inodes.
- minBlocks := (inodes-1)/inodesPerGroup*dataBlocksPerGroup + 1
- if blocks < minBlocks {
- blocks = minBlocks
- }
-
- return (blocks + dataBlocksPerGroup - 1) / dataBlocksPerGroup
-}
-
-func bestGroupCount(blocks uint32, inodes uint32) (groups uint32, inodesPerGroup uint32) {
- groups = 0xffffffff
- for ipg := uint32(inodesPerGroupIncrement); ipg <= maxInodesPerGroup; ipg += inodesPerGroupIncrement {
- g := groupCount(blocks, inodes, ipg)
- if g < groups {
- groups = g
- inodesPerGroup = ipg
- }
- }
- return
-}
-
-func (w *Writer) Close() error {
- if err := w.finishInode(); err != nil {
- return err
- }
- root := w.root()
- if err := w.writeDirectoryRecursive(root, root); err != nil {
- return err
- }
- // Finish the last inode (probably a directory).
- if err := w.finishInode(); err != nil {
- return err
- }
-
- // Write the inode table
- inodeTableOffset := w.block()
- groups, inodesPerGroup := bestGroupCount(inodeTableOffset, uint32(len(w.inodes)))
- err := w.writeInodeTable(groups * inodesPerGroup * inodeSize)
- if err != nil {
- return err
- }
-
- // Write the bitmaps.
- bitmapOffset := w.block()
- bitmapSize := groups * 2
- validDataSize := bitmapOffset + bitmapSize
- diskSize := validDataSize
- minSize := (groups-1)*blocksPerGroup + 1
- if diskSize < minSize {
- diskSize = minSize
- }
-
- usedGdBlocks := (groups-1)/groupDescriptorSize + 1
- if usedGdBlocks > w.gdBlocks {
- return exceededMaxSizeError{w.maxDiskSize}
- }
-
- gds := make([]format.GroupDescriptor, w.gdBlocks*groupsPerDescriptorBlock)
- inodeTableSizePerGroup := inodesPerGroup * inodeSize / blockSize
- var totalUsedBlocks, totalUsedInodes uint32
- for g := uint32(0); g < groups; g++ {
- var b [blockSize * 2]byte
- var dirCount, usedInodeCount, usedBlockCount uint16
-
- // Block bitmap
- if (g+1)*blocksPerGroup <= validDataSize {
- // This group is fully allocated.
- for j := range b[:blockSize] {
- b[j] = 0xff
- }
- usedBlockCount = blocksPerGroup
- } else if g*blocksPerGroup < validDataSize {
- for j := uint32(0); j < validDataSize-g*blocksPerGroup; j++ {
- b[j/8] |= 1 << (j % 8)
- usedBlockCount++
- }
- }
- if g == 0 {
- // Unused group descriptor blocks should be cleared.
- for j := 1 + usedGdBlocks; j < 1+w.gdBlocks; j++ {
- b[j/8] &^= 1 << (j % 8)
- usedBlockCount--
- }
- }
- if g == groups-1 && diskSize%blocksPerGroup != 0 {
- // Blocks that aren't present in the disk should be marked as
- // allocated.
- for j := diskSize % blocksPerGroup; j < blocksPerGroup; j++ {
- b[j/8] |= 1 << (j % 8)
- usedBlockCount++
- }
- }
- // Inode bitmap
- for j := uint32(0); j < inodesPerGroup; j++ {
- ino := format.InodeNumber(1 + g*inodesPerGroup + j)
- inode := w.getInode(ino)
- if ino < inodeFirst || inode != nil {
- b[blockSize+j/8] |= 1 << (j % 8)
- usedInodeCount++
- }
- if inode != nil && inode.Mode&format.TypeMask == format.S_IFDIR {
- dirCount++
- }
- }
- _, err := w.write(b[:])
- if err != nil {
- return err
- }
- gds[g] = format.GroupDescriptor{
- BlockBitmapLow: bitmapOffset + 2*g,
- InodeBitmapLow: bitmapOffset + 2*g + 1,
- InodeTableLow: inodeTableOffset + g*inodeTableSizePerGroup,
- UsedDirsCountLow: dirCount,
- FreeInodesCountLow: uint16(inodesPerGroup) - usedInodeCount,
- FreeBlocksCountLow: blocksPerGroup - usedBlockCount,
- }
-
- totalUsedBlocks += uint32(usedBlockCount)
- totalUsedInodes += uint32(usedInodeCount)
- }
-
- // Zero up to the disk size.
- _, err = w.zero(int64(diskSize-bitmapOffset-bitmapSize) * blockSize)
- if err != nil {
- return err
- }
-
- // Write the block descriptors
- w.seekBlock(1)
- if w.err != nil {
- return w.err
- }
- err = binary.Write(w.bw, binary.LittleEndian, gds)
- if err != nil {
- return err
- }
-
- // Write the super block
- var blk [blockSize]byte
- b := bytes.NewBuffer(blk[:1024])
- sb := &format.SuperBlock{
- InodesCount: inodesPerGroup * groups,
- BlocksCountLow: diskSize,
- FreeBlocksCountLow: blocksPerGroup*groups - totalUsedBlocks,
- FreeInodesCount: inodesPerGroup*groups - totalUsedInodes,
- FirstDataBlock: 0,
- LogBlockSize: 2, // 2^(10 + 2)
- LogClusterSize: 2,
- BlocksPerGroup: blocksPerGroup,
- ClustersPerGroup: blocksPerGroup,
- InodesPerGroup: inodesPerGroup,
- Magic: format.SuperBlockMagic,
- State: 1, // cleanly unmounted
- Errors: 1, // continue on error?
- CreatorOS: 0, // Linux
- RevisionLevel: 1, // dynamic inode sizes
- FirstInode: inodeFirst,
- LpfInode: inodeLostAndFound,
- InodeSize: inodeSize,
- FeatureCompat: format.CompatSparseSuper2 | format.CompatExtAttr,
- FeatureIncompat: format.IncompatFiletype | format.IncompatExtents | format.IncompatFlexBg,
- FeatureRoCompat: format.RoCompatLargeFile | format.RoCompatHugeFile | format.RoCompatExtraIsize | format.RoCompatReadonly,
- MinExtraIsize: extraIsize,
- WantExtraIsize: extraIsize,
- LogGroupsPerFlex: 31,
- }
- if w.supportInlineData {
- sb.FeatureIncompat |= format.IncompatInlineData
- }
- binary.Write(b, binary.LittleEndian, sb)
- w.seekBlock(0)
- if _, err := w.write(blk[:]); err != nil {
- return err
- }
- w.seekBlock(diskSize)
- return w.err
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/ext4/internal/format/format.go b/vendor/github.com/Microsoft/hcsshim/ext4/internal/format/format.go
deleted file mode 100644
index 9dc4c4e16..000000000
--- a/vendor/github.com/Microsoft/hcsshim/ext4/internal/format/format.go
+++ /dev/null
@@ -1,411 +0,0 @@
-package format
-
-type SuperBlock struct {
- InodesCount uint32
- BlocksCountLow uint32
- RootBlocksCountLow uint32
- FreeBlocksCountLow uint32
- FreeInodesCount uint32
- FirstDataBlock uint32
- LogBlockSize uint32
- LogClusterSize uint32
- BlocksPerGroup uint32
- ClustersPerGroup uint32
- InodesPerGroup uint32
- Mtime uint32
- Wtime uint32
- MountCount uint16
- MaxMountCount uint16
- Magic uint16
- State uint16
- Errors uint16
- MinorRevisionLevel uint16
- LastCheck uint32
- CheckInterval uint32
- CreatorOS uint32
- RevisionLevel uint32
- DefaultReservedUid uint16
- DefaultReservedGid uint16
- FirstInode uint32
- InodeSize uint16
- BlockGroupNr uint16
- FeatureCompat CompatFeature
- FeatureIncompat IncompatFeature
- FeatureRoCompat RoCompatFeature
- UUID [16]uint8
- VolumeName [16]byte
- LastMounted [64]byte
- AlgorithmUsageBitmap uint32
- PreallocBlocks uint8
- PreallocDirBlocks uint8
- ReservedGdtBlocks uint16
- JournalUUID [16]uint8
- JournalInum uint32
- JournalDev uint32
- LastOrphan uint32
- HashSeed [4]uint32
- DefHashVersion uint8
- JournalBackupType uint8
- DescSize uint16
- DefaultMountOpts uint32
- FirstMetaBg uint32
- MkfsTime uint32
- JournalBlocks [17]uint32
- BlocksCountHigh uint32
- RBlocksCountHigh uint32
- FreeBlocksCountHigh uint32
- MinExtraIsize uint16
- WantExtraIsize uint16
- Flags uint32
- RaidStride uint16
- MmpInterval uint16
- MmpBlock uint64
- RaidStripeWidth uint32
- LogGroupsPerFlex uint8
- ChecksumType uint8
- ReservedPad uint16
- KbytesWritten uint64
- SnapshotInum uint32
- SnapshotID uint32
- SnapshotRBlocksCount uint64
- SnapshotList uint32
- ErrorCount uint32
- FirstErrorTime uint32
- FirstErrorInode uint32
- FirstErrorBlock uint64
- FirstErrorFunc [32]uint8
- FirstErrorLine uint32
- LastErrorTime uint32
- LastErrorInode uint32
- LastErrorLine uint32
- LastErrorBlock uint64
- LastErrorFunc [32]uint8
- MountOpts [64]uint8
- UserQuotaInum uint32
- GroupQuotaInum uint32
- OverheadBlocks uint32
- BackupBgs [2]uint32
- EncryptAlgos [4]uint8
- EncryptPwSalt [16]uint8
- LpfInode uint32
- ProjectQuotaInum uint32
- ChecksumSeed uint32
- WtimeHigh uint8
- MtimeHigh uint8
- MkfsTimeHigh uint8
- LastcheckHigh uint8
- FirstErrorTimeHigh uint8
- LastErrorTimeHigh uint8
- Pad [2]uint8
- Reserved [96]uint32
- Checksum uint32
-}
-
-const SuperBlockMagic uint16 = 0xef53
-
-type CompatFeature uint32
-type IncompatFeature uint32
-type RoCompatFeature uint32
-
-const (
- CompatDirPrealloc CompatFeature = 0x1
- CompatImagicInodes CompatFeature = 0x2
- CompatHasJournal CompatFeature = 0x4
- CompatExtAttr CompatFeature = 0x8
- CompatResizeInode CompatFeature = 0x10
- CompatDirIndex CompatFeature = 0x20
- CompatLazyBg CompatFeature = 0x40
- CompatExcludeInode CompatFeature = 0x80
- CompatExcludeBitmap CompatFeature = 0x100
- CompatSparseSuper2 CompatFeature = 0x200
-
- IncompatCompression IncompatFeature = 0x1
- IncompatFiletype IncompatFeature = 0x2
- IncompatRecover IncompatFeature = 0x4
- IncompatJournalDev IncompatFeature = 0x8
- IncompatMetaBg IncompatFeature = 0x10
- IncompatExtents IncompatFeature = 0x40
- Incompat_64Bit IncompatFeature = 0x80
- IncompatMmp IncompatFeature = 0x100
- IncompatFlexBg IncompatFeature = 0x200
- IncompatEaInode IncompatFeature = 0x400
- IncompatDirdata IncompatFeature = 0x1000
- IncompatCsumSeed IncompatFeature = 0x2000
- IncompatLargedir IncompatFeature = 0x4000
- IncompatInlineData IncompatFeature = 0x8000
- IncompatEncrypt IncompatFeature = 0x10000
-
- RoCompatSparseSuper RoCompatFeature = 0x1
- RoCompatLargeFile RoCompatFeature = 0x2
- RoCompatBtreeDir RoCompatFeature = 0x4
- RoCompatHugeFile RoCompatFeature = 0x8
- RoCompatGdtCsum RoCompatFeature = 0x10
- RoCompatDirNlink RoCompatFeature = 0x20
- RoCompatExtraIsize RoCompatFeature = 0x40
- RoCompatHasSnapshot RoCompatFeature = 0x80
- RoCompatQuota RoCompatFeature = 0x100
- RoCompatBigalloc RoCompatFeature = 0x200
- RoCompatMetadataCsum RoCompatFeature = 0x400
- RoCompatReplica RoCompatFeature = 0x800
- RoCompatReadonly RoCompatFeature = 0x1000
- RoCompatProject RoCompatFeature = 0x2000
-)
-
-type BlockGroupFlag uint16
-
-const (
- BlockGroupInodeUninit BlockGroupFlag = 0x1
- BlockGroupBlockUninit BlockGroupFlag = 0x2
- BlockGroupInodeZeroed BlockGroupFlag = 0x4
-)
-
-type GroupDescriptor struct {
- BlockBitmapLow uint32
- InodeBitmapLow uint32
- InodeTableLow uint32
- FreeBlocksCountLow uint16
- FreeInodesCountLow uint16
- UsedDirsCountLow uint16
- Flags BlockGroupFlag
- ExcludeBitmapLow uint32
- BlockBitmapCsumLow uint16
- InodeBitmapCsumLow uint16
- ItableUnusedLow uint16
- Checksum uint16
-}
-
-type GroupDescriptor64 struct {
- GroupDescriptor
- BlockBitmapHigh uint32
- InodeBitmapHigh uint32
- InodeTableHigh uint32
- FreeBlocksCountHigh uint16
- FreeInodesCountHigh uint16
- UsedDirsCountHigh uint16
- ItableUnusedHigh uint16
- ExcludeBitmapHigh uint32
- BlockBitmapCsumHigh uint16
- InodeBitmapCsumHigh uint16
- Reserved uint32
-}
-
-const (
- S_IXOTH = 0x1
- S_IWOTH = 0x2
- S_IROTH = 0x4
- S_IXGRP = 0x8
- S_IWGRP = 0x10
- S_IRGRP = 0x20
- S_IXUSR = 0x40
- S_IWUSR = 0x80
- S_IRUSR = 0x100
- S_ISVTX = 0x200
- S_ISGID = 0x400
- S_ISUID = 0x800
- S_IFIFO = 0x1000
- S_IFCHR = 0x2000
- S_IFDIR = 0x4000
- S_IFBLK = 0x6000
- S_IFREG = 0x8000
- S_IFLNK = 0xA000
- S_IFSOCK = 0xC000
-
- TypeMask uint16 = 0xF000
-)
-
-type InodeNumber uint32
-
-const (
- InodeRoot = 2
-)
-
-type Inode struct {
- Mode uint16
- Uid uint16
- SizeLow uint32
- Atime uint32
- Ctime uint32
- Mtime uint32
- Dtime uint32
- Gid uint16
- LinksCount uint16
- BlocksLow uint32
- Flags InodeFlag
- Version uint32
- Block [60]byte
- Generation uint32
- XattrBlockLow uint32
- SizeHigh uint32
- ObsoleteFragmentAddr uint32
- BlocksHigh uint16
- XattrBlockHigh uint16
- UidHigh uint16
- GidHigh uint16
- ChecksumLow uint16
- Reserved uint16
- ExtraIsize uint16
- ChecksumHigh uint16
- CtimeExtra uint32
- MtimeExtra uint32
- AtimeExtra uint32
- Crtime uint32
- CrtimeExtra uint32
- VersionHigh uint32
- Projid uint32
-}
-
-type InodeFlag uint32
-
-const (
- InodeFlagSecRm InodeFlag = 0x1
- InodeFlagUnRm InodeFlag = 0x2
- InodeFlagCompressed InodeFlag = 0x4
- InodeFlagSync InodeFlag = 0x8
- InodeFlagImmutable InodeFlag = 0x10
- InodeFlagAppend InodeFlag = 0x20
- InodeFlagNoDump InodeFlag = 0x40
- InodeFlagNoAtime InodeFlag = 0x80
- InodeFlagDirtyCompressed InodeFlag = 0x100
- InodeFlagCompressedClusters InodeFlag = 0x200
- InodeFlagNoCompress InodeFlag = 0x400
- InodeFlagEncrypted InodeFlag = 0x800
- InodeFlagHashedIndex InodeFlag = 0x1000
- InodeFlagMagic InodeFlag = 0x2000
- InodeFlagJournalData InodeFlag = 0x4000
- InodeFlagNoTail InodeFlag = 0x8000
- InodeFlagDirSync InodeFlag = 0x10000
- InodeFlagTopDir InodeFlag = 0x20000
- InodeFlagHugeFile InodeFlag = 0x40000
- InodeFlagExtents InodeFlag = 0x80000
- InodeFlagEaInode InodeFlag = 0x200000
- InodeFlagEOFBlocks InodeFlag = 0x400000
- InodeFlagSnapfile InodeFlag = 0x01000000
- InodeFlagSnapfileDeleted InodeFlag = 0x04000000
- InodeFlagSnapfileShrunk InodeFlag = 0x08000000
- InodeFlagInlineData InodeFlag = 0x10000000
- InodeFlagProjectIDInherit InodeFlag = 0x20000000
- InodeFlagReserved InodeFlag = 0x80000000
-)
-
-const (
- MaxLinks = 65000
-)
-
-type ExtentHeader struct {
- Magic uint16
- Entries uint16
- Max uint16
- Depth uint16
- Generation uint32
-}
-
-const ExtentHeaderMagic uint16 = 0xf30a
-
-type ExtentIndexNode struct {
- Block uint32
- LeafLow uint32
- LeafHigh uint16
- Unused uint16
-}
-
-type ExtentLeafNode struct {
- Block uint32
- Length uint16
- StartHigh uint16
- StartLow uint32
-}
-
-type ExtentTail struct {
- Checksum uint32
-}
-
-type DirectoryEntry struct {
- Inode InodeNumber
- RecordLength uint16
- NameLength uint8
- FileType FileType
- //Name []byte
-}
-
-type FileType uint8
-
-const (
- FileTypeUnknown FileType = 0x0
- FileTypeRegular FileType = 0x1
- FileTypeDirectory FileType = 0x2
- FileTypeCharacter FileType = 0x3
- FileTypeBlock FileType = 0x4
- FileTypeFIFO FileType = 0x5
- FileTypeSocket FileType = 0x6
- FileTypeSymbolicLink FileType = 0x7
-)
-
-type DirectoryEntryTail struct {
- ReservedZero1 uint32
- RecordLength uint16
- ReservedZero2 uint8
- FileType uint8
- Checksum uint32
-}
-
-type DirectoryTreeRoot struct {
- Dot DirectoryEntry
- DotName [4]byte
- DotDot DirectoryEntry
- DotDotName [4]byte
- ReservedZero uint32
- HashVersion uint8
- InfoLength uint8
- IndirectLevels uint8
- UnusedFlags uint8
- Limit uint16
- Count uint16
- Block uint32
- //Entries []DirectoryTreeEntry
-}
-
-type DirectoryTreeNode struct {
- FakeInode uint32
- FakeRecordLength uint16
- NameLength uint8
- FileType uint8
- Limit uint16
- Count uint16
- Block uint32
- //Entries []DirectoryTreeEntry
-}
-
-type DirectoryTreeEntry struct {
- Hash uint32
- Block uint32
-}
-
-type DirectoryTreeTail struct {
- Reserved uint32
- Checksum uint32
-}
-
-type XAttrInodeBodyHeader struct {
- Magic uint32
-}
-
-type XAttrHeader struct {
- Magic uint32
- ReferenceCount uint32
- Blocks uint32
- Hash uint32
- Checksum uint32
- Reserved [3]uint32
-}
-
-const XAttrHeaderMagic uint32 = 0xea020000
-
-type XAttrEntry struct {
- NameLength uint8
- NameIndex uint8
- ValueOffset uint16
- ValueInum uint32
- ValueSize uint32
- Hash uint32
- //Name []byte
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/ext4/tar2ext4/tar2ext4.go b/vendor/github.com/Microsoft/hcsshim/ext4/tar2ext4/tar2ext4.go
deleted file mode 100644
index ad0921046..000000000
--- a/vendor/github.com/Microsoft/hcsshim/ext4/tar2ext4/tar2ext4.go
+++ /dev/null
@@ -1,174 +0,0 @@
-package tar2ext4
-
-import (
- "archive/tar"
- "bufio"
- "encoding/binary"
- "io"
- "path"
- "strings"
-
- "github.com/Microsoft/hcsshim/ext4/internal/compactext4"
-)
-
-type params struct {
- convertWhiteout bool
- appendVhdFooter bool
- ext4opts []compactext4.Option
-}
-
-// Option is the type for optional parameters to Convert.
-type Option func(*params)
-
-// ConvertWhiteout instructs the converter to convert OCI-style whiteouts
-// (beginning with .wh.) to overlay-style whiteouts.
-func ConvertWhiteout(p *params) {
- p.convertWhiteout = true
-}
-
-// AppendVhdFooter instructs the converter to add a fixed VHD footer to the
-// file.
-func AppendVhdFooter(p *params) {
- p.appendVhdFooter = true
-}
-
-// InlineData instructs the converter to write small files into the inode
-// structures directly. This creates smaller images but currently is not
-// compatible with DAX.
-func InlineData(p *params) {
- p.ext4opts = append(p.ext4opts, compactext4.InlineData)
-}
-
-// MaximumDiskSize instructs the writer to limit the disk size to the specified
-// value. This also reserves enough metadata space for the specified disk size.
-// If not provided, then 16GB is the default.
-func MaximumDiskSize(size int64) Option {
- return func(p *params) {
- p.ext4opts = append(p.ext4opts, compactext4.MaximumDiskSize(size))
- }
-}
-
-const (
- whiteoutPrefix = ".wh."
- opaqueWhiteout = ".wh..wh..opq"
-)
-
-// Convert writes a compact ext4 file system image that contains the files in the
-// input tar stream.
-func Convert(r io.Reader, w io.ReadWriteSeeker, options ...Option) error {
- var p params
- for _, opt := range options {
- opt(&p)
- }
- t := tar.NewReader(bufio.NewReader(r))
- fs := compactext4.NewWriter(w, p.ext4opts...)
- for {
- hdr, err := t.Next()
- if err == io.EOF {
- break
- }
- if err != nil {
- return err
- }
-
- if p.convertWhiteout {
- dir, name := path.Split(hdr.Name)
- if strings.HasPrefix(name, whiteoutPrefix) {
- if name == opaqueWhiteout {
- // Update the directory with the appropriate xattr.
- f, err := fs.Stat(dir)
- if err != nil {
- return err
- }
- f.Xattrs["trusted.overlay.opaque"] = []byte("y")
- err = fs.Create(dir, f)
- if err != nil {
- return err
- }
- } else {
- // Create an overlay-style whiteout.
- f := &compactext4.File{
- Mode: compactext4.S_IFCHR,
- Devmajor: 0,
- Devminor: 0,
- }
- err = fs.Create(path.Join(dir, name[len(whiteoutPrefix):]), f)
- if err != nil {
- return err
- }
- }
-
- continue
- }
- }
-
- if hdr.Typeflag == tar.TypeLink {
- err = fs.Link(hdr.Linkname, hdr.Name)
- if err != nil {
- return err
- }
- } else {
- f := &compactext4.File{
- Mode: uint16(hdr.Mode),
- Atime: hdr.AccessTime,
- Mtime: hdr.ModTime,
- Ctime: hdr.ChangeTime,
- Crtime: hdr.ModTime,
- Size: hdr.Size,
- Uid: uint32(hdr.Uid),
- Gid: uint32(hdr.Gid),
- Linkname: hdr.Linkname,
- Devmajor: uint32(hdr.Devmajor),
- Devminor: uint32(hdr.Devminor),
- Xattrs: make(map[string][]byte),
- }
- for key, value := range hdr.PAXRecords {
- const xattrPrefix = "SCHILY.xattr."
- if strings.HasPrefix(key, xattrPrefix) {
- f.Xattrs[key[len(xattrPrefix):]] = []byte(value)
- }
- }
-
- var typ uint16
- switch hdr.Typeflag {
- case tar.TypeReg, tar.TypeRegA:
- typ = compactext4.S_IFREG
- case tar.TypeSymlink:
- typ = compactext4.S_IFLNK
- case tar.TypeChar:
- typ = compactext4.S_IFCHR
- case tar.TypeBlock:
- typ = compactext4.S_IFBLK
- case tar.TypeDir:
- typ = compactext4.S_IFDIR
- case tar.TypeFifo:
- typ = compactext4.S_IFIFO
- }
- f.Mode &= ^compactext4.TypeMask
- f.Mode |= typ
- err = fs.Create(hdr.Name, f)
- if err != nil {
- return err
- }
- _, err = io.Copy(fs, t)
- if err != nil {
- return err
- }
- }
- }
- err := fs.Close()
- if err != nil {
- return err
- }
- if p.appendVhdFooter {
- size, err := w.Seek(0, io.SeekEnd)
- if err != nil {
- return err
- }
- err = binary.Write(w, binary.BigEndian, makeFixedVHDFooter(size))
- if err != nil {
- return err
- }
- }
- return nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/ext4/tar2ext4/vhdfooter.go b/vendor/github.com/Microsoft/hcsshim/ext4/tar2ext4/vhdfooter.go
deleted file mode 100644
index c98740302..000000000
--- a/vendor/github.com/Microsoft/hcsshim/ext4/tar2ext4/vhdfooter.go
+++ /dev/null
@@ -1,76 +0,0 @@
-package tar2ext4
-
-import (
- "bytes"
- "crypto/rand"
- "encoding/binary"
-)
-
-// Constants for the VHD footer
-const (
- cookieMagic = "conectix"
- featureMask = 0x2
- fileFormatVersionMagic = 0x00010000
- fixedDataOffset = -1
- creatorVersionMagic = 0x000a0000
- diskTypeFixed = 2
-)
-
-type vhdFooter struct {
- Cookie [8]byte
- Features uint32
- FileFormatVersion uint32
- DataOffset int64
- TimeStamp uint32
- CreatorApplication [4]byte
- CreatorVersion uint32
- CreatorHostOS [4]byte
- OriginalSize int64
- CurrentSize int64
- DiskGeometry uint32
- DiskType uint32
- Checksum uint32
- UniqueID [16]uint8
- SavedState uint8
- Reserved [427]uint8
-}
-
-func makeFixedVHDFooter(size int64) *vhdFooter {
- footer := &vhdFooter{
- Features: featureMask,
- FileFormatVersion: fileFormatVersionMagic,
- DataOffset: fixedDataOffset,
- CreatorVersion: creatorVersionMagic,
- OriginalSize: size,
- CurrentSize: size,
- DiskType: diskTypeFixed,
- UniqueID: generateUUID(),
- }
- copy(footer.Cookie[:], cookieMagic)
- footer.Checksum = calculateCheckSum(footer)
- return footer
-}
-
-func calculateCheckSum(footer *vhdFooter) uint32 {
- oldchk := footer.Checksum
- footer.Checksum = 0
-
- buf := &bytes.Buffer{}
- binary.Write(buf, binary.BigEndian, footer)
-
- var chk uint32
- bufBytes := buf.Bytes()
- for i := 0; i < len(bufBytes); i++ {
- chk += uint32(bufBytes[i])
- }
- footer.Checksum = oldchk
- return uint32(^chk)
-}
-
-func generateUUID() [16]byte {
- res := [16]byte{}
- if _, err := rand.Read(res[:]); err != nil {
- panic(err)
- }
- return res
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/go.mod b/vendor/github.com/Microsoft/hcsshim/go.mod
deleted file mode 100644
index 5255b93f1..000000000
--- a/vendor/github.com/Microsoft/hcsshim/go.mod
+++ /dev/null
@@ -1,35 +0,0 @@
-module github.com/Microsoft/hcsshim
-
-go 1.13
-
-require (
- github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5
- github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f
- github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1
- github.com/containerd/containerd v1.3.2
- github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc // indirect
- github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448 // indirect
- github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3
- github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de
- github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd
- github.com/gogo/protobuf v1.3.1
- github.com/golang/protobuf v1.3.2 // indirect
- github.com/kr/pretty v0.1.0 // indirect
- github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2 // indirect
- github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f // indirect
- github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700
- github.com/pkg/errors v0.8.1
- github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7 // indirect
- github.com/sirupsen/logrus v1.4.2
- github.com/stretchr/testify v1.4.0 // indirect
- github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5
- go.opencensus.io v0.22.0
- golang.org/x/net v0.0.0-20191004110552-13f9640d40b9 // indirect
- golang.org/x/sync v0.0.0-20190423024810-112230192c58
- golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3
- google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873 // indirect
- google.golang.org/grpc v1.23.1
- gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
- gopkg.in/yaml.v2 v2.2.8 // indirect
- gotest.tools v2.2.0+incompatible // indirect
-)
diff --git a/vendor/github.com/Microsoft/hcsshim/hcn/hcn.go b/vendor/github.com/Microsoft/hcsshim/hcn/hcn.go
deleted file mode 100644
index 810dd85ed..000000000
--- a/vendor/github.com/Microsoft/hcsshim/hcn/hcn.go
+++ /dev/null
@@ -1,223 +0,0 @@
-// Package hcn is a shim for the Host Compute Networking (HCN) service, which manages networking for Windows Server
-// containers and Hyper-V containers. Previous to RS5, HCN was referred to as Host Networking Service (HNS).
-package hcn
-
-import (
- "encoding/json"
- "fmt"
- "syscall"
-
- "github.com/Microsoft/go-winio/pkg/guid"
-)
-
-//go:generate go run ../mksyscall_windows.go -output zsyscall_windows.go hcn.go
-
-/// HNS V1 API
-
-//sys SetCurrentThreadCompartmentId(compartmentId uint32) (hr error) = iphlpapi.SetCurrentThreadCompartmentId
-//sys _hnsCall(method string, path string, object string, response **uint16) (hr error) = vmcompute.HNSCall?
-
-/// HCN V2 API
-
-// Network
-//sys hcnEnumerateNetworks(query string, networks **uint16, result **uint16) (hr error) = computenetwork.HcnEnumerateNetworks?
-//sys hcnCreateNetwork(id *_guid, settings string, network *hcnNetwork, result **uint16) (hr error) = computenetwork.HcnCreateNetwork?
-//sys hcnOpenNetwork(id *_guid, network *hcnNetwork, result **uint16) (hr error) = computenetwork.HcnOpenNetwork?
-//sys hcnModifyNetwork(network hcnNetwork, settings string, result **uint16) (hr error) = computenetwork.HcnModifyNetwork?
-//sys hcnQueryNetworkProperties(network hcnNetwork, query string, properties **uint16, result **uint16) (hr error) = computenetwork.HcnQueryNetworkProperties?
-//sys hcnDeleteNetwork(id *_guid, result **uint16) (hr error) = computenetwork.HcnDeleteNetwork?
-//sys hcnCloseNetwork(network hcnNetwork) (hr error) = computenetwork.HcnCloseNetwork?
-
-// Endpoint
-//sys hcnEnumerateEndpoints(query string, endpoints **uint16, result **uint16) (hr error) = computenetwork.HcnEnumerateEndpoints?
-//sys hcnCreateEndpoint(network hcnNetwork, id *_guid, settings string, endpoint *hcnEndpoint, result **uint16) (hr error) = computenetwork.HcnCreateEndpoint?
-//sys hcnOpenEndpoint(id *_guid, endpoint *hcnEndpoint, result **uint16) (hr error) = computenetwork.HcnOpenEndpoint?
-//sys hcnModifyEndpoint(endpoint hcnEndpoint, settings string, result **uint16) (hr error) = computenetwork.HcnModifyEndpoint?
-//sys hcnQueryEndpointProperties(endpoint hcnEndpoint, query string, properties **uint16, result **uint16) (hr error) = computenetwork.HcnQueryEndpointProperties?
-//sys hcnDeleteEndpoint(id *_guid, result **uint16) (hr error) = computenetwork.HcnDeleteEndpoint?
-//sys hcnCloseEndpoint(endpoint hcnEndpoint) (hr error) = computenetwork.HcnCloseEndpoint?
-
-// Namespace
-//sys hcnEnumerateNamespaces(query string, namespaces **uint16, result **uint16) (hr error) = computenetwork.HcnEnumerateNamespaces?
-//sys hcnCreateNamespace(id *_guid, settings string, namespace *hcnNamespace, result **uint16) (hr error) = computenetwork.HcnCreateNamespace?
-//sys hcnOpenNamespace(id *_guid, namespace *hcnNamespace, result **uint16) (hr error) = computenetwork.HcnOpenNamespace?
-//sys hcnModifyNamespace(namespace hcnNamespace, settings string, result **uint16) (hr error) = computenetwork.HcnModifyNamespace?
-//sys hcnQueryNamespaceProperties(namespace hcnNamespace, query string, properties **uint16, result **uint16) (hr error) = computenetwork.HcnQueryNamespaceProperties?
-//sys hcnDeleteNamespace(id *_guid, result **uint16) (hr error) = computenetwork.HcnDeleteNamespace?
-//sys hcnCloseNamespace(namespace hcnNamespace) (hr error) = computenetwork.HcnCloseNamespace?
-
-// LoadBalancer
-//sys hcnEnumerateLoadBalancers(query string, loadBalancers **uint16, result **uint16) (hr error) = computenetwork.HcnEnumerateLoadBalancers?
-//sys hcnCreateLoadBalancer(id *_guid, settings string, loadBalancer *hcnLoadBalancer, result **uint16) (hr error) = computenetwork.HcnCreateLoadBalancer?
-//sys hcnOpenLoadBalancer(id *_guid, loadBalancer *hcnLoadBalancer, result **uint16) (hr error) = computenetwork.HcnOpenLoadBalancer?
-//sys hcnModifyLoadBalancer(loadBalancer hcnLoadBalancer, settings string, result **uint16) (hr error) = computenetwork.HcnModifyLoadBalancer?
-//sys hcnQueryLoadBalancerProperties(loadBalancer hcnLoadBalancer, query string, properties **uint16, result **uint16) (hr error) = computenetwork.HcnQueryLoadBalancerProperties?
-//sys hcnDeleteLoadBalancer(id *_guid, result **uint16) (hr error) = computenetwork.HcnDeleteLoadBalancer?
-//sys hcnCloseLoadBalancer(loadBalancer hcnLoadBalancer) (hr error) = computenetwork.HcnCloseLoadBalancer?
-
-// SDN Routes
-//sys hcnEnumerateRoutes(query string, routes **uint16, result **uint16) (hr error) = computenetwork.HcnEnumerateSdnRoutes?
-//sys hcnCreateRoute(id *_guid, settings string, route *hcnRoute, result **uint16) (hr error) = computenetwork.HcnCreateSdnRoute?
-//sys hcnOpenRoute(id *_guid, route *hcnRoute, result **uint16) (hr error) = computenetwork.HcnOpenSdnRoute?
-//sys hcnModifyRoute(route hcnRoute, settings string, result **uint16) (hr error) = computenetwork.HcnModifySdnRoute?
-//sys hcnQueryRouteProperties(route hcnRoute, query string, properties **uint16, result **uint16) (hr error) = computenetwork.HcnQuerySdnRouteProperties?
-//sys hcnDeleteRoute(id *_guid, result **uint16) (hr error) = computenetwork.HcnDeleteSdnRoute?
-//sys hcnCloseRoute(route hcnRoute) (hr error) = computenetwork.HcnCloseSdnRoute?
-
-// Service
-//sys hcnOpenService(service *hcnService, result **uint16) (hr error) = computenetwork.HcnOpenService?
-//sys hcnRegisterServiceCallback(service hcnService, callback int32, context int32, callbackHandle *hcnCallbackHandle) (hr error) = computenetwork.HcnRegisterServiceCallback?
-//sys hcnUnregisterServiceCallback(callbackHandle hcnCallbackHandle) (hr error) = computenetwork.HcnUnregisterServiceCallback?
-//sys hcnCloseService(service hcnService) (hr error) = computenetwork.HcnCloseService?
-
-type _guid = guid.GUID
-
-type hcnNetwork syscall.Handle
-type hcnEndpoint syscall.Handle
-type hcnNamespace syscall.Handle
-type hcnLoadBalancer syscall.Handle
-type hcnRoute syscall.Handle
-type hcnService syscall.Handle
-type hcnCallbackHandle syscall.Handle
-
-// SchemaVersion for HCN Objects/Queries.
-type SchemaVersion = Version // hcnglobals.go
-
-// HostComputeQueryFlags are passed in to a HostComputeQuery to determine which
-// properties of an object are returned.
-type HostComputeQueryFlags uint32
-
-var (
- // HostComputeQueryFlagsNone returns an object with the standard properties.
- HostComputeQueryFlagsNone HostComputeQueryFlags
- // HostComputeQueryFlagsDetailed returns an object with all properties.
- HostComputeQueryFlagsDetailed HostComputeQueryFlags = 1
-)
-
-// HostComputeQuery is the format for HCN queries.
-type HostComputeQuery struct {
- SchemaVersion SchemaVersion `json:""`
- Flags HostComputeQueryFlags `json:",omitempty"`
- Filter string `json:",omitempty"`
-}
-
-// defaultQuery generates HCN Query.
-// Passed into get/enumerate calls to filter results.
-func defaultQuery() HostComputeQuery {
- query := HostComputeQuery{
- SchemaVersion: SchemaVersion{
- Major: 2,
- Minor: 0,
- },
- Flags: HostComputeQueryFlagsNone,
- }
- return query
-}
-
-func defaultQueryJson() string {
- query := defaultQuery()
- queryJson, err := json.Marshal(query)
- if err != nil {
- return ""
- }
- return string(queryJson)
-}
-
-// PlatformDoesNotSupportError happens when users are attempting to use a newer shim on an older OS
-func platformDoesNotSupportError(featureName string) error {
- return fmt.Errorf("Platform does not support feature %s", featureName)
-}
-
-// V2ApiSupported returns an error if the HCN version does not support the V2 Apis.
-func V2ApiSupported() error {
- supported := GetSupportedFeatures()
- if supported.Api.V2 {
- return nil
- }
- return platformDoesNotSupportError("V2 Api/Schema")
-}
-
-func V2SchemaVersion() SchemaVersion {
- return SchemaVersion{
- Major: 2,
- Minor: 0,
- }
-}
-
-// RemoteSubnetSupported returns an error if the HCN version does not support Remote Subnet policies.
-func RemoteSubnetSupported() error {
- supported := GetSupportedFeatures()
- if supported.RemoteSubnet {
- return nil
- }
- return platformDoesNotSupportError("Remote Subnet")
-}
-
-// HostRouteSupported returns an error if the HCN version does not support Host Route policies.
-func HostRouteSupported() error {
- supported := GetSupportedFeatures()
- if supported.HostRoute {
- return nil
- }
- return platformDoesNotSupportError("Host Route")
-}
-
-// DSRSupported returns an error if the HCN version does not support Direct Server Return.
-func DSRSupported() error {
- supported := GetSupportedFeatures()
- if supported.DSR {
- return nil
- }
- return platformDoesNotSupportError("Direct Server Return (DSR)")
-}
-
-// Slash32EndpointPrefixesSupported returns an error if the HCN version does not support configuring endpoints with /32 prefixes.
-func Slash32EndpointPrefixesSupported() error {
- supported := GetSupportedFeatures()
- if supported.Slash32EndpointPrefixes {
- return nil
- }
- return platformDoesNotSupportError("Slash 32 Endpoint prefixes")
-}
-
-// AclSupportForProtocol252Supported returns an error if the HCN version does not support HNS ACL Policies to support protocol 252 for VXLAN.
-func AclSupportForProtocol252Supported() error {
- supported := GetSupportedFeatures()
- if supported.AclSupportForProtocol252 {
- return nil
- }
- return platformDoesNotSupportError("HNS ACL Policies to support protocol 252 for VXLAN")
-}
-
-// SessionAffinitySupported returns an error if the HCN version does not support Session Affinity.
-func SessionAffinitySupported() error {
- supported := GetSupportedFeatures()
- if supported.SessionAffinity {
- return nil
- }
- return platformDoesNotSupportError("Session Affinity")
-}
-
-// IPv6DualStackSupported returns an error if the HCN version does not support IPv6DualStack.
-func IPv6DualStackSupported() error {
- supported := GetSupportedFeatures()
- if supported.IPv6DualStack {
- return nil
- }
- return platformDoesNotSupportError("IPv6 DualStack")
-}
-
-// RequestType are the different operations performed to settings.
-// Used to update the settings of Endpoint/Namespace objects.
-type RequestType string
-
-var (
- // RequestTypeAdd adds the provided settings object.
- RequestTypeAdd RequestType = "Add"
- // RequestTypeRemove removes the provided settings object.
- RequestTypeRemove RequestType = "Remove"
- // RequestTypeUpdate replaces settings with the ones provided.
- RequestTypeUpdate RequestType = "Update"
- // RequestTypeRefresh refreshes the settings provided.
- RequestTypeRefresh RequestType = "Refresh"
-)
diff --git a/vendor/github.com/Microsoft/hcsshim/hcn/hcnendpoint.go b/vendor/github.com/Microsoft/hcsshim/hcn/hcnendpoint.go
deleted file mode 100644
index e02146f8c..000000000
--- a/vendor/github.com/Microsoft/hcsshim/hcn/hcnendpoint.go
+++ /dev/null
@@ -1,380 +0,0 @@
-package hcn
-
-import (
- "encoding/json"
- "errors"
-
- "github.com/Microsoft/go-winio/pkg/guid"
- "github.com/Microsoft/hcsshim/internal/interop"
- "github.com/sirupsen/logrus"
-)
-
-// IpConfig is assoicated with an endpoint
-type IpConfig struct {
- IpAddress string `json:",omitempty"`
- PrefixLength uint8 `json:",omitempty"`
-}
-
-// EndpointFlags are special settings on an endpoint.
-type EndpointFlags uint32
-
-var (
- // EndpointFlagsNone is the default.
- EndpointFlagsNone EndpointFlags
- // EndpointFlagsRemoteEndpoint means that an endpoint is on another host.
- EndpointFlagsRemoteEndpoint EndpointFlags = 1
-)
-
-// HostComputeEndpoint represents a network endpoint
-type HostComputeEndpoint struct {
- Id string `json:"ID,omitempty"`
- Name string `json:",omitempty"`
- HostComputeNetwork string `json:",omitempty"` // GUID
- HostComputeNamespace string `json:",omitempty"` // GUID
- Policies []EndpointPolicy `json:",omitempty"`
- IpConfigurations []IpConfig `json:",omitempty"`
- Dns Dns `json:",omitempty"`
- Routes []Route `json:",omitempty"`
- MacAddress string `json:",omitempty"`
- Flags EndpointFlags `json:",omitempty"`
- SchemaVersion SchemaVersion `json:",omitempty"`
-}
-
-// EndpointResourceType are the two different Endpoint settings resources.
-type EndpointResourceType string
-
-var (
- // EndpointResourceTypePolicy is for Endpoint Policies. Ex: ACL, NAT
- EndpointResourceTypePolicy EndpointResourceType = "Policy"
- // EndpointResourceTypePort is for Endpoint Port settings.
- EndpointResourceTypePort EndpointResourceType = "Port"
-)
-
-// ModifyEndpointSettingRequest is the structure used to send request to modify an endpoint.
-// Used to update policy/port on an endpoint.
-type ModifyEndpointSettingRequest struct {
- ResourceType EndpointResourceType `json:",omitempty"` // Policy, Port
- RequestType RequestType `json:",omitempty"` // Add, Remove, Update, Refresh
- Settings json.RawMessage `json:",omitempty"`
-}
-
-type PolicyEndpointRequest struct {
- Policies []EndpointPolicy `json:",omitempty"`
-}
-
-func getEndpoint(endpointGuid guid.GUID, query string) (*HostComputeEndpoint, error) {
- // Open endpoint.
- var (
- endpointHandle hcnEndpoint
- resultBuffer *uint16
- propertiesBuffer *uint16
- )
- hr := hcnOpenEndpoint(&endpointGuid, &endpointHandle, &resultBuffer)
- if err := checkForErrors("hcnOpenEndpoint", hr, resultBuffer); err != nil {
- return nil, err
- }
- // Query endpoint.
- hr = hcnQueryEndpointProperties(endpointHandle, query, &propertiesBuffer, &resultBuffer)
- if err := checkForErrors("hcnQueryEndpointProperties", hr, resultBuffer); err != nil {
- return nil, err
- }
- properties := interop.ConvertAndFreeCoTaskMemString(propertiesBuffer)
- // Close endpoint.
- hr = hcnCloseEndpoint(endpointHandle)
- if err := checkForErrors("hcnCloseEndpoint", hr, nil); err != nil {
- return nil, err
- }
- // Convert output to HostComputeEndpoint
- var outputEndpoint HostComputeEndpoint
- if err := json.Unmarshal([]byte(properties), &outputEndpoint); err != nil {
- return nil, err
- }
- return &outputEndpoint, nil
-}
-
-func enumerateEndpoints(query string) ([]HostComputeEndpoint, error) {
- // Enumerate all Endpoint Guids
- var (
- resultBuffer *uint16
- endpointBuffer *uint16
- )
- hr := hcnEnumerateEndpoints(query, &endpointBuffer, &resultBuffer)
- if err := checkForErrors("hcnEnumerateEndpoints", hr, resultBuffer); err != nil {
- return nil, err
- }
-
- endpoints := interop.ConvertAndFreeCoTaskMemString(endpointBuffer)
- var endpointIds []guid.GUID
- err := json.Unmarshal([]byte(endpoints), &endpointIds)
- if err != nil {
- return nil, err
- }
-
- var outputEndpoints []HostComputeEndpoint
- for _, endpointGuid := range endpointIds {
- endpoint, err := getEndpoint(endpointGuid, query)
- if err != nil {
- return nil, err
- }
- outputEndpoints = append(outputEndpoints, *endpoint)
- }
- return outputEndpoints, nil
-}
-
-func createEndpoint(networkId string, endpointSettings string) (*HostComputeEndpoint, error) {
- networkGuid, err := guid.FromString(networkId)
- if err != nil {
- return nil, errInvalidNetworkID
- }
- // Open network.
- var networkHandle hcnNetwork
- var resultBuffer *uint16
- hr := hcnOpenNetwork(&networkGuid, &networkHandle, &resultBuffer)
- if err := checkForErrors("hcnOpenNetwork", hr, resultBuffer); err != nil {
- return nil, err
- }
- // Create endpoint.
- endpointId := guid.GUID{}
- var endpointHandle hcnEndpoint
- hr = hcnCreateEndpoint(networkHandle, &endpointId, endpointSettings, &endpointHandle, &resultBuffer)
- if err := checkForErrors("hcnCreateEndpoint", hr, resultBuffer); err != nil {
- return nil, err
- }
- // Query endpoint.
- hcnQuery := defaultQuery()
- query, err := json.Marshal(hcnQuery)
- if err != nil {
- return nil, err
- }
- var propertiesBuffer *uint16
- hr = hcnQueryEndpointProperties(endpointHandle, string(query), &propertiesBuffer, &resultBuffer)
- if err := checkForErrors("hcnQueryEndpointProperties", hr, resultBuffer); err != nil {
- return nil, err
- }
- properties := interop.ConvertAndFreeCoTaskMemString(propertiesBuffer)
- // Close endpoint.
- hr = hcnCloseEndpoint(endpointHandle)
- if err := checkForErrors("hcnCloseEndpoint", hr, nil); err != nil {
- return nil, err
- }
- // Close network.
- hr = hcnCloseNetwork(networkHandle)
- if err := checkForErrors("hcnCloseNetwork", hr, nil); err != nil {
- return nil, err
- }
- // Convert output to HostComputeEndpoint
- var outputEndpoint HostComputeEndpoint
- if err := json.Unmarshal([]byte(properties), &outputEndpoint); err != nil {
- return nil, err
- }
- return &outputEndpoint, nil
-}
-
-func modifyEndpoint(endpointId string, settings string) (*HostComputeEndpoint, error) {
- endpointGuid, err := guid.FromString(endpointId)
- if err != nil {
- return nil, errInvalidEndpointID
- }
- // Open endpoint
- var (
- endpointHandle hcnEndpoint
- resultBuffer *uint16
- propertiesBuffer *uint16
- )
- hr := hcnOpenEndpoint(&endpointGuid, &endpointHandle, &resultBuffer)
- if err := checkForErrors("hcnOpenEndpoint", hr, resultBuffer); err != nil {
- return nil, err
- }
- // Modify endpoint
- hr = hcnModifyEndpoint(endpointHandle, settings, &resultBuffer)
- if err := checkForErrors("hcnModifyEndpoint", hr, resultBuffer); err != nil {
- return nil, err
- }
- // Query endpoint.
- hcnQuery := defaultQuery()
- query, err := json.Marshal(hcnQuery)
- if err != nil {
- return nil, err
- }
- hr = hcnQueryEndpointProperties(endpointHandle, string(query), &propertiesBuffer, &resultBuffer)
- if err := checkForErrors("hcnQueryEndpointProperties", hr, resultBuffer); err != nil {
- return nil, err
- }
- properties := interop.ConvertAndFreeCoTaskMemString(propertiesBuffer)
- // Close endpoint.
- hr = hcnCloseEndpoint(endpointHandle)
- if err := checkForErrors("hcnCloseEndpoint", hr, nil); err != nil {
- return nil, err
- }
- // Convert output to HostComputeEndpoint
- var outputEndpoint HostComputeEndpoint
- if err := json.Unmarshal([]byte(properties), &outputEndpoint); err != nil {
- return nil, err
- }
- return &outputEndpoint, nil
-}
-
-func deleteEndpoint(endpointId string) error {
- endpointGuid, err := guid.FromString(endpointId)
- if err != nil {
- return errInvalidEndpointID
- }
- var resultBuffer *uint16
- hr := hcnDeleteEndpoint(&endpointGuid, &resultBuffer)
- if err := checkForErrors("hcnDeleteEndpoint", hr, resultBuffer); err != nil {
- return err
- }
- return nil
-}
-
-// ListEndpoints makes a call to list all available endpoints.
-func ListEndpoints() ([]HostComputeEndpoint, error) {
- hcnQuery := defaultQuery()
- endpoints, err := ListEndpointsQuery(hcnQuery)
- if err != nil {
- return nil, err
- }
- return endpoints, nil
-}
-
-// ListEndpointsQuery makes a call to query the list of available endpoints.
-func ListEndpointsQuery(query HostComputeQuery) ([]HostComputeEndpoint, error) {
- queryJson, err := json.Marshal(query)
- if err != nil {
- return nil, err
- }
-
- endpoints, err := enumerateEndpoints(string(queryJson))
- if err != nil {
- return nil, err
- }
- return endpoints, nil
-}
-
-// ListEndpointsOfNetwork queries the list of endpoints on a network.
-func ListEndpointsOfNetwork(networkId string) ([]HostComputeEndpoint, error) {
- hcnQuery := defaultQuery()
- // TODO: Once query can convert schema, change to {HostComputeNetwork:networkId}
- mapA := map[string]string{"VirtualNetwork": networkId}
- filter, err := json.Marshal(mapA)
- if err != nil {
- return nil, err
- }
- hcnQuery.Filter = string(filter)
-
- return ListEndpointsQuery(hcnQuery)
-}
-
-// GetEndpointByID returns an endpoint specified by Id
-func GetEndpointByID(endpointId string) (*HostComputeEndpoint, error) {
- hcnQuery := defaultQuery()
- mapA := map[string]string{"ID": endpointId}
- filter, err := json.Marshal(mapA)
- if err != nil {
- return nil, err
- }
- hcnQuery.Filter = string(filter)
-
- endpoints, err := ListEndpointsQuery(hcnQuery)
- if err != nil {
- return nil, err
- }
- if len(endpoints) == 0 {
- return nil, EndpointNotFoundError{EndpointID: endpointId}
- }
- return &endpoints[0], err
-}
-
-// GetEndpointByName returns an endpoint specified by Name
-func GetEndpointByName(endpointName string) (*HostComputeEndpoint, error) {
- hcnQuery := defaultQuery()
- mapA := map[string]string{"Name": endpointName}
- filter, err := json.Marshal(mapA)
- if err != nil {
- return nil, err
- }
- hcnQuery.Filter = string(filter)
-
- endpoints, err := ListEndpointsQuery(hcnQuery)
- if err != nil {
- return nil, err
- }
- if len(endpoints) == 0 {
- return nil, EndpointNotFoundError{EndpointName: endpointName}
- }
- return &endpoints[0], err
-}
-
-// Create Endpoint.
-func (endpoint *HostComputeEndpoint) Create() (*HostComputeEndpoint, error) {
- logrus.Debugf("hcn::HostComputeEndpoint::Create id=%s", endpoint.Id)
-
- if endpoint.HostComputeNamespace != "" {
- return nil, errors.New("endpoint create error, endpoint json HostComputeNamespace is read only and should not be set")
- }
-
- jsonString, err := json.Marshal(endpoint)
- if err != nil {
- return nil, err
- }
-
- logrus.Debugf("hcn::HostComputeEndpoint::Create JSON: %s", jsonString)
- endpoint, hcnErr := createEndpoint(endpoint.HostComputeNetwork, string(jsonString))
- if hcnErr != nil {
- return nil, hcnErr
- }
- return endpoint, nil
-}
-
-// Delete Endpoint.
-func (endpoint *HostComputeEndpoint) Delete() error {
- logrus.Debugf("hcn::HostComputeEndpoint::Delete id=%s", endpoint.Id)
-
- if err := deleteEndpoint(endpoint.Id); err != nil {
- return err
- }
- return nil
-}
-
-// ModifyEndpointSettings updates the Port/Policy of an Endpoint.
-func ModifyEndpointSettings(endpointId string, request *ModifyEndpointSettingRequest) error {
- logrus.Debugf("hcn::HostComputeEndpoint::ModifyEndpointSettings id=%s", endpointId)
-
- endpointSettingsRequest, err := json.Marshal(request)
- if err != nil {
- return err
- }
-
- _, err = modifyEndpoint(endpointId, string(endpointSettingsRequest))
- if err != nil {
- return err
- }
- return nil
-}
-
-// ApplyPolicy applies a Policy (ex: ACL) on the Endpoint.
-func (endpoint *HostComputeEndpoint) ApplyPolicy(requestType RequestType, endpointPolicy PolicyEndpointRequest) error {
- logrus.Debugf("hcn::HostComputeEndpoint::ApplyPolicy id=%s", endpoint.Id)
-
- settingsJson, err := json.Marshal(endpointPolicy)
- if err != nil {
- return err
- }
- requestMessage := &ModifyEndpointSettingRequest{
- ResourceType: EndpointResourceTypePolicy,
- RequestType: requestType,
- Settings: settingsJson,
- }
-
- return ModifyEndpointSettings(endpoint.Id, requestMessage)
-}
-
-// NamespaceAttach modifies a Namespace to add an endpoint.
-func (endpoint *HostComputeEndpoint) NamespaceAttach(namespaceId string) error {
- return AddNamespaceEndpoint(namespaceId, endpoint.Id)
-}
-
-// NamespaceDetach modifies a Namespace to remove an endpoint.
-func (endpoint *HostComputeEndpoint) NamespaceDetach(namespaceId string) error {
- return RemoveNamespaceEndpoint(namespaceId, endpoint.Id)
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/hcn/hcnerrors.go b/vendor/github.com/Microsoft/hcsshim/hcn/hcnerrors.go
deleted file mode 100644
index ad30d320d..000000000
--- a/vendor/github.com/Microsoft/hcsshim/hcn/hcnerrors.go
+++ /dev/null
@@ -1,164 +0,0 @@
-// Package hcn is a shim for the Host Compute Networking (HCN) service, which manages networking for Windows Server
-// containers and Hyper-V containers. Previous to RS5, HCN was referred to as Host Networking Service (HNS).
-package hcn
-
-import (
- "errors"
- "fmt"
-
- "github.com/Microsoft/hcsshim/internal/hcs"
- "github.com/Microsoft/hcsshim/internal/hcserror"
- "github.com/Microsoft/hcsshim/internal/interop"
- "github.com/sirupsen/logrus"
-)
-
-var (
- errInvalidNetworkID = errors.New("invalid network ID")
- errInvalidEndpointID = errors.New("invalid endpoint ID")
- errInvalidNamespaceID = errors.New("invalid namespace ID")
- errInvalidLoadBalancerID = errors.New("invalid load balancer ID")
- errInvalidRouteID = errors.New("invalid route ID")
-)
-
-func checkForErrors(methodName string, hr error, resultBuffer *uint16) error {
- errorFound := false
-
- if hr != nil {
- errorFound = true
- }
-
- result := ""
- if resultBuffer != nil {
- result = interop.ConvertAndFreeCoTaskMemString(resultBuffer)
- if result != "" {
- errorFound = true
- }
- }
-
- if errorFound {
- returnError := new(hr, methodName, result)
- logrus.Debugf(returnError.Error()) // HCN errors logged for debugging.
- return returnError
- }
-
- return nil
-}
-
-type ErrorCode uint32
-
-// For common errors, define the error as it is in windows, so we can quickly determine it later
-const (
- ERROR_NOT_FOUND = 0x490
- HCN_E_PORT_ALREADY_EXISTS ErrorCode = 0x803b0013
-)
-
-type HcnError struct {
- *hcserror.HcsError
- code ErrorCode
-}
-
-func (e *HcnError) Error() string {
- return e.HcsError.Error()
-}
-
-func CheckErrorWithCode(err error, code ErrorCode) bool {
- hcnError, ok := err.(*HcnError)
- if ok {
- return hcnError.code == code
- }
- return false
-}
-
-func IsElementNotFoundError(err error) bool {
- return CheckErrorWithCode(err, ERROR_NOT_FOUND)
-}
-
-func IsPortAlreadyExistsError(err error) bool {
- return CheckErrorWithCode(err, HCN_E_PORT_ALREADY_EXISTS)
-}
-
-func new(hr error, title string, rest string) error {
- err := &HcnError{}
- hcsError := hcserror.New(hr, title, rest)
- err.HcsError = hcsError.(*hcserror.HcsError)
- err.code = ErrorCode(hcserror.Win32FromError(hr))
- return err
-}
-
-//
-// Note that the below errors are not errors returned by hcn itself
-// we wish to seperate them as they are shim usage error
-//
-
-// NetworkNotFoundError results from a failed seach for a network by Id or Name
-type NetworkNotFoundError struct {
- NetworkName string
- NetworkID string
-}
-
-func (e NetworkNotFoundError) Error() string {
- if e.NetworkName != "" {
- return fmt.Sprintf("Network name %q not found", e.NetworkName)
- }
- return fmt.Sprintf("Network ID %q not found", e.NetworkID)
-}
-
-// EndpointNotFoundError results from a failed seach for an endpoint by Id or Name
-type EndpointNotFoundError struct {
- EndpointName string
- EndpointID string
-}
-
-func (e EndpointNotFoundError) Error() string {
- if e.EndpointName != "" {
- return fmt.Sprintf("Endpoint name %q not found", e.EndpointName)
- }
- return fmt.Sprintf("Endpoint ID %q not found", e.EndpointID)
-}
-
-// NamespaceNotFoundError results from a failed seach for a namsepace by Id
-type NamespaceNotFoundError struct {
- NamespaceID string
-}
-
-func (e NamespaceNotFoundError) Error() string {
- return fmt.Sprintf("Namespace ID %q not found", e.NamespaceID)
-}
-
-// LoadBalancerNotFoundError results from a failed seach for a loadbalancer by Id
-type LoadBalancerNotFoundError struct {
- LoadBalancerId string
-}
-
-func (e LoadBalancerNotFoundError) Error() string {
- return fmt.Sprintf("LoadBalancer %q not found", e.LoadBalancerId)
-}
-
-// RouteNotFoundError results from a failed seach for a route by Id
-type RouteNotFoundError struct {
- RouteId string
-}
-
-func (e RouteNotFoundError) Error() string {
- return fmt.Sprintf("SDN Route %q not found", e.RouteId)
-}
-
-// IsNotFoundError returns a boolean indicating whether the error was caused by
-// a resource not being found.
-func IsNotFoundError(err error) bool {
- switch pe := err.(type) {
- case NetworkNotFoundError:
- return true
- case EndpointNotFoundError:
- return true
- case NamespaceNotFoundError:
- return true
- case LoadBalancerNotFoundError:
- return true
- case RouteNotFoundError:
- return true
- case *hcserror.HcsError:
- return pe.Err == hcs.ErrElementNotFound
- }
- return false
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/hcn/hcnglobals.go b/vendor/github.com/Microsoft/hcsshim/hcn/hcnglobals.go
deleted file mode 100644
index 1438497d8..000000000
--- a/vendor/github.com/Microsoft/hcsshim/hcn/hcnglobals.go
+++ /dev/null
@@ -1,112 +0,0 @@
-package hcn
-
-import (
- "encoding/json"
- "fmt"
- "math"
-
- "github.com/Microsoft/hcsshim/internal/hcserror"
- "github.com/Microsoft/hcsshim/internal/interop"
- "github.com/sirupsen/logrus"
-)
-
-// Globals are all global properties of the HCN Service.
-type Globals struct {
- Version Version `json:"Version"`
-}
-
-// Version is the HCN Service version.
-type Version struct {
- Major int `json:"Major"`
- Minor int `json:"Minor"`
-}
-
-type VersionRange struct {
- MinVersion Version
- MaxVersion Version
-}
-
-type VersionRanges []VersionRange
-
-var (
- // HNSVersion1803 added ACL functionality.
- HNSVersion1803 = VersionRanges{VersionRange{MinVersion: Version{Major: 7, Minor: 2}, MaxVersion: Version{Major: math.MaxInt32, Minor: math.MaxInt32}}}
- // V2ApiSupport allows the use of V2 Api calls and V2 Schema.
- V2ApiSupport = VersionRanges{VersionRange{MinVersion: Version{Major: 9, Minor: 2}, MaxVersion: Version{Major: math.MaxInt32, Minor: math.MaxInt32}}}
- // Remote Subnet allows for Remote Subnet policies on Overlay networks
- RemoteSubnetVersion = VersionRanges{VersionRange{MinVersion: Version{Major: 9, Minor: 2}, MaxVersion: Version{Major: math.MaxInt32, Minor: math.MaxInt32}}}
- // A Host Route policy allows for local container to local host communication Overlay networks
- HostRouteVersion = VersionRanges{VersionRange{MinVersion: Version{Major: 9, Minor: 2}, MaxVersion: Version{Major: math.MaxInt32, Minor: math.MaxInt32}}}
- // HNS 10.2 allows for Direct Server Return for loadbalancing
- DSRVersion = VersionRanges{VersionRange{MinVersion: Version{Major: 10, Minor: 2}, MaxVersion: Version{Major: math.MaxInt32, Minor: math.MaxInt32}}}
- // HNS 9.3 through 10.0 (not included) and, 10.4+ provide support for configuring endpoints with /32 prefixes
- Slash32EndpointPrefixesVersion = VersionRanges{
- VersionRange{MinVersion: Version{Major: 9, Minor: 3}, MaxVersion: Version{Major: 9, Minor: math.MaxInt32}},
- VersionRange{MinVersion: Version{Major: 10, Minor: 4}, MaxVersion: Version{Major: math.MaxInt32, Minor: math.MaxInt32}},
- }
- // HNS 9.3 through 10.0 (not included) and, 10.4+ allow for HNS ACL Policies to support protocol 252 for VXLAN
- AclSupportForProtocol252Version = VersionRanges{
- VersionRange{MinVersion: Version{Major: 9, Minor: 3}, MaxVersion: Version{Major: 9, Minor: math.MaxInt32}},
- VersionRange{MinVersion: Version{Major: 10, Minor: 4}, MaxVersion: Version{Major: math.MaxInt32, Minor: math.MaxInt32}},
- }
- // HNS 12.0 allows for session affinity for loadbalancing
- SessionAffinityVersion = VersionRanges{VersionRange{MinVersion: Version{Major: 12, Minor: 0}, MaxVersion: Version{Major: math.MaxInt32, Minor: math.MaxInt32}}}
- // HNS 10.5 through 11 (not included) and 12.0+ supports Ipv6 dual stack.
- IPv6DualStackVersion = VersionRanges{
- VersionRange{MinVersion: Version{Major: 10, Minor: 5}, MaxVersion: Version{Major: 10, Minor: math.MaxInt32}},
- VersionRange{MinVersion: Version{Major: 12, Minor: 0}, MaxVersion: Version{Major: math.MaxInt32, Minor: math.MaxInt32}},
- }
-)
-
-// GetGlobals returns the global properties of the HCN Service.
-func GetGlobals() (*Globals, error) {
- var version Version
- err := hnsCall("GET", "/globals/version", "", &version)
- if err != nil {
- return nil, err
- }
-
- globals := &Globals{
- Version: version,
- }
-
- return globals, nil
-}
-
-type hnsResponse struct {
- Success bool
- Error string
- Output json.RawMessage
-}
-
-func hnsCall(method, path, request string, returnResponse interface{}) error {
- var responseBuffer *uint16
- logrus.Debugf("[%s]=>[%s] Request : %s", method, path, request)
-
- err := _hnsCall(method, path, request, &responseBuffer)
- if err != nil {
- return hcserror.New(err, "hnsCall ", "")
- }
- response := interop.ConvertAndFreeCoTaskMemString(responseBuffer)
-
- hnsresponse := &hnsResponse{}
- if err = json.Unmarshal([]byte(response), &hnsresponse); err != nil {
- return err
- }
-
- if !hnsresponse.Success {
- return fmt.Errorf("HNS failed with error : %s", hnsresponse.Error)
- }
-
- if len(hnsresponse.Output) == 0 {
- return nil
- }
-
- logrus.Debugf("Network Response : %s", hnsresponse.Output)
- err = json.Unmarshal(hnsresponse.Output, returnResponse)
- if err != nil {
- return err
- }
-
- return nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/hcn/hcnloadbalancer.go b/vendor/github.com/Microsoft/hcsshim/hcn/hcnloadbalancer.go
deleted file mode 100644
index 9ed59a669..000000000
--- a/vendor/github.com/Microsoft/hcsshim/hcn/hcnloadbalancer.go
+++ /dev/null
@@ -1,354 +0,0 @@
-package hcn
-
-import (
- "encoding/json"
-
- "github.com/Microsoft/go-winio/pkg/guid"
- "github.com/Microsoft/hcsshim/internal/interop"
- "github.com/sirupsen/logrus"
-)
-
-// LoadBalancerPortMapping is associated with HostComputeLoadBalancer
-type LoadBalancerPortMapping struct {
- Protocol uint32 `json:",omitempty"` // EX: TCP = 6, UDP = 17
- InternalPort uint16 `json:",omitempty"`
- ExternalPort uint16 `json:",omitempty"`
- DistributionType LoadBalancerDistribution `json:",omitempty"` // EX: Distribute per connection = 0, distribute traffic of the same protocol per client IP = 1, distribute per client IP = 2
- Flags LoadBalancerPortMappingFlags `json:",omitempty"`
-}
-
-// HostComputeLoadBalancer represents software load balancer.
-type HostComputeLoadBalancer struct {
- Id string `json:"ID,omitempty"`
- HostComputeEndpoints []string `json:",omitempty"`
- SourceVIP string `json:",omitempty"`
- FrontendVIPs []string `json:",omitempty"`
- PortMappings []LoadBalancerPortMapping `json:",omitempty"`
- SchemaVersion SchemaVersion `json:",omitempty"`
- Flags LoadBalancerFlags `json:",omitempty"` // 0: None, 1: EnableDirectServerReturn
-}
-
-//LoadBalancerFlags modify settings for a loadbalancer.
-type LoadBalancerFlags uint32
-
-var (
- // LoadBalancerFlagsNone is the default.
- LoadBalancerFlagsNone LoadBalancerFlags = 0
- // LoadBalancerFlagsDSR enables Direct Server Return (DSR)
- LoadBalancerFlagsDSR LoadBalancerFlags = 1
-)
-
-// LoadBalancerPortMappingFlags are special settings on a loadbalancer.
-type LoadBalancerPortMappingFlags uint32
-
-var (
- // LoadBalancerPortMappingFlagsNone is the default.
- LoadBalancerPortMappingFlagsNone LoadBalancerPortMappingFlags
- // LoadBalancerPortMappingFlagsILB enables internal loadbalancing.
- LoadBalancerPortMappingFlagsILB LoadBalancerPortMappingFlags = 1
- // LoadBalancerPortMappingFlagsLocalRoutedVIP enables VIP access from the host.
- LoadBalancerPortMappingFlagsLocalRoutedVIP LoadBalancerPortMappingFlags = 2
- // LoadBalancerPortMappingFlagsUseMux enables DSR for NodePort access of VIP.
- LoadBalancerPortMappingFlagsUseMux LoadBalancerPortMappingFlags = 4
- // LoadBalancerPortMappingFlagsPreserveDIP delivers packets with destination IP as the VIP.
- LoadBalancerPortMappingFlagsPreserveDIP LoadBalancerPortMappingFlags = 8
-)
-
-// LoadBalancerDistribution specifies how the loadbalancer distributes traffic.
-type LoadBalancerDistribution uint32
-
-var (
- // LoadBalancerDistributionNone is the default and loadbalances each connection to the same pod.
- LoadBalancerDistributionNone LoadBalancerDistribution
- // LoadBalancerDistributionSourceIPProtocol loadbalances all traffic of the same protocol from a client IP to the same pod.
- LoadBalancerDistributionSourceIPProtocol LoadBalancerDistribution = 1
- // LoadBalancerDistributionSourceIP loadbalances all traffic from a client IP to the same pod.
- LoadBalancerDistributionSourceIP LoadBalancerDistribution = 2
-)
-
-func getLoadBalancer(loadBalancerGuid guid.GUID, query string) (*HostComputeLoadBalancer, error) {
- // Open loadBalancer.
- var (
- loadBalancerHandle hcnLoadBalancer
- resultBuffer *uint16
- propertiesBuffer *uint16
- )
- hr := hcnOpenLoadBalancer(&loadBalancerGuid, &loadBalancerHandle, &resultBuffer)
- if err := checkForErrors("hcnOpenLoadBalancer", hr, resultBuffer); err != nil {
- return nil, err
- }
- // Query loadBalancer.
- hr = hcnQueryLoadBalancerProperties(loadBalancerHandle, query, &propertiesBuffer, &resultBuffer)
- if err := checkForErrors("hcnQueryLoadBalancerProperties", hr, resultBuffer); err != nil {
- return nil, err
- }
- properties := interop.ConvertAndFreeCoTaskMemString(propertiesBuffer)
- // Close loadBalancer.
- hr = hcnCloseLoadBalancer(loadBalancerHandle)
- if err := checkForErrors("hcnCloseLoadBalancer", hr, nil); err != nil {
- return nil, err
- }
- // Convert output to HostComputeLoadBalancer
- var outputLoadBalancer HostComputeLoadBalancer
- if err := json.Unmarshal([]byte(properties), &outputLoadBalancer); err != nil {
- return nil, err
- }
- return &outputLoadBalancer, nil
-}
-
-func enumerateLoadBalancers(query string) ([]HostComputeLoadBalancer, error) {
- // Enumerate all LoadBalancer Guids
- var (
- resultBuffer *uint16
- loadBalancerBuffer *uint16
- )
- hr := hcnEnumerateLoadBalancers(query, &loadBalancerBuffer, &resultBuffer)
- if err := checkForErrors("hcnEnumerateLoadBalancers", hr, resultBuffer); err != nil {
- return nil, err
- }
-
- loadBalancers := interop.ConvertAndFreeCoTaskMemString(loadBalancerBuffer)
- var loadBalancerIds []guid.GUID
- if err := json.Unmarshal([]byte(loadBalancers), &loadBalancerIds); err != nil {
- return nil, err
- }
-
- var outputLoadBalancers []HostComputeLoadBalancer
- for _, loadBalancerGuid := range loadBalancerIds {
- loadBalancer, err := getLoadBalancer(loadBalancerGuid, query)
- if err != nil {
- return nil, err
- }
- outputLoadBalancers = append(outputLoadBalancers, *loadBalancer)
- }
- return outputLoadBalancers, nil
-}
-
-func createLoadBalancer(settings string) (*HostComputeLoadBalancer, error) {
- // Create new loadBalancer.
- var (
- loadBalancerHandle hcnLoadBalancer
- resultBuffer *uint16
- propertiesBuffer *uint16
- )
- loadBalancerGuid := guid.GUID{}
- hr := hcnCreateLoadBalancer(&loadBalancerGuid, settings, &loadBalancerHandle, &resultBuffer)
- if err := checkForErrors("hcnCreateLoadBalancer", hr, resultBuffer); err != nil {
- return nil, err
- }
- // Query loadBalancer.
- hcnQuery := defaultQuery()
- query, err := json.Marshal(hcnQuery)
- if err != nil {
- return nil, err
- }
- hr = hcnQueryLoadBalancerProperties(loadBalancerHandle, string(query), &propertiesBuffer, &resultBuffer)
- if err := checkForErrors("hcnQueryLoadBalancerProperties", hr, resultBuffer); err != nil {
- return nil, err
- }
- properties := interop.ConvertAndFreeCoTaskMemString(propertiesBuffer)
- // Close loadBalancer.
- hr = hcnCloseLoadBalancer(loadBalancerHandle)
- if err := checkForErrors("hcnCloseLoadBalancer", hr, nil); err != nil {
- return nil, err
- }
- // Convert output to HostComputeLoadBalancer
- var outputLoadBalancer HostComputeLoadBalancer
- if err := json.Unmarshal([]byte(properties), &outputLoadBalancer); err != nil {
- return nil, err
- }
- return &outputLoadBalancer, nil
-}
-
-func modifyLoadBalancer(loadBalancerId string, settings string) (*HostComputeLoadBalancer, error) {
- loadBalancerGuid, err := guid.FromString(loadBalancerId)
- if err != nil {
- return nil, errInvalidLoadBalancerID
- }
- // Open loadBalancer.
- var (
- loadBalancerHandle hcnLoadBalancer
- resultBuffer *uint16
- propertiesBuffer *uint16
- )
- hr := hcnOpenLoadBalancer(&loadBalancerGuid, &loadBalancerHandle, &resultBuffer)
- if err := checkForErrors("hcnOpenLoadBalancer", hr, resultBuffer); err != nil {
- return nil, err
- }
- // Modify loadBalancer.
- hr = hcnModifyLoadBalancer(loadBalancerHandle, settings, &resultBuffer)
- if err := checkForErrors("hcnModifyLoadBalancer", hr, resultBuffer); err != nil {
- return nil, err
- }
- // Query loadBalancer.
- hcnQuery := defaultQuery()
- query, err := json.Marshal(hcnQuery)
- if err != nil {
- return nil, err
- }
- hr = hcnQueryLoadBalancerProperties(loadBalancerHandle, string(query), &propertiesBuffer, &resultBuffer)
- if err := checkForErrors("hcnQueryLoadBalancerProperties", hr, resultBuffer); err != nil {
- return nil, err
- }
- properties := interop.ConvertAndFreeCoTaskMemString(propertiesBuffer)
- // Close loadBalancer.
- hr = hcnCloseLoadBalancer(loadBalancerHandle)
- if err := checkForErrors("hcnCloseLoadBalancer", hr, nil); err != nil {
- return nil, err
- }
- // Convert output to LoadBalancer
- var outputLoadBalancer HostComputeLoadBalancer
- if err := json.Unmarshal([]byte(properties), &outputLoadBalancer); err != nil {
- return nil, err
- }
- return &outputLoadBalancer, nil
-}
-
-func deleteLoadBalancer(loadBalancerId string) error {
- loadBalancerGuid, err := guid.FromString(loadBalancerId)
- if err != nil {
- return errInvalidLoadBalancerID
- }
- var resultBuffer *uint16
- hr := hcnDeleteLoadBalancer(&loadBalancerGuid, &resultBuffer)
- if err := checkForErrors("hcnDeleteLoadBalancer", hr, resultBuffer); err != nil {
- return err
- }
- return nil
-}
-
-// ListLoadBalancers makes a call to list all available loadBalancers.
-func ListLoadBalancers() ([]HostComputeLoadBalancer, error) {
- hcnQuery := defaultQuery()
- loadBalancers, err := ListLoadBalancersQuery(hcnQuery)
- if err != nil {
- return nil, err
- }
- return loadBalancers, nil
-}
-
-// ListLoadBalancersQuery makes a call to query the list of available loadBalancers.
-func ListLoadBalancersQuery(query HostComputeQuery) ([]HostComputeLoadBalancer, error) {
- queryJson, err := json.Marshal(query)
- if err != nil {
- return nil, err
- }
-
- loadBalancers, err := enumerateLoadBalancers(string(queryJson))
- if err != nil {
- return nil, err
- }
- return loadBalancers, nil
-}
-
-// GetLoadBalancerByID returns the LoadBalancer specified by Id.
-func GetLoadBalancerByID(loadBalancerId string) (*HostComputeLoadBalancer, error) {
- hcnQuery := defaultQuery()
- mapA := map[string]string{"ID": loadBalancerId}
- filter, err := json.Marshal(mapA)
- if err != nil {
- return nil, err
- }
- hcnQuery.Filter = string(filter)
-
- loadBalancers, err := ListLoadBalancersQuery(hcnQuery)
- if err != nil {
- return nil, err
- }
- if len(loadBalancers) == 0 {
- return nil, LoadBalancerNotFoundError{LoadBalancerId: loadBalancerId}
- }
- return &loadBalancers[0], err
-}
-
-// Create LoadBalancer.
-func (loadBalancer *HostComputeLoadBalancer) Create() (*HostComputeLoadBalancer, error) {
- logrus.Debugf("hcn::HostComputeLoadBalancer::Create id=%s", loadBalancer.Id)
-
- jsonString, err := json.Marshal(loadBalancer)
- if err != nil {
- return nil, err
- }
-
- logrus.Debugf("hcn::HostComputeLoadBalancer::Create JSON: %s", jsonString)
- loadBalancer, hcnErr := createLoadBalancer(string(jsonString))
- if hcnErr != nil {
- return nil, hcnErr
- }
- return loadBalancer, nil
-}
-
-// Delete LoadBalancer.
-func (loadBalancer *HostComputeLoadBalancer) Delete() error {
- logrus.Debugf("hcn::HostComputeLoadBalancer::Delete id=%s", loadBalancer.Id)
-
- if err := deleteLoadBalancer(loadBalancer.Id); err != nil {
- return err
- }
- return nil
-}
-
-// AddEndpoint add an endpoint to a LoadBalancer
-func (loadBalancer *HostComputeLoadBalancer) AddEndpoint(endpoint *HostComputeEndpoint) (*HostComputeLoadBalancer, error) {
- logrus.Debugf("hcn::HostComputeLoadBalancer::AddEndpoint loadBalancer=%s endpoint=%s", loadBalancer.Id, endpoint.Id)
-
- err := loadBalancer.Delete()
- if err != nil {
- return nil, err
- }
-
- // Add Endpoint to the Existing List
- loadBalancer.HostComputeEndpoints = append(loadBalancer.HostComputeEndpoints, endpoint.Id)
-
- return loadBalancer.Create()
-}
-
-// RemoveEndpoint removes an endpoint from a LoadBalancer
-func (loadBalancer *HostComputeLoadBalancer) RemoveEndpoint(endpoint *HostComputeEndpoint) (*HostComputeLoadBalancer, error) {
- logrus.Debugf("hcn::HostComputeLoadBalancer::RemoveEndpoint loadBalancer=%s endpoint=%s", loadBalancer.Id, endpoint.Id)
-
- err := loadBalancer.Delete()
- if err != nil {
- return nil, err
- }
-
- // Create a list of all the endpoints besides the one being removed
- var endpoints []string
- for _, endpointReference := range loadBalancer.HostComputeEndpoints {
- if endpointReference == endpoint.Id {
- continue
- }
- endpoints = append(endpoints, endpointReference)
- }
- loadBalancer.HostComputeEndpoints = endpoints
- return loadBalancer.Create()
-}
-
-// AddLoadBalancer for the specified endpoints
-func AddLoadBalancer(endpoints []HostComputeEndpoint, flags LoadBalancerFlags, portMappingFlags LoadBalancerPortMappingFlags, sourceVIP string, frontendVIPs []string, protocol uint16, internalPort uint16, externalPort uint16) (*HostComputeLoadBalancer, error) {
- logrus.Debugf("hcn::HostComputeLoadBalancer::AddLoadBalancer endpointId=%v, LoadBalancerFlags=%v, LoadBalancerPortMappingFlags=%v, sourceVIP=%s, frontendVIPs=%v, protocol=%v, internalPort=%v, externalPort=%v", endpoints, flags, portMappingFlags, sourceVIP, frontendVIPs, protocol, internalPort, externalPort)
-
- loadBalancer := &HostComputeLoadBalancer{
- SourceVIP: sourceVIP,
- PortMappings: []LoadBalancerPortMapping{
- {
- Protocol: uint32(protocol),
- InternalPort: internalPort,
- ExternalPort: externalPort,
- Flags: portMappingFlags,
- },
- },
- FrontendVIPs: frontendVIPs,
- SchemaVersion: SchemaVersion{
- Major: 2,
- Minor: 0,
- },
- Flags: flags,
- }
-
- for _, endpoint := range endpoints {
- loadBalancer.HostComputeEndpoints = append(loadBalancer.HostComputeEndpoints, endpoint.Id)
- }
-
- return loadBalancer.Create()
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/hcn/hcnnamespace.go b/vendor/github.com/Microsoft/hcsshim/hcn/hcnnamespace.go
deleted file mode 100644
index 22c7cf95f..000000000
--- a/vendor/github.com/Microsoft/hcsshim/hcn/hcnnamespace.go
+++ /dev/null
@@ -1,446 +0,0 @@
-package hcn
-
-import (
- "encoding/json"
- "os"
- "syscall"
-
- "github.com/Microsoft/go-winio/pkg/guid"
- icni "github.com/Microsoft/hcsshim/internal/cni"
- "github.com/Microsoft/hcsshim/internal/interop"
- "github.com/Microsoft/hcsshim/internal/regstate"
- "github.com/Microsoft/hcsshim/internal/runhcs"
- "github.com/sirupsen/logrus"
-)
-
-// NamespaceResourceEndpoint represents an Endpoint attached to a Namespace.
-type NamespaceResourceEndpoint struct {
- Id string `json:"ID,"`
-}
-
-// NamespaceResourceContainer represents a Container attached to a Namespace.
-type NamespaceResourceContainer struct {
- Id string `json:"ID,"`
-}
-
-// NamespaceResourceType determines whether the Namespace resource is a Container or Endpoint.
-type NamespaceResourceType string
-
-var (
- // NamespaceResourceTypeContainer are contianers associated with a Namespace.
- NamespaceResourceTypeContainer NamespaceResourceType = "Container"
- // NamespaceResourceTypeEndpoint are endpoints associated with a Namespace.
- NamespaceResourceTypeEndpoint NamespaceResourceType = "Endpoint"
-)
-
-// NamespaceResource is associated with a namespace
-type NamespaceResource struct {
- Type NamespaceResourceType `json:","` // Container, Endpoint
- Data json.RawMessage `json:","`
-}
-
-// NamespaceType determines whether the Namespace is for a Host or Guest
-type NamespaceType string
-
-var (
- // NamespaceTypeHost are host namespaces.
- NamespaceTypeHost NamespaceType = "Host"
- // NamespaceTypeHostDefault are host namespaces in the default compartment.
- NamespaceTypeHostDefault NamespaceType = "HostDefault"
- // NamespaceTypeGuest are guest namespaces.
- NamespaceTypeGuest NamespaceType = "Guest"
- // NamespaceTypeGuestDefault are guest namespaces in the default compartment.
- NamespaceTypeGuestDefault NamespaceType = "GuestDefault"
-)
-
-// HostComputeNamespace represents a namespace (AKA compartment) in
-type HostComputeNamespace struct {
- Id string `json:"ID,omitempty"`
- NamespaceId uint32 `json:",omitempty"`
- Type NamespaceType `json:",omitempty"` // Host, HostDefault, Guest, GuestDefault
- Resources []NamespaceResource `json:",omitempty"`
- SchemaVersion SchemaVersion `json:",omitempty"`
-}
-
-// ModifyNamespaceSettingRequest is the structure used to send request to modify a namespace.
-// Used to Add/Remove an endpoints and containers to/from a namespace.
-type ModifyNamespaceSettingRequest struct {
- ResourceType NamespaceResourceType `json:",omitempty"` // Container, Endpoint
- RequestType RequestType `json:",omitempty"` // Add, Remove, Update, Refresh
- Settings json.RawMessage `json:",omitempty"`
-}
-
-func getNamespace(namespaceGuid guid.GUID, query string) (*HostComputeNamespace, error) {
- // Open namespace.
- var (
- namespaceHandle hcnNamespace
- resultBuffer *uint16
- propertiesBuffer *uint16
- )
- hr := hcnOpenNamespace(&namespaceGuid, &namespaceHandle, &resultBuffer)
- if err := checkForErrors("hcnOpenNamespace", hr, resultBuffer); err != nil {
- return nil, err
- }
- // Query namespace.
- hr = hcnQueryNamespaceProperties(namespaceHandle, query, &propertiesBuffer, &resultBuffer)
- if err := checkForErrors("hcnQueryNamespaceProperties", hr, resultBuffer); err != nil {
- return nil, err
- }
- properties := interop.ConvertAndFreeCoTaskMemString(propertiesBuffer)
- // Close namespace.
- hr = hcnCloseNamespace(namespaceHandle)
- if err := checkForErrors("hcnCloseNamespace", hr, nil); err != nil {
- return nil, err
- }
- // Convert output to HostComputeNamespace
- var outputNamespace HostComputeNamespace
- if err := json.Unmarshal([]byte(properties), &outputNamespace); err != nil {
- return nil, err
- }
- return &outputNamespace, nil
-}
-
-func enumerateNamespaces(query string) ([]HostComputeNamespace, error) {
- // Enumerate all Namespace Guids
- var (
- resultBuffer *uint16
- namespaceBuffer *uint16
- )
- hr := hcnEnumerateNamespaces(query, &namespaceBuffer, &resultBuffer)
- if err := checkForErrors("hcnEnumerateNamespaces", hr, resultBuffer); err != nil {
- return nil, err
- }
-
- namespaces := interop.ConvertAndFreeCoTaskMemString(namespaceBuffer)
- var namespaceIds []guid.GUID
- if err := json.Unmarshal([]byte(namespaces), &namespaceIds); err != nil {
- return nil, err
- }
-
- var outputNamespaces []HostComputeNamespace
- for _, namespaceGuid := range namespaceIds {
- namespace, err := getNamespace(namespaceGuid, query)
- if err != nil {
- return nil, err
- }
- outputNamespaces = append(outputNamespaces, *namespace)
- }
- return outputNamespaces, nil
-}
-
-func createNamespace(settings string) (*HostComputeNamespace, error) {
- // Create new namespace.
- var (
- namespaceHandle hcnNamespace
- resultBuffer *uint16
- propertiesBuffer *uint16
- )
- namespaceGuid := guid.GUID{}
- hr := hcnCreateNamespace(&namespaceGuid, settings, &namespaceHandle, &resultBuffer)
- if err := checkForErrors("hcnCreateNamespace", hr, resultBuffer); err != nil {
- return nil, err
- }
- // Query namespace.
- hcnQuery := defaultQuery()
- query, err := json.Marshal(hcnQuery)
- if err != nil {
- return nil, err
- }
- hr = hcnQueryNamespaceProperties(namespaceHandle, string(query), &propertiesBuffer, &resultBuffer)
- if err := checkForErrors("hcnQueryNamespaceProperties", hr, resultBuffer); err != nil {
- return nil, err
- }
- properties := interop.ConvertAndFreeCoTaskMemString(propertiesBuffer)
- // Close namespace.
- hr = hcnCloseNamespace(namespaceHandle)
- if err := checkForErrors("hcnCloseNamespace", hr, nil); err != nil {
- return nil, err
- }
- // Convert output to HostComputeNamespace
- var outputNamespace HostComputeNamespace
- if err := json.Unmarshal([]byte(properties), &outputNamespace); err != nil {
- return nil, err
- }
- return &outputNamespace, nil
-}
-
-func modifyNamespace(namespaceId string, settings string) (*HostComputeNamespace, error) {
- namespaceGuid, err := guid.FromString(namespaceId)
- if err != nil {
- return nil, errInvalidNamespaceID
- }
- // Open namespace.
- var (
- namespaceHandle hcnNamespace
- resultBuffer *uint16
- propertiesBuffer *uint16
- )
- hr := hcnOpenNamespace(&namespaceGuid, &namespaceHandle, &resultBuffer)
- if err := checkForErrors("hcnOpenNamespace", hr, resultBuffer); err != nil {
- return nil, err
- }
- // Modify namespace.
- hr = hcnModifyNamespace(namespaceHandle, settings, &resultBuffer)
- if err := checkForErrors("hcnModifyNamespace", hr, resultBuffer); err != nil {
- return nil, err
- }
- // Query namespace.
- hcnQuery := defaultQuery()
- query, err := json.Marshal(hcnQuery)
- if err != nil {
- return nil, err
- }
- hr = hcnQueryNamespaceProperties(namespaceHandle, string(query), &propertiesBuffer, &resultBuffer)
- if err := checkForErrors("hcnQueryNamespaceProperties", hr, resultBuffer); err != nil {
- return nil, err
- }
- properties := interop.ConvertAndFreeCoTaskMemString(propertiesBuffer)
- // Close namespace.
- hr = hcnCloseNamespace(namespaceHandle)
- if err := checkForErrors("hcnCloseNamespace", hr, nil); err != nil {
- return nil, err
- }
- // Convert output to Namespace
- var outputNamespace HostComputeNamespace
- if err := json.Unmarshal([]byte(properties), &outputNamespace); err != nil {
- return nil, err
- }
- return &outputNamespace, nil
-}
-
-func deleteNamespace(namespaceId string) error {
- namespaceGuid, err := guid.FromString(namespaceId)
- if err != nil {
- return errInvalidNamespaceID
- }
- var resultBuffer *uint16
- hr := hcnDeleteNamespace(&namespaceGuid, &resultBuffer)
- if err := checkForErrors("hcnDeleteNamespace", hr, resultBuffer); err != nil {
- return err
- }
- return nil
-}
-
-// ListNamespaces makes a call to list all available namespaces.
-func ListNamespaces() ([]HostComputeNamespace, error) {
- hcnQuery := defaultQuery()
- namespaces, err := ListNamespacesQuery(hcnQuery)
- if err != nil {
- return nil, err
- }
- return namespaces, nil
-}
-
-// ListNamespacesQuery makes a call to query the list of available namespaces.
-func ListNamespacesQuery(query HostComputeQuery) ([]HostComputeNamespace, error) {
- queryJson, err := json.Marshal(query)
- if err != nil {
- return nil, err
- }
-
- namespaces, err := enumerateNamespaces(string(queryJson))
- if err != nil {
- return nil, err
- }
- return namespaces, nil
-}
-
-// GetNamespaceByID returns the Namespace specified by Id.
-func GetNamespaceByID(namespaceId string) (*HostComputeNamespace, error) {
- hcnQuery := defaultQuery()
- mapA := map[string]string{"ID": namespaceId}
- filter, err := json.Marshal(mapA)
- if err != nil {
- return nil, err
- }
- hcnQuery.Filter = string(filter)
-
- namespaces, err := ListNamespacesQuery(hcnQuery)
- if err != nil {
- return nil, err
- }
- if len(namespaces) == 0 {
- return nil, NamespaceNotFoundError{NamespaceID: namespaceId}
- }
-
- return &namespaces[0], err
-}
-
-// GetNamespaceEndpointIds returns the endpoints of the Namespace specified by Id.
-func GetNamespaceEndpointIds(namespaceId string) ([]string, error) {
- namespace, err := GetNamespaceByID(namespaceId)
- if err != nil {
- return nil, err
- }
- var endpointsIds []string
- for _, resource := range namespace.Resources {
- if resource.Type == "Endpoint" {
- var endpointResource NamespaceResourceEndpoint
- if err := json.Unmarshal([]byte(resource.Data), &endpointResource); err != nil {
- return nil, err
- }
- endpointsIds = append(endpointsIds, endpointResource.Id)
- }
- }
- return endpointsIds, nil
-}
-
-// GetNamespaceContainerIds returns the containers of the Namespace specified by Id.
-func GetNamespaceContainerIds(namespaceId string) ([]string, error) {
- namespace, err := GetNamespaceByID(namespaceId)
- if err != nil {
- return nil, err
- }
- var containerIds []string
- for _, resource := range namespace.Resources {
- if resource.Type == "Container" {
- var contaienrResource NamespaceResourceContainer
- if err := json.Unmarshal([]byte(resource.Data), &contaienrResource); err != nil {
- return nil, err
- }
- containerIds = append(containerIds, contaienrResource.Id)
- }
- }
- return containerIds, nil
-}
-
-// NewNamespace creates a new Namespace object
-func NewNamespace(nsType NamespaceType) *HostComputeNamespace {
- return &HostComputeNamespace{
- Type: nsType,
- SchemaVersion: V2SchemaVersion(),
- }
-}
-
-// Create Namespace.
-func (namespace *HostComputeNamespace) Create() (*HostComputeNamespace, error) {
- logrus.Debugf("hcn::HostComputeNamespace::Create id=%s", namespace.Id)
-
- jsonString, err := json.Marshal(namespace)
- if err != nil {
- return nil, err
- }
-
- logrus.Debugf("hcn::HostComputeNamespace::Create JSON: %s", jsonString)
- namespace, hcnErr := createNamespace(string(jsonString))
- if hcnErr != nil {
- return nil, hcnErr
- }
- return namespace, nil
-}
-
-// Delete Namespace.
-func (namespace *HostComputeNamespace) Delete() error {
- logrus.Debugf("hcn::HostComputeNamespace::Delete id=%s", namespace.Id)
-
- if err := deleteNamespace(namespace.Id); err != nil {
- return err
- }
- return nil
-}
-
-// Sync Namespace endpoints with the appropriate sandbox container holding the
-// network namespace open. If no sandbox container is found for this namespace
-// this method is determined to be a success and will not return an error in
-// this case. If the sandbox container is found and a sync is initiated any
-// failures will be returned via this method.
-//
-// This call initiates a sync between endpoints and the matching UtilityVM
-// hosting those endpoints. It is safe to call for any `NamespaceType` but
-// `NamespaceTypeGuest` is the only case when a sync will actually occur. For
-// `NamespaceTypeHost` the process container will be automatically synchronized
-// when the the endpoint is added via `AddNamespaceEndpoint`.
-//
-// Note: This method sync's both additions and removals of endpoints from a
-// `NamespaceTypeGuest` namespace.
-func (namespace *HostComputeNamespace) Sync() error {
- logrus.WithField("id", namespace.Id).Debugf("hcs::HostComputeNamespace::Sync")
-
- // We only attempt a sync for namespace guest.
- if namespace.Type != NamespaceTypeGuest {
- return nil
- }
-
- // Look in the registry for the key to map from namespace id to pod-id
- cfg, err := icni.LoadPersistedNamespaceConfig(namespace.Id)
- if err != nil {
- if regstate.IsNotFoundError(err) {
- return nil
- }
- return err
- }
- req := runhcs.VMRequest{
- ID: cfg.ContainerID,
- Op: runhcs.OpSyncNamespace,
- }
- shimPath := runhcs.VMPipePath(cfg.HostUniqueID)
- if err := runhcs.IssueVMRequest(shimPath, &req); err != nil {
- // The shim is likey gone. Simply ignore the sync as if it didn't exist.
- if perr, ok := err.(*os.PathError); ok && perr.Err == syscall.ERROR_FILE_NOT_FOUND {
- // Remove the reg key there is no point to try again
- cfg.Remove()
- return nil
- }
- f := map[string]interface{}{
- "id": namespace.Id,
- "container-id": cfg.ContainerID,
- }
- logrus.WithFields(f).
- WithError(err).
- Debugf("hcs::HostComputeNamespace::Sync failed to connect to shim pipe: '%s'", shimPath)
- return err
- }
- return nil
-}
-
-// ModifyNamespaceSettings updates the Endpoints/Containers of a Namespace.
-func ModifyNamespaceSettings(namespaceId string, request *ModifyNamespaceSettingRequest) error {
- logrus.Debugf("hcn::HostComputeNamespace::ModifyNamespaceSettings id=%s", namespaceId)
-
- namespaceSettings, err := json.Marshal(request)
- if err != nil {
- return err
- }
-
- _, err = modifyNamespace(namespaceId, string(namespaceSettings))
- if err != nil {
- return err
- }
- return nil
-}
-
-// AddNamespaceEndpoint adds an endpoint to a Namespace.
-func AddNamespaceEndpoint(namespaceId string, endpointId string) error {
- logrus.Debugf("hcn::HostComputeEndpoint::AddNamespaceEndpoint id=%s", endpointId)
-
- mapA := map[string]string{"EndpointId": endpointId}
- settingsJson, err := json.Marshal(mapA)
- if err != nil {
- return err
- }
- requestMessage := &ModifyNamespaceSettingRequest{
- ResourceType: NamespaceResourceTypeEndpoint,
- RequestType: RequestTypeAdd,
- Settings: settingsJson,
- }
-
- return ModifyNamespaceSettings(namespaceId, requestMessage)
-}
-
-// RemoveNamespaceEndpoint removes an endpoint from a Namespace.
-func RemoveNamespaceEndpoint(namespaceId string, endpointId string) error {
- logrus.Debugf("hcn::HostComputeNamespace::RemoveNamespaceEndpoint id=%s", endpointId)
-
- mapA := map[string]string{"EndpointId": endpointId}
- settingsJson, err := json.Marshal(mapA)
- if err != nil {
- return err
- }
- requestMessage := &ModifyNamespaceSettingRequest{
- ResourceType: NamespaceResourceTypeEndpoint,
- RequestType: RequestTypeRemove,
- Settings: settingsJson,
- }
-
- return ModifyNamespaceSettings(namespaceId, requestMessage)
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/hcn/hcnnetwork.go b/vendor/github.com/Microsoft/hcsshim/hcn/hcnnetwork.go
deleted file mode 100644
index a95fc1d75..000000000
--- a/vendor/github.com/Microsoft/hcsshim/hcn/hcnnetwork.go
+++ /dev/null
@@ -1,461 +0,0 @@
-package hcn
-
-import (
- "encoding/json"
- "errors"
-
- "github.com/Microsoft/go-winio/pkg/guid"
- "github.com/Microsoft/hcsshim/internal/interop"
- "github.com/sirupsen/logrus"
-)
-
-// Route is assoicated with a subnet.
-type Route struct {
- NextHop string `json:",omitempty"`
- DestinationPrefix string `json:",omitempty"`
- Metric uint16 `json:",omitempty"`
-}
-
-// Subnet is assoicated with a Ipam.
-type Subnet struct {
- IpAddressPrefix string `json:",omitempty"`
- Policies []json.RawMessage `json:",omitempty"`
- Routes []Route `json:",omitempty"`
-}
-
-// Ipam (Internet Protocol Addres Management) is assoicated with a network
-// and represents the address space(s) of a network.
-type Ipam struct {
- Type string `json:",omitempty"` // Ex: Static, DHCP
- Subnets []Subnet `json:",omitempty"`
-}
-
-// MacRange is associated with MacPool and respresents the start and end addresses.
-type MacRange struct {
- StartMacAddress string `json:",omitempty"`
- EndMacAddress string `json:",omitempty"`
-}
-
-// MacPool is assoicated with a network and represents pool of MacRanges.
-type MacPool struct {
- Ranges []MacRange `json:",omitempty"`
-}
-
-// Dns (Domain Name System is associated with a network.
-type Dns struct {
- Domain string `json:",omitempty"`
- Search []string `json:",omitempty"`
- ServerList []string `json:",omitempty"`
- Options []string `json:",omitempty"`
-}
-
-// NetworkType are various networks.
-type NetworkType string
-
-// NetworkType const
-const (
- NAT NetworkType = "NAT"
- Transparent NetworkType = "Transparent"
- L2Bridge NetworkType = "L2Bridge"
- L2Tunnel NetworkType = "L2Tunnel"
- ICS NetworkType = "ICS"
- Private NetworkType = "Private"
- Overlay NetworkType = "Overlay"
-)
-
-// NetworkFlags are various network flags.
-type NetworkFlags uint32
-
-// NetworkFlags const
-const (
- None NetworkFlags = 0
- EnableNonPersistent NetworkFlags = 8
-)
-
-// HostComputeNetwork represents a network
-type HostComputeNetwork struct {
- Id string `json:"ID,omitempty"`
- Name string `json:",omitempty"`
- Type NetworkType `json:",omitempty"`
- Policies []NetworkPolicy `json:",omitempty"`
- MacPool MacPool `json:",omitempty"`
- Dns Dns `json:",omitempty"`
- Ipams []Ipam `json:",omitempty"`
- Flags NetworkFlags `json:",omitempty"` // 0: None
- SchemaVersion SchemaVersion `json:",omitempty"`
-}
-
-// NetworkResourceType are the 3 different Network settings resources.
-type NetworkResourceType string
-
-var (
- // NetworkResourceTypePolicy is for Network's policies. Ex: RemoteSubnet
- NetworkResourceTypePolicy NetworkResourceType = "Policy"
- // NetworkResourceTypeDNS is for Network's DNS settings.
- NetworkResourceTypeDNS NetworkResourceType = "DNS"
- // NetworkResourceTypeExtension is for Network's extension settings.
- NetworkResourceTypeExtension NetworkResourceType = "Extension"
-)
-
-// ModifyNetworkSettingRequest is the structure used to send request to modify an network.
-// Used to update DNS/extension/policy on an network.
-type ModifyNetworkSettingRequest struct {
- ResourceType NetworkResourceType `json:",omitempty"` // Policy, DNS, Extension
- RequestType RequestType `json:",omitempty"` // Add, Remove, Update, Refresh
- Settings json.RawMessage `json:",omitempty"`
-}
-
-type PolicyNetworkRequest struct {
- Policies []NetworkPolicy `json:",omitempty"`
-}
-
-func getNetwork(networkGuid guid.GUID, query string) (*HostComputeNetwork, error) {
- // Open network.
- var (
- networkHandle hcnNetwork
- resultBuffer *uint16
- propertiesBuffer *uint16
- )
- hr := hcnOpenNetwork(&networkGuid, &networkHandle, &resultBuffer)
- if err := checkForErrors("hcnOpenNetwork", hr, resultBuffer); err != nil {
- return nil, err
- }
- // Query network.
- hr = hcnQueryNetworkProperties(networkHandle, query, &propertiesBuffer, &resultBuffer)
- if err := checkForErrors("hcnQueryNetworkProperties", hr, resultBuffer); err != nil {
- return nil, err
- }
- properties := interop.ConvertAndFreeCoTaskMemString(propertiesBuffer)
- // Close network.
- hr = hcnCloseNetwork(networkHandle)
- if err := checkForErrors("hcnCloseNetwork", hr, nil); err != nil {
- return nil, err
- }
- // Convert output to HostComputeNetwork
- var outputNetwork HostComputeNetwork
-
- // If HNS sets the network type to NAT (i.e. '0' in HNS.Schema.Network.NetworkMode),
- // the value will be omitted from the JSON blob. We therefore need to initialize NAT here before
- // unmarshaling the JSON blob.
- outputNetwork.Type = NAT
-
- if err := json.Unmarshal([]byte(properties), &outputNetwork); err != nil {
- return nil, err
- }
- return &outputNetwork, nil
-}
-
-func enumerateNetworks(query string) ([]HostComputeNetwork, error) {
- // Enumerate all Network Guids
- var (
- resultBuffer *uint16
- networkBuffer *uint16
- )
- hr := hcnEnumerateNetworks(query, &networkBuffer, &resultBuffer)
- if err := checkForErrors("hcnEnumerateNetworks", hr, resultBuffer); err != nil {
- return nil, err
- }
-
- networks := interop.ConvertAndFreeCoTaskMemString(networkBuffer)
- var networkIds []guid.GUID
- if err := json.Unmarshal([]byte(networks), &networkIds); err != nil {
- return nil, err
- }
-
- var outputNetworks []HostComputeNetwork
- for _, networkGuid := range networkIds {
- network, err := getNetwork(networkGuid, query)
- if err != nil {
- return nil, err
- }
- outputNetworks = append(outputNetworks, *network)
- }
- return outputNetworks, nil
-}
-
-func createNetwork(settings string) (*HostComputeNetwork, error) {
- // Create new network.
- var (
- networkHandle hcnNetwork
- resultBuffer *uint16
- propertiesBuffer *uint16
- )
- networkGuid := guid.GUID{}
- hr := hcnCreateNetwork(&networkGuid, settings, &networkHandle, &resultBuffer)
- if err := checkForErrors("hcnCreateNetwork", hr, resultBuffer); err != nil {
- return nil, err
- }
- // Query network.
- hcnQuery := defaultQuery()
- query, err := json.Marshal(hcnQuery)
- if err != nil {
- return nil, err
- }
- hr = hcnQueryNetworkProperties(networkHandle, string(query), &propertiesBuffer, &resultBuffer)
- if err := checkForErrors("hcnQueryNetworkProperties", hr, resultBuffer); err != nil {
- return nil, err
- }
- properties := interop.ConvertAndFreeCoTaskMemString(propertiesBuffer)
- // Close network.
- hr = hcnCloseNetwork(networkHandle)
- if err := checkForErrors("hcnCloseNetwork", hr, nil); err != nil {
- return nil, err
- }
- // Convert output to HostComputeNetwork
- var outputNetwork HostComputeNetwork
-
- // If HNS sets the network type to NAT (i.e. '0' in HNS.Schema.Network.NetworkMode),
- // the value will be omitted from the JSON blob. We therefore need to initialize NAT here before
- // unmarshaling the JSON blob.
- outputNetwork.Type = NAT
-
- if err := json.Unmarshal([]byte(properties), &outputNetwork); err != nil {
- return nil, err
- }
- return &outputNetwork, nil
-}
-
-func modifyNetwork(networkId string, settings string) (*HostComputeNetwork, error) {
- networkGuid, err := guid.FromString(networkId)
- if err != nil {
- return nil, errInvalidNetworkID
- }
- // Open Network
- var (
- networkHandle hcnNetwork
- resultBuffer *uint16
- propertiesBuffer *uint16
- )
- hr := hcnOpenNetwork(&networkGuid, &networkHandle, &resultBuffer)
- if err := checkForErrors("hcnOpenNetwork", hr, resultBuffer); err != nil {
- return nil, err
- }
- // Modify Network
- hr = hcnModifyNetwork(networkHandle, settings, &resultBuffer)
- if err := checkForErrors("hcnModifyNetwork", hr, resultBuffer); err != nil {
- return nil, err
- }
- // Query network.
- hcnQuery := defaultQuery()
- query, err := json.Marshal(hcnQuery)
- if err != nil {
- return nil, err
- }
- hr = hcnQueryNetworkProperties(networkHandle, string(query), &propertiesBuffer, &resultBuffer)
- if err := checkForErrors("hcnQueryNetworkProperties", hr, resultBuffer); err != nil {
- return nil, err
- }
- properties := interop.ConvertAndFreeCoTaskMemString(propertiesBuffer)
- // Close network.
- hr = hcnCloseNetwork(networkHandle)
- if err := checkForErrors("hcnCloseNetwork", hr, nil); err != nil {
- return nil, err
- }
- // Convert output to HostComputeNetwork
- var outputNetwork HostComputeNetwork
-
- // If HNS sets the network type to NAT (i.e. '0' in HNS.Schema.Network.NetworkMode),
- // the value will be omitted from the JSON blob. We therefore need to initialize NAT here before
- // unmarshaling the JSON blob.
- outputNetwork.Type = NAT
-
- if err := json.Unmarshal([]byte(properties), &outputNetwork); err != nil {
- return nil, err
- }
- return &outputNetwork, nil
-}
-
-func deleteNetwork(networkId string) error {
- networkGuid, err := guid.FromString(networkId)
- if err != nil {
- return errInvalidNetworkID
- }
- var resultBuffer *uint16
- hr := hcnDeleteNetwork(&networkGuid, &resultBuffer)
- if err := checkForErrors("hcnDeleteNetwork", hr, resultBuffer); err != nil {
- return err
- }
- return nil
-}
-
-// ListNetworks makes a call to list all available networks.
-func ListNetworks() ([]HostComputeNetwork, error) {
- hcnQuery := defaultQuery()
- networks, err := ListNetworksQuery(hcnQuery)
- if err != nil {
- return nil, err
- }
- return networks, nil
-}
-
-// ListNetworksQuery makes a call to query the list of available networks.
-func ListNetworksQuery(query HostComputeQuery) ([]HostComputeNetwork, error) {
- queryJson, err := json.Marshal(query)
- if err != nil {
- return nil, err
- }
-
- networks, err := enumerateNetworks(string(queryJson))
- if err != nil {
- return nil, err
- }
- return networks, nil
-}
-
-// GetNetworkByID returns the network specified by Id.
-func GetNetworkByID(networkID string) (*HostComputeNetwork, error) {
- hcnQuery := defaultQuery()
- mapA := map[string]string{"ID": networkID}
- filter, err := json.Marshal(mapA)
- if err != nil {
- return nil, err
- }
- hcnQuery.Filter = string(filter)
-
- networks, err := ListNetworksQuery(hcnQuery)
- if err != nil {
- return nil, err
- }
- if len(networks) == 0 {
- return nil, NetworkNotFoundError{NetworkID: networkID}
- }
- return &networks[0], err
-}
-
-// GetNetworkByName returns the network specified by Name.
-func GetNetworkByName(networkName string) (*HostComputeNetwork, error) {
- hcnQuery := defaultQuery()
- mapA := map[string]string{"Name": networkName}
- filter, err := json.Marshal(mapA)
- if err != nil {
- return nil, err
- }
- hcnQuery.Filter = string(filter)
-
- networks, err := ListNetworksQuery(hcnQuery)
- if err != nil {
- return nil, err
- }
- if len(networks) == 0 {
- return nil, NetworkNotFoundError{NetworkName: networkName}
- }
- return &networks[0], err
-}
-
-// Create Network.
-func (network *HostComputeNetwork) Create() (*HostComputeNetwork, error) {
- logrus.Debugf("hcn::HostComputeNetwork::Create id=%s", network.Id)
- for _, ipam := range network.Ipams {
- for _, subnet := range ipam.Subnets {
- if subnet.IpAddressPrefix != "" {
- hasDefault := false
- for _, route := range subnet.Routes {
- if route.NextHop == "" {
- return nil, errors.New("network create error, subnet has address prefix but no gateway specified")
- }
- if route.DestinationPrefix == "0.0.0.0/0" || route.DestinationPrefix == "::/0" {
- hasDefault = true
- }
- }
- if !hasDefault {
- return nil, errors.New("network create error, no default gateway")
- }
- }
- }
- }
-
- jsonString, err := json.Marshal(network)
- if err != nil {
- return nil, err
- }
-
- logrus.Debugf("hcn::HostComputeNetwork::Create JSON: %s", jsonString)
- network, hcnErr := createNetwork(string(jsonString))
- if hcnErr != nil {
- return nil, hcnErr
- }
- return network, nil
-}
-
-// Delete Network.
-func (network *HostComputeNetwork) Delete() error {
- logrus.Debugf("hcn::HostComputeNetwork::Delete id=%s", network.Id)
-
- if err := deleteNetwork(network.Id); err != nil {
- return err
- }
- return nil
-}
-
-// ModifyNetworkSettings updates the Policy for a network.
-func (network *HostComputeNetwork) ModifyNetworkSettings(request *ModifyNetworkSettingRequest) error {
- logrus.Debugf("hcn::HostComputeNetwork::ModifyNetworkSettings id=%s", network.Id)
-
- networkSettingsRequest, err := json.Marshal(request)
- if err != nil {
- return err
- }
-
- _, err = modifyNetwork(network.Id, string(networkSettingsRequest))
- if err != nil {
- return err
- }
- return nil
-}
-
-// AddPolicy applies a Policy (ex: RemoteSubnet) on the Network.
-func (network *HostComputeNetwork) AddPolicy(networkPolicy PolicyNetworkRequest) error {
- logrus.Debugf("hcn::HostComputeNetwork::AddPolicy id=%s", network.Id)
-
- settingsJson, err := json.Marshal(networkPolicy)
- if err != nil {
- return err
- }
- requestMessage := &ModifyNetworkSettingRequest{
- ResourceType: NetworkResourceTypePolicy,
- RequestType: RequestTypeAdd,
- Settings: settingsJson,
- }
-
- return network.ModifyNetworkSettings(requestMessage)
-}
-
-// RemovePolicy removes a Policy (ex: RemoteSubnet) from the Network.
-func (network *HostComputeNetwork) RemovePolicy(networkPolicy PolicyNetworkRequest) error {
- logrus.Debugf("hcn::HostComputeNetwork::RemovePolicy id=%s", network.Id)
-
- settingsJson, err := json.Marshal(networkPolicy)
- if err != nil {
- return err
- }
- requestMessage := &ModifyNetworkSettingRequest{
- ResourceType: NetworkResourceTypePolicy,
- RequestType: RequestTypeRemove,
- Settings: settingsJson,
- }
-
- return network.ModifyNetworkSettings(requestMessage)
-}
-
-// CreateEndpoint creates an endpoint on the Network.
-func (network *HostComputeNetwork) CreateEndpoint(endpoint *HostComputeEndpoint) (*HostComputeEndpoint, error) {
- isRemote := endpoint.Flags&EndpointFlagsRemoteEndpoint != 0
- logrus.Debugf("hcn::HostComputeNetwork::CreatEndpoint, networkId=%s remote=%t", network.Id, isRemote)
-
- endpoint.HostComputeNetwork = network.Id
- endpointSettings, err := json.Marshal(endpoint)
- if err != nil {
- return nil, err
- }
- newEndpoint, err := createEndpoint(network.Id, string(endpointSettings))
- if err != nil {
- return nil, err
- }
- return newEndpoint, nil
-}
-
-// CreateRemoteEndpoint creates a remote endpoint on the Network.
-func (network *HostComputeNetwork) CreateRemoteEndpoint(endpoint *HostComputeEndpoint) (*HostComputeEndpoint, error) {
- endpoint.Flags = EndpointFlagsRemoteEndpoint | endpoint.Flags
- return network.CreateEndpoint(endpoint)
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/hcn/hcnpolicy.go b/vendor/github.com/Microsoft/hcsshim/hcn/hcnpolicy.go
deleted file mode 100644
index d0fb6e49e..000000000
--- a/vendor/github.com/Microsoft/hcsshim/hcn/hcnpolicy.go
+++ /dev/null
@@ -1,232 +0,0 @@
-package hcn
-
-import (
- "encoding/json"
-)
-
-// EndpointPolicyType are the potential Policies that apply to Endpoints.
-type EndpointPolicyType string
-
-// EndpointPolicyType const
-const (
- PortMapping EndpointPolicyType = "PortMapping"
- ACL EndpointPolicyType = "ACL"
- QOS EndpointPolicyType = "QOS"
- L2Driver EndpointPolicyType = "L2Driver"
- OutBoundNAT EndpointPolicyType = "OutBoundNAT"
- SDNRoute EndpointPolicyType = "SDNRoute"
- L4Proxy EndpointPolicyType = "L4Proxy"
- L4WFPPROXY EndpointPolicyType = "L4WFPPROXY"
- PortName EndpointPolicyType = "PortName"
- EncapOverhead EndpointPolicyType = "EncapOverhead"
- // Endpoint and Network have InterfaceConstraint and ProviderAddress
- NetworkProviderAddress EndpointPolicyType = "ProviderAddress"
- NetworkInterfaceConstraint EndpointPolicyType = "InterfaceConstraint"
-)
-
-// EndpointPolicy is a collection of Policy settings for an Endpoint.
-type EndpointPolicy struct {
- Type EndpointPolicyType `json:""`
- Settings json.RawMessage `json:",omitempty"`
-}
-
-// NetworkPolicyType are the potential Policies that apply to Networks.
-type NetworkPolicyType string
-
-// NetworkPolicyType const
-const (
- SourceMacAddress NetworkPolicyType = "SourceMacAddress"
- NetAdapterName NetworkPolicyType = "NetAdapterName"
- VSwitchExtension NetworkPolicyType = "VSwitchExtension"
- DrMacAddress NetworkPolicyType = "DrMacAddress"
- AutomaticDNS NetworkPolicyType = "AutomaticDNS"
- InterfaceConstraint NetworkPolicyType = "InterfaceConstraint"
- ProviderAddress NetworkPolicyType = "ProviderAddress"
- RemoteSubnetRoute NetworkPolicyType = "RemoteSubnetRoute"
- HostRoute NetworkPolicyType = "HostRoute"
-)
-
-// NetworkPolicy is a collection of Policy settings for a Network.
-type NetworkPolicy struct {
- Type NetworkPolicyType `json:""`
- Settings json.RawMessage `json:",omitempty"`
-}
-
-// SubnetPolicyType are the potential Policies that apply to Subnets.
-type SubnetPolicyType string
-
-// SubnetPolicyType const
-const (
- VLAN SubnetPolicyType = "VLAN"
- VSID SubnetPolicyType = "VSID"
-)
-
-// SubnetPolicy is a collection of Policy settings for a Subnet.
-type SubnetPolicy struct {
- Type SubnetPolicyType `json:""`
- Settings json.RawMessage `json:",omitempty"`
-}
-
-// NatFlags are flags for portmappings.
-type NatFlags uint32
-
-/// Endpoint Policy objects
-
-// PortMappingPolicySetting defines Port Mapping (NAT)
-type PortMappingPolicySetting struct {
- Protocol uint32 `json:",omitempty"` // EX: TCP = 6, UDP = 17
- InternalPort uint16 `json:",omitempty"`
- ExternalPort uint16 `json:",omitempty"`
- VIP string `json:",omitempty"`
- Flags NatFlags `json:",omitempty"`
-}
-
-// ActionType associated with ACLs. Value is either Allow or Block.
-type ActionType string
-
-// DirectionType associated with ACLs. Value is either In or Out.
-type DirectionType string
-
-// RuleType associated with ACLs. Value is either Host (WFP) or Switch (VFP).
-type RuleType string
-
-const (
- // Allow traffic
- ActionTypeAllow ActionType = "Allow"
- // Block traffic
- ActionTypeBlock ActionType = "Block"
-
- // In is traffic coming to the Endpoint
- DirectionTypeIn DirectionType = "In"
- // Out is traffic leaving the Endpoint
- DirectionTypeOut DirectionType = "Out"
-
- // Host creates WFP (Windows Firewall) rules
- RuleTypeHost RuleType = "Host"
- // Switch creates VFP (Virtual Filter Platform) rules
- RuleTypeSwitch RuleType = "Switch"
-)
-
-// AclPolicySetting creates firewall rules on an endpoint
-type AclPolicySetting struct {
- Protocols string `json:",omitempty"` // EX: 6 (TCP), 17 (UDP), 1 (ICMPv4), 58 (ICMPv6), 2 (IGMP)
- Action ActionType `json:","`
- Direction DirectionType `json:","`
- LocalAddresses string `json:",omitempty"`
- RemoteAddresses string `json:",omitempty"`
- LocalPorts string `json:",omitempty"`
- RemotePorts string `json:",omitempty"`
- RuleType RuleType `json:",omitempty"`
- Priority uint16 `json:",omitempty"`
-}
-
-// QosPolicySetting sets Quality of Service bandwidth caps on an Endpoint.
-type QosPolicySetting struct {
- MaximumOutgoingBandwidthInBytes uint64
-}
-
-// OutboundNatPolicySetting sets outbound Network Address Translation on an Endpoint.
-type OutboundNatPolicySetting struct {
- VirtualIP string `json:",omitempty"`
- Exceptions []string `json:",omitempty"`
- Destinations []string `json:",omitempty"`
-}
-
-// SDNRoutePolicySetting sets SDN Route on an Endpoint.
-type SDNRoutePolicySetting struct {
- DestinationPrefix string `json:",omitempty"`
- NextHop string `json:",omitempty"`
- NeedEncap bool `json:",omitempty"`
-}
-
-// FiveTuple is nested in L4ProxyPolicySetting for WFP support.
-type FiveTuple struct {
- Protocols string `json:",omitempty"`
- LocalAddresses string `json:",omitempty"`
- RemoteAddresses string `json:",omitempty"`
- LocalPorts string `json:",omitempty"`
- RemotePorts string `json:",omitempty"`
- Priority uint16 `json:",omitempty"`
-}
-
-// L4WfpProxyPolicySetting sets Layer-4 Proxy on an endpoint.
-type L4WfpProxyPolicySetting struct {
- Port string `json:",omitempty"`
- FilterTuple FiveTuple `json:",omitempty"`
- UserSID string `json:",omitempty"`
-}
-
-// PortnameEndpointPolicySetting sets the port name for an endpoint.
-type PortnameEndpointPolicySetting struct {
- Name string `json:",omitempty"`
-}
-
-// EncapOverheadEndpointPolicySetting sets the encap overhead for an endpoint.
-type EncapOverheadEndpointPolicySetting struct {
- Overhead uint16 `json:",omitempty"`
-}
-
-/// Endpoint and Network Policy objects
-
-// ProviderAddressEndpointPolicySetting sets the PA for an endpoint.
-type ProviderAddressEndpointPolicySetting struct {
- ProviderAddress string `json:",omitempty"`
-}
-
-// InterfaceConstraintPolicySetting limits an Endpoint or Network to a specific Nic.
-type InterfaceConstraintPolicySetting struct {
- InterfaceGuid string `json:",omitempty"`
- InterfaceLuid uint64 `json:",omitempty"`
- InterfaceIndex uint32 `json:",omitempty"`
- InterfaceMediaType uint32 `json:",omitempty"`
- InterfaceAlias string `json:",omitempty"`
- InterfaceDescription string `json:",omitempty"`
-}
-
-/// Network Policy objects
-
-// SourceMacAddressNetworkPolicySetting sets source MAC for a network.
-type SourceMacAddressNetworkPolicySetting struct {
- SourceMacAddress string `json:",omitempty"`
-}
-
-// NetAdapterNameNetworkPolicySetting sets network adapter of a network.
-type NetAdapterNameNetworkPolicySetting struct {
- NetworkAdapterName string `json:",omitempty"`
-}
-
-// VSwitchExtensionNetworkPolicySetting enables/disabled VSwitch extensions for a network.
-type VSwitchExtensionNetworkPolicySetting struct {
- ExtensionID string `json:",omitempty"`
- Enable bool `json:",omitempty"`
-}
-
-// DrMacAddressNetworkPolicySetting sets the DR MAC for a network.
-type DrMacAddressNetworkPolicySetting struct {
- Address string `json:",omitempty"`
-}
-
-// AutomaticDNSNetworkPolicySetting enables/disables automatic DNS on a network.
-type AutomaticDNSNetworkPolicySetting struct {
- Enable bool `json:",omitempty"`
-}
-
-/// Subnet Policy objects
-
-// VlanPolicySetting isolates a subnet with VLAN tagging.
-type VlanPolicySetting struct {
- IsolationId uint32 `json:","`
-}
-
-// VsidPolicySetting isolates a subnet with VSID tagging.
-type VsidPolicySetting struct {
- IsolationId uint32 `json:","`
-}
-
-// RemoteSubnetRoutePolicySetting creates remote subnet route rules on a network
-type RemoteSubnetRoutePolicySetting struct {
- DestinationPrefix string
- IsolationId uint16
- ProviderAddress string
- DistributedRouterMacAddress string
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/hcn/hcnroute.go b/vendor/github.com/Microsoft/hcsshim/hcn/hcnroute.go
deleted file mode 100644
index d6d27079b..000000000
--- a/vendor/github.com/Microsoft/hcsshim/hcn/hcnroute.go
+++ /dev/null
@@ -1,266 +0,0 @@
-package hcn
-
-import (
- "encoding/json"
- "errors"
-
- "github.com/Microsoft/go-winio/pkg/guid"
- "github.com/Microsoft/hcsshim/internal/interop"
- "github.com/sirupsen/logrus"
-)
-
-// HostComputeRoute represents SDN routes.
-type HostComputeRoute struct {
- ID string `json:"ID,omitempty"`
- HostComputeEndpoints []string `json:",omitempty"`
- Setting []SDNRoutePolicySetting `json:",omitempty"`
- SchemaVersion SchemaVersion `json:",omitempty"`
-}
-
-// ListRoutes makes a call to list all available routes.
-func ListRoutes() ([]HostComputeRoute, error) {
- hcnQuery := defaultQuery()
- routes, err := ListRoutesQuery(hcnQuery)
- if err != nil {
- return nil, err
- }
- return routes, nil
-}
-
-// ListRoutesQuery makes a call to query the list of available routes.
-func ListRoutesQuery(query HostComputeQuery) ([]HostComputeRoute, error) {
- queryJSON, err := json.Marshal(query)
- if err != nil {
- return nil, err
- }
-
- routes, err := enumerateRoutes(string(queryJSON))
- if err != nil {
- return nil, err
- }
- return routes, nil
-}
-
-// GetRouteByID returns the route specified by Id.
-func GetRouteByID(routeID string) (*HostComputeRoute, error) {
- hcnQuery := defaultQuery()
- mapA := map[string]string{"ID": routeID}
- filter, err := json.Marshal(mapA)
- if err != nil {
- return nil, err
- }
- hcnQuery.Filter = string(filter)
-
- routes, err := ListRoutesQuery(hcnQuery)
- if err != nil {
- return nil, err
- }
- if len(routes) == 0 {
- return nil, RouteNotFoundError{RouteId: routeID}
- }
- return &routes[0], err
-}
-
-// Create Route.
-func (route *HostComputeRoute) Create() (*HostComputeRoute, error) {
- logrus.Debugf("hcn::HostComputeRoute::Create id=%s", route.ID)
-
- jsonString, err := json.Marshal(route)
- if err != nil {
- return nil, err
- }
-
- logrus.Debugf("hcn::HostComputeRoute::Create JSON: %s", jsonString)
- route, hcnErr := createRoute(string(jsonString))
- if hcnErr != nil {
- return nil, hcnErr
- }
- return route, nil
-}
-
-// Delete Route.
-func (route *HostComputeRoute) Delete() error {
- logrus.Debugf("hcn::HostComputeRoute::Delete id=%s", route.ID)
-
- existingRoute, _ := GetRouteByID(route.ID)
-
- if existingRoute != nil {
- if err := deleteRoute(route.ID); err != nil {
- return err
- }
- }
-
- return nil
-}
-
-// AddEndpoint add an endpoint to a route
-// Since HCNRoute doesn't implement modify functionality, add operation is essentially delete and add
-func (route *HostComputeRoute) AddEndpoint(endpoint *HostComputeEndpoint) (*HostComputeRoute, error) {
- logrus.Debugf("hcn::HostComputeRoute::AddEndpoint route=%s endpoint=%s", route.ID, endpoint.Id)
-
- err := route.Delete()
- if err != nil {
- return nil, err
- }
-
- // Add Endpoint to the Existing List
- route.HostComputeEndpoints = append(route.HostComputeEndpoints, endpoint.Id)
-
- return route.Create()
-}
-
-// RemoveEndpoint removes an endpoint from a route
-// Since HCNRoute doesn't implement modify functionality, remove operation is essentially delete and add
-func (route *HostComputeRoute) RemoveEndpoint(endpoint *HostComputeEndpoint) (*HostComputeRoute, error) {
- logrus.Debugf("hcn::HostComputeRoute::RemoveEndpoint route=%s endpoint=%s", route.ID, endpoint.Id)
-
- err := route.Delete()
- if err != nil {
- return nil, err
- }
-
- // Create a list of all the endpoints besides the one being removed
- i := 0
- for index, endpointReference := range route.HostComputeEndpoints {
- if endpointReference == endpoint.Id {
- i = index
- break
- }
- }
-
- route.HostComputeEndpoints = append(route.HostComputeEndpoints[0:i], route.HostComputeEndpoints[i+1:]...)
- return route.Create()
-}
-
-// AddRoute for the specified endpoints and SDN Route setting
-func AddRoute(endpoints []HostComputeEndpoint, destinationPrefix string, nextHop string, needEncapsulation bool) (*HostComputeRoute, error) {
- logrus.Debugf("hcn::HostComputeRoute::AddRoute endpointId=%v, destinationPrefix=%v, nextHop=%v, needEncapsulation=%v", endpoints, destinationPrefix, nextHop, needEncapsulation)
-
- if len(endpoints) <= 0 {
- return nil, errors.New("Missing endpoints")
- }
-
- route := &HostComputeRoute{
- SchemaVersion: V2SchemaVersion(),
- Setting: []SDNRoutePolicySetting{
- {
- DestinationPrefix: destinationPrefix,
- NextHop: nextHop,
- NeedEncap: needEncapsulation,
- },
- },
- }
-
- for _, endpoint := range endpoints {
- route.HostComputeEndpoints = append(route.HostComputeEndpoints, endpoint.Id)
- }
-
- return route.Create()
-}
-
-func enumerateRoutes(query string) ([]HostComputeRoute, error) {
- // Enumerate all routes Guids
- var (
- resultBuffer *uint16
- routeBuffer *uint16
- )
- hr := hcnEnumerateRoutes(query, &routeBuffer, &resultBuffer)
- if err := checkForErrors("hcnEnumerateRoutes", hr, resultBuffer); err != nil {
- return nil, err
- }
-
- routes := interop.ConvertAndFreeCoTaskMemString(routeBuffer)
- var routeIds []guid.GUID
- if err := json.Unmarshal([]byte(routes), &routeIds); err != nil {
- return nil, err
- }
-
- var outputRoutes []HostComputeRoute
- for _, routeGUID := range routeIds {
- route, err := getRoute(routeGUID, query)
- if err != nil {
- return nil, err
- }
- outputRoutes = append(outputRoutes, *route)
- }
- return outputRoutes, nil
-}
-
-func getRoute(routeGUID guid.GUID, query string) (*HostComputeRoute, error) {
- // Open routes.
- var (
- routeHandle hcnRoute
- resultBuffer *uint16
- propertiesBuffer *uint16
- )
- hr := hcnOpenRoute(&routeGUID, &routeHandle, &resultBuffer)
- if err := checkForErrors("hcnOpenRoute", hr, resultBuffer); err != nil {
- return nil, err
- }
- // Query routes.
- hr = hcnQueryRouteProperties(routeHandle, query, &propertiesBuffer, &resultBuffer)
- if err := checkForErrors("hcnQueryRouteProperties", hr, resultBuffer); err != nil {
- return nil, err
- }
- properties := interop.ConvertAndFreeCoTaskMemString(propertiesBuffer)
- // Close routes.
- hr = hcnCloseRoute(routeHandle)
- if err := checkForErrors("hcnCloseRoute", hr, nil); err != nil {
- return nil, err
- }
- // Convert output to HostComputeRoute
- var outputRoute HostComputeRoute
- if err := json.Unmarshal([]byte(properties), &outputRoute); err != nil {
- return nil, err
- }
- return &outputRoute, nil
-}
-
-func createRoute(settings string) (*HostComputeRoute, error) {
- // Create new route.
- var (
- routeHandle hcnRoute
- resultBuffer *uint16
- propertiesBuffer *uint16
- )
- routeGUID := guid.GUID{}
- hr := hcnCreateRoute(&routeGUID, settings, &routeHandle, &resultBuffer)
- if err := checkForErrors("hcnCreateRoute", hr, resultBuffer); err != nil {
- return nil, err
- }
- // Query route.
- hcnQuery := defaultQuery()
- query, err := json.Marshal(hcnQuery)
- if err != nil {
- return nil, err
- }
- hr = hcnQueryRouteProperties(routeHandle, string(query), &propertiesBuffer, &resultBuffer)
- if err := checkForErrors("hcnQueryRouteProperties", hr, resultBuffer); err != nil {
- return nil, err
- }
- properties := interop.ConvertAndFreeCoTaskMemString(propertiesBuffer)
- // Close Route.
- hr = hcnCloseRoute(routeHandle)
- if err := checkForErrors("hcnCloseRoute", hr, nil); err != nil {
- return nil, err
- }
- // Convert output to HostComputeRoute
- var outputRoute HostComputeRoute
- if err := json.Unmarshal([]byte(properties), &outputRoute); err != nil {
- return nil, err
- }
- return &outputRoute, nil
-}
-
-func deleteRoute(routeID string) error {
- routeGUID, err := guid.FromString(routeID)
- if err != nil {
- return errInvalidRouteID
- }
- var resultBuffer *uint16
- hr := hcnDeleteRoute(&routeGUID, &resultBuffer)
- if err := checkForErrors("hcnDeleteRoute", hr, resultBuffer); err != nil {
- return err
- }
- return nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/hcn/hcnsupport.go b/vendor/github.com/Microsoft/hcsshim/hcn/hcnsupport.go
deleted file mode 100644
index 401bda40d..000000000
--- a/vendor/github.com/Microsoft/hcsshim/hcn/hcnsupport.go
+++ /dev/null
@@ -1,96 +0,0 @@
-package hcn
-
-import (
- "github.com/sirupsen/logrus"
-)
-
-// SupportedFeatures are the features provided by the Service.
-type SupportedFeatures struct {
- Acl AclFeatures `json:"ACL"`
- Api ApiSupport `json:"API"`
- RemoteSubnet bool `json:"RemoteSubnet"`
- HostRoute bool `json:"HostRoute"`
- DSR bool `json:"DSR"`
- Slash32EndpointPrefixes bool `json:"Slash32EndpointPrefixes"`
- AclSupportForProtocol252 bool `json:"AclSupportForProtocol252"`
- SessionAffinity bool `json:"SessionAffinity"`
- IPv6DualStack bool `json:"IPv6DualStack"`
-}
-
-// AclFeatures are the supported ACL possibilities.
-type AclFeatures struct {
- AclAddressLists bool `json:"AclAddressLists"`
- AclNoHostRulePriority bool `json:"AclHostRulePriority"`
- AclPortRanges bool `json:"AclPortRanges"`
- AclRuleId bool `json:"AclRuleId"`
-}
-
-// ApiSupport lists the supported API versions.
-type ApiSupport struct {
- V1 bool `json:"V1"`
- V2 bool `json:"V2"`
-}
-
-// GetSupportedFeatures returns the features supported by the Service.
-func GetSupportedFeatures() SupportedFeatures {
- var features SupportedFeatures
-
- globals, err := GetGlobals()
- if err != nil {
- // Expected on pre-1803 builds, all features will be false/unsupported
- logrus.Debugf("Unable to obtain globals: %s", err)
- return features
- }
-
- features.Acl = AclFeatures{
- AclAddressLists: isFeatureSupported(globals.Version, HNSVersion1803),
- AclNoHostRulePriority: isFeatureSupported(globals.Version, HNSVersion1803),
- AclPortRanges: isFeatureSupported(globals.Version, HNSVersion1803),
- AclRuleId: isFeatureSupported(globals.Version, HNSVersion1803),
- }
-
- features.Api = ApiSupport{
- V2: isFeatureSupported(globals.Version, V2ApiSupport),
- V1: true, // HNSCall is still available.
- }
-
- features.RemoteSubnet = isFeatureSupported(globals.Version, RemoteSubnetVersion)
- features.HostRoute = isFeatureSupported(globals.Version, HostRouteVersion)
- features.DSR = isFeatureSupported(globals.Version, DSRVersion)
- features.Slash32EndpointPrefixes = isFeatureSupported(globals.Version, Slash32EndpointPrefixesVersion)
- features.AclSupportForProtocol252 = isFeatureSupported(globals.Version, AclSupportForProtocol252Version)
- features.SessionAffinity = isFeatureSupported(globals.Version, SessionAffinityVersion)
- features.IPv6DualStack = isFeatureSupported(globals.Version, IPv6DualStackVersion)
-
- return features
-}
-
-func isFeatureSupported(currentVersion Version, versionsSupported VersionRanges) bool {
- isFeatureSupported := false
-
- for _, versionRange := range versionsSupported {
- isFeatureSupported = isFeatureSupported || isFeatureInRange(currentVersion, versionRange)
- }
-
- return isFeatureSupported
-}
-
-func isFeatureInRange(currentVersion Version, versionRange VersionRange) bool {
- if currentVersion.Major < versionRange.MinVersion.Major {
- logrus.Infof("currentVersion.Major < versionRange.MinVersion.Major: %v, %v", currentVersion.Major, versionRange.MinVersion.Major)
- return false
- }
- if currentVersion.Major > versionRange.MaxVersion.Major {
- logrus.Infof("currentVersion.Major > versionRange.MaxVersion.Major: %v, %v", currentVersion.Major, versionRange.MaxVersion.Major)
- return false
- }
- if currentVersion.Major == versionRange.MinVersion.Major && currentVersion.Minor < versionRange.MinVersion.Minor {
- logrus.Infof("currentVersion.Minor < versionRange.MinVersion.Major: %v, %v", currentVersion.Minor, versionRange.MinVersion.Minor)
- return false
- }
- if currentVersion.Major == versionRange.MaxVersion.Major && currentVersion.Minor > versionRange.MaxVersion.Minor {
- logrus.Infof("currentVersion.Minor > versionRange.MaxVersion.Major: %v, %v", currentVersion.Minor, versionRange.MaxVersion.Minor)
- return false
- }
- return true
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/hcn/zsyscall_windows.go b/vendor/github.com/Microsoft/hcsshim/hcn/zsyscall_windows.go
deleted file mode 100644
index 466d30457..000000000
--- a/vendor/github.com/Microsoft/hcsshim/hcn/zsyscall_windows.go
+++ /dev/null
@@ -1,855 +0,0 @@
-// Code generated mksyscall_windows.exe DO NOT EDIT
-
-package hcn
-
-import (
- "syscall"
- "unsafe"
-
- "golang.org/x/sys/windows"
-)
-
-var _ unsafe.Pointer
-
-// Do the interface allocations only once for common
-// Errno values.
-const (
- errnoERROR_IO_PENDING = 997
-)
-
-var (
- errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING)
-)
-
-// errnoErr returns common boxed Errno values, to prevent
-// allocations at runtime.
-func errnoErr(e syscall.Errno) error {
- switch e {
- case 0:
- return nil
- case errnoERROR_IO_PENDING:
- return errERROR_IO_PENDING
- }
- // TODO: add more here, after collecting data on the common
- // error values see on Windows. (perhaps when running
- // all.bat?)
- return e
-}
-
-var (
- modiphlpapi = windows.NewLazySystemDLL("iphlpapi.dll")
- modvmcompute = windows.NewLazySystemDLL("vmcompute.dll")
- modcomputenetwork = windows.NewLazySystemDLL("computenetwork.dll")
-
- procSetCurrentThreadCompartmentId = modiphlpapi.NewProc("SetCurrentThreadCompartmentId")
- procHNSCall = modvmcompute.NewProc("HNSCall")
- procHcnEnumerateNetworks = modcomputenetwork.NewProc("HcnEnumerateNetworks")
- procHcnCreateNetwork = modcomputenetwork.NewProc("HcnCreateNetwork")
- procHcnOpenNetwork = modcomputenetwork.NewProc("HcnOpenNetwork")
- procHcnModifyNetwork = modcomputenetwork.NewProc("HcnModifyNetwork")
- procHcnQueryNetworkProperties = modcomputenetwork.NewProc("HcnQueryNetworkProperties")
- procHcnDeleteNetwork = modcomputenetwork.NewProc("HcnDeleteNetwork")
- procHcnCloseNetwork = modcomputenetwork.NewProc("HcnCloseNetwork")
- procHcnEnumerateEndpoints = modcomputenetwork.NewProc("HcnEnumerateEndpoints")
- procHcnCreateEndpoint = modcomputenetwork.NewProc("HcnCreateEndpoint")
- procHcnOpenEndpoint = modcomputenetwork.NewProc("HcnOpenEndpoint")
- procHcnModifyEndpoint = modcomputenetwork.NewProc("HcnModifyEndpoint")
- procHcnQueryEndpointProperties = modcomputenetwork.NewProc("HcnQueryEndpointProperties")
- procHcnDeleteEndpoint = modcomputenetwork.NewProc("HcnDeleteEndpoint")
- procHcnCloseEndpoint = modcomputenetwork.NewProc("HcnCloseEndpoint")
- procHcnEnumerateNamespaces = modcomputenetwork.NewProc("HcnEnumerateNamespaces")
- procHcnCreateNamespace = modcomputenetwork.NewProc("HcnCreateNamespace")
- procHcnOpenNamespace = modcomputenetwork.NewProc("HcnOpenNamespace")
- procHcnModifyNamespace = modcomputenetwork.NewProc("HcnModifyNamespace")
- procHcnQueryNamespaceProperties = modcomputenetwork.NewProc("HcnQueryNamespaceProperties")
- procHcnDeleteNamespace = modcomputenetwork.NewProc("HcnDeleteNamespace")
- procHcnCloseNamespace = modcomputenetwork.NewProc("HcnCloseNamespace")
- procHcnEnumerateLoadBalancers = modcomputenetwork.NewProc("HcnEnumerateLoadBalancers")
- procHcnCreateLoadBalancer = modcomputenetwork.NewProc("HcnCreateLoadBalancer")
- procHcnOpenLoadBalancer = modcomputenetwork.NewProc("HcnOpenLoadBalancer")
- procHcnModifyLoadBalancer = modcomputenetwork.NewProc("HcnModifyLoadBalancer")
- procHcnQueryLoadBalancerProperties = modcomputenetwork.NewProc("HcnQueryLoadBalancerProperties")
- procHcnDeleteLoadBalancer = modcomputenetwork.NewProc("HcnDeleteLoadBalancer")
- procHcnCloseLoadBalancer = modcomputenetwork.NewProc("HcnCloseLoadBalancer")
- procHcnEnumerateSdnRoutes = modcomputenetwork.NewProc("HcnEnumerateSdnRoutes")
- procHcnCreateSdnRoute = modcomputenetwork.NewProc("HcnCreateSdnRoute")
- procHcnOpenSdnRoute = modcomputenetwork.NewProc("HcnOpenSdnRoute")
- procHcnModifySdnRoute = modcomputenetwork.NewProc("HcnModifySdnRoute")
- procHcnQuerySdnRouteProperties = modcomputenetwork.NewProc("HcnQuerySdnRouteProperties")
- procHcnDeleteSdnRoute = modcomputenetwork.NewProc("HcnDeleteSdnRoute")
- procHcnCloseSdnRoute = modcomputenetwork.NewProc("HcnCloseSdnRoute")
- procHcnOpenService = modcomputenetwork.NewProc("HcnOpenService")
- procHcnRegisterServiceCallback = modcomputenetwork.NewProc("HcnRegisterServiceCallback")
- procHcnUnregisterServiceCallback = modcomputenetwork.NewProc("HcnUnregisterServiceCallback")
- procHcnCloseService = modcomputenetwork.NewProc("HcnCloseService")
-)
-
-func SetCurrentThreadCompartmentId(compartmentId uint32) (hr error) {
- r0, _, _ := syscall.Syscall(procSetCurrentThreadCompartmentId.Addr(), 1, uintptr(compartmentId), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func _hnsCall(method string, path string, object string, response **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(method)
- if hr != nil {
- return
- }
- var _p1 *uint16
- _p1, hr = syscall.UTF16PtrFromString(path)
- if hr != nil {
- return
- }
- var _p2 *uint16
- _p2, hr = syscall.UTF16PtrFromString(object)
- if hr != nil {
- return
- }
- return __hnsCall(_p0, _p1, _p2, response)
-}
-
-func __hnsCall(method *uint16, path *uint16, object *uint16, response **uint16) (hr error) {
- if hr = procHNSCall.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall6(procHNSCall.Addr(), 4, uintptr(unsafe.Pointer(method)), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(object)), uintptr(unsafe.Pointer(response)), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnEnumerateNetworks(query string, networks **uint16, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(query)
- if hr != nil {
- return
- }
- return _hcnEnumerateNetworks(_p0, networks, result)
-}
-
-func _hcnEnumerateNetworks(query *uint16, networks **uint16, result **uint16) (hr error) {
- if hr = procHcnEnumerateNetworks.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcnEnumerateNetworks.Addr(), 3, uintptr(unsafe.Pointer(query)), uintptr(unsafe.Pointer(networks)), uintptr(unsafe.Pointer(result)))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnCreateNetwork(id *_guid, settings string, network *hcnNetwork, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(settings)
- if hr != nil {
- return
- }
- return _hcnCreateNetwork(id, _p0, network, result)
-}
-
-func _hcnCreateNetwork(id *_guid, settings *uint16, network *hcnNetwork, result **uint16) (hr error) {
- if hr = procHcnCreateNetwork.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall6(procHcnCreateNetwork.Addr(), 4, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(settings)), uintptr(unsafe.Pointer(network)), uintptr(unsafe.Pointer(result)), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnOpenNetwork(id *_guid, network *hcnNetwork, result **uint16) (hr error) {
- if hr = procHcnOpenNetwork.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcnOpenNetwork.Addr(), 3, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(network)), uintptr(unsafe.Pointer(result)))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnModifyNetwork(network hcnNetwork, settings string, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(settings)
- if hr != nil {
- return
- }
- return _hcnModifyNetwork(network, _p0, result)
-}
-
-func _hcnModifyNetwork(network hcnNetwork, settings *uint16, result **uint16) (hr error) {
- if hr = procHcnModifyNetwork.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcnModifyNetwork.Addr(), 3, uintptr(network), uintptr(unsafe.Pointer(settings)), uintptr(unsafe.Pointer(result)))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnQueryNetworkProperties(network hcnNetwork, query string, properties **uint16, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(query)
- if hr != nil {
- return
- }
- return _hcnQueryNetworkProperties(network, _p0, properties, result)
-}
-
-func _hcnQueryNetworkProperties(network hcnNetwork, query *uint16, properties **uint16, result **uint16) (hr error) {
- if hr = procHcnQueryNetworkProperties.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall6(procHcnQueryNetworkProperties.Addr(), 4, uintptr(network), uintptr(unsafe.Pointer(query)), uintptr(unsafe.Pointer(properties)), uintptr(unsafe.Pointer(result)), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnDeleteNetwork(id *_guid, result **uint16) (hr error) {
- if hr = procHcnDeleteNetwork.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcnDeleteNetwork.Addr(), 2, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(result)), 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnCloseNetwork(network hcnNetwork) (hr error) {
- if hr = procHcnCloseNetwork.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcnCloseNetwork.Addr(), 1, uintptr(network), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnEnumerateEndpoints(query string, endpoints **uint16, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(query)
- if hr != nil {
- return
- }
- return _hcnEnumerateEndpoints(_p0, endpoints, result)
-}
-
-func _hcnEnumerateEndpoints(query *uint16, endpoints **uint16, result **uint16) (hr error) {
- if hr = procHcnEnumerateEndpoints.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcnEnumerateEndpoints.Addr(), 3, uintptr(unsafe.Pointer(query)), uintptr(unsafe.Pointer(endpoints)), uintptr(unsafe.Pointer(result)))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnCreateEndpoint(network hcnNetwork, id *_guid, settings string, endpoint *hcnEndpoint, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(settings)
- if hr != nil {
- return
- }
- return _hcnCreateEndpoint(network, id, _p0, endpoint, result)
-}
-
-func _hcnCreateEndpoint(network hcnNetwork, id *_guid, settings *uint16, endpoint *hcnEndpoint, result **uint16) (hr error) {
- if hr = procHcnCreateEndpoint.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall6(procHcnCreateEndpoint.Addr(), 5, uintptr(network), uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(settings)), uintptr(unsafe.Pointer(endpoint)), uintptr(unsafe.Pointer(result)), 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnOpenEndpoint(id *_guid, endpoint *hcnEndpoint, result **uint16) (hr error) {
- if hr = procHcnOpenEndpoint.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcnOpenEndpoint.Addr(), 3, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(endpoint)), uintptr(unsafe.Pointer(result)))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnModifyEndpoint(endpoint hcnEndpoint, settings string, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(settings)
- if hr != nil {
- return
- }
- return _hcnModifyEndpoint(endpoint, _p0, result)
-}
-
-func _hcnModifyEndpoint(endpoint hcnEndpoint, settings *uint16, result **uint16) (hr error) {
- if hr = procHcnModifyEndpoint.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcnModifyEndpoint.Addr(), 3, uintptr(endpoint), uintptr(unsafe.Pointer(settings)), uintptr(unsafe.Pointer(result)))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnQueryEndpointProperties(endpoint hcnEndpoint, query string, properties **uint16, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(query)
- if hr != nil {
- return
- }
- return _hcnQueryEndpointProperties(endpoint, _p0, properties, result)
-}
-
-func _hcnQueryEndpointProperties(endpoint hcnEndpoint, query *uint16, properties **uint16, result **uint16) (hr error) {
- if hr = procHcnQueryEndpointProperties.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall6(procHcnQueryEndpointProperties.Addr(), 4, uintptr(endpoint), uintptr(unsafe.Pointer(query)), uintptr(unsafe.Pointer(properties)), uintptr(unsafe.Pointer(result)), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnDeleteEndpoint(id *_guid, result **uint16) (hr error) {
- if hr = procHcnDeleteEndpoint.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcnDeleteEndpoint.Addr(), 2, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(result)), 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnCloseEndpoint(endpoint hcnEndpoint) (hr error) {
- if hr = procHcnCloseEndpoint.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcnCloseEndpoint.Addr(), 1, uintptr(endpoint), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnEnumerateNamespaces(query string, namespaces **uint16, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(query)
- if hr != nil {
- return
- }
- return _hcnEnumerateNamespaces(_p0, namespaces, result)
-}
-
-func _hcnEnumerateNamespaces(query *uint16, namespaces **uint16, result **uint16) (hr error) {
- if hr = procHcnEnumerateNamespaces.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcnEnumerateNamespaces.Addr(), 3, uintptr(unsafe.Pointer(query)), uintptr(unsafe.Pointer(namespaces)), uintptr(unsafe.Pointer(result)))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnCreateNamespace(id *_guid, settings string, namespace *hcnNamespace, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(settings)
- if hr != nil {
- return
- }
- return _hcnCreateNamespace(id, _p0, namespace, result)
-}
-
-func _hcnCreateNamespace(id *_guid, settings *uint16, namespace *hcnNamespace, result **uint16) (hr error) {
- if hr = procHcnCreateNamespace.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall6(procHcnCreateNamespace.Addr(), 4, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(settings)), uintptr(unsafe.Pointer(namespace)), uintptr(unsafe.Pointer(result)), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnOpenNamespace(id *_guid, namespace *hcnNamespace, result **uint16) (hr error) {
- if hr = procHcnOpenNamespace.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcnOpenNamespace.Addr(), 3, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(namespace)), uintptr(unsafe.Pointer(result)))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnModifyNamespace(namespace hcnNamespace, settings string, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(settings)
- if hr != nil {
- return
- }
- return _hcnModifyNamespace(namespace, _p0, result)
-}
-
-func _hcnModifyNamespace(namespace hcnNamespace, settings *uint16, result **uint16) (hr error) {
- if hr = procHcnModifyNamespace.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcnModifyNamespace.Addr(), 3, uintptr(namespace), uintptr(unsafe.Pointer(settings)), uintptr(unsafe.Pointer(result)))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnQueryNamespaceProperties(namespace hcnNamespace, query string, properties **uint16, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(query)
- if hr != nil {
- return
- }
- return _hcnQueryNamespaceProperties(namespace, _p0, properties, result)
-}
-
-func _hcnQueryNamespaceProperties(namespace hcnNamespace, query *uint16, properties **uint16, result **uint16) (hr error) {
- if hr = procHcnQueryNamespaceProperties.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall6(procHcnQueryNamespaceProperties.Addr(), 4, uintptr(namespace), uintptr(unsafe.Pointer(query)), uintptr(unsafe.Pointer(properties)), uintptr(unsafe.Pointer(result)), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnDeleteNamespace(id *_guid, result **uint16) (hr error) {
- if hr = procHcnDeleteNamespace.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcnDeleteNamespace.Addr(), 2, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(result)), 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnCloseNamespace(namespace hcnNamespace) (hr error) {
- if hr = procHcnCloseNamespace.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcnCloseNamespace.Addr(), 1, uintptr(namespace), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnEnumerateLoadBalancers(query string, loadBalancers **uint16, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(query)
- if hr != nil {
- return
- }
- return _hcnEnumerateLoadBalancers(_p0, loadBalancers, result)
-}
-
-func _hcnEnumerateLoadBalancers(query *uint16, loadBalancers **uint16, result **uint16) (hr error) {
- if hr = procHcnEnumerateLoadBalancers.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcnEnumerateLoadBalancers.Addr(), 3, uintptr(unsafe.Pointer(query)), uintptr(unsafe.Pointer(loadBalancers)), uintptr(unsafe.Pointer(result)))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnCreateLoadBalancer(id *_guid, settings string, loadBalancer *hcnLoadBalancer, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(settings)
- if hr != nil {
- return
- }
- return _hcnCreateLoadBalancer(id, _p0, loadBalancer, result)
-}
-
-func _hcnCreateLoadBalancer(id *_guid, settings *uint16, loadBalancer *hcnLoadBalancer, result **uint16) (hr error) {
- if hr = procHcnCreateLoadBalancer.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall6(procHcnCreateLoadBalancer.Addr(), 4, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(settings)), uintptr(unsafe.Pointer(loadBalancer)), uintptr(unsafe.Pointer(result)), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnOpenLoadBalancer(id *_guid, loadBalancer *hcnLoadBalancer, result **uint16) (hr error) {
- if hr = procHcnOpenLoadBalancer.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcnOpenLoadBalancer.Addr(), 3, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(loadBalancer)), uintptr(unsafe.Pointer(result)))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnModifyLoadBalancer(loadBalancer hcnLoadBalancer, settings string, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(settings)
- if hr != nil {
- return
- }
- return _hcnModifyLoadBalancer(loadBalancer, _p0, result)
-}
-
-func _hcnModifyLoadBalancer(loadBalancer hcnLoadBalancer, settings *uint16, result **uint16) (hr error) {
- if hr = procHcnModifyLoadBalancer.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcnModifyLoadBalancer.Addr(), 3, uintptr(loadBalancer), uintptr(unsafe.Pointer(settings)), uintptr(unsafe.Pointer(result)))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnQueryLoadBalancerProperties(loadBalancer hcnLoadBalancer, query string, properties **uint16, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(query)
- if hr != nil {
- return
- }
- return _hcnQueryLoadBalancerProperties(loadBalancer, _p0, properties, result)
-}
-
-func _hcnQueryLoadBalancerProperties(loadBalancer hcnLoadBalancer, query *uint16, properties **uint16, result **uint16) (hr error) {
- if hr = procHcnQueryLoadBalancerProperties.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall6(procHcnQueryLoadBalancerProperties.Addr(), 4, uintptr(loadBalancer), uintptr(unsafe.Pointer(query)), uintptr(unsafe.Pointer(properties)), uintptr(unsafe.Pointer(result)), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnDeleteLoadBalancer(id *_guid, result **uint16) (hr error) {
- if hr = procHcnDeleteLoadBalancer.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcnDeleteLoadBalancer.Addr(), 2, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(result)), 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnCloseLoadBalancer(loadBalancer hcnLoadBalancer) (hr error) {
- if hr = procHcnCloseLoadBalancer.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcnCloseLoadBalancer.Addr(), 1, uintptr(loadBalancer), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnEnumerateRoutes(query string, routes **uint16, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(query)
- if hr != nil {
- return
- }
- return _hcnEnumerateRoutes(_p0, routes, result)
-}
-
-func _hcnEnumerateRoutes(query *uint16, routes **uint16, result **uint16) (hr error) {
- if hr = procHcnEnumerateSdnRoutes.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcnEnumerateSdnRoutes.Addr(), 3, uintptr(unsafe.Pointer(query)), uintptr(unsafe.Pointer(routes)), uintptr(unsafe.Pointer(result)))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnCreateRoute(id *_guid, settings string, route *hcnRoute, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(settings)
- if hr != nil {
- return
- }
- return _hcnCreateRoute(id, _p0, route, result)
-}
-
-func _hcnCreateRoute(id *_guid, settings *uint16, route *hcnRoute, result **uint16) (hr error) {
- if hr = procHcnCreateSdnRoute.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall6(procHcnCreateSdnRoute.Addr(), 4, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(settings)), uintptr(unsafe.Pointer(route)), uintptr(unsafe.Pointer(result)), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnOpenRoute(id *_guid, route *hcnRoute, result **uint16) (hr error) {
- if hr = procHcnOpenSdnRoute.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcnOpenSdnRoute.Addr(), 3, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(route)), uintptr(unsafe.Pointer(result)))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnModifyRoute(route hcnRoute, settings string, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(settings)
- if hr != nil {
- return
- }
- return _hcnModifyRoute(route, _p0, result)
-}
-
-func _hcnModifyRoute(route hcnRoute, settings *uint16, result **uint16) (hr error) {
- if hr = procHcnModifySdnRoute.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcnModifySdnRoute.Addr(), 3, uintptr(route), uintptr(unsafe.Pointer(settings)), uintptr(unsafe.Pointer(result)))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnQueryRouteProperties(route hcnRoute, query string, properties **uint16, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(query)
- if hr != nil {
- return
- }
- return _hcnQueryRouteProperties(route, _p0, properties, result)
-}
-
-func _hcnQueryRouteProperties(route hcnRoute, query *uint16, properties **uint16, result **uint16) (hr error) {
- if hr = procHcnQuerySdnRouteProperties.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall6(procHcnQuerySdnRouteProperties.Addr(), 4, uintptr(route), uintptr(unsafe.Pointer(query)), uintptr(unsafe.Pointer(properties)), uintptr(unsafe.Pointer(result)), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnDeleteRoute(id *_guid, result **uint16) (hr error) {
- if hr = procHcnDeleteSdnRoute.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcnDeleteSdnRoute.Addr(), 2, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(result)), 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnCloseRoute(route hcnRoute) (hr error) {
- if hr = procHcnCloseSdnRoute.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcnCloseSdnRoute.Addr(), 1, uintptr(route), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnOpenService(service *hcnService, result **uint16) (hr error) {
- if hr = procHcnOpenService.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcnOpenService.Addr(), 2, uintptr(unsafe.Pointer(service)), uintptr(unsafe.Pointer(result)), 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnRegisterServiceCallback(service hcnService, callback int32, context int32, callbackHandle *hcnCallbackHandle) (hr error) {
- if hr = procHcnRegisterServiceCallback.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall6(procHcnRegisterServiceCallback.Addr(), 4, uintptr(service), uintptr(callback), uintptr(context), uintptr(unsafe.Pointer(callbackHandle)), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnUnregisterServiceCallback(callbackHandle hcnCallbackHandle) (hr error) {
- if hr = procHcnUnregisterServiceCallback.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcnUnregisterServiceCallback.Addr(), 1, uintptr(callbackHandle), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcnCloseService(service hcnService) (hr error) {
- if hr = procHcnCloseService.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcnCloseService.Addr(), 1, uintptr(service), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/hcsshim.go b/vendor/github.com/Microsoft/hcsshim/hcsshim.go
deleted file mode 100644
index ceb3ac85e..000000000
--- a/vendor/github.com/Microsoft/hcsshim/hcsshim.go
+++ /dev/null
@@ -1,28 +0,0 @@
-// Shim for the Host Compute Service (HCS) to manage Windows Server
-// containers and Hyper-V containers.
-
-package hcsshim
-
-import (
- "syscall"
-
- "github.com/Microsoft/hcsshim/internal/hcserror"
-)
-
-//go:generate go run mksyscall_windows.go -output zsyscall_windows.go hcsshim.go
-
-//sys SetCurrentThreadCompartmentId(compartmentId uint32) (hr error) = iphlpapi.SetCurrentThreadCompartmentId
-
-const (
- // Specific user-visible exit codes
- WaitErrExecFailed = 32767
-
- ERROR_GEN_FAILURE = hcserror.ERROR_GEN_FAILURE
- ERROR_SHUTDOWN_IN_PROGRESS = syscall.Errno(1115)
- WSAEINVAL = syscall.Errno(10022)
-
- // Timeout on wait calls
- TimeoutInfinite = 0xFFFFFFFF
-)
-
-type HcsError = hcserror.HcsError
diff --git a/vendor/github.com/Microsoft/hcsshim/hnsendpoint.go b/vendor/github.com/Microsoft/hcsshim/hnsendpoint.go
deleted file mode 100644
index 09b3860a7..000000000
--- a/vendor/github.com/Microsoft/hcsshim/hnsendpoint.go
+++ /dev/null
@@ -1,104 +0,0 @@
-package hcsshim
-
-import (
- "github.com/Microsoft/hcsshim/internal/hns"
-)
-
-// HNSEndpoint represents a network endpoint in HNS
-type HNSEndpoint = hns.HNSEndpoint
-
-// Namespace represents a Compartment.
-type Namespace = hns.Namespace
-
-//SystemType represents the type of the system on which actions are done
-type SystemType string
-
-// SystemType const
-const (
- ContainerType SystemType = "Container"
- VirtualMachineType SystemType = "VirtualMachine"
- HostType SystemType = "Host"
-)
-
-// EndpointAttachDetachRequest is the structure used to send request to the container to modify the system
-// Supported resource types are Network and Request Types are Add/Remove
-type EndpointAttachDetachRequest = hns.EndpointAttachDetachRequest
-
-// EndpointResquestResponse is object to get the endpoint request response
-type EndpointResquestResponse = hns.EndpointResquestResponse
-
-// HNSEndpointRequest makes a HNS call to modify/query a network endpoint
-func HNSEndpointRequest(method, path, request string) (*HNSEndpoint, error) {
- return hns.HNSEndpointRequest(method, path, request)
-}
-
-// HNSListEndpointRequest makes a HNS call to query the list of available endpoints
-func HNSListEndpointRequest() ([]HNSEndpoint, error) {
- return hns.HNSListEndpointRequest()
-}
-
-// HotAttachEndpoint makes a HCS Call to attach the endpoint to the container
-func HotAttachEndpoint(containerID string, endpointID string) error {
- endpoint, err := GetHNSEndpointByID(endpointID)
- isAttached, err := endpoint.IsAttached(containerID)
- if isAttached {
- return err
- }
- return modifyNetworkEndpoint(containerID, endpointID, Add)
-}
-
-// HotDetachEndpoint makes a HCS Call to detach the endpoint from the container
-func HotDetachEndpoint(containerID string, endpointID string) error {
- endpoint, err := GetHNSEndpointByID(endpointID)
- isAttached, err := endpoint.IsAttached(containerID)
- if !isAttached {
- return err
- }
- return modifyNetworkEndpoint(containerID, endpointID, Remove)
-}
-
-// ModifyContainer corresponding to the container id, by sending a request
-func modifyContainer(id string, request *ResourceModificationRequestResponse) error {
- container, err := OpenContainer(id)
- if err != nil {
- if IsNotExist(err) {
- return ErrComputeSystemDoesNotExist
- }
- return getInnerError(err)
- }
- defer container.Close()
- err = container.Modify(request)
- if err != nil {
- if IsNotSupported(err) {
- return ErrPlatformNotSupported
- }
- return getInnerError(err)
- }
-
- return nil
-}
-
-func modifyNetworkEndpoint(containerID string, endpointID string, request RequestType) error {
- requestMessage := &ResourceModificationRequestResponse{
- Resource: Network,
- Request: request,
- Data: endpointID,
- }
- err := modifyContainer(containerID, requestMessage)
-
- if err != nil {
- return err
- }
-
- return nil
-}
-
-// GetHNSEndpointByID get the Endpoint by ID
-func GetHNSEndpointByID(endpointID string) (*HNSEndpoint, error) {
- return hns.GetHNSEndpointByID(endpointID)
-}
-
-// GetHNSEndpointByName gets the endpoint filtered by Name
-func GetHNSEndpointByName(endpointName string) (*HNSEndpoint, error) {
- return hns.GetHNSEndpointByName(endpointName)
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/hnsglobals.go b/vendor/github.com/Microsoft/hcsshim/hnsglobals.go
deleted file mode 100644
index 2b5381904..000000000
--- a/vendor/github.com/Microsoft/hcsshim/hnsglobals.go
+++ /dev/null
@@ -1,16 +0,0 @@
-package hcsshim
-
-import (
- "github.com/Microsoft/hcsshim/internal/hns"
-)
-
-type HNSGlobals = hns.HNSGlobals
-type HNSVersion = hns.HNSVersion
-
-var (
- HNSVersion1803 = hns.HNSVersion1803
-)
-
-func GetHNSGlobals() (*HNSGlobals, error) {
- return hns.GetHNSGlobals()
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/hnsnetwork.go b/vendor/github.com/Microsoft/hcsshim/hnsnetwork.go
deleted file mode 100644
index f775fa1d0..000000000
--- a/vendor/github.com/Microsoft/hcsshim/hnsnetwork.go
+++ /dev/null
@@ -1,36 +0,0 @@
-package hcsshim
-
-import (
- "github.com/Microsoft/hcsshim/internal/hns"
-)
-
-// Subnet is assoicated with a network and represents a list
-// of subnets available to the network
-type Subnet = hns.Subnet
-
-// MacPool is assoicated with a network and represents a list
-// of macaddresses available to the network
-type MacPool = hns.MacPool
-
-// HNSNetwork represents a network in HNS
-type HNSNetwork = hns.HNSNetwork
-
-// HNSNetworkRequest makes a call into HNS to update/query a single network
-func HNSNetworkRequest(method, path, request string) (*HNSNetwork, error) {
- return hns.HNSNetworkRequest(method, path, request)
-}
-
-// HNSListNetworkRequest makes a HNS call to query the list of available networks
-func HNSListNetworkRequest(method, path, request string) ([]HNSNetwork, error) {
- return hns.HNSListNetworkRequest(method, path, request)
-}
-
-// GetHNSNetworkByID
-func GetHNSNetworkByID(networkID string) (*HNSNetwork, error) {
- return hns.GetHNSNetworkByID(networkID)
-}
-
-// GetHNSNetworkName filtered by Name
-func GetHNSNetworkByName(networkName string) (*HNSNetwork, error) {
- return hns.GetHNSNetworkByName(networkName)
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/hnspolicy.go b/vendor/github.com/Microsoft/hcsshim/hnspolicy.go
deleted file mode 100644
index 00ab26364..000000000
--- a/vendor/github.com/Microsoft/hcsshim/hnspolicy.go
+++ /dev/null
@@ -1,60 +0,0 @@
-package hcsshim
-
-import (
- "github.com/Microsoft/hcsshim/internal/hns"
-)
-
-// Type of Request Support in ModifySystem
-type PolicyType = hns.PolicyType
-
-// RequestType const
-const (
- Nat = hns.Nat
- ACL = hns.ACL
- PA = hns.PA
- VLAN = hns.VLAN
- VSID = hns.VSID
- VNet = hns.VNet
- L2Driver = hns.L2Driver
- Isolation = hns.Isolation
- QOS = hns.QOS
- OutboundNat = hns.OutboundNat
- ExternalLoadBalancer = hns.ExternalLoadBalancer
- Route = hns.Route
- Proxy = hns.Proxy
-)
-
-type ProxyPolicy = hns.ProxyPolicy
-
-type NatPolicy = hns.NatPolicy
-
-type QosPolicy = hns.QosPolicy
-
-type IsolationPolicy = hns.IsolationPolicy
-
-type VlanPolicy = hns.VlanPolicy
-
-type VsidPolicy = hns.VsidPolicy
-
-type PaPolicy = hns.PaPolicy
-
-type OutboundNatPolicy = hns.OutboundNatPolicy
-
-type ActionType = hns.ActionType
-type DirectionType = hns.DirectionType
-type RuleType = hns.RuleType
-
-const (
- Allow = hns.Allow
- Block = hns.Block
-
- In = hns.In
- Out = hns.Out
-
- Host = hns.Host
- Switch = hns.Switch
-)
-
-type ACLPolicy = hns.ACLPolicy
-
-type Policy = hns.Policy
diff --git a/vendor/github.com/Microsoft/hcsshim/hnspolicylist.go b/vendor/github.com/Microsoft/hcsshim/hnspolicylist.go
deleted file mode 100644
index 55aaa4a50..000000000
--- a/vendor/github.com/Microsoft/hcsshim/hnspolicylist.go
+++ /dev/null
@@ -1,47 +0,0 @@
-package hcsshim
-
-import (
- "github.com/Microsoft/hcsshim/internal/hns"
-)
-
-// RoutePolicy is a structure defining schema for Route based Policy
-type RoutePolicy = hns.RoutePolicy
-
-// ELBPolicy is a structure defining schema for ELB LoadBalancing based Policy
-type ELBPolicy = hns.ELBPolicy
-
-// LBPolicy is a structure defining schema for LoadBalancing based Policy
-type LBPolicy = hns.LBPolicy
-
-// PolicyList is a structure defining schema for Policy list request
-type PolicyList = hns.PolicyList
-
-// HNSPolicyListRequest makes a call into HNS to update/query a single network
-func HNSPolicyListRequest(method, path, request string) (*PolicyList, error) {
- return hns.HNSPolicyListRequest(method, path, request)
-}
-
-// HNSListPolicyListRequest gets all the policy list
-func HNSListPolicyListRequest() ([]PolicyList, error) {
- return hns.HNSListPolicyListRequest()
-}
-
-// PolicyListRequest makes a HNS call to modify/query a network policy list
-func PolicyListRequest(method, path, request string) (*PolicyList, error) {
- return hns.PolicyListRequest(method, path, request)
-}
-
-// GetPolicyListByID get the policy list by ID
-func GetPolicyListByID(policyListID string) (*PolicyList, error) {
- return hns.GetPolicyListByID(policyListID)
-}
-
-// AddLoadBalancer policy list for the specified endpoints
-func AddLoadBalancer(endpoints []HNSEndpoint, isILB bool, sourceVIP, vip string, protocol uint16, internalPort uint16, externalPort uint16) (*PolicyList, error) {
- return hns.AddLoadBalancer(endpoints, isILB, sourceVIP, vip, protocol, internalPort, externalPort)
-}
-
-// AddRoute adds route policy list for the specified endpoints
-func AddRoute(endpoints []HNSEndpoint, destinationPrefix string, nextHop string, encapEnabled bool) (*PolicyList, error) {
- return hns.AddRoute(endpoints, destinationPrefix, nextHop, encapEnabled)
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/hnssupport.go b/vendor/github.com/Microsoft/hcsshim/hnssupport.go
deleted file mode 100644
index 69405244b..000000000
--- a/vendor/github.com/Microsoft/hcsshim/hnssupport.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package hcsshim
-
-import (
- "github.com/Microsoft/hcsshim/internal/hns"
-)
-
-type HNSSupportedFeatures = hns.HNSSupportedFeatures
-
-type HNSAclFeatures = hns.HNSAclFeatures
-
-func GetHNSSupportedFeatures() HNSSupportedFeatures {
- return hns.GetHNSSupportedFeatures()
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/interface.go b/vendor/github.com/Microsoft/hcsshim/interface.go
deleted file mode 100644
index 5b91e0cc5..000000000
--- a/vendor/github.com/Microsoft/hcsshim/interface.go
+++ /dev/null
@@ -1,114 +0,0 @@
-package hcsshim
-
-import (
- "io"
- "time"
-
- "github.com/Microsoft/hcsshim/internal/schema1"
-)
-
-// ProcessConfig is used as both the input of Container.CreateProcess
-// and to convert the parameters to JSON for passing onto the HCS
-type ProcessConfig = schema1.ProcessConfig
-
-type Layer = schema1.Layer
-type MappedDir = schema1.MappedDir
-type MappedPipe = schema1.MappedPipe
-type HvRuntime = schema1.HvRuntime
-type MappedVirtualDisk = schema1.MappedVirtualDisk
-
-// AssignedDevice represents a device that has been directly assigned to a container
-//
-// NOTE: Support added in RS5
-type AssignedDevice = schema1.AssignedDevice
-
-// ContainerConfig is used as both the input of CreateContainer
-// and to convert the parameters to JSON for passing onto the HCS
-type ContainerConfig = schema1.ContainerConfig
-
-type ComputeSystemQuery = schema1.ComputeSystemQuery
-
-// Container represents a created (but not necessarily running) container.
-type Container interface {
- // Start synchronously starts the container.
- Start() error
-
- // Shutdown requests a container shutdown, but it may not actually be shutdown until Wait() succeeds.
- Shutdown() error
-
- // Terminate requests a container terminate, but it may not actually be terminated until Wait() succeeds.
- Terminate() error
-
- // Waits synchronously waits for the container to shutdown or terminate.
- Wait() error
-
- // WaitTimeout synchronously waits for the container to terminate or the duration to elapse. It
- // returns false if timeout occurs.
- WaitTimeout(time.Duration) error
-
- // Pause pauses the execution of a container.
- Pause() error
-
- // Resume resumes the execution of a container.
- Resume() error
-
- // HasPendingUpdates returns true if the container has updates pending to install.
- HasPendingUpdates() (bool, error)
-
- // Statistics returns statistics for a container.
- Statistics() (Statistics, error)
-
- // ProcessList returns details for the processes in a container.
- ProcessList() ([]ProcessListItem, error)
-
- // MappedVirtualDisks returns virtual disks mapped to a utility VM, indexed by controller
- MappedVirtualDisks() (map[int]MappedVirtualDiskController, error)
-
- // CreateProcess launches a new process within the container.
- CreateProcess(c *ProcessConfig) (Process, error)
-
- // OpenProcess gets an interface to an existing process within the container.
- OpenProcess(pid int) (Process, error)
-
- // Close cleans up any state associated with the container but does not terminate or wait for it.
- Close() error
-
- // Modify the System
- Modify(config *ResourceModificationRequestResponse) error
-}
-
-// Process represents a running or exited process.
-type Process interface {
- // Pid returns the process ID of the process within the container.
- Pid() int
-
- // Kill signals the process to terminate but does not wait for it to finish terminating.
- Kill() error
-
- // Wait waits for the process to exit.
- Wait() error
-
- // WaitTimeout waits for the process to exit or the duration to elapse. It returns
- // false if timeout occurs.
- WaitTimeout(time.Duration) error
-
- // ExitCode returns the exit code of the process. The process must have
- // already terminated.
- ExitCode() (int, error)
-
- // ResizeConsole resizes the console of the process.
- ResizeConsole(width, height uint16) error
-
- // Stdio returns the stdin, stdout, and stderr pipes, respectively. Closing
- // these pipes does not close the underlying pipes; it should be possible to
- // call this multiple times to get multiple interfaces.
- Stdio() (io.WriteCloser, io.ReadCloser, io.ReadCloser, error)
-
- // CloseStdin closes the write side of the stdin pipe so that the process is
- // notified on the read side that there is no more data in stdin.
- CloseStdin() error
-
- // Close cleans up any state associated with the process but does not kill
- // or wait on it.
- Close() error
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/cni/registry.go b/vendor/github.com/Microsoft/hcsshim/internal/cni/registry.go
deleted file mode 100644
index 4a4fcea84..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/cni/registry.go
+++ /dev/null
@@ -1,110 +0,0 @@
-package cni
-
-import (
- "errors"
-
- "github.com/Microsoft/go-winio/pkg/guid"
- "github.com/Microsoft/hcsshim/internal/regstate"
-)
-
-const (
- cniRoot = "cni"
- cniKey = "cfg"
-)
-
-// PersistedNamespaceConfig is the registry version of the `NamespaceID` to UVM
-// map.
-type PersistedNamespaceConfig struct {
- namespaceID string
- stored bool
-
- ContainerID string
- HostUniqueID guid.GUID
-}
-
-// NewPersistedNamespaceConfig creates an in-memory namespace config that can be
-// persisted to the registry.
-func NewPersistedNamespaceConfig(namespaceID, containerID string, containerHostUniqueID guid.GUID) *PersistedNamespaceConfig {
- return &PersistedNamespaceConfig{
- namespaceID: namespaceID,
- ContainerID: containerID,
- HostUniqueID: containerHostUniqueID,
- }
-}
-
-// LoadPersistedNamespaceConfig loads a persisted config from the registry that matches
-// `namespaceID`. If not found returns `regstate.NotFoundError`
-func LoadPersistedNamespaceConfig(namespaceID string) (*PersistedNamespaceConfig, error) {
- sk, err := regstate.Open(cniRoot, false)
- if err != nil {
- return nil, err
- }
- defer sk.Close()
-
- pnc := PersistedNamespaceConfig{
- namespaceID: namespaceID,
- stored: true,
- }
- if err := sk.Get(namespaceID, cniKey, &pnc); err != nil {
- return nil, err
- }
- return &pnc, nil
-}
-
-// Store stores or updates the in-memory config to its registry state. If the
-// store failes returns the store error.
-func (pnc *PersistedNamespaceConfig) Store() error {
- if pnc.namespaceID == "" {
- return errors.New("invalid namespaceID ''")
- }
- if pnc.ContainerID == "" {
- return errors.New("invalid containerID ''")
- }
- empty := guid.GUID{}
- if pnc.HostUniqueID == empty {
- return errors.New("invalid containerHostUniqueID 'empy'")
- }
- sk, err := regstate.Open(cniRoot, false)
- if err != nil {
- return err
- }
- defer sk.Close()
-
- if pnc.stored {
- if err := sk.Set(pnc.namespaceID, cniKey, pnc); err != nil {
- return err
- }
- } else {
- if err := sk.Create(pnc.namespaceID, cniKey, pnc); err != nil {
- return err
- }
- }
- pnc.stored = true
- return nil
-}
-
-// Remove removes any persisted state associated with this config. If the config
-// is not found in the registery `Remove` returns no error.
-func (pnc *PersistedNamespaceConfig) Remove() error {
- if pnc.stored {
- sk, err := regstate.Open(cniRoot, false)
- if err != nil {
- if regstate.IsNotFoundError(err) {
- pnc.stored = false
- return nil
- }
- return err
- }
- defer sk.Close()
-
- if err := sk.Remove(pnc.namespaceID); err != nil {
- if regstate.IsNotFoundError(err) {
- pnc.stored = false
- return nil
- }
- return err
- }
- }
- pnc.stored = false
- return nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/cow/cow.go b/vendor/github.com/Microsoft/hcsshim/internal/cow/cow.go
deleted file mode 100644
index 8193315f0..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/cow/cow.go
+++ /dev/null
@@ -1,83 +0,0 @@
-package cow
-
-import (
- "context"
- "io"
-
- "github.com/Microsoft/hcsshim/internal/schema1"
- hcsschema "github.com/Microsoft/hcsshim/internal/schema2"
-)
-
-// Process is the interface for an OS process running in a container or utility VM.
-type Process interface {
- // Close releases resources associated with the process and closes the
- // writer and readers returned by Stdio. Depending on the implementation,
- // this may also terminate the process.
- Close() error
- // CloseStdin causes the process's stdin handle to receive EOF/EPIPE/whatever
- // is appropriate to indicate that no more data is available.
- CloseStdin(ctx context.Context) error
- // Pid returns the process ID.
- Pid() int
- // Stdio returns the stdio streams for a process. These may be nil if a stream
- // was not requested during CreateProcess.
- Stdio() (_ io.Writer, _ io.Reader, _ io.Reader)
- // ResizeConsole resizes the virtual terminal associated with the process.
- ResizeConsole(ctx context.Context, width, height uint16) error
- // Kill sends a SIGKILL or equivalent signal to the process and returns whether
- // the signal was delivered. It does not wait for the process to terminate.
- Kill(ctx context.Context) (bool, error)
- // Signal sends a signal to the process and returns whether the signal was
- // delivered. The input is OS specific (either
- // guestrequest.SignalProcessOptionsWCOW or
- // guestrequest.SignalProcessOptionsLCOW). It does not wait for the process
- // to terminate.
- Signal(ctx context.Context, options interface{}) (bool, error)
- // Wait waits for the process to complete, or for a connection to the process to be
- // terminated by some error condition (including calling Close).
- Wait() error
- // ExitCode returns the exit code of the process. Returns an error if the process is
- // not running.
- ExitCode() (int, error)
-}
-
-// ProcessHost is the interface for creating processes.
-type ProcessHost interface {
- // CreateProcess creates a process. The configuration is host specific
- // (either hcsschema.ProcessParameters or lcow.ProcessParameters).
- CreateProcess(ctx context.Context, config interface{}) (Process, error)
- // OS returns the host's operating system, "linux" or "windows".
- OS() string
- // IsOCI specifies whether this is an OCI-compliant process host. If true,
- // then the configuration passed to CreateProcess should have an OCI process
- // spec (or nil if this is the initial process in an OCI container).
- // Otherwise, it should have the HCS-specific process parameters.
- IsOCI() bool
-}
-
-// Container is the interface for container objects, either running on the host or
-// in a utility VM.
-type Container interface {
- ProcessHost
- // Close releases the resources associated with the container. Depending on
- // the implementation, this may also terminate the container.
- Close() error
- // ID returns the container ID.
- ID() string
- // Properties returns the requested container properties targeting a V1 schema container.
- Properties(ctx context.Context, types ...schema1.PropertyType) (*schema1.ContainerProperties, error)
- // PropertiesV2 returns the requested container properties targeting a V2 schema container.
- PropertiesV2(ctx context.Context, types ...hcsschema.PropertyType) (*hcsschema.Properties, error)
- // Start starts a container.
- Start(ctx context.Context) error
- // Shutdown sends a shutdown request to the container (but does not wait for
- // the shutdown to complete).
- Shutdown(ctx context.Context) error
- // Terminate sends a terminate request to the container (but does not wait
- // for the terminate to complete).
- Terminate(ctx context.Context) error
- // Wait waits for the container to terminate, or for the connection to the
- // container to be terminated by some error condition (including calling
- // Close).
- Wait() error
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/callback.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/callback.go
deleted file mode 100644
index 62ba81751..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/hcs/callback.go
+++ /dev/null
@@ -1,160 +0,0 @@
-package hcs
-
-import (
- "fmt"
- "sync"
- "syscall"
-
- "github.com/Microsoft/hcsshim/internal/interop"
- "github.com/Microsoft/hcsshim/internal/logfields"
- "github.com/Microsoft/hcsshim/internal/vmcompute"
- "github.com/sirupsen/logrus"
-)
-
-var (
- nextCallback uintptr
- callbackMap = map[uintptr]*notifcationWatcherContext{}
- callbackMapLock = sync.RWMutex{}
-
- notificationWatcherCallback = syscall.NewCallback(notificationWatcher)
-
- // Notifications for HCS_SYSTEM handles
- hcsNotificationSystemExited hcsNotification = 0x00000001
- hcsNotificationSystemCreateCompleted hcsNotification = 0x00000002
- hcsNotificationSystemStartCompleted hcsNotification = 0x00000003
- hcsNotificationSystemPauseCompleted hcsNotification = 0x00000004
- hcsNotificationSystemResumeCompleted hcsNotification = 0x00000005
- hcsNotificationSystemCrashReport hcsNotification = 0x00000006
- hcsNotificationSystemSiloJobCreated hcsNotification = 0x00000007
- hcsNotificationSystemSaveCompleted hcsNotification = 0x00000008
- hcsNotificationSystemRdpEnhancedModeStateChanged hcsNotification = 0x00000009
- hcsNotificationSystemShutdownFailed hcsNotification = 0x0000000A
- hcsNotificationSystemGetPropertiesCompleted hcsNotification = 0x0000000B
- hcsNotificationSystemModifyCompleted hcsNotification = 0x0000000C
- hcsNotificationSystemCrashInitiated hcsNotification = 0x0000000D
- hcsNotificationSystemGuestConnectionClosed hcsNotification = 0x0000000E
-
- // Notifications for HCS_PROCESS handles
- hcsNotificationProcessExited hcsNotification = 0x00010000
-
- // Common notifications
- hcsNotificationInvalid hcsNotification = 0x00000000
- hcsNotificationServiceDisconnect hcsNotification = 0x01000000
-)
-
-type hcsNotification uint32
-
-func (hn hcsNotification) String() string {
- switch hn {
- case hcsNotificationSystemExited:
- return "SystemExited"
- case hcsNotificationSystemCreateCompleted:
- return "SystemCreateCompleted"
- case hcsNotificationSystemStartCompleted:
- return "SystemStartCompleted"
- case hcsNotificationSystemPauseCompleted:
- return "SystemPauseCompleted"
- case hcsNotificationSystemResumeCompleted:
- return "SystemResumeCompleted"
- case hcsNotificationSystemCrashReport:
- return "SystemCrashReport"
- case hcsNotificationSystemSiloJobCreated:
- return "SystemSiloJobCreated"
- case hcsNotificationSystemSaveCompleted:
- return "SystemSaveCompleted"
- case hcsNotificationSystemRdpEnhancedModeStateChanged:
- return "SystemRdpEnhancedModeStateChanged"
- case hcsNotificationSystemShutdownFailed:
- return "SystemShutdownFailed"
- case hcsNotificationSystemGetPropertiesCompleted:
- return "SystemGetPropertiesCompleted"
- case hcsNotificationSystemModifyCompleted:
- return "SystemModifyCompleted"
- case hcsNotificationSystemCrashInitiated:
- return "SystemCrashInitiated"
- case hcsNotificationSystemGuestConnectionClosed:
- return "SystemGuestConnectionClosed"
- case hcsNotificationProcessExited:
- return "ProcessExited"
- case hcsNotificationInvalid:
- return "Invalid"
- case hcsNotificationServiceDisconnect:
- return "ServiceDisconnect"
- default:
- return fmt.Sprintf("Unknown: %d", hn)
- }
-}
-
-type notificationChannel chan error
-
-type notifcationWatcherContext struct {
- channels notificationChannels
- handle vmcompute.HcsCallback
-
- systemID string
- processID int
-}
-
-type notificationChannels map[hcsNotification]notificationChannel
-
-func newSystemChannels() notificationChannels {
- channels := make(notificationChannels)
- for _, notif := range []hcsNotification{
- hcsNotificationServiceDisconnect,
- hcsNotificationSystemExited,
- hcsNotificationSystemCreateCompleted,
- hcsNotificationSystemStartCompleted,
- hcsNotificationSystemPauseCompleted,
- hcsNotificationSystemResumeCompleted,
- } {
- channels[notif] = make(notificationChannel, 1)
- }
- return channels
-}
-
-func newProcessChannels() notificationChannels {
- channels := make(notificationChannels)
- for _, notif := range []hcsNotification{
- hcsNotificationServiceDisconnect,
- hcsNotificationProcessExited,
- } {
- channels[notif] = make(notificationChannel, 1)
- }
- return channels
-}
-
-func closeChannels(channels notificationChannels) {
- for _, c := range channels {
- close(c)
- }
-}
-
-func notificationWatcher(notificationType hcsNotification, callbackNumber uintptr, notificationStatus uintptr, notificationData *uint16) uintptr {
- var result error
- if int32(notificationStatus) < 0 {
- result = interop.Win32FromHresult(notificationStatus)
- }
-
- callbackMapLock.RLock()
- context := callbackMap[callbackNumber]
- callbackMapLock.RUnlock()
-
- if context == nil {
- return 0
- }
-
- log := logrus.WithFields(logrus.Fields{
- "notification-type": notificationType.String(),
- "system-id": context.systemID,
- })
- if context.processID != 0 {
- log.Data[logfields.ProcessID] = context.processID
- }
- log.Debug("HCS notification")
-
- if channel, ok := context.channels[notificationType]; ok {
- channel <- result
- }
-
- return 0
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/errors.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/errors.go
deleted file mode 100644
index 9a4705a49..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/hcs/errors.go
+++ /dev/null
@@ -1,336 +0,0 @@
-package hcs
-
-import (
- "context"
- "encoding/json"
- "errors"
- "fmt"
- "net"
- "syscall"
-
- "github.com/Microsoft/hcsshim/internal/log"
-)
-
-var (
- // ErrComputeSystemDoesNotExist is an error encountered when the container being operated on no longer exists
- ErrComputeSystemDoesNotExist = syscall.Errno(0xc037010e)
-
- // ErrElementNotFound is an error encountered when the object being referenced does not exist
- ErrElementNotFound = syscall.Errno(0x490)
-
- // ErrElementNotFound is an error encountered when the object being referenced does not exist
- ErrNotSupported = syscall.Errno(0x32)
-
- // ErrInvalidData is an error encountered when the request being sent to hcs is invalid/unsupported
- // decimal -2147024883 / hex 0x8007000d
- ErrInvalidData = syscall.Errno(0xd)
-
- // ErrHandleClose is an error encountered when the handle generating the notification being waited on has been closed
- ErrHandleClose = errors.New("hcsshim: the handle generating this notification has been closed")
-
- // ErrAlreadyClosed is an error encountered when using a handle that has been closed by the Close method
- ErrAlreadyClosed = errors.New("hcsshim: the handle has already been closed")
-
- // ErrInvalidNotificationType is an error encountered when an invalid notification type is used
- ErrInvalidNotificationType = errors.New("hcsshim: invalid notification type")
-
- // ErrInvalidProcessState is an error encountered when the process is not in a valid state for the requested operation
- ErrInvalidProcessState = errors.New("the process is in an invalid state for the attempted operation")
-
- // ErrTimeout is an error encountered when waiting on a notification times out
- ErrTimeout = errors.New("hcsshim: timeout waiting for notification")
-
- // ErrUnexpectedContainerExit is the error encountered when a container exits while waiting for
- // a different expected notification
- ErrUnexpectedContainerExit = errors.New("unexpected container exit")
-
- // ErrUnexpectedProcessAbort is the error encountered when communication with the compute service
- // is lost while waiting for a notification
- ErrUnexpectedProcessAbort = errors.New("lost communication with compute service")
-
- // ErrUnexpectedValue is an error encountered when hcs returns an invalid value
- ErrUnexpectedValue = errors.New("unexpected value returned from hcs")
-
- // ErrVmcomputeAlreadyStopped is an error encountered when a shutdown or terminate request is made on a stopped container
- ErrVmcomputeAlreadyStopped = syscall.Errno(0xc0370110)
-
- // ErrVmcomputeOperationPending is an error encountered when the operation is being completed asynchronously
- ErrVmcomputeOperationPending = syscall.Errno(0xC0370103)
-
- // ErrVmcomputeOperationInvalidState is an error encountered when the compute system is not in a valid state for the requested operation
- ErrVmcomputeOperationInvalidState = syscall.Errno(0xc0370105)
-
- // ErrProcNotFound is an error encountered when the the process cannot be found
- ErrProcNotFound = syscall.Errno(0x7f)
-
- // ErrVmcomputeOperationAccessIsDenied is an error which can be encountered when enumerating compute systems in RS1/RS2
- // builds when the underlying silo might be in the process of terminating. HCS was fixed in RS3.
- ErrVmcomputeOperationAccessIsDenied = syscall.Errno(0x5)
-
- // ErrVmcomputeInvalidJSON is an error encountered when the compute system does not support/understand the messages sent by management
- ErrVmcomputeInvalidJSON = syscall.Errno(0xc037010d)
-
- // ErrVmcomputeUnknownMessage is an error encountered guest compute system doesn't support the message
- ErrVmcomputeUnknownMessage = syscall.Errno(0xc037010b)
-
- // ErrVmcomputeUnexpectedExit is an error encountered when the compute system terminates unexpectedly
- ErrVmcomputeUnexpectedExit = syscall.Errno(0xC0370106)
-
- // ErrNotSupported is an error encountered when hcs doesn't support the request
- ErrPlatformNotSupported = errors.New("unsupported platform request")
-)
-
-type ErrorEvent struct {
- Message string `json:"Message,omitempty"` // Fully formated error message
- StackTrace string `json:"StackTrace,omitempty"` // Stack trace in string form
- Provider string `json:"Provider,omitempty"`
- EventID uint16 `json:"EventId,omitempty"`
- Flags uint32 `json:"Flags,omitempty"`
- Source string `json:"Source,omitempty"`
- //Data []EventData `json:"Data,omitempty"` // Omit this as HCS doesn't encode this well. It's more confusing to include. It is however logged in debug mode (see processHcsResult function)
-}
-
-type hcsResult struct {
- Error int32
- ErrorMessage string
- ErrorEvents []ErrorEvent `json:"ErrorEvents,omitempty"`
-}
-
-func (ev *ErrorEvent) String() string {
- evs := "[Event Detail: " + ev.Message
- if ev.StackTrace != "" {
- evs += " Stack Trace: " + ev.StackTrace
- }
- if ev.Provider != "" {
- evs += " Provider: " + ev.Provider
- }
- if ev.EventID != 0 {
- evs = fmt.Sprintf("%s EventID: %d", evs, ev.EventID)
- }
- if ev.Flags != 0 {
- evs = fmt.Sprintf("%s flags: %d", evs, ev.Flags)
- }
- if ev.Source != "" {
- evs += " Source: " + ev.Source
- }
- evs += "]"
- return evs
-}
-
-func processHcsResult(ctx context.Context, resultJSON string) []ErrorEvent {
- if resultJSON != "" {
- result := &hcsResult{}
- if err := json.Unmarshal([]byte(resultJSON), result); err != nil {
- log.G(ctx).WithError(err).Warning("Could not unmarshal HCS result")
- return nil
- }
- return result.ErrorEvents
- }
- return nil
-}
-
-type HcsError struct {
- Op string
- Err error
- Events []ErrorEvent
-}
-
-var _ net.Error = &HcsError{}
-
-func (e *HcsError) Error() string {
- s := e.Op + ": " + e.Err.Error()
- for _, ev := range e.Events {
- s += "\n" + ev.String()
- }
- return s
-}
-
-func (e *HcsError) Temporary() bool {
- err, ok := e.Err.(net.Error)
- return ok && err.Temporary()
-}
-
-func (e *HcsError) Timeout() bool {
- err, ok := e.Err.(net.Error)
- return ok && err.Timeout()
-}
-
-// ProcessError is an error encountered in HCS during an operation on a Process object
-type ProcessError struct {
- SystemID string
- Pid int
- Op string
- Err error
- Events []ErrorEvent
-}
-
-var _ net.Error = &ProcessError{}
-
-// SystemError is an error encountered in HCS during an operation on a Container object
-type SystemError struct {
- ID string
- Op string
- Err error
- Extra string
- Events []ErrorEvent
-}
-
-var _ net.Error = &SystemError{}
-
-func (e *SystemError) Error() string {
- s := e.Op + " " + e.ID + ": " + e.Err.Error()
- for _, ev := range e.Events {
- s += "\n" + ev.String()
- }
- if e.Extra != "" {
- s += "\n(extra info: " + e.Extra + ")"
- }
- return s
-}
-
-func (e *SystemError) Temporary() bool {
- err, ok := e.Err.(net.Error)
- return ok && err.Temporary()
-}
-
-func (e *SystemError) Timeout() bool {
- err, ok := e.Err.(net.Error)
- return ok && err.Timeout()
-}
-
-func makeSystemError(system *System, op string, extra string, err error, events []ErrorEvent) error {
- // Don't double wrap errors
- if _, ok := err.(*SystemError); ok {
- return err
- }
- return &SystemError{
- ID: system.ID(),
- Op: op,
- Extra: extra,
- Err: err,
- Events: events,
- }
-}
-
-func (e *ProcessError) Error() string {
- s := fmt.Sprintf("%s %s:%d: %s", e.Op, e.SystemID, e.Pid, e.Err.Error())
- for _, ev := range e.Events {
- s += "\n" + ev.String()
- }
- return s
-}
-
-func (e *ProcessError) Temporary() bool {
- err, ok := e.Err.(net.Error)
- return ok && err.Temporary()
-}
-
-func (e *ProcessError) Timeout() bool {
- err, ok := e.Err.(net.Error)
- return ok && err.Timeout()
-}
-
-func makeProcessError(process *Process, op string, err error, events []ErrorEvent) error {
- // Don't double wrap errors
- if _, ok := err.(*ProcessError); ok {
- return err
- }
- return &ProcessError{
- Pid: process.Pid(),
- SystemID: process.SystemID(),
- Op: op,
- Err: err,
- Events: events,
- }
-}
-
-// IsNotExist checks if an error is caused by the Container or Process not existing.
-// Note: Currently, ErrElementNotFound can mean that a Process has either
-// already exited, or does not exist. Both IsAlreadyStopped and IsNotExist
-// will currently return true when the error is ErrElementNotFound or ErrProcNotFound.
-func IsNotExist(err error) bool {
- err = getInnerError(err)
- return err == ErrComputeSystemDoesNotExist ||
- err == ErrElementNotFound ||
- err == ErrProcNotFound
-}
-
-// IsAlreadyClosed checks if an error is caused by the Container or Process having been
-// already closed by a call to the Close() method.
-func IsAlreadyClosed(err error) bool {
- err = getInnerError(err)
- return err == ErrAlreadyClosed
-}
-
-// IsPending returns a boolean indicating whether the error is that
-// the requested operation is being completed in the background.
-func IsPending(err error) bool {
- err = getInnerError(err)
- return err == ErrVmcomputeOperationPending
-}
-
-// IsTimeout returns a boolean indicating whether the error is caused by
-// a timeout waiting for the operation to complete.
-func IsTimeout(err error) bool {
- if err, ok := err.(net.Error); ok && err.Timeout() {
- return true
- }
- err = getInnerError(err)
- return err == ErrTimeout
-}
-
-// IsAlreadyStopped returns a boolean indicating whether the error is caused by
-// a Container or Process being already stopped.
-// Note: Currently, ErrElementNotFound can mean that a Process has either
-// already exited, or does not exist. Both IsAlreadyStopped and IsNotExist
-// will currently return true when the error is ErrElementNotFound or ErrProcNotFound.
-func IsAlreadyStopped(err error) bool {
- err = getInnerError(err)
- return err == ErrVmcomputeAlreadyStopped ||
- err == ErrElementNotFound ||
- err == ErrProcNotFound
-}
-
-// IsNotSupported returns a boolean indicating whether the error is caused by
-// unsupported platform requests
-// Note: Currently Unsupported platform requests can be mean either
-// ErrVmcomputeInvalidJSON, ErrInvalidData, ErrNotSupported or ErrVmcomputeUnknownMessage
-// is thrown from the Platform
-func IsNotSupported(err error) bool {
- err = getInnerError(err)
- // If Platform doesn't recognize or support the request sent, below errors are seen
- return err == ErrVmcomputeInvalidJSON ||
- err == ErrInvalidData ||
- err == ErrNotSupported ||
- err == ErrVmcomputeUnknownMessage
-}
-
-// IsOperationInvalidState returns true when err is caused by
-// `ErrVmcomputeOperationInvalidState`.
-func IsOperationInvalidState(err error) bool {
- err = getInnerError(err)
- return err == ErrVmcomputeOperationInvalidState
-}
-
-func getInnerError(err error) error {
- switch pe := err.(type) {
- case nil:
- return nil
- case *HcsError:
- err = pe.Err
- case *SystemError:
- err = pe.Err
- case *ProcessError:
- err = pe.Err
- }
- return err
-}
-
-func getOperationLogResult(err error) (string, error) {
- switch err {
- case nil:
- return "Success", nil
- default:
- return "Error", err
- }
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/process.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/process.go
deleted file mode 100644
index 2ad978f29..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/hcs/process.go
+++ /dev/null
@@ -1,474 +0,0 @@
-package hcs
-
-import (
- "context"
- "encoding/json"
- "io"
- "sync"
- "syscall"
- "time"
-
- "github.com/Microsoft/hcsshim/internal/log"
- "github.com/Microsoft/hcsshim/internal/oc"
- "github.com/Microsoft/hcsshim/internal/vmcompute"
- "go.opencensus.io/trace"
-)
-
-// ContainerError is an error encountered in HCS
-type Process struct {
- handleLock sync.RWMutex
- handle vmcompute.HcsProcess
- processID int
- system *System
- hasCachedStdio bool
- stdioLock sync.Mutex
- stdin io.WriteCloser
- stdout io.ReadCloser
- stderr io.ReadCloser
- callbackNumber uintptr
-
- closedWaitOnce sync.Once
- waitBlock chan struct{}
- exitCode int
- waitError error
-}
-
-func newProcess(process vmcompute.HcsProcess, processID int, computeSystem *System) *Process {
- return &Process{
- handle: process,
- processID: processID,
- system: computeSystem,
- waitBlock: make(chan struct{}),
- }
-}
-
-type processModifyRequest struct {
- Operation string
- ConsoleSize *consoleSize `json:",omitempty"`
- CloseHandle *closeHandle `json:",omitempty"`
-}
-
-type consoleSize struct {
- Height uint16
- Width uint16
-}
-
-type closeHandle struct {
- Handle string
-}
-
-type processStatus struct {
- ProcessID uint32
- Exited bool
- ExitCode uint32
- LastWaitResult int32
-}
-
-const (
- stdIn string = "StdIn"
- stdOut string = "StdOut"
- stdErr string = "StdErr"
-)
-
-const (
- modifyConsoleSize string = "ConsoleSize"
- modifyCloseHandle string = "CloseHandle"
-)
-
-// Pid returns the process ID of the process within the container.
-func (process *Process) Pid() int {
- return process.processID
-}
-
-// SystemID returns the ID of the process's compute system.
-func (process *Process) SystemID() string {
- return process.system.ID()
-}
-
-func (process *Process) processSignalResult(ctx context.Context, err error) (bool, error) {
- switch err {
- case nil:
- return true, nil
- case ErrVmcomputeOperationInvalidState, ErrComputeSystemDoesNotExist, ErrElementNotFound:
- select {
- case <-process.waitBlock:
- // The process exit notification has already arrived.
- default:
- // The process should be gone, but we have not received the notification.
- // After a second, force unblock the process wait to work around a possible
- // deadlock in the HCS.
- go func() {
- time.Sleep(time.Second)
- process.closedWaitOnce.Do(func() {
- log.G(ctx).WithError(err).Warn("force unblocking process waits")
- process.exitCode = -1
- process.waitError = err
- close(process.waitBlock)
- })
- }()
- }
- return false, nil
- default:
- return false, err
- }
-}
-
-// Signal signals the process with `options`.
-//
-// For LCOW `guestrequest.SignalProcessOptionsLCOW`.
-//
-// For WCOW `guestrequest.SignalProcessOptionsWCOW`.
-func (process *Process) Signal(ctx context.Context, options interface{}) (bool, error) {
- process.handleLock.RLock()
- defer process.handleLock.RUnlock()
-
- operation := "hcsshim::Process::Signal"
-
- if process.handle == 0 {
- return false, makeProcessError(process, operation, ErrAlreadyClosed, nil)
- }
-
- optionsb, err := json.Marshal(options)
- if err != nil {
- return false, err
- }
-
- resultJSON, err := vmcompute.HcsSignalProcess(ctx, process.handle, string(optionsb))
- events := processHcsResult(ctx, resultJSON)
- delivered, err := process.processSignalResult(ctx, err)
- if err != nil {
- err = makeProcessError(process, operation, err, events)
- }
- return delivered, err
-}
-
-// Kill signals the process to terminate but does not wait for it to finish terminating.
-func (process *Process) Kill(ctx context.Context) (bool, error) {
- process.handleLock.RLock()
- defer process.handleLock.RUnlock()
-
- operation := "hcsshim::Process::Kill"
-
- if process.handle == 0 {
- return false, makeProcessError(process, operation, ErrAlreadyClosed, nil)
- }
-
- resultJSON, err := vmcompute.HcsTerminateProcess(ctx, process.handle)
- events := processHcsResult(ctx, resultJSON)
- delivered, err := process.processSignalResult(ctx, err)
- if err != nil {
- err = makeProcessError(process, operation, err, events)
- }
- return delivered, err
-}
-
-// waitBackground waits for the process exit notification. Once received sets
-// `process.waitError` (if any) and unblocks all `Wait` calls.
-//
-// This MUST be called exactly once per `process.handle` but `Wait` is safe to
-// call multiple times.
-func (process *Process) waitBackground() {
- operation := "hcsshim::Process::waitBackground"
- ctx, span := trace.StartSpan(context.Background(), operation)
- defer span.End()
- span.AddAttributes(
- trace.StringAttribute("cid", process.SystemID()),
- trace.Int64Attribute("pid", int64(process.processID)))
-
- var (
- err error
- exitCode = -1
- )
-
- err = waitForNotification(ctx, process.callbackNumber, hcsNotificationProcessExited, nil)
- if err != nil {
- err = makeProcessError(process, operation, err, nil)
- log.G(ctx).WithError(err).Error("failed wait")
- } else {
- process.handleLock.RLock()
- defer process.handleLock.RUnlock()
-
- // Make sure we didnt race with Close() here
- if process.handle != 0 {
- propertiesJSON, resultJSON, err := vmcompute.HcsGetProcessProperties(ctx, process.handle)
- events := processHcsResult(ctx, resultJSON)
- if err != nil {
- err = makeProcessError(process, operation, err, events)
- } else {
- properties := &processStatus{}
- err = json.Unmarshal([]byte(propertiesJSON), properties)
- if err != nil {
- err = makeProcessError(process, operation, err, nil)
- } else {
- if properties.LastWaitResult != 0 {
- log.G(ctx).WithField("wait-result", properties.LastWaitResult).Warning("non-zero last wait result")
- } else {
- exitCode = int(properties.ExitCode)
- }
- }
- }
- }
- }
- log.G(ctx).WithField("exitCode", exitCode).Debug("process exited")
-
- process.closedWaitOnce.Do(func() {
- process.exitCode = exitCode
- process.waitError = err
- close(process.waitBlock)
- })
- oc.SetSpanStatus(span, err)
-}
-
-// Wait waits for the process to exit. If the process has already exited returns
-// the pervious error (if any).
-func (process *Process) Wait() error {
- <-process.waitBlock
- return process.waitError
-}
-
-// ResizeConsole resizes the console of the process.
-func (process *Process) ResizeConsole(ctx context.Context, width, height uint16) error {
- process.handleLock.RLock()
- defer process.handleLock.RUnlock()
-
- operation := "hcsshim::Process::ResizeConsole"
-
- if process.handle == 0 {
- return makeProcessError(process, operation, ErrAlreadyClosed, nil)
- }
-
- modifyRequest := processModifyRequest{
- Operation: modifyConsoleSize,
- ConsoleSize: &consoleSize{
- Height: height,
- Width: width,
- },
- }
-
- modifyRequestb, err := json.Marshal(modifyRequest)
- if err != nil {
- return err
- }
-
- resultJSON, err := vmcompute.HcsModifyProcess(ctx, process.handle, string(modifyRequestb))
- events := processHcsResult(ctx, resultJSON)
- if err != nil {
- return makeProcessError(process, operation, err, events)
- }
-
- return nil
-}
-
-// ExitCode returns the exit code of the process. The process must have
-// already terminated.
-func (process *Process) ExitCode() (int, error) {
- select {
- case <-process.waitBlock:
- if process.waitError != nil {
- return -1, process.waitError
- }
- return process.exitCode, nil
- default:
- return -1, makeProcessError(process, "hcsshim::Process::ExitCode", ErrInvalidProcessState, nil)
- }
-}
-
-// StdioLegacy returns the stdin, stdout, and stderr pipes, respectively. Closing
-// these pipes does not close the underlying pipes. Once returned, these pipes
-// are the responsibility of the caller to close.
-func (process *Process) StdioLegacy() (_ io.WriteCloser, _ io.ReadCloser, _ io.ReadCloser, err error) {
- operation := "hcsshim::Process::StdioLegacy"
- ctx, span := trace.StartSpan(context.Background(), operation)
- defer span.End()
- defer func() { oc.SetSpanStatus(span, err) }()
- span.AddAttributes(
- trace.StringAttribute("cid", process.SystemID()),
- trace.Int64Attribute("pid", int64(process.processID)))
-
- process.handleLock.RLock()
- defer process.handleLock.RUnlock()
-
- if process.handle == 0 {
- return nil, nil, nil, makeProcessError(process, operation, ErrAlreadyClosed, nil)
- }
-
- process.stdioLock.Lock()
- defer process.stdioLock.Unlock()
- if process.hasCachedStdio {
- stdin, stdout, stderr := process.stdin, process.stdout, process.stderr
- process.stdin, process.stdout, process.stderr = nil, nil, nil
- process.hasCachedStdio = false
- return stdin, stdout, stderr, nil
- }
-
- processInfo, resultJSON, err := vmcompute.HcsGetProcessInfo(ctx, process.handle)
- events := processHcsResult(ctx, resultJSON)
- if err != nil {
- return nil, nil, nil, makeProcessError(process, operation, err, events)
- }
-
- pipes, err := makeOpenFiles([]syscall.Handle{processInfo.StdInput, processInfo.StdOutput, processInfo.StdError})
- if err != nil {
- return nil, nil, nil, makeProcessError(process, operation, err, nil)
- }
-
- return pipes[0], pipes[1], pipes[2], nil
-}
-
-// Stdio returns the stdin, stdout, and stderr pipes, respectively.
-// To close them, close the process handle.
-func (process *Process) Stdio() (stdin io.Writer, stdout, stderr io.Reader) {
- process.stdioLock.Lock()
- defer process.stdioLock.Unlock()
- return process.stdin, process.stdout, process.stderr
-}
-
-// CloseStdin closes the write side of the stdin pipe so that the process is
-// notified on the read side that there is no more data in stdin.
-func (process *Process) CloseStdin(ctx context.Context) error {
- process.handleLock.RLock()
- defer process.handleLock.RUnlock()
-
- operation := "hcsshim::Process::CloseStdin"
-
- if process.handle == 0 {
- return makeProcessError(process, operation, ErrAlreadyClosed, nil)
- }
-
- modifyRequest := processModifyRequest{
- Operation: modifyCloseHandle,
- CloseHandle: &closeHandle{
- Handle: stdIn,
- },
- }
-
- modifyRequestb, err := json.Marshal(modifyRequest)
- if err != nil {
- return err
- }
-
- resultJSON, err := vmcompute.HcsModifyProcess(ctx, process.handle, string(modifyRequestb))
- events := processHcsResult(ctx, resultJSON)
- if err != nil {
- return makeProcessError(process, operation, err, events)
- }
-
- process.stdioLock.Lock()
- if process.stdin != nil {
- process.stdin.Close()
- process.stdin = nil
- }
- process.stdioLock.Unlock()
-
- return nil
-}
-
-// Close cleans up any state associated with the process but does not kill
-// or wait on it.
-func (process *Process) Close() (err error) {
- operation := "hcsshim::Process::Close"
- ctx, span := trace.StartSpan(context.Background(), operation)
- defer span.End()
- defer func() { oc.SetSpanStatus(span, err) }()
- span.AddAttributes(
- trace.StringAttribute("cid", process.SystemID()),
- trace.Int64Attribute("pid", int64(process.processID)))
-
- process.handleLock.Lock()
- defer process.handleLock.Unlock()
-
- // Don't double free this
- if process.handle == 0 {
- return nil
- }
-
- process.stdioLock.Lock()
- if process.stdin != nil {
- process.stdin.Close()
- process.stdin = nil
- }
- if process.stdout != nil {
- process.stdout.Close()
- process.stdout = nil
- }
- if process.stderr != nil {
- process.stderr.Close()
- process.stderr = nil
- }
- process.stdioLock.Unlock()
-
- if err = process.unregisterCallback(ctx); err != nil {
- return makeProcessError(process, operation, err, nil)
- }
-
- if err = vmcompute.HcsCloseProcess(ctx, process.handle); err != nil {
- return makeProcessError(process, operation, err, nil)
- }
-
- process.handle = 0
- process.closedWaitOnce.Do(func() {
- process.exitCode = -1
- process.waitError = ErrAlreadyClosed
- close(process.waitBlock)
- })
-
- return nil
-}
-
-func (process *Process) registerCallback(ctx context.Context) error {
- callbackContext := ¬ifcationWatcherContext{
- channels: newProcessChannels(),
- systemID: process.SystemID(),
- processID: process.processID,
- }
-
- callbackMapLock.Lock()
- callbackNumber := nextCallback
- nextCallback++
- callbackMap[callbackNumber] = callbackContext
- callbackMapLock.Unlock()
-
- callbackHandle, err := vmcompute.HcsRegisterProcessCallback(ctx, process.handle, notificationWatcherCallback, callbackNumber)
- if err != nil {
- return err
- }
- callbackContext.handle = callbackHandle
- process.callbackNumber = callbackNumber
-
- return nil
-}
-
-func (process *Process) unregisterCallback(ctx context.Context) error {
- callbackNumber := process.callbackNumber
-
- callbackMapLock.RLock()
- callbackContext := callbackMap[callbackNumber]
- callbackMapLock.RUnlock()
-
- if callbackContext == nil {
- return nil
- }
-
- handle := callbackContext.handle
-
- if handle == 0 {
- return nil
- }
-
- // vmcompute.HcsUnregisterProcessCallback has its own synchronization to
- // wait for all callbacks to complete. We must NOT hold the callbackMapLock.
- err := vmcompute.HcsUnregisterProcessCallback(ctx, handle)
- if err != nil {
- return err
- }
-
- closeChannels(callbackContext.channels)
-
- callbackMapLock.Lock()
- delete(callbackMap, callbackNumber)
- callbackMapLock.Unlock()
-
- handle = 0
-
- return nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/syscall.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/syscall.go
deleted file mode 100644
index ded2175c5..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/hcs/syscall.go
+++ /dev/null
@@ -1,5 +0,0 @@
-package hcs
-
-//go:generate go run ../../mksyscall_windows.go -output zsyscall_windows.go syscall.go
-
-//sys hcsFormatWritableLayerVhd(handle uintptr) (hr error) = computestorage.HcsFormatWritableLayerVhd
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/system.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/system.go
deleted file mode 100644
index 67a5f7176..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/hcs/system.go
+++ /dev/null
@@ -1,606 +0,0 @@
-package hcs
-
-import (
- "context"
- "encoding/json"
- "errors"
- "strings"
- "sync"
- "syscall"
-
- "github.com/Microsoft/hcsshim/internal/cow"
- "github.com/Microsoft/hcsshim/internal/log"
- "github.com/Microsoft/hcsshim/internal/oc"
- "github.com/Microsoft/hcsshim/internal/schema1"
- hcsschema "github.com/Microsoft/hcsshim/internal/schema2"
- "github.com/Microsoft/hcsshim/internal/timeout"
- "github.com/Microsoft/hcsshim/internal/vmcompute"
- "go.opencensus.io/trace"
-)
-
-type System struct {
- handleLock sync.RWMutex
- handle vmcompute.HcsSystem
- id string
- callbackNumber uintptr
-
- closedWaitOnce sync.Once
- waitBlock chan struct{}
- waitError error
- exitError error
-
- os, typ string
-}
-
-func newSystem(id string) *System {
- return &System{
- id: id,
- waitBlock: make(chan struct{}),
- }
-}
-
-// CreateComputeSystem creates a new compute system with the given configuration but does not start it.
-func CreateComputeSystem(ctx context.Context, id string, hcsDocumentInterface interface{}) (_ *System, err error) {
- operation := "hcsshim::CreateComputeSystem"
-
- // hcsCreateComputeSystemContext is an async operation. Start the outer span
- // here to measure the full create time.
- ctx, span := trace.StartSpan(ctx, operation)
- defer span.End()
- defer func() { oc.SetSpanStatus(span, err) }()
- span.AddAttributes(trace.StringAttribute("cid", id))
-
- computeSystem := newSystem(id)
-
- hcsDocumentB, err := json.Marshal(hcsDocumentInterface)
- if err != nil {
- return nil, err
- }
-
- hcsDocument := string(hcsDocumentB)
-
- var (
- identity syscall.Handle
- resultJSON string
- createError error
- )
- computeSystem.handle, resultJSON, createError = vmcompute.HcsCreateComputeSystem(ctx, id, hcsDocument, identity)
- if createError == nil || IsPending(createError) {
- defer func() {
- if err != nil {
- computeSystem.Close()
- }
- }()
- if err = computeSystem.registerCallback(ctx); err != nil {
- // Terminate the compute system if it still exists. We're okay to
- // ignore a failure here.
- computeSystem.Terminate(ctx)
- return nil, makeSystemError(computeSystem, operation, "", err, nil)
- }
- }
-
- events, err := processAsyncHcsResult(ctx, createError, resultJSON, computeSystem.callbackNumber, hcsNotificationSystemCreateCompleted, &timeout.SystemCreate)
- if err != nil {
- if err == ErrTimeout {
- // Terminate the compute system if it still exists. We're okay to
- // ignore a failure here.
- computeSystem.Terminate(ctx)
- }
- return nil, makeSystemError(computeSystem, operation, hcsDocument, err, events)
- }
- go computeSystem.waitBackground()
- if err = computeSystem.getCachedProperties(ctx); err != nil {
- return nil, err
- }
- return computeSystem, nil
-}
-
-// OpenComputeSystem opens an existing compute system by ID.
-func OpenComputeSystem(ctx context.Context, id string) (*System, error) {
- operation := "hcsshim::OpenComputeSystem"
-
- computeSystem := newSystem(id)
- handle, resultJSON, err := vmcompute.HcsOpenComputeSystem(ctx, id)
- events := processHcsResult(ctx, resultJSON)
- if err != nil {
- return nil, makeSystemError(computeSystem, operation, "", err, events)
- }
- computeSystem.handle = handle
- defer func() {
- if err != nil {
- computeSystem.Close()
- }
- }()
- if err = computeSystem.registerCallback(ctx); err != nil {
- return nil, makeSystemError(computeSystem, operation, "", err, nil)
- }
- go computeSystem.waitBackground()
- if err = computeSystem.getCachedProperties(ctx); err != nil {
- return nil, err
- }
- return computeSystem, nil
-}
-
-func (computeSystem *System) getCachedProperties(ctx context.Context) error {
- props, err := computeSystem.Properties(ctx)
- if err != nil {
- return err
- }
- computeSystem.typ = strings.ToLower(props.SystemType)
- computeSystem.os = strings.ToLower(props.RuntimeOSType)
- if computeSystem.os == "" && computeSystem.typ == "container" {
- // Pre-RS5 HCS did not return the OS, but it only supported containers
- // that ran Windows.
- computeSystem.os = "windows"
- }
- return nil
-}
-
-// OS returns the operating system of the compute system, "linux" or "windows".
-func (computeSystem *System) OS() string {
- return computeSystem.os
-}
-
-// IsOCI returns whether processes in the compute system should be created via
-// OCI.
-func (computeSystem *System) IsOCI() bool {
- return computeSystem.os == "linux" && computeSystem.typ == "container"
-}
-
-// GetComputeSystems gets a list of the compute systems on the system that match the query
-func GetComputeSystems(ctx context.Context, q schema1.ComputeSystemQuery) ([]schema1.ContainerProperties, error) {
- operation := "hcsshim::GetComputeSystems"
-
- queryb, err := json.Marshal(q)
- if err != nil {
- return nil, err
- }
-
- computeSystemsJSON, resultJSON, err := vmcompute.HcsEnumerateComputeSystems(ctx, string(queryb))
- events := processHcsResult(ctx, resultJSON)
- if err != nil {
- return nil, &HcsError{Op: operation, Err: err, Events: events}
- }
-
- if computeSystemsJSON == "" {
- return nil, ErrUnexpectedValue
- }
- computeSystems := []schema1.ContainerProperties{}
- if err = json.Unmarshal([]byte(computeSystemsJSON), &computeSystems); err != nil {
- return nil, err
- }
-
- return computeSystems, nil
-}
-
-// Start synchronously starts the computeSystem.
-func (computeSystem *System) Start(ctx context.Context) (err error) {
- operation := "hcsshim::System::Start"
-
- // hcsStartComputeSystemContext is an async operation. Start the outer span
- // here to measure the full start time.
- ctx, span := trace.StartSpan(ctx, operation)
- defer span.End()
- defer func() { oc.SetSpanStatus(span, err) }()
- span.AddAttributes(trace.StringAttribute("cid", computeSystem.id))
-
- computeSystem.handleLock.RLock()
- defer computeSystem.handleLock.RUnlock()
-
- if computeSystem.handle == 0 {
- return makeSystemError(computeSystem, operation, "", ErrAlreadyClosed, nil)
- }
-
- resultJSON, err := vmcompute.HcsStartComputeSystem(ctx, computeSystem.handle, "")
- events, err := processAsyncHcsResult(ctx, err, resultJSON, computeSystem.callbackNumber, hcsNotificationSystemStartCompleted, &timeout.SystemStart)
- if err != nil {
- return makeSystemError(computeSystem, operation, "", err, events)
- }
-
- return nil
-}
-
-// ID returns the compute system's identifier.
-func (computeSystem *System) ID() string {
- return computeSystem.id
-}
-
-// Shutdown requests a compute system shutdown.
-func (computeSystem *System) Shutdown(ctx context.Context) error {
- computeSystem.handleLock.RLock()
- defer computeSystem.handleLock.RUnlock()
-
- operation := "hcsshim::System::Shutdown"
-
- if computeSystem.handle == 0 {
- return nil
- }
-
- resultJSON, err := vmcompute.HcsShutdownComputeSystem(ctx, computeSystem.handle, "")
- events := processHcsResult(ctx, resultJSON)
- switch err {
- case nil, ErrVmcomputeAlreadyStopped, ErrComputeSystemDoesNotExist, ErrVmcomputeOperationPending:
- default:
- return makeSystemError(computeSystem, operation, "", err, events)
- }
- return nil
-}
-
-// Terminate requests a compute system terminate.
-func (computeSystem *System) Terminate(ctx context.Context) error {
- computeSystem.handleLock.RLock()
- defer computeSystem.handleLock.RUnlock()
-
- operation := "hcsshim::System::Terminate"
-
- if computeSystem.handle == 0 {
- return nil
- }
-
- resultJSON, err := vmcompute.HcsTerminateComputeSystem(ctx, computeSystem.handle, "")
- events := processHcsResult(ctx, resultJSON)
- switch err {
- case nil, ErrVmcomputeAlreadyStopped, ErrComputeSystemDoesNotExist, ErrVmcomputeOperationPending:
- default:
- return makeSystemError(computeSystem, operation, "", err, events)
- }
- return nil
-}
-
-// waitBackground waits for the compute system exit notification. Once received
-// sets `computeSystem.waitError` (if any) and unblocks all `Wait` calls.
-//
-// This MUST be called exactly once per `computeSystem.handle` but `Wait` is
-// safe to call multiple times.
-func (computeSystem *System) waitBackground() {
- operation := "hcsshim::System::waitBackground"
- ctx, span := trace.StartSpan(context.Background(), operation)
- defer span.End()
- span.AddAttributes(trace.StringAttribute("cid", computeSystem.id))
-
- err := waitForNotification(ctx, computeSystem.callbackNumber, hcsNotificationSystemExited, nil)
- switch err {
- case nil:
- log.G(ctx).Debug("system exited")
- case ErrVmcomputeUnexpectedExit:
- log.G(ctx).Debug("unexpected system exit")
- computeSystem.exitError = makeSystemError(computeSystem, operation, "", err, nil)
- err = nil
- default:
- err = makeSystemError(computeSystem, operation, "", err, nil)
- }
- computeSystem.closedWaitOnce.Do(func() {
- computeSystem.waitError = err
- close(computeSystem.waitBlock)
- })
- oc.SetSpanStatus(span, err)
-}
-
-// Wait synchronously waits for the compute system to shutdown or terminate. If
-// the compute system has already exited returns the previous error (if any).
-func (computeSystem *System) Wait() error {
- <-computeSystem.waitBlock
- return computeSystem.waitError
-}
-
-// ExitError returns an error describing the reason the compute system terminated.
-func (computeSystem *System) ExitError() error {
- select {
- case <-computeSystem.waitBlock:
- if computeSystem.waitError != nil {
- return computeSystem.waitError
- }
- return computeSystem.exitError
- default:
- return errors.New("container not exited")
- }
-}
-
-// Properties returns the requested container properties targeting a V1 schema container.
-func (computeSystem *System) Properties(ctx context.Context, types ...schema1.PropertyType) (*schema1.ContainerProperties, error) {
- computeSystem.handleLock.RLock()
- defer computeSystem.handleLock.RUnlock()
-
- operation := "hcsshim::System::Properties"
-
- queryBytes, err := json.Marshal(schema1.PropertyQuery{PropertyTypes: types})
- if err != nil {
- return nil, makeSystemError(computeSystem, operation, "", err, nil)
- }
-
- propertiesJSON, resultJSON, err := vmcompute.HcsGetComputeSystemProperties(ctx, computeSystem.handle, string(queryBytes))
- events := processHcsResult(ctx, resultJSON)
- if err != nil {
- return nil, makeSystemError(computeSystem, operation, "", err, events)
- }
-
- if propertiesJSON == "" {
- return nil, ErrUnexpectedValue
- }
- properties := &schema1.ContainerProperties{}
- if err := json.Unmarshal([]byte(propertiesJSON), properties); err != nil {
- return nil, makeSystemError(computeSystem, operation, "", err, nil)
- }
-
- return properties, nil
-}
-
-// PropertiesV2 returns the requested container properties targeting a V2 schema container.
-func (computeSystem *System) PropertiesV2(ctx context.Context, types ...hcsschema.PropertyType) (*hcsschema.Properties, error) {
- computeSystem.handleLock.RLock()
- defer computeSystem.handleLock.RUnlock()
-
- operation := "hcsshim::System::PropertiesV2"
-
- queryBytes, err := json.Marshal(hcsschema.PropertyQuery{PropertyTypes: types})
- if err != nil {
- return nil, makeSystemError(computeSystem, operation, "", err, nil)
- }
-
- propertiesJSON, resultJSON, err := vmcompute.HcsGetComputeSystemProperties(ctx, computeSystem.handle, string(queryBytes))
- events := processHcsResult(ctx, resultJSON)
- if err != nil {
- return nil, makeSystemError(computeSystem, operation, "", err, events)
- }
-
- if propertiesJSON == "" {
- return nil, ErrUnexpectedValue
- }
- properties := &hcsschema.Properties{}
- if err := json.Unmarshal([]byte(propertiesJSON), properties); err != nil {
- return nil, makeSystemError(computeSystem, operation, "", err, nil)
- }
-
- return properties, nil
-}
-
-// Pause pauses the execution of the computeSystem. This feature is not enabled in TP5.
-func (computeSystem *System) Pause(ctx context.Context) (err error) {
- operation := "hcsshim::System::Pause"
-
- // hcsPauseComputeSystemContext is an async peration. Start the outer span
- // here to measure the full pause time.
- ctx, span := trace.StartSpan(ctx, operation)
- defer span.End()
- defer func() { oc.SetSpanStatus(span, err) }()
- span.AddAttributes(trace.StringAttribute("cid", computeSystem.id))
-
- computeSystem.handleLock.RLock()
- defer computeSystem.handleLock.RUnlock()
-
- if computeSystem.handle == 0 {
- return makeSystemError(computeSystem, operation, "", ErrAlreadyClosed, nil)
- }
-
- resultJSON, err := vmcompute.HcsPauseComputeSystem(ctx, computeSystem.handle, "")
- events, err := processAsyncHcsResult(ctx, err, resultJSON, computeSystem.callbackNumber, hcsNotificationSystemPauseCompleted, &timeout.SystemPause)
- if err != nil {
- return makeSystemError(computeSystem, operation, "", err, events)
- }
-
- return nil
-}
-
-// Resume resumes the execution of the computeSystem. This feature is not enabled in TP5.
-func (computeSystem *System) Resume(ctx context.Context) (err error) {
- operation := "hcsshim::System::Resume"
-
- // hcsResumeComputeSystemContext is an async operation. Start the outer span
- // here to measure the full restore time.
- ctx, span := trace.StartSpan(ctx, operation)
- defer span.End()
- defer func() { oc.SetSpanStatus(span, err) }()
- span.AddAttributes(trace.StringAttribute("cid", computeSystem.id))
-
- computeSystem.handleLock.RLock()
- defer computeSystem.handleLock.RUnlock()
-
- if computeSystem.handle == 0 {
- return makeSystemError(computeSystem, operation, "", ErrAlreadyClosed, nil)
- }
-
- resultJSON, err := vmcompute.HcsResumeComputeSystem(ctx, computeSystem.handle, "")
- events, err := processAsyncHcsResult(ctx, err, resultJSON, computeSystem.callbackNumber, hcsNotificationSystemResumeCompleted, &timeout.SystemResume)
- if err != nil {
- return makeSystemError(computeSystem, operation, "", err, events)
- }
-
- return nil
-}
-
-func (computeSystem *System) createProcess(ctx context.Context, operation string, c interface{}) (*Process, *vmcompute.HcsProcessInformation, error) {
- computeSystem.handleLock.RLock()
- defer computeSystem.handleLock.RUnlock()
-
- if computeSystem.handle == 0 {
- return nil, nil, makeSystemError(computeSystem, operation, "", ErrAlreadyClosed, nil)
- }
-
- configurationb, err := json.Marshal(c)
- if err != nil {
- return nil, nil, makeSystemError(computeSystem, operation, "", err, nil)
- }
-
- configuration := string(configurationb)
- processInfo, processHandle, resultJSON, err := vmcompute.HcsCreateProcess(ctx, computeSystem.handle, configuration)
- events := processHcsResult(ctx, resultJSON)
- if err != nil {
- return nil, nil, makeSystemError(computeSystem, operation, configuration, err, events)
- }
-
- log.G(ctx).WithField("pid", processInfo.ProcessId).Debug("created process pid")
- return newProcess(processHandle, int(processInfo.ProcessId), computeSystem), &processInfo, nil
-}
-
-// CreateProcess launches a new process within the computeSystem.
-func (computeSystem *System) CreateProcess(ctx context.Context, c interface{}) (cow.Process, error) {
- operation := "hcsshim::System::CreateProcess"
- process, processInfo, err := computeSystem.createProcess(ctx, operation, c)
- if err != nil {
- return nil, err
- }
- defer func() {
- if err != nil {
- process.Close()
- }
- }()
-
- pipes, err := makeOpenFiles([]syscall.Handle{processInfo.StdInput, processInfo.StdOutput, processInfo.StdError})
- if err != nil {
- return nil, makeSystemError(computeSystem, operation, "", err, nil)
- }
- process.stdin = pipes[0]
- process.stdout = pipes[1]
- process.stderr = pipes[2]
- process.hasCachedStdio = true
-
- if err = process.registerCallback(ctx); err != nil {
- return nil, makeSystemError(computeSystem, operation, "", err, nil)
- }
- go process.waitBackground()
-
- return process, nil
-}
-
-// OpenProcess gets an interface to an existing process within the computeSystem.
-func (computeSystem *System) OpenProcess(ctx context.Context, pid int) (*Process, error) {
- computeSystem.handleLock.RLock()
- defer computeSystem.handleLock.RUnlock()
-
- operation := "hcsshim::System::OpenProcess"
-
- if computeSystem.handle == 0 {
- return nil, makeSystemError(computeSystem, operation, "", ErrAlreadyClosed, nil)
- }
-
- processHandle, resultJSON, err := vmcompute.HcsOpenProcess(ctx, computeSystem.handle, uint32(pid))
- events := processHcsResult(ctx, resultJSON)
- if err != nil {
- return nil, makeSystemError(computeSystem, operation, "", err, events)
- }
-
- process := newProcess(processHandle, pid, computeSystem)
- if err = process.registerCallback(ctx); err != nil {
- return nil, makeSystemError(computeSystem, operation, "", err, nil)
- }
- go process.waitBackground()
-
- return process, nil
-}
-
-// Close cleans up any state associated with the compute system but does not terminate or wait for it.
-func (computeSystem *System) Close() (err error) {
- operation := "hcsshim::System::Close"
- ctx, span := trace.StartSpan(context.Background(), operation)
- defer span.End()
- defer func() { oc.SetSpanStatus(span, err) }()
- span.AddAttributes(trace.StringAttribute("cid", computeSystem.id))
-
- computeSystem.handleLock.Lock()
- defer computeSystem.handleLock.Unlock()
-
- // Don't double free this
- if computeSystem.handle == 0 {
- return nil
- }
-
- if err = computeSystem.unregisterCallback(ctx); err != nil {
- return makeSystemError(computeSystem, operation, "", err, nil)
- }
-
- err = vmcompute.HcsCloseComputeSystem(ctx, computeSystem.handle)
- if err != nil {
- return makeSystemError(computeSystem, operation, "", err, nil)
- }
-
- computeSystem.handle = 0
- computeSystem.closedWaitOnce.Do(func() {
- computeSystem.waitError = ErrAlreadyClosed
- close(computeSystem.waitBlock)
- })
-
- return nil
-}
-
-func (computeSystem *System) registerCallback(ctx context.Context) error {
- callbackContext := ¬ifcationWatcherContext{
- channels: newSystemChannels(),
- systemID: computeSystem.id,
- }
-
- callbackMapLock.Lock()
- callbackNumber := nextCallback
- nextCallback++
- callbackMap[callbackNumber] = callbackContext
- callbackMapLock.Unlock()
-
- callbackHandle, err := vmcompute.HcsRegisterComputeSystemCallback(ctx, computeSystem.handle, notificationWatcherCallback, callbackNumber)
- if err != nil {
- return err
- }
- callbackContext.handle = callbackHandle
- computeSystem.callbackNumber = callbackNumber
-
- return nil
-}
-
-func (computeSystem *System) unregisterCallback(ctx context.Context) error {
- callbackNumber := computeSystem.callbackNumber
-
- callbackMapLock.RLock()
- callbackContext := callbackMap[callbackNumber]
- callbackMapLock.RUnlock()
-
- if callbackContext == nil {
- return nil
- }
-
- handle := callbackContext.handle
-
- if handle == 0 {
- return nil
- }
-
- // hcsUnregisterComputeSystemCallback has its own syncronization
- // to wait for all callbacks to complete. We must NOT hold the callbackMapLock.
- err := vmcompute.HcsUnregisterComputeSystemCallback(ctx, handle)
- if err != nil {
- return err
- }
-
- closeChannels(callbackContext.channels)
-
- callbackMapLock.Lock()
- delete(callbackMap, callbackNumber)
- callbackMapLock.Unlock()
-
- handle = 0
-
- return nil
-}
-
-// Modify the System by sending a request to HCS
-func (computeSystem *System) Modify(ctx context.Context, config interface{}) error {
- computeSystem.handleLock.RLock()
- defer computeSystem.handleLock.RUnlock()
-
- operation := "hcsshim::System::Modify"
-
- if computeSystem.handle == 0 {
- return makeSystemError(computeSystem, operation, "", ErrAlreadyClosed, nil)
- }
-
- requestBytes, err := json.Marshal(config)
- if err != nil {
- return err
- }
-
- requestJSON := string(requestBytes)
- resultJSON, err := vmcompute.HcsModifyComputeSystem(ctx, computeSystem.handle, requestJSON)
- events := processHcsResult(ctx, resultJSON)
- if err != nil {
- return makeSystemError(computeSystem, operation, requestJSON, err, events)
- }
-
- return nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/utils.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/utils.go
deleted file mode 100644
index b474604bd..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/hcs/utils.go
+++ /dev/null
@@ -1,61 +0,0 @@
-package hcs
-
-import (
- "context"
- "io"
- "syscall"
-
- "github.com/Microsoft/go-winio"
- diskutil "github.com/Microsoft/go-winio/vhd"
- "github.com/pkg/errors"
- "golang.org/x/sys/windows"
-)
-
-// makeOpenFiles calls winio.MakeOpenFile for each handle in a slice but closes all the handles
-// if there is an error.
-func makeOpenFiles(hs []syscall.Handle) (_ []io.ReadWriteCloser, err error) {
- fs := make([]io.ReadWriteCloser, len(hs))
- for i, h := range hs {
- if h != syscall.Handle(0) {
- if err == nil {
- fs[i], err = winio.MakeOpenFile(h)
- }
- if err != nil {
- syscall.Close(h)
- }
- }
- }
- if err != nil {
- for _, f := range fs {
- if f != nil {
- f.Close()
- }
- }
- return nil, err
- }
- return fs, nil
-}
-
-// creates a VHD formatted with NTFS of size `sizeGB` at the given `vhdPath`.
-func CreateNTFSVHD(ctx context.Context, vhdPath string, sizeGB uint32) (err error) {
- if err := diskutil.CreateVhdx(vhdPath, sizeGB, 1); err != nil {
- return errors.Wrap(err, "failed to create VHD")
- }
-
- vhd, err := diskutil.OpenVirtualDisk(vhdPath, diskutil.VirtualDiskAccessNone, diskutil.OpenVirtualDiskFlagNone)
- if err != nil {
- return errors.Wrap(err, "failed to open VHD")
- }
- defer func() {
- err2 := windows.CloseHandle(windows.Handle(vhd))
- if err == nil {
- err = errors.Wrap(err2, "failed to close VHD")
- }
- }()
-
- if err := hcsFormatWritableLayerVhd(uintptr(vhd)); err != nil {
- return errors.Wrap(err, "failed to format VHD")
- }
-
- return nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/waithelper.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/waithelper.go
deleted file mode 100644
index f07f532c1..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/hcs/waithelper.go
+++ /dev/null
@@ -1,69 +0,0 @@
-package hcs
-
-import (
- "context"
- "time"
-
- "github.com/Microsoft/hcsshim/internal/log"
-)
-
-func processAsyncHcsResult(ctx context.Context, err error, resultJSON string, callbackNumber uintptr, expectedNotification hcsNotification, timeout *time.Duration) ([]ErrorEvent, error) {
- events := processHcsResult(ctx, resultJSON)
- if IsPending(err) {
- return nil, waitForNotification(ctx, callbackNumber, expectedNotification, timeout)
- }
-
- return events, err
-}
-
-func waitForNotification(ctx context.Context, callbackNumber uintptr, expectedNotification hcsNotification, timeout *time.Duration) error {
- callbackMapLock.RLock()
- if _, ok := callbackMap[callbackNumber]; !ok {
- callbackMapLock.RUnlock()
- log.G(ctx).WithField("callbackNumber", callbackNumber).Error("failed to waitForNotification: callbackNumber does not exist in callbackMap")
- return ErrHandleClose
- }
- channels := callbackMap[callbackNumber].channels
- callbackMapLock.RUnlock()
-
- expectedChannel := channels[expectedNotification]
- if expectedChannel == nil {
- log.G(ctx).WithField("type", expectedNotification).Error("unknown notification type in waitForNotification")
- return ErrInvalidNotificationType
- }
-
- var c <-chan time.Time
- if timeout != nil {
- timer := time.NewTimer(*timeout)
- c = timer.C
- defer timer.Stop()
- }
-
- select {
- case err, ok := <-expectedChannel:
- if !ok {
- return ErrHandleClose
- }
- return err
- case err, ok := <-channels[hcsNotificationSystemExited]:
- if !ok {
- return ErrHandleClose
- }
- // If the expected notification is hcsNotificationSystemExited which of the two selects
- // chosen is random. Return the raw error if hcsNotificationSystemExited is expected
- if channels[hcsNotificationSystemExited] == expectedChannel {
- return err
- }
- return ErrUnexpectedContainerExit
- case _, ok := <-channels[hcsNotificationServiceDisconnect]:
- if !ok {
- return ErrHandleClose
- }
- // hcsNotificationServiceDisconnect should never be an expected notification
- // it does not need the same handling as hcsNotificationSystemExited
- return ErrUnexpectedProcessAbort
- case <-c:
- return ErrTimeout
- }
- return nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcs/zsyscall_windows.go b/vendor/github.com/Microsoft/hcsshim/internal/hcs/zsyscall_windows.go
deleted file mode 100644
index 39396d272..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/hcs/zsyscall_windows.go
+++ /dev/null
@@ -1,54 +0,0 @@
-// Code generated mksyscall_windows.exe DO NOT EDIT
-
-package hcs
-
-import (
- "syscall"
- "unsafe"
-
- "golang.org/x/sys/windows"
-)
-
-var _ unsafe.Pointer
-
-// Do the interface allocations only once for common
-// Errno values.
-const (
- errnoERROR_IO_PENDING = 997
-)
-
-var (
- errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING)
-)
-
-// errnoErr returns common boxed Errno values, to prevent
-// allocations at runtime.
-func errnoErr(e syscall.Errno) error {
- switch e {
- case 0:
- return nil
- case errnoERROR_IO_PENDING:
- return errERROR_IO_PENDING
- }
- // TODO: add more here, after collecting data on the common
- // error values see on Windows. (perhaps when running
- // all.bat?)
- return e
-}
-
-var (
- modcomputestorage = windows.NewLazySystemDLL("computestorage.dll")
-
- procHcsFormatWritableLayerVhd = modcomputestorage.NewProc("HcsFormatWritableLayerVhd")
-)
-
-func hcsFormatWritableLayerVhd(handle uintptr) (hr error) {
- r0, _, _ := syscall.Syscall(procHcsFormatWritableLayerVhd.Addr(), 1, uintptr(handle), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hcserror/hcserror.go b/vendor/github.com/Microsoft/hcsshim/internal/hcserror/hcserror.go
deleted file mode 100644
index 921c2c855..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/hcserror/hcserror.go
+++ /dev/null
@@ -1,47 +0,0 @@
-package hcserror
-
-import (
- "fmt"
- "syscall"
-)
-
-const ERROR_GEN_FAILURE = syscall.Errno(31)
-
-type HcsError struct {
- title string
- rest string
- Err error
-}
-
-func (e *HcsError) Error() string {
- s := e.title
- if len(s) > 0 && s[len(s)-1] != ' ' {
- s += " "
- }
- s += fmt.Sprintf("failed in Win32: %s (0x%x)", e.Err, Win32FromError(e.Err))
- if e.rest != "" {
- if e.rest[0] != ' ' {
- s += " "
- }
- s += e.rest
- }
- return s
-}
-
-func New(err error, title, rest string) error {
- // Pass through DLL errors directly since they do not originate from HCS.
- if _, ok := err.(*syscall.DLLError); ok {
- return err
- }
- return &HcsError{title, rest, err}
-}
-
-func Win32FromError(err error) uint32 {
- if herr, ok := err.(*HcsError); ok {
- return Win32FromError(herr.Err)
- }
- if code, ok := err.(syscall.Errno); ok {
- return uint32(code)
- }
- return uint32(ERROR_GEN_FAILURE)
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hns/hns.go b/vendor/github.com/Microsoft/hcsshim/internal/hns/hns.go
deleted file mode 100644
index b2e475f53..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/hns/hns.go
+++ /dev/null
@@ -1,23 +0,0 @@
-package hns
-
-import "fmt"
-
-//go:generate go run ../../mksyscall_windows.go -output zsyscall_windows.go hns.go
-
-//sys _hnsCall(method string, path string, object string, response **uint16) (hr error) = vmcompute.HNSCall?
-
-type EndpointNotFoundError struct {
- EndpointName string
-}
-
-func (e EndpointNotFoundError) Error() string {
- return fmt.Sprintf("Endpoint %s not found", e.EndpointName)
-}
-
-type NetworkNotFoundError struct {
- NetworkName string
-}
-
-func (e NetworkNotFoundError) Error() string {
- return fmt.Sprintf("Network %s not found", e.NetworkName)
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsendpoint.go b/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsendpoint.go
deleted file mode 100644
index e0e1a4710..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsendpoint.go
+++ /dev/null
@@ -1,305 +0,0 @@
-package hns
-
-import (
- "encoding/json"
- "net"
- "strings"
-
- "github.com/sirupsen/logrus"
-)
-
-// HNSEndpoint represents a network endpoint in HNS
-type HNSEndpoint struct {
- Id string `json:"ID,omitempty"`
- Name string `json:",omitempty"`
- VirtualNetwork string `json:",omitempty"`
- VirtualNetworkName string `json:",omitempty"`
- Policies []json.RawMessage `json:",omitempty"`
- MacAddress string `json:",omitempty"`
- IPAddress net.IP `json:",omitempty"`
- DNSSuffix string `json:",omitempty"`
- DNSServerList string `json:",omitempty"`
- GatewayAddress string `json:",omitempty"`
- EnableInternalDNS bool `json:",omitempty"`
- DisableICC bool `json:",omitempty"`
- PrefixLength uint8 `json:",omitempty"`
- IsRemoteEndpoint bool `json:",omitempty"`
- EnableLowMetric bool `json:",omitempty"`
- Namespace *Namespace `json:",omitempty"`
- EncapOverhead uint16 `json:",omitempty"`
-}
-
-//SystemType represents the type of the system on which actions are done
-type SystemType string
-
-// SystemType const
-const (
- ContainerType SystemType = "Container"
- VirtualMachineType SystemType = "VirtualMachine"
- HostType SystemType = "Host"
-)
-
-// EndpointAttachDetachRequest is the structure used to send request to the container to modify the system
-// Supported resource types are Network and Request Types are Add/Remove
-type EndpointAttachDetachRequest struct {
- ContainerID string `json:"ContainerId,omitempty"`
- SystemType SystemType `json:"SystemType"`
- CompartmentID uint16 `json:"CompartmentId,omitempty"`
- VirtualNICName string `json:"VirtualNicName,omitempty"`
-}
-
-// EndpointResquestResponse is object to get the endpoint request response
-type EndpointResquestResponse struct {
- Success bool
- Error string
-}
-
-// HNSEndpointRequest makes a HNS call to modify/query a network endpoint
-func HNSEndpointRequest(method, path, request string) (*HNSEndpoint, error) {
- endpoint := &HNSEndpoint{}
- err := hnsCall(method, "/endpoints/"+path, request, &endpoint)
- if err != nil {
- return nil, err
- }
-
- return endpoint, nil
-}
-
-// HNSListEndpointRequest makes a HNS call to query the list of available endpoints
-func HNSListEndpointRequest() ([]HNSEndpoint, error) {
- var endpoint []HNSEndpoint
- err := hnsCall("GET", "/endpoints/", "", &endpoint)
- if err != nil {
- return nil, err
- }
-
- return endpoint, nil
-}
-
-// GetHNSEndpointByID get the Endpoint by ID
-func GetHNSEndpointByID(endpointID string) (*HNSEndpoint, error) {
- return HNSEndpointRequest("GET", endpointID, "")
-}
-
-// GetHNSEndpointByName gets the endpoint filtered by Name
-func GetHNSEndpointByName(endpointName string) (*HNSEndpoint, error) {
- hnsResponse, err := HNSListEndpointRequest()
- if err != nil {
- return nil, err
- }
- for _, hnsEndpoint := range hnsResponse {
- if hnsEndpoint.Name == endpointName {
- return &hnsEndpoint, nil
- }
- }
- return nil, EndpointNotFoundError{EndpointName: endpointName}
-}
-
-type endpointAttachInfo struct {
- SharedContainers json.RawMessage `json:",omitempty"`
-}
-
-func (endpoint *HNSEndpoint) IsAttached(vID string) (bool, error) {
- attachInfo := endpointAttachInfo{}
- err := hnsCall("GET", "/endpoints/"+endpoint.Id, "", &attachInfo)
-
- // Return false allows us to just return the err
- if err != nil {
- return false, err
- }
-
- if strings.Contains(strings.ToLower(string(attachInfo.SharedContainers)), strings.ToLower(vID)) {
- return true, nil
- }
-
- return false, nil
-
-}
-
-// Create Endpoint by sending EndpointRequest to HNS. TODO: Create a separate HNS interface to place all these methods
-func (endpoint *HNSEndpoint) Create() (*HNSEndpoint, error) {
- operation := "Create"
- title := "hcsshim::HNSEndpoint::" + operation
- logrus.Debugf(title+" id=%s", endpoint.Id)
-
- jsonString, err := json.Marshal(endpoint)
- if err != nil {
- return nil, err
- }
- return HNSEndpointRequest("POST", "", string(jsonString))
-}
-
-// Delete Endpoint by sending EndpointRequest to HNS
-func (endpoint *HNSEndpoint) Delete() (*HNSEndpoint, error) {
- operation := "Delete"
- title := "hcsshim::HNSEndpoint::" + operation
- logrus.Debugf(title+" id=%s", endpoint.Id)
-
- return HNSEndpointRequest("DELETE", endpoint.Id, "")
-}
-
-// Update Endpoint
-func (endpoint *HNSEndpoint) Update() (*HNSEndpoint, error) {
- operation := "Update"
- title := "hcsshim::HNSEndpoint::" + operation
- logrus.Debugf(title+" id=%s", endpoint.Id)
- jsonString, err := json.Marshal(endpoint)
- if err != nil {
- return nil, err
- }
- err = hnsCall("POST", "/endpoints/"+endpoint.Id, string(jsonString), &endpoint)
-
- return endpoint, err
-}
-
-// ApplyACLPolicy applies a set of ACL Policies on the Endpoint
-func (endpoint *HNSEndpoint) ApplyACLPolicy(policies ...*ACLPolicy) error {
- operation := "ApplyACLPolicy"
- title := "hcsshim::HNSEndpoint::" + operation
- logrus.Debugf(title+" id=%s", endpoint.Id)
-
- for _, policy := range policies {
- if policy == nil {
- continue
- }
- jsonString, err := json.Marshal(policy)
- if err != nil {
- return err
- }
- endpoint.Policies = append(endpoint.Policies, jsonString)
- }
-
- _, err := endpoint.Update()
- return err
-}
-
-// ApplyProxyPolicy applies a set of Proxy Policies on the Endpoint
-func (endpoint *HNSEndpoint) ApplyProxyPolicy(policies ...*ProxyPolicy) error {
- operation := "ApplyProxyPolicy"
- title := "hcsshim::HNSEndpoint::" + operation
- logrus.Debugf(title+" id=%s", endpoint.Id)
-
- for _, policy := range policies {
- if policy == nil {
- continue
- }
- jsonString, err := json.Marshal(policy)
- if err != nil {
- return err
- }
- endpoint.Policies = append(endpoint.Policies, jsonString)
- }
-
- _, err := endpoint.Update()
- return err
-}
-
-// ContainerAttach attaches an endpoint to container
-func (endpoint *HNSEndpoint) ContainerAttach(containerID string, compartmentID uint16) error {
- operation := "ContainerAttach"
- title := "hcsshim::HNSEndpoint::" + operation
- logrus.Debugf(title+" id=%s", endpoint.Id)
-
- requestMessage := &EndpointAttachDetachRequest{
- ContainerID: containerID,
- CompartmentID: compartmentID,
- SystemType: ContainerType,
- }
- response := &EndpointResquestResponse{}
- jsonString, err := json.Marshal(requestMessage)
- if err != nil {
- return err
- }
- return hnsCall("POST", "/endpoints/"+endpoint.Id+"/attach", string(jsonString), &response)
-}
-
-// ContainerDetach detaches an endpoint from container
-func (endpoint *HNSEndpoint) ContainerDetach(containerID string) error {
- operation := "ContainerDetach"
- title := "hcsshim::HNSEndpoint::" + operation
- logrus.Debugf(title+" id=%s", endpoint.Id)
-
- requestMessage := &EndpointAttachDetachRequest{
- ContainerID: containerID,
- SystemType: ContainerType,
- }
- response := &EndpointResquestResponse{}
-
- jsonString, err := json.Marshal(requestMessage)
- if err != nil {
- return err
- }
- return hnsCall("POST", "/endpoints/"+endpoint.Id+"/detach", string(jsonString), &response)
-}
-
-// HostAttach attaches a nic on the host
-func (endpoint *HNSEndpoint) HostAttach(compartmentID uint16) error {
- operation := "HostAttach"
- title := "hcsshim::HNSEndpoint::" + operation
- logrus.Debugf(title+" id=%s", endpoint.Id)
- requestMessage := &EndpointAttachDetachRequest{
- CompartmentID: compartmentID,
- SystemType: HostType,
- }
- response := &EndpointResquestResponse{}
-
- jsonString, err := json.Marshal(requestMessage)
- if err != nil {
- return err
- }
- return hnsCall("POST", "/endpoints/"+endpoint.Id+"/attach", string(jsonString), &response)
-
-}
-
-// HostDetach detaches a nic on the host
-func (endpoint *HNSEndpoint) HostDetach() error {
- operation := "HostDetach"
- title := "hcsshim::HNSEndpoint::" + operation
- logrus.Debugf(title+" id=%s", endpoint.Id)
- requestMessage := &EndpointAttachDetachRequest{
- SystemType: HostType,
- }
- response := &EndpointResquestResponse{}
-
- jsonString, err := json.Marshal(requestMessage)
- if err != nil {
- return err
- }
- return hnsCall("POST", "/endpoints/"+endpoint.Id+"/detach", string(jsonString), &response)
-}
-
-// VirtualMachineNICAttach attaches a endpoint to a virtual machine
-func (endpoint *HNSEndpoint) VirtualMachineNICAttach(virtualMachineNICName string) error {
- operation := "VirtualMachineNicAttach"
- title := "hcsshim::HNSEndpoint::" + operation
- logrus.Debugf(title+" id=%s", endpoint.Id)
- requestMessage := &EndpointAttachDetachRequest{
- VirtualNICName: virtualMachineNICName,
- SystemType: VirtualMachineType,
- }
- response := &EndpointResquestResponse{}
-
- jsonString, err := json.Marshal(requestMessage)
- if err != nil {
- return err
- }
- return hnsCall("POST", "/endpoints/"+endpoint.Id+"/attach", string(jsonString), &response)
-}
-
-// VirtualMachineNICDetach detaches a endpoint from a virtual machine
-func (endpoint *HNSEndpoint) VirtualMachineNICDetach() error {
- operation := "VirtualMachineNicDetach"
- title := "hcsshim::HNSEndpoint::" + operation
- logrus.Debugf(title+" id=%s", endpoint.Id)
-
- requestMessage := &EndpointAttachDetachRequest{
- SystemType: VirtualMachineType,
- }
- response := &EndpointResquestResponse{}
-
- jsonString, err := json.Marshal(requestMessage)
- if err != nil {
- return err
- }
- return hnsCall("POST", "/endpoints/"+endpoint.Id+"/detach", string(jsonString), &response)
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsfuncs.go b/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsfuncs.go
deleted file mode 100644
index 2df4a57f5..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsfuncs.go
+++ /dev/null
@@ -1,49 +0,0 @@
-package hns
-
-import (
- "encoding/json"
- "fmt"
-
- "github.com/Microsoft/hcsshim/internal/hcserror"
- "github.com/Microsoft/hcsshim/internal/interop"
- "github.com/sirupsen/logrus"
-)
-
-func hnsCallRawResponse(method, path, request string) (*hnsResponse, error) {
- var responseBuffer *uint16
- logrus.Debugf("[%s]=>[%s] Request : %s", method, path, request)
-
- err := _hnsCall(method, path, request, &responseBuffer)
- if err != nil {
- return nil, hcserror.New(err, "hnsCall ", "")
- }
- response := interop.ConvertAndFreeCoTaskMemString(responseBuffer)
-
- hnsresponse := &hnsResponse{}
- if err = json.Unmarshal([]byte(response), &hnsresponse); err != nil {
- return nil, err
- }
- return hnsresponse, nil
-}
-
-func hnsCall(method, path, request string, returnResponse interface{}) error {
- hnsresponse, err := hnsCallRawResponse(method, path, request)
- if err != nil {
- return fmt.Errorf("failed during hnsCallRawResponse: %v", err)
- }
- if !hnsresponse.Success {
- return fmt.Errorf("hns failed with error : %s", hnsresponse.Error)
- }
-
- if len(hnsresponse.Output) == 0 {
- return nil
- }
-
- logrus.Debugf("Network Response : %s", hnsresponse.Output)
- err = json.Unmarshal(hnsresponse.Output, returnResponse)
- if err != nil {
- return err
- }
-
- return nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsglobals.go b/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsglobals.go
deleted file mode 100644
index a8d8cc56a..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsglobals.go
+++ /dev/null
@@ -1,28 +0,0 @@
-package hns
-
-type HNSGlobals struct {
- Version HNSVersion `json:"Version"`
-}
-
-type HNSVersion struct {
- Major int `json:"Major"`
- Minor int `json:"Minor"`
-}
-
-var (
- HNSVersion1803 = HNSVersion{Major: 7, Minor: 2}
-)
-
-func GetHNSGlobals() (*HNSGlobals, error) {
- var version HNSVersion
- err := hnsCall("GET", "/globals/version", "", &version)
- if err != nil {
- return nil, err
- }
-
- globals := &HNSGlobals{
- Version: version,
- }
-
- return globals, nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsnetwork.go b/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsnetwork.go
deleted file mode 100644
index b7ae96fdd..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsnetwork.go
+++ /dev/null
@@ -1,147 +0,0 @@
-package hns
-
-import (
- "encoding/json"
- "errors"
- "github.com/sirupsen/logrus"
- "net"
-)
-
-// Subnet is assoicated with a network and represents a list
-// of subnets available to the network
-type Subnet struct {
- AddressPrefix string `json:",omitempty"`
- GatewayAddress string `json:",omitempty"`
- Policies []json.RawMessage `json:",omitempty"`
-}
-
-// MacPool is assoicated with a network and represents a list
-// of macaddresses available to the network
-type MacPool struct {
- StartMacAddress string `json:",omitempty"`
- EndMacAddress string `json:",omitempty"`
-}
-
-// HNSNetwork represents a network in HNS
-type HNSNetwork struct {
- Id string `json:"ID,omitempty"`
- Name string `json:",omitempty"`
- Type string `json:",omitempty"`
- NetworkAdapterName string `json:",omitempty"`
- SourceMac string `json:",omitempty"`
- Policies []json.RawMessage `json:",omitempty"`
- MacPools []MacPool `json:",omitempty"`
- Subnets []Subnet `json:",omitempty"`
- DNSSuffix string `json:",omitempty"`
- DNSServerList string `json:",omitempty"`
- DNSServerCompartment uint32 `json:",omitempty"`
- ManagementIP string `json:",omitempty"`
- AutomaticDNS bool `json:",omitempty"`
-}
-
-type hnsNetworkResponse struct {
- Success bool
- Error string
- Output HNSNetwork
-}
-
-type hnsResponse struct {
- Success bool
- Error string
- Output json.RawMessage
-}
-
-// HNSNetworkRequest makes a call into HNS to update/query a single network
-func HNSNetworkRequest(method, path, request string) (*HNSNetwork, error) {
- var network HNSNetwork
- err := hnsCall(method, "/networks/"+path, request, &network)
- if err != nil {
- return nil, err
- }
-
- return &network, nil
-}
-
-// HNSListNetworkRequest makes a HNS call to query the list of available networks
-func HNSListNetworkRequest(method, path, request string) ([]HNSNetwork, error) {
- var network []HNSNetwork
- err := hnsCall(method, "/networks/"+path, request, &network)
- if err != nil {
- return nil, err
- }
-
- return network, nil
-}
-
-// GetHNSNetworkByID
-func GetHNSNetworkByID(networkID string) (*HNSNetwork, error) {
- return HNSNetworkRequest("GET", networkID, "")
-}
-
-// GetHNSNetworkName filtered by Name
-func GetHNSNetworkByName(networkName string) (*HNSNetwork, error) {
- hsnnetworks, err := HNSListNetworkRequest("GET", "", "")
- if err != nil {
- return nil, err
- }
- for _, hnsnetwork := range hsnnetworks {
- if hnsnetwork.Name == networkName {
- return &hnsnetwork, nil
- }
- }
- return nil, NetworkNotFoundError{NetworkName: networkName}
-}
-
-// Create Network by sending NetworkRequest to HNS.
-func (network *HNSNetwork) Create() (*HNSNetwork, error) {
- operation := "Create"
- title := "hcsshim::HNSNetwork::" + operation
- logrus.Debugf(title+" id=%s", network.Id)
-
- for _, subnet := range network.Subnets {
- if (subnet.AddressPrefix != "") && (subnet.GatewayAddress == "") {
- return nil, errors.New("network create error, subnet has address prefix but no gateway specified")
- }
- }
-
- jsonString, err := json.Marshal(network)
- if err != nil {
- return nil, err
- }
- return HNSNetworkRequest("POST", "", string(jsonString))
-}
-
-// Delete Network by sending NetworkRequest to HNS
-func (network *HNSNetwork) Delete() (*HNSNetwork, error) {
- operation := "Delete"
- title := "hcsshim::HNSNetwork::" + operation
- logrus.Debugf(title+" id=%s", network.Id)
-
- return HNSNetworkRequest("DELETE", network.Id, "")
-}
-
-// Creates an endpoint on the Network.
-func (network *HNSNetwork) NewEndpoint(ipAddress net.IP, macAddress net.HardwareAddr) *HNSEndpoint {
- return &HNSEndpoint{
- VirtualNetwork: network.Id,
- IPAddress: ipAddress,
- MacAddress: string(macAddress),
- }
-}
-
-func (network *HNSNetwork) CreateEndpoint(endpoint *HNSEndpoint) (*HNSEndpoint, error) {
- operation := "CreateEndpoint"
- title := "hcsshim::HNSNetwork::" + operation
- logrus.Debugf(title+" id=%s, endpointId=%s", network.Id, endpoint.Id)
-
- endpoint.VirtualNetwork = network.Id
- return endpoint.Create()
-}
-
-func (network *HNSNetwork) CreateRemoteEndpoint(endpoint *HNSEndpoint) (*HNSEndpoint, error) {
- operation := "CreateRemoteEndpoint"
- title := "hcsshim::HNSNetwork::" + operation
- logrus.Debugf(title+" id=%s", network.Id)
- endpoint.IsRemoteEndpoint = true
- return network.CreateEndpoint(endpoint)
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hns/hnspolicy.go b/vendor/github.com/Microsoft/hcsshim/internal/hns/hnspolicy.go
deleted file mode 100644
index 6765aaead..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/hns/hnspolicy.go
+++ /dev/null
@@ -1,109 +0,0 @@
-package hns
-
-// Type of Request Support in ModifySystem
-type PolicyType string
-
-// RequestType const
-const (
- Nat PolicyType = "NAT"
- ACL PolicyType = "ACL"
- PA PolicyType = "PA"
- VLAN PolicyType = "VLAN"
- VSID PolicyType = "VSID"
- VNet PolicyType = "VNET"
- L2Driver PolicyType = "L2Driver"
- Isolation PolicyType = "Isolation"
- QOS PolicyType = "QOS"
- OutboundNat PolicyType = "OutBoundNAT"
- ExternalLoadBalancer PolicyType = "ELB"
- Route PolicyType = "ROUTE"
- Proxy PolicyType = "PROXY"
-)
-
-type NatPolicy struct {
- Type PolicyType `json:"Type"`
- Protocol string
- InternalPort uint16
- ExternalPort uint16
-}
-
-type QosPolicy struct {
- Type PolicyType `json:"Type"`
- MaximumOutgoingBandwidthInBytes uint64
-}
-
-type IsolationPolicy struct {
- Type PolicyType `json:"Type"`
- VLAN uint
- VSID uint
- InDefaultIsolation bool
-}
-
-type VlanPolicy struct {
- Type PolicyType `json:"Type"`
- VLAN uint
-}
-
-type VsidPolicy struct {
- Type PolicyType `json:"Type"`
- VSID uint
-}
-
-type PaPolicy struct {
- Type PolicyType `json:"Type"`
- PA string `json:"PA"`
-}
-
-type OutboundNatPolicy struct {
- Policy
- VIP string `json:"VIP,omitempty"`
- Exceptions []string `json:"ExceptionList,omitempty"`
- Destinations []string `json:",omitempty"`
-}
-
-type ProxyPolicy struct {
- Type PolicyType `json:"Type"`
- IP string `json:",omitempty"`
- Port string `json:",omitempty"`
- ExceptionList []string `json:",omitempty"`
- Destination string `json:",omitempty"`
- OutboundNat bool `json:",omitempty"`
-}
-
-type ActionType string
-type DirectionType string
-type RuleType string
-
-const (
- Allow ActionType = "Allow"
- Block ActionType = "Block"
-
- In DirectionType = "In"
- Out DirectionType = "Out"
-
- Host RuleType = "Host"
- Switch RuleType = "Switch"
-)
-
-type ACLPolicy struct {
- Type PolicyType `json:"Type"`
- Id string `json:"Id,omitempty"`
- Protocol uint16
- Protocols string `json:"Protocols,omitempty"`
- InternalPort uint16
- Action ActionType
- Direction DirectionType
- LocalAddresses string
- RemoteAddresses string
- LocalPorts string `json:"LocalPorts,omitempty"`
- LocalPort uint16
- RemotePorts string `json:"RemotePorts,omitempty"`
- RemotePort uint16
- RuleType RuleType `json:"RuleType,omitempty"`
- Priority uint16
- ServiceName string
-}
-
-type Policy struct {
- Type PolicyType `json:"Type"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hns/hnspolicylist.go b/vendor/github.com/Microsoft/hcsshim/internal/hns/hnspolicylist.go
deleted file mode 100644
index 31322a681..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/hns/hnspolicylist.go
+++ /dev/null
@@ -1,201 +0,0 @@
-package hns
-
-import (
- "encoding/json"
-
- "github.com/sirupsen/logrus"
-)
-
-// RoutePolicy is a structure defining schema for Route based Policy
-type RoutePolicy struct {
- Policy
- DestinationPrefix string `json:"DestinationPrefix,omitempty"`
- NextHop string `json:"NextHop,omitempty"`
- EncapEnabled bool `json:"NeedEncap,omitempty"`
-}
-
-// ELBPolicy is a structure defining schema for ELB LoadBalancing based Policy
-type ELBPolicy struct {
- LBPolicy
- SourceVIP string `json:"SourceVIP,omitempty"`
- VIPs []string `json:"VIPs,omitempty"`
- ILB bool `json:"ILB,omitempty"`
- DSR bool `json:"IsDSR,omitempty"`
-}
-
-// LBPolicy is a structure defining schema for LoadBalancing based Policy
-type LBPolicy struct {
- Policy
- Protocol uint16 `json:"Protocol,omitempty"`
- InternalPort uint16
- ExternalPort uint16
-}
-
-// PolicyList is a structure defining schema for Policy list request
-type PolicyList struct {
- ID string `json:"ID,omitempty"`
- EndpointReferences []string `json:"References,omitempty"`
- Policies []json.RawMessage `json:"Policies,omitempty"`
-}
-
-// HNSPolicyListRequest makes a call into HNS to update/query a single network
-func HNSPolicyListRequest(method, path, request string) (*PolicyList, error) {
- var policy PolicyList
- err := hnsCall(method, "/policylists/"+path, request, &policy)
- if err != nil {
- return nil, err
- }
-
- return &policy, nil
-}
-
-// HNSListPolicyListRequest gets all the policy list
-func HNSListPolicyListRequest() ([]PolicyList, error) {
- var plist []PolicyList
- err := hnsCall("GET", "/policylists/", "", &plist)
- if err != nil {
- return nil, err
- }
-
- return plist, nil
-}
-
-// PolicyListRequest makes a HNS call to modify/query a network policy list
-func PolicyListRequest(method, path, request string) (*PolicyList, error) {
- policylist := &PolicyList{}
- err := hnsCall(method, "/policylists/"+path, request, &policylist)
- if err != nil {
- return nil, err
- }
-
- return policylist, nil
-}
-
-// GetPolicyListByID get the policy list by ID
-func GetPolicyListByID(policyListID string) (*PolicyList, error) {
- return PolicyListRequest("GET", policyListID, "")
-}
-
-// Create PolicyList by sending PolicyListRequest to HNS.
-func (policylist *PolicyList) Create() (*PolicyList, error) {
- operation := "Create"
- title := "hcsshim::PolicyList::" + operation
- logrus.Debugf(title+" id=%s", policylist.ID)
- jsonString, err := json.Marshal(policylist)
- if err != nil {
- return nil, err
- }
- return PolicyListRequest("POST", "", string(jsonString))
-}
-
-// Delete deletes PolicyList
-func (policylist *PolicyList) Delete() (*PolicyList, error) {
- operation := "Delete"
- title := "hcsshim::PolicyList::" + operation
- logrus.Debugf(title+" id=%s", policylist.ID)
-
- return PolicyListRequest("DELETE", policylist.ID, "")
-}
-
-// AddEndpoint add an endpoint to a Policy List
-func (policylist *PolicyList) AddEndpoint(endpoint *HNSEndpoint) (*PolicyList, error) {
- operation := "AddEndpoint"
- title := "hcsshim::PolicyList::" + operation
- logrus.Debugf(title+" id=%s, endpointId:%s", policylist.ID, endpoint.Id)
-
- _, err := policylist.Delete()
- if err != nil {
- return nil, err
- }
-
- // Add Endpoint to the Existing List
- policylist.EndpointReferences = append(policylist.EndpointReferences, "/endpoints/"+endpoint.Id)
-
- return policylist.Create()
-}
-
-// RemoveEndpoint removes an endpoint from the Policy List
-func (policylist *PolicyList) RemoveEndpoint(endpoint *HNSEndpoint) (*PolicyList, error) {
- operation := "RemoveEndpoint"
- title := "hcsshim::PolicyList::" + operation
- logrus.Debugf(title+" id=%s, endpointId:%s", policylist.ID, endpoint.Id)
-
- _, err := policylist.Delete()
- if err != nil {
- return nil, err
- }
-
- elementToRemove := "/endpoints/" + endpoint.Id
-
- var references []string
-
- for _, endpointReference := range policylist.EndpointReferences {
- if endpointReference == elementToRemove {
- continue
- }
- references = append(references, endpointReference)
- }
- policylist.EndpointReferences = references
- return policylist.Create()
-}
-
-// AddLoadBalancer policy list for the specified endpoints
-func AddLoadBalancer(endpoints []HNSEndpoint, isILB bool, sourceVIP, vip string, protocol uint16, internalPort uint16, externalPort uint16) (*PolicyList, error) {
- operation := "AddLoadBalancer"
- title := "hcsshim::PolicyList::" + operation
- logrus.Debugf(title+" endpointId=%v, isILB=%v, sourceVIP=%s, vip=%s, protocol=%v, internalPort=%v, externalPort=%v", endpoints, isILB, sourceVIP, vip, protocol, internalPort, externalPort)
-
- policylist := &PolicyList{}
-
- elbPolicy := &ELBPolicy{
- SourceVIP: sourceVIP,
- ILB: isILB,
- }
-
- if len(vip) > 0 {
- elbPolicy.VIPs = []string{vip}
- }
- elbPolicy.Type = ExternalLoadBalancer
- elbPolicy.Protocol = protocol
- elbPolicy.InternalPort = internalPort
- elbPolicy.ExternalPort = externalPort
-
- for _, endpoint := range endpoints {
- policylist.EndpointReferences = append(policylist.EndpointReferences, "/endpoints/"+endpoint.Id)
- }
-
- jsonString, err := json.Marshal(elbPolicy)
- if err != nil {
- return nil, err
- }
- policylist.Policies = append(policylist.Policies, jsonString)
- return policylist.Create()
-}
-
-// AddRoute adds route policy list for the specified endpoints
-func AddRoute(endpoints []HNSEndpoint, destinationPrefix string, nextHop string, encapEnabled bool) (*PolicyList, error) {
- operation := "AddRoute"
- title := "hcsshim::PolicyList::" + operation
- logrus.Debugf(title+" destinationPrefix:%s", destinationPrefix)
-
- policylist := &PolicyList{}
-
- rPolicy := &RoutePolicy{
- DestinationPrefix: destinationPrefix,
- NextHop: nextHop,
- EncapEnabled: encapEnabled,
- }
- rPolicy.Type = Route
-
- for _, endpoint := range endpoints {
- policylist.EndpointReferences = append(policylist.EndpointReferences, "/endpoints/"+endpoint.Id)
- }
-
- jsonString, err := json.Marshal(rPolicy)
- if err != nil {
- return nil, err
- }
-
- policylist.Policies = append(policylist.Policies, jsonString)
- return policylist.Create()
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hns/hnssupport.go b/vendor/github.com/Microsoft/hcsshim/internal/hns/hnssupport.go
deleted file mode 100644
index d5efba7f2..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/hns/hnssupport.go
+++ /dev/null
@@ -1,49 +0,0 @@
-package hns
-
-import (
- "github.com/sirupsen/logrus"
-)
-
-type HNSSupportedFeatures struct {
- Acl HNSAclFeatures `json:"ACL"`
-}
-
-type HNSAclFeatures struct {
- AclAddressLists bool `json:"AclAddressLists"`
- AclNoHostRulePriority bool `json:"AclHostRulePriority"`
- AclPortRanges bool `json:"AclPortRanges"`
- AclRuleId bool `json:"AclRuleId"`
-}
-
-func GetHNSSupportedFeatures() HNSSupportedFeatures {
- var hnsFeatures HNSSupportedFeatures
-
- globals, err := GetHNSGlobals()
- if err != nil {
- // Expected on pre-1803 builds, all features will be false/unsupported
- logrus.Debugf("Unable to obtain HNS globals: %s", err)
- return hnsFeatures
- }
-
- hnsFeatures.Acl = HNSAclFeatures{
- AclAddressLists: isHNSFeatureSupported(globals.Version, HNSVersion1803),
- AclNoHostRulePriority: isHNSFeatureSupported(globals.Version, HNSVersion1803),
- AclPortRanges: isHNSFeatureSupported(globals.Version, HNSVersion1803),
- AclRuleId: isHNSFeatureSupported(globals.Version, HNSVersion1803),
- }
-
- return hnsFeatures
-}
-
-func isHNSFeatureSupported(currentVersion HNSVersion, minVersionSupported HNSVersion) bool {
- if currentVersion.Major < minVersionSupported.Major {
- return false
- }
- if currentVersion.Major > minVersionSupported.Major {
- return true
- }
- if currentVersion.Minor < minVersionSupported.Minor {
- return false
- }
- return true
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hns/namespace.go b/vendor/github.com/Microsoft/hcsshim/internal/hns/namespace.go
deleted file mode 100644
index 45e2281b0..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/hns/namespace.go
+++ /dev/null
@@ -1,110 +0,0 @@
-package hns
-
-import (
- "encoding/json"
- "fmt"
- "os"
- "path"
- "strings"
-)
-
-type namespaceRequest struct {
- IsDefault bool `json:",omitempty"`
-}
-
-type namespaceEndpointRequest struct {
- ID string `json:"Id"`
-}
-
-type NamespaceResource struct {
- Type string
- Data json.RawMessage
-}
-
-type namespaceResourceRequest struct {
- Type string
- Data interface{}
-}
-
-type Namespace struct {
- ID string
- IsDefault bool `json:",omitempty"`
- ResourceList []NamespaceResource `json:",omitempty"`
-}
-
-func issueNamespaceRequest(id *string, method, subpath string, request interface{}) (*Namespace, error) {
- var err error
- hnspath := "/namespaces/"
- if id != nil {
- hnspath = path.Join(hnspath, *id)
- }
- if subpath != "" {
- hnspath = path.Join(hnspath, subpath)
- }
- var reqJSON []byte
- if request != nil {
- if reqJSON, err = json.Marshal(request); err != nil {
- return nil, err
- }
- }
- var ns Namespace
- err = hnsCall(method, hnspath, string(reqJSON), &ns)
- if err != nil {
- if strings.Contains(err.Error(), "Element not found.") {
- return nil, os.ErrNotExist
- }
- return nil, fmt.Errorf("%s %s: %s", method, hnspath, err)
- }
- return &ns, err
-}
-
-func CreateNamespace() (string, error) {
- req := namespaceRequest{}
- ns, err := issueNamespaceRequest(nil, "POST", "", &req)
- if err != nil {
- return "", err
- }
- return ns.ID, nil
-}
-
-func RemoveNamespace(id string) error {
- _, err := issueNamespaceRequest(&id, "DELETE", "", nil)
- return err
-}
-
-func GetNamespaceEndpoints(id string) ([]string, error) {
- ns, err := issueNamespaceRequest(&id, "GET", "", nil)
- if err != nil {
- return nil, err
- }
- var endpoints []string
- for _, rsrc := range ns.ResourceList {
- if rsrc.Type == "Endpoint" {
- var endpoint namespaceEndpointRequest
- err = json.Unmarshal(rsrc.Data, &endpoint)
- if err != nil {
- return nil, fmt.Errorf("unmarshal endpoint: %s", err)
- }
- endpoints = append(endpoints, endpoint.ID)
- }
- }
- return endpoints, nil
-}
-
-func AddNamespaceEndpoint(id string, endpointID string) error {
- resource := namespaceResourceRequest{
- Type: "Endpoint",
- Data: namespaceEndpointRequest{endpointID},
- }
- _, err := issueNamespaceRequest(&id, "POST", "addresource", &resource)
- return err
-}
-
-func RemoveNamespaceEndpoint(id string, endpointID string) error {
- resource := namespaceResourceRequest{
- Type: "Endpoint",
- Data: namespaceEndpointRequest{endpointID},
- }
- _, err := issueNamespaceRequest(&id, "POST", "removeresource", &resource)
- return err
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/hns/zsyscall_windows.go b/vendor/github.com/Microsoft/hcsshim/internal/hns/zsyscall_windows.go
deleted file mode 100644
index 204633a48..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/hns/zsyscall_windows.go
+++ /dev/null
@@ -1,76 +0,0 @@
-// Code generated mksyscall_windows.exe DO NOT EDIT
-
-package hns
-
-import (
- "syscall"
- "unsafe"
-
- "golang.org/x/sys/windows"
-)
-
-var _ unsafe.Pointer
-
-// Do the interface allocations only once for common
-// Errno values.
-const (
- errnoERROR_IO_PENDING = 997
-)
-
-var (
- errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING)
-)
-
-// errnoErr returns common boxed Errno values, to prevent
-// allocations at runtime.
-func errnoErr(e syscall.Errno) error {
- switch e {
- case 0:
- return nil
- case errnoERROR_IO_PENDING:
- return errERROR_IO_PENDING
- }
- // TODO: add more here, after collecting data on the common
- // error values see on Windows. (perhaps when running
- // all.bat?)
- return e
-}
-
-var (
- modvmcompute = windows.NewLazySystemDLL("vmcompute.dll")
-
- procHNSCall = modvmcompute.NewProc("HNSCall")
-)
-
-func _hnsCall(method string, path string, object string, response **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(method)
- if hr != nil {
- return
- }
- var _p1 *uint16
- _p1, hr = syscall.UTF16PtrFromString(path)
- if hr != nil {
- return
- }
- var _p2 *uint16
- _p2, hr = syscall.UTF16PtrFromString(object)
- if hr != nil {
- return
- }
- return __hnsCall(_p0, _p1, _p2, response)
-}
-
-func __hnsCall(method *uint16, path *uint16, object *uint16, response **uint16) (hr error) {
- if hr = procHNSCall.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall6(procHNSCall.Addr(), 4, uintptr(unsafe.Pointer(method)), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(object)), uintptr(unsafe.Pointer(response)), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/interop/interop.go b/vendor/github.com/Microsoft/hcsshim/internal/interop/interop.go
deleted file mode 100644
index 922f7c679..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/interop/interop.go
+++ /dev/null
@@ -1,23 +0,0 @@
-package interop
-
-import (
- "syscall"
- "unsafe"
-)
-
-//go:generate go run ../../mksyscall_windows.go -output zsyscall_windows.go interop.go
-
-//sys coTaskMemFree(buffer unsafe.Pointer) = api_ms_win_core_com_l1_1_0.CoTaskMemFree
-
-func ConvertAndFreeCoTaskMemString(buffer *uint16) string {
- str := syscall.UTF16ToString((*[1 << 29]uint16)(unsafe.Pointer(buffer))[:])
- coTaskMemFree(unsafe.Pointer(buffer))
- return str
-}
-
-func Win32FromHresult(hr uintptr) syscall.Errno {
- if hr&0x1fff0000 == 0x00070000 {
- return syscall.Errno(hr & 0xffff)
- }
- return syscall.Errno(hr)
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/interop/zsyscall_windows.go b/vendor/github.com/Microsoft/hcsshim/internal/interop/zsyscall_windows.go
deleted file mode 100644
index 12b0c71c5..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/interop/zsyscall_windows.go
+++ /dev/null
@@ -1,48 +0,0 @@
-// Code generated mksyscall_windows.exe DO NOT EDIT
-
-package interop
-
-import (
- "syscall"
- "unsafe"
-
- "golang.org/x/sys/windows"
-)
-
-var _ unsafe.Pointer
-
-// Do the interface allocations only once for common
-// Errno values.
-const (
- errnoERROR_IO_PENDING = 997
-)
-
-var (
- errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING)
-)
-
-// errnoErr returns common boxed Errno values, to prevent
-// allocations at runtime.
-func errnoErr(e syscall.Errno) error {
- switch e {
- case 0:
- return nil
- case errnoERROR_IO_PENDING:
- return errERROR_IO_PENDING
- }
- // TODO: add more here, after collecting data on the common
- // error values see on Windows. (perhaps when running
- // all.bat?)
- return e
-}
-
-var (
- modapi_ms_win_core_com_l1_1_0 = windows.NewLazySystemDLL("api-ms-win-core-com-l1-1-0.dll")
-
- procCoTaskMemFree = modapi_ms_win_core_com_l1_1_0.NewProc("CoTaskMemFree")
-)
-
-func coTaskMemFree(buffer unsafe.Pointer) {
- syscall.Syscall(procCoTaskMemFree.Addr(), 1, uintptr(buffer), 0, 0)
- return
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/log/g.go b/vendor/github.com/Microsoft/hcsshim/internal/log/g.go
deleted file mode 100644
index ba6b1a4a5..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/log/g.go
+++ /dev/null
@@ -1,23 +0,0 @@
-package log
-
-import (
- "context"
-
- "github.com/sirupsen/logrus"
- "go.opencensus.io/trace"
-)
-
-// G returns a `logrus.Entry` with the `TraceID, SpanID` from `ctx` if `ctx`
-// contains an OpenCensus `trace.Span`.
-func G(ctx context.Context) *logrus.Entry {
- span := trace.FromContext(ctx)
- if span != nil {
- sctx := span.SpanContext()
- return logrus.WithFields(logrus.Fields{
- "traceID": sctx.TraceID.String(),
- "spanID": sctx.SpanID.String(),
- // "parentSpanID": TODO: JTERRY75 - Try to convince OC to export this?
- })
- }
- return logrus.NewEntry(logrus.StandardLogger())
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/logfields/fields.go b/vendor/github.com/Microsoft/hcsshim/internal/logfields/fields.go
deleted file mode 100644
index cf2c166d9..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/logfields/fields.go
+++ /dev/null
@@ -1,32 +0,0 @@
-package logfields
-
-const (
- // Identifiers
-
- ContainerID = "cid"
- UVMID = "uvm-id"
- ProcessID = "pid"
-
- // Common Misc
-
- // Timeout represents an operation timeout.
- Timeout = "timeout"
- JSON = "json"
-
- // Keys/values
-
- Field = "field"
- OCIAnnotation = "oci-annotation"
- Value = "value"
-
- // Golang type's
-
- ExpectedType = "expected-type"
- Bool = "bool"
- Uint32 = "uint32"
- Uint64 = "uint64"
-
- // runhcs
-
- VMShimOperation = "vmshim-op"
-)
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/longpath/longpath.go b/vendor/github.com/Microsoft/hcsshim/internal/longpath/longpath.go
deleted file mode 100644
index e5b8b85e0..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/longpath/longpath.go
+++ /dev/null
@@ -1,24 +0,0 @@
-package longpath
-
-import (
- "path/filepath"
- "strings"
-)
-
-// LongAbs makes a path absolute and returns it in NT long path form.
-func LongAbs(path string) (string, error) {
- if strings.HasPrefix(path, `\\?\`) || strings.HasPrefix(path, `\\.\`) {
- return path, nil
- }
- if !filepath.IsAbs(path) {
- absPath, err := filepath.Abs(path)
- if err != nil {
- return "", err
- }
- path = absPath
- }
- if strings.HasPrefix(path, `\\`) {
- return `\\?\UNC\` + path[2:], nil
- }
- return `\\?\` + path, nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/mergemaps/merge.go b/vendor/github.com/Microsoft/hcsshim/internal/mergemaps/merge.go
deleted file mode 100644
index 7e95efb30..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/mergemaps/merge.go
+++ /dev/null
@@ -1,52 +0,0 @@
-package mergemaps
-
-import "encoding/json"
-
-// Merge recursively merges map `fromMap` into map `ToMap`. Any pre-existing values
-// in ToMap are overwritten. Values in fromMap are added to ToMap.
-// From http://stackoverflow.com/questions/40491438/merging-two-json-strings-in-golang
-func Merge(fromMap, ToMap interface{}) interface{} {
- switch fromMap := fromMap.(type) {
- case map[string]interface{}:
- ToMap, ok := ToMap.(map[string]interface{})
- if !ok {
- return fromMap
- }
- for keyToMap, valueToMap := range ToMap {
- if valueFromMap, ok := fromMap[keyToMap]; ok {
- fromMap[keyToMap] = Merge(valueFromMap, valueToMap)
- } else {
- fromMap[keyToMap] = valueToMap
- }
- }
- case nil:
- // merge(nil, map[string]interface{...}) -> map[string]interface{...}
- ToMap, ok := ToMap.(map[string]interface{})
- if ok {
- return ToMap
- }
- }
- return fromMap
-}
-
-// MergeJSON merges the contents of a JSON string into an object representation,
-// returning a new object suitable for translating to JSON.
-func MergeJSON(object interface{}, additionalJSON []byte) (interface{}, error) {
- if len(additionalJSON) == 0 {
- return object, nil
- }
- objectJSON, err := json.Marshal(object)
- if err != nil {
- return nil, err
- }
- var objectMap, newMap map[string]interface{}
- err = json.Unmarshal(objectJSON, &objectMap)
- if err != nil {
- return nil, err
- }
- err = json.Unmarshal(additionalJSON, &newMap)
- if err != nil {
- return nil, err
- }
- return Merge(newMap, objectMap), nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/oc/exporter.go b/vendor/github.com/Microsoft/hcsshim/internal/oc/exporter.go
deleted file mode 100644
index f428bdaf7..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/oc/exporter.go
+++ /dev/null
@@ -1,43 +0,0 @@
-package oc
-
-import (
- "github.com/sirupsen/logrus"
- "go.opencensus.io/trace"
-)
-
-var _ = (trace.Exporter)(&LogrusExporter{})
-
-// LogrusExporter is an OpenCensus `trace.Exporter` that exports
-// `trace.SpanData` to logrus output.
-type LogrusExporter struct {
-}
-
-// ExportSpan exports `s` based on the the following rules:
-//
-// 1. All output will contain `s.Attributes`, `s.TraceID`, `s.SpanID`,
-// `s.ParentSpanID` for correlation
-//
-// 2. Any calls to .Annotate will not be supported.
-//
-// 3. The span itself will be written at `logrus.InfoLevel` unless
-// `s.Status.Code != 0` in which case it will be written at `logrus.ErrorLevel`
-// providing `s.Status.Message` as the error value.
-func (le *LogrusExporter) ExportSpan(s *trace.SpanData) {
- // Combine all span annotations with traceID, spanID, parentSpanID
- baseEntry := logrus.WithFields(logrus.Fields(s.Attributes))
- baseEntry.Data["traceID"] = s.TraceID.String()
- baseEntry.Data["spanID"] = s.SpanID.String()
- baseEntry.Data["parentSpanID"] = s.ParentSpanID.String()
- baseEntry.Data["startTime"] = s.StartTime
- baseEntry.Data["endTime"] = s.EndTime
- baseEntry.Data["duration"] = s.EndTime.Sub(s.StartTime).String()
- baseEntry.Data["name"] = s.Name
- baseEntry.Time = s.StartTime
-
- level := logrus.InfoLevel
- if s.Status.Code != 0 {
- level = logrus.ErrorLevel
- baseEntry.Data[logrus.ErrorKey] = s.Status.Message
- }
- baseEntry.Log(level, "Span")
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/oc/span.go b/vendor/github.com/Microsoft/hcsshim/internal/oc/span.go
deleted file mode 100644
index fee4765cb..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/oc/span.go
+++ /dev/null
@@ -1,17 +0,0 @@
-package oc
-
-import (
- "go.opencensus.io/trace"
-)
-
-// SetSpanStatus sets `span.SetStatus` to the proper status depending on `err`. If
-// `err` is `nil` assumes `trace.StatusCodeOk`.
-func SetSpanStatus(span *trace.Span, err error) {
- status := trace.Status{}
- if err != nil {
- // TODO: JTERRY75 - Handle errors in a non-generic way
- status.Code = trace.StatusCodeUnknown
- status.Message = err.Error()
- }
- span.SetStatus(status)
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/regstate/regstate.go b/vendor/github.com/Microsoft/hcsshim/internal/regstate/regstate.go
deleted file mode 100644
index 6c4a64156..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/regstate/regstate.go
+++ /dev/null
@@ -1,287 +0,0 @@
-package regstate
-
-import (
- "encoding/json"
- "fmt"
- "net/url"
- "os"
- "path/filepath"
- "reflect"
- "syscall"
-
- "golang.org/x/sys/windows/registry"
-)
-
-//go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go regstate.go
-
-//sys regCreateKeyEx(key syscall.Handle, subkey *uint16, reserved uint32, class *uint16, options uint32, desired uint32, sa *syscall.SecurityAttributes, result *syscall.Handle, disposition *uint32) (regerrno error) = advapi32.RegCreateKeyExW
-
-const (
- _REG_OPTION_VOLATILE = 1
-
- _REG_CREATED_NEW_KEY = 1
- _REG_OPENED_EXISTING_KEY = 2
-)
-
-type Key struct {
- registry.Key
- Name string
-}
-
-var localMachine = &Key{registry.LOCAL_MACHINE, "HKEY_LOCAL_MACHINE"}
-var localUser = &Key{registry.CURRENT_USER, "HKEY_CURRENT_USER"}
-
-var rootPath = `SOFTWARE\Microsoft\runhcs`
-
-type NotFoundError struct {
- Id string
-}
-
-func (err *NotFoundError) Error() string {
- return fmt.Sprintf("ID '%s' was not found", err.Id)
-}
-
-func IsNotFoundError(err error) bool {
- _, ok := err.(*NotFoundError)
- return ok
-}
-
-type NoStateError struct {
- ID string
- Key string
-}
-
-func (err *NoStateError) Error() string {
- return fmt.Sprintf("state '%s' is not present for ID '%s'", err.Key, err.ID)
-}
-
-func createVolatileKey(k *Key, path string, access uint32) (newk *Key, openedExisting bool, err error) {
- var (
- h syscall.Handle
- d uint32
- )
- fullpath := filepath.Join(k.Name, path)
- err = regCreateKeyEx(syscall.Handle(k.Key), syscall.StringToUTF16Ptr(path), 0, nil, _REG_OPTION_VOLATILE, access, nil, &h, &d)
- if err != nil {
- return nil, false, &os.PathError{Op: "RegCreateKeyEx", Path: fullpath, Err: err}
- }
- return &Key{registry.Key(h), fullpath}, d == _REG_OPENED_EXISTING_KEY, nil
-}
-
-func hive(perUser bool) *Key {
- r := localMachine
- if perUser {
- r = localUser
- }
- return r
-}
-
-func Open(root string, perUser bool) (*Key, error) {
- k, _, err := createVolatileKey(hive(perUser), rootPath, registry.ALL_ACCESS)
- if err != nil {
- return nil, err
- }
- defer k.Close()
-
- k2, _, err := createVolatileKey(k, url.PathEscape(root), registry.ALL_ACCESS)
- if err != nil {
- return nil, err
- }
- return k2, nil
-}
-
-func RemoveAll(root string, perUser bool) error {
- k, err := hive(perUser).open(rootPath)
- if err != nil {
- return err
- }
- defer k.Close()
- r, err := k.open(url.PathEscape(root))
- if err != nil {
- return err
- }
- defer r.Close()
- ids, err := r.Enumerate()
- if err != nil {
- return err
- }
- for _, id := range ids {
- err = r.Remove(id)
- if err != nil {
- return err
- }
- }
- r.Close()
- return k.Remove(root)
-}
-
-func (k *Key) Close() error {
- err := k.Key.Close()
- k.Key = 0
- return err
-}
-
-func (k *Key) Enumerate() ([]string, error) {
- escapedIDs, err := k.ReadSubKeyNames(0)
- if err != nil {
- return nil, err
- }
- var ids []string
- for _, e := range escapedIDs {
- id, err := url.PathUnescape(e)
- if err == nil {
- ids = append(ids, id)
- }
- }
- return ids, nil
-}
-
-func (k *Key) open(name string) (*Key, error) {
- fullpath := filepath.Join(k.Name, name)
- nk, err := registry.OpenKey(k.Key, name, registry.ALL_ACCESS)
- if err != nil {
- return nil, &os.PathError{Op: "RegOpenKey", Path: fullpath, Err: err}
- }
- return &Key{nk, fullpath}, nil
-}
-
-func (k *Key) openid(id string) (*Key, error) {
- escaped := url.PathEscape(id)
- fullpath := filepath.Join(k.Name, escaped)
- nk, err := k.open(escaped)
- if perr, ok := err.(*os.PathError); ok && perr.Err == syscall.ERROR_FILE_NOT_FOUND {
- return nil, &NotFoundError{id}
- }
- if err != nil {
- return nil, &os.PathError{Op: "RegOpenKey", Path: fullpath, Err: err}
- }
- return nk, nil
-}
-
-func (k *Key) Remove(id string) error {
- escaped := url.PathEscape(id)
- err := registry.DeleteKey(k.Key, escaped)
- if err != nil {
- if err == syscall.ERROR_FILE_NOT_FOUND {
- return &NotFoundError{id}
- }
- return &os.PathError{Op: "RegDeleteKey", Path: filepath.Join(k.Name, escaped), Err: err}
- }
- return nil
-}
-
-func (k *Key) set(id string, create bool, key string, state interface{}) error {
- var sk *Key
- var err error
- if create {
- var existing bool
- eid := url.PathEscape(id)
- sk, existing, err = createVolatileKey(k, eid, registry.ALL_ACCESS)
- if err != nil {
- return err
- }
- defer sk.Close()
- if existing {
- sk.Close()
- return fmt.Errorf("container %s already exists", id)
- }
- } else {
- sk, err = k.openid(id)
- if err != nil {
- return err
- }
- defer sk.Close()
- }
- switch reflect.TypeOf(state).Kind() {
- case reflect.Bool:
- v := uint32(0)
- if state.(bool) {
- v = 1
- }
- err = sk.SetDWordValue(key, v)
- case reflect.Int:
- err = sk.SetQWordValue(key, uint64(state.(int)))
- case reflect.String:
- err = sk.SetStringValue(key, state.(string))
- default:
- var js []byte
- js, err = json.Marshal(state)
- if err != nil {
- return err
- }
- err = sk.SetBinaryValue(key, js)
- }
- if err != nil {
- if err == syscall.ERROR_FILE_NOT_FOUND {
- return &NoStateError{id, key}
- }
- return &os.PathError{Op: "RegSetValueEx", Path: sk.Name + ":" + key, Err: err}
- }
- return nil
-}
-
-func (k *Key) Create(id, key string, state interface{}) error {
- return k.set(id, true, key, state)
-}
-
-func (k *Key) Set(id, key string, state interface{}) error {
- return k.set(id, false, key, state)
-}
-
-func (k *Key) Clear(id, key string) error {
- sk, err := k.openid(id)
- if err != nil {
- return err
- }
- defer sk.Close()
- err = sk.DeleteValue(key)
- if err != nil {
- if err == syscall.ERROR_FILE_NOT_FOUND {
- return &NoStateError{id, key}
- }
- return &os.PathError{Op: "RegDeleteValue", Path: sk.Name + ":" + key, Err: err}
- }
- return nil
-}
-
-func (k *Key) Get(id, key string, state interface{}) error {
- sk, err := k.openid(id)
- if err != nil {
- return err
- }
- defer sk.Close()
-
- var js []byte
- switch reflect.TypeOf(state).Elem().Kind() {
- case reflect.Bool:
- var v uint64
- v, _, err = sk.GetIntegerValue(key)
- if err == nil {
- *state.(*bool) = v != 0
- }
- case reflect.Int:
- var v uint64
- v, _, err = sk.GetIntegerValue(key)
- if err == nil {
- *state.(*int) = int(v)
- }
- case reflect.String:
- var v string
- v, _, err = sk.GetStringValue(key)
- if err == nil {
- *state.(*string) = string(v)
- }
- default:
- js, _, err = sk.GetBinaryValue(key)
- }
- if err != nil {
- if err == syscall.ERROR_FILE_NOT_FOUND {
- return &NoStateError{id, key}
- }
- return &os.PathError{Op: "RegQueryValueEx", Path: sk.Name + ":" + key, Err: err}
- }
- if js != nil {
- err = json.Unmarshal(js, state)
- }
- return err
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/regstate/zsyscall_windows.go b/vendor/github.com/Microsoft/hcsshim/internal/regstate/zsyscall_windows.go
deleted file mode 100644
index 4e349ad49..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/regstate/zsyscall_windows.go
+++ /dev/null
@@ -1,51 +0,0 @@
-// Code generated by 'go generate'; DO NOT EDIT.
-
-package regstate
-
-import (
- "syscall"
- "unsafe"
-
- "golang.org/x/sys/windows"
-)
-
-var _ unsafe.Pointer
-
-// Do the interface allocations only once for common
-// Errno values.
-const (
- errnoERROR_IO_PENDING = 997
-)
-
-var (
- errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING)
-)
-
-// errnoErr returns common boxed Errno values, to prevent
-// allocations at runtime.
-func errnoErr(e syscall.Errno) error {
- switch e {
- case 0:
- return nil
- case errnoERROR_IO_PENDING:
- return errERROR_IO_PENDING
- }
- // TODO: add more here, after collecting data on the common
- // error values see on Windows. (perhaps when running
- // all.bat?)
- return e
-}
-
-var (
- modadvapi32 = windows.NewLazySystemDLL("advapi32.dll")
-
- procRegCreateKeyExW = modadvapi32.NewProc("RegCreateKeyExW")
-)
-
-func regCreateKeyEx(key syscall.Handle, subkey *uint16, reserved uint32, class *uint16, options uint32, desired uint32, sa *syscall.SecurityAttributes, result *syscall.Handle, disposition *uint32) (regerrno error) {
- r0, _, _ := syscall.Syscall9(procRegCreateKeyExW.Addr(), 9, uintptr(key), uintptr(unsafe.Pointer(subkey)), uintptr(reserved), uintptr(unsafe.Pointer(class)), uintptr(options), uintptr(desired), uintptr(unsafe.Pointer(sa)), uintptr(unsafe.Pointer(result)), uintptr(unsafe.Pointer(disposition)))
- if r0 != 0 {
- regerrno = syscall.Errno(r0)
- }
- return
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/runhcs/container.go b/vendor/github.com/Microsoft/hcsshim/internal/runhcs/container.go
deleted file mode 100644
index 2f39e5845..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/runhcs/container.go
+++ /dev/null
@@ -1,71 +0,0 @@
-package runhcs
-
-import (
- "bytes"
- "errors"
- "fmt"
- "io"
- "io/ioutil"
- "os"
- "syscall"
- "time"
-
- "github.com/Microsoft/go-winio/pkg/guid"
-)
-
-// ContainerState represents the platform agnostic pieces relating to a
-// running container's status and state
-type ContainerState struct {
- // Version is the OCI version for the container
- Version string `json:"ociVersion"`
- // ID is the container ID
- ID string `json:"id"`
- // InitProcessPid is the init process id in the parent namespace
- InitProcessPid int `json:"pid"`
- // Status is the current status of the container, running, paused, ...
- Status string `json:"status"`
- // Bundle is the path on the filesystem to the bundle
- Bundle string `json:"bundle"`
- // Rootfs is a path to a directory containing the container's root filesystem.
- Rootfs string `json:"rootfs"`
- // Created is the unix timestamp for the creation time of the container in UTC
- Created time.Time `json:"created"`
- // Annotations is the user defined annotations added to the config.
- Annotations map[string]string `json:"annotations,omitempty"`
- // The owner of the state directory (the owner of the container).
- Owner string `json:"owner"`
-}
-
-// GetErrorFromPipe returns reads from `pipe` and verifies if the operation
-// returned success or error. If error converts that to an error and returns. If
-// `p` is not nill will issue a `Kill` and `Wait` for exit.
-func GetErrorFromPipe(pipe io.Reader, p *os.Process) error {
- serr, err := ioutil.ReadAll(pipe)
- if err != nil {
- return err
- }
-
- if bytes.Equal(serr, ShimSuccess) {
- return nil
- }
-
- extra := ""
- if p != nil {
- p.Kill()
- state, err := p.Wait()
- if err != nil {
- panic(err)
- }
- extra = fmt.Sprintf(", exit code %d", state.Sys().(syscall.WaitStatus).ExitCode)
- }
- if len(serr) == 0 {
- return fmt.Errorf("unknown shim failure%s", extra)
- }
-
- return errors.New(string(serr))
-}
-
-// VMPipePath returns the named pipe path for the vm shim.
-func VMPipePath(hostUniqueID guid.GUID) string {
- return SafePipePath("runhcs-vm-" + hostUniqueID.String())
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/runhcs/util.go b/vendor/github.com/Microsoft/hcsshim/internal/runhcs/util.go
deleted file mode 100644
index dcbb1903b..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/runhcs/util.go
+++ /dev/null
@@ -1,16 +0,0 @@
-package runhcs
-
-import "net/url"
-
-const (
- SafePipePrefix = `\\.\pipe\ProtectedPrefix\Administrators\`
-)
-
-// ShimSuccess is the byte stream returned on a successful operation.
-var ShimSuccess = []byte{0, 'O', 'K', 0}
-
-func SafePipePath(name string) string {
- // Use a pipe in the Administrators protected prefixed to prevent malicious
- // squatting.
- return SafePipePrefix + url.PathEscape(name)
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/runhcs/vm.go b/vendor/github.com/Microsoft/hcsshim/internal/runhcs/vm.go
deleted file mode 100644
index 2c8957b88..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/runhcs/vm.go
+++ /dev/null
@@ -1,43 +0,0 @@
-package runhcs
-
-import (
- "encoding/json"
-
- "github.com/Microsoft/go-winio"
-)
-
-// VMRequestOp is an operation that can be issued to a VM shim.
-type VMRequestOp string
-
-const (
- // OpCreateContainer is a create container request.
- OpCreateContainer VMRequestOp = "create"
- // OpSyncNamespace is a `cni.NamespaceTypeGuest` sync request with the UVM.
- OpSyncNamespace VMRequestOp = "sync"
- // OpUnmountContainer is a container unmount request.
- OpUnmountContainer VMRequestOp = "unmount"
- // OpUnmountContainerDiskOnly is a container unmount disk request.
- OpUnmountContainerDiskOnly VMRequestOp = "unmount-disk"
-)
-
-// VMRequest is an operation request that is issued to a VM shim.
-type VMRequest struct {
- ID string
- Op VMRequestOp
-}
-
-// IssueVMRequest issues a request to a shim at the given pipe.
-func IssueVMRequest(pipepath string, req *VMRequest) error {
- pipe, err := winio.DialPipe(pipepath, nil)
- if err != nil {
- return err
- }
- defer pipe.Close()
- if err := json.NewEncoder(pipe).Encode(req); err != nil {
- return err
- }
- if err := GetErrorFromPipe(pipe, nil); err != nil {
- return err
- }
- return nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/safefile/safeopen.go b/vendor/github.com/Microsoft/hcsshim/internal/safefile/safeopen.go
deleted file mode 100644
index f31edfaf8..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/safefile/safeopen.go
+++ /dev/null
@@ -1,431 +0,0 @@
-package safefile
-
-import (
- "errors"
- "io"
- "os"
- "path/filepath"
- "strings"
- "syscall"
- "unicode/utf16"
- "unsafe"
-
- "github.com/Microsoft/hcsshim/internal/longpath"
-
- winio "github.com/Microsoft/go-winio"
-)
-
-//go:generate go run $GOROOT\src\syscall\mksyscall_windows.go -output zsyscall_windows.go safeopen.go
-
-//sys ntCreateFile(handle *uintptr, accessMask uint32, oa *objectAttributes, iosb *ioStatusBlock, allocationSize *uint64, fileAttributes uint32, shareAccess uint32, createDisposition uint32, createOptions uint32, eaBuffer *byte, eaLength uint32) (status uint32) = ntdll.NtCreateFile
-//sys ntSetInformationFile(handle uintptr, iosb *ioStatusBlock, information uintptr, length uint32, class uint32) (status uint32) = ntdll.NtSetInformationFile
-//sys rtlNtStatusToDosError(status uint32) (winerr error) = ntdll.RtlNtStatusToDosErrorNoTeb
-//sys localAlloc(flags uint32, size int) (ptr uintptr) = kernel32.LocalAlloc
-//sys localFree(ptr uintptr) = kernel32.LocalFree
-
-type ioStatusBlock struct {
- Status, Information uintptr
-}
-
-type objectAttributes struct {
- Length uintptr
- RootDirectory uintptr
- ObjectName uintptr
- Attributes uintptr
- SecurityDescriptor uintptr
- SecurityQoS uintptr
-}
-
-type unicodeString struct {
- Length uint16
- MaximumLength uint16
- Buffer uintptr
-}
-
-type fileLinkInformation struct {
- ReplaceIfExists bool
- RootDirectory uintptr
- FileNameLength uint32
- FileName [1]uint16
-}
-
-type fileDispositionInformationEx struct {
- Flags uintptr
-}
-
-const (
- _FileLinkInformation = 11
- _FileDispositionInformationEx = 64
-
- FILE_READ_ATTRIBUTES = 0x0080
- FILE_WRITE_ATTRIBUTES = 0x0100
- DELETE = 0x10000
-
- FILE_OPEN = 1
- FILE_CREATE = 2
-
- FILE_DIRECTORY_FILE = 0x00000001
- FILE_SYNCHRONOUS_IO_NONALERT = 0x00000020
- FILE_DELETE_ON_CLOSE = 0x00001000
- FILE_OPEN_FOR_BACKUP_INTENT = 0x00004000
- FILE_OPEN_REPARSE_POINT = 0x00200000
-
- FILE_DISPOSITION_DELETE = 0x00000001
-
- _OBJ_DONT_REPARSE = 0x1000
-
- _STATUS_REPARSE_POINT_ENCOUNTERED = 0xC000050B
-)
-
-func OpenRoot(path string) (*os.File, error) {
- longpath, err := longpath.LongAbs(path)
- if err != nil {
- return nil, err
- }
- return winio.OpenForBackup(longpath, syscall.GENERIC_READ, syscall.FILE_SHARE_READ|syscall.FILE_SHARE_WRITE|syscall.FILE_SHARE_DELETE, syscall.OPEN_EXISTING)
-}
-
-func ntRelativePath(path string) ([]uint16, error) {
- path = filepath.Clean(path)
- if strings.Contains(path, ":") {
- // Since alternate data streams must follow the file they
- // are attached to, finding one here (out of order) is invalid.
- return nil, errors.New("path contains invalid character `:`")
- }
- fspath := filepath.FromSlash(path)
- if len(fspath) > 0 && fspath[0] == '\\' {
- return nil, errors.New("expected relative path")
- }
-
- path16 := utf16.Encode(([]rune)(fspath))
- if len(path16) > 32767 {
- return nil, syscall.ENAMETOOLONG
- }
-
- return path16, nil
-}
-
-// openRelativeInternal opens a relative path from the given root, failing if
-// any of the intermediate path components are reparse points.
-func openRelativeInternal(path string, root *os.File, accessMask uint32, shareFlags uint32, createDisposition uint32, flags uint32) (*os.File, error) {
- var (
- h uintptr
- iosb ioStatusBlock
- oa objectAttributes
- )
-
- path16, err := ntRelativePath(path)
- if err != nil {
- return nil, err
- }
-
- if root == nil || root.Fd() == 0 {
- return nil, errors.New("missing root directory")
- }
-
- upathBuffer := localAlloc(0, int(unsafe.Sizeof(unicodeString{}))+len(path16)*2)
- defer localFree(upathBuffer)
-
- upath := (*unicodeString)(unsafe.Pointer(upathBuffer))
- upath.Length = uint16(len(path16) * 2)
- upath.MaximumLength = upath.Length
- upath.Buffer = upathBuffer + unsafe.Sizeof(*upath)
- copy((*[32768]uint16)(unsafe.Pointer(upath.Buffer))[:], path16)
-
- oa.Length = unsafe.Sizeof(oa)
- oa.ObjectName = upathBuffer
- oa.RootDirectory = uintptr(root.Fd())
- oa.Attributes = _OBJ_DONT_REPARSE
- status := ntCreateFile(
- &h,
- accessMask|syscall.SYNCHRONIZE,
- &oa,
- &iosb,
- nil,
- 0,
- shareFlags,
- createDisposition,
- FILE_OPEN_FOR_BACKUP_INTENT|FILE_SYNCHRONOUS_IO_NONALERT|flags,
- nil,
- 0,
- )
- if status != 0 {
- return nil, rtlNtStatusToDosError(status)
- }
-
- fullPath, err := longpath.LongAbs(filepath.Join(root.Name(), path))
- if err != nil {
- syscall.Close(syscall.Handle(h))
- return nil, err
- }
-
- return os.NewFile(h, fullPath), nil
-}
-
-// OpenRelative opens a relative path from the given root, failing if
-// any of the intermediate path components are reparse points.
-func OpenRelative(path string, root *os.File, accessMask uint32, shareFlags uint32, createDisposition uint32, flags uint32) (*os.File, error) {
- f, err := openRelativeInternal(path, root, accessMask, shareFlags, createDisposition, flags)
- if err != nil {
- err = &os.PathError{Op: "open", Path: filepath.Join(root.Name(), path), Err: err}
- }
- return f, err
-}
-
-// LinkRelative creates a hard link from oldname to newname (relative to oldroot
-// and newroot), failing if any of the intermediate path components are reparse
-// points.
-func LinkRelative(oldname string, oldroot *os.File, newname string, newroot *os.File) error {
- // Open the old file.
- oldf, err := openRelativeInternal(
- oldname,
- oldroot,
- syscall.FILE_WRITE_ATTRIBUTES,
- syscall.FILE_SHARE_READ|syscall.FILE_SHARE_WRITE|syscall.FILE_SHARE_DELETE,
- FILE_OPEN,
- 0,
- )
- if err != nil {
- return &os.LinkError{Op: "link", Old: filepath.Join(oldroot.Name(), oldname), New: filepath.Join(newroot.Name(), newname), Err: err}
- }
- defer oldf.Close()
-
- // Open the parent of the new file.
- var parent *os.File
- parentPath := filepath.Dir(newname)
- if parentPath != "." {
- parent, err = openRelativeInternal(
- parentPath,
- newroot,
- syscall.GENERIC_READ,
- syscall.FILE_SHARE_READ|syscall.FILE_SHARE_WRITE|syscall.FILE_SHARE_DELETE,
- FILE_OPEN,
- FILE_DIRECTORY_FILE)
- if err != nil {
- return &os.LinkError{Op: "link", Old: oldf.Name(), New: filepath.Join(newroot.Name(), newname), Err: err}
- }
- defer parent.Close()
-
- fi, err := winio.GetFileBasicInfo(parent)
- if err != nil {
- return err
- }
- if (fi.FileAttributes & syscall.FILE_ATTRIBUTE_REPARSE_POINT) != 0 {
- return &os.LinkError{Op: "link", Old: oldf.Name(), New: filepath.Join(newroot.Name(), newname), Err: rtlNtStatusToDosError(_STATUS_REPARSE_POINT_ENCOUNTERED)}
- }
-
- } else {
- parent = newroot
- }
-
- // Issue an NT call to create the link. This will be safe because NT will
- // not open any more directories to create the link, so it cannot walk any
- // more reparse points.
- newbase := filepath.Base(newname)
- newbase16, err := ntRelativePath(newbase)
- if err != nil {
- return err
- }
-
- size := int(unsafe.Offsetof(fileLinkInformation{}.FileName)) + len(newbase16)*2
- linkinfoBuffer := localAlloc(0, size)
- defer localFree(linkinfoBuffer)
- linkinfo := (*fileLinkInformation)(unsafe.Pointer(linkinfoBuffer))
- linkinfo.RootDirectory = parent.Fd()
- linkinfo.FileNameLength = uint32(len(newbase16) * 2)
- copy((*[32768]uint16)(unsafe.Pointer(&linkinfo.FileName[0]))[:], newbase16)
-
- var iosb ioStatusBlock
- status := ntSetInformationFile(
- oldf.Fd(),
- &iosb,
- linkinfoBuffer,
- uint32(size),
- _FileLinkInformation,
- )
- if status != 0 {
- return &os.LinkError{Op: "link", Old: oldf.Name(), New: filepath.Join(parent.Name(), newbase), Err: rtlNtStatusToDosError(status)}
- }
-
- return nil
-}
-
-// deleteOnClose marks a file to be deleted when the handle is closed.
-func deleteOnClose(f *os.File) error {
- disposition := fileDispositionInformationEx{Flags: FILE_DISPOSITION_DELETE}
- var iosb ioStatusBlock
- status := ntSetInformationFile(
- f.Fd(),
- &iosb,
- uintptr(unsafe.Pointer(&disposition)),
- uint32(unsafe.Sizeof(disposition)),
- _FileDispositionInformationEx,
- )
- if status != 0 {
- return rtlNtStatusToDosError(status)
- }
- return nil
-}
-
-// clearReadOnly clears the readonly attribute on a file.
-func clearReadOnly(f *os.File) error {
- bi, err := winio.GetFileBasicInfo(f)
- if err != nil {
- return err
- }
- if bi.FileAttributes&syscall.FILE_ATTRIBUTE_READONLY == 0 {
- return nil
- }
- sbi := winio.FileBasicInfo{
- FileAttributes: bi.FileAttributes &^ syscall.FILE_ATTRIBUTE_READONLY,
- }
- if sbi.FileAttributes == 0 {
- sbi.FileAttributes = syscall.FILE_ATTRIBUTE_NORMAL
- }
- return winio.SetFileBasicInfo(f, &sbi)
-}
-
-// RemoveRelative removes a file or directory relative to a root, failing if any
-// intermediate path components are reparse points.
-func RemoveRelative(path string, root *os.File) error {
- f, err := openRelativeInternal(
- path,
- root,
- FILE_READ_ATTRIBUTES|FILE_WRITE_ATTRIBUTES|DELETE,
- syscall.FILE_SHARE_READ|syscall.FILE_SHARE_WRITE|syscall.FILE_SHARE_DELETE,
- FILE_OPEN,
- FILE_OPEN_REPARSE_POINT)
- if err == nil {
- defer f.Close()
- err = deleteOnClose(f)
- if err == syscall.ERROR_ACCESS_DENIED {
- // Maybe the file is marked readonly. Clear the bit and retry.
- clearReadOnly(f)
- err = deleteOnClose(f)
- }
- }
- if err != nil {
- return &os.PathError{Op: "remove", Path: filepath.Join(root.Name(), path), Err: err}
- }
- return nil
-}
-
-// RemoveAllRelative removes a directory tree relative to a root, failing if any
-// intermediate path components are reparse points.
-func RemoveAllRelative(path string, root *os.File) error {
- fi, err := LstatRelative(path, root)
- if err != nil {
- if os.IsNotExist(err) {
- return nil
- }
- return err
- }
- fileAttributes := fi.Sys().(*syscall.Win32FileAttributeData).FileAttributes
- if fileAttributes&syscall.FILE_ATTRIBUTE_DIRECTORY == 0 || fileAttributes&syscall.FILE_ATTRIBUTE_REPARSE_POINT != 0 {
- // If this is a reparse point, it can't have children. Simple remove will do.
- err := RemoveRelative(path, root)
- if err == nil || os.IsNotExist(err) {
- return nil
- }
- return err
- }
-
- // It is necessary to use os.Open as Readdirnames does not work with
- // OpenRelative. This is safe because the above lstatrelative fails
- // if the target is outside the root, and we know this is not a
- // symlink from the above FILE_ATTRIBUTE_REPARSE_POINT check.
- fd, err := os.Open(filepath.Join(root.Name(), path))
- if err != nil {
- if os.IsNotExist(err) {
- // Race. It was deleted between the Lstat and Open.
- // Return nil per RemoveAll's docs.
- return nil
- }
- return err
- }
-
- // Remove contents & return first error.
- for {
- names, err1 := fd.Readdirnames(100)
- for _, name := range names {
- err1 := RemoveAllRelative(path+string(os.PathSeparator)+name, root)
- if err == nil {
- err = err1
- }
- }
- if err1 == io.EOF {
- break
- }
- // If Readdirnames returned an error, use it.
- if err == nil {
- err = err1
- }
- if len(names) == 0 {
- break
- }
- }
- fd.Close()
-
- // Remove directory.
- err1 := RemoveRelative(path, root)
- if err1 == nil || os.IsNotExist(err1) {
- return nil
- }
- if err == nil {
- err = err1
- }
- return err
-}
-
-// MkdirRelative creates a directory relative to a root, failing if any
-// intermediate path components are reparse points.
-func MkdirRelative(path string, root *os.File) error {
- f, err := openRelativeInternal(
- path,
- root,
- 0,
- syscall.FILE_SHARE_READ|syscall.FILE_SHARE_WRITE|syscall.FILE_SHARE_DELETE,
- FILE_CREATE,
- FILE_DIRECTORY_FILE)
- if err == nil {
- f.Close()
- } else {
- err = &os.PathError{Op: "mkdir", Path: filepath.Join(root.Name(), path), Err: err}
- }
- return err
-}
-
-// LstatRelative performs a stat operation on a file relative to a root, failing
-// if any intermediate path components are reparse points.
-func LstatRelative(path string, root *os.File) (os.FileInfo, error) {
- f, err := openRelativeInternal(
- path,
- root,
- FILE_READ_ATTRIBUTES,
- syscall.FILE_SHARE_READ|syscall.FILE_SHARE_WRITE|syscall.FILE_SHARE_DELETE,
- FILE_OPEN,
- FILE_OPEN_REPARSE_POINT)
- if err != nil {
- return nil, &os.PathError{Op: "stat", Path: filepath.Join(root.Name(), path), Err: err}
- }
- defer f.Close()
- return f.Stat()
-}
-
-// EnsureNotReparsePointRelative validates that a given file (relative to a
-// root) and all intermediate path components are not a reparse points.
-func EnsureNotReparsePointRelative(path string, root *os.File) error {
- // Perform an open with OBJ_DONT_REPARSE but without specifying FILE_OPEN_REPARSE_POINT.
- f, err := OpenRelative(
- path,
- root,
- 0,
- syscall.FILE_SHARE_READ|syscall.FILE_SHARE_WRITE|syscall.FILE_SHARE_DELETE,
- FILE_OPEN,
- 0)
- if err != nil {
- return err
- }
- f.Close()
- return nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/safefile/zsyscall_windows.go b/vendor/github.com/Microsoft/hcsshim/internal/safefile/zsyscall_windows.go
deleted file mode 100644
index 709b9d347..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/safefile/zsyscall_windows.go
+++ /dev/null
@@ -1,79 +0,0 @@
-// Code generated by 'go generate'; DO NOT EDIT.
-
-package safefile
-
-import (
- "syscall"
- "unsafe"
-
- "golang.org/x/sys/windows"
-)
-
-var _ unsafe.Pointer
-
-// Do the interface allocations only once for common
-// Errno values.
-const (
- errnoERROR_IO_PENDING = 997
-)
-
-var (
- errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING)
-)
-
-// errnoErr returns common boxed Errno values, to prevent
-// allocations at runtime.
-func errnoErr(e syscall.Errno) error {
- switch e {
- case 0:
- return nil
- case errnoERROR_IO_PENDING:
- return errERROR_IO_PENDING
- }
- // TODO: add more here, after collecting data on the common
- // error values see on Windows. (perhaps when running
- // all.bat?)
- return e
-}
-
-var (
- modntdll = windows.NewLazySystemDLL("ntdll.dll")
- modkernel32 = windows.NewLazySystemDLL("kernel32.dll")
-
- procNtCreateFile = modntdll.NewProc("NtCreateFile")
- procNtSetInformationFile = modntdll.NewProc("NtSetInformationFile")
- procRtlNtStatusToDosErrorNoTeb = modntdll.NewProc("RtlNtStatusToDosErrorNoTeb")
- procLocalAlloc = modkernel32.NewProc("LocalAlloc")
- procLocalFree = modkernel32.NewProc("LocalFree")
-)
-
-func ntCreateFile(handle *uintptr, accessMask uint32, oa *objectAttributes, iosb *ioStatusBlock, allocationSize *uint64, fileAttributes uint32, shareAccess uint32, createDisposition uint32, createOptions uint32, eaBuffer *byte, eaLength uint32) (status uint32) {
- r0, _, _ := syscall.Syscall12(procNtCreateFile.Addr(), 11, uintptr(unsafe.Pointer(handle)), uintptr(accessMask), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(allocationSize)), uintptr(fileAttributes), uintptr(shareAccess), uintptr(createDisposition), uintptr(createOptions), uintptr(unsafe.Pointer(eaBuffer)), uintptr(eaLength), 0)
- status = uint32(r0)
- return
-}
-
-func ntSetInformationFile(handle uintptr, iosb *ioStatusBlock, information uintptr, length uint32, class uint32) (status uint32) {
- r0, _, _ := syscall.Syscall6(procNtSetInformationFile.Addr(), 5, uintptr(handle), uintptr(unsafe.Pointer(iosb)), uintptr(information), uintptr(length), uintptr(class), 0)
- status = uint32(r0)
- return
-}
-
-func rtlNtStatusToDosError(status uint32) (winerr error) {
- r0, _, _ := syscall.Syscall(procRtlNtStatusToDosErrorNoTeb.Addr(), 1, uintptr(status), 0, 0)
- if r0 != 0 {
- winerr = syscall.Errno(r0)
- }
- return
-}
-
-func localAlloc(flags uint32, size int) (ptr uintptr) {
- r0, _, _ := syscall.Syscall(procLocalAlloc.Addr(), 2, uintptr(flags), uintptr(size), 0)
- ptr = uintptr(r0)
- return
-}
-
-func localFree(ptr uintptr) {
- syscall.Syscall(procLocalFree.Addr(), 1, uintptr(ptr), 0, 0)
- return
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema1/schema1.go b/vendor/github.com/Microsoft/hcsshim/internal/schema1/schema1.go
deleted file mode 100644
index 24bb3b46b..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema1/schema1.go
+++ /dev/null
@@ -1,249 +0,0 @@
-package schema1
-
-import (
- "encoding/json"
- "time"
-
- "github.com/Microsoft/go-winio/pkg/guid"
- hcsschema "github.com/Microsoft/hcsshim/internal/schema2"
-)
-
-// ProcessConfig is used as both the input of Container.CreateProcess
-// and to convert the parameters to JSON for passing onto the HCS
-type ProcessConfig struct {
- ApplicationName string `json:",omitempty"`
- CommandLine string `json:",omitempty"`
- CommandArgs []string `json:",omitempty"` // Used by Linux Containers on Windows
- User string `json:",omitempty"`
- WorkingDirectory string `json:",omitempty"`
- Environment map[string]string `json:",omitempty"`
- EmulateConsole bool `json:",omitempty"`
- CreateStdInPipe bool `json:",omitempty"`
- CreateStdOutPipe bool `json:",omitempty"`
- CreateStdErrPipe bool `json:",omitempty"`
- ConsoleSize [2]uint `json:",omitempty"`
- CreateInUtilityVm bool `json:",omitempty"` // Used by Linux Containers on Windows
- OCISpecification *json.RawMessage `json:",omitempty"` // Used by Linux Containers on Windows
-}
-
-type Layer struct {
- ID string
- Path string
-}
-
-type MappedDir struct {
- HostPath string
- ContainerPath string
- ReadOnly bool
- BandwidthMaximum uint64
- IOPSMaximum uint64
- CreateInUtilityVM bool
- // LinuxMetadata - Support added in 1803/RS4+.
- LinuxMetadata bool `json:",omitempty"`
-}
-
-type MappedPipe struct {
- HostPath string
- ContainerPipeName string
-}
-
-type HvRuntime struct {
- ImagePath string `json:",omitempty"`
- SkipTemplate bool `json:",omitempty"`
- LinuxInitrdFile string `json:",omitempty"` // File under ImagePath on host containing an initrd image for starting a Linux utility VM
- LinuxKernelFile string `json:",omitempty"` // File under ImagePath on host containing a kernel for starting a Linux utility VM
- LinuxBootParameters string `json:",omitempty"` // Additional boot parameters for starting a Linux Utility VM in initrd mode
- BootSource string `json:",omitempty"` // "Vhd" for Linux Utility VM booting from VHD
- WritableBootSource bool `json:",omitempty"` // Linux Utility VM booting from VHD
-}
-
-type MappedVirtualDisk struct {
- HostPath string `json:",omitempty"` // Path to VHD on the host
- ContainerPath string // Platform-specific mount point path in the container
- CreateInUtilityVM bool `json:",omitempty"`
- ReadOnly bool `json:",omitempty"`
- Cache string `json:",omitempty"` // "" (Unspecified); "Disabled"; "Enabled"; "Private"; "PrivateAllowSharing"
- AttachOnly bool `json:",omitempty"`
-}
-
-// AssignedDevice represents a device that has been directly assigned to a container
-//
-// NOTE: Support added in RS5
-type AssignedDevice struct {
- // InterfaceClassGUID of the device to assign to container.
- InterfaceClassGUID string `json:"InterfaceClassGuid,omitempty"`
-}
-
-// ContainerConfig is used as both the input of CreateContainer
-// and to convert the parameters to JSON for passing onto the HCS
-type ContainerConfig struct {
- SystemType string // HCS requires this to be hard-coded to "Container"
- Name string // Name of the container. We use the docker ID.
- Owner string `json:",omitempty"` // The management platform that created this container
- VolumePath string `json:",omitempty"` // Windows volume path for scratch space. Used by Windows Server Containers only. Format \\?\\Volume{GUID}
- IgnoreFlushesDuringBoot bool `json:",omitempty"` // Optimization hint for container startup in Windows
- LayerFolderPath string `json:",omitempty"` // Where the layer folders are located. Used by Windows Server Containers only. Format %root%\windowsfilter\containerID
- Layers []Layer // List of storage layers. Required for Windows Server and Hyper-V Containers. Format ID=GUID;Path=%root%\windowsfilter\layerID
- Credentials string `json:",omitempty"` // Credentials information
- ProcessorCount uint32 `json:",omitempty"` // Number of processors to assign to the container.
- ProcessorWeight uint64 `json:",omitempty"` // CPU shares (relative weight to other containers with cpu shares). Range is from 1 to 10000. A value of 0 results in default shares.
- ProcessorMaximum int64 `json:",omitempty"` // Specifies the portion of processor cycles that this container can use as a percentage times 100. Range is from 1 to 10000. A value of 0 results in no limit.
- StorageIOPSMaximum uint64 `json:",omitempty"` // Maximum Storage IOPS
- StorageBandwidthMaximum uint64 `json:",omitempty"` // Maximum Storage Bandwidth in bytes per second
- StorageSandboxSize uint64 `json:",omitempty"` // Size in bytes that the container system drive should be expanded to if smaller
- MemoryMaximumInMB int64 `json:",omitempty"` // Maximum memory available to the container in Megabytes
- HostName string `json:",omitempty"` // Hostname
- MappedDirectories []MappedDir `json:",omitempty"` // List of mapped directories (volumes/mounts)
- MappedPipes []MappedPipe `json:",omitempty"` // List of mapped Windows named pipes
- HvPartition bool // True if it a Hyper-V Container
- NetworkSharedContainerName string `json:",omitempty"` // Name (ID) of the container that we will share the network stack with.
- EndpointList []string `json:",omitempty"` // List of networking endpoints to be attached to container
- HvRuntime *HvRuntime `json:",omitempty"` // Hyper-V container settings. Used by Hyper-V containers only. Format ImagePath=%root%\BaseLayerID\UtilityVM
- Servicing bool `json:",omitempty"` // True if this container is for servicing
- AllowUnqualifiedDNSQuery bool `json:",omitempty"` // True to allow unqualified DNS name resolution
- DNSSearchList string `json:",omitempty"` // Comma seperated list of DNS suffixes to use for name resolution
- ContainerType string `json:",omitempty"` // "Linux" for Linux containers on Windows. Omitted otherwise.
- TerminateOnLastHandleClosed bool `json:",omitempty"` // Should HCS terminate the container once all handles have been closed
- MappedVirtualDisks []MappedVirtualDisk `json:",omitempty"` // Array of virtual disks to mount at start
- AssignedDevices []AssignedDevice `json:",omitempty"` // Array of devices to assign. NOTE: Support added in RS5
-}
-
-type ComputeSystemQuery struct {
- IDs []string `json:"Ids,omitempty"`
- Types []string `json:",omitempty"`
- Names []string `json:",omitempty"`
- Owners []string `json:",omitempty"`
-}
-
-type PropertyType string
-
-const (
- PropertyTypeStatistics PropertyType = "Statistics" // V1 and V2
- PropertyTypeProcessList = "ProcessList" // V1 and V2
- PropertyTypeMappedVirtualDisk = "MappedVirtualDisk" // Not supported in V2 schema call
- PropertyTypeGuestConnection = "GuestConnection" // V1 and V2. Nil return from HCS before RS5
-)
-
-type PropertyQuery struct {
- PropertyTypes []PropertyType `json:",omitempty"`
-}
-
-// ContainerProperties holds the properties for a container and the processes running in that container
-type ContainerProperties struct {
- ID string `json:"Id"`
- State string
- Name string
- SystemType string
- RuntimeOSType string `json:"RuntimeOsType,omitempty"`
- Owner string
- SiloGUID string `json:"SiloGuid,omitempty"`
- RuntimeID guid.GUID `json:"RuntimeId,omitempty"`
- IsRuntimeTemplate bool `json:",omitempty"`
- RuntimeImagePath string `json:",omitempty"`
- Stopped bool `json:",omitempty"`
- ExitType string `json:",omitempty"`
- AreUpdatesPending bool `json:",omitempty"`
- ObRoot string `json:",omitempty"`
- Statistics Statistics `json:",omitempty"`
- ProcessList []ProcessListItem `json:",omitempty"`
- MappedVirtualDiskControllers map[int]MappedVirtualDiskController `json:",omitempty"`
- GuestConnectionInfo GuestConnectionInfo `json:",omitempty"`
-}
-
-// MemoryStats holds the memory statistics for a container
-type MemoryStats struct {
- UsageCommitBytes uint64 `json:"MemoryUsageCommitBytes,omitempty"`
- UsageCommitPeakBytes uint64 `json:"MemoryUsageCommitPeakBytes,omitempty"`
- UsagePrivateWorkingSetBytes uint64 `json:"MemoryUsagePrivateWorkingSetBytes,omitempty"`
-}
-
-// ProcessorStats holds the processor statistics for a container
-type ProcessorStats struct {
- TotalRuntime100ns uint64 `json:",omitempty"`
- RuntimeUser100ns uint64 `json:",omitempty"`
- RuntimeKernel100ns uint64 `json:",omitempty"`
-}
-
-// StorageStats holds the storage statistics for a container
-type StorageStats struct {
- ReadCountNormalized uint64 `json:",omitempty"`
- ReadSizeBytes uint64 `json:",omitempty"`
- WriteCountNormalized uint64 `json:",omitempty"`
- WriteSizeBytes uint64 `json:",omitempty"`
-}
-
-// NetworkStats holds the network statistics for a container
-type NetworkStats struct {
- BytesReceived uint64 `json:",omitempty"`
- BytesSent uint64 `json:",omitempty"`
- PacketsReceived uint64 `json:",omitempty"`
- PacketsSent uint64 `json:",omitempty"`
- DroppedPacketsIncoming uint64 `json:",omitempty"`
- DroppedPacketsOutgoing uint64 `json:",omitempty"`
- EndpointId string `json:",omitempty"`
- InstanceId string `json:",omitempty"`
-}
-
-// Statistics is the structure returned by a statistics call on a container
-type Statistics struct {
- Timestamp time.Time `json:",omitempty"`
- ContainerStartTime time.Time `json:",omitempty"`
- Uptime100ns uint64 `json:",omitempty"`
- Memory MemoryStats `json:",omitempty"`
- Processor ProcessorStats `json:",omitempty"`
- Storage StorageStats `json:",omitempty"`
- Network []NetworkStats `json:",omitempty"`
-}
-
-// ProcessList is the structure of an item returned by a ProcessList call on a container
-type ProcessListItem struct {
- CreateTimestamp time.Time `json:",omitempty"`
- ImageName string `json:",omitempty"`
- KernelTime100ns uint64 `json:",omitempty"`
- MemoryCommitBytes uint64 `json:",omitempty"`
- MemoryWorkingSetPrivateBytes uint64 `json:",omitempty"`
- MemoryWorkingSetSharedBytes uint64 `json:",omitempty"`
- ProcessId uint32 `json:",omitempty"`
- UserTime100ns uint64 `json:",omitempty"`
-}
-
-// MappedVirtualDiskController is the structure of an item returned by a MappedVirtualDiskList call on a container
-type MappedVirtualDiskController struct {
- MappedVirtualDisks map[int]MappedVirtualDisk `json:",omitempty"`
-}
-
-// GuestDefinedCapabilities is part of the GuestConnectionInfo returned by a GuestConnection call on a utility VM
-type GuestDefinedCapabilities struct {
- NamespaceAddRequestSupported bool `json:",omitempty"`
- SignalProcessSupported bool `json:",omitempty"`
- DumpStacksSupported bool `json:",omitempty"`
- DeleteContainerStateSupported bool `json:",omitempty"`
-}
-
-// GuestConnectionInfo is the structure of an iterm return by a GuestConnection call on a utility VM
-type GuestConnectionInfo struct {
- SupportedSchemaVersions []hcsschema.Version `json:",omitempty"`
- ProtocolVersion uint32 `json:",omitempty"`
- GuestDefinedCapabilities GuestDefinedCapabilities `json:",omitempty"`
-}
-
-// Type of Request Support in ModifySystem
-type RequestType string
-
-// Type of Resource Support in ModifySystem
-type ResourceType string
-
-// RequestType const
-const (
- Add RequestType = "Add"
- Remove RequestType = "Remove"
- Network ResourceType = "Network"
-)
-
-// ResourceModificationRequestResponse is the structure used to send request to the container to modify the system
-// Supported resource types are Network and Request Types are Add/Remove
-type ResourceModificationRequestResponse struct {
- Resource ResourceType `json:"ResourceType"`
- Data interface{} `json:"Settings"`
- Request RequestType `json:"RequestType,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/attachment.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/attachment.go
deleted file mode 100644
index bcfeb34d5..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/attachment.go
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type Attachment struct {
- Type_ string `json:"Type,omitempty"`
-
- Path string `json:"Path,omitempty"`
-
- IgnoreFlushes bool `json:"IgnoreFlushes,omitempty"`
-
- CachingMode string `json:"CachingMode,omitempty"`
-
- NoWriteHardening bool `json:"NoWriteHardening,omitempty"`
-
- DisableExpansionOptimization bool `json:"DisableExpansionOptimization,omitempty"`
-
- IgnoreRelativeLocator bool `json:"IgnoreRelativeLocator,omitempty"`
-
- CaptureIoAttributionContext bool `json:"CaptureIoAttributionContext,omitempty"`
-
- ReadOnly bool `json:"ReadOnly,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/battery.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/battery.go
deleted file mode 100644
index ecbbed4c2..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/battery.go
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type Battery struct {
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/cache_query_stats_response.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/cache_query_stats_response.go
deleted file mode 100644
index c1ea3953b..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/cache_query_stats_response.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type CacheQueryStatsResponse struct {
- L3OccupancyBytes int32 `json:"L3OccupancyBytes,omitempty"`
-
- L3TotalBwBytes int32 `json:"L3TotalBwBytes,omitempty"`
-
- L3LocalBwBytes int32 `json:"L3LocalBwBytes,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/chipset.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/chipset.go
deleted file mode 100644
index ca75277a3..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/chipset.go
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type Chipset struct {
- Uefi *Uefi `json:"Uefi,omitempty"`
-
- IsNumLockDisabled bool `json:"IsNumLockDisabled,omitempty"`
-
- BaseBoardSerialNumber string `json:"BaseBoardSerialNumber,omitempty"`
-
- ChassisSerialNumber string `json:"ChassisSerialNumber,omitempty"`
-
- ChassisAssetTag string `json:"ChassisAssetTag,omitempty"`
-
- UseUtc bool `json:"UseUtc,omitempty"`
-
- // LinuxKernelDirect - Added in v2.2 Builds >=181117
- LinuxKernelDirect *LinuxKernelDirect `json:"LinuxKernelDirect,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/close_handle.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/close_handle.go
deleted file mode 100644
index b4f9c315b..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/close_handle.go
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type CloseHandle struct {
- Handle string `json:"Handle,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/com_port.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/com_port.go
deleted file mode 100644
index 8bf8cab60..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/com_port.go
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-// ComPort specifies the named pipe that will be used for the port, with empty string indicating a disconnected port.
-type ComPort struct {
- NamedPipe string `json:"NamedPipe,omitempty"`
-
- OptimizeForDebugger bool `json:"OptimizeForDebugger,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/compute_system.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/compute_system.go
deleted file mode 100644
index 10cea67e0..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/compute_system.go
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type ComputeSystem struct {
- Owner string `json:"Owner,omitempty"`
-
- SchemaVersion *Version `json:"SchemaVersion,omitempty"`
-
- HostingSystemId string `json:"HostingSystemId,omitempty"`
-
- HostedSystem interface{} `json:"HostedSystem,omitempty"`
-
- Container *Container `json:"Container,omitempty"`
-
- VirtualMachine *VirtualMachine `json:"VirtualMachine,omitempty"`
-
- ShouldTerminateOnLastHandleClosed bool `json:"ShouldTerminateOnLastHandleClosed,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/configuration.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/configuration.go
deleted file mode 100644
index 1d5dfe68a..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/configuration.go
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-import (
- "net/http"
-)
-
-// contextKeys are used to identify the type of value in the context.
-// Since these are string, it is possible to get a short description of the
-// context key for logging and debugging using key.String().
-
-type contextKey string
-
-func (c contextKey) String() string {
- return "auth " + string(c)
-}
-
-var (
- // ContextOAuth2 takes a oauth2.TokenSource as authentication for the request.
- ContextOAuth2 = contextKey("token")
-
- // ContextBasicAuth takes BasicAuth as authentication for the request.
- ContextBasicAuth = contextKey("basic")
-
- // ContextAccessToken takes a string oauth2 access token as authentication for the request.
- ContextAccessToken = contextKey("accesstoken")
-
- // ContextAPIKey takes an APIKey as authentication for the request
- ContextAPIKey = contextKey("apikey")
-)
-
-// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
-type BasicAuth struct {
- UserName string `json:"userName,omitempty"`
- Password string `json:"password,omitempty"`
-}
-
-// APIKey provides API key based authentication to a request passed via context using ContextAPIKey
-type APIKey struct {
- Key string
- Prefix string
-}
-
-type Configuration struct {
- BasePath string `json:"basePath,omitempty"`
- Host string `json:"host,omitempty"`
- Scheme string `json:"scheme,omitempty"`
- DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
- UserAgent string `json:"userAgent,omitempty"`
- HTTPClient *http.Client
-}
-
-func NewConfiguration() *Configuration {
- cfg := &Configuration{
- BasePath: "https://localhost",
- DefaultHeader: make(map[string]string),
- UserAgent: "Swagger-Codegen/2.1.0/go",
- }
- return cfg
-}
-
-func (c *Configuration) AddDefaultHeader(key string, value string) {
- c.DefaultHeader[key] = value
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/console_size.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/console_size.go
deleted file mode 100644
index 68aa04a57..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/console_size.go
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type ConsoleSize struct {
- Height int32 `json:"Height,omitempty"`
-
- Width int32 `json:"Width,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/container.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/container.go
deleted file mode 100644
index 4fb231076..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/container.go
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type Container struct {
- GuestOs *GuestOs `json:"GuestOs,omitempty"`
-
- Storage *Storage `json:"Storage,omitempty"`
-
- MappedDirectories []MappedDirectory `json:"MappedDirectories,omitempty"`
-
- MappedPipes []MappedPipe `json:"MappedPipes,omitempty"`
-
- Memory *Memory `json:"Memory,omitempty"`
-
- Processor *Processor `json:"Processor,omitempty"`
-
- Networking *Networking `json:"Networking,omitempty"`
-
- HvSocket *HvSocket `json:"HvSocket,omitempty"`
-
- ContainerCredentialGuard *ContainerCredentialGuardState `json:"ContainerCredentialGuard,omitempty"`
-
- RegistryChanges *RegistryChanges `json:"RegistryChanges,omitempty"`
-
- AssignedDevices []Device `json:"AssignedDevices,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/container_credential_guard_state.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/container_credential_guard_state.go
deleted file mode 100644
index 0f8f64437..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/container_credential_guard_state.go
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type ContainerCredentialGuardState struct {
-
- // Authentication cookie for calls to a Container Credential Guard instance.
- Cookie string `json:"Cookie,omitempty"`
-
- // Name of the RPC endpoint of the Container Credential Guard instance.
- RpcEndpoint string `json:"RpcEndpoint,omitempty"`
-
- // Transport used for the configured Container Credential Guard instance.
- Transport string `json:"Transport,omitempty"`
-
- // Credential spec used for the configured Container Credential Guard instance.
- CredentialSpec string `json:"CredentialSpec,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/container_memory_information.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/container_memory_information.go
deleted file mode 100644
index 1fd7ca5d5..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/container_memory_information.go
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-// memory usage as viewed from within the container
-type ContainerMemoryInformation struct {
- TotalPhysicalBytes int32 `json:"TotalPhysicalBytes,omitempty"`
-
- TotalUsage int32 `json:"TotalUsage,omitempty"`
-
- CommittedBytes int32 `json:"CommittedBytes,omitempty"`
-
- SharedCommittedBytes int32 `json:"SharedCommittedBytes,omitempty"`
-
- CommitLimitBytes int32 `json:"CommitLimitBytes,omitempty"`
-
- PeakCommitmentBytes int32 `json:"PeakCommitmentBytes,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/device.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/device.go
deleted file mode 100644
index ca319bbbc..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/device.go
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type Device struct {
-
- // The interface class guid of the device to assign to container.
- InterfaceClassGuid string `json:"InterfaceClassGuid,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/devices.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/devices.go
deleted file mode 100644
index e985d96d2..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/devices.go
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type Devices struct {
- ComPorts map[string]ComPort `json:"ComPorts,omitempty"`
-
- Scsi map[string]Scsi `json:"Scsi,omitempty"`
-
- VirtualPMem *VirtualPMemController `json:"VirtualPMem,omitempty"`
-
- NetworkAdapters map[string]NetworkAdapter `json:"NetworkAdapters,omitempty"`
-
- VideoMonitor *VideoMonitor `json:"VideoMonitor,omitempty"`
-
- Keyboard *Keyboard `json:"Keyboard,omitempty"`
-
- Mouse *Mouse `json:"Mouse,omitempty"`
-
- HvSocket *HvSocket2 `json:"HvSocket,omitempty"`
-
- EnhancedModeVideo *EnhancedModeVideo `json:"EnhancedModeVideo,omitempty"`
-
- GuestCrashReporting *GuestCrashReporting `json:"GuestCrashReporting,omitempty"`
-
- VirtualSmb *VirtualSmb `json:"VirtualSmb,omitempty"`
-
- Plan9 *Plan9 `json:"Plan9,omitempty"`
-
- Battery *Battery `json:"Battery,omitempty"`
-
- FlexibleIov map[string]FlexibleIoDevice `json:"FlexibleIov,omitempty"`
-
- SharedMemory *SharedMemoryConfiguration `json:"SharedMemory,omitempty"`
-
- // TODO: This is pre-release support in schema 2.3. Need to add build number
- // docs when a public build with this is out.
- VirtualPci map[string]VirtualPciDevice `json:",omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/enhanced_mode_video.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/enhanced_mode_video.go
deleted file mode 100644
index 85450c41e..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/enhanced_mode_video.go
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type EnhancedModeVideo struct {
- ConnectionOptions *RdpConnectionOptions `json:"ConnectionOptions,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/flexible_io_device.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/flexible_io_device.go
deleted file mode 100644
index fe86cab65..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/flexible_io_device.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type FlexibleIoDevice struct {
- EmulatorId string `json:"EmulatorId,omitempty"`
-
- HostingModel string `json:"HostingModel,omitempty"`
-
- Configuration []string `json:"Configuration,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/guest_connection.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/guest_connection.go
deleted file mode 100644
index 7db29495b..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/guest_connection.go
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type GuestConnection struct {
-
- // Use Vsock rather than Hyper-V sockets to communicate with the guest service.
- UseVsock bool `json:"UseVsock,omitempty"`
-
- // Don't disconnect the guest connection when pausing the virtual machine.
- UseConnectedSuspend bool `json:"UseConnectedSuspend,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/guest_connection_info.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/guest_connection_info.go
deleted file mode 100644
index 8a369bab7..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/guest_connection_info.go
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-// Information about the guest.
-type GuestConnectionInfo struct {
-
- // Each schema version x.y stands for the range of versions a.b where a==x and b<=y. This list comes from the SupportedSchemaVersions field in GcsCapabilities.
- SupportedSchemaVersions []Version `json:"SupportedSchemaVersions,omitempty"`
-
- ProtocolVersion int32 `json:"ProtocolVersion,omitempty"`
-
- GuestDefinedCapabilities *interface{} `json:"GuestDefinedCapabilities,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/guest_crash_reporting.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/guest_crash_reporting.go
deleted file mode 100644
index af8280048..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/guest_crash_reporting.go
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type GuestCrashReporting struct {
- WindowsCrashSettings *WindowsCrashReporting `json:"WindowsCrashSettings,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/guest_os.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/guest_os.go
deleted file mode 100644
index 8838519a3..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/guest_os.go
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type GuestOs struct {
- HostName string `json:"HostName,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/guest_state.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/guest_state.go
deleted file mode 100644
index ef1eec886..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/guest_state.go
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type GuestState struct {
-
- // The path to an existing file uses for persistent guest state storage. An empty string indicates the system should initialize new transient, in-memory guest state.
- GuestStateFilePath string `json:"GuestStateFilePath,omitempty"`
-
- // The path to an existing file for persistent runtime state storage. An empty string indicates the system should initialize new transient, in-memory runtime state.
- RuntimeStateFilePath string `json:"RuntimeStateFilePath,omitempty"`
-
- // If true, the guest state and runtime state files will be used as templates to populate transient, in-memory state instead of using the files as persistent backing store.
- ForceTransientState bool `json:"ForceTransientState,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/hosted_system.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/hosted_system.go
deleted file mode 100644
index ea3084bca..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/hosted_system.go
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type HostedSystem struct {
- SchemaVersion *Version `json:"SchemaVersion,omitempty"`
-
- Container *Container `json:"Container,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/hv_socket.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/hv_socket.go
deleted file mode 100644
index 23b2ee9e7..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/hv_socket.go
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type HvSocket struct {
- Config *HvSocketSystemConfig `json:"Config,omitempty"`
-
- EnablePowerShellDirect bool `json:"EnablePowerShellDirect,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/hv_socket_2.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/hv_socket_2.go
deleted file mode 100644
index a017691f0..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/hv_socket_2.go
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-// HvSocket configuration for a VM
-type HvSocket2 struct {
- HvSocketConfig *HvSocketSystemConfig `json:"HvSocketConfig,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/hv_socket_service_config.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/hv_socket_service_config.go
deleted file mode 100644
index a848e91e6..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/hv_socket_service_config.go
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type HvSocketServiceConfig struct {
-
- // SDDL string that HvSocket will check before allowing a host process to bind to this specific service. If not specified, defaults to the system DefaultBindSecurityDescriptor, defined in HvSocketSystemWpConfig in V1.
- BindSecurityDescriptor string `json:"BindSecurityDescriptor,omitempty"`
-
- // SDDL string that HvSocket will check before allowing a host process to connect to this specific service. If not specified, defaults to the system DefaultConnectSecurityDescriptor, defined in HvSocketSystemWpConfig in V1.
- ConnectSecurityDescriptor string `json:"ConnectSecurityDescriptor,omitempty"`
-
- // If true, HvSocket will process wildcard binds for this service/system combination. Wildcard binds are secured in the registry at SOFTWARE/Microsoft/Windows NT/CurrentVersion/Virtualization/HvSocket/WildcardDescriptors
- AllowWildcardBinds bool `json:"AllowWildcardBinds,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/hv_socket_system_config.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/hv_socket_system_config.go
deleted file mode 100644
index 69f4f9d39..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/hv_socket_system_config.go
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-// This is the HCS Schema version of the HvSocket configuration. The VMWP version is located in Config.Devices.IC in V1.
-type HvSocketSystemConfig struct {
-
- // SDDL string that HvSocket will check before allowing a host process to bind to an unlisted service for this specific container/VM (not wildcard binds).
- DefaultBindSecurityDescriptor string `json:"DefaultBindSecurityDescriptor,omitempty"`
-
- // SDDL string that HvSocket will check before allowing a host process to connect to an unlisted service in the VM/container.
- DefaultConnectSecurityDescriptor string `json:"DefaultConnectSecurityDescriptor,omitempty"`
-
- ServiceTable map[string]HvSocketServiceConfig `json:"ServiceTable,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/keyboard.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/keyboard.go
deleted file mode 100644
index 3d3fa3b1c..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/keyboard.go
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type Keyboard struct {
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/layer.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/layer.go
deleted file mode 100644
index 176c49d49..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/layer.go
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type Layer struct {
- Id string `json:"Id,omitempty"`
-
- Path string `json:"Path,omitempty"`
-
- PathType string `json:"PathType,omitempty"`
-
- // Unspecified defaults to Enabled
- Cache string `json:"Cache,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/linux_kernel_direct.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/linux_kernel_direct.go
deleted file mode 100644
index 0ab6c280f..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/linux_kernel_direct.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.2
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type LinuxKernelDirect struct {
- KernelFilePath string `json:"KernelFilePath,omitempty"`
-
- InitRdPath string `json:"InitRdPath,omitempty"`
-
- KernelCmdLine string `json:"KernelCmdLine,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/mapped_directory.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/mapped_directory.go
deleted file mode 100644
index 9b86a4045..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/mapped_directory.go
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type MappedDirectory struct {
- HostPath string `json:"HostPath,omitempty"`
-
- HostPathType string `json:"HostPathType,omitempty"`
-
- ContainerPath string `json:"ContainerPath,omitempty"`
-
- ReadOnly bool `json:"ReadOnly,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/mapped_pipe.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/mapped_pipe.go
deleted file mode 100644
index 208074e9a..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/mapped_pipe.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type MappedPipe struct {
- ContainerPipeName string `json:"ContainerPipeName,omitempty"`
-
- HostPath string `json:"HostPath,omitempty"`
-
- HostPathType string `json:"HostPathType,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/memory.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/memory.go
deleted file mode 100644
index ec93d004e..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/memory.go
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type Memory struct {
- SizeInMB int32 `json:"SizeInMB,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/memory_2.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/memory_2.go
deleted file mode 100644
index 95328ec30..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/memory_2.go
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type Memory2 struct {
- SizeInMB int32 `json:"SizeInMB,omitempty"`
-
- AllowOvercommit bool `json:"AllowOvercommit,omitempty"`
-
- EnableHotHint bool `json:"EnableHotHint,omitempty"`
-
- EnableColdHint bool `json:"EnableColdHint,omitempty"`
-
- EnableEpf bool `json:"EnableEpf,omitempty"`
-
- // EnableDeferredCommit is private in the schema. If regenerated need to add back.
- EnableDeferredCommit bool `json:"EnableDeferredCommit,omitempty"`
-
- // EnableColdDiscardHint if enabled, then the memory cold discard hint feature is exposed
- // to the VM, allowing it to trim non-zeroed pages from the working set (if supported by
- // the guest operating system).
- EnableColdDiscardHint bool `json:"EnableColdDiscardHint,omitempty"`
-
- // LowMmioGapInMB is the low MMIO region allocated below 4GB.
- //
- // TODO: This is pre-release support in schema 2.3. Need to add build number
- // docs when a public build with this is out.
- LowMMIOGapInMB uint64 `json:"LowMmioGapInMB,omitempty"`
-
- // HighMmioBaseInMB is the high MMIO region allocated above 4GB (base and
- // size).
- //
- // TODO: This is pre-release support in schema 2.3. Need to add build number
- // docs when a public build with this is out.
- HighMMIOBaseInMB uint64 `json:"HighMmioBaseInMB,omitempty"`
-
- // HighMmioGapInMB is the high MMIO region.
- //
- // TODO: This is pre-release support in schema 2.3. Need to add build number
- // docs when a public build with this is out.
- HighMMIOGapInMB uint64 `json:"HighMmioGapInMB,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/memory_information_for_vm.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/memory_information_for_vm.go
deleted file mode 100644
index 811779b04..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/memory_information_for_vm.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type MemoryInformationForVm struct {
- VirtualNodeCount uint32 `json:"VirtualNodeCount,omitempty"`
-
- VirtualMachineMemory *VmMemory `json:"VirtualMachineMemory,omitempty"`
-
- VirtualNodes []VirtualNodeInfo `json:"VirtualNodes,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/memory_stats.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/memory_stats.go
deleted file mode 100644
index 906ba597f..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/memory_stats.go
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-// Memory runtime statistics
-type MemoryStats struct {
- MemoryUsageCommitBytes uint64 `json:"MemoryUsageCommitBytes,omitempty"`
-
- MemoryUsageCommitPeakBytes uint64 `json:"MemoryUsageCommitPeakBytes,omitempty"`
-
- MemoryUsagePrivateWorkingSetBytes uint64 `json:"MemoryUsagePrivateWorkingSetBytes,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/modify_setting_request.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/modify_setting_request.go
deleted file mode 100644
index d29455a3e..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/modify_setting_request.go
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type ModifySettingRequest struct {
- ResourcePath string `json:"ResourcePath,omitempty"`
-
- RequestType string `json:"RequestType,omitempty"`
-
- Settings interface{} `json:"Settings,omitempty"` // NOTE: Swagger generated as *interface{}. Locally updated
-
- GuestRequest interface{} `json:"GuestRequest,omitempty"` // NOTE: Swagger generated as *interface{}. Locally updated
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/mouse.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/mouse.go
deleted file mode 100644
index ccf8b938f..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/mouse.go
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type Mouse struct {
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/network_adapter.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/network_adapter.go
deleted file mode 100644
index a9c750b34..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/network_adapter.go
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type NetworkAdapter struct {
- EndpointId string `json:"EndpointId,omitempty"`
-
- MacAddress string `json:"MacAddress,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/networking.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/networking.go
deleted file mode 100644
index e5ea187a2..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/networking.go
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type Networking struct {
- AllowUnqualifiedDnsQuery bool `json:"AllowUnqualifiedDnsQuery,omitempty"`
-
- DnsSearchList string `json:"DnsSearchList,omitempty"`
-
- NetworkSharedContainerName string `json:"NetworkSharedContainerName,omitempty"`
-
- // Guid in windows; string in linux
- Namespace string `json:"Namespace,omitempty"`
-
- NetworkAdapters []string `json:"NetworkAdapters,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/pause_notification.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/pause_notification.go
deleted file mode 100644
index d96c9501f..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/pause_notification.go
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-// Notification data that is indicated to components running in the Virtual Machine.
-type PauseNotification struct {
- Reason string `json:"Reason,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/pause_options.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/pause_options.go
deleted file mode 100644
index 21707a88e..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/pause_options.go
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-// Options for HcsPauseComputeSystem
-type PauseOptions struct {
- SuspensionLevel string `json:"SuspensionLevel,omitempty"`
-
- HostedNotification *PauseNotification `json:"HostedNotification,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/plan9.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/plan9.go
deleted file mode 100644
index 29d8c8012..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/plan9.go
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type Plan9 struct {
- Shares []Plan9Share `json:"Shares,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/plan9_share.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/plan9_share.go
deleted file mode 100644
index 41f8fdea0..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/plan9_share.go
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type Plan9Share struct {
- Name string `json:"Name,omitempty"`
-
- // The name by which the guest operation system can access this share, via the aname parameter in the Plan9 protocol.
- AccessName string `json:"AccessName,omitempty"`
-
- Path string `json:"Path,omitempty"`
-
- Port int32 `json:"Port,omitempty"`
-
- // Flags are marked private. Until they are exported correctly
- //
- // ReadOnly 0x00000001
- // LinuxMetadata 0x00000004
- // CaseSensitive 0x00000008
- Flags int32 `json:"Flags,omitempty"`
-
- ReadOnly bool `json:"ReadOnly,omitempty"`
-
- UseShareRootIdentity bool `json:"UseShareRootIdentity,omitempty"`
-
- AllowedFiles []string `json:"AllowedFiles,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/process_details.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/process_details.go
deleted file mode 100644
index e9a662dd5..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/process_details.go
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-import (
- "time"
-)
-
-// Information about a process running in a container
-type ProcessDetails struct {
- ProcessId int32 `json:"ProcessId,omitempty"`
-
- ImageName string `json:"ImageName,omitempty"`
-
- CreateTimestamp time.Time `json:"CreateTimestamp,omitempty"`
-
- UserTime100ns int32 `json:"UserTime100ns,omitempty"`
-
- KernelTime100ns int32 `json:"KernelTime100ns,omitempty"`
-
- MemoryCommitBytes int32 `json:"MemoryCommitBytes,omitempty"`
-
- MemoryWorkingSetPrivateBytes int32 `json:"MemoryWorkingSetPrivateBytes,omitempty"`
-
- MemoryWorkingSetSharedBytes int32 `json:"MemoryWorkingSetSharedBytes,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/process_modify_request.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/process_modify_request.go
deleted file mode 100644
index e4ed095c7..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/process_modify_request.go
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-// Passed to HcsRpc_ModifyProcess
-type ProcessModifyRequest struct {
- Operation string `json:"Operation,omitempty"`
-
- ConsoleSize *ConsoleSize `json:"ConsoleSize,omitempty"`
-
- CloseHandle *CloseHandle `json:"CloseHandle,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/process_parameters.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/process_parameters.go
deleted file mode 100644
index 82b0d0532..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/process_parameters.go
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type ProcessParameters struct {
- ApplicationName string `json:"ApplicationName,omitempty"`
-
- CommandLine string `json:"CommandLine,omitempty"`
-
- // optional alternative to CommandLine, currently only supported by Linux GCS
- CommandArgs []string `json:"CommandArgs,omitempty"`
-
- User string `json:"User,omitempty"`
-
- WorkingDirectory string `json:"WorkingDirectory,omitempty"`
-
- Environment map[string]string `json:"Environment,omitempty"`
-
- // if set, will run as low-privilege process
- RestrictedToken bool `json:"RestrictedToken,omitempty"`
-
- // if set, ignore StdErrPipe
- EmulateConsole bool `json:"EmulateConsole,omitempty"`
-
- CreateStdInPipe bool `json:"CreateStdInPipe,omitempty"`
-
- CreateStdOutPipe bool `json:"CreateStdOutPipe,omitempty"`
-
- CreateStdErrPipe bool `json:"CreateStdErrPipe,omitempty"`
-
- // height then width
- ConsoleSize []int32 `json:"ConsoleSize,omitempty"`
-
- // if set, find an existing session for the user and create the process in it
- UseExistingLogin bool `json:"UseExistingLogin,omitempty"`
-
- // if set, use the legacy console instead of conhost
- UseLegacyConsole bool `json:"UseLegacyConsole,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/process_status.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/process_status.go
deleted file mode 100644
index ad9a4fa9a..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/process_status.go
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-// Status of a process running in a container
-type ProcessStatus struct {
- ProcessId int32 `json:"ProcessId,omitempty"`
-
- Exited bool `json:"Exited,omitempty"`
-
- ExitCode int32 `json:"ExitCode,omitempty"`
-
- LastWaitResult int32 `json:"LastWaitResult,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/processor.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/processor.go
deleted file mode 100644
index bb24e88da..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/processor.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type Processor struct {
- Count int32 `json:"Count,omitempty"`
-
- Maximum int32 `json:"Maximum,omitempty"`
-
- Weight int32 `json:"Weight,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/processor_2.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/processor_2.go
deleted file mode 100644
index 21fe46062..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/processor_2.go
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type Processor2 struct {
- Count int32 `json:"Count,omitempty"`
-
- Limit int32 `json:"Limit,omitempty"`
-
- Weight int32 `json:"Weight,omitempty"`
-
- ExposeVirtualizationExtensions bool `json:"ExposeVirtualizationExtensions,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/processor_stats.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/processor_stats.go
deleted file mode 100644
index 6157e2522..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/processor_stats.go
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-// CPU runtime statistics
-type ProcessorStats struct {
- TotalRuntime100ns uint64 `json:"TotalRuntime100ns,omitempty"`
-
- RuntimeUser100ns uint64 `json:"RuntimeUser100ns,omitempty"`
-
- RuntimeKernel100ns uint64 `json:"RuntimeKernel100ns,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/properties.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/properties.go
deleted file mode 100644
index 17558cba0..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/properties.go
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-import (
- v1 "github.com/containerd/cgroups/stats/v1"
-)
-
-type Properties struct {
- Id string `json:"Id,omitempty"`
-
- SystemType string `json:"SystemType,omitempty"`
-
- RuntimeOsType string `json:"RuntimeOsType,omitempty"`
-
- Name string `json:"Name,omitempty"`
-
- Owner string `json:"Owner,omitempty"`
-
- RuntimeId string `json:"RuntimeId,omitempty"`
-
- RuntimeTemplateId string `json:"RuntimeTemplateId,omitempty"`
-
- State string `json:"State,omitempty"`
-
- Stopped bool `json:"Stopped,omitempty"`
-
- ExitType string `json:"ExitType,omitempty"`
-
- Memory *MemoryInformationForVm `json:"Memory,omitempty"`
-
- Statistics *Statistics `json:"Statistics,omitempty"`
-
- ProcessList []ProcessDetails `json:"ProcessList,omitempty"`
-
- TerminateOnLastHandleClosed bool `json:"TerminateOnLastHandleClosed,omitempty"`
-
- HostingSystemId string `json:"HostingSystemId,omitempty"`
-
- SharedMemoryRegionInfo []SharedMemoryRegionInfo `json:"SharedMemoryRegionInfo,omitempty"`
-
- GuestConnectionInfo *GuestConnectionInfo `json:"GuestConnectionInfo,omitempty"`
-
- // Metrics is not part of the API for HCS but this is used for LCOW v2 to
- // return the full cgroup metrics from the guest.
- Metrics *v1.Metrics `json:"LCOWMetrics,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/property_query.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/property_query.go
deleted file mode 100644
index d6d80df13..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/property_query.go
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-// By default the basic properties will be returned. This query provides a way to request specific properties.
-type PropertyQuery struct {
- PropertyTypes []PropertyType `json:"PropertyTypes,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/property_type.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/property_type.go
deleted file mode 100644
index f092b737f..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/property_type.go
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type PropertyType string
-
-const (
- PTMemory PropertyType = "Memory"
- PTGuestMemory PropertyType = "GuestMemory"
- PTStatistics PropertyType = "Statistics"
- PTProcessList PropertyType = "ProcessList"
- PTTerminateOnLastHandleClosed PropertyType = "TerminateOnLastHandleClosed"
- PTSharedMemoryRegion PropertyType = "SharedMemoryRegion"
- PTGuestConnection PropertyType = "GuestConnection"
- PTICHeartbeatStatus PropertyType = "ICHeartbeatStatus"
-)
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/rdp_connection_options.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/rdp_connection_options.go
deleted file mode 100644
index 8d5f5c171..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/rdp_connection_options.go
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type RdpConnectionOptions struct {
- AccessSids []string `json:"AccessSids,omitempty"`
-
- NamedPipe string `json:"NamedPipe,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/registry_changes.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/registry_changes.go
deleted file mode 100644
index 006906f6e..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/registry_changes.go
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type RegistryChanges struct {
- AddValues []RegistryValue `json:"AddValues,omitempty"`
-
- DeleteKeys []RegistryKey `json:"DeleteKeys,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/registry_key.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/registry_key.go
deleted file mode 100644
index 26fde99c7..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/registry_key.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type RegistryKey struct {
- Hive string `json:"Hive,omitempty"`
-
- Name string `json:"Name,omitempty"`
-
- Volatile bool `json:"Volatile,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/registry_value.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/registry_value.go
deleted file mode 100644
index 3f203176c..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/registry_value.go
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type RegistryValue struct {
- Key *RegistryKey `json:"Key,omitempty"`
-
- Name string `json:"Name,omitempty"`
-
- Type_ string `json:"Type,omitempty"`
-
- // One and only one value type must be set.
- StringValue string `json:"StringValue,omitempty"`
-
- BinaryValue string `json:"BinaryValue,omitempty"`
-
- DWordValue int32 `json:"DWordValue,omitempty"`
-
- QWordValue int32 `json:"QWordValue,omitempty"`
-
- // Only used if RegistryValueType is CustomType The data is in BinaryValue
- CustomType int32 `json:"CustomType,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/restore_state.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/restore_state.go
deleted file mode 100644
index 778ff5873..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/restore_state.go
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type RestoreState struct {
-
- // The path to the save state file to restore the system from.
- SaveStateFilePath string `json:"SaveStateFilePath,omitempty"`
-
- // The ID of the template system to clone this new system off of. An empty string indicates the system should not be cloned from a template.
- TemplateSystemId string `json:"TemplateSystemId,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/save_options.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/save_options.go
deleted file mode 100644
index e55fa1d98..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/save_options.go
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type SaveOptions struct {
-
- // The type of save operation to be performed.
- SaveType string `json:"SaveType,omitempty"`
-
- // The path to the file that will container the saved state.
- SaveStateFilePath string `json:"SaveStateFilePath,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/scsi.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/scsi.go
deleted file mode 100644
index bf253a470..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/scsi.go
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type Scsi struct {
-
- // Map of attachments, where the key is the integer LUN number on the controller.
- Attachments map[string]Attachment `json:"Attachments,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/shared_memory_configuration.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/shared_memory_configuration.go
deleted file mode 100644
index df9baa921..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/shared_memory_configuration.go
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type SharedMemoryConfiguration struct {
- Regions []SharedMemoryRegion `json:"Regions,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/shared_memory_region.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/shared_memory_region.go
deleted file mode 100644
index 825b71865..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/shared_memory_region.go
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type SharedMemoryRegion struct {
- SectionName string `json:"SectionName,omitempty"`
-
- StartOffset int32 `json:"StartOffset,omitempty"`
-
- Length int32 `json:"Length,omitempty"`
-
- AllowGuestWrite bool `json:"AllowGuestWrite,omitempty"`
-
- HiddenFromGuest bool `json:"HiddenFromGuest,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/shared_memory_region_info.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/shared_memory_region_info.go
deleted file mode 100644
index f67b08eb5..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/shared_memory_region_info.go
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type SharedMemoryRegionInfo struct {
- SectionName string `json:"SectionName,omitempty"`
-
- GuestPhysicalAddress int32 `json:"GuestPhysicalAddress,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/silo_properties.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/silo_properties.go
deleted file mode 100644
index 5eaf6a7f4..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/silo_properties.go
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-// Silo job information
-type SiloProperties struct {
- Enabled bool `json:"Enabled,omitempty"`
-
- JobName string `json:"JobName,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/statistics.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/statistics.go
deleted file mode 100644
index ba7a6b396..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/statistics.go
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-import (
- "time"
-)
-
-// Runtime statistics for a container
-type Statistics struct {
- Timestamp time.Time `json:"Timestamp,omitempty"`
-
- ContainerStartTime time.Time `json:"ContainerStartTime,omitempty"`
-
- Uptime100ns uint64 `json:"Uptime100ns,omitempty"`
-
- Processor *ProcessorStats `json:"Processor,omitempty"`
-
- Memory *MemoryStats `json:"Memory,omitempty"`
-
- Storage *StorageStats `json:"Storage,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/storage.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/storage.go
deleted file mode 100644
index 2627af913..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/storage.go
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type Storage struct {
-
- // List of layers that describe the parent hierarchy for a container's storage. These layers combined together, presented as a disposable and/or committable working storage, are used by the container to record all changes done to the parent layers.
- Layers []Layer `json:"Layers,omitempty"`
-
- // Path that points to the scratch space of a container, where parent layers are combined together to present a new disposable and/or committable layer with the changes done during its runtime.
- Path string `json:"Path,omitempty"`
-
- QoS *StorageQoS `json:"QoS,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/storage_qo_s.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/storage_qo_s.go
deleted file mode 100644
index 9c5e6eb53..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/storage_qo_s.go
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type StorageQoS struct {
- IopsMaximum int32 `json:"IopsMaximum,omitempty"`
-
- BandwidthMaximum int32 `json:"BandwidthMaximum,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/storage_stats.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/storage_stats.go
deleted file mode 100644
index 4f042ffd9..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/storage_stats.go
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-// Storage runtime statistics
-type StorageStats struct {
- ReadCountNormalized uint64 `json:"ReadCountNormalized,omitempty"`
-
- ReadSizeBytes uint64 `json:"ReadSizeBytes,omitempty"`
-
- WriteCountNormalized uint64 `json:"WriteCountNormalized,omitempty"`
-
- WriteSizeBytes uint64 `json:"WriteSizeBytes,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/topology.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/topology.go
deleted file mode 100644
index 834869940..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/topology.go
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type Topology struct {
- Memory *Memory2 `json:"Memory,omitempty"`
-
- Processor *Processor2 `json:"Processor,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/uefi.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/uefi.go
deleted file mode 100644
index 0e48ece50..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/uefi.go
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type Uefi struct {
- EnableDebugger bool `json:"EnableDebugger,omitempty"`
-
- SecureBootTemplateId string `json:"SecureBootTemplateId,omitempty"`
-
- BootThis *UefiBootEntry `json:"BootThis,omitempty"`
-
- Console string `json:"Console,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/uefi_boot_entry.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/uefi_boot_entry.go
deleted file mode 100644
index 3ab409d82..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/uefi_boot_entry.go
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type UefiBootEntry struct {
- DeviceType string `json:"DeviceType,omitempty"`
-
- DevicePath string `json:"DevicePath,omitempty"`
-
- DiskNumber int32 `json:"DiskNumber,omitempty"`
-
- OptionalData string `json:"OptionalData,omitempty"`
-
- VmbFsRootPath string `json:"VmbFsRootPath,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/version.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/version.go
deleted file mode 100644
index 2abfccca3..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/version.go
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type Version struct {
- Major int32 `json:"Major,omitempty"`
-
- Minor int32 `json:"Minor,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/video_monitor.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/video_monitor.go
deleted file mode 100644
index ec5d0fb93..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/video_monitor.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type VideoMonitor struct {
- HorizontalResolution int32 `json:"HorizontalResolution,omitempty"`
-
- VerticalResolution int32 `json:"VerticalResolution,omitempty"`
-
- ConnectionOptions *RdpConnectionOptions `json:"ConnectionOptions,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/virtual_machine.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/virtual_machine.go
deleted file mode 100644
index 2d22b1bcb..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/virtual_machine.go
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type VirtualMachine struct {
-
- // StopOnReset is private in the schema. If regenerated need to put back.
- StopOnReset bool `json:"StopOnReset,omitempty"`
-
- Chipset *Chipset `json:"Chipset,omitempty"`
-
- ComputeTopology *Topology `json:"ComputeTopology,omitempty"`
-
- Devices *Devices `json:"Devices,omitempty"`
-
- GuestState *GuestState `json:"GuestState,omitempty"`
-
- RestoreState *RestoreState `json:"RestoreState,omitempty"`
-
- RegistryChanges *RegistryChanges `json:"RegistryChanges,omitempty"`
-
- StorageQoS *StorageQoS `json:"StorageQoS,omitempty"`
-
- GuestConnection *GuestConnection `json:"GuestConnection,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/virtual_node_info.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/virtual_node_info.go
deleted file mode 100644
index 91a3c83d4..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/virtual_node_info.go
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type VirtualNodeInfo struct {
- VirtualNodeIndex int32 `json:"VirtualNodeIndex,omitempty"`
-
- PhysicalNodeNumber int32 `json:"PhysicalNodeNumber,omitempty"`
-
- VirtualProcessorCount int32 `json:"VirtualProcessorCount,omitempty"`
-
- MemoryUsageInPages int32 `json:"MemoryUsageInPages,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/virtual_p_mem_controller.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/virtual_p_mem_controller.go
deleted file mode 100644
index f5b7f3e38..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/virtual_p_mem_controller.go
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type VirtualPMemController struct {
- Devices map[string]VirtualPMemDevice `json:"Devices,omitempty"`
-
- MaximumCount uint32 `json:"MaximumCount,omitempty"`
-
- MaximumSizeBytes uint64 `json:"MaximumSizeBytes,omitempty"`
-
- Backing string `json:"Backing,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/virtual_p_mem_device.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/virtual_p_mem_device.go
deleted file mode 100644
index 70cf2d90d..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/virtual_p_mem_device.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type VirtualPMemDevice struct {
- HostPath string `json:"HostPath,omitempty"`
-
- ReadOnly bool `json:"ReadOnly,omitempty"`
-
- ImageFormat string `json:"ImageFormat,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/virtual_pci_device.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/virtual_pci_device.go
deleted file mode 100644
index f5e05903c..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/virtual_pci_device.go
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.3
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-// TODO: This is pre-release support in schema 2.3. Need to add build number
-// docs when a public build with this is out.
-type VirtualPciDevice struct {
- Functions []VirtualPciFunction `json:",omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/virtual_pci_function.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/virtual_pci_function.go
deleted file mode 100644
index cedb7d18b..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/virtual_pci_function.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.3
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-// TODO: This is pre-release support in schema 2.3. Need to add build number
-// docs when a public build with this is out.
-type VirtualPciFunction struct {
- DeviceInstancePath string `json:",omitempty"`
-
- VirtualFunction uint16 `json:",omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/virtual_smb.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/virtual_smb.go
deleted file mode 100644
index 362df363e..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/virtual_smb.go
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type VirtualSmb struct {
- Shares []VirtualSmbShare `json:"Shares,omitempty"`
-
- DirectFileMappingInMB int64 `json:"DirectFileMappingInMB,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/virtual_smb_share.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/virtual_smb_share.go
deleted file mode 100644
index 915e9b638..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/virtual_smb_share.go
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type VirtualSmbShare struct {
- Name string `json:"Name,omitempty"`
-
- Path string `json:"Path,omitempty"`
-
- AllowedFiles []string `json:"AllowedFiles,omitempty"`
-
- Options *VirtualSmbShareOptions `json:"Options,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/virtual_smb_share_options.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/virtual_smb_share_options.go
deleted file mode 100644
index 75196bd8c..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/virtual_smb_share_options.go
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type VirtualSmbShareOptions struct {
- ReadOnly bool `json:"ReadOnly,omitempty"`
-
- // convert exclusive access to shared read access
- ShareRead bool `json:"ShareRead,omitempty"`
-
- // all opens will use cached I/O
- CacheIo bool `json:"CacheIo,omitempty"`
-
- // disable oplock support
- NoOplocks bool `json:"NoOplocks,omitempty"`
-
- // Acquire the backup privilege when attempting to open
- TakeBackupPrivilege bool `json:"TakeBackupPrivilege,omitempty"`
-
- // Use the identity of the share root when opening
- UseShareRootIdentity bool `json:"UseShareRootIdentity,omitempty"`
-
- // disable Direct Mapping
- NoDirectmap bool `json:"NoDirectmap,omitempty"`
-
- // disable Byterange locks
- NoLocks bool `json:"NoLocks,omitempty"`
-
- // disable Directory CHange Notifications
- NoDirnotify bool `json:"NoDirnotify,omitempty"`
-
- // share is use for VM shared memory
- VmSharedMemory bool `json:"VmSharedMemory,omitempty"`
-
- // allow access only to the files specified in AllowedFiles
- RestrictFileAccess bool `json:"RestrictFileAccess,omitempty"`
-
- // disable all oplocks except Level II
- ForceLevelIIOplocks bool `json:"ForceLevelIIOplocks,omitempty"`
-
- // Allow the host to reparse this base layer
- ReparseBaseLayer bool `json:"ReparseBaseLayer,omitempty"`
-
- // Enable pseudo-oplocks
- PseudoOplocks bool `json:"PseudoOplocks,omitempty"`
-
- // All opens will use non-cached IO
- NonCacheIo bool `json:"NonCacheIo,omitempty"`
-
- // Enable pseudo directory change notifications
- PseudoDirnotify bool `json:"PseudoDirnotify,omitempty"`
-
- // Block directory enumeration, renames, and deletes.
- SingleFileMapping bool `json:"SingleFileMapping,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/vm_memory.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/vm_memory.go
deleted file mode 100644
index 8e1836dd6..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/vm_memory.go
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type VmMemory struct {
- AvailableMemory int32 `json:"AvailableMemory,omitempty"`
-
- AvailableMemoryBuffer int32 `json:"AvailableMemoryBuffer,omitempty"`
-
- ReservedMemory uint64 `json:"ReservedMemory,omitempty"`
-
- AssignedMemory uint64 `json:"AssignedMemory,omitempty"`
-
- SlpActive bool `json:"SlpActive,omitempty"`
-
- BalancingEnabled bool `json:"BalancingEnabled,omitempty"`
-
- DmOperationInProgress bool `json:"DmOperationInProgress,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/schema2/windows_crash_reporting.go b/vendor/github.com/Microsoft/hcsshim/internal/schema2/windows_crash_reporting.go
deleted file mode 100644
index 8ed7e566d..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/schema2/windows_crash_reporting.go
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * HCS API
- *
- * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
- *
- * API version: 2.1
- * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
- */
-
-package hcsschema
-
-type WindowsCrashReporting struct {
- DumpFileName string `json:"DumpFileName,omitempty"`
-
- MaxDumpSize int64 `json:"MaxDumpSize,omitempty"`
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/timeout/timeout.go b/vendor/github.com/Microsoft/hcsshim/internal/timeout/timeout.go
deleted file mode 100644
index ff3b6572e..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/timeout/timeout.go
+++ /dev/null
@@ -1,70 +0,0 @@
-package timeout
-
-import (
- "os"
- "strconv"
- "time"
-)
-
-var (
- // defaultTimeout is the timeout for most operations that is not overridden.
- defaultTimeout = 4 * time.Minute
-
- // defaultTimeoutTestdRetry is the retry loop timeout for testd to respond
- // for a disk to come online in LCOW.
- defaultTimeoutTestdRetry = 5 * time.Second
-)
-
-// External variables for HCSShim consumers to use.
-var (
- // SystemCreate is the timeout for creating a compute system
- SystemCreate time.Duration = defaultTimeout
-
- // SystemStart is the timeout for starting a compute system
- SystemStart time.Duration = defaultTimeout
-
- // SystemPause is the timeout for pausing a compute system
- SystemPause time.Duration = defaultTimeout
-
- // SystemResume is the timeout for resuming a compute system
- SystemResume time.Duration = defaultTimeout
-
- // SyscallWatcher is the timeout before warning of a potential stuck platform syscall.
- SyscallWatcher time.Duration = defaultTimeout
-
- // Tar2VHD is the timeout for the tar2vhd operation to complete
- Tar2VHD time.Duration = defaultTimeout
-
- // ExternalCommandToStart is the timeout for external commands to start
- ExternalCommandToStart = defaultTimeout
-
- // ExternalCommandToComplete is the timeout for external commands to complete.
- // Generally this means copying data from their stdio pipes.
- ExternalCommandToComplete = defaultTimeout
-
- // TestDRetryLoop is the timeout for testd retry loop when onlining a SCSI disk in LCOW
- TestDRetryLoop = defaultTimeoutTestdRetry
-)
-
-func init() {
- SystemCreate = durationFromEnvironment("HCSSHIM_TIMEOUT_SYSTEMCREATE", SystemCreate)
- SystemStart = durationFromEnvironment("HCSSHIM_TIMEOUT_SYSTEMSTART", SystemStart)
- SystemPause = durationFromEnvironment("HCSSHIM_TIMEOUT_SYSTEMPAUSE", SystemPause)
- SystemResume = durationFromEnvironment("HCSSHIM_TIMEOUT_SYSTEMRESUME", SystemResume)
- SyscallWatcher = durationFromEnvironment("HCSSHIM_TIMEOUT_SYSCALLWATCHER", SyscallWatcher)
- Tar2VHD = durationFromEnvironment("HCSSHIM_TIMEOUT_TAR2VHD", Tar2VHD)
- ExternalCommandToStart = durationFromEnvironment("HCSSHIM_TIMEOUT_EXTERNALCOMMANDSTART", ExternalCommandToStart)
- ExternalCommandToComplete = durationFromEnvironment("HCSSHIM_TIMEOUT_EXTERNALCOMMANDCOMPLETE", ExternalCommandToComplete)
- TestDRetryLoop = durationFromEnvironment("HCSSHIM_TIMEOUT_TESTDRETRYLOOP", TestDRetryLoop)
-}
-
-func durationFromEnvironment(env string, defaultValue time.Duration) time.Duration {
- envTimeout := os.Getenv(env)
- if len(envTimeout) > 0 {
- e, err := strconv.Atoi(envTimeout)
- if err == nil && e > 0 {
- return time.Second * time.Duration(e)
- }
- }
- return defaultValue
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/vmcompute/vmcompute.go b/vendor/github.com/Microsoft/hcsshim/internal/vmcompute/vmcompute.go
deleted file mode 100644
index 7c2a0dc28..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/vmcompute/vmcompute.go
+++ /dev/null
@@ -1,565 +0,0 @@
-package vmcompute
-
-import (
- gcontext "context"
- "syscall"
- "time"
-
- "github.com/Microsoft/hcsshim/internal/interop"
- "github.com/Microsoft/hcsshim/internal/log"
- "github.com/Microsoft/hcsshim/internal/logfields"
- "github.com/Microsoft/hcsshim/internal/oc"
- "github.com/Microsoft/hcsshim/internal/timeout"
- "go.opencensus.io/trace"
-)
-
-//go:generate go run ../../mksyscall_windows.go -output zsyscall_windows.go vmcompute.go
-
-//sys hcsEnumerateComputeSystems(query string, computeSystems **uint16, result **uint16) (hr error) = vmcompute.HcsEnumerateComputeSystems?
-//sys hcsCreateComputeSystem(id string, configuration string, identity syscall.Handle, computeSystem *HcsSystem, result **uint16) (hr error) = vmcompute.HcsCreateComputeSystem?
-//sys hcsOpenComputeSystem(id string, computeSystem *HcsSystem, result **uint16) (hr error) = vmcompute.HcsOpenComputeSystem?
-//sys hcsCloseComputeSystem(computeSystem HcsSystem) (hr error) = vmcompute.HcsCloseComputeSystem?
-//sys hcsStartComputeSystem(computeSystem HcsSystem, options string, result **uint16) (hr error) = vmcompute.HcsStartComputeSystem?
-//sys hcsShutdownComputeSystem(computeSystem HcsSystem, options string, result **uint16) (hr error) = vmcompute.HcsShutdownComputeSystem?
-//sys hcsTerminateComputeSystem(computeSystem HcsSystem, options string, result **uint16) (hr error) = vmcompute.HcsTerminateComputeSystem?
-//sys hcsPauseComputeSystem(computeSystem HcsSystem, options string, result **uint16) (hr error) = vmcompute.HcsPauseComputeSystem?
-//sys hcsResumeComputeSystem(computeSystem HcsSystem, options string, result **uint16) (hr error) = vmcompute.HcsResumeComputeSystem?
-//sys hcsGetComputeSystemProperties(computeSystem HcsSystem, propertyQuery string, properties **uint16, result **uint16) (hr error) = vmcompute.HcsGetComputeSystemProperties?
-//sys hcsModifyComputeSystem(computeSystem HcsSystem, configuration string, result **uint16) (hr error) = vmcompute.HcsModifyComputeSystem?
-//sys hcsRegisterComputeSystemCallback(computeSystem HcsSystem, callback uintptr, context uintptr, callbackHandle *HcsCallback) (hr error) = vmcompute.HcsRegisterComputeSystemCallback?
-//sys hcsUnregisterComputeSystemCallback(callbackHandle HcsCallback) (hr error) = vmcompute.HcsUnregisterComputeSystemCallback?
-
-//sys hcsCreateProcess(computeSystem HcsSystem, processParameters string, processInformation *HcsProcessInformation, process *HcsProcess, result **uint16) (hr error) = vmcompute.HcsCreateProcess?
-//sys hcsOpenProcess(computeSystem HcsSystem, pid uint32, process *HcsProcess, result **uint16) (hr error) = vmcompute.HcsOpenProcess?
-//sys hcsCloseProcess(process HcsProcess) (hr error) = vmcompute.HcsCloseProcess?
-//sys hcsTerminateProcess(process HcsProcess, result **uint16) (hr error) = vmcompute.HcsTerminateProcess?
-//sys hcsSignalProcess(process HcsProcess, options string, result **uint16) (hr error) = vmcompute.HcsSignalProcess?
-//sys hcsGetProcessInfo(process HcsProcess, processInformation *HcsProcessInformation, result **uint16) (hr error) = vmcompute.HcsGetProcessInfo?
-//sys hcsGetProcessProperties(process HcsProcess, processProperties **uint16, result **uint16) (hr error) = vmcompute.HcsGetProcessProperties?
-//sys hcsModifyProcess(process HcsProcess, settings string, result **uint16) (hr error) = vmcompute.HcsModifyProcess?
-//sys hcsGetServiceProperties(propertyQuery string, properties **uint16, result **uint16) (hr error) = vmcompute.HcsGetServiceProperties?
-//sys hcsRegisterProcessCallback(process HcsProcess, callback uintptr, context uintptr, callbackHandle *HcsCallback) (hr error) = vmcompute.HcsRegisterProcessCallback?
-//sys hcsUnregisterProcessCallback(callbackHandle HcsCallback) (hr error) = vmcompute.HcsUnregisterProcessCallback?
-
-// errVmcomputeOperationPending is an error encountered when the operation is being completed asynchronously
-const errVmcomputeOperationPending = syscall.Errno(0xC0370103)
-
-// HcsSystem is the handle associated with a created compute system.
-type HcsSystem syscall.Handle
-
-// HcsProcess is the handle associated with a created process in a compute
-// system.
-type HcsProcess syscall.Handle
-
-// HcsCallback is the handle associated with the function to call when events
-// occur.
-type HcsCallback syscall.Handle
-
-// HcsProcessInformation is the structure used when creating or getting process
-// info.
-type HcsProcessInformation struct {
- // ProcessId is the pid of the created process.
- ProcessId uint32
- reserved uint32
- // StdInput is the handle associated with the stdin of the process.
- StdInput syscall.Handle
- // StdOutput is the handle associated with the stdout of the process.
- StdOutput syscall.Handle
- // StdError is the handle associated with the stderr of the process.
- StdError syscall.Handle
-}
-
-func execute(ctx gcontext.Context, timeout time.Duration, f func() error) error {
- if timeout > 0 {
- var cancel gcontext.CancelFunc
- ctx, cancel = gcontext.WithTimeout(ctx, timeout)
- defer cancel()
- }
-
- done := make(chan error, 1)
- go func() {
- done <- f()
- }()
- select {
- case <-ctx.Done():
- if ctx.Err() == gcontext.DeadlineExceeded {
- log.G(ctx).WithField(logfields.Timeout, timeout).
- Warning("Syscall did not complete within operation timeout. This may indicate a platform issue. If it appears to be making no forward progress, obtain the stacks and see if there is a syscall stuck in the platform API for a significant length of time.")
- }
- return ctx.Err()
- case err := <-done:
- return err
- }
-}
-
-func HcsEnumerateComputeSystems(ctx gcontext.Context, query string) (computeSystems, result string, hr error) {
- ctx, span := trace.StartSpan(ctx, "HcsEnumerateComputeSystems")
- defer span.End()
- defer func() {
- if result != "" {
- span.AddAttributes(trace.StringAttribute("result", result))
- }
- oc.SetSpanStatus(span, hr)
- }()
- span.AddAttributes(trace.StringAttribute("query", query))
-
- return computeSystems, result, execute(ctx, timeout.SyscallWatcher, func() error {
- var (
- computeSystemsp *uint16
- resultp *uint16
- )
- err := hcsEnumerateComputeSystems(query, &computeSystemsp, &resultp)
- if computeSystemsp != nil {
- computeSystems = interop.ConvertAndFreeCoTaskMemString(computeSystemsp)
- }
- if resultp != nil {
- result = interop.ConvertAndFreeCoTaskMemString(resultp)
- }
- return err
- })
-}
-
-func HcsCreateComputeSystem(ctx gcontext.Context, id string, configuration string, identity syscall.Handle) (computeSystem HcsSystem, result string, hr error) {
- ctx, span := trace.StartSpan(ctx, "HcsCreateComputeSystem")
- defer span.End()
- defer func() {
- if result != "" {
- span.AddAttributes(trace.StringAttribute("result", result))
- }
- if hr != errVmcomputeOperationPending {
- oc.SetSpanStatus(span, hr)
- }
- }()
- span.AddAttributes(
- trace.StringAttribute("id", id),
- trace.StringAttribute("configuration", configuration))
-
- return computeSystem, result, execute(ctx, timeout.SystemCreate, func() error {
- var resultp *uint16
- err := hcsCreateComputeSystem(id, configuration, identity, &computeSystem, &resultp)
- if resultp != nil {
- result = interop.ConvertAndFreeCoTaskMemString(resultp)
- }
- return err
- })
-}
-
-func HcsOpenComputeSystem(ctx gcontext.Context, id string) (computeSystem HcsSystem, result string, hr error) {
- ctx, span := trace.StartSpan(ctx, "HcsOpenComputeSystem")
- defer span.End()
- defer func() {
- if result != "" {
- span.AddAttributes(trace.StringAttribute("result", result))
- }
- oc.SetSpanStatus(span, hr)
- }()
-
- return computeSystem, result, execute(ctx, timeout.SyscallWatcher, func() error {
- var resultp *uint16
- err := hcsOpenComputeSystem(id, &computeSystem, &resultp)
- if resultp != nil {
- result = interop.ConvertAndFreeCoTaskMemString(resultp)
- }
- return err
- })
-}
-
-func HcsCloseComputeSystem(ctx gcontext.Context, computeSystem HcsSystem) (hr error) {
- ctx, span := trace.StartSpan(ctx, "HcsCloseComputeSystem")
- defer span.End()
- defer func() { oc.SetSpanStatus(span, hr) }()
-
- return execute(ctx, timeout.SyscallWatcher, func() error {
- return hcsCloseComputeSystem(computeSystem)
- })
-}
-
-func HcsStartComputeSystem(ctx gcontext.Context, computeSystem HcsSystem, options string) (result string, hr error) {
- ctx, span := trace.StartSpan(ctx, "HcsStartComputeSystem")
- defer span.End()
- defer func() {
- if result != "" {
- span.AddAttributes(trace.StringAttribute("result", result))
- }
- if hr != errVmcomputeOperationPending {
- oc.SetSpanStatus(span, hr)
- }
- }()
- span.AddAttributes(trace.StringAttribute("options", options))
-
- return result, execute(ctx, timeout.SystemStart, func() error {
- var resultp *uint16
- err := hcsStartComputeSystem(computeSystem, options, &resultp)
- if resultp != nil {
- result = interop.ConvertAndFreeCoTaskMemString(resultp)
- }
- return err
- })
-}
-
-func HcsShutdownComputeSystem(ctx gcontext.Context, computeSystem HcsSystem, options string) (result string, hr error) {
- ctx, span := trace.StartSpan(ctx, "HcsShutdownComputeSystem")
- defer span.End()
- defer func() {
- if result != "" {
- span.AddAttributes(trace.StringAttribute("result", result))
- }
- if hr != errVmcomputeOperationPending {
- oc.SetSpanStatus(span, hr)
- }
- }()
- span.AddAttributes(trace.StringAttribute("options", options))
-
- return result, execute(ctx, timeout.SyscallWatcher, func() error {
- var resultp *uint16
- err := hcsShutdownComputeSystem(computeSystem, options, &resultp)
- if resultp != nil {
- result = interop.ConvertAndFreeCoTaskMemString(resultp)
- }
- return err
- })
-}
-
-func HcsTerminateComputeSystem(ctx gcontext.Context, computeSystem HcsSystem, options string) (result string, hr error) {
- ctx, span := trace.StartSpan(ctx, "HcsTerminateComputeSystem")
- defer span.End()
- defer func() {
- if result != "" {
- span.AddAttributes(trace.StringAttribute("result", result))
- }
- if hr != errVmcomputeOperationPending {
- oc.SetSpanStatus(span, hr)
- }
- }()
- span.AddAttributes(trace.StringAttribute("options", options))
-
- return result, execute(ctx, timeout.SyscallWatcher, func() error {
- var resultp *uint16
- err := hcsTerminateComputeSystem(computeSystem, options, &resultp)
- if resultp != nil {
- result = interop.ConvertAndFreeCoTaskMemString(resultp)
- }
- return err
- })
-}
-
-func HcsPauseComputeSystem(ctx gcontext.Context, computeSystem HcsSystem, options string) (result string, hr error) {
- ctx, span := trace.StartSpan(ctx, "HcsPauseComputeSystem")
- defer span.End()
- defer func() {
- if result != "" {
- span.AddAttributes(trace.StringAttribute("result", result))
- }
- if hr != errVmcomputeOperationPending {
- oc.SetSpanStatus(span, hr)
- }
- }()
- span.AddAttributes(trace.StringAttribute("options", options))
-
- return result, execute(ctx, timeout.SystemPause, func() error {
- var resultp *uint16
- err := hcsPauseComputeSystem(computeSystem, options, &resultp)
- if resultp != nil {
- result = interop.ConvertAndFreeCoTaskMemString(resultp)
- }
- return err
- })
-}
-
-func HcsResumeComputeSystem(ctx gcontext.Context, computeSystem HcsSystem, options string) (result string, hr error) {
- ctx, span := trace.StartSpan(ctx, "HcsResumeComputeSystem")
- defer span.End()
- defer func() {
- if result != "" {
- span.AddAttributes(trace.StringAttribute("result", result))
- }
- if hr != errVmcomputeOperationPending {
- oc.SetSpanStatus(span, hr)
- }
- }()
- span.AddAttributes(trace.StringAttribute("options", options))
-
- return result, execute(ctx, timeout.SystemResume, func() error {
- var resultp *uint16
- err := hcsResumeComputeSystem(computeSystem, options, &resultp)
- if resultp != nil {
- result = interop.ConvertAndFreeCoTaskMemString(resultp)
- }
- return err
- })
-}
-
-func HcsGetComputeSystemProperties(ctx gcontext.Context, computeSystem HcsSystem, propertyQuery string) (properties, result string, hr error) {
- ctx, span := trace.StartSpan(ctx, "HcsGetComputeSystemProperties")
- defer span.End()
- defer func() {
- if result != "" {
- span.AddAttributes(trace.StringAttribute("result", result))
- }
- oc.SetSpanStatus(span, hr)
- }()
- span.AddAttributes(trace.StringAttribute("propertyQuery", propertyQuery))
-
- return properties, result, execute(ctx, timeout.SyscallWatcher, func() error {
- var (
- propertiesp *uint16
- resultp *uint16
- )
- err := hcsGetComputeSystemProperties(computeSystem, propertyQuery, &propertiesp, &resultp)
- if propertiesp != nil {
- properties = interop.ConvertAndFreeCoTaskMemString(propertiesp)
- }
- if resultp != nil {
- result = interop.ConvertAndFreeCoTaskMemString(resultp)
- }
- return err
- })
-}
-
-func HcsModifyComputeSystem(ctx gcontext.Context, computeSystem HcsSystem, configuration string) (result string, hr error) {
- ctx, span := trace.StartSpan(ctx, "HcsModifyComputeSystem")
- defer span.End()
- defer func() {
- if result != "" {
- span.AddAttributes(trace.StringAttribute("result", result))
- }
- oc.SetSpanStatus(span, hr)
- }()
- span.AddAttributes(trace.StringAttribute("configuration", configuration))
-
- return result, execute(ctx, timeout.SyscallWatcher, func() error {
- var resultp *uint16
- err := hcsModifyComputeSystem(computeSystem, configuration, &resultp)
- if resultp != nil {
- result = interop.ConvertAndFreeCoTaskMemString(resultp)
- }
- return err
- })
-}
-
-func HcsRegisterComputeSystemCallback(ctx gcontext.Context, computeSystem HcsSystem, callback uintptr, context uintptr) (callbackHandle HcsCallback, hr error) {
- ctx, span := trace.StartSpan(ctx, "HcsRegisterComputeSystemCallback")
- defer span.End()
- defer func() { oc.SetSpanStatus(span, hr) }()
-
- return callbackHandle, execute(ctx, timeout.SyscallWatcher, func() error {
- return hcsRegisterComputeSystemCallback(computeSystem, callback, context, &callbackHandle)
- })
-}
-
-func HcsUnregisterComputeSystemCallback(ctx gcontext.Context, callbackHandle HcsCallback) (hr error) {
- ctx, span := trace.StartSpan(ctx, "HcsUnregisterComputeSystemCallback")
- defer span.End()
- defer func() { oc.SetSpanStatus(span, hr) }()
-
- return execute(ctx, timeout.SyscallWatcher, func() error {
- return hcsUnregisterComputeSystemCallback(callbackHandle)
- })
-}
-
-func HcsCreateProcess(ctx gcontext.Context, computeSystem HcsSystem, processParameters string) (processInformation HcsProcessInformation, process HcsProcess, result string, hr error) {
- ctx, span := trace.StartSpan(ctx, "HcsCreateProcess")
- defer span.End()
- defer func() {
- if result != "" {
- span.AddAttributes(trace.StringAttribute("result", result))
- }
- oc.SetSpanStatus(span, hr)
- }()
- span.AddAttributes(trace.StringAttribute("processParameters", processParameters))
-
- return processInformation, process, result, execute(ctx, timeout.SyscallWatcher, func() error {
- var resultp *uint16
- err := hcsCreateProcess(computeSystem, processParameters, &processInformation, &process, &resultp)
- if resultp != nil {
- result = interop.ConvertAndFreeCoTaskMemString(resultp)
- }
- return err
- })
-}
-
-func HcsOpenProcess(ctx gcontext.Context, computeSystem HcsSystem, pid uint32) (process HcsProcess, result string, hr error) {
- ctx, span := trace.StartSpan(ctx, "HcsOpenProcess")
- defer span.End()
- defer func() {
- if result != "" {
- span.AddAttributes(trace.StringAttribute("result", result))
- }
- oc.SetSpanStatus(span, hr)
- }()
- span.AddAttributes(trace.Int64Attribute("pid", int64(pid)))
-
- return process, result, execute(ctx, timeout.SyscallWatcher, func() error {
- var resultp *uint16
- err := hcsOpenProcess(computeSystem, pid, &process, &resultp)
- if resultp != nil {
- result = interop.ConvertAndFreeCoTaskMemString(resultp)
- }
- return err
- })
-}
-
-func HcsCloseProcess(ctx gcontext.Context, process HcsProcess) (hr error) {
- ctx, span := trace.StartSpan(ctx, "HcsCloseProcess")
- defer span.End()
- defer func() { oc.SetSpanStatus(span, hr) }()
-
- return execute(ctx, timeout.SyscallWatcher, func() error {
- return hcsCloseProcess(process)
- })
-}
-
-func HcsTerminateProcess(ctx gcontext.Context, process HcsProcess) (result string, hr error) {
- ctx, span := trace.StartSpan(ctx, "HcsTerminateProcess")
- defer span.End()
- defer func() {
- if result != "" {
- span.AddAttributes(trace.StringAttribute("result", result))
- }
- oc.SetSpanStatus(span, hr)
- }()
-
- return result, execute(ctx, timeout.SyscallWatcher, func() error {
- var resultp *uint16
- err := hcsTerminateProcess(process, &resultp)
- if resultp != nil {
- result = interop.ConvertAndFreeCoTaskMemString(resultp)
- }
- return err
- })
-}
-
-func HcsSignalProcess(ctx gcontext.Context, process HcsProcess, options string) (result string, hr error) {
- ctx, span := trace.StartSpan(ctx, "HcsSignalProcess")
- defer span.End()
- defer func() {
- if result != "" {
- span.AddAttributes(trace.StringAttribute("result", result))
- }
- oc.SetSpanStatus(span, hr)
- }()
- span.AddAttributes(trace.StringAttribute("options", options))
-
- return result, execute(ctx, timeout.SyscallWatcher, func() error {
- var resultp *uint16
- err := hcsSignalProcess(process, options, &resultp)
- if resultp != nil {
- result = interop.ConvertAndFreeCoTaskMemString(resultp)
- }
- return err
- })
-}
-
-func HcsGetProcessInfo(ctx gcontext.Context, process HcsProcess) (processInformation HcsProcessInformation, result string, hr error) {
- ctx, span := trace.StartSpan(ctx, "HcsGetProcessInfo")
- defer span.End()
- defer func() {
- if result != "" {
- span.AddAttributes(trace.StringAttribute("result", result))
- }
- oc.SetSpanStatus(span, hr)
- }()
-
- return processInformation, result, execute(ctx, timeout.SyscallWatcher, func() error {
- var resultp *uint16
- err := hcsGetProcessInfo(process, &processInformation, &resultp)
- if resultp != nil {
- result = interop.ConvertAndFreeCoTaskMemString(resultp)
- }
- return err
- })
-}
-
-func HcsGetProcessProperties(ctx gcontext.Context, process HcsProcess) (processProperties, result string, hr error) {
- ctx, span := trace.StartSpan(ctx, "HcsGetProcessProperties")
- defer span.End()
- defer func() {
- if result != "" {
- span.AddAttributes(trace.StringAttribute("result", result))
- }
- oc.SetSpanStatus(span, hr)
- }()
-
- return processProperties, result, execute(ctx, timeout.SyscallWatcher, func() error {
- var (
- processPropertiesp *uint16
- resultp *uint16
- )
- err := hcsGetProcessProperties(process, &processPropertiesp, &resultp)
- if processPropertiesp != nil {
- processProperties = interop.ConvertAndFreeCoTaskMemString(processPropertiesp)
- }
- if resultp != nil {
- result = interop.ConvertAndFreeCoTaskMemString(resultp)
- }
- return err
- })
-}
-
-func HcsModifyProcess(ctx gcontext.Context, process HcsProcess, settings string) (result string, hr error) {
- ctx, span := trace.StartSpan(ctx, "HcsModifyProcess")
- defer span.End()
- defer func() {
- if result != "" {
- span.AddAttributes(trace.StringAttribute("result", result))
- }
- oc.SetSpanStatus(span, hr)
- }()
- span.AddAttributes(trace.StringAttribute("settings", settings))
-
- return result, execute(ctx, timeout.SyscallWatcher, func() error {
- var resultp *uint16
- err := hcsModifyProcess(process, settings, &resultp)
- if resultp != nil {
- result = interop.ConvertAndFreeCoTaskMemString(resultp)
- }
- return err
- })
-}
-
-func HcsGetServiceProperties(ctx gcontext.Context, propertyQuery string) (properties, result string, hr error) {
- ctx, span := trace.StartSpan(ctx, "HcsGetServiceProperties")
- defer span.End()
- defer func() {
- if result != "" {
- span.AddAttributes(trace.StringAttribute("result", result))
- }
- oc.SetSpanStatus(span, hr)
- }()
- span.AddAttributes(trace.StringAttribute("propertyQuery", propertyQuery))
-
- return properties, result, execute(ctx, timeout.SyscallWatcher, func() error {
- var (
- propertiesp *uint16
- resultp *uint16
- )
- err := hcsGetServiceProperties(propertyQuery, &propertiesp, &resultp)
- if propertiesp != nil {
- properties = interop.ConvertAndFreeCoTaskMemString(propertiesp)
- }
- if resultp != nil {
- result = interop.ConvertAndFreeCoTaskMemString(resultp)
- }
- return err
- })
-}
-
-func HcsRegisterProcessCallback(ctx gcontext.Context, process HcsProcess, callback uintptr, context uintptr) (callbackHandle HcsCallback, hr error) {
- ctx, span := trace.StartSpan(ctx, "HcsRegisterProcessCallback")
- defer span.End()
- defer func() { oc.SetSpanStatus(span, hr) }()
-
- return callbackHandle, execute(ctx, timeout.SyscallWatcher, func() error {
- return hcsRegisterProcessCallback(process, callback, context, &callbackHandle)
- })
-}
-
-func HcsUnregisterProcessCallback(ctx gcontext.Context, callbackHandle HcsCallback) (hr error) {
- ctx, span := trace.StartSpan(ctx, "HcsUnregisterProcessCallback")
- defer span.End()
- defer func() { oc.SetSpanStatus(span, hr) }()
-
- return execute(ctx, timeout.SyscallWatcher, func() error {
- return hcsUnregisterProcessCallback(callbackHandle)
- })
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/vmcompute/zsyscall_windows.go b/vendor/github.com/Microsoft/hcsshim/internal/vmcompute/zsyscall_windows.go
deleted file mode 100644
index 0f2a69f6a..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/vmcompute/zsyscall_windows.go
+++ /dev/null
@@ -1,533 +0,0 @@
-// Code generated mksyscall_windows.exe DO NOT EDIT
-
-package vmcompute
-
-import (
- "syscall"
- "unsafe"
-
- "golang.org/x/sys/windows"
-)
-
-var _ unsafe.Pointer
-
-// Do the interface allocations only once for common
-// Errno values.
-const (
- errnoERROR_IO_PENDING = 997
-)
-
-var (
- errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING)
-)
-
-// errnoErr returns common boxed Errno values, to prevent
-// allocations at runtime.
-func errnoErr(e syscall.Errno) error {
- switch e {
- case 0:
- return nil
- case errnoERROR_IO_PENDING:
- return errERROR_IO_PENDING
- }
- // TODO: add more here, after collecting data on the common
- // error values see on Windows. (perhaps when running
- // all.bat?)
- return e
-}
-
-var (
- modvmcompute = windows.NewLazySystemDLL("vmcompute.dll")
-
- procHcsEnumerateComputeSystems = modvmcompute.NewProc("HcsEnumerateComputeSystems")
- procHcsCreateComputeSystem = modvmcompute.NewProc("HcsCreateComputeSystem")
- procHcsOpenComputeSystem = modvmcompute.NewProc("HcsOpenComputeSystem")
- procHcsCloseComputeSystem = modvmcompute.NewProc("HcsCloseComputeSystem")
- procHcsStartComputeSystem = modvmcompute.NewProc("HcsStartComputeSystem")
- procHcsShutdownComputeSystem = modvmcompute.NewProc("HcsShutdownComputeSystem")
- procHcsTerminateComputeSystem = modvmcompute.NewProc("HcsTerminateComputeSystem")
- procHcsPauseComputeSystem = modvmcompute.NewProc("HcsPauseComputeSystem")
- procHcsResumeComputeSystem = modvmcompute.NewProc("HcsResumeComputeSystem")
- procHcsGetComputeSystemProperties = modvmcompute.NewProc("HcsGetComputeSystemProperties")
- procHcsModifyComputeSystem = modvmcompute.NewProc("HcsModifyComputeSystem")
- procHcsRegisterComputeSystemCallback = modvmcompute.NewProc("HcsRegisterComputeSystemCallback")
- procHcsUnregisterComputeSystemCallback = modvmcompute.NewProc("HcsUnregisterComputeSystemCallback")
- procHcsCreateProcess = modvmcompute.NewProc("HcsCreateProcess")
- procHcsOpenProcess = modvmcompute.NewProc("HcsOpenProcess")
- procHcsCloseProcess = modvmcompute.NewProc("HcsCloseProcess")
- procHcsTerminateProcess = modvmcompute.NewProc("HcsTerminateProcess")
- procHcsSignalProcess = modvmcompute.NewProc("HcsSignalProcess")
- procHcsGetProcessInfo = modvmcompute.NewProc("HcsGetProcessInfo")
- procHcsGetProcessProperties = modvmcompute.NewProc("HcsGetProcessProperties")
- procHcsModifyProcess = modvmcompute.NewProc("HcsModifyProcess")
- procHcsGetServiceProperties = modvmcompute.NewProc("HcsGetServiceProperties")
- procHcsRegisterProcessCallback = modvmcompute.NewProc("HcsRegisterProcessCallback")
- procHcsUnregisterProcessCallback = modvmcompute.NewProc("HcsUnregisterProcessCallback")
-)
-
-func hcsEnumerateComputeSystems(query string, computeSystems **uint16, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(query)
- if hr != nil {
- return
- }
- return _hcsEnumerateComputeSystems(_p0, computeSystems, result)
-}
-
-func _hcsEnumerateComputeSystems(query *uint16, computeSystems **uint16, result **uint16) (hr error) {
- if hr = procHcsEnumerateComputeSystems.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcsEnumerateComputeSystems.Addr(), 3, uintptr(unsafe.Pointer(query)), uintptr(unsafe.Pointer(computeSystems)), uintptr(unsafe.Pointer(result)))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcsCreateComputeSystem(id string, configuration string, identity syscall.Handle, computeSystem *HcsSystem, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(id)
- if hr != nil {
- return
- }
- var _p1 *uint16
- _p1, hr = syscall.UTF16PtrFromString(configuration)
- if hr != nil {
- return
- }
- return _hcsCreateComputeSystem(_p0, _p1, identity, computeSystem, result)
-}
-
-func _hcsCreateComputeSystem(id *uint16, configuration *uint16, identity syscall.Handle, computeSystem *HcsSystem, result **uint16) (hr error) {
- if hr = procHcsCreateComputeSystem.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall6(procHcsCreateComputeSystem.Addr(), 5, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(configuration)), uintptr(identity), uintptr(unsafe.Pointer(computeSystem)), uintptr(unsafe.Pointer(result)), 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcsOpenComputeSystem(id string, computeSystem *HcsSystem, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(id)
- if hr != nil {
- return
- }
- return _hcsOpenComputeSystem(_p0, computeSystem, result)
-}
-
-func _hcsOpenComputeSystem(id *uint16, computeSystem *HcsSystem, result **uint16) (hr error) {
- if hr = procHcsOpenComputeSystem.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcsOpenComputeSystem.Addr(), 3, uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(computeSystem)), uintptr(unsafe.Pointer(result)))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcsCloseComputeSystem(computeSystem HcsSystem) (hr error) {
- if hr = procHcsCloseComputeSystem.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcsCloseComputeSystem.Addr(), 1, uintptr(computeSystem), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcsStartComputeSystem(computeSystem HcsSystem, options string, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(options)
- if hr != nil {
- return
- }
- return _hcsStartComputeSystem(computeSystem, _p0, result)
-}
-
-func _hcsStartComputeSystem(computeSystem HcsSystem, options *uint16, result **uint16) (hr error) {
- if hr = procHcsStartComputeSystem.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcsStartComputeSystem.Addr(), 3, uintptr(computeSystem), uintptr(unsafe.Pointer(options)), uintptr(unsafe.Pointer(result)))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcsShutdownComputeSystem(computeSystem HcsSystem, options string, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(options)
- if hr != nil {
- return
- }
- return _hcsShutdownComputeSystem(computeSystem, _p0, result)
-}
-
-func _hcsShutdownComputeSystem(computeSystem HcsSystem, options *uint16, result **uint16) (hr error) {
- if hr = procHcsShutdownComputeSystem.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcsShutdownComputeSystem.Addr(), 3, uintptr(computeSystem), uintptr(unsafe.Pointer(options)), uintptr(unsafe.Pointer(result)))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcsTerminateComputeSystem(computeSystem HcsSystem, options string, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(options)
- if hr != nil {
- return
- }
- return _hcsTerminateComputeSystem(computeSystem, _p0, result)
-}
-
-func _hcsTerminateComputeSystem(computeSystem HcsSystem, options *uint16, result **uint16) (hr error) {
- if hr = procHcsTerminateComputeSystem.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcsTerminateComputeSystem.Addr(), 3, uintptr(computeSystem), uintptr(unsafe.Pointer(options)), uintptr(unsafe.Pointer(result)))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcsPauseComputeSystem(computeSystem HcsSystem, options string, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(options)
- if hr != nil {
- return
- }
- return _hcsPauseComputeSystem(computeSystem, _p0, result)
-}
-
-func _hcsPauseComputeSystem(computeSystem HcsSystem, options *uint16, result **uint16) (hr error) {
- if hr = procHcsPauseComputeSystem.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcsPauseComputeSystem.Addr(), 3, uintptr(computeSystem), uintptr(unsafe.Pointer(options)), uintptr(unsafe.Pointer(result)))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcsResumeComputeSystem(computeSystem HcsSystem, options string, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(options)
- if hr != nil {
- return
- }
- return _hcsResumeComputeSystem(computeSystem, _p0, result)
-}
-
-func _hcsResumeComputeSystem(computeSystem HcsSystem, options *uint16, result **uint16) (hr error) {
- if hr = procHcsResumeComputeSystem.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcsResumeComputeSystem.Addr(), 3, uintptr(computeSystem), uintptr(unsafe.Pointer(options)), uintptr(unsafe.Pointer(result)))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcsGetComputeSystemProperties(computeSystem HcsSystem, propertyQuery string, properties **uint16, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(propertyQuery)
- if hr != nil {
- return
- }
- return _hcsGetComputeSystemProperties(computeSystem, _p0, properties, result)
-}
-
-func _hcsGetComputeSystemProperties(computeSystem HcsSystem, propertyQuery *uint16, properties **uint16, result **uint16) (hr error) {
- if hr = procHcsGetComputeSystemProperties.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall6(procHcsGetComputeSystemProperties.Addr(), 4, uintptr(computeSystem), uintptr(unsafe.Pointer(propertyQuery)), uintptr(unsafe.Pointer(properties)), uintptr(unsafe.Pointer(result)), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcsModifyComputeSystem(computeSystem HcsSystem, configuration string, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(configuration)
- if hr != nil {
- return
- }
- return _hcsModifyComputeSystem(computeSystem, _p0, result)
-}
-
-func _hcsModifyComputeSystem(computeSystem HcsSystem, configuration *uint16, result **uint16) (hr error) {
- if hr = procHcsModifyComputeSystem.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcsModifyComputeSystem.Addr(), 3, uintptr(computeSystem), uintptr(unsafe.Pointer(configuration)), uintptr(unsafe.Pointer(result)))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcsRegisterComputeSystemCallback(computeSystem HcsSystem, callback uintptr, context uintptr, callbackHandle *HcsCallback) (hr error) {
- if hr = procHcsRegisterComputeSystemCallback.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall6(procHcsRegisterComputeSystemCallback.Addr(), 4, uintptr(computeSystem), uintptr(callback), uintptr(context), uintptr(unsafe.Pointer(callbackHandle)), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcsUnregisterComputeSystemCallback(callbackHandle HcsCallback) (hr error) {
- if hr = procHcsUnregisterComputeSystemCallback.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcsUnregisterComputeSystemCallback.Addr(), 1, uintptr(callbackHandle), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcsCreateProcess(computeSystem HcsSystem, processParameters string, processInformation *HcsProcessInformation, process *HcsProcess, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(processParameters)
- if hr != nil {
- return
- }
- return _hcsCreateProcess(computeSystem, _p0, processInformation, process, result)
-}
-
-func _hcsCreateProcess(computeSystem HcsSystem, processParameters *uint16, processInformation *HcsProcessInformation, process *HcsProcess, result **uint16) (hr error) {
- if hr = procHcsCreateProcess.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall6(procHcsCreateProcess.Addr(), 5, uintptr(computeSystem), uintptr(unsafe.Pointer(processParameters)), uintptr(unsafe.Pointer(processInformation)), uintptr(unsafe.Pointer(process)), uintptr(unsafe.Pointer(result)), 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcsOpenProcess(computeSystem HcsSystem, pid uint32, process *HcsProcess, result **uint16) (hr error) {
- if hr = procHcsOpenProcess.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall6(procHcsOpenProcess.Addr(), 4, uintptr(computeSystem), uintptr(pid), uintptr(unsafe.Pointer(process)), uintptr(unsafe.Pointer(result)), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcsCloseProcess(process HcsProcess) (hr error) {
- if hr = procHcsCloseProcess.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcsCloseProcess.Addr(), 1, uintptr(process), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcsTerminateProcess(process HcsProcess, result **uint16) (hr error) {
- if hr = procHcsTerminateProcess.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcsTerminateProcess.Addr(), 2, uintptr(process), uintptr(unsafe.Pointer(result)), 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcsSignalProcess(process HcsProcess, options string, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(options)
- if hr != nil {
- return
- }
- return _hcsSignalProcess(process, _p0, result)
-}
-
-func _hcsSignalProcess(process HcsProcess, options *uint16, result **uint16) (hr error) {
- if hr = procHcsSignalProcess.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcsSignalProcess.Addr(), 3, uintptr(process), uintptr(unsafe.Pointer(options)), uintptr(unsafe.Pointer(result)))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcsGetProcessInfo(process HcsProcess, processInformation *HcsProcessInformation, result **uint16) (hr error) {
- if hr = procHcsGetProcessInfo.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcsGetProcessInfo.Addr(), 3, uintptr(process), uintptr(unsafe.Pointer(processInformation)), uintptr(unsafe.Pointer(result)))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcsGetProcessProperties(process HcsProcess, processProperties **uint16, result **uint16) (hr error) {
- if hr = procHcsGetProcessProperties.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcsGetProcessProperties.Addr(), 3, uintptr(process), uintptr(unsafe.Pointer(processProperties)), uintptr(unsafe.Pointer(result)))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcsModifyProcess(process HcsProcess, settings string, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(settings)
- if hr != nil {
- return
- }
- return _hcsModifyProcess(process, _p0, result)
-}
-
-func _hcsModifyProcess(process HcsProcess, settings *uint16, result **uint16) (hr error) {
- if hr = procHcsModifyProcess.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcsModifyProcess.Addr(), 3, uintptr(process), uintptr(unsafe.Pointer(settings)), uintptr(unsafe.Pointer(result)))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcsGetServiceProperties(propertyQuery string, properties **uint16, result **uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(propertyQuery)
- if hr != nil {
- return
- }
- return _hcsGetServiceProperties(_p0, properties, result)
-}
-
-func _hcsGetServiceProperties(propertyQuery *uint16, properties **uint16, result **uint16) (hr error) {
- if hr = procHcsGetServiceProperties.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcsGetServiceProperties.Addr(), 3, uintptr(unsafe.Pointer(propertyQuery)), uintptr(unsafe.Pointer(properties)), uintptr(unsafe.Pointer(result)))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcsRegisterProcessCallback(process HcsProcess, callback uintptr, context uintptr, callbackHandle *HcsCallback) (hr error) {
- if hr = procHcsRegisterProcessCallback.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall6(procHcsRegisterProcessCallback.Addr(), 4, uintptr(process), uintptr(callback), uintptr(context), uintptr(unsafe.Pointer(callbackHandle)), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func hcsUnregisterProcessCallback(callbackHandle HcsCallback) (hr error) {
- if hr = procHcsUnregisterProcessCallback.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procHcsUnregisterProcessCallback.Addr(), 1, uintptr(callbackHandle), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/activatelayer.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/activatelayer.go
deleted file mode 100644
index 81e454956..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/activatelayer.go
+++ /dev/null
@@ -1,27 +0,0 @@
-package wclayer
-
-import (
- "context"
-
- "github.com/Microsoft/hcsshim/internal/hcserror"
- "github.com/Microsoft/hcsshim/internal/oc"
- "go.opencensus.io/trace"
-)
-
-// ActivateLayer will find the layer with the given id and mount it's filesystem.
-// For a read/write layer, the mounted filesystem will appear as a volume on the
-// host, while a read-only layer is generally expected to be a no-op.
-// An activated layer must later be deactivated via DeactivateLayer.
-func ActivateLayer(ctx context.Context, path string) (err error) {
- title := "hcsshim::ActivateLayer"
- ctx, span := trace.StartSpan(ctx, title)
- defer span.End()
- defer func() { oc.SetSpanStatus(span, err) }()
- span.AddAttributes(trace.StringAttribute("path", path))
-
- err = activateLayer(&stdDriverInfo, path)
- if err != nil {
- return hcserror.New(err, title+" - failed", "")
- }
- return nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/baselayer.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/baselayer.go
deleted file mode 100644
index f907a7044..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/baselayer.go
+++ /dev/null
@@ -1,182 +0,0 @@
-package wclayer
-
-import (
- "context"
- "errors"
- "os"
- "path/filepath"
- "syscall"
-
- "github.com/Microsoft/go-winio"
- "github.com/Microsoft/hcsshim/internal/hcserror"
- "github.com/Microsoft/hcsshim/internal/oc"
- "github.com/Microsoft/hcsshim/internal/safefile"
- "go.opencensus.io/trace"
-)
-
-type baseLayerWriter struct {
- ctx context.Context
- s *trace.Span
-
- root *os.File
- f *os.File
- bw *winio.BackupFileWriter
- err error
- hasUtilityVM bool
- dirInfo []dirInfo
-}
-
-type dirInfo struct {
- path string
- fileInfo winio.FileBasicInfo
-}
-
-// reapplyDirectoryTimes reapplies directory modification, creation, etc. times
-// after processing of the directory tree has completed. The times are expected
-// to be ordered such that parent directories come before child directories.
-func reapplyDirectoryTimes(root *os.File, dis []dirInfo) error {
- for i := range dis {
- di := &dis[len(dis)-i-1] // reverse order: process child directories first
- f, err := safefile.OpenRelative(di.path, root, syscall.GENERIC_READ|syscall.GENERIC_WRITE, syscall.FILE_SHARE_READ, safefile.FILE_OPEN, safefile.FILE_DIRECTORY_FILE)
- if err != nil {
- return err
- }
-
- err = winio.SetFileBasicInfo(f, &di.fileInfo)
- f.Close()
- if err != nil {
- return err
- }
- }
- return nil
-}
-
-func (w *baseLayerWriter) closeCurrentFile() error {
- if w.f != nil {
- err := w.bw.Close()
- err2 := w.f.Close()
- w.f = nil
- w.bw = nil
- if err != nil {
- return err
- }
- if err2 != nil {
- return err2
- }
- }
- return nil
-}
-
-func (w *baseLayerWriter) Add(name string, fileInfo *winio.FileBasicInfo) (err error) {
- defer func() {
- if err != nil {
- w.err = err
- }
- }()
-
- err = w.closeCurrentFile()
- if err != nil {
- return err
- }
-
- if filepath.ToSlash(name) == `UtilityVM/Files` {
- w.hasUtilityVM = true
- }
-
- var f *os.File
- defer func() {
- if f != nil {
- f.Close()
- }
- }()
-
- extraFlags := uint32(0)
- if fileInfo.FileAttributes&syscall.FILE_ATTRIBUTE_DIRECTORY != 0 {
- extraFlags |= safefile.FILE_DIRECTORY_FILE
- if fileInfo.FileAttributes&syscall.FILE_ATTRIBUTE_REPARSE_POINT == 0 {
- w.dirInfo = append(w.dirInfo, dirInfo{name, *fileInfo})
- }
- }
-
- mode := uint32(syscall.GENERIC_READ | syscall.GENERIC_WRITE | winio.WRITE_DAC | winio.WRITE_OWNER | winio.ACCESS_SYSTEM_SECURITY)
- f, err = safefile.OpenRelative(name, w.root, mode, syscall.FILE_SHARE_READ, safefile.FILE_CREATE, extraFlags)
- if err != nil {
- return hcserror.New(err, "Failed to safefile.OpenRelative", name)
- }
-
- err = winio.SetFileBasicInfo(f, fileInfo)
- if err != nil {
- return hcserror.New(err, "Failed to SetFileBasicInfo", name)
- }
-
- w.f = f
- w.bw = winio.NewBackupFileWriter(f, true)
- f = nil
- return nil
-}
-
-func (w *baseLayerWriter) AddLink(name string, target string) (err error) {
- defer func() {
- if err != nil {
- w.err = err
- }
- }()
-
- err = w.closeCurrentFile()
- if err != nil {
- return err
- }
-
- return safefile.LinkRelative(target, w.root, name, w.root)
-}
-
-func (w *baseLayerWriter) Remove(name string) error {
- return errors.New("base layer cannot have tombstones")
-}
-
-func (w *baseLayerWriter) Write(b []byte) (int, error) {
- n, err := w.bw.Write(b)
- if err != nil {
- w.err = err
- }
- return n, err
-}
-
-func (w *baseLayerWriter) Close() (err error) {
- defer w.s.End()
- defer func() { oc.SetSpanStatus(w.s, err) }()
- defer func() {
- w.root.Close()
- w.root = nil
- }()
-
- err = w.closeCurrentFile()
- if err != nil {
- return err
- }
- if w.err == nil {
- // Restore the file times of all the directories, since they may have
- // been modified by creating child directories.
- err = reapplyDirectoryTimes(w.root, w.dirInfo)
- if err != nil {
- return err
- }
-
- err = ProcessBaseLayer(w.ctx, w.root.Name())
- if err != nil {
- return err
- }
-
- if w.hasUtilityVM {
- err := safefile.EnsureNotReparsePointRelative("UtilityVM", w.root)
- if err != nil {
- return err
- }
- err = ProcessUtilityVMImage(w.ctx, filepath.Join(w.root.Name(), "UtilityVM"))
- if err != nil {
- return err
- }
- }
- }
- return w.err
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/createlayer.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/createlayer.go
deleted file mode 100644
index 41e5e6731..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/createlayer.go
+++ /dev/null
@@ -1,27 +0,0 @@
-package wclayer
-
-import (
- "context"
-
- "github.com/Microsoft/hcsshim/internal/hcserror"
- "github.com/Microsoft/hcsshim/internal/oc"
- "go.opencensus.io/trace"
-)
-
-// CreateLayer creates a new, empty, read-only layer on the filesystem based on
-// the parent layer provided.
-func CreateLayer(ctx context.Context, path, parent string) (err error) {
- title := "hcsshim::CreateLayer"
- ctx, span := trace.StartSpan(ctx, title)
- defer span.End()
- defer func() { oc.SetSpanStatus(span, err) }()
- span.AddAttributes(
- trace.StringAttribute("path", path),
- trace.StringAttribute("parent", parent))
-
- err = createLayer(&stdDriverInfo, path, parent)
- if err != nil {
- return hcserror.New(err, title+" - failed", "")
- }
- return nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/createscratchlayer.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/createscratchlayer.go
deleted file mode 100644
index e3ff952a7..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/createscratchlayer.go
+++ /dev/null
@@ -1,36 +0,0 @@
-package wclayer
-
-import (
- "context"
- "strings"
-
- "github.com/Microsoft/hcsshim/internal/hcserror"
- "github.com/Microsoft/hcsshim/internal/oc"
- "go.opencensus.io/trace"
-)
-
-// CreateScratchLayer creates and populates new read-write layer for use by a container.
-// This requires both the id of the direct parent layer, as well as the full list
-// of paths to all parent layers up to the base (and including the direct parent
-// whose id was provided).
-func CreateScratchLayer(ctx context.Context, path string, parentLayerPaths []string) (err error) {
- title := "hcsshim::CreateScratchLayer"
- ctx, span := trace.StartSpan(ctx, title)
- defer span.End()
- defer func() { oc.SetSpanStatus(span, err) }()
- span.AddAttributes(
- trace.StringAttribute("path", path),
- trace.StringAttribute("parentLayerPaths", strings.Join(parentLayerPaths, ", ")))
-
- // Generate layer descriptors
- layers, err := layerPathsToDescriptors(ctx, parentLayerPaths)
- if err != nil {
- return err
- }
-
- err = createSandboxLayer(&stdDriverInfo, path, 0, layers)
- if err != nil {
- return hcserror.New(err, title+" - failed", "")
- }
- return nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/deactivatelayer.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/deactivatelayer.go
deleted file mode 100644
index 70a711cf5..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/deactivatelayer.go
+++ /dev/null
@@ -1,24 +0,0 @@
-package wclayer
-
-import (
- "context"
-
- "github.com/Microsoft/hcsshim/internal/hcserror"
- "github.com/Microsoft/hcsshim/internal/oc"
- "go.opencensus.io/trace"
-)
-
-// DeactivateLayer will dismount a layer that was mounted via ActivateLayer.
-func DeactivateLayer(ctx context.Context, path string) (err error) {
- title := "hcsshim::DeactivateLayer"
- ctx, span := trace.StartSpan(ctx, title)
- defer span.End()
- defer func() { oc.SetSpanStatus(span, err) }()
- span.AddAttributes(trace.StringAttribute("path", path))
-
- err = deactivateLayer(&stdDriverInfo, path)
- if err != nil {
- return hcserror.New(err, title+"- failed", "")
- }
- return nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/destroylayer.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/destroylayer.go
deleted file mode 100644
index bf197e3b0..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/destroylayer.go
+++ /dev/null
@@ -1,25 +0,0 @@
-package wclayer
-
-import (
- "context"
-
- "github.com/Microsoft/hcsshim/internal/hcserror"
- "github.com/Microsoft/hcsshim/internal/oc"
- "go.opencensus.io/trace"
-)
-
-// DestroyLayer will remove the on-disk files representing the layer with the given
-// path, including that layer's containing folder, if any.
-func DestroyLayer(ctx context.Context, path string) (err error) {
- title := "hcsshim::DestroyLayer"
- ctx, span := trace.StartSpan(ctx, title)
- defer span.End()
- defer func() { oc.SetSpanStatus(span, err) }()
- span.AddAttributes(trace.StringAttribute("path", path))
-
- err = destroyLayer(&stdDriverInfo, path)
- if err != nil {
- return hcserror.New(err, title+" - failed", "")
- }
- return nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/expandscratchsize.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/expandscratchsize.go
deleted file mode 100644
index 93f27da8a..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/expandscratchsize.go
+++ /dev/null
@@ -1,140 +0,0 @@
-package wclayer
-
-import (
- "context"
- "os"
- "path/filepath"
- "syscall"
- "unsafe"
-
- "github.com/Microsoft/hcsshim/internal/hcserror"
- "github.com/Microsoft/hcsshim/internal/oc"
- "github.com/Microsoft/hcsshim/osversion"
- "go.opencensus.io/trace"
-)
-
-// ExpandScratchSize expands the size of a layer to at least size bytes.
-func ExpandScratchSize(ctx context.Context, path string, size uint64) (err error) {
- title := "hcsshim::ExpandScratchSize"
- ctx, span := trace.StartSpan(ctx, title)
- defer span.End()
- defer func() { oc.SetSpanStatus(span, err) }()
- span.AddAttributes(
- trace.StringAttribute("path", path),
- trace.Int64Attribute("size", int64(size)))
-
- err = expandSandboxSize(&stdDriverInfo, path, size)
- if err != nil {
- return hcserror.New(err, title+" - failed", "")
- }
-
- // Manually expand the volume now in order to work around bugs in 19H1 and
- // prerelease versions of Vb. Remove once this is fixed in Windows.
- if build := osversion.Get().Build; build >= osversion.V19H1 && build < 19020 {
- err = expandSandboxVolume(ctx, path)
- if err != nil {
- return err
- }
- }
- return nil
-}
-
-type virtualStorageType struct {
- DeviceID uint32
- VendorID [16]byte
-}
-
-type openVersion2 struct {
- GetInfoOnly int32 // bool but 4-byte aligned
- ReadOnly int32 // bool but 4-byte aligned
- ResiliencyGUID [16]byte // GUID
-}
-
-type openVirtualDiskParameters struct {
- Version uint32 // Must always be set to 2
- Version2 openVersion2
-}
-
-func attachVhd(path string) (syscall.Handle, error) {
- var (
- defaultType virtualStorageType
- handle syscall.Handle
- )
- parameters := openVirtualDiskParameters{Version: 2}
- err := openVirtualDisk(
- &defaultType,
- path,
- 0,
- 0,
- ¶meters,
- &handle)
- if err != nil {
- return 0, &os.PathError{Op: "OpenVirtualDisk", Path: path, Err: err}
- }
- err = attachVirtualDisk(handle, 0, 0, 0, 0, 0)
- if err != nil {
- syscall.Close(handle)
- return 0, &os.PathError{Op: "AttachVirtualDisk", Path: path, Err: err}
- }
- return handle, nil
-}
-
-func expandSandboxVolume(ctx context.Context, path string) error {
- // Mount the sandbox VHD temporarily.
- vhdPath := filepath.Join(path, "sandbox.vhdx")
- vhd, err := attachVhd(vhdPath)
- if err != nil {
- return &os.PathError{Op: "OpenVirtualDisk", Path: vhdPath, Err: err}
- }
- defer syscall.Close(vhd)
-
- // Open the volume.
- volumePath, err := GetLayerMountPath(ctx, path)
- if err != nil {
- return err
- }
- if volumePath[len(volumePath)-1] == '\\' {
- volumePath = volumePath[:len(volumePath)-1]
- }
- volume, err := os.OpenFile(volumePath, os.O_RDWR, 0)
- if err != nil {
- return err
- }
- defer volume.Close()
-
- // Get the volume's underlying partition size in NTFS clusters.
- var (
- partitionSize int64
- bytes uint32
- )
- const _IOCTL_DISK_GET_LENGTH_INFO = 0x0007405C
- err = syscall.DeviceIoControl(syscall.Handle(volume.Fd()), _IOCTL_DISK_GET_LENGTH_INFO, nil, 0, (*byte)(unsafe.Pointer(&partitionSize)), 8, &bytes, nil)
- if err != nil {
- return &os.PathError{Op: "IOCTL_DISK_GET_LENGTH_INFO", Path: volume.Name(), Err: err}
- }
- const (
- clusterSize = 4096
- sectorSize = 512
- )
- targetClusters := partitionSize / clusterSize
-
- // Get the volume's current size in NTFS clusters.
- var volumeSize int64
- err = getDiskFreeSpaceEx(volume.Name()+"\\", nil, &volumeSize, nil)
- if err != nil {
- return &os.PathError{Op: "GetDiskFreeSpaceEx", Path: volume.Name(), Err: err}
- }
- volumeClusters := volumeSize / clusterSize
-
- // Only resize the volume if there is space to grow, otherwise this will
- // fail with invalid parameter. NTFS reserves one cluster.
- if volumeClusters+1 < targetClusters {
- targetSectors := targetClusters * (clusterSize / sectorSize)
- const _FSCTL_EXTEND_VOLUME = 0x000900F0
- err = syscall.DeviceIoControl(syscall.Handle(volume.Fd()), _FSCTL_EXTEND_VOLUME, (*byte)(unsafe.Pointer(&targetSectors)), 8, nil, 0, &bytes, nil)
- if err != nil {
- return &os.PathError{Op: "FSCTL_EXTEND_VOLUME", Path: volume.Name(), Err: err}
- }
- }
- return nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/exportlayer.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/exportlayer.go
deleted file mode 100644
index 09f0de1a4..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/exportlayer.go
+++ /dev/null
@@ -1,94 +0,0 @@
-package wclayer
-
-import (
- "context"
- "io/ioutil"
- "os"
- "strings"
-
- "github.com/Microsoft/go-winio"
- "github.com/Microsoft/hcsshim/internal/hcserror"
- "github.com/Microsoft/hcsshim/internal/oc"
- "go.opencensus.io/trace"
-)
-
-// ExportLayer will create a folder at exportFolderPath and fill that folder with
-// the transport format version of the layer identified by layerId. This transport
-// format includes any metadata required for later importing the layer (using
-// ImportLayer), and requires the full list of parent layer paths in order to
-// perform the export.
-func ExportLayer(ctx context.Context, path string, exportFolderPath string, parentLayerPaths []string) (err error) {
- title := "hcsshim::ExportLayer"
- ctx, span := trace.StartSpan(ctx, title)
- defer span.End()
- defer func() { oc.SetSpanStatus(span, err) }()
- span.AddAttributes(
- trace.StringAttribute("path", path),
- trace.StringAttribute("exportFolderPath", exportFolderPath),
- trace.StringAttribute("parentLayerPaths", strings.Join(parentLayerPaths, ", ")))
-
- // Generate layer descriptors
- layers, err := layerPathsToDescriptors(ctx, parentLayerPaths)
- if err != nil {
- return err
- }
-
- err = exportLayer(&stdDriverInfo, path, exportFolderPath, layers)
- if err != nil {
- return hcserror.New(err, title+" - failed", "")
- }
- return nil
-}
-
-type LayerReader interface {
- Next() (string, int64, *winio.FileBasicInfo, error)
- Read(b []byte) (int, error)
- Close() error
-}
-
-// NewLayerReader returns a new layer reader for reading the contents of an on-disk layer.
-// The caller must have taken the SeBackupPrivilege privilege
-// to call this and any methods on the resulting LayerReader.
-func NewLayerReader(ctx context.Context, path string, parentLayerPaths []string) (_ LayerReader, err error) {
- ctx, span := trace.StartSpan(ctx, "hcsshim::NewLayerReader")
- defer func() {
- if err != nil {
- oc.SetSpanStatus(span, err)
- span.End()
- }
- }()
- span.AddAttributes(
- trace.StringAttribute("path", path),
- trace.StringAttribute("parentLayerPaths", strings.Join(parentLayerPaths, ", ")))
-
- exportPath, err := ioutil.TempDir("", "hcs")
- if err != nil {
- return nil, err
- }
- err = ExportLayer(ctx, path, exportPath, parentLayerPaths)
- if err != nil {
- os.RemoveAll(exportPath)
- return nil, err
- }
- return &legacyLayerReaderWrapper{
- ctx: ctx,
- s: span,
- legacyLayerReader: newLegacyLayerReader(exportPath),
- }, nil
-}
-
-type legacyLayerReaderWrapper struct {
- ctx context.Context
- s *trace.Span
-
- *legacyLayerReader
-}
-
-func (r *legacyLayerReaderWrapper) Close() (err error) {
- defer r.s.End()
- defer func() { oc.SetSpanStatus(r.s, err) }()
-
- err = r.legacyLayerReader.Close()
- os.RemoveAll(r.root)
- return err
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/getlayermountpath.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/getlayermountpath.go
deleted file mode 100644
index 942e3bbf9..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/getlayermountpath.go
+++ /dev/null
@@ -1,51 +0,0 @@
-package wclayer
-
-import (
- "context"
- "syscall"
-
- "github.com/Microsoft/hcsshim/internal/hcserror"
- "github.com/Microsoft/hcsshim/internal/log"
- "github.com/Microsoft/hcsshim/internal/oc"
- "go.opencensus.io/trace"
-)
-
-// GetLayerMountPath will look for a mounted layer with the given path and return
-// the path at which that layer can be accessed. This path may be a volume path
-// if the layer is a mounted read-write layer, otherwise it is expected to be the
-// folder path at which the layer is stored.
-func GetLayerMountPath(ctx context.Context, path string) (_ string, err error) {
- title := "hcsshim::GetLayerMountPath"
- ctx, span := trace.StartSpan(ctx, title)
- defer span.End()
- defer func() { oc.SetSpanStatus(span, err) }()
- span.AddAttributes(trace.StringAttribute("path", path))
-
- var mountPathLength uintptr
- mountPathLength = 0
-
- // Call the procedure itself.
- log.G(ctx).Debug("Calling proc (1)")
- err = getLayerMountPath(&stdDriverInfo, path, &mountPathLength, nil)
- if err != nil {
- return "", hcserror.New(err, title+" - failed", "(first call)")
- }
-
- // Allocate a mount path of the returned length.
- if mountPathLength == 0 {
- return "", nil
- }
- mountPathp := make([]uint16, mountPathLength)
- mountPathp[0] = 0
-
- // Call the procedure again
- log.G(ctx).Debug("Calling proc (2)")
- err = getLayerMountPath(&stdDriverInfo, path, &mountPathLength, &mountPathp[0])
- if err != nil {
- return "", hcserror.New(err, title+" - failed", "(second call)")
- }
-
- mountPath := syscall.UTF16ToString(mountPathp[0:])
- span.AddAttributes(trace.StringAttribute("mountPath", mountPath))
- return mountPath, nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/getsharedbaseimages.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/getsharedbaseimages.go
deleted file mode 100644
index a50378f49..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/getsharedbaseimages.go
+++ /dev/null
@@ -1,29 +0,0 @@
-package wclayer
-
-import (
- "context"
-
- "github.com/Microsoft/hcsshim/internal/hcserror"
- "github.com/Microsoft/hcsshim/internal/interop"
- "github.com/Microsoft/hcsshim/internal/oc"
- "go.opencensus.io/trace"
-)
-
-// GetSharedBaseImages will enumerate the images stored in the common central
-// image store and return descriptive info about those images for the purpose
-// of registering them with the graphdriver, graph, and tagstore.
-func GetSharedBaseImages(ctx context.Context) (_ string, err error) {
- title := "hcsshim::GetSharedBaseImages"
- ctx, span := trace.StartSpan(ctx, title)
- defer span.End()
- defer func() { oc.SetSpanStatus(span, err) }()
-
- var buffer *uint16
- err = getBaseImages(&buffer)
- if err != nil {
- return "", hcserror.New(err, title+" - failed", "")
- }
- imageData := interop.ConvertAndFreeCoTaskMemString(buffer)
- span.AddAttributes(trace.StringAttribute("imageData", imageData))
- return imageData, nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/grantvmaccess.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/grantvmaccess.go
deleted file mode 100644
index aa7c8ae1f..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/grantvmaccess.go
+++ /dev/null
@@ -1,26 +0,0 @@
-package wclayer
-
-import (
- "context"
-
- "github.com/Microsoft/hcsshim/internal/hcserror"
- "github.com/Microsoft/hcsshim/internal/oc"
- "go.opencensus.io/trace"
-)
-
-// GrantVmAccess adds access to a file for a given VM
-func GrantVmAccess(ctx context.Context, vmid string, filepath string) (err error) {
- title := "hcsshim::GrantVmAccess"
- ctx, span := trace.StartSpan(ctx, title)
- defer span.End()
- defer func() { oc.SetSpanStatus(span, err) }()
- span.AddAttributes(
- trace.StringAttribute("vm-id", vmid),
- trace.StringAttribute("path", filepath))
-
- err = grantVmAccess(vmid, filepath)
- if err != nil {
- return hcserror.New(err, title+" - failed", "")
- }
- return nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/importlayer.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/importlayer.go
deleted file mode 100644
index 16800b394..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/importlayer.go
+++ /dev/null
@@ -1,153 +0,0 @@
-package wclayer
-
-import (
- "context"
- "io/ioutil"
- "os"
- "path/filepath"
- "strings"
-
- "github.com/Microsoft/go-winio"
- "github.com/Microsoft/hcsshim/internal/hcserror"
- "github.com/Microsoft/hcsshim/internal/oc"
- "github.com/Microsoft/hcsshim/internal/safefile"
- "go.opencensus.io/trace"
-)
-
-// ImportLayer will take the contents of the folder at importFolderPath and import
-// that into a layer with the id layerId. Note that in order to correctly populate
-// the layer and interperet the transport format, all parent layers must already
-// be present on the system at the paths provided in parentLayerPaths.
-func ImportLayer(ctx context.Context, path string, importFolderPath string, parentLayerPaths []string) (err error) {
- title := "hcsshim::ImportLayer"
- ctx, span := trace.StartSpan(ctx, title)
- defer span.End()
- defer func() { oc.SetSpanStatus(span, err) }()
- span.AddAttributes(
- trace.StringAttribute("path", path),
- trace.StringAttribute("importFolderPath", importFolderPath),
- trace.StringAttribute("parentLayerPaths", strings.Join(parentLayerPaths, ", ")))
-
- // Generate layer descriptors
- layers, err := layerPathsToDescriptors(ctx, parentLayerPaths)
- if err != nil {
- return err
- }
-
- err = importLayer(&stdDriverInfo, path, importFolderPath, layers)
- if err != nil {
- return hcserror.New(err, title+" - failed", "")
- }
- return nil
-}
-
-// LayerWriter is an interface that supports writing a new container image layer.
-type LayerWriter interface {
- // Add adds a file to the layer with given metadata.
- Add(name string, fileInfo *winio.FileBasicInfo) error
- // AddLink adds a hard link to the layer. The target must already have been added.
- AddLink(name string, target string) error
- // Remove removes a file that was present in a parent layer from the layer.
- Remove(name string) error
- // Write writes data to the current file. The data must be in the format of a Win32
- // backup stream.
- Write(b []byte) (int, error)
- // Close finishes the layer writing process and releases any resources.
- Close() error
-}
-
-type legacyLayerWriterWrapper struct {
- ctx context.Context
- s *trace.Span
-
- *legacyLayerWriter
- path string
- parentLayerPaths []string
-}
-
-func (r *legacyLayerWriterWrapper) Close() (err error) {
- defer r.s.End()
- defer func() { oc.SetSpanStatus(r.s, err) }()
- defer os.RemoveAll(r.root.Name())
- defer r.legacyLayerWriter.CloseRoots()
-
- err = r.legacyLayerWriter.Close()
- if err != nil {
- return err
- }
-
- if err = ImportLayer(r.ctx, r.destRoot.Name(), r.path, r.parentLayerPaths); err != nil {
- return err
- }
- for _, name := range r.Tombstones {
- if err = safefile.RemoveRelative(name, r.destRoot); err != nil && !os.IsNotExist(err) {
- return err
- }
- }
- // Add any hard links that were collected.
- for _, lnk := range r.PendingLinks {
- if err = safefile.RemoveRelative(lnk.Path, r.destRoot); err != nil && !os.IsNotExist(err) {
- return err
- }
- if err = safefile.LinkRelative(lnk.Target, lnk.TargetRoot, lnk.Path, r.destRoot); err != nil {
- return err
- }
- }
- // Prepare the utility VM for use if one is present in the layer.
- if r.HasUtilityVM {
- err := safefile.EnsureNotReparsePointRelative("UtilityVM", r.destRoot)
- if err != nil {
- return err
- }
- err = ProcessUtilityVMImage(r.ctx, filepath.Join(r.destRoot.Name(), "UtilityVM"))
- if err != nil {
- return err
- }
- }
- return nil
-}
-
-// NewLayerWriter returns a new layer writer for creating a layer on disk.
-// The caller must have taken the SeBackupPrivilege and SeRestorePrivilege privileges
-// to call this and any methods on the resulting LayerWriter.
-func NewLayerWriter(ctx context.Context, path string, parentLayerPaths []string) (_ LayerWriter, err error) {
- ctx, span := trace.StartSpan(ctx, "hcsshim::NewLayerWriter")
- defer func() {
- if err != nil {
- oc.SetSpanStatus(span, err)
- span.End()
- }
- }()
- span.AddAttributes(
- trace.StringAttribute("path", path),
- trace.StringAttribute("parentLayerPaths", strings.Join(parentLayerPaths, ", ")))
-
- if len(parentLayerPaths) == 0 {
- // This is a base layer. It gets imported differently.
- f, err := safefile.OpenRoot(path)
- if err != nil {
- return nil, err
- }
- return &baseLayerWriter{
- ctx: ctx,
- s: span,
- root: f,
- }, nil
- }
-
- importPath, err := ioutil.TempDir("", "hcs")
- if err != nil {
- return nil, err
- }
- w, err := newLegacyLayerWriter(importPath, parentLayerPaths, path)
- if err != nil {
- return nil, err
- }
- return &legacyLayerWriterWrapper{
- ctx: ctx,
- s: span,
- legacyLayerWriter: w,
- path: importPath,
- parentLayerPaths: parentLayerPaths,
- }, nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerexists.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerexists.go
deleted file mode 100644
index 6dd6f2d57..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerexists.go
+++ /dev/null
@@ -1,28 +0,0 @@
-package wclayer
-
-import (
- "context"
-
- "github.com/Microsoft/hcsshim/internal/hcserror"
- "github.com/Microsoft/hcsshim/internal/oc"
- "go.opencensus.io/trace"
-)
-
-// LayerExists will return true if a layer with the given id exists and is known
-// to the system.
-func LayerExists(ctx context.Context, path string) (_ bool, err error) {
- title := "hcsshim::LayerExists"
- ctx, span := trace.StartSpan(ctx, title)
- defer span.End()
- defer func() { oc.SetSpanStatus(span, err) }()
- span.AddAttributes(trace.StringAttribute("path", path))
-
- // Call the procedure itself.
- var exists uint32
- err = layerExists(&stdDriverInfo, path, &exists)
- if err != nil {
- return false, hcserror.New(err, title+" - failed", "")
- }
- span.AddAttributes(trace.BoolAttribute("layer-exists", exists != 0))
- return exists != 0, nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerid.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerid.go
deleted file mode 100644
index 0ce34a30f..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerid.go
+++ /dev/null
@@ -1,22 +0,0 @@
-package wclayer
-
-import (
- "context"
- "path/filepath"
-
- "github.com/Microsoft/go-winio/pkg/guid"
- "github.com/Microsoft/hcsshim/internal/oc"
- "go.opencensus.io/trace"
-)
-
-// LayerID returns the layer ID of a layer on disk.
-func LayerID(ctx context.Context, path string) (_ guid.GUID, err error) {
- title := "hcsshim::LayerID"
- ctx, span := trace.StartSpan(ctx, title)
- defer span.End()
- defer func() { oc.SetSpanStatus(span, err) }()
- span.AddAttributes(trace.StringAttribute("path", path))
-
- _, file := filepath.Split(path)
- return NameToGuid(ctx, file)
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerutils.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerutils.go
deleted file mode 100644
index 1ec893c6a..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerutils.go
+++ /dev/null
@@ -1,97 +0,0 @@
-package wclayer
-
-// This file contains utility functions to support storage (graph) related
-// functionality.
-
-import (
- "context"
- "syscall"
-
- "github.com/Microsoft/go-winio/pkg/guid"
- "github.com/sirupsen/logrus"
-)
-
-/* To pass into syscall, we need a struct matching the following:
-enum GraphDriverType
-{
- DiffDriver,
- FilterDriver
-};
-
-struct DriverInfo {
- GraphDriverType Flavour;
- LPCWSTR HomeDir;
-};
-*/
-
-type driverInfo struct {
- Flavour int
- HomeDirp *uint16
-}
-
-var (
- utf16EmptyString uint16
- stdDriverInfo = driverInfo{1, &utf16EmptyString}
-)
-
-/* To pass into syscall, we need a struct matching the following:
-typedef struct _WC_LAYER_DESCRIPTOR {
-
- //
- // The ID of the layer
- //
-
- GUID LayerId;
-
- //
- // Additional flags
- //
-
- union {
- struct {
- ULONG Reserved : 31;
- ULONG Dirty : 1; // Created from sandbox as a result of snapshot
- };
- ULONG Value;
- } Flags;
-
- //
- // Path to the layer root directory, null-terminated
- //
-
- PCWSTR Path;
-
-} WC_LAYER_DESCRIPTOR, *PWC_LAYER_DESCRIPTOR;
-*/
-type WC_LAYER_DESCRIPTOR struct {
- LayerId guid.GUID
- Flags uint32
- Pathp *uint16
-}
-
-func layerPathsToDescriptors(ctx context.Context, parentLayerPaths []string) ([]WC_LAYER_DESCRIPTOR, error) {
- // Array of descriptors that gets constructed.
- var layers []WC_LAYER_DESCRIPTOR
-
- for i := 0; i < len(parentLayerPaths); i++ {
- g, err := LayerID(ctx, parentLayerPaths[i])
- if err != nil {
- logrus.WithError(err).Debug("Failed to convert name to guid")
- return nil, err
- }
-
- p, err := syscall.UTF16PtrFromString(parentLayerPaths[i])
- if err != nil {
- logrus.WithError(err).Debug("Failed conversion of parentLayerPath to pointer")
- return nil, err
- }
-
- layers = append(layers, WC_LAYER_DESCRIPTOR{
- LayerId: g,
- Flags: 0,
- Pathp: p,
- })
- }
-
- return layers, nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/legacy.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/legacy.go
deleted file mode 100644
index b8ea5d263..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/legacy.go
+++ /dev/null
@@ -1,815 +0,0 @@
-package wclayer
-
-import (
- "bufio"
- "encoding/binary"
- "errors"
- "fmt"
- "io"
- "io/ioutil"
- "os"
- "path/filepath"
- "strings"
- "syscall"
-
- "github.com/Microsoft/go-winio"
- "github.com/Microsoft/hcsshim/internal/longpath"
- "github.com/Microsoft/hcsshim/internal/safefile"
-)
-
-var errorIterationCanceled = errors.New("")
-
-var mutatedUtilityVMFiles = map[string]bool{
- `EFI\Microsoft\Boot\BCD`: true,
- `EFI\Microsoft\Boot\BCD.LOG`: true,
- `EFI\Microsoft\Boot\BCD.LOG1`: true,
- `EFI\Microsoft\Boot\BCD.LOG2`: true,
-}
-
-const (
- filesPath = `Files`
- hivesPath = `Hives`
- utilityVMPath = `UtilityVM`
- utilityVMFilesPath = `UtilityVM\Files`
-)
-
-func openFileOrDir(path string, mode uint32, createDisposition uint32) (file *os.File, err error) {
- return winio.OpenForBackup(path, mode, syscall.FILE_SHARE_READ, createDisposition)
-}
-
-func hasPathPrefix(p, prefix string) bool {
- return strings.HasPrefix(p, prefix) && len(p) > len(prefix) && p[len(prefix)] == '\\'
-}
-
-type fileEntry struct {
- path string
- fi os.FileInfo
- err error
-}
-
-type legacyLayerReader struct {
- root string
- result chan *fileEntry
- proceed chan bool
- currentFile *os.File
- backupReader *winio.BackupFileReader
-}
-
-// newLegacyLayerReader returns a new LayerReader that can read the Windows
-// container layer transport format from disk.
-func newLegacyLayerReader(root string) *legacyLayerReader {
- r := &legacyLayerReader{
- root: root,
- result: make(chan *fileEntry),
- proceed: make(chan bool),
- }
- go r.walk()
- return r
-}
-
-func readTombstones(path string) (map[string]([]string), error) {
- tf, err := os.Open(filepath.Join(path, "tombstones.txt"))
- if err != nil {
- return nil, err
- }
- defer tf.Close()
- s := bufio.NewScanner(tf)
- if !s.Scan() || s.Text() != "\xef\xbb\xbfVersion 1.0" {
- return nil, errors.New("Invalid tombstones file")
- }
-
- ts := make(map[string]([]string))
- for s.Scan() {
- t := filepath.Join(filesPath, s.Text()[1:]) // skip leading `\`
- dir := filepath.Dir(t)
- ts[dir] = append(ts[dir], t)
- }
- if err = s.Err(); err != nil {
- return nil, err
- }
-
- return ts, nil
-}
-
-func (r *legacyLayerReader) walkUntilCancelled() error {
- root, err := longpath.LongAbs(r.root)
- if err != nil {
- return err
- }
-
- r.root = root
- ts, err := readTombstones(r.root)
- if err != nil {
- return err
- }
-
- err = filepath.Walk(r.root, func(path string, info os.FileInfo, err error) error {
- if err != nil {
- return err
- }
-
- // Indirect fix for https://github.com/moby/moby/issues/32838#issuecomment-343610048.
- // Handle failure from what may be a golang bug in the conversion of
- // UTF16 to UTF8 in files which are left in the recycle bin. Os.Lstat
- // which is called by filepath.Walk will fail when a filename contains
- // unicode characters. Skip the recycle bin regardless which is goodness.
- if strings.EqualFold(path, filepath.Join(r.root, `Files\$Recycle.Bin`)) && info.IsDir() {
- return filepath.SkipDir
- }
-
- if path == r.root || path == filepath.Join(r.root, "tombstones.txt") || strings.HasSuffix(path, ".$wcidirs$") {
- return nil
- }
-
- r.result <- &fileEntry{path, info, nil}
- if !<-r.proceed {
- return errorIterationCanceled
- }
-
- // List all the tombstones.
- if info.IsDir() {
- relPath, err := filepath.Rel(r.root, path)
- if err != nil {
- return err
- }
- if dts, ok := ts[relPath]; ok {
- for _, t := range dts {
- r.result <- &fileEntry{filepath.Join(r.root, t), nil, nil}
- if !<-r.proceed {
- return errorIterationCanceled
- }
- }
- }
- }
- return nil
- })
- if err == errorIterationCanceled {
- return nil
- }
- if err == nil {
- return io.EOF
- }
- return err
-}
-
-func (r *legacyLayerReader) walk() {
- defer close(r.result)
- if !<-r.proceed {
- return
- }
-
- err := r.walkUntilCancelled()
- if err != nil {
- for {
- r.result <- &fileEntry{err: err}
- if !<-r.proceed {
- return
- }
- }
- }
-}
-
-func (r *legacyLayerReader) reset() {
- if r.backupReader != nil {
- r.backupReader.Close()
- r.backupReader = nil
- }
- if r.currentFile != nil {
- r.currentFile.Close()
- r.currentFile = nil
- }
-}
-
-func findBackupStreamSize(r io.Reader) (int64, error) {
- br := winio.NewBackupStreamReader(r)
- for {
- hdr, err := br.Next()
- if err != nil {
- if err == io.EOF {
- err = nil
- }
- return 0, err
- }
- if hdr.Id == winio.BackupData {
- return hdr.Size, nil
- }
- }
-}
-
-func (r *legacyLayerReader) Next() (path string, size int64, fileInfo *winio.FileBasicInfo, err error) {
- r.reset()
- r.proceed <- true
- fe := <-r.result
- if fe == nil {
- err = errors.New("LegacyLayerReader closed")
- return
- }
- if fe.err != nil {
- err = fe.err
- return
- }
-
- path, err = filepath.Rel(r.root, fe.path)
- if err != nil {
- return
- }
-
- if fe.fi == nil {
- // This is a tombstone. Return a nil fileInfo.
- return
- }
-
- if fe.fi.IsDir() && hasPathPrefix(path, filesPath) {
- fe.path += ".$wcidirs$"
- }
-
- f, err := openFileOrDir(fe.path, syscall.GENERIC_READ, syscall.OPEN_EXISTING)
- if err != nil {
- return
- }
- defer func() {
- if f != nil {
- f.Close()
- }
- }()
-
- fileInfo, err = winio.GetFileBasicInfo(f)
- if err != nil {
- return
- }
-
- if !hasPathPrefix(path, filesPath) {
- size = fe.fi.Size()
- r.backupReader = winio.NewBackupFileReader(f, false)
- if path == hivesPath || path == filesPath {
- // The Hives directory has a non-deterministic file time because of the
- // nature of the import process. Use the times from System_Delta.
- var g *os.File
- g, err = os.Open(filepath.Join(r.root, hivesPath, `System_Delta`))
- if err != nil {
- return
- }
- attr := fileInfo.FileAttributes
- fileInfo, err = winio.GetFileBasicInfo(g)
- g.Close()
- if err != nil {
- return
- }
- fileInfo.FileAttributes = attr
- }
-
- // The creation time and access time get reset for files outside of the Files path.
- fileInfo.CreationTime = fileInfo.LastWriteTime
- fileInfo.LastAccessTime = fileInfo.LastWriteTime
-
- } else {
- // The file attributes are written before the backup stream.
- var attr uint32
- err = binary.Read(f, binary.LittleEndian, &attr)
- if err != nil {
- return
- }
- fileInfo.FileAttributes = attr
- beginning := int64(4)
-
- // Find the accurate file size.
- if !fe.fi.IsDir() {
- size, err = findBackupStreamSize(f)
- if err != nil {
- err = &os.PathError{Op: "findBackupStreamSize", Path: fe.path, Err: err}
- return
- }
- }
-
- // Return back to the beginning of the backup stream.
- _, err = f.Seek(beginning, 0)
- if err != nil {
- return
- }
- }
-
- r.currentFile = f
- f = nil
- return
-}
-
-func (r *legacyLayerReader) Read(b []byte) (int, error) {
- if r.backupReader == nil {
- if r.currentFile == nil {
- return 0, io.EOF
- }
- return r.currentFile.Read(b)
- }
- return r.backupReader.Read(b)
-}
-
-func (r *legacyLayerReader) Seek(offset int64, whence int) (int64, error) {
- if r.backupReader == nil {
- if r.currentFile == nil {
- return 0, errors.New("no current file")
- }
- return r.currentFile.Seek(offset, whence)
- }
- return 0, errors.New("seek not supported on this stream")
-}
-
-func (r *legacyLayerReader) Close() error {
- r.proceed <- false
- <-r.result
- r.reset()
- return nil
-}
-
-type pendingLink struct {
- Path, Target string
- TargetRoot *os.File
-}
-
-type pendingDir struct {
- Path string
- Root *os.File
-}
-
-type legacyLayerWriter struct {
- root *os.File
- destRoot *os.File
- parentRoots []*os.File
- currentFile *os.File
- bufWriter *bufio.Writer
- currentFileName string
- currentFileRoot *os.File
- backupWriter *winio.BackupFileWriter
- Tombstones []string
- HasUtilityVM bool
- uvmDi []dirInfo
- addedFiles map[string]bool
- PendingLinks []pendingLink
- pendingDirs []pendingDir
- currentIsDir bool
-}
-
-// newLegacyLayerWriter returns a LayerWriter that can write the contaler layer
-// transport format to disk.
-func newLegacyLayerWriter(root string, parentRoots []string, destRoot string) (w *legacyLayerWriter, err error) {
- w = &legacyLayerWriter{
- addedFiles: make(map[string]bool),
- }
- defer func() {
- if err != nil {
- w.CloseRoots()
- w = nil
- }
- }()
- w.root, err = safefile.OpenRoot(root)
- if err != nil {
- return
- }
- w.destRoot, err = safefile.OpenRoot(destRoot)
- if err != nil {
- return
- }
- for _, r := range parentRoots {
- f, err := safefile.OpenRoot(r)
- if err != nil {
- return w, err
- }
- w.parentRoots = append(w.parentRoots, f)
- }
- w.bufWriter = bufio.NewWriterSize(ioutil.Discard, 65536)
- return
-}
-
-func (w *legacyLayerWriter) CloseRoots() {
- if w.root != nil {
- w.root.Close()
- w.root = nil
- }
- if w.destRoot != nil {
- w.destRoot.Close()
- w.destRoot = nil
- }
- for i := range w.parentRoots {
- w.parentRoots[i].Close()
- }
- w.parentRoots = nil
-}
-
-func (w *legacyLayerWriter) initUtilityVM() error {
- if !w.HasUtilityVM {
- err := safefile.MkdirRelative(utilityVMPath, w.destRoot)
- if err != nil {
- return err
- }
- // Server 2016 does not support multiple layers for the utility VM, so
- // clone the utility VM from the parent layer into this layer. Use hard
- // links to avoid unnecessary copying, since most of the files are
- // immutable.
- err = cloneTree(w.parentRoots[0], w.destRoot, utilityVMFilesPath, mutatedUtilityVMFiles)
- if err != nil {
- return fmt.Errorf("cloning the parent utility VM image failed: %s", err)
- }
- w.HasUtilityVM = true
- }
- return nil
-}
-
-func (w *legacyLayerWriter) reset() error {
- err := w.bufWriter.Flush()
- if err != nil {
- return err
- }
- w.bufWriter.Reset(ioutil.Discard)
- if w.currentIsDir {
- r := w.currentFile
- br := winio.NewBackupStreamReader(r)
- // Seek to the beginning of the backup stream, skipping the fileattrs
- if _, err := r.Seek(4, io.SeekStart); err != nil {
- return err
- }
-
- for {
- bhdr, err := br.Next()
- if err == io.EOF {
- // end of backupstream data
- break
- }
- if err != nil {
- return err
- }
- switch bhdr.Id {
- case winio.BackupReparseData:
- // The current file is a `.$wcidirs$` metadata file that
- // describes a directory reparse point. Delete the placeholder
- // directory to prevent future files being added into the
- // destination of the reparse point during the ImportLayer call
- if err := safefile.RemoveRelative(w.currentFileName, w.currentFileRoot); err != nil {
- return err
- }
- w.pendingDirs = append(w.pendingDirs, pendingDir{Path: w.currentFileName, Root: w.currentFileRoot})
- default:
- // ignore all other stream types, as we only care about directory reparse points
- }
- }
- w.currentIsDir = false
- }
- if w.backupWriter != nil {
- w.backupWriter.Close()
- w.backupWriter = nil
- }
- if w.currentFile != nil {
- w.currentFile.Close()
- w.currentFile = nil
- w.currentFileName = ""
- w.currentFileRoot = nil
- }
- return nil
-}
-
-// copyFileWithMetadata copies a file using the backup/restore APIs in order to preserve metadata
-func copyFileWithMetadata(srcRoot, destRoot *os.File, subPath string, isDir bool) (fileInfo *winio.FileBasicInfo, err error) {
- src, err := safefile.OpenRelative(
- subPath,
- srcRoot,
- syscall.GENERIC_READ|winio.ACCESS_SYSTEM_SECURITY,
- syscall.FILE_SHARE_READ,
- safefile.FILE_OPEN,
- safefile.FILE_OPEN_REPARSE_POINT)
- if err != nil {
- return nil, err
- }
- defer src.Close()
- srcr := winio.NewBackupFileReader(src, true)
- defer srcr.Close()
-
- fileInfo, err = winio.GetFileBasicInfo(src)
- if err != nil {
- return nil, err
- }
-
- extraFlags := uint32(0)
- if isDir {
- extraFlags |= safefile.FILE_DIRECTORY_FILE
- }
- dest, err := safefile.OpenRelative(
- subPath,
- destRoot,
- syscall.GENERIC_READ|syscall.GENERIC_WRITE|winio.WRITE_DAC|winio.WRITE_OWNER|winio.ACCESS_SYSTEM_SECURITY,
- syscall.FILE_SHARE_READ,
- safefile.FILE_CREATE,
- extraFlags)
- if err != nil {
- return nil, err
- }
- defer dest.Close()
-
- err = winio.SetFileBasicInfo(dest, fileInfo)
- if err != nil {
- return nil, err
- }
-
- destw := winio.NewBackupFileWriter(dest, true)
- defer func() {
- cerr := destw.Close()
- if err == nil {
- err = cerr
- }
- }()
-
- _, err = io.Copy(destw, srcr)
- if err != nil {
- return nil, err
- }
-
- return fileInfo, nil
-}
-
-// cloneTree clones a directory tree using hard links. It skips hard links for
-// the file names in the provided map and just copies those files.
-func cloneTree(srcRoot *os.File, destRoot *os.File, subPath string, mutatedFiles map[string]bool) error {
- var di []dirInfo
- err := safefile.EnsureNotReparsePointRelative(subPath, srcRoot)
- if err != nil {
- return err
- }
- err = filepath.Walk(filepath.Join(srcRoot.Name(), subPath), func(srcFilePath string, info os.FileInfo, err error) error {
- if err != nil {
- return err
- }
-
- relPath, err := filepath.Rel(srcRoot.Name(), srcFilePath)
- if err != nil {
- return err
- }
-
- fileAttributes := info.Sys().(*syscall.Win32FileAttributeData).FileAttributes
- // Directories, reparse points, and files that will be mutated during
- // utility VM import must be copied. All other files can be hard linked.
- isReparsePoint := fileAttributes&syscall.FILE_ATTRIBUTE_REPARSE_POINT != 0
- // In go1.9, FileInfo.IsDir() returns false if the directory is also a symlink.
- // See: https://github.com/golang/go/commit/1989921aef60c83e6f9127a8448fb5ede10e9acc
- // Fixes the problem by checking syscall.FILE_ATTRIBUTE_DIRECTORY directly
- isDir := fileAttributes&syscall.FILE_ATTRIBUTE_DIRECTORY != 0
-
- if isDir || isReparsePoint || mutatedFiles[relPath] {
- fi, err := copyFileWithMetadata(srcRoot, destRoot, relPath, isDir)
- if err != nil {
- return err
- }
- if isDir && !isReparsePoint {
- di = append(di, dirInfo{path: relPath, fileInfo: *fi})
- }
- } else {
- err = safefile.LinkRelative(relPath, srcRoot, relPath, destRoot)
- if err != nil {
- return err
- }
- }
-
- return nil
- })
- if err != nil {
- return err
- }
-
- return reapplyDirectoryTimes(destRoot, di)
-}
-
-func (w *legacyLayerWriter) Add(name string, fileInfo *winio.FileBasicInfo) error {
- if err := w.reset(); err != nil {
- return err
- }
-
- if name == utilityVMPath {
- return w.initUtilityVM()
- }
-
- name = filepath.Clean(name)
- if hasPathPrefix(name, utilityVMPath) {
- if !w.HasUtilityVM {
- return errors.New("missing UtilityVM directory")
- }
- if !hasPathPrefix(name, utilityVMFilesPath) && name != utilityVMFilesPath {
- return errors.New("invalid UtilityVM layer")
- }
- createDisposition := uint32(safefile.FILE_OPEN)
- if (fileInfo.FileAttributes & syscall.FILE_ATTRIBUTE_DIRECTORY) != 0 {
- st, err := safefile.LstatRelative(name, w.destRoot)
- if err != nil && !os.IsNotExist(err) {
- return err
- }
- if st != nil {
- // Delete the existing file/directory if it is not the same type as this directory.
- existingAttr := st.Sys().(*syscall.Win32FileAttributeData).FileAttributes
- if (uint32(fileInfo.FileAttributes)^existingAttr)&(syscall.FILE_ATTRIBUTE_DIRECTORY|syscall.FILE_ATTRIBUTE_REPARSE_POINT) != 0 {
- if err = safefile.RemoveAllRelative(name, w.destRoot); err != nil {
- return err
- }
- st = nil
- }
- }
- if st == nil {
- if err = safefile.MkdirRelative(name, w.destRoot); err != nil {
- return err
- }
- }
- if fileInfo.FileAttributes&syscall.FILE_ATTRIBUTE_REPARSE_POINT == 0 {
- w.uvmDi = append(w.uvmDi, dirInfo{path: name, fileInfo: *fileInfo})
- }
- } else {
- // Overwrite any existing hard link.
- err := safefile.RemoveRelative(name, w.destRoot)
- if err != nil && !os.IsNotExist(err) {
- return err
- }
- createDisposition = safefile.FILE_CREATE
- }
-
- f, err := safefile.OpenRelative(
- name,
- w.destRoot,
- syscall.GENERIC_READ|syscall.GENERIC_WRITE|winio.WRITE_DAC|winio.WRITE_OWNER|winio.ACCESS_SYSTEM_SECURITY,
- syscall.FILE_SHARE_READ,
- createDisposition,
- safefile.FILE_OPEN_REPARSE_POINT,
- )
- if err != nil {
- return err
- }
- defer func() {
- if f != nil {
- f.Close()
- safefile.RemoveRelative(name, w.destRoot)
- }
- }()
-
- err = winio.SetFileBasicInfo(f, fileInfo)
- if err != nil {
- return err
- }
-
- w.backupWriter = winio.NewBackupFileWriter(f, true)
- w.bufWriter.Reset(w.backupWriter)
- w.currentFile = f
- w.currentFileName = name
- w.currentFileRoot = w.destRoot
- w.addedFiles[name] = true
- f = nil
- return nil
- }
-
- fname := name
- if (fileInfo.FileAttributes & syscall.FILE_ATTRIBUTE_DIRECTORY) != 0 {
- err := safefile.MkdirRelative(name, w.root)
- if err != nil {
- return err
- }
- fname += ".$wcidirs$"
- w.currentIsDir = true
- }
-
- f, err := safefile.OpenRelative(fname, w.root, syscall.GENERIC_READ|syscall.GENERIC_WRITE, syscall.FILE_SHARE_READ, safefile.FILE_CREATE, 0)
- if err != nil {
- return err
- }
- defer func() {
- if f != nil {
- f.Close()
- safefile.RemoveRelative(fname, w.root)
- }
- }()
-
- strippedFi := *fileInfo
- strippedFi.FileAttributes = 0
- err = winio.SetFileBasicInfo(f, &strippedFi)
- if err != nil {
- return err
- }
-
- if hasPathPrefix(name, hivesPath) {
- w.backupWriter = winio.NewBackupFileWriter(f, false)
- w.bufWriter.Reset(w.backupWriter)
- } else {
- w.bufWriter.Reset(f)
- // The file attributes are written before the stream.
- err = binary.Write(w.bufWriter, binary.LittleEndian, uint32(fileInfo.FileAttributes))
- if err != nil {
- w.bufWriter.Reset(ioutil.Discard)
- return err
- }
- }
-
- w.currentFile = f
- w.currentFileName = name
- w.currentFileRoot = w.root
- w.addedFiles[name] = true
- f = nil
- return nil
-}
-
-func (w *legacyLayerWriter) AddLink(name string, target string) error {
- if err := w.reset(); err != nil {
- return err
- }
-
- target = filepath.Clean(target)
- var roots []*os.File
- if hasPathPrefix(target, filesPath) {
- // Look for cross-layer hard link targets in the parent layers, since
- // nothing is in the destination path yet.
- roots = w.parentRoots
- } else if hasPathPrefix(target, utilityVMFilesPath) {
- // Since the utility VM is fully cloned into the destination path
- // already, look for cross-layer hard link targets directly in the
- // destination path.
- roots = []*os.File{w.destRoot}
- }
-
- if roots == nil || (!hasPathPrefix(name, filesPath) && !hasPathPrefix(name, utilityVMFilesPath)) {
- return errors.New("invalid hard link in layer")
- }
-
- // Find to try the target of the link in a previously added file. If that
- // fails, search in parent layers.
- var selectedRoot *os.File
- if _, ok := w.addedFiles[target]; ok {
- selectedRoot = w.destRoot
- } else {
- for _, r := range roots {
- if _, err := safefile.LstatRelative(target, r); err != nil {
- if !os.IsNotExist(err) {
- return err
- }
- } else {
- selectedRoot = r
- break
- }
- }
- if selectedRoot == nil {
- return fmt.Errorf("failed to find link target for '%s' -> '%s'", name, target)
- }
- }
-
- // The link can't be written until after the ImportLayer call.
- w.PendingLinks = append(w.PendingLinks, pendingLink{
- Path: name,
- Target: target,
- TargetRoot: selectedRoot,
- })
- w.addedFiles[name] = true
- return nil
-}
-
-func (w *legacyLayerWriter) Remove(name string) error {
- name = filepath.Clean(name)
- if hasPathPrefix(name, filesPath) {
- w.Tombstones = append(w.Tombstones, name)
- } else if hasPathPrefix(name, utilityVMFilesPath) {
- err := w.initUtilityVM()
- if err != nil {
- return err
- }
- // Make sure the path exists; os.RemoveAll will not fail if the file is
- // already gone, and this needs to be a fatal error for diagnostics
- // purposes.
- if _, err := safefile.LstatRelative(name, w.destRoot); err != nil {
- return err
- }
- err = safefile.RemoveAllRelative(name, w.destRoot)
- if err != nil {
- return err
- }
- } else {
- return fmt.Errorf("invalid tombstone %s", name)
- }
-
- return nil
-}
-
-func (w *legacyLayerWriter) Write(b []byte) (int, error) {
- if w.backupWriter == nil && w.currentFile == nil {
- return 0, errors.New("closed")
- }
- return w.bufWriter.Write(b)
-}
-
-func (w *legacyLayerWriter) Close() error {
- if err := w.reset(); err != nil {
- return err
- }
- if err := safefile.RemoveRelative("tombstones.txt", w.root); err != nil && !os.IsNotExist(err) {
- return err
- }
- for _, pd := range w.pendingDirs {
- err := safefile.MkdirRelative(pd.Path, pd.Root)
- if err != nil {
- return err
- }
- }
- if w.HasUtilityVM {
- err := reapplyDirectoryTimes(w.destRoot, w.uvmDi)
- if err != nil {
- return err
- }
- }
- return nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/nametoguid.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/nametoguid.go
deleted file mode 100644
index b732857b3..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/nametoguid.go
+++ /dev/null
@@ -1,29 +0,0 @@
-package wclayer
-
-import (
- "context"
-
- "github.com/Microsoft/go-winio/pkg/guid"
- "github.com/Microsoft/hcsshim/internal/hcserror"
- "github.com/Microsoft/hcsshim/internal/oc"
- "go.opencensus.io/trace"
-)
-
-// NameToGuid converts the given string into a GUID using the algorithm in the
-// Host Compute Service, ensuring GUIDs generated with the same string are common
-// across all clients.
-func NameToGuid(ctx context.Context, name string) (_ guid.GUID, err error) {
- title := "hcsshim::NameToGuid"
- ctx, span := trace.StartSpan(ctx, title)
- defer span.End()
- defer func() { oc.SetSpanStatus(span, err) }()
- span.AddAttributes(trace.StringAttribute("name", name))
-
- var id guid.GUID
- err = nameToGuid(name, &id)
- if err != nil {
- return guid.GUID{}, hcserror.New(err, title+" - failed", "")
- }
- span.AddAttributes(trace.StringAttribute("guid", id.String()))
- return id, nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/preparelayer.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/preparelayer.go
deleted file mode 100644
index 55f7730d0..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/preparelayer.go
+++ /dev/null
@@ -1,44 +0,0 @@
-package wclayer
-
-import (
- "context"
- "strings"
- "sync"
-
- "github.com/Microsoft/hcsshim/internal/hcserror"
- "github.com/Microsoft/hcsshim/internal/oc"
- "go.opencensus.io/trace"
-)
-
-var prepareLayerLock sync.Mutex
-
-// PrepareLayer finds a mounted read-write layer matching path and enables the
-// the filesystem filter for use on that layer. This requires the paths to all
-// parent layers, and is necessary in order to view or interact with the layer
-// as an actual filesystem (reading and writing files, creating directories, etc).
-// Disabling the filter must be done via UnprepareLayer.
-func PrepareLayer(ctx context.Context, path string, parentLayerPaths []string) (err error) {
- title := "hcsshim::PrepareLayer"
- ctx, span := trace.StartSpan(ctx, title)
- defer span.End()
- defer func() { oc.SetSpanStatus(span, err) }()
- span.AddAttributes(
- trace.StringAttribute("path", path),
- trace.StringAttribute("parentLayerPaths", strings.Join(parentLayerPaths, ", ")))
-
- // Generate layer descriptors
- layers, err := layerPathsToDescriptors(ctx, parentLayerPaths)
- if err != nil {
- return err
- }
-
- // This lock is a temporary workaround for a Windows bug. Only allowing one
- // call to prepareLayer at a time vastly reduces the chance of a timeout.
- prepareLayerLock.Lock()
- defer prepareLayerLock.Unlock()
- err = prepareLayer(&stdDriverInfo, path, layers)
- if err != nil {
- return hcserror.New(err, title+" - failed", "")
- }
- return nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/processimage.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/processimage.go
deleted file mode 100644
index aabb31368..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/processimage.go
+++ /dev/null
@@ -1,41 +0,0 @@
-package wclayer
-
-import (
- "context"
- "os"
-
- "github.com/Microsoft/hcsshim/internal/oc"
- "go.opencensus.io/trace"
-)
-
-// ProcessBaseLayer post-processes a base layer that has had its files extracted.
-// The files should have been extracted to \Files.
-func ProcessBaseLayer(ctx context.Context, path string) (err error) {
- title := "hcsshim::ProcessBaseLayer"
- ctx, span := trace.StartSpan(ctx, title)
- defer span.End()
- defer func() { oc.SetSpanStatus(span, err) }()
- span.AddAttributes(trace.StringAttribute("path", path))
-
- err = processBaseImage(path)
- if err != nil {
- return &os.PathError{Op: title, Path: path, Err: err}
- }
- return nil
-}
-
-// ProcessUtilityVMImage post-processes a utility VM image that has had its files extracted.
-// The files should have been extracted to \Files.
-func ProcessUtilityVMImage(ctx context.Context, path string) (err error) {
- title := "hcsshim::ProcessUtilityVMImage"
- ctx, span := trace.StartSpan(ctx, title)
- defer span.End()
- defer func() { oc.SetSpanStatus(span, err) }()
- span.AddAttributes(trace.StringAttribute("path", path))
-
- err = processUtilityImage(path)
- if err != nil {
- return &os.PathError{Op: title, Path: path, Err: err}
- }
- return nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/unpreparelayer.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/unpreparelayer.go
deleted file mode 100644
index 84f81848f..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/unpreparelayer.go
+++ /dev/null
@@ -1,25 +0,0 @@
-package wclayer
-
-import (
- "context"
-
- "github.com/Microsoft/hcsshim/internal/hcserror"
- "github.com/Microsoft/hcsshim/internal/oc"
- "go.opencensus.io/trace"
-)
-
-// UnprepareLayer disables the filesystem filter for the read-write layer with
-// the given id.
-func UnprepareLayer(ctx context.Context, path string) (err error) {
- title := "hcsshim::UnprepareLayer"
- ctx, span := trace.StartSpan(ctx, title)
- defer span.End()
- defer func() { oc.SetSpanStatus(span, err) }()
- span.AddAttributes(trace.StringAttribute("path", path))
-
- err = unprepareLayer(&stdDriverInfo, path)
- if err != nil {
- return hcserror.New(err, title+" - failed", "")
- }
- return nil
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/wclayer.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/wclayer.go
deleted file mode 100644
index dc40bf519..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/wclayer.go
+++ /dev/null
@@ -1,32 +0,0 @@
-package wclayer
-
-import "github.com/Microsoft/go-winio/pkg/guid"
-
-//go:generate go run ../../mksyscall_windows.go -output zsyscall_windows.go wclayer.go
-
-//sys activateLayer(info *driverInfo, id string) (hr error) = vmcompute.ActivateLayer?
-//sys copyLayer(info *driverInfo, srcId string, dstId string, descriptors []WC_LAYER_DESCRIPTOR) (hr error) = vmcompute.CopyLayer?
-//sys createLayer(info *driverInfo, id string, parent string) (hr error) = vmcompute.CreateLayer?
-//sys createSandboxLayer(info *driverInfo, id string, parent uintptr, descriptors []WC_LAYER_DESCRIPTOR) (hr error) = vmcompute.CreateSandboxLayer?
-//sys expandSandboxSize(info *driverInfo, id string, size uint64) (hr error) = vmcompute.ExpandSandboxSize?
-//sys deactivateLayer(info *driverInfo, id string) (hr error) = vmcompute.DeactivateLayer?
-//sys destroyLayer(info *driverInfo, id string) (hr error) = vmcompute.DestroyLayer?
-//sys exportLayer(info *driverInfo, id string, path string, descriptors []WC_LAYER_DESCRIPTOR) (hr error) = vmcompute.ExportLayer?
-//sys getLayerMountPath(info *driverInfo, id string, length *uintptr, buffer *uint16) (hr error) = vmcompute.GetLayerMountPath?
-//sys getBaseImages(buffer **uint16) (hr error) = vmcompute.GetBaseImages?
-//sys importLayer(info *driverInfo, id string, path string, descriptors []WC_LAYER_DESCRIPTOR) (hr error) = vmcompute.ImportLayer?
-//sys layerExists(info *driverInfo, id string, exists *uint32) (hr error) = vmcompute.LayerExists?
-//sys nameToGuid(name string, guid *_guid) (hr error) = vmcompute.NameToGuid?
-//sys prepareLayer(info *driverInfo, id string, descriptors []WC_LAYER_DESCRIPTOR) (hr error) = vmcompute.PrepareLayer?
-//sys unprepareLayer(info *driverInfo, id string) (hr error) = vmcompute.UnprepareLayer?
-//sys processBaseImage(path string) (hr error) = vmcompute.ProcessBaseImage?
-//sys processUtilityImage(path string) (hr error) = vmcompute.ProcessUtilityImage?
-
-//sys grantVmAccess(vmid string, filepath string) (hr error) = vmcompute.GrantVmAccess?
-
-//sys openVirtualDisk(virtualStorageType *virtualStorageType, path string, virtualDiskAccessMask uint32, flags uint32, parameters *openVirtualDiskParameters, handle *syscall.Handle) (err error) [failretval != 0] = virtdisk.OpenVirtualDisk
-//sys attachVirtualDisk(handle syscall.Handle, sd uintptr, flags uint32, providerFlags uint32, params uintptr, overlapped uintptr) (err error) [failretval != 0] = virtdisk.AttachVirtualDisk
-
-//sys getDiskFreeSpaceEx(directoryName string, freeBytesAvailableToCaller *int64, totalNumberOfBytes *int64, totalNumberOfFreeBytes *int64) (err error) = GetDiskFreeSpaceExW
-
-type _guid = guid.GUID
diff --git a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/zsyscall_windows.go b/vendor/github.com/Microsoft/hcsshim/internal/wclayer/zsyscall_windows.go
deleted file mode 100644
index 67f917f07..000000000
--- a/vendor/github.com/Microsoft/hcsshim/internal/wclayer/zsyscall_windows.go
+++ /dev/null
@@ -1,569 +0,0 @@
-// Code generated mksyscall_windows.exe DO NOT EDIT
-
-package wclayer
-
-import (
- "syscall"
- "unsafe"
-
- "golang.org/x/sys/windows"
-)
-
-var _ unsafe.Pointer
-
-// Do the interface allocations only once for common
-// Errno values.
-const (
- errnoERROR_IO_PENDING = 997
-)
-
-var (
- errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING)
-)
-
-// errnoErr returns common boxed Errno values, to prevent
-// allocations at runtime.
-func errnoErr(e syscall.Errno) error {
- switch e {
- case 0:
- return nil
- case errnoERROR_IO_PENDING:
- return errERROR_IO_PENDING
- }
- // TODO: add more here, after collecting data on the common
- // error values see on Windows. (perhaps when running
- // all.bat?)
- return e
-}
-
-var (
- modvmcompute = windows.NewLazySystemDLL("vmcompute.dll")
- modvirtdisk = windows.NewLazySystemDLL("virtdisk.dll")
- modkernel32 = windows.NewLazySystemDLL("kernel32.dll")
-
- procActivateLayer = modvmcompute.NewProc("ActivateLayer")
- procCopyLayer = modvmcompute.NewProc("CopyLayer")
- procCreateLayer = modvmcompute.NewProc("CreateLayer")
- procCreateSandboxLayer = modvmcompute.NewProc("CreateSandboxLayer")
- procExpandSandboxSize = modvmcompute.NewProc("ExpandSandboxSize")
- procDeactivateLayer = modvmcompute.NewProc("DeactivateLayer")
- procDestroyLayer = modvmcompute.NewProc("DestroyLayer")
- procExportLayer = modvmcompute.NewProc("ExportLayer")
- procGetLayerMountPath = modvmcompute.NewProc("GetLayerMountPath")
- procGetBaseImages = modvmcompute.NewProc("GetBaseImages")
- procImportLayer = modvmcompute.NewProc("ImportLayer")
- procLayerExists = modvmcompute.NewProc("LayerExists")
- procNameToGuid = modvmcompute.NewProc("NameToGuid")
- procPrepareLayer = modvmcompute.NewProc("PrepareLayer")
- procUnprepareLayer = modvmcompute.NewProc("UnprepareLayer")
- procProcessBaseImage = modvmcompute.NewProc("ProcessBaseImage")
- procProcessUtilityImage = modvmcompute.NewProc("ProcessUtilityImage")
- procGrantVmAccess = modvmcompute.NewProc("GrantVmAccess")
- procOpenVirtualDisk = modvirtdisk.NewProc("OpenVirtualDisk")
- procAttachVirtualDisk = modvirtdisk.NewProc("AttachVirtualDisk")
- procGetDiskFreeSpaceExW = modkernel32.NewProc("GetDiskFreeSpaceExW")
-)
-
-func activateLayer(info *driverInfo, id string) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(id)
- if hr != nil {
- return
- }
- return _activateLayer(info, _p0)
-}
-
-func _activateLayer(info *driverInfo, id *uint16) (hr error) {
- if hr = procActivateLayer.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procActivateLayer.Addr(), 2, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func copyLayer(info *driverInfo, srcId string, dstId string, descriptors []WC_LAYER_DESCRIPTOR) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(srcId)
- if hr != nil {
- return
- }
- var _p1 *uint16
- _p1, hr = syscall.UTF16PtrFromString(dstId)
- if hr != nil {
- return
- }
- return _copyLayer(info, _p0, _p1, descriptors)
-}
-
-func _copyLayer(info *driverInfo, srcId *uint16, dstId *uint16, descriptors []WC_LAYER_DESCRIPTOR) (hr error) {
- var _p2 *WC_LAYER_DESCRIPTOR
- if len(descriptors) > 0 {
- _p2 = &descriptors[0]
- }
- if hr = procCopyLayer.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall6(procCopyLayer.Addr(), 5, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(srcId)), uintptr(unsafe.Pointer(dstId)), uintptr(unsafe.Pointer(_p2)), uintptr(len(descriptors)), 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func createLayer(info *driverInfo, id string, parent string) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(id)
- if hr != nil {
- return
- }
- var _p1 *uint16
- _p1, hr = syscall.UTF16PtrFromString(parent)
- if hr != nil {
- return
- }
- return _createLayer(info, _p0, _p1)
-}
-
-func _createLayer(info *driverInfo, id *uint16, parent *uint16) (hr error) {
- if hr = procCreateLayer.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procCreateLayer.Addr(), 3, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(parent)))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func createSandboxLayer(info *driverInfo, id string, parent uintptr, descriptors []WC_LAYER_DESCRIPTOR) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(id)
- if hr != nil {
- return
- }
- return _createSandboxLayer(info, _p0, parent, descriptors)
-}
-
-func _createSandboxLayer(info *driverInfo, id *uint16, parent uintptr, descriptors []WC_LAYER_DESCRIPTOR) (hr error) {
- var _p1 *WC_LAYER_DESCRIPTOR
- if len(descriptors) > 0 {
- _p1 = &descriptors[0]
- }
- if hr = procCreateSandboxLayer.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall6(procCreateSandboxLayer.Addr(), 5, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), uintptr(parent), uintptr(unsafe.Pointer(_p1)), uintptr(len(descriptors)), 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func expandSandboxSize(info *driverInfo, id string, size uint64) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(id)
- if hr != nil {
- return
- }
- return _expandSandboxSize(info, _p0, size)
-}
-
-func _expandSandboxSize(info *driverInfo, id *uint16, size uint64) (hr error) {
- if hr = procExpandSandboxSize.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procExpandSandboxSize.Addr(), 3, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), uintptr(size))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func deactivateLayer(info *driverInfo, id string) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(id)
- if hr != nil {
- return
- }
- return _deactivateLayer(info, _p0)
-}
-
-func _deactivateLayer(info *driverInfo, id *uint16) (hr error) {
- if hr = procDeactivateLayer.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procDeactivateLayer.Addr(), 2, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func destroyLayer(info *driverInfo, id string) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(id)
- if hr != nil {
- return
- }
- return _destroyLayer(info, _p0)
-}
-
-func _destroyLayer(info *driverInfo, id *uint16) (hr error) {
- if hr = procDestroyLayer.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procDestroyLayer.Addr(), 2, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func exportLayer(info *driverInfo, id string, path string, descriptors []WC_LAYER_DESCRIPTOR) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(id)
- if hr != nil {
- return
- }
- var _p1 *uint16
- _p1, hr = syscall.UTF16PtrFromString(path)
- if hr != nil {
- return
- }
- return _exportLayer(info, _p0, _p1, descriptors)
-}
-
-func _exportLayer(info *driverInfo, id *uint16, path *uint16, descriptors []WC_LAYER_DESCRIPTOR) (hr error) {
- var _p2 *WC_LAYER_DESCRIPTOR
- if len(descriptors) > 0 {
- _p2 = &descriptors[0]
- }
- if hr = procExportLayer.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall6(procExportLayer.Addr(), 5, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(_p2)), uintptr(len(descriptors)), 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func getLayerMountPath(info *driverInfo, id string, length *uintptr, buffer *uint16) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(id)
- if hr != nil {
- return
- }
- return _getLayerMountPath(info, _p0, length, buffer)
-}
-
-func _getLayerMountPath(info *driverInfo, id *uint16, length *uintptr, buffer *uint16) (hr error) {
- if hr = procGetLayerMountPath.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall6(procGetLayerMountPath.Addr(), 4, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(length)), uintptr(unsafe.Pointer(buffer)), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func getBaseImages(buffer **uint16) (hr error) {
- if hr = procGetBaseImages.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procGetBaseImages.Addr(), 1, uintptr(unsafe.Pointer(buffer)), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func importLayer(info *driverInfo, id string, path string, descriptors []WC_LAYER_DESCRIPTOR) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(id)
- if hr != nil {
- return
- }
- var _p1 *uint16
- _p1, hr = syscall.UTF16PtrFromString(path)
- if hr != nil {
- return
- }
- return _importLayer(info, _p0, _p1, descriptors)
-}
-
-func _importLayer(info *driverInfo, id *uint16, path *uint16, descriptors []WC_LAYER_DESCRIPTOR) (hr error) {
- var _p2 *WC_LAYER_DESCRIPTOR
- if len(descriptors) > 0 {
- _p2 = &descriptors[0]
- }
- if hr = procImportLayer.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall6(procImportLayer.Addr(), 5, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(_p2)), uintptr(len(descriptors)), 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func layerExists(info *driverInfo, id string, exists *uint32) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(id)
- if hr != nil {
- return
- }
- return _layerExists(info, _p0, exists)
-}
-
-func _layerExists(info *driverInfo, id *uint16, exists *uint32) (hr error) {
- if hr = procLayerExists.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procLayerExists.Addr(), 3, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(exists)))
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func nameToGuid(name string, guid *_guid) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(name)
- if hr != nil {
- return
- }
- return _nameToGuid(_p0, guid)
-}
-
-func _nameToGuid(name *uint16, guid *_guid) (hr error) {
- if hr = procNameToGuid.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procNameToGuid.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(guid)), 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func prepareLayer(info *driverInfo, id string, descriptors []WC_LAYER_DESCRIPTOR) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(id)
- if hr != nil {
- return
- }
- return _prepareLayer(info, _p0, descriptors)
-}
-
-func _prepareLayer(info *driverInfo, id *uint16, descriptors []WC_LAYER_DESCRIPTOR) (hr error) {
- var _p1 *WC_LAYER_DESCRIPTOR
- if len(descriptors) > 0 {
- _p1 = &descriptors[0]
- }
- if hr = procPrepareLayer.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall6(procPrepareLayer.Addr(), 4, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), uintptr(unsafe.Pointer(_p1)), uintptr(len(descriptors)), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func unprepareLayer(info *driverInfo, id string) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(id)
- if hr != nil {
- return
- }
- return _unprepareLayer(info, _p0)
-}
-
-func _unprepareLayer(info *driverInfo, id *uint16) (hr error) {
- if hr = procUnprepareLayer.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procUnprepareLayer.Addr(), 2, uintptr(unsafe.Pointer(info)), uintptr(unsafe.Pointer(id)), 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func processBaseImage(path string) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(path)
- if hr != nil {
- return
- }
- return _processBaseImage(_p0)
-}
-
-func _processBaseImage(path *uint16) (hr error) {
- if hr = procProcessBaseImage.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procProcessBaseImage.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func processUtilityImage(path string) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(path)
- if hr != nil {
- return
- }
- return _processUtilityImage(_p0)
-}
-
-func _processUtilityImage(path *uint16) (hr error) {
- if hr = procProcessUtilityImage.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procProcessUtilityImage.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func grantVmAccess(vmid string, filepath string) (hr error) {
- var _p0 *uint16
- _p0, hr = syscall.UTF16PtrFromString(vmid)
- if hr != nil {
- return
- }
- var _p1 *uint16
- _p1, hr = syscall.UTF16PtrFromString(filepath)
- if hr != nil {
- return
- }
- return _grantVmAccess(_p0, _p1)
-}
-
-func _grantVmAccess(vmid *uint16, filepath *uint16) (hr error) {
- if hr = procGrantVmAccess.Find(); hr != nil {
- return
- }
- r0, _, _ := syscall.Syscall(procGrantVmAccess.Addr(), 2, uintptr(unsafe.Pointer(vmid)), uintptr(unsafe.Pointer(filepath)), 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
-
-func openVirtualDisk(virtualStorageType *virtualStorageType, path string, virtualDiskAccessMask uint32, flags uint32, parameters *openVirtualDiskParameters, handle *syscall.Handle) (err error) {
- var _p0 *uint16
- _p0, err = syscall.UTF16PtrFromString(path)
- if err != nil {
- return
- }
- return _openVirtualDisk(virtualStorageType, _p0, virtualDiskAccessMask, flags, parameters, handle)
-}
-
-func _openVirtualDisk(virtualStorageType *virtualStorageType, path *uint16, virtualDiskAccessMask uint32, flags uint32, parameters *openVirtualDiskParameters, handle *syscall.Handle) (err error) {
- r1, _, e1 := syscall.Syscall6(procOpenVirtualDisk.Addr(), 6, uintptr(unsafe.Pointer(virtualStorageType)), uintptr(unsafe.Pointer(path)), uintptr(virtualDiskAccessMask), uintptr(flags), uintptr(unsafe.Pointer(parameters)), uintptr(unsafe.Pointer(handle)))
- if r1 != 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func attachVirtualDisk(handle syscall.Handle, sd uintptr, flags uint32, providerFlags uint32, params uintptr, overlapped uintptr) (err error) {
- r1, _, e1 := syscall.Syscall6(procAttachVirtualDisk.Addr(), 6, uintptr(handle), uintptr(sd), uintptr(flags), uintptr(providerFlags), uintptr(params), uintptr(overlapped))
- if r1 != 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
-
-func getDiskFreeSpaceEx(directoryName string, freeBytesAvailableToCaller *int64, totalNumberOfBytes *int64, totalNumberOfFreeBytes *int64) (err error) {
- var _p0 *uint16
- _p0, err = syscall.UTF16PtrFromString(directoryName)
- if err != nil {
- return
- }
- return _getDiskFreeSpaceEx(_p0, freeBytesAvailableToCaller, totalNumberOfBytes, totalNumberOfFreeBytes)
-}
-
-func _getDiskFreeSpaceEx(directoryName *uint16, freeBytesAvailableToCaller *int64, totalNumberOfBytes *int64, totalNumberOfFreeBytes *int64) (err error) {
- r1, _, e1 := syscall.Syscall6(procGetDiskFreeSpaceExW.Addr(), 4, uintptr(unsafe.Pointer(directoryName)), uintptr(unsafe.Pointer(freeBytesAvailableToCaller)), uintptr(unsafe.Pointer(totalNumberOfBytes)), uintptr(unsafe.Pointer(totalNumberOfFreeBytes)), 0, 0)
- if r1 == 0 {
- if e1 != 0 {
- err = errnoErr(e1)
- } else {
- err = syscall.EINVAL
- }
- }
- return
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/layer.go b/vendor/github.com/Microsoft/hcsshim/layer.go
deleted file mode 100644
index 891616370..000000000
--- a/vendor/github.com/Microsoft/hcsshim/layer.go
+++ /dev/null
@@ -1,107 +0,0 @@
-package hcsshim
-
-import (
- "context"
- "crypto/sha1"
- "path/filepath"
-
- "github.com/Microsoft/go-winio/pkg/guid"
- "github.com/Microsoft/hcsshim/internal/wclayer"
-)
-
-func layerPath(info *DriverInfo, id string) string {
- return filepath.Join(info.HomeDir, id)
-}
-
-func ActivateLayer(info DriverInfo, id string) error {
- return wclayer.ActivateLayer(context.Background(), layerPath(&info, id))
-}
-func CreateLayer(info DriverInfo, id, parent string) error {
- return wclayer.CreateLayer(context.Background(), layerPath(&info, id), parent)
-}
-
-// New clients should use CreateScratchLayer instead. Kept in to preserve API compatibility.
-func CreateSandboxLayer(info DriverInfo, layerId, parentId string, parentLayerPaths []string) error {
- return wclayer.CreateScratchLayer(context.Background(), layerPath(&info, layerId), parentLayerPaths)
-}
-func CreateScratchLayer(info DriverInfo, layerId, parentId string, parentLayerPaths []string) error {
- return wclayer.CreateScratchLayer(context.Background(), layerPath(&info, layerId), parentLayerPaths)
-}
-func DeactivateLayer(info DriverInfo, id string) error {
- return wclayer.DeactivateLayer(context.Background(), layerPath(&info, id))
-}
-func DestroyLayer(info DriverInfo, id string) error {
- return wclayer.DestroyLayer(context.Background(), layerPath(&info, id))
-}
-
-// New clients should use ExpandScratchSize instead. Kept in to preserve API compatibility.
-func ExpandSandboxSize(info DriverInfo, layerId string, size uint64) error {
- return wclayer.ExpandScratchSize(context.Background(), layerPath(&info, layerId), size)
-}
-func ExpandScratchSize(info DriverInfo, layerId string, size uint64) error {
- return wclayer.ExpandScratchSize(context.Background(), layerPath(&info, layerId), size)
-}
-func ExportLayer(info DriverInfo, layerId string, exportFolderPath string, parentLayerPaths []string) error {
- return wclayer.ExportLayer(context.Background(), layerPath(&info, layerId), exportFolderPath, parentLayerPaths)
-}
-func GetLayerMountPath(info DriverInfo, id string) (string, error) {
- return wclayer.GetLayerMountPath(context.Background(), layerPath(&info, id))
-}
-func GetSharedBaseImages() (imageData string, err error) {
- return wclayer.GetSharedBaseImages(context.Background())
-}
-func ImportLayer(info DriverInfo, layerID string, importFolderPath string, parentLayerPaths []string) error {
- return wclayer.ImportLayer(context.Background(), layerPath(&info, layerID), importFolderPath, parentLayerPaths)
-}
-func LayerExists(info DriverInfo, id string) (bool, error) {
- return wclayer.LayerExists(context.Background(), layerPath(&info, id))
-}
-func PrepareLayer(info DriverInfo, layerId string, parentLayerPaths []string) error {
- return wclayer.PrepareLayer(context.Background(), layerPath(&info, layerId), parentLayerPaths)
-}
-func ProcessBaseLayer(path string) error {
- return wclayer.ProcessBaseLayer(context.Background(), path)
-}
-func ProcessUtilityVMImage(path string) error {
- return wclayer.ProcessUtilityVMImage(context.Background(), path)
-}
-func UnprepareLayer(info DriverInfo, layerId string) error {
- return wclayer.UnprepareLayer(context.Background(), layerPath(&info, layerId))
-}
-
-type DriverInfo struct {
- Flavour int
- HomeDir string
-}
-
-type GUID [16]byte
-
-func NameToGuid(name string) (id GUID, err error) {
- g, err := wclayer.NameToGuid(context.Background(), name)
- return g.ToWindowsArray(), err
-}
-
-func NewGUID(source string) *GUID {
- h := sha1.Sum([]byte(source))
- var g GUID
- copy(g[0:], h[0:16])
- return &g
-}
-
-func (g *GUID) ToString() string {
- return guid.FromWindowsArray(*g).String()
-}
-
-type LayerReader = wclayer.LayerReader
-
-func NewLayerReader(info DriverInfo, layerID string, parentLayerPaths []string) (LayerReader, error) {
- return wclayer.NewLayerReader(context.Background(), layerPath(&info, layerID), parentLayerPaths)
-}
-
-type LayerWriter = wclayer.LayerWriter
-
-func NewLayerWriter(info DriverInfo, layerID string, parentLayerPaths []string) (LayerWriter, error) {
- return wclayer.NewLayerWriter(context.Background(), layerPath(&info, layerID), parentLayerPaths)
-}
-
-type WC_LAYER_DESCRIPTOR = wclayer.WC_LAYER_DESCRIPTOR
diff --git a/vendor/github.com/Microsoft/hcsshim/osversion/osversion_windows.go b/vendor/github.com/Microsoft/hcsshim/osversion/osversion_windows.go
deleted file mode 100644
index 477fe7078..000000000
--- a/vendor/github.com/Microsoft/hcsshim/osversion/osversion_windows.go
+++ /dev/null
@@ -1,57 +0,0 @@
-package osversion
-
-import (
- "fmt"
-
- "golang.org/x/sys/windows"
-)
-
-// OSVersion is a wrapper for Windows version information
-// https://msdn.microsoft.com/en-us/library/windows/desktop/ms724439(v=vs.85).aspx
-type OSVersion struct {
- Version uint32
- MajorVersion uint8
- MinorVersion uint8
- Build uint16
-}
-
-// https://msdn.microsoft.com/en-us/library/windows/desktop/ms724833(v=vs.85).aspx
-type osVersionInfoEx struct {
- OSVersionInfoSize uint32
- MajorVersion uint32
- MinorVersion uint32
- BuildNumber uint32
- PlatformID uint32
- CSDVersion [128]uint16
- ServicePackMajor uint16
- ServicePackMinor uint16
- SuiteMask uint16
- ProductType byte
- Reserve byte
-}
-
-// Get gets the operating system version on Windows.
-// The calling application must be manifested to get the correct version information.
-func Get() OSVersion {
- var err error
- osv := OSVersion{}
- osv.Version, err = windows.GetVersion()
- if err != nil {
- // GetVersion never fails.
- panic(err)
- }
- osv.MajorVersion = uint8(osv.Version & 0xFF)
- osv.MinorVersion = uint8(osv.Version >> 8 & 0xFF)
- osv.Build = uint16(osv.Version >> 16)
- return osv
-}
-
-// Build gets the build-number on Windows
-// The calling application must be manifested to get the correct version information.
-func Build() uint16 {
- return Get().Build
-}
-
-func (osv OSVersion) ToString() string {
- return fmt.Sprintf("%d.%d.%d", osv.MajorVersion, osv.MinorVersion, osv.Build)
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/osversion/windowsbuilds.go b/vendor/github.com/Microsoft/hcsshim/osversion/windowsbuilds.go
deleted file mode 100644
index 726d1c8c1..000000000
--- a/vendor/github.com/Microsoft/hcsshim/osversion/windowsbuilds.go
+++ /dev/null
@@ -1,27 +0,0 @@
-package osversion
-
-const (
- // RS1 (version 1607, codename "Redstone 1") corresponds to Windows Server
- // 2016 (ltsc2016) and Windows 10 (Anniversary Update).
- RS1 = 14393
-
- // RS2 (version 1703, codename "Redstone 2") was a client-only update, and
- // corresponds to Windows 10 (Creators Update).
- RS2 = 15063
-
- // RS3 (version 1709, codename "Redstone 3") corresponds to Windows Server
- // 1709 (Semi-Annual Channel (SAC)), and Windows 10 (Fall Creators Update).
- RS3 = 16299
-
- // RS4 (version 1803, codename "Redstone 4") corresponds to Windows Server
- // 1803 (Semi-Annual Channel (SAC)), and Windows 10 (April 2018 Update).
- RS4 = 17134
-
- // RS5 (version 1809, codename "Redstone 5") corresponds to Windows Server
- // 2019 (ltsc2019), and Windows 10 (October 2018 Update).
- RS5 = 17763
-
- // V19H1 (version 1903) corresponds to Windows Server 1903 (semi-annual
- // channel).
- V19H1 = 18362
-)
diff --git a/vendor/github.com/Microsoft/hcsshim/process.go b/vendor/github.com/Microsoft/hcsshim/process.go
deleted file mode 100644
index 3362c6833..000000000
--- a/vendor/github.com/Microsoft/hcsshim/process.go
+++ /dev/null
@@ -1,98 +0,0 @@
-package hcsshim
-
-import (
- "context"
- "io"
- "sync"
- "time"
-
- "github.com/Microsoft/hcsshim/internal/hcs"
-)
-
-// ContainerError is an error encountered in HCS
-type process struct {
- p *hcs.Process
- waitOnce sync.Once
- waitCh chan struct{}
- waitErr error
-}
-
-// Pid returns the process ID of the process within the container.
-func (process *process) Pid() int {
- return process.p.Pid()
-}
-
-// Kill signals the process to terminate but does not wait for it to finish terminating.
-func (process *process) Kill() error {
- found, err := process.p.Kill(context.Background())
- if err != nil {
- return convertProcessError(err, process)
- }
- if !found {
- return &ProcessError{Process: process, Err: ErrElementNotFound, Operation: "hcsshim::Process::Kill"}
- }
- return nil
-}
-
-// Wait waits for the process to exit.
-func (process *process) Wait() error {
- return convertProcessError(process.p.Wait(), process)
-}
-
-// WaitTimeout waits for the process to exit or the duration to elapse. It returns
-// false if timeout occurs.
-func (process *process) WaitTimeout(timeout time.Duration) error {
- process.waitOnce.Do(func() {
- process.waitCh = make(chan struct{})
- go func() {
- process.waitErr = process.Wait()
- close(process.waitCh)
- }()
- })
- t := time.NewTimer(timeout)
- defer t.Stop()
- select {
- case <-t.C:
- return &ProcessError{Process: process, Err: ErrTimeout, Operation: "hcsshim::Process::Wait"}
- case <-process.waitCh:
- return process.waitErr
- }
-}
-
-// ExitCode returns the exit code of the process. The process must have
-// already terminated.
-func (process *process) ExitCode() (int, error) {
- code, err := process.p.ExitCode()
- if err != nil {
- err = convertProcessError(err, process)
- }
- return code, err
-}
-
-// ResizeConsole resizes the console of the process.
-func (process *process) ResizeConsole(width, height uint16) error {
- return convertProcessError(process.p.ResizeConsole(context.Background(), width, height), process)
-}
-
-// Stdio returns the stdin, stdout, and stderr pipes, respectively. Closing
-// these pipes does not close the underlying pipes; it should be possible to
-// call this multiple times to get multiple interfaces.
-func (process *process) Stdio() (io.WriteCloser, io.ReadCloser, io.ReadCloser, error) {
- stdin, stdout, stderr, err := process.p.StdioLegacy()
- if err != nil {
- err = convertProcessError(err, process)
- }
- return stdin, stdout, stderr, err
-}
-
-// CloseStdin closes the write side of the stdin pipe so that the process is
-// notified on the read side that there is no more data in stdin.
-func (process *process) CloseStdin() error {
- return convertProcessError(process.p.CloseStdin(context.Background()), process)
-}
-
-// Close cleans up any state associated with the process but does not kill
-// or wait on it.
-func (process *process) Close() error {
- return convertProcessError(process.p.Close(), process)
-}
diff --git a/vendor/github.com/Microsoft/hcsshim/zsyscall_windows.go b/vendor/github.com/Microsoft/hcsshim/zsyscall_windows.go
deleted file mode 100644
index 8bed84857..000000000
--- a/vendor/github.com/Microsoft/hcsshim/zsyscall_windows.go
+++ /dev/null
@@ -1,54 +0,0 @@
-// Code generated mksyscall_windows.exe DO NOT EDIT
-
-package hcsshim
-
-import (
- "syscall"
- "unsafe"
-
- "golang.org/x/sys/windows"
-)
-
-var _ unsafe.Pointer
-
-// Do the interface allocations only once for common
-// Errno values.
-const (
- errnoERROR_IO_PENDING = 997
-)
-
-var (
- errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING)
-)
-
-// errnoErr returns common boxed Errno values, to prevent
-// allocations at runtime.
-func errnoErr(e syscall.Errno) error {
- switch e {
- case 0:
- return nil
- case errnoERROR_IO_PENDING:
- return errERROR_IO_PENDING
- }
- // TODO: add more here, after collecting data on the common
- // error values see on Windows. (perhaps when running
- // all.bat?)
- return e
-}
-
-var (
- modiphlpapi = windows.NewLazySystemDLL("iphlpapi.dll")
-
- procSetCurrentThreadCompartmentId = modiphlpapi.NewProc("SetCurrentThreadCompartmentId")
-)
-
-func SetCurrentThreadCompartmentId(compartmentId uint32) (hr error) {
- r0, _, _ := syscall.Syscall(procSetCurrentThreadCompartmentId.Addr(), 1, uintptr(compartmentId), 0, 0)
- if int32(r0) < 0 {
- if r0&0x1fff0000 == 0x00070000 {
- r0 &= 0xffff
- }
- hr = syscall.Errno(r0)
- }
- return
-}
diff --git a/vendor/github.com/beorn7/perks/LICENSE b/vendor/github.com/beorn7/perks/LICENSE
deleted file mode 100644
index 339177be6..000000000
--- a/vendor/github.com/beorn7/perks/LICENSE
+++ /dev/null
@@ -1,20 +0,0 @@
-Copyright (C) 2013 Blake Mizerany
-
-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/vendor/github.com/beorn7/perks/README.md b/vendor/github.com/beorn7/perks/README.md
deleted file mode 100644
index fc0577770..000000000
--- a/vendor/github.com/beorn7/perks/README.md
+++ /dev/null
@@ -1,31 +0,0 @@
-# Perks for Go (golang.org)
-
-Perks contains the Go package quantile that computes approximate quantiles over
-an unbounded data stream within low memory and CPU bounds.
-
-For more information and examples, see:
-http://godoc.org/github.com/bmizerany/perks
-
-A very special thank you and shout out to Graham Cormode (Rutgers University),
-Flip Korn (AT&T Labs–Research), S. Muthukrishnan (Rutgers University), and
-Divesh Srivastava (AT&T Labs–Research) for their research and publication of
-[Effective Computation of Biased Quantiles over Data Streams](http://www.cs.rutgers.edu/~muthu/bquant.pdf)
-
-Thank you, also:
-* Armon Dadgar (@armon)
-* Andrew Gerrand (@nf)
-* Brad Fitzpatrick (@bradfitz)
-* Keith Rarick (@kr)
-
-FAQ:
-
-Q: Why not move the quantile package into the project root?
-A: I want to add more packages to perks later.
-
-Copyright (C) 2013 Blake Mizerany
-
-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/vendor/github.com/beorn7/perks/go.mod b/vendor/github.com/beorn7/perks/go.mod
deleted file mode 100644
index c4022f212..000000000
--- a/vendor/github.com/beorn7/perks/go.mod
+++ /dev/null
@@ -1,3 +0,0 @@
-module github.com/beorn7/perks
-
-go 1.11
diff --git a/vendor/github.com/beorn7/perks/quantile/stream.go b/vendor/github.com/beorn7/perks/quantile/stream.go
deleted file mode 100644
index d7d14f8eb..000000000
--- a/vendor/github.com/beorn7/perks/quantile/stream.go
+++ /dev/null
@@ -1,316 +0,0 @@
-// Package quantile computes approximate quantiles over an unbounded data
-// stream within low memory and CPU bounds.
-//
-// A small amount of accuracy is traded to achieve the above properties.
-//
-// Multiple streams can be merged before calling Query to generate a single set
-// of results. This is meaningful when the streams represent the same type of
-// data. See Merge and Samples.
-//
-// For more detailed information about the algorithm used, see:
-//
-// Effective Computation of Biased Quantiles over Data Streams
-//
-// http://www.cs.rutgers.edu/~muthu/bquant.pdf
-package quantile
-
-import (
- "math"
- "sort"
-)
-
-// Sample holds an observed value and meta information for compression. JSON
-// tags have been added for convenience.
-type Sample struct {
- Value float64 `json:",string"`
- Width float64 `json:",string"`
- Delta float64 `json:",string"`
-}
-
-// Samples represents a slice of samples. It implements sort.Interface.
-type Samples []Sample
-
-func (a Samples) Len() int { return len(a) }
-func (a Samples) Less(i, j int) bool { return a[i].Value < a[j].Value }
-func (a Samples) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
-
-type invariant func(s *stream, r float64) float64
-
-// NewLowBiased returns an initialized Stream for low-biased quantiles
-// (e.g. 0.01, 0.1, 0.5) where the needed quantiles are not known a priori, but
-// error guarantees can still be given even for the lower ranks of the data
-// distribution.
-//
-// The provided epsilon is a relative error, i.e. the true quantile of a value
-// returned by a query is guaranteed to be within (1±Epsilon)*Quantile.
-//
-// See http://www.cs.rutgers.edu/~muthu/bquant.pdf for time, space, and error
-// properties.
-func NewLowBiased(epsilon float64) *Stream {
- ƒ := func(s *stream, r float64) float64 {
- return 2 * epsilon * r
- }
- return newStream(ƒ)
-}
-
-// NewHighBiased returns an initialized Stream for high-biased quantiles
-// (e.g. 0.01, 0.1, 0.5) where the needed quantiles are not known a priori, but
-// error guarantees can still be given even for the higher ranks of the data
-// distribution.
-//
-// The provided epsilon is a relative error, i.e. the true quantile of a value
-// returned by a query is guaranteed to be within 1-(1±Epsilon)*(1-Quantile).
-//
-// See http://www.cs.rutgers.edu/~muthu/bquant.pdf for time, space, and error
-// properties.
-func NewHighBiased(epsilon float64) *Stream {
- ƒ := func(s *stream, r float64) float64 {
- return 2 * epsilon * (s.n - r)
- }
- return newStream(ƒ)
-}
-
-// NewTargeted returns an initialized Stream concerned with a particular set of
-// quantile values that are supplied a priori. Knowing these a priori reduces
-// space and computation time. The targets map maps the desired quantiles to
-// their absolute errors, i.e. the true quantile of a value returned by a query
-// is guaranteed to be within (Quantile±Epsilon).
-//
-// See http://www.cs.rutgers.edu/~muthu/bquant.pdf for time, space, and error properties.
-func NewTargeted(targetMap map[float64]float64) *Stream {
- // Convert map to slice to avoid slow iterations on a map.
- // ƒ is called on the hot path, so converting the map to a slice
- // beforehand results in significant CPU savings.
- targets := targetMapToSlice(targetMap)
-
- ƒ := func(s *stream, r float64) float64 {
- var m = math.MaxFloat64
- var f float64
- for _, t := range targets {
- if t.quantile*s.n <= r {
- f = (2 * t.epsilon * r) / t.quantile
- } else {
- f = (2 * t.epsilon * (s.n - r)) / (1 - t.quantile)
- }
- if f < m {
- m = f
- }
- }
- return m
- }
- return newStream(ƒ)
-}
-
-type target struct {
- quantile float64
- epsilon float64
-}
-
-func targetMapToSlice(targetMap map[float64]float64) []target {
- targets := make([]target, 0, len(targetMap))
-
- for quantile, epsilon := range targetMap {
- t := target{
- quantile: quantile,
- epsilon: epsilon,
- }
- targets = append(targets, t)
- }
-
- return targets
-}
-
-// Stream computes quantiles for a stream of float64s. It is not thread-safe by
-// design. Take care when using across multiple goroutines.
-type Stream struct {
- *stream
- b Samples
- sorted bool
-}
-
-func newStream(ƒ invariant) *Stream {
- x := &stream{ƒ: ƒ}
- return &Stream{x, make(Samples, 0, 500), true}
-}
-
-// Insert inserts v into the stream.
-func (s *Stream) Insert(v float64) {
- s.insert(Sample{Value: v, Width: 1})
-}
-
-func (s *Stream) insert(sample Sample) {
- s.b = append(s.b, sample)
- s.sorted = false
- if len(s.b) == cap(s.b) {
- s.flush()
- }
-}
-
-// Query returns the computed qth percentiles value. If s was created with
-// NewTargeted, and q is not in the set of quantiles provided a priori, Query
-// will return an unspecified result.
-func (s *Stream) Query(q float64) float64 {
- if !s.flushed() {
- // Fast path when there hasn't been enough data for a flush;
- // this also yields better accuracy for small sets of data.
- l := len(s.b)
- if l == 0 {
- return 0
- }
- i := int(math.Ceil(float64(l) * q))
- if i > 0 {
- i -= 1
- }
- s.maybeSort()
- return s.b[i].Value
- }
- s.flush()
- return s.stream.query(q)
-}
-
-// Merge merges samples into the underlying streams samples. This is handy when
-// merging multiple streams from separate threads, database shards, etc.
-//
-// ATTENTION: This method is broken and does not yield correct results. The
-// underlying algorithm is not capable of merging streams correctly.
-func (s *Stream) Merge(samples Samples) {
- sort.Sort(samples)
- s.stream.merge(samples)
-}
-
-// Reset reinitializes and clears the list reusing the samples buffer memory.
-func (s *Stream) Reset() {
- s.stream.reset()
- s.b = s.b[:0]
-}
-
-// Samples returns stream samples held by s.
-func (s *Stream) Samples() Samples {
- if !s.flushed() {
- return s.b
- }
- s.flush()
- return s.stream.samples()
-}
-
-// Count returns the total number of samples observed in the stream
-// since initialization.
-func (s *Stream) Count() int {
- return len(s.b) + s.stream.count()
-}
-
-func (s *Stream) flush() {
- s.maybeSort()
- s.stream.merge(s.b)
- s.b = s.b[:0]
-}
-
-func (s *Stream) maybeSort() {
- if !s.sorted {
- s.sorted = true
- sort.Sort(s.b)
- }
-}
-
-func (s *Stream) flushed() bool {
- return len(s.stream.l) > 0
-}
-
-type stream struct {
- n float64
- l []Sample
- ƒ invariant
-}
-
-func (s *stream) reset() {
- s.l = s.l[:0]
- s.n = 0
-}
-
-func (s *stream) insert(v float64) {
- s.merge(Samples{{v, 1, 0}})
-}
-
-func (s *stream) merge(samples Samples) {
- // TODO(beorn7): This tries to merge not only individual samples, but
- // whole summaries. The paper doesn't mention merging summaries at
- // all. Unittests show that the merging is inaccurate. Find out how to
- // do merges properly.
- var r float64
- i := 0
- for _, sample := range samples {
- for ; i < len(s.l); i++ {
- c := s.l[i]
- if c.Value > sample.Value {
- // Insert at position i.
- s.l = append(s.l, Sample{})
- copy(s.l[i+1:], s.l[i:])
- s.l[i] = Sample{
- sample.Value,
- sample.Width,
- math.Max(sample.Delta, math.Floor(s.ƒ(s, r))-1),
- // TODO(beorn7): How to calculate delta correctly?
- }
- i++
- goto inserted
- }
- r += c.Width
- }
- s.l = append(s.l, Sample{sample.Value, sample.Width, 0})
- i++
- inserted:
- s.n += sample.Width
- r += sample.Width
- }
- s.compress()
-}
-
-func (s *stream) count() int {
- return int(s.n)
-}
-
-func (s *stream) query(q float64) float64 {
- t := math.Ceil(q * s.n)
- t += math.Ceil(s.ƒ(s, t) / 2)
- p := s.l[0]
- var r float64
- for _, c := range s.l[1:] {
- r += p.Width
- if r+c.Width+c.Delta > t {
- return p.Value
- }
- p = c
- }
- return p.Value
-}
-
-func (s *stream) compress() {
- if len(s.l) < 2 {
- return
- }
- x := s.l[len(s.l)-1]
- xi := len(s.l) - 1
- r := s.n - 1 - x.Width
-
- for i := len(s.l) - 2; i >= 0; i-- {
- c := s.l[i]
- if c.Width+x.Width+x.Delta <= s.ƒ(s, r) {
- x.Width += c.Width
- s.l[xi] = x
- // Remove element at i.
- copy(s.l[i:], s.l[i+1:])
- s.l = s.l[:len(s.l)-1]
- xi -= 1
- } else {
- x = c
- xi = i
- }
- r -= c.Width
- }
-}
-
-func (s *stream) samples() Samples {
- samples := make(Samples, len(s.l))
- copy(samples, s.l)
- return samples
-}
diff --git a/vendor/github.com/cespare/xxhash/v2/LICENSE.txt b/vendor/github.com/cespare/xxhash/v2/LICENSE.txt
deleted file mode 100644
index 24b53065f..000000000
--- a/vendor/github.com/cespare/xxhash/v2/LICENSE.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-Copyright (c) 2016 Caleb Spare
-
-MIT License
-
-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/vendor/github.com/cespare/xxhash/v2/README.md b/vendor/github.com/cespare/xxhash/v2/README.md
deleted file mode 100644
index 2fd8693c2..000000000
--- a/vendor/github.com/cespare/xxhash/v2/README.md
+++ /dev/null
@@ -1,67 +0,0 @@
-# xxhash
-
-[](https://godoc.org/github.com/cespare/xxhash)
-[](https://travis-ci.org/cespare/xxhash)
-
-xxhash is a Go implementation of the 64-bit
-[xxHash](http://cyan4973.github.io/xxHash/) algorithm, XXH64. This is a
-high-quality hashing algorithm that is much faster than anything in the Go
-standard library.
-
-This package provides a straightforward API:
-
-```
-func Sum64(b []byte) uint64
-func Sum64String(s string) uint64
-type Digest struct{ ... }
- func New() *Digest
-```
-
-The `Digest` type implements hash.Hash64. Its key methods are:
-
-```
-func (*Digest) Write([]byte) (int, error)
-func (*Digest) WriteString(string) (int, error)
-func (*Digest) Sum64() uint64
-```
-
-This implementation provides a fast pure-Go implementation and an even faster
-assembly implementation for amd64.
-
-## Compatibility
-
-This package is in a module and the latest code is in version 2 of the module.
-You need a version of Go with at least "minimal module compatibility" to use
-github.com/cespare/xxhash/v2:
-
-* 1.9.7+ for Go 1.9
-* 1.10.3+ for Go 1.10
-* Go 1.11 or later
-
-I recommend using the latest release of Go.
-
-## Benchmarks
-
-Here are some quick benchmarks comparing the pure-Go and assembly
-implementations of Sum64.
-
-| input size | purego | asm |
-| --- | --- | --- |
-| 5 B | 979.66 MB/s | 1291.17 MB/s |
-| 100 B | 7475.26 MB/s | 7973.40 MB/s |
-| 4 KB | 17573.46 MB/s | 17602.65 MB/s |
-| 10 MB | 17131.46 MB/s | 17142.16 MB/s |
-
-These numbers were generated on Ubuntu 18.04 with an Intel i7-8700K CPU using
-the following commands under Go 1.11.2:
-
-```
-$ go test -tags purego -benchtime 10s -bench '/xxhash,direct,bytes'
-$ go test -benchtime 10s -bench '/xxhash,direct,bytes'
-```
-
-## Projects using this package
-
-- [InfluxDB](https://github.com/influxdata/influxdb)
-- [Prometheus](https://github.com/prometheus/prometheus)
-- [FreeCache](https://github.com/coocood/freecache)
diff --git a/vendor/github.com/cespare/xxhash/v2/go.mod b/vendor/github.com/cespare/xxhash/v2/go.mod
deleted file mode 100644
index 49f67608b..000000000
--- a/vendor/github.com/cespare/xxhash/v2/go.mod
+++ /dev/null
@@ -1,3 +0,0 @@
-module github.com/cespare/xxhash/v2
-
-go 1.11
diff --git a/vendor/github.com/cespare/xxhash/v2/xxhash.go b/vendor/github.com/cespare/xxhash/v2/xxhash.go
deleted file mode 100644
index db0b35fbe..000000000
--- a/vendor/github.com/cespare/xxhash/v2/xxhash.go
+++ /dev/null
@@ -1,236 +0,0 @@
-// Package xxhash implements the 64-bit variant of xxHash (XXH64) as described
-// at http://cyan4973.github.io/xxHash/.
-package xxhash
-
-import (
- "encoding/binary"
- "errors"
- "math/bits"
-)
-
-const (
- prime1 uint64 = 11400714785074694791
- prime2 uint64 = 14029467366897019727
- prime3 uint64 = 1609587929392839161
- prime4 uint64 = 9650029242287828579
- prime5 uint64 = 2870177450012600261
-)
-
-// NOTE(caleb): I'm using both consts and vars of the primes. Using consts where
-// possible in the Go code is worth a small (but measurable) performance boost
-// by avoiding some MOVQs. Vars are needed for the asm and also are useful for
-// convenience in the Go code in a few places where we need to intentionally
-// avoid constant arithmetic (e.g., v1 := prime1 + prime2 fails because the
-// result overflows a uint64).
-var (
- prime1v = prime1
- prime2v = prime2
- prime3v = prime3
- prime4v = prime4
- prime5v = prime5
-)
-
-// Digest implements hash.Hash64.
-type Digest struct {
- v1 uint64
- v2 uint64
- v3 uint64
- v4 uint64
- total uint64
- mem [32]byte
- n int // how much of mem is used
-}
-
-// New creates a new Digest that computes the 64-bit xxHash algorithm.
-func New() *Digest {
- var d Digest
- d.Reset()
- return &d
-}
-
-// Reset clears the Digest's state so that it can be reused.
-func (d *Digest) Reset() {
- d.v1 = prime1v + prime2
- d.v2 = prime2
- d.v3 = 0
- d.v4 = -prime1v
- d.total = 0
- d.n = 0
-}
-
-// Size always returns 8 bytes.
-func (d *Digest) Size() int { return 8 }
-
-// BlockSize always returns 32 bytes.
-func (d *Digest) BlockSize() int { return 32 }
-
-// Write adds more data to d. It always returns len(b), nil.
-func (d *Digest) Write(b []byte) (n int, err error) {
- n = len(b)
- d.total += uint64(n)
-
- if d.n+n < 32 {
- // This new data doesn't even fill the current block.
- copy(d.mem[d.n:], b)
- d.n += n
- return
- }
-
- if d.n > 0 {
- // Finish off the partial block.
- copy(d.mem[d.n:], b)
- d.v1 = round(d.v1, u64(d.mem[0:8]))
- d.v2 = round(d.v2, u64(d.mem[8:16]))
- d.v3 = round(d.v3, u64(d.mem[16:24]))
- d.v4 = round(d.v4, u64(d.mem[24:32]))
- b = b[32-d.n:]
- d.n = 0
- }
-
- if len(b) >= 32 {
- // One or more full blocks left.
- nw := writeBlocks(d, b)
- b = b[nw:]
- }
-
- // Store any remaining partial block.
- copy(d.mem[:], b)
- d.n = len(b)
-
- return
-}
-
-// Sum appends the current hash to b and returns the resulting slice.
-func (d *Digest) Sum(b []byte) []byte {
- s := d.Sum64()
- return append(
- b,
- byte(s>>56),
- byte(s>>48),
- byte(s>>40),
- byte(s>>32),
- byte(s>>24),
- byte(s>>16),
- byte(s>>8),
- byte(s),
- )
-}
-
-// Sum64 returns the current hash.
-func (d *Digest) Sum64() uint64 {
- var h uint64
-
- if d.total >= 32 {
- v1, v2, v3, v4 := d.v1, d.v2, d.v3, d.v4
- h = rol1(v1) + rol7(v2) + rol12(v3) + rol18(v4)
- h = mergeRound(h, v1)
- h = mergeRound(h, v2)
- h = mergeRound(h, v3)
- h = mergeRound(h, v4)
- } else {
- h = d.v3 + prime5
- }
-
- h += d.total
-
- i, end := 0, d.n
- for ; i+8 <= end; i += 8 {
- k1 := round(0, u64(d.mem[i:i+8]))
- h ^= k1
- h = rol27(h)*prime1 + prime4
- }
- if i+4 <= end {
- h ^= uint64(u32(d.mem[i:i+4])) * prime1
- h = rol23(h)*prime2 + prime3
- i += 4
- }
- for i < end {
- h ^= uint64(d.mem[i]) * prime5
- h = rol11(h) * prime1
- i++
- }
-
- h ^= h >> 33
- h *= prime2
- h ^= h >> 29
- h *= prime3
- h ^= h >> 32
-
- return h
-}
-
-const (
- magic = "xxh\x06"
- marshaledSize = len(magic) + 8*5 + 32
-)
-
-// MarshalBinary implements the encoding.BinaryMarshaler interface.
-func (d *Digest) MarshalBinary() ([]byte, error) {
- b := make([]byte, 0, marshaledSize)
- b = append(b, magic...)
- b = appendUint64(b, d.v1)
- b = appendUint64(b, d.v2)
- b = appendUint64(b, d.v3)
- b = appendUint64(b, d.v4)
- b = appendUint64(b, d.total)
- b = append(b, d.mem[:d.n]...)
- b = b[:len(b)+len(d.mem)-d.n]
- return b, nil
-}
-
-// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
-func (d *Digest) UnmarshalBinary(b []byte) error {
- if len(b) < len(magic) || string(b[:len(magic)]) != magic {
- return errors.New("xxhash: invalid hash state identifier")
- }
- if len(b) != marshaledSize {
- return errors.New("xxhash: invalid hash state size")
- }
- b = b[len(magic):]
- b, d.v1 = consumeUint64(b)
- b, d.v2 = consumeUint64(b)
- b, d.v3 = consumeUint64(b)
- b, d.v4 = consumeUint64(b)
- b, d.total = consumeUint64(b)
- copy(d.mem[:], b)
- b = b[len(d.mem):]
- d.n = int(d.total % uint64(len(d.mem)))
- return nil
-}
-
-func appendUint64(b []byte, x uint64) []byte {
- var a [8]byte
- binary.LittleEndian.PutUint64(a[:], x)
- return append(b, a[:]...)
-}
-
-func consumeUint64(b []byte) ([]byte, uint64) {
- x := u64(b)
- return b[8:], x
-}
-
-func u64(b []byte) uint64 { return binary.LittleEndian.Uint64(b) }
-func u32(b []byte) uint32 { return binary.LittleEndian.Uint32(b) }
-
-func round(acc, input uint64) uint64 {
- acc += input * prime2
- acc = rol31(acc)
- acc *= prime1
- return acc
-}
-
-func mergeRound(acc, val uint64) uint64 {
- val = round(0, val)
- acc ^= val
- acc = acc*prime1 + prime4
- return acc
-}
-
-func rol1(x uint64) uint64 { return bits.RotateLeft64(x, 1) }
-func rol7(x uint64) uint64 { return bits.RotateLeft64(x, 7) }
-func rol11(x uint64) uint64 { return bits.RotateLeft64(x, 11) }
-func rol12(x uint64) uint64 { return bits.RotateLeft64(x, 12) }
-func rol18(x uint64) uint64 { return bits.RotateLeft64(x, 18) }
-func rol23(x uint64) uint64 { return bits.RotateLeft64(x, 23) }
-func rol27(x uint64) uint64 { return bits.RotateLeft64(x, 27) }
-func rol31(x uint64) uint64 { return bits.RotateLeft64(x, 31) }
diff --git a/vendor/github.com/cespare/xxhash/v2/xxhash_amd64.go b/vendor/github.com/cespare/xxhash/v2/xxhash_amd64.go
deleted file mode 100644
index ad14b807f..000000000
--- a/vendor/github.com/cespare/xxhash/v2/xxhash_amd64.go
+++ /dev/null
@@ -1,13 +0,0 @@
-// +build !appengine
-// +build gc
-// +build !purego
-
-package xxhash
-
-// Sum64 computes the 64-bit xxHash digest of b.
-//
-//go:noescape
-func Sum64(b []byte) uint64
-
-//go:noescape
-func writeBlocks(d *Digest, b []byte) int
diff --git a/vendor/github.com/cespare/xxhash/v2/xxhash_amd64.s b/vendor/github.com/cespare/xxhash/v2/xxhash_amd64.s
deleted file mode 100644
index d580e32ae..000000000
--- a/vendor/github.com/cespare/xxhash/v2/xxhash_amd64.s
+++ /dev/null
@@ -1,215 +0,0 @@
-// +build !appengine
-// +build gc
-// +build !purego
-
-#include "textflag.h"
-
-// Register allocation:
-// AX h
-// CX pointer to advance through b
-// DX n
-// BX loop end
-// R8 v1, k1
-// R9 v2
-// R10 v3
-// R11 v4
-// R12 tmp
-// R13 prime1v
-// R14 prime2v
-// R15 prime4v
-
-// round reads from and advances the buffer pointer in CX.
-// It assumes that R13 has prime1v and R14 has prime2v.
-#define round(r) \
- MOVQ (CX), R12 \
- ADDQ $8, CX \
- IMULQ R14, R12 \
- ADDQ R12, r \
- ROLQ $31, r \
- IMULQ R13, r
-
-// mergeRound applies a merge round on the two registers acc and val.
-// It assumes that R13 has prime1v, R14 has prime2v, and R15 has prime4v.
-#define mergeRound(acc, val) \
- IMULQ R14, val \
- ROLQ $31, val \
- IMULQ R13, val \
- XORQ val, acc \
- IMULQ R13, acc \
- ADDQ R15, acc
-
-// func Sum64(b []byte) uint64
-TEXT ·Sum64(SB), NOSPLIT, $0-32
- // Load fixed primes.
- MOVQ ·prime1v(SB), R13
- MOVQ ·prime2v(SB), R14
- MOVQ ·prime4v(SB), R15
-
- // Load slice.
- MOVQ b_base+0(FP), CX
- MOVQ b_len+8(FP), DX
- LEAQ (CX)(DX*1), BX
-
- // The first loop limit will be len(b)-32.
- SUBQ $32, BX
-
- // Check whether we have at least one block.
- CMPQ DX, $32
- JLT noBlocks
-
- // Set up initial state (v1, v2, v3, v4).
- MOVQ R13, R8
- ADDQ R14, R8
- MOVQ R14, R9
- XORQ R10, R10
- XORQ R11, R11
- SUBQ R13, R11
-
- // Loop until CX > BX.
-blockLoop:
- round(R8)
- round(R9)
- round(R10)
- round(R11)
-
- CMPQ CX, BX
- JLE blockLoop
-
- MOVQ R8, AX
- ROLQ $1, AX
- MOVQ R9, R12
- ROLQ $7, R12
- ADDQ R12, AX
- MOVQ R10, R12
- ROLQ $12, R12
- ADDQ R12, AX
- MOVQ R11, R12
- ROLQ $18, R12
- ADDQ R12, AX
-
- mergeRound(AX, R8)
- mergeRound(AX, R9)
- mergeRound(AX, R10)
- mergeRound(AX, R11)
-
- JMP afterBlocks
-
-noBlocks:
- MOVQ ·prime5v(SB), AX
-
-afterBlocks:
- ADDQ DX, AX
-
- // Right now BX has len(b)-32, and we want to loop until CX > len(b)-8.
- ADDQ $24, BX
-
- CMPQ CX, BX
- JG fourByte
-
-wordLoop:
- // Calculate k1.
- MOVQ (CX), R8
- ADDQ $8, CX
- IMULQ R14, R8
- ROLQ $31, R8
- IMULQ R13, R8
-
- XORQ R8, AX
- ROLQ $27, AX
- IMULQ R13, AX
- ADDQ R15, AX
-
- CMPQ CX, BX
- JLE wordLoop
-
-fourByte:
- ADDQ $4, BX
- CMPQ CX, BX
- JG singles
-
- MOVL (CX), R8
- ADDQ $4, CX
- IMULQ R13, R8
- XORQ R8, AX
-
- ROLQ $23, AX
- IMULQ R14, AX
- ADDQ ·prime3v(SB), AX
-
-singles:
- ADDQ $4, BX
- CMPQ CX, BX
- JGE finalize
-
-singlesLoop:
- MOVBQZX (CX), R12
- ADDQ $1, CX
- IMULQ ·prime5v(SB), R12
- XORQ R12, AX
-
- ROLQ $11, AX
- IMULQ R13, AX
-
- CMPQ CX, BX
- JL singlesLoop
-
-finalize:
- MOVQ AX, R12
- SHRQ $33, R12
- XORQ R12, AX
- IMULQ R14, AX
- MOVQ AX, R12
- SHRQ $29, R12
- XORQ R12, AX
- IMULQ ·prime3v(SB), AX
- MOVQ AX, R12
- SHRQ $32, R12
- XORQ R12, AX
-
- MOVQ AX, ret+24(FP)
- RET
-
-// writeBlocks uses the same registers as above except that it uses AX to store
-// the d pointer.
-
-// func writeBlocks(d *Digest, b []byte) int
-TEXT ·writeBlocks(SB), NOSPLIT, $0-40
- // Load fixed primes needed for round.
- MOVQ ·prime1v(SB), R13
- MOVQ ·prime2v(SB), R14
-
- // Load slice.
- MOVQ b_base+8(FP), CX
- MOVQ b_len+16(FP), DX
- LEAQ (CX)(DX*1), BX
- SUBQ $32, BX
-
- // Load vN from d.
- MOVQ d+0(FP), AX
- MOVQ 0(AX), R8 // v1
- MOVQ 8(AX), R9 // v2
- MOVQ 16(AX), R10 // v3
- MOVQ 24(AX), R11 // v4
-
- // We don't need to check the loop condition here; this function is
- // always called with at least one block of data to process.
-blockLoop:
- round(R8)
- round(R9)
- round(R10)
- round(R11)
-
- CMPQ CX, BX
- JLE blockLoop
-
- // Copy vN back to d.
- MOVQ R8, 0(AX)
- MOVQ R9, 8(AX)
- MOVQ R10, 16(AX)
- MOVQ R11, 24(AX)
-
- // The number of bytes written is CX minus the old base pointer.
- SUBQ b_base+8(FP), CX
- MOVQ CX, ret+32(FP)
-
- RET
diff --git a/vendor/github.com/cespare/xxhash/v2/xxhash_other.go b/vendor/github.com/cespare/xxhash/v2/xxhash_other.go
deleted file mode 100644
index 4a5a82160..000000000
--- a/vendor/github.com/cespare/xxhash/v2/xxhash_other.go
+++ /dev/null
@@ -1,76 +0,0 @@
-// +build !amd64 appengine !gc purego
-
-package xxhash
-
-// Sum64 computes the 64-bit xxHash digest of b.
-func Sum64(b []byte) uint64 {
- // A simpler version would be
- // d := New()
- // d.Write(b)
- // return d.Sum64()
- // but this is faster, particularly for small inputs.
-
- n := len(b)
- var h uint64
-
- if n >= 32 {
- v1 := prime1v + prime2
- v2 := prime2
- v3 := uint64(0)
- v4 := -prime1v
- for len(b) >= 32 {
- v1 = round(v1, u64(b[0:8:len(b)]))
- v2 = round(v2, u64(b[8:16:len(b)]))
- v3 = round(v3, u64(b[16:24:len(b)]))
- v4 = round(v4, u64(b[24:32:len(b)]))
- b = b[32:len(b):len(b)]
- }
- h = rol1(v1) + rol7(v2) + rol12(v3) + rol18(v4)
- h = mergeRound(h, v1)
- h = mergeRound(h, v2)
- h = mergeRound(h, v3)
- h = mergeRound(h, v4)
- } else {
- h = prime5
- }
-
- h += uint64(n)
-
- i, end := 0, len(b)
- for ; i+8 <= end; i += 8 {
- k1 := round(0, u64(b[i:i+8:len(b)]))
- h ^= k1
- h = rol27(h)*prime1 + prime4
- }
- if i+4 <= end {
- h ^= uint64(u32(b[i:i+4:len(b)])) * prime1
- h = rol23(h)*prime2 + prime3
- i += 4
- }
- for ; i < end; i++ {
- h ^= uint64(b[i]) * prime5
- h = rol11(h) * prime1
- }
-
- h ^= h >> 33
- h *= prime2
- h ^= h >> 29
- h *= prime3
- h ^= h >> 32
-
- return h
-}
-
-func writeBlocks(d *Digest, b []byte) int {
- v1, v2, v3, v4 := d.v1, d.v2, d.v3, d.v4
- n := len(b)
- for len(b) >= 32 {
- v1 = round(v1, u64(b[0:8:len(b)]))
- v2 = round(v2, u64(b[8:16:len(b)]))
- v3 = round(v3, u64(b[16:24:len(b)]))
- v4 = round(v4, u64(b[24:32:len(b)]))
- b = b[32:len(b):len(b)]
- }
- d.v1, d.v2, d.v3, d.v4 = v1, v2, v3, v4
- return n - len(b)
-}
diff --git a/vendor/github.com/cespare/xxhash/v2/xxhash_safe.go b/vendor/github.com/cespare/xxhash/v2/xxhash_safe.go
deleted file mode 100644
index fc9bea7a3..000000000
--- a/vendor/github.com/cespare/xxhash/v2/xxhash_safe.go
+++ /dev/null
@@ -1,15 +0,0 @@
-// +build appengine
-
-// This file contains the safe implementations of otherwise unsafe-using code.
-
-package xxhash
-
-// Sum64String computes the 64-bit xxHash digest of s.
-func Sum64String(s string) uint64 {
- return Sum64([]byte(s))
-}
-
-// WriteString adds more data to d. It always returns len(s), nil.
-func (d *Digest) WriteString(s string) (n int, err error) {
- return d.Write([]byte(s))
-}
diff --git a/vendor/github.com/cespare/xxhash/v2/xxhash_unsafe.go b/vendor/github.com/cespare/xxhash/v2/xxhash_unsafe.go
deleted file mode 100644
index 53bf76efb..000000000
--- a/vendor/github.com/cespare/xxhash/v2/xxhash_unsafe.go
+++ /dev/null
@@ -1,46 +0,0 @@
-// +build !appengine
-
-// This file encapsulates usage of unsafe.
-// xxhash_safe.go contains the safe implementations.
-
-package xxhash
-
-import (
- "reflect"
- "unsafe"
-)
-
-// Notes:
-//
-// See https://groups.google.com/d/msg/golang-nuts/dcjzJy-bSpw/tcZYBzQqAQAJ
-// for some discussion about these unsafe conversions.
-//
-// In the future it's possible that compiler optimizations will make these
-// unsafe operations unnecessary: https://golang.org/issue/2205.
-//
-// Both of these wrapper functions still incur function call overhead since they
-// will not be inlined. We could write Go/asm copies of Sum64 and Digest.Write
-// for strings to squeeze out a bit more speed. Mid-stack inlining should
-// eventually fix this.
-
-// Sum64String computes the 64-bit xxHash digest of s.
-// It may be faster than Sum64([]byte(s)) by avoiding a copy.
-func Sum64String(s string) uint64 {
- var b []byte
- bh := (*reflect.SliceHeader)(unsafe.Pointer(&b))
- bh.Data = (*reflect.StringHeader)(unsafe.Pointer(&s)).Data
- bh.Len = len(s)
- bh.Cap = len(s)
- return Sum64(b)
-}
-
-// WriteString adds more data to d. It always returns len(s), nil.
-// It may be faster than Write([]byte(s)) by avoiding a copy.
-func (d *Digest) WriteString(s string) (n int, err error) {
- var b []byte
- bh := (*reflect.SliceHeader)(unsafe.Pointer(&b))
- bh.Data = (*reflect.StringHeader)(unsafe.Pointer(&s)).Data
- bh.Len = len(s)
- bh.Cap = len(s)
- return d.Write(b)
-}
diff --git a/vendor/github.com/cilium/ebpf/LICENSE b/vendor/github.com/cilium/ebpf/LICENSE
deleted file mode 100644
index c637ae99c..000000000
--- a/vendor/github.com/cilium/ebpf/LICENSE
+++ /dev/null
@@ -1,23 +0,0 @@
-MIT License
-
-Copyright (c) 2017 Nathan Sweet
-Copyright (c) 2018, 2019 Cloudflare
-Copyright (c) 2019 Authors of Cilium
-
-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/vendor/github.com/cilium/ebpf/abi.go b/vendor/github.com/cilium/ebpf/abi.go
deleted file mode 100644
index d432eb46f..000000000
--- a/vendor/github.com/cilium/ebpf/abi.go
+++ /dev/null
@@ -1,206 +0,0 @@
-package ebpf
-
-import (
- "bufio"
- "bytes"
- "errors"
- "fmt"
- "io"
- "os"
- "syscall"
-
- "github.com/cilium/ebpf/internal"
-)
-
-// MapABI are the attributes of a Map which are available across all supported kernels.
-type MapABI struct {
- Type MapType
- KeySize uint32
- ValueSize uint32
- MaxEntries uint32
- Flags uint32
-}
-
-func newMapABIFromSpec(spec *MapSpec) *MapABI {
- return &MapABI{
- spec.Type,
- spec.KeySize,
- spec.ValueSize,
- spec.MaxEntries,
- spec.Flags,
- }
-}
-
-func newMapABIFromFd(fd *internal.FD) (string, *MapABI, error) {
- info, err := bpfGetMapInfoByFD(fd)
- if err != nil {
- if errors.Is(err, syscall.EINVAL) {
- abi, err := newMapABIFromProc(fd)
- return "", abi, err
- }
- return "", nil, err
- }
-
- return "", &MapABI{
- MapType(info.mapType),
- info.keySize,
- info.valueSize,
- info.maxEntries,
- info.flags,
- }, nil
-}
-
-func newMapABIFromProc(fd *internal.FD) (*MapABI, error) {
- var abi MapABI
- err := scanFdInfo(fd, map[string]interface{}{
- "map_type": &abi.Type,
- "key_size": &abi.KeySize,
- "value_size": &abi.ValueSize,
- "max_entries": &abi.MaxEntries,
- "map_flags": &abi.Flags,
- })
- if err != nil {
- return nil, err
- }
- return &abi, nil
-}
-
-// Equal returns true if two ABIs have the same values.
-func (abi *MapABI) Equal(other *MapABI) bool {
- switch {
- case abi.Type != other.Type:
- return false
- case abi.KeySize != other.KeySize:
- return false
- case abi.ValueSize != other.ValueSize:
- return false
- case abi.MaxEntries != other.MaxEntries:
- return false
- case abi.Flags != other.Flags:
- return false
- default:
- return true
- }
-}
-
-// ProgramABI are the attributes of a Program which are available across all supported kernels.
-type ProgramABI struct {
- Type ProgramType
-}
-
-func newProgramABIFromSpec(spec *ProgramSpec) *ProgramABI {
- return &ProgramABI{
- spec.Type,
- }
-}
-
-func newProgramABIFromFd(fd *internal.FD) (string, *ProgramABI, error) {
- info, err := bpfGetProgInfoByFD(fd)
- if err != nil {
- if errors.Is(err, syscall.EINVAL) {
- return newProgramABIFromProc(fd)
- }
-
- return "", nil, err
- }
-
- var name string
- if bpfName := internal.CString(info.name[:]); bpfName != "" {
- name = bpfName
- } else {
- name = internal.CString(info.tag[:])
- }
-
- return name, &ProgramABI{
- Type: ProgramType(info.progType),
- }, nil
-}
-
-func newProgramABIFromProc(fd *internal.FD) (string, *ProgramABI, error) {
- var (
- abi ProgramABI
- name string
- )
-
- err := scanFdInfo(fd, map[string]interface{}{
- "prog_type": &abi.Type,
- "prog_tag": &name,
- })
- if errors.Is(err, errMissingFields) {
- return "", nil, &internal.UnsupportedFeatureError{
- Name: "reading ABI from /proc/self/fdinfo",
- MinimumVersion: internal.Version{4, 11, 0},
- }
- }
- if err != nil {
- return "", nil, err
- }
-
- return name, &abi, nil
-}
-
-func scanFdInfo(fd *internal.FD, fields map[string]interface{}) error {
- raw, err := fd.Value()
- if err != nil {
- return err
- }
-
- fh, err := os.Open(fmt.Sprintf("/proc/self/fdinfo/%d", raw))
- if err != nil {
- return err
- }
- defer fh.Close()
-
- if err := scanFdInfoReader(fh, fields); err != nil {
- return fmt.Errorf("%s: %w", fh.Name(), err)
- }
- return nil
-}
-
-var errMissingFields = errors.New("missing fields")
-
-func scanFdInfoReader(r io.Reader, fields map[string]interface{}) error {
- var (
- scanner = bufio.NewScanner(r)
- scanned int
- )
-
- for scanner.Scan() {
- parts := bytes.SplitN(scanner.Bytes(), []byte("\t"), 2)
- if len(parts) != 2 {
- continue
- }
-
- name := bytes.TrimSuffix(parts[0], []byte(":"))
- field, ok := fields[string(name)]
- if !ok {
- continue
- }
-
- if n, err := fmt.Fscanln(bytes.NewReader(parts[1]), field); err != nil || n != 1 {
- return fmt.Errorf("can't parse field %s: %v", name, err)
- }
-
- scanned++
- }
-
- if err := scanner.Err(); err != nil {
- return err
- }
-
- if scanned != len(fields) {
- return errMissingFields
- }
-
- return nil
-}
-
-// Equal returns true if two ABIs have the same values.
-func (abi *ProgramABI) Equal(other *ProgramABI) bool {
- switch {
- case abi.Type != other.Type:
- return false
- default:
- return true
- }
-}
diff --git a/vendor/github.com/cilium/ebpf/asm/alu.go b/vendor/github.com/cilium/ebpf/asm/alu.go
deleted file mode 100644
index 70ccc4d15..000000000
--- a/vendor/github.com/cilium/ebpf/asm/alu.go
+++ /dev/null
@@ -1,149 +0,0 @@
-package asm
-
-//go:generate stringer -output alu_string.go -type=Source,Endianness,ALUOp
-
-// Source of ALU / ALU64 / Branch operations
-//
-// msb lsb
-// +----+-+---+
-// |op |S|cls|
-// +----+-+---+
-type Source uint8
-
-const sourceMask OpCode = 0x08
-
-// Source bitmask
-const (
- // InvalidSource is returned by getters when invoked
- // on non ALU / branch OpCodes.
- InvalidSource Source = 0xff
- // ImmSource src is from constant
- ImmSource Source = 0x00
- // RegSource src is from register
- RegSource Source = 0x08
-)
-
-// The Endianness of a byte swap instruction.
-type Endianness uint8
-
-const endianMask = sourceMask
-
-// Endian flags
-const (
- InvalidEndian Endianness = 0xff
- // Convert to little endian
- LE Endianness = 0x00
- // Convert to big endian
- BE Endianness = 0x08
-)
-
-// ALUOp are ALU / ALU64 operations
-//
-// msb lsb
-// +----+-+---+
-// |OP |s|cls|
-// +----+-+---+
-type ALUOp uint8
-
-const aluMask OpCode = 0xf0
-
-const (
- // InvalidALUOp is returned by getters when invoked
- // on non ALU OpCodes
- InvalidALUOp ALUOp = 0xff
- // Add - addition
- Add ALUOp = 0x00
- // Sub - subtraction
- Sub ALUOp = 0x10
- // Mul - multiplication
- Mul ALUOp = 0x20
- // Div - division
- Div ALUOp = 0x30
- // Or - bitwise or
- Or ALUOp = 0x40
- // And - bitwise and
- And ALUOp = 0x50
- // LSh - bitwise shift left
- LSh ALUOp = 0x60
- // RSh - bitwise shift right
- RSh ALUOp = 0x70
- // Neg - sign/unsign signing bit
- Neg ALUOp = 0x80
- // Mod - modulo
- Mod ALUOp = 0x90
- // Xor - bitwise xor
- Xor ALUOp = 0xa0
- // Mov - move value from one place to another
- Mov ALUOp = 0xb0
- // ArSh - arithmatic shift
- ArSh ALUOp = 0xc0
- // Swap - endian conversions
- Swap ALUOp = 0xd0
-)
-
-// HostTo converts from host to another endianness.
-func HostTo(endian Endianness, dst Register, size Size) Instruction {
- var imm int64
- switch size {
- case Half:
- imm = 16
- case Word:
- imm = 32
- case DWord:
- imm = 64
- default:
- return Instruction{OpCode: InvalidOpCode}
- }
-
- return Instruction{
- OpCode: OpCode(ALUClass).SetALUOp(Swap).SetSource(Source(endian)),
- Dst: dst,
- Constant: imm,
- }
-}
-
-// Op returns the OpCode for an ALU operation with a given source.
-func (op ALUOp) Op(source Source) OpCode {
- return OpCode(ALU64Class).SetALUOp(op).SetSource(source)
-}
-
-// Reg emits `dst (op) src`.
-func (op ALUOp) Reg(dst, src Register) Instruction {
- return Instruction{
- OpCode: op.Op(RegSource),
- Dst: dst,
- Src: src,
- }
-}
-
-// Imm emits `dst (op) value`.
-func (op ALUOp) Imm(dst Register, value int32) Instruction {
- return Instruction{
- OpCode: op.Op(ImmSource),
- Dst: dst,
- Constant: int64(value),
- }
-}
-
-// Op32 returns the OpCode for a 32-bit ALU operation with a given source.
-func (op ALUOp) Op32(source Source) OpCode {
- return OpCode(ALUClass).SetALUOp(op).SetSource(source)
-}
-
-// Reg32 emits `dst (op) src`, zeroing the upper 32 bit of dst.
-func (op ALUOp) Reg32(dst, src Register) Instruction {
- return Instruction{
- OpCode: op.Op32(RegSource),
- Dst: dst,
- Src: src,
- }
-}
-
-// Imm32 emits `dst (op) value`, zeroing the upper 32 bit of dst.
-func (op ALUOp) Imm32(dst Register, value int32) Instruction {
- return Instruction{
- OpCode: op.Op32(ImmSource),
- Dst: dst,
- Constant: int64(value),
- }
-}
diff --git a/vendor/github.com/cilium/ebpf/asm/alu_string.go b/vendor/github.com/cilium/ebpf/asm/alu_string.go
deleted file mode 100644
index 72d3fe629..000000000
--- a/vendor/github.com/cilium/ebpf/asm/alu_string.go
+++ /dev/null
@@ -1,107 +0,0 @@
-// Code generated by "stringer -output alu_string.go -type=Source,Endianness,ALUOp"; DO NOT EDIT.
-
-package asm
-
-import "strconv"
-
-func _() {
- // An "invalid array index" compiler error signifies that the constant values have changed.
- // Re-run the stringer command to generate them again.
- var x [1]struct{}
- _ = x[InvalidSource-255]
- _ = x[ImmSource-0]
- _ = x[RegSource-8]
-}
-
-const (
- _Source_name_0 = "ImmSource"
- _Source_name_1 = "RegSource"
- _Source_name_2 = "InvalidSource"
-)
-
-func (i Source) String() string {
- switch {
- case i == 0:
- return _Source_name_0
- case i == 8:
- return _Source_name_1
- case i == 255:
- return _Source_name_2
- default:
- return "Source(" + strconv.FormatInt(int64(i), 10) + ")"
- }
-}
-func _() {
- // An "invalid array index" compiler error signifies that the constant values have changed.
- // Re-run the stringer command to generate them again.
- var x [1]struct{}
- _ = x[InvalidEndian-255]
- _ = x[LE-0]
- _ = x[BE-8]
-}
-
-const (
- _Endianness_name_0 = "LE"
- _Endianness_name_1 = "BE"
- _Endianness_name_2 = "InvalidEndian"
-)
-
-func (i Endianness) String() string {
- switch {
- case i == 0:
- return _Endianness_name_0
- case i == 8:
- return _Endianness_name_1
- case i == 255:
- return _Endianness_name_2
- default:
- return "Endianness(" + strconv.FormatInt(int64(i), 10) + ")"
- }
-}
-func _() {
- // An "invalid array index" compiler error signifies that the constant values have changed.
- // Re-run the stringer command to generate them again.
- var x [1]struct{}
- _ = x[InvalidALUOp-255]
- _ = x[Add-0]
- _ = x[Sub-16]
- _ = x[Mul-32]
- _ = x[Div-48]
- _ = x[Or-64]
- _ = x[And-80]
- _ = x[LSh-96]
- _ = x[RSh-112]
- _ = x[Neg-128]
- _ = x[Mod-144]
- _ = x[Xor-160]
- _ = x[Mov-176]
- _ = x[ArSh-192]
- _ = x[Swap-208]
-}
-
-const _ALUOp_name = "AddSubMulDivOrAndLShRShNegModXorMovArShSwapInvalidALUOp"
-
-var _ALUOp_map = map[ALUOp]string{
- 0: _ALUOp_name[0:3],
- 16: _ALUOp_name[3:6],
- 32: _ALUOp_name[6:9],
- 48: _ALUOp_name[9:12],
- 64: _ALUOp_name[12:14],
- 80: _ALUOp_name[14:17],
- 96: _ALUOp_name[17:20],
- 112: _ALUOp_name[20:23],
- 128: _ALUOp_name[23:26],
- 144: _ALUOp_name[26:29],
- 160: _ALUOp_name[29:32],
- 176: _ALUOp_name[32:35],
- 192: _ALUOp_name[35:39],
- 208: _ALUOp_name[39:43],
- 255: _ALUOp_name[43:55],
-}
-
-func (i ALUOp) String() string {
- if str, ok := _ALUOp_map[i]; ok {
- return str
- }
- return "ALUOp(" + strconv.FormatInt(int64(i), 10) + ")"
-}
diff --git a/vendor/github.com/cilium/ebpf/asm/doc.go b/vendor/github.com/cilium/ebpf/asm/doc.go
deleted file mode 100644
index 7031bdc27..000000000
--- a/vendor/github.com/cilium/ebpf/asm/doc.go
+++ /dev/null
@@ -1,2 +0,0 @@
-// Package asm is an assembler for eBPF bytecode.
-package asm
diff --git a/vendor/github.com/cilium/ebpf/asm/func.go b/vendor/github.com/cilium/ebpf/asm/func.go
deleted file mode 100644
index 97f794cdb..000000000
--- a/vendor/github.com/cilium/ebpf/asm/func.go
+++ /dev/null
@@ -1,143 +0,0 @@
-package asm
-
-//go:generate stringer -output func_string.go -type=BuiltinFunc
-
-// BuiltinFunc is a built-in eBPF function.
-type BuiltinFunc int32
-
-// eBPF built-in functions
-//
-// You can renegerate this list using the following gawk script:
-//
-// /FN\(.+\),/ {
-// match($1, /\((.+)\)/, r)
-// split(r[1], p, "_")
-// printf "Fn"
-// for (i in p) {
-// printf "%s%s", toupper(substr(p[i], 1, 1)), substr(p[i], 2)
-// }
-// print ""
-// }
-//
-// The script expects include/uapi/linux/bpf.h as it's input.
-const (
- FnUnspec BuiltinFunc = iota
- FnMapLookupElem
- FnMapUpdateElem
- FnMapDeleteElem
- FnProbeRead
- FnKtimeGetNs
- FnTracePrintk
- FnGetPrandomU32
- FnGetSmpProcessorId
- FnSkbStoreBytes
- FnL3CsumReplace
- FnL4CsumReplace
- FnTailCall
- FnCloneRedirect
- FnGetCurrentPidTgid
- FnGetCurrentUidGid
- FnGetCurrentComm
- FnGetCgroupClassid
- FnSkbVlanPush
- FnSkbVlanPop
- FnSkbGetTunnelKey
- FnSkbSetTunnelKey
- FnPerfEventRead
- FnRedirect
- FnGetRouteRealm
- FnPerfEventOutput
- FnSkbLoadBytes
- FnGetStackid
- FnCsumDiff
- FnSkbGetTunnelOpt
- FnSkbSetTunnelOpt
- FnSkbChangeProto
- FnSkbChangeType
- FnSkbUnderCgroup
- FnGetHashRecalc
- FnGetCurrentTask
- FnProbeWriteUser
- FnCurrentTaskUnderCgroup
- FnSkbChangeTail
- FnSkbPullData
- FnCsumUpdate
- FnSetHashInvalid
- FnGetNumaNodeId
- FnSkbChangeHead
- FnXdpAdjustHead
- FnProbeReadStr
- FnGetSocketCookie
- FnGetSocketUid
- FnSetHash
- FnSetsockopt
- FnSkbAdjustRoom
- FnRedirectMap
- FnSkRedirectMap
- FnSockMapUpdate
- FnXdpAdjustMeta
- FnPerfEventReadValue
- FnPerfProgReadValue
- FnGetsockopt
- FnOverrideReturn
- FnSockOpsCbFlagsSet
- FnMsgRedirectMap
- FnMsgApplyBytes
- FnMsgCorkBytes
- FnMsgPullData
- FnBind
- FnXdpAdjustTail
- FnSkbGetXfrmState
- FnGetStack
- FnSkbLoadBytesRelative
- FnFibLookup
- FnSockHashUpdate
- FnMsgRedirectHash
- FnSkRedirectHash
- FnLwtPushEncap
- FnLwtSeg6StoreBytes
- FnLwtSeg6AdjustSrh
- FnLwtSeg6Action
- FnRcRepeat
- FnRcKeydown
- FnSkbCgroupId
- FnGetCurrentCgroupId
- FnGetLocalStorage
- FnSkSelectReuseport
- FnSkbAncestorCgroupId
- FnSkLookupTcp
- FnSkLookupUdp
- FnSkRelease
- FnMapPushElem
- FnMapPopElem
- FnMapPeekElem
- FnMsgPushData
- FnMsgPopData
- FnRcPointerRel
- FnSpinLock
- FnSpinUnlock
- FnSkFullsock
- FnTcpSock
- FnSkbEcnSetCe
- FnGetListenerSock
- FnSkcLookupTcp
- FnTcpCheckSyncookie
- FnSysctlGetName
- FnSysctlGetCurrentValue
- FnSysctlGetNewValue
- FnSysctlSetNewValue
- FnStrtol
- FnStrtoul
- FnSkStorageGet
- FnSkStorageDelete
- FnSendSignal
- FnTcpGenSyncookie
-)
-
-// Call emits a function call.
-func (fn BuiltinFunc) Call() Instruction {
- return Instruction{
- OpCode: OpCode(JumpClass).SetJumpOp(Call),
- Constant: int64(fn),
- }
-}
diff --git a/vendor/github.com/cilium/ebpf/asm/func_string.go b/vendor/github.com/cilium/ebpf/asm/func_string.go
deleted file mode 100644
index 8860b9fdb..000000000
--- a/vendor/github.com/cilium/ebpf/asm/func_string.go
+++ /dev/null
@@ -1,133 +0,0 @@
-// Code generated by "stringer -output func_string.go -type=BuiltinFunc"; DO NOT EDIT.
-
-package asm
-
-import "strconv"
-
-func _() {
- // An "invalid array index" compiler error signifies that the constant values have changed.
- // Re-run the stringer command to generate them again.
- var x [1]struct{}
- _ = x[FnUnspec-0]
- _ = x[FnMapLookupElem-1]
- _ = x[FnMapUpdateElem-2]
- _ = x[FnMapDeleteElem-3]
- _ = x[FnProbeRead-4]
- _ = x[FnKtimeGetNs-5]
- _ = x[FnTracePrintk-6]
- _ = x[FnGetPrandomU32-7]
- _ = x[FnGetSmpProcessorId-8]
- _ = x[FnSkbStoreBytes-9]
- _ = x[FnL3CsumReplace-10]
- _ = x[FnL4CsumReplace-11]
- _ = x[FnTailCall-12]
- _ = x[FnCloneRedirect-13]
- _ = x[FnGetCurrentPidTgid-14]
- _ = x[FnGetCurrentUidGid-15]
- _ = x[FnGetCurrentComm-16]
- _ = x[FnGetCgroupClassid-17]
- _ = x[FnSkbVlanPush-18]
- _ = x[FnSkbVlanPop-19]
- _ = x[FnSkbGetTunnelKey-20]
- _ = x[FnSkbSetTunnelKey-21]
- _ = x[FnPerfEventRead-22]
- _ = x[FnRedirect-23]
- _ = x[FnGetRouteRealm-24]
- _ = x[FnPerfEventOutput-25]
- _ = x[FnSkbLoadBytes-26]
- _ = x[FnGetStackid-27]
- _ = x[FnCsumDiff-28]
- _ = x[FnSkbGetTunnelOpt-29]
- _ = x[FnSkbSetTunnelOpt-30]
- _ = x[FnSkbChangeProto-31]
- _ = x[FnSkbChangeType-32]
- _ = x[FnSkbUnderCgroup-33]
- _ = x[FnGetHashRecalc-34]
- _ = x[FnGetCurrentTask-35]
- _ = x[FnProbeWriteUser-36]
- _ = x[FnCurrentTaskUnderCgroup-37]
- _ = x[FnSkbChangeTail-38]
- _ = x[FnSkbPullData-39]
- _ = x[FnCsumUpdate-40]
- _ = x[FnSetHashInvalid-41]
- _ = x[FnGetNumaNodeId-42]
- _ = x[FnSkbChangeHead-43]
- _ = x[FnXdpAdjustHead-44]
- _ = x[FnProbeReadStr-45]
- _ = x[FnGetSocketCookie-46]
- _ = x[FnGetSocketUid-47]
- _ = x[FnSetHash-48]
- _ = x[FnSetsockopt-49]
- _ = x[FnSkbAdjustRoom-50]
- _ = x[FnRedirectMap-51]
- _ = x[FnSkRedirectMap-52]
- _ = x[FnSockMapUpdate-53]
- _ = x[FnXdpAdjustMeta-54]
- _ = x[FnPerfEventReadValue-55]
- _ = x[FnPerfProgReadValue-56]
- _ = x[FnGetsockopt-57]
- _ = x[FnOverrideReturn-58]
- _ = x[FnSockOpsCbFlagsSet-59]
- _ = x[FnMsgRedirectMap-60]
- _ = x[FnMsgApplyBytes-61]
- _ = x[FnMsgCorkBytes-62]
- _ = x[FnMsgPullData-63]
- _ = x[FnBind-64]
- _ = x[FnXdpAdjustTail-65]
- _ = x[FnSkbGetXfrmState-66]
- _ = x[FnGetStack-67]
- _ = x[FnSkbLoadBytesRelative-68]
- _ = x[FnFibLookup-69]
- _ = x[FnSockHashUpdate-70]
- _ = x[FnMsgRedirectHash-71]
- _ = x[FnSkRedirectHash-72]
- _ = x[FnLwtPushEncap-73]
- _ = x[FnLwtSeg6StoreBytes-74]
- _ = x[FnLwtSeg6AdjustSrh-75]
- _ = x[FnLwtSeg6Action-76]
- _ = x[FnRcRepeat-77]
- _ = x[FnRcKeydown-78]
- _ = x[FnSkbCgroupId-79]
- _ = x[FnGetCurrentCgroupId-80]
- _ = x[FnGetLocalStorage-81]
- _ = x[FnSkSelectReuseport-82]
- _ = x[FnSkbAncestorCgroupId-83]
- _ = x[FnSkLookupTcp-84]
- _ = x[FnSkLookupUdp-85]
- _ = x[FnSkRelease-86]
- _ = x[FnMapPushElem-87]
- _ = x[FnMapPopElem-88]
- _ = x[FnMapPeekElem-89]
- _ = x[FnMsgPushData-90]
- _ = x[FnMsgPopData-91]
- _ = x[FnRcPointerRel-92]
- _ = x[FnSpinLock-93]
- _ = x[FnSpinUnlock-94]
- _ = x[FnSkFullsock-95]
- _ = x[FnTcpSock-96]
- _ = x[FnSkbEcnSetCe-97]
- _ = x[FnGetListenerSock-98]
- _ = x[FnSkcLookupTcp-99]
- _ = x[FnTcpCheckSyncookie-100]
- _ = x[FnSysctlGetName-101]
- _ = x[FnSysctlGetCurrentValue-102]
- _ = x[FnSysctlGetNewValue-103]
- _ = x[FnSysctlSetNewValue-104]
- _ = x[FnStrtol-105]
- _ = x[FnStrtoul-106]
- _ = x[FnSkStorageGet-107]
- _ = x[FnSkStorageDelete-108]
- _ = x[FnSendSignal-109]
- _ = x[FnTcpGenSyncookie-110]
-}
-
-const _BuiltinFunc_name = "FnUnspecFnMapLookupElemFnMapUpdateElemFnMapDeleteElemFnProbeReadFnKtimeGetNsFnTracePrintkFnGetPrandomU32FnGetSmpProcessorIdFnSkbStoreBytesFnL3CsumReplaceFnL4CsumReplaceFnTailCallFnCloneRedirectFnGetCurrentPidTgidFnGetCurrentUidGidFnGetCurrentCommFnGetCgroupClassidFnSkbVlanPushFnSkbVlanPopFnSkbGetTunnelKeyFnSkbSetTunnelKeyFnPerfEventReadFnRedirectFnGetRouteRealmFnPerfEventOutputFnSkbLoadBytesFnGetStackidFnCsumDiffFnSkbGetTunnelOptFnSkbSetTunnelOptFnSkbChangeProtoFnSkbChangeTypeFnSkbUnderCgroupFnGetHashRecalcFnGetCurrentTaskFnProbeWriteUserFnCurrentTaskUnderCgroupFnSkbChangeTailFnSkbPullDataFnCsumUpdateFnSetHashInvalidFnGetNumaNodeIdFnSkbChangeHeadFnXdpAdjustHeadFnProbeReadStrFnGetSocketCookieFnGetSocketUidFnSetHashFnSetsockoptFnSkbAdjustRoomFnRedirectMapFnSkRedirectMapFnSockMapUpdateFnXdpAdjustMetaFnPerfEventReadValueFnPerfProgReadValueFnGetsockoptFnOverrideReturnFnSockOpsCbFlagsSetFnMsgRedirectMapFnMsgApplyBytesFnMsgCorkBytesFnMsgPullDataFnBindFnXdpAdjustTailFnSkbGetXfrmStateFnGetStackFnSkbLoadBytesRelativeFnFibLookupFnSockHashUpdateFnMsgRedirectHashFnSkRedirectHashFnLwtPushEncapFnLwtSeg6StoreBytesFnLwtSeg6AdjustSrhFnLwtSeg6ActionFnRcRepeatFnRcKeydownFnSkbCgroupIdFnGetCurrentCgroupIdFnGetLocalStorageFnSkSelectReuseportFnSkbAncestorCgroupIdFnSkLookupTcpFnSkLookupUdpFnSkReleaseFnMapPushElemFnMapPopElemFnMapPeekElemFnMsgPushDataFnMsgPopDataFnRcPointerRelFnSpinLockFnSpinUnlockFnSkFullsockFnTcpSockFnSkbEcnSetCeFnGetListenerSockFnSkcLookupTcpFnTcpCheckSyncookieFnSysctlGetNameFnSysctlGetCurrentValueFnSysctlGetNewValueFnSysctlSetNewValueFnStrtolFnStrtoulFnSkStorageGetFnSkStorageDeleteFnSendSignalFnTcpGenSyncookie"
-
-var _BuiltinFunc_index = [...]uint16{0, 8, 23, 38, 53, 64, 76, 89, 104, 123, 138, 153, 168, 178, 193, 212, 230, 246, 264, 277, 289, 306, 323, 338, 348, 363, 380, 394, 406, 416, 433, 450, 466, 481, 497, 512, 528, 544, 568, 583, 596, 608, 624, 639, 654, 669, 683, 700, 714, 723, 735, 750, 763, 778, 793, 808, 828, 847, 859, 875, 894, 910, 925, 939, 952, 958, 973, 990, 1000, 1022, 1033, 1049, 1066, 1082, 1096, 1115, 1133, 1148, 1158, 1169, 1182, 1202, 1219, 1238, 1259, 1272, 1285, 1296, 1309, 1321, 1334, 1347, 1359, 1373, 1383, 1395, 1407, 1416, 1429, 1446, 1460, 1479, 1494, 1517, 1536, 1555, 1563, 1572, 1586, 1603, 1615, 1632}
-
-func (i BuiltinFunc) String() string {
- if i < 0 || i >= BuiltinFunc(len(_BuiltinFunc_index)-1) {
- return "BuiltinFunc(" + strconv.FormatInt(int64(i), 10) + ")"
- }
- return _BuiltinFunc_name[_BuiltinFunc_index[i]:_BuiltinFunc_index[i+1]]
-}
diff --git a/vendor/github.com/cilium/ebpf/asm/instruction.go b/vendor/github.com/cilium/ebpf/asm/instruction.go
deleted file mode 100644
index 8fbcf5664..000000000
--- a/vendor/github.com/cilium/ebpf/asm/instruction.go
+++ /dev/null
@@ -1,476 +0,0 @@
-package asm
-
-import (
- "encoding/binary"
- "errors"
- "fmt"
- "io"
- "math"
- "strings"
-)
-
-// InstructionSize is the size of a BPF instruction in bytes
-const InstructionSize = 8
-
-// Instruction is a single eBPF instruction.
-type Instruction struct {
- OpCode OpCode
- Dst Register
- Src Register
- Offset int16
- Constant int64
- Reference string
- Symbol string
-}
-
-// Sym creates a symbol.
-func (ins Instruction) Sym(name string) Instruction {
- ins.Symbol = name
- return ins
-}
-
-// Unmarshal decodes a BPF instruction.
-func (ins *Instruction) Unmarshal(r io.Reader, bo binary.ByteOrder) (uint64, error) {
- var bi bpfInstruction
- err := binary.Read(r, bo, &bi)
- if err != nil {
- return 0, err
- }
-
- ins.OpCode = bi.OpCode
- ins.Offset = bi.Offset
- ins.Constant = int64(bi.Constant)
- ins.Dst, ins.Src, err = bi.Registers.Unmarshal(bo)
- if err != nil {
- return 0, fmt.Errorf("can't unmarshal registers: %s", err)
- }
-
- if !bi.OpCode.isDWordLoad() {
- return InstructionSize, nil
- }
-
- var bi2 bpfInstruction
- if err := binary.Read(r, bo, &bi2); err != nil {
- // No Wrap, to avoid io.EOF clash
- return 0, errors.New("64bit immediate is missing second half")
- }
- if bi2.OpCode != 0 || bi2.Offset != 0 || bi2.Registers != 0 {
- return 0, errors.New("64bit immediate has non-zero fields")
- }
- ins.Constant = int64(uint64(uint32(bi2.Constant))<<32 | uint64(uint32(bi.Constant)))
-
- return 2 * InstructionSize, nil
-}
-
-// Marshal encodes a BPF instruction.
-func (ins Instruction) Marshal(w io.Writer, bo binary.ByteOrder) (uint64, error) {
- if ins.OpCode == InvalidOpCode {
- return 0, errors.New("invalid opcode")
- }
-
- isDWordLoad := ins.OpCode.isDWordLoad()
-
- cons := int32(ins.Constant)
- if isDWordLoad {
- // Encode least significant 32bit first for 64bit operations.
- cons = int32(uint32(ins.Constant))
- }
-
- regs, err := newBPFRegisters(ins.Dst, ins.Src, bo)
- if err != nil {
- return 0, fmt.Errorf("can't marshal registers: %s", err)
- }
-
- bpfi := bpfInstruction{
- ins.OpCode,
- regs,
- ins.Offset,
- cons,
- }
-
- if err := binary.Write(w, bo, &bpfi); err != nil {
- return 0, err
- }
-
- if !isDWordLoad {
- return InstructionSize, nil
- }
-
- bpfi = bpfInstruction{
- Constant: int32(ins.Constant >> 32),
- }
-
- if err := binary.Write(w, bo, &bpfi); err != nil {
- return 0, err
- }
-
- return 2 * InstructionSize, nil
-}
-
-// RewriteMapPtr changes an instruction to use a new map fd.
-//
-// Returns an error if the instruction doesn't load a map.
-func (ins *Instruction) RewriteMapPtr(fd int) error {
- if !ins.OpCode.isDWordLoad() {
- return fmt.Errorf("%s is not a 64 bit load", ins.OpCode)
- }
-
- if ins.Src != PseudoMapFD && ins.Src != PseudoMapValue {
- return errors.New("not a load from a map")
- }
-
- // Preserve the offset value for direct map loads.
- offset := uint64(ins.Constant) & (math.MaxUint32 << 32)
- rawFd := uint64(uint32(fd))
- ins.Constant = int64(offset | rawFd)
- return nil
-}
-
-func (ins *Instruction) mapPtr() uint32 {
- return uint32(uint64(ins.Constant) & math.MaxUint32)
-}
-
-// RewriteMapOffset changes the offset of a direct load from a map.
-//
-// Returns an error if the instruction is not a direct load.
-func (ins *Instruction) RewriteMapOffset(offset uint32) error {
- if !ins.OpCode.isDWordLoad() {
- return fmt.Errorf("%s is not a 64 bit load", ins.OpCode)
- }
-
- if ins.Src != PseudoMapValue {
- return errors.New("not a direct load from a map")
- }
-
- fd := uint64(ins.Constant) & math.MaxUint32
- ins.Constant = int64(uint64(offset)<<32 | fd)
- return nil
-}
-
-func (ins *Instruction) mapOffset() uint32 {
- return uint32(uint64(ins.Constant) >> 32)
-}
-
-func (ins *Instruction) isLoadFromMap() bool {
- return ins.OpCode == LoadImmOp(DWord) && (ins.Src == PseudoMapFD || ins.Src == PseudoMapValue)
-}
-
-// Format implements fmt.Formatter.
-func (ins Instruction) Format(f fmt.State, c rune) {
- if c != 'v' {
- fmt.Fprintf(f, "{UNRECOGNIZED: %c}", c)
- return
- }
-
- op := ins.OpCode
-
- if op == InvalidOpCode {
- fmt.Fprint(f, "INVALID")
- return
- }
-
- // Omit trailing space for Exit
- if op.JumpOp() == Exit {
- fmt.Fprint(f, op)
- return
- }
-
- if ins.isLoadFromMap() {
- fd := int32(ins.mapPtr())
- switch ins.Src {
- case PseudoMapFD:
- fmt.Fprintf(f, "LoadMapPtr dst: %s fd: %d", ins.Dst, fd)
-
- case PseudoMapValue:
- fmt.Fprintf(f, "LoadMapValue dst: %s, fd: %d off: %d", ins.Dst, fd, ins.mapOffset())
- }
-
- goto ref
- }
-
- fmt.Fprintf(f, "%v ", op)
- switch cls := op.Class(); cls {
- case LdClass, LdXClass, StClass, StXClass:
- switch op.Mode() {
- case ImmMode:
- fmt.Fprintf(f, "dst: %s imm: %d", ins.Dst, ins.Constant)
- case AbsMode:
- fmt.Fprintf(f, "imm: %d", ins.Constant)
- case IndMode:
- fmt.Fprintf(f, "dst: %s src: %s imm: %d", ins.Dst, ins.Src, ins.Constant)
- case MemMode:
- fmt.Fprintf(f, "dst: %s src: %s off: %d imm: %d", ins.Dst, ins.Src, ins.Offset, ins.Constant)
- case XAddMode:
- fmt.Fprintf(f, "dst: %s src: %s", ins.Dst, ins.Src)
- }
-
- case ALU64Class, ALUClass:
- fmt.Fprintf(f, "dst: %s ", ins.Dst)
- if op.ALUOp() == Swap || op.Source() == ImmSource {
- fmt.Fprintf(f, "imm: %d", ins.Constant)
- } else {
- fmt.Fprintf(f, "src: %s", ins.Src)
- }
-
- case JumpClass:
- switch jop := op.JumpOp(); jop {
- case Call:
- if ins.Src == PseudoCall {
- // bpf-to-bpf call
- fmt.Fprint(f, ins.Constant)
- } else {
- fmt.Fprint(f, BuiltinFunc(ins.Constant))
- }
-
- default:
- fmt.Fprintf(f, "dst: %s off: %d ", ins.Dst, ins.Offset)
- if op.Source() == ImmSource {
- fmt.Fprintf(f, "imm: %d", ins.Constant)
- } else {
- fmt.Fprintf(f, "src: %s", ins.Src)
- }
- }
- }
-
-ref:
- if ins.Reference != "" {
- fmt.Fprintf(f, " <%s>", ins.Reference)
- }
-}
-
-// Instructions is an eBPF program.
-type Instructions []Instruction
-
-func (insns Instructions) String() string {
- return fmt.Sprint(insns)
-}
-
-// RewriteMapPtr rewrites all loads of a specific map pointer to a new fd.
-//
-// Returns an error if the symbol isn't used, see IsUnreferencedSymbol.
-func (insns Instructions) RewriteMapPtr(symbol string, fd int) error {
- if symbol == "" {
- return errors.New("empty symbol")
- }
-
- found := false
- for i := range insns {
- ins := &insns[i]
- if ins.Reference != symbol {
- continue
- }
-
- if err := ins.RewriteMapPtr(fd); err != nil {
- return err
- }
-
- found = true
- }
-
- if !found {
- return &unreferencedSymbolError{symbol}
- }
-
- return nil
-}
-
-// SymbolOffsets returns the set of symbols and their offset in
-// the instructions.
-func (insns Instructions) SymbolOffsets() (map[string]int, error) {
- offsets := make(map[string]int)
-
- for i, ins := range insns {
- if ins.Symbol == "" {
- continue
- }
-
- if _, ok := offsets[ins.Symbol]; ok {
- return nil, fmt.Errorf("duplicate symbol %s", ins.Symbol)
- }
-
- offsets[ins.Symbol] = i
- }
-
- return offsets, nil
-}
-
-// ReferenceOffsets returns the set of references and their offset in
-// the instructions.
-func (insns Instructions) ReferenceOffsets() map[string][]int {
- offsets := make(map[string][]int)
-
- for i, ins := range insns {
- if ins.Reference == "" {
- continue
- }
-
- offsets[ins.Reference] = append(offsets[ins.Reference], i)
- }
-
- return offsets
-}
-
-func (insns Instructions) marshalledOffsets() (map[string]int, error) {
- symbols := make(map[string]int)
-
- marshalledPos := 0
- for _, ins := range insns {
- currentPos := marshalledPos
- marshalledPos += ins.OpCode.marshalledInstructions()
-
- if ins.Symbol == "" {
- continue
- }
-
- if _, ok := symbols[ins.Symbol]; ok {
- return nil, fmt.Errorf("duplicate symbol %s", ins.Symbol)
- }
-
- symbols[ins.Symbol] = currentPos
- }
-
- return symbols, nil
-}
-
-// Format implements fmt.Formatter.
-//
-// You can control indentation of symbols by
-// specifying a width. Setting a precision controls the indentation of
-// instructions.
-// The default character is a tab, which can be overriden by specifying
-// the ' ' space flag.
-func (insns Instructions) Format(f fmt.State, c rune) {
- if c != 's' && c != 'v' {
- fmt.Fprintf(f, "{UNKNOWN FORMAT '%c'}", c)
- return
- }
-
- // Precision is better in this case, because it allows
- // specifying 0 padding easily.
- padding, ok := f.Precision()
- if !ok {
- padding = 1
- }
-
- indent := strings.Repeat("\t", padding)
- if f.Flag(' ') {
- indent = strings.Repeat(" ", padding)
- }
-
- symPadding, ok := f.Width()
- if !ok {
- symPadding = padding - 1
- }
- if symPadding < 0 {
- symPadding = 0
- }
-
- symIndent := strings.Repeat("\t", symPadding)
- if f.Flag(' ') {
- symIndent = strings.Repeat(" ", symPadding)
- }
-
- // Figure out how many digits we need to represent the highest
- // offset.
- highestOffset := 0
- for _, ins := range insns {
- highestOffset += ins.OpCode.marshalledInstructions()
- }
- offsetWidth := int(math.Ceil(math.Log10(float64(highestOffset))))
-
- offset := 0
- for _, ins := range insns {
- if ins.Symbol != "" {
- fmt.Fprintf(f, "%s%s:\n", symIndent, ins.Symbol)
- }
- fmt.Fprintf(f, "%s%*d: %v\n", indent, offsetWidth, offset, ins)
- offset += ins.OpCode.marshalledInstructions()
- }
-
- return
-}
-
-// Marshal encodes a BPF program into the kernel format.
-func (insns Instructions) Marshal(w io.Writer, bo binary.ByteOrder) error {
- absoluteOffsets, err := insns.marshalledOffsets()
- if err != nil {
- return err
- }
-
- num := 0
- for i, ins := range insns {
- switch {
- case ins.OpCode.JumpOp() == Call && ins.Src == PseudoCall && ins.Constant == -1:
- // Rewrite bpf to bpf call
- offset, ok := absoluteOffsets[ins.Reference]
- if !ok {
- return fmt.Errorf("instruction %d: reference to missing symbol %s", i, ins.Reference)
- }
-
- ins.Constant = int64(offset - num - 1)
-
- case ins.OpCode.Class() == JumpClass && ins.Offset == -1:
- // Rewrite jump to label
- offset, ok := absoluteOffsets[ins.Reference]
- if !ok {
- return fmt.Errorf("instruction %d: reference to missing symbol %s", i, ins.Reference)
- }
-
- ins.Offset = int16(offset - num - 1)
- }
-
- n, err := ins.Marshal(w, bo)
- if err != nil {
- return fmt.Errorf("instruction %d: %w", i, err)
- }
-
- num += int(n / InstructionSize)
- }
- return nil
-}
-
-type bpfInstruction struct {
- OpCode OpCode
- Registers bpfRegisters
- Offset int16
- Constant int32
-}
-
-type bpfRegisters uint8
-
-func newBPFRegisters(dst, src Register, bo binary.ByteOrder) (bpfRegisters, error) {
- switch bo {
- case binary.LittleEndian:
- return bpfRegisters((src << 4) | (dst & 0xF)), nil
- case binary.BigEndian:
- return bpfRegisters((dst << 4) | (src & 0xF)), nil
- default:
- return 0, fmt.Errorf("unrecognized ByteOrder %T", bo)
- }
-}
-
-func (r bpfRegisters) Unmarshal(bo binary.ByteOrder) (dst, src Register, err error) {
- switch bo {
- case binary.LittleEndian:
- return Register(r & 0xF), Register(r >> 4), nil
- case binary.BigEndian:
- return Register(r >> 4), Register(r & 0xf), nil
- default:
- return 0, 0, fmt.Errorf("unrecognized ByteOrder %T", bo)
- }
-}
-
-type unreferencedSymbolError struct {
- symbol string
-}
-
-func (use *unreferencedSymbolError) Error() string {
- return fmt.Sprintf("unreferenced symbol %s", use.symbol)
-}
-
-// IsUnreferencedSymbol returns true if err was caused by
-// an unreferenced symbol.
-func IsUnreferencedSymbol(err error) bool {
- _, ok := err.(*unreferencedSymbolError)
- return ok
-}
diff --git a/vendor/github.com/cilium/ebpf/asm/jump.go b/vendor/github.com/cilium/ebpf/asm/jump.go
deleted file mode 100644
index 7757179de..000000000
--- a/vendor/github.com/cilium/ebpf/asm/jump.go
+++ /dev/null
@@ -1,109 +0,0 @@
-package asm
-
-//go:generate stringer -output jump_string.go -type=JumpOp
-
-// JumpOp affect control flow.
-//
-// msb lsb
-// +----+-+---+
-// |OP |s|cls|
-// +----+-+---+
-type JumpOp uint8
-
-const jumpMask OpCode = aluMask
-
-const (
- // InvalidJumpOp is returned by getters when invoked
- // on non branch OpCodes
- InvalidJumpOp JumpOp = 0xff
- // Ja jumps by offset unconditionally
- Ja JumpOp = 0x00
- // JEq jumps by offset if r == imm
- JEq JumpOp = 0x10
- // JGT jumps by offset if r > imm
- JGT JumpOp = 0x20
- // JGE jumps by offset if r >= imm
- JGE JumpOp = 0x30
- // JSet jumps by offset if r & imm
- JSet JumpOp = 0x40
- // JNE jumps by offset if r != imm
- JNE JumpOp = 0x50
- // JSGT jumps by offset if signed r > signed imm
- JSGT JumpOp = 0x60
- // JSGE jumps by offset if signed r >= signed imm
- JSGE JumpOp = 0x70
- // Call builtin or user defined function from imm
- Call JumpOp = 0x80
- // Exit ends execution, with value in r0
- Exit JumpOp = 0x90
- // JLT jumps by offset if r < imm
- JLT JumpOp = 0xa0
- // JLE jumps by offset if r <= imm
- JLE JumpOp = 0xb0
- // JSLT jumps by offset if signed r < signed imm
- JSLT JumpOp = 0xc0
- // JSLE jumps by offset if signed r <= signed imm
- JSLE JumpOp = 0xd0
-)
-
-// Return emits an exit instruction.
-//
-// Requires a return value in R0.
-func Return() Instruction {
- return Instruction{
- OpCode: OpCode(JumpClass).SetJumpOp(Exit),
- }
-}
-
-// Op returns the OpCode for a given jump source.
-func (op JumpOp) Op(source Source) OpCode {
- return OpCode(JumpClass).SetJumpOp(op).SetSource(source)
-}
-
-// Imm compares dst to value, and adjusts PC by offset if the condition is fulfilled.
-func (op JumpOp) Imm(dst Register, value int32, label string) Instruction {
- if op == Exit || op == Call || op == Ja {
- return Instruction{OpCode: InvalidOpCode}
- }
-
- return Instruction{
- OpCode: OpCode(JumpClass).SetJumpOp(op).SetSource(ImmSource),
- Dst: dst,
- Offset: -1,
- Constant: int64(value),
- Reference: label,
- }
-}
-
-// Reg compares dst to src, and adjusts PC by offset if the condition is fulfilled.
-func (op JumpOp) Reg(dst, src Register, label string) Instruction {
- if op == Exit || op == Call || op == Ja {
- return Instruction{OpCode: InvalidOpCode}
- }
-
- return Instruction{
- OpCode: OpCode(JumpClass).SetJumpOp(op).SetSource(RegSource),
- Dst: dst,
- Src: src,
- Offset: -1,
- Reference: label,
- }
-}
-
-// Label adjusts PC to the address of the label.
-func (op JumpOp) Label(label string) Instruction {
- if op == Call {
- return Instruction{
- OpCode: OpCode(JumpClass).SetJumpOp(Call),
- Src: PseudoCall,
- Constant: -1,
- Reference: label,
- }
- }
-
- return Instruction{
- OpCode: OpCode(JumpClass).SetJumpOp(op),
- Offset: -1,
- Reference: label,
- }
-}
diff --git a/vendor/github.com/cilium/ebpf/asm/jump_string.go b/vendor/github.com/cilium/ebpf/asm/jump_string.go
deleted file mode 100644
index 85a4aaffa..000000000
--- a/vendor/github.com/cilium/ebpf/asm/jump_string.go
+++ /dev/null
@@ -1,53 +0,0 @@
-// Code generated by "stringer -output jump_string.go -type=JumpOp"; DO NOT EDIT.
-
-package asm
-
-import "strconv"
-
-func _() {
- // An "invalid array index" compiler error signifies that the constant values have changed.
- // Re-run the stringer command to generate them again.
- var x [1]struct{}
- _ = x[InvalidJumpOp-255]
- _ = x[Ja-0]
- _ = x[JEq-16]
- _ = x[JGT-32]
- _ = x[JGE-48]
- _ = x[JSet-64]
- _ = x[JNE-80]
- _ = x[JSGT-96]
- _ = x[JSGE-112]
- _ = x[Call-128]
- _ = x[Exit-144]
- _ = x[JLT-160]
- _ = x[JLE-176]
- _ = x[JSLT-192]
- _ = x[JSLE-208]
-}
-
-const _JumpOp_name = "JaJEqJGTJGEJSetJNEJSGTJSGECallExitJLTJLEJSLTJSLEInvalidJumpOp"
-
-var _JumpOp_map = map[JumpOp]string{
- 0: _JumpOp_name[0:2],
- 16: _JumpOp_name[2:5],
- 32: _JumpOp_name[5:8],
- 48: _JumpOp_name[8:11],
- 64: _JumpOp_name[11:15],
- 80: _JumpOp_name[15:18],
- 96: _JumpOp_name[18:22],
- 112: _JumpOp_name[22:26],
- 128: _JumpOp_name[26:30],
- 144: _JumpOp_name[30:34],
- 160: _JumpOp_name[34:37],
- 176: _JumpOp_name[37:40],
- 192: _JumpOp_name[40:44],
- 208: _JumpOp_name[44:48],
- 255: _JumpOp_name[48:61],
-}
-
-func (i JumpOp) String() string {
- if str, ok := _JumpOp_map[i]; ok {
- return str
- }
- return "JumpOp(" + strconv.FormatInt(int64(i), 10) + ")"
-}
diff --git a/vendor/github.com/cilium/ebpf/asm/load_store.go b/vendor/github.com/cilium/ebpf/asm/load_store.go
deleted file mode 100644
index 2d0ec648e..000000000
--- a/vendor/github.com/cilium/ebpf/asm/load_store.go
+++ /dev/null
@@ -1,204 +0,0 @@
-package asm
-
-//go:generate stringer -output load_store_string.go -type=Mode,Size
-
-// Mode for load and store operations
-//
-// msb lsb
-// +---+--+---+
-// |MDE|sz|cls|
-// +---+--+---+
-type Mode uint8
-
-const modeMask OpCode = 0xe0
-
-const (
- // InvalidMode is returned by getters when invoked
- // on non load / store OpCodes
- InvalidMode Mode = 0xff
- // ImmMode - immediate value
- ImmMode Mode = 0x00
- // AbsMode - immediate value + offset
- AbsMode Mode = 0x20
- // IndMode - indirect (imm+src)
- IndMode Mode = 0x40
- // MemMode - load from memory
- MemMode Mode = 0x60
- // XAddMode - add atomically across processors.
- XAddMode Mode = 0xc0
-)
-
-// Size of load and store operations
-//
-// msb lsb
-// +---+--+---+
-// |mde|SZ|cls|
-// +---+--+---+
-type Size uint8
-
-const sizeMask OpCode = 0x18
-
-const (
- // InvalidSize is returned by getters when invoked
- // on non load / store OpCodes
- InvalidSize Size = 0xff
- // DWord - double word; 64 bits
- DWord Size = 0x18
- // Word - word; 32 bits
- Word Size = 0x00
- // Half - half-word; 16 bits
- Half Size = 0x08
- // Byte - byte; 8 bits
- Byte Size = 0x10
-)
-
-// Sizeof returns the size in bytes.
-func (s Size) Sizeof() int {
- switch s {
- case DWord:
- return 8
- case Word:
- return 4
- case Half:
- return 2
- case Byte:
- return 1
- default:
- return -1
- }
-}
-
-// LoadMemOp returns the OpCode to load a value of given size from memory.
-func LoadMemOp(size Size) OpCode {
- return OpCode(LdXClass).SetMode(MemMode).SetSize(size)
-}
-
-// LoadMem emits `dst = *(size *)(src + offset)`.
-func LoadMem(dst, src Register, offset int16, size Size) Instruction {
- return Instruction{
- OpCode: LoadMemOp(size),
- Dst: dst,
- Src: src,
- Offset: offset,
- }
-}
-
-// LoadImmOp returns the OpCode to load an immediate of given size.
-//
-// As of kernel 4.20, only DWord size is accepted.
-func LoadImmOp(size Size) OpCode {
- return OpCode(LdClass).SetMode(ImmMode).SetSize(size)
-}
-
-// LoadImm emits `dst = (size)value`.
-//
-// As of kernel 4.20, only DWord size is accepted.
-func LoadImm(dst Register, value int64, size Size) Instruction {
- return Instruction{
- OpCode: LoadImmOp(size),
- Dst: dst,
- Constant: value,
- }
-}
-
-// LoadMapPtr stores a pointer to a map in dst.
-func LoadMapPtr(dst Register, fd int) Instruction {
- if fd < 0 {
- return Instruction{OpCode: InvalidOpCode}
- }
-
- return Instruction{
- OpCode: LoadImmOp(DWord),
- Dst: dst,
- Src: PseudoMapFD,
- Constant: int64(fd),
- }
-}
-
-// LoadMapValue stores a pointer to the value at a certain offset of a map.
-func LoadMapValue(dst Register, fd int, offset uint32) Instruction {
- if fd < 0 {
- return Instruction{OpCode: InvalidOpCode}
- }
-
- fdAndOffset := (uint64(offset) << 32) | uint64(uint32(fd))
- return Instruction{
- OpCode: LoadImmOp(DWord),
- Dst: dst,
- Src: PseudoMapValue,
- Constant: int64(fdAndOffset),
- }
-}
-
-// LoadIndOp returns the OpCode for loading a value of given size from an sk_buff.
-func LoadIndOp(size Size) OpCode {
- return OpCode(LdClass).SetMode(IndMode).SetSize(size)
-}
-
-// LoadInd emits `dst = ntoh(*(size *)(((sk_buff *)R6)->data + src + offset))`.
-func LoadInd(dst, src Register, offset int32, size Size) Instruction {
- return Instruction{
- OpCode: LoadIndOp(size),
- Dst: dst,
- Src: src,
- Constant: int64(offset),
- }
-}
-
-// LoadAbsOp returns the OpCode for loading a value of given size from an sk_buff.
-func LoadAbsOp(size Size) OpCode {
- return OpCode(LdClass).SetMode(AbsMode).SetSize(size)
-}
-
-// LoadAbs emits `r0 = ntoh(*(size *)(((sk_buff *)R6)->data + offset))`.
-func LoadAbs(offset int32, size Size) Instruction {
- return Instruction{
- OpCode: LoadAbsOp(size),
- Dst: R0,
- Constant: int64(offset),
- }
-}
-
-// StoreMemOp returns the OpCode for storing a register of given size in memory.
-func StoreMemOp(size Size) OpCode {
- return OpCode(StXClass).SetMode(MemMode).SetSize(size)
-}
-
-// StoreMem emits `*(size *)(dst + offset) = src`
-func StoreMem(dst Register, offset int16, src Register, size Size) Instruction {
- return Instruction{
- OpCode: StoreMemOp(size),
- Dst: dst,
- Src: src,
- Offset: offset,
- }
-}
-
-// StoreImmOp returns the OpCode for storing an immediate of given size in memory.
-func StoreImmOp(size Size) OpCode {
- return OpCode(StClass).SetMode(MemMode).SetSize(size)
-}
-
-// StoreImm emits `*(size *)(dst + offset) = value`.
-func StoreImm(dst Register, offset int16, value int64, size Size) Instruction {
- return Instruction{
- OpCode: StoreImmOp(size),
- Dst: dst,
- Offset: offset,
- Constant: value,
- }
-}
-
-// StoreXAddOp returns the OpCode to atomically add a register to a value in memory.
-func StoreXAddOp(size Size) OpCode {
- return OpCode(StXClass).SetMode(XAddMode).SetSize(size)
-}
-
-// StoreXAdd atomically adds src to *dst.
-func StoreXAdd(dst, src Register, size Size) Instruction {
- return Instruction{
- OpCode: StoreXAddOp(size),
- Dst: dst,
- Src: src,
- }
-}
diff --git a/vendor/github.com/cilium/ebpf/asm/load_store_string.go b/vendor/github.com/cilium/ebpf/asm/load_store_string.go
deleted file mode 100644
index 76d29a075..000000000
--- a/vendor/github.com/cilium/ebpf/asm/load_store_string.go
+++ /dev/null
@@ -1,80 +0,0 @@
-// Code generated by "stringer -output load_store_string.go -type=Mode,Size"; DO NOT EDIT.
-
-package asm
-
-import "strconv"
-
-func _() {
- // An "invalid array index" compiler error signifies that the constant values have changed.
- // Re-run the stringer command to generate them again.
- var x [1]struct{}
- _ = x[InvalidMode-255]
- _ = x[ImmMode-0]
- _ = x[AbsMode-32]
- _ = x[IndMode-64]
- _ = x[MemMode-96]
- _ = x[XAddMode-192]
-}
-
-const (
- _Mode_name_0 = "ImmMode"
- _Mode_name_1 = "AbsMode"
- _Mode_name_2 = "IndMode"
- _Mode_name_3 = "MemMode"
- _Mode_name_4 = "XAddMode"
- _Mode_name_5 = "InvalidMode"
-)
-
-func (i Mode) String() string {
- switch {
- case i == 0:
- return _Mode_name_0
- case i == 32:
- return _Mode_name_1
- case i == 64:
- return _Mode_name_2
- case i == 96:
- return _Mode_name_3
- case i == 192:
- return _Mode_name_4
- case i == 255:
- return _Mode_name_5
- default:
- return "Mode(" + strconv.FormatInt(int64(i), 10) + ")"
- }
-}
-func _() {
- // An "invalid array index" compiler error signifies that the constant values have changed.
- // Re-run the stringer command to generate them again.
- var x [1]struct{}
- _ = x[InvalidSize-255]
- _ = x[DWord-24]
- _ = x[Word-0]
- _ = x[Half-8]
- _ = x[Byte-16]
-}
-
-const (
- _Size_name_0 = "Word"
- _Size_name_1 = "Half"
- _Size_name_2 = "Byte"
- _Size_name_3 = "DWord"
- _Size_name_4 = "InvalidSize"
-)
-
-func (i Size) String() string {
- switch {
- case i == 0:
- return _Size_name_0
- case i == 8:
- return _Size_name_1
- case i == 16:
- return _Size_name_2
- case i == 24:
- return _Size_name_3
- case i == 255:
- return _Size_name_4
- default:
- return "Size(" + strconv.FormatInt(int64(i), 10) + ")"
- }
-}
diff --git a/vendor/github.com/cilium/ebpf/asm/opcode.go b/vendor/github.com/cilium/ebpf/asm/opcode.go
deleted file mode 100644
index c99b6595a..000000000
--- a/vendor/github.com/cilium/ebpf/asm/opcode.go
+++ /dev/null
@@ -1,237 +0,0 @@
-package asm
-
-import (
- "fmt"
- "strings"
-)
-
-//go:generate stringer -output opcode_string.go -type=Class
-
-type encoding int
-
-const (
- unknownEncoding encoding = iota
- loadOrStore
- jumpOrALU
-)
-
-// Class of operations
-//
-// msb lsb
-// +---+--+---+
-// | ?? |CLS|
-// +---+--+---+
-type Class uint8
-
-const classMask OpCode = 0x07
-
-const (
- // LdClass load memory
- LdClass Class = 0x00
- // LdXClass load memory from constant
- LdXClass Class = 0x01
- // StClass load register from memory
- StClass Class = 0x02
- // StXClass load register from constant
- StXClass Class = 0x03
- // ALUClass arithmetic operators
- ALUClass Class = 0x04
- // JumpClass jump operators
- JumpClass Class = 0x05
- // ALU64Class arithmetic in 64 bit mode
- ALU64Class Class = 0x07
-)
-
-func (cls Class) encoding() encoding {
- switch cls {
- case LdClass, LdXClass, StClass, StXClass:
- return loadOrStore
- case ALU64Class, ALUClass, JumpClass:
- return jumpOrALU
- default:
- return unknownEncoding
- }
-}
-
-// OpCode is a packed eBPF opcode.
-//
-// Its encoding is defined by a Class value:
-//
-// msb lsb
-// +----+-+---+
-// | ???? |CLS|
-// +----+-+---+
-type OpCode uint8
-
-// InvalidOpCode is returned by setters on OpCode
-const InvalidOpCode OpCode = 0xff
-
-// marshalledInstructions returns the number of BPF instructions required
-// to encode this opcode.
-func (op OpCode) marshalledInstructions() int {
- if op == LoadImmOp(DWord) {
- return 2
- }
- return 1
-}
-
-func (op OpCode) isDWordLoad() bool {
- return op == LoadImmOp(DWord)
-}
-
-// Class returns the class of operation.
-func (op OpCode) Class() Class {
- return Class(op & classMask)
-}
-
-// Mode returns the mode for load and store operations.
-func (op OpCode) Mode() Mode {
- if op.Class().encoding() != loadOrStore {
- return InvalidMode
- }
- return Mode(op & modeMask)
-}
-
-// Size returns the size for load and store operations.
-func (op OpCode) Size() Size {
- if op.Class().encoding() != loadOrStore {
- return InvalidSize
- }
- return Size(op & sizeMask)
-}
-
-// Source returns the source for branch and ALU operations.
-func (op OpCode) Source() Source {
- if op.Class().encoding() != jumpOrALU || op.ALUOp() == Swap {
- return InvalidSource
- }
- return Source(op & sourceMask)
-}
-
-// ALUOp returns the ALUOp.
-func (op OpCode) ALUOp() ALUOp {
- if op.Class().encoding() != jumpOrALU {
- return InvalidALUOp
- }
- return ALUOp(op & aluMask)
-}
-
-// Endianness returns the Endianness for a byte swap instruction.
-func (op OpCode) Endianness() Endianness {
- if op.ALUOp() != Swap {
- return InvalidEndian
- }
- return Endianness(op & endianMask)
-}
-
-// JumpOp returns the JumpOp.
-func (op OpCode) JumpOp() JumpOp {
- if op.Class().encoding() != jumpOrALU {
- return InvalidJumpOp
- }
- return JumpOp(op & jumpMask)
-}
-
-// SetMode sets the mode on load and store operations.
-//
-// Returns InvalidOpCode if op is of the wrong class.
-func (op OpCode) SetMode(mode Mode) OpCode {
- if op.Class().encoding() != loadOrStore || !valid(OpCode(mode), modeMask) {
- return InvalidOpCode
- }
- return (op & ^modeMask) | OpCode(mode)
-}
-
-// SetSize sets the size on load and store operations.
-//
-// Returns InvalidOpCode if op is of the wrong class.
-func (op OpCode) SetSize(size Size) OpCode {
- if op.Class().encoding() != loadOrStore || !valid(OpCode(size), sizeMask) {
- return InvalidOpCode
- }
- return (op & ^sizeMask) | OpCode(size)
-}
-
-// SetSource sets the source on jump and ALU operations.
-//
-// Returns InvalidOpCode if op is of the wrong class.
-func (op OpCode) SetSource(source Source) OpCode {
- if op.Class().encoding() != jumpOrALU || !valid(OpCode(source), sourceMask) {
- return InvalidOpCode
- }
- return (op & ^sourceMask) | OpCode(source)
-}
-
-// SetALUOp sets the ALUOp on ALU operations.
-//
-// Returns InvalidOpCode if op is of the wrong class.
-func (op OpCode) SetALUOp(alu ALUOp) OpCode {
- class := op.Class()
- if (class != ALUClass && class != ALU64Class) || !valid(OpCode(alu), aluMask) {
- return InvalidOpCode
- }
- return (op & ^aluMask) | OpCode(alu)
-}
-
-// SetJumpOp sets the JumpOp on jump operations.
-//
-// Returns InvalidOpCode if op is of the wrong class.
-func (op OpCode) SetJumpOp(jump JumpOp) OpCode {
- if op.Class() != JumpClass || !valid(OpCode(jump), jumpMask) {
- return InvalidOpCode
- }
- return (op & ^jumpMask) | OpCode(jump)
-}
-
-func (op OpCode) String() string {
- var f strings.Builder
-
- switch class := op.Class(); class {
- case LdClass, LdXClass, StClass, StXClass:
- f.WriteString(strings.TrimSuffix(class.String(), "Class"))
-
- mode := op.Mode()
- f.WriteString(strings.TrimSuffix(mode.String(), "Mode"))
-
- switch op.Size() {
- case DWord:
- f.WriteString("DW")
- case Word:
- f.WriteString("W")
- case Half:
- f.WriteString("H")
- case Byte:
- f.WriteString("B")
- }
-
- case ALU64Class, ALUClass:
- f.WriteString(op.ALUOp().String())
-
- if op.ALUOp() == Swap {
- // Width for Endian is controlled by Constant
- f.WriteString(op.Endianness().String())
- } else {
- if class == ALUClass {
- f.WriteString("32")
- }
-
- f.WriteString(strings.TrimSuffix(op.Source().String(), "Source"))
- }
-
- case JumpClass:
- f.WriteString(op.JumpOp().String())
- if jop := op.JumpOp(); jop != Exit && jop != Call {
- f.WriteString(strings.TrimSuffix(op.Source().String(), "Source"))
- }
-
- default:
- fmt.Fprintf(&f, "OpCode(%#x)", uint8(op))
- }
-
- return f.String()
-}
-
-// valid returns true if all bits in value are covered by mask.
-func valid(value, mask OpCode) bool {
- return value & ^mask == 0
-}
diff --git a/vendor/github.com/cilium/ebpf/asm/opcode_string.go b/vendor/github.com/cilium/ebpf/asm/opcode_string.go
deleted file mode 100644
index 079ce1db0..000000000
--- a/vendor/github.com/cilium/ebpf/asm/opcode_string.go
+++ /dev/null
@@ -1,38 +0,0 @@
-// Code generated by "stringer -output opcode_string.go -type=Class"; DO NOT EDIT.
-
-package asm
-
-import "strconv"
-
-func _() {
- // An "invalid array index" compiler error signifies that the constant values have changed.
- // Re-run the stringer command to generate them again.
- var x [1]struct{}
- _ = x[LdClass-0]
- _ = x[LdXClass-1]
- _ = x[StClass-2]
- _ = x[StXClass-3]
- _ = x[ALUClass-4]
- _ = x[JumpClass-5]
- _ = x[ALU64Class-7]
-}
-
-const (
- _Class_name_0 = "LdClassLdXClassStClassStXClassALUClassJumpClass"
- _Class_name_1 = "ALU64Class"
-)
-
-var (
- _Class_index_0 = [...]uint8{0, 7, 15, 22, 30, 38, 47}
-)
-
-func (i Class) String() string {
- switch {
- case 0 <= i && i <= 5:
- return _Class_name_0[_Class_index_0[i]:_Class_index_0[i+1]]
- case i == 7:
- return _Class_name_1
- default:
- return "Class(" + strconv.FormatInt(int64(i), 10) + ")"
- }
-}
diff --git a/vendor/github.com/cilium/ebpf/asm/register.go b/vendor/github.com/cilium/ebpf/asm/register.go
deleted file mode 100644
index 76cb44bff..000000000
--- a/vendor/github.com/cilium/ebpf/asm/register.go
+++ /dev/null
@@ -1,49 +0,0 @@
-package asm
-
-import (
- "fmt"
-)
-
-// Register is the source or destination of most operations.
-type Register uint8
-
-// R0 contains return values.
-const R0 Register = 0
-
-// Registers for function arguments.
-const (
- R1 Register = R0 + 1 + iota
- R2
- R3
- R4
- R5
-)
-
-// Callee saved registers preserved by function calls.
-const (
- R6 Register = R5 + 1 + iota
- R7
- R8
- R9
-)
-
-// Read-only frame pointer to access stack.
-const (
- R10 Register = R9 + 1
- RFP = R10
-)
-
-// Pseudo registers used by 64bit loads and jumps
-const (
- PseudoMapFD = R1 // BPF_PSEUDO_MAP_FD
- PseudoMapValue = R2 // BPF_PSEUDO_MAP_VALUE
- PseudoCall = R1 // BPF_PSEUDO_CALL
-)
-
-func (r Register) String() string {
- v := uint8(r)
- if v == 10 {
- return "rfp"
- }
- return fmt.Sprintf("r%d", v)
-}
diff --git a/vendor/github.com/cilium/ebpf/collection.go b/vendor/github.com/cilium/ebpf/collection.go
deleted file mode 100644
index 0c8b65d94..000000000
--- a/vendor/github.com/cilium/ebpf/collection.go
+++ /dev/null
@@ -1,294 +0,0 @@
-package ebpf
-
-import (
- "errors"
- "fmt"
- "math"
-
- "github.com/cilium/ebpf/asm"
- "github.com/cilium/ebpf/internal"
- "github.com/cilium/ebpf/internal/btf"
-)
-
-// CollectionOptions control loading a collection into the kernel.
-type CollectionOptions struct {
- Programs ProgramOptions
-}
-
-// CollectionSpec describes a collection.
-type CollectionSpec struct {
- Maps map[string]*MapSpec
- Programs map[string]*ProgramSpec
-}
-
-// Copy returns a recursive copy of the spec.
-func (cs *CollectionSpec) Copy() *CollectionSpec {
- if cs == nil {
- return nil
- }
-
- cpy := CollectionSpec{
- Maps: make(map[string]*MapSpec, len(cs.Maps)),
- Programs: make(map[string]*ProgramSpec, len(cs.Programs)),
- }
-
- for name, spec := range cs.Maps {
- cpy.Maps[name] = spec.Copy()
- }
-
- for name, spec := range cs.Programs {
- cpy.Programs[name] = spec.Copy()
- }
-
- return &cpy
-}
-
-// RewriteMaps replaces all references to specific maps.
-//
-// Use this function to use pre-existing maps instead of creating new ones
-// when calling NewCollection. Any named maps are removed from CollectionSpec.Maps.
-//
-// Returns an error if a named map isn't used in at least one program.
-func (cs *CollectionSpec) RewriteMaps(maps map[string]*Map) error {
- for symbol, m := range maps {
- // have we seen a program that uses this symbol / map
- seen := false
- fd := m.FD()
- for progName, progSpec := range cs.Programs {
- err := progSpec.Instructions.RewriteMapPtr(symbol, fd)
-
- switch {
- case err == nil:
- seen = true
-
- case asm.IsUnreferencedSymbol(err):
- // Not all programs need to use the map
-
- default:
- return fmt.Errorf("program %s: %w", progName, err)
- }
- }
-
- if !seen {
- return fmt.Errorf("map %s not referenced by any programs", symbol)
- }
-
- // Prevent NewCollection from creating rewritten maps
- delete(cs.Maps, symbol)
- }
-
- return nil
-}
-
-// RewriteConstants replaces the value of multiple constants.
-//
-// The constant must be defined like so in the C program:
-//
-// static volatile const type foobar;
-// static volatile const type foobar = default;
-//
-// Replacement values must be of the same length as the C sizeof(type).
-// If necessary, they are marshalled according to the same rules as
-// map values.
-//
-// From Linux 5.5 the verifier will use constants to eliminate dead code.
-//
-// Returns an error if a constant doesn't exist.
-func (cs *CollectionSpec) RewriteConstants(consts map[string]interface{}) error {
- rodata := cs.Maps[".rodata"]
- if rodata == nil {
- return errors.New("missing .rodata section")
- }
-
- if rodata.BTF == nil {
- return errors.New(".rodata section has no BTF")
- }
-
- if n := len(rodata.Contents); n != 1 {
- return fmt.Errorf("expected one key in .rodata, found %d", n)
- }
-
- kv := rodata.Contents[0]
- value, ok := kv.Value.([]byte)
- if !ok {
- return fmt.Errorf("first value in .rodata is %T not []byte", kv.Value)
- }
-
- buf := make([]byte, len(value))
- copy(buf, value)
-
- err := patchValue(buf, btf.MapValue(rodata.BTF), consts)
- if err != nil {
- return err
- }
-
- rodata.Contents[0] = MapKV{kv.Key, buf}
- return nil
-}
-
-// Collection is a collection of Programs and Maps associated
-// with their symbols
-type Collection struct {
- Programs map[string]*Program
- Maps map[string]*Map
-}
-
-// NewCollection creates a Collection from a specification.
-//
-// Only maps referenced by at least one of the programs are initialized.
-func NewCollection(spec *CollectionSpec) (*Collection, error) {
- return NewCollectionWithOptions(spec, CollectionOptions{})
-}
-
-// NewCollectionWithOptions creates a Collection from a specification.
-//
-// Only maps referenced by at least one of the programs are initialized.
-func NewCollectionWithOptions(spec *CollectionSpec, opts CollectionOptions) (coll *Collection, err error) {
- var (
- maps = make(map[string]*Map)
- progs = make(map[string]*Program)
- btfs = make(map[*btf.Spec]*btf.Handle)
- )
-
- defer func() {
- for _, btf := range btfs {
- btf.Close()
- }
-
- if err == nil {
- return
- }
-
- for _, m := range maps {
- m.Close()
- }
-
- for _, p := range progs {
- p.Close()
- }
- }()
-
- loadBTF := func(spec *btf.Spec) (*btf.Handle, error) {
- if btfs[spec] != nil {
- return btfs[spec], nil
- }
-
- handle, err := btf.NewHandle(spec)
- if err != nil {
- return nil, err
- }
-
- btfs[spec] = handle
- return handle, nil
- }
-
- for mapName, mapSpec := range spec.Maps {
- var handle *btf.Handle
- if mapSpec.BTF != nil {
- handle, err = loadBTF(btf.MapSpec(mapSpec.BTF))
- if err != nil && !errors.Is(err, btf.ErrNotSupported) {
- return nil, err
- }
- }
-
- m, err := newMapWithBTF(mapSpec, handle)
- if err != nil {
- return nil, fmt.Errorf("map %s: %w", mapName, err)
- }
- maps[mapName] = m
- }
-
- for progName, origProgSpec := range spec.Programs {
- progSpec := origProgSpec.Copy()
-
- // Rewrite any reference to a valid map.
- for i := range progSpec.Instructions {
- ins := &progSpec.Instructions[i]
-
- if ins.OpCode != asm.LoadImmOp(asm.DWord) || ins.Reference == "" {
- continue
- }
-
- if uint32(ins.Constant) != math.MaxUint32 {
- // Don't overwrite maps already rewritten, users can
- // rewrite programs in the spec themselves
- continue
- }
-
- m := maps[ins.Reference]
- if m == nil {
- return nil, fmt.Errorf("program %s: missing map %s", progName, ins.Reference)
- }
-
- fd := m.FD()
- if fd < 0 {
- return nil, fmt.Errorf("map %s: %w", ins.Reference, internal.ErrClosedFd)
- }
- if err := ins.RewriteMapPtr(m.FD()); err != nil {
- return nil, fmt.Errorf("progam %s: map %s: %w", progName, ins.Reference, err)
- }
- }
-
- var handle *btf.Handle
- if progSpec.BTF != nil {
- handle, err = loadBTF(btf.ProgramSpec(progSpec.BTF))
- if err != nil && !errors.Is(err, btf.ErrNotSupported) {
- return nil, err
- }
- }
-
- prog, err := newProgramWithBTF(progSpec, handle, opts.Programs)
- if err != nil {
- return nil, fmt.Errorf("program %s: %w", progName, err)
- }
- progs[progName] = prog
- }
-
- return &Collection{
- progs,
- maps,
- }, nil
-}
-
-// LoadCollection parses an object file and converts it to a collection.
-func LoadCollection(file string) (*Collection, error) {
- spec, err := LoadCollectionSpec(file)
- if err != nil {
- return nil, err
- }
- return NewCollection(spec)
-}
-
-// Close frees all maps and programs associated with the collection.
-//
-// The collection mustn't be used afterwards.
-func (coll *Collection) Close() {
- for _, prog := range coll.Programs {
- prog.Close()
- }
- for _, m := range coll.Maps {
- m.Close()
- }
-}
-
-// DetachMap removes the named map from the Collection.
-//
-// This means that a later call to Close() will not affect this map.
-//
-// Returns nil if no map of that name exists.
-func (coll *Collection) DetachMap(name string) *Map {
- m := coll.Maps[name]
- delete(coll.Maps, name)
- return m
-}
-
-// DetachProgram removes the named program from the Collection.
-//
-// This means that a later call to Close() will not affect this program.
-//
-// Returns nil if no program of that name exists.
-func (coll *Collection) DetachProgram(name string) *Program {
- p := coll.Programs[name]
- delete(coll.Programs, name)
- return p
-}
diff --git a/vendor/github.com/cilium/ebpf/doc.go b/vendor/github.com/cilium/ebpf/doc.go
deleted file mode 100644
index d96e6b1e6..000000000
--- a/vendor/github.com/cilium/ebpf/doc.go
+++ /dev/null
@@ -1,17 +0,0 @@
-// Package ebpf is a toolkit for working with eBPF programs.
-//
-// eBPF programs are small snippets of code which are executed directly
-// in a VM in the Linux kernel, which makes them very fast and flexible.
-// Many Linux subsystems now accept eBPF programs. This makes it possible
-// to implement highly application specific logic inside the kernel,
-// without having to modify the actual kernel itself.
-//
-// This package is designed for long-running processes which
-// want to use eBPF to implement part of their application logic. It has no
-// run-time dependencies outside of the library and the Linux kernel itself.
-// eBPF code should be compiled ahead of time using clang, and shipped with
-// your application as any other resource.
-//
-// This package doesn't include code required to attach eBPF to Linux
-// subsystems, since this varies per subsystem.
-package ebpf
diff --git a/vendor/github.com/cilium/ebpf/elf_reader.go b/vendor/github.com/cilium/ebpf/elf_reader.go
deleted file mode 100644
index 77acaed8d..000000000
--- a/vendor/github.com/cilium/ebpf/elf_reader.go
+++ /dev/null
@@ -1,742 +0,0 @@
-package ebpf
-
-import (
- "bytes"
- "debug/elf"
- "encoding/binary"
- "errors"
- "fmt"
- "io"
- "math"
- "os"
- "strings"
-
- "github.com/cilium/ebpf/asm"
- "github.com/cilium/ebpf/internal"
- "github.com/cilium/ebpf/internal/btf"
- "github.com/cilium/ebpf/internal/unix"
-)
-
-type elfCode struct {
- *elf.File
- symbols []elf.Symbol
- symbolsPerSection map[elf.SectionIndex]map[uint64]elf.Symbol
- license string
- version uint32
-}
-
-// LoadCollectionSpec parses an ELF file into a CollectionSpec.
-func LoadCollectionSpec(file string) (*CollectionSpec, error) {
- f, err := os.Open(file)
- if err != nil {
- return nil, err
- }
- defer f.Close()
-
- spec, err := LoadCollectionSpecFromReader(f)
- if err != nil {
- return nil, fmt.Errorf("file %s: %w", file, err)
- }
- return spec, nil
-}
-
-// LoadCollectionSpecFromReader parses an ELF file into a CollectionSpec.
-func LoadCollectionSpecFromReader(rd io.ReaderAt) (*CollectionSpec, error) {
- f, err := elf.NewFile(rd)
- if err != nil {
- return nil, err
- }
- defer f.Close()
-
- symbols, err := f.Symbols()
- if err != nil {
- return nil, fmt.Errorf("load symbols: %v", err)
- }
-
- ec := &elfCode{f, symbols, symbolsPerSection(symbols), "", 0}
-
- var (
- licenseSection *elf.Section
- versionSection *elf.Section
- btfMaps = make(map[elf.SectionIndex]*elf.Section)
- progSections = make(map[elf.SectionIndex]*elf.Section)
- relSections = make(map[elf.SectionIndex]*elf.Section)
- mapSections = make(map[elf.SectionIndex]*elf.Section)
- dataSections = make(map[elf.SectionIndex]*elf.Section)
- )
-
- for i, sec := range ec.Sections {
- switch {
- case strings.HasPrefix(sec.Name, "license"):
- licenseSection = sec
- case strings.HasPrefix(sec.Name, "version"):
- versionSection = sec
- case strings.HasPrefix(sec.Name, "maps"):
- mapSections[elf.SectionIndex(i)] = sec
- case sec.Name == ".maps":
- btfMaps[elf.SectionIndex(i)] = sec
- case sec.Name == ".bss" || sec.Name == ".rodata" || sec.Name == ".data":
- dataSections[elf.SectionIndex(i)] = sec
- case sec.Type == elf.SHT_REL:
- if int(sec.Info) >= len(ec.Sections) {
- return nil, fmt.Errorf("found relocation section %v for missing section %v", i, sec.Info)
- }
-
- // Store relocations under the section index of the target
- idx := elf.SectionIndex(sec.Info)
- if relSections[idx] != nil {
- return nil, fmt.Errorf("section %d has multiple relocation sections", sec.Info)
- }
- relSections[idx] = sec
- case sec.Type == elf.SHT_PROGBITS && (sec.Flags&elf.SHF_EXECINSTR) != 0 && sec.Size > 0:
- progSections[elf.SectionIndex(i)] = sec
- }
- }
-
- ec.license, err = loadLicense(licenseSection)
- if err != nil {
- return nil, fmt.Errorf("load license: %w", err)
- }
-
- ec.version, err = loadVersion(versionSection, ec.ByteOrder)
- if err != nil {
- return nil, fmt.Errorf("load version: %w", err)
- }
-
- btfSpec, err := btf.LoadSpecFromReader(rd)
- if err != nil {
- return nil, fmt.Errorf("load BTF: %w", err)
- }
-
- relocations, referencedSections, err := ec.loadRelocations(relSections)
- if err != nil {
- return nil, fmt.Errorf("load relocations: %w", err)
- }
-
- maps := make(map[string]*MapSpec)
- if err := ec.loadMaps(maps, mapSections); err != nil {
- return nil, fmt.Errorf("load maps: %w", err)
- }
-
- if len(btfMaps) > 0 {
- if err := ec.loadBTFMaps(maps, btfMaps, btfSpec); err != nil {
- return nil, fmt.Errorf("load BTF maps: %w", err)
- }
- }
-
- if len(dataSections) > 0 {
- for idx := range dataSections {
- if !referencedSections[idx] {
- // Prune data sections which are not referenced by any
- // instructions.
- delete(dataSections, idx)
- }
- }
-
- if err := ec.loadDataSections(maps, dataSections, btfSpec); err != nil {
- return nil, fmt.Errorf("load data sections: %w", err)
- }
- }
-
- progs, err := ec.loadPrograms(progSections, relocations, btfSpec)
- if err != nil {
- return nil, fmt.Errorf("load programs: %w", err)
- }
-
- return &CollectionSpec{maps, progs}, nil
-}
-
-func loadLicense(sec *elf.Section) (string, error) {
- if sec == nil {
- return "", nil
- }
-
- data, err := sec.Data()
- if err != nil {
- return "", fmt.Errorf("section %s: %v", sec.Name, err)
- }
- return string(bytes.TrimRight(data, "\000")), nil
-}
-
-func loadVersion(sec *elf.Section, bo binary.ByteOrder) (uint32, error) {
- if sec == nil {
- return 0, nil
- }
-
- var version uint32
- if err := binary.Read(sec.Open(), bo, &version); err != nil {
- return 0, fmt.Errorf("section %s: %v", sec.Name, err)
- }
- return version, nil
-}
-
-func (ec *elfCode) loadPrograms(progSections map[elf.SectionIndex]*elf.Section, relocations map[elf.SectionIndex]map[uint64]elf.Symbol, btfSpec *btf.Spec) (map[string]*ProgramSpec, error) {
- var (
- progs []*ProgramSpec
- libs []*ProgramSpec
- )
-
- for idx, sec := range progSections {
- syms := ec.symbolsPerSection[idx]
- if len(syms) == 0 {
- return nil, fmt.Errorf("section %v: missing symbols", sec.Name)
- }
-
- funcSym, ok := syms[0]
- if !ok {
- return nil, fmt.Errorf("section %v: no label at start", sec.Name)
- }
-
- insns, length, err := ec.loadInstructions(sec, syms, relocations[idx])
- if err != nil {
- return nil, fmt.Errorf("program %s: can't unmarshal instructions: %w", funcSym.Name, err)
- }
-
- progType, attachType, attachTo := getProgType(sec.Name)
-
- spec := &ProgramSpec{
- Name: funcSym.Name,
- Type: progType,
- AttachType: attachType,
- AttachTo: attachTo,
- License: ec.license,
- KernelVersion: ec.version,
- Instructions: insns,
- ByteOrder: ec.ByteOrder,
- }
-
- if btfSpec != nil {
- spec.BTF, err = btfSpec.Program(sec.Name, length)
- if err != nil && !errors.Is(err, btf.ErrNoExtendedInfo) {
- return nil, fmt.Errorf("program %s: %w", funcSym.Name, err)
- }
- }
-
- if spec.Type == UnspecifiedProgram {
- // There is no single name we can use for "library" sections,
- // since they may contain multiple functions. We'll decode the
- // labels they contain later on, and then link sections that way.
- libs = append(libs, spec)
- } else {
- progs = append(progs, spec)
- }
- }
-
- res := make(map[string]*ProgramSpec, len(progs))
- for _, prog := range progs {
- err := link(prog, libs)
- if err != nil {
- return nil, fmt.Errorf("program %s: %w", prog.Name, err)
- }
- res[prog.Name] = prog
- }
-
- return res, nil
-}
-
-func (ec *elfCode) loadInstructions(section *elf.Section, symbols, relocations map[uint64]elf.Symbol) (asm.Instructions, uint64, error) {
- var (
- r = section.Open()
- insns asm.Instructions
- offset uint64
- )
- for {
- var ins asm.Instruction
- n, err := ins.Unmarshal(r, ec.ByteOrder)
- if err == io.EOF {
- return insns, offset, nil
- }
- if err != nil {
- return nil, 0, fmt.Errorf("offset %d: %w", offset, err)
- }
-
- ins.Symbol = symbols[offset].Name
-
- if rel, ok := relocations[offset]; ok {
- if err = ec.relocateInstruction(&ins, rel); err != nil {
- return nil, 0, fmt.Errorf("offset %d: can't relocate instruction: %w", offset, err)
- }
- }
-
- insns = append(insns, ins)
- offset += n
- }
-}
-
-func (ec *elfCode) relocateInstruction(ins *asm.Instruction, rel elf.Symbol) error {
- var (
- typ = elf.ST_TYPE(rel.Info)
- bind = elf.ST_BIND(rel.Info)
- name = rel.Name
- )
-
- if typ == elf.STT_SECTION {
- // Symbols with section type do not have a name set. Get it
- // from the section itself.
- idx := int(rel.Section)
- if idx > len(ec.Sections) {
- return errors.New("out-of-bounds section index")
- }
-
- name = ec.Sections[idx].Name
- }
-
-outer:
- switch {
- case ins.OpCode == asm.LoadImmOp(asm.DWord):
- // There are two distinct types of a load from a map:
- // a direct one, where the value is extracted without
- // a call to map_lookup_elem in eBPF, and an indirect one
- // that goes via the helper. They are distinguished by
- // different relocations.
- switch typ {
- case elf.STT_SECTION:
- // This is a direct load since the referenced symbol is a
- // section. Weirdly, the offset of the real symbol in the
- // section is encoded in the instruction stream.
- if bind != elf.STB_LOCAL {
- return fmt.Errorf("direct load: %s: unsupported relocation %s", name, bind)
- }
-
- // For some reason, clang encodes the offset of the symbol its
- // section in the first basic BPF instruction, while the kernel
- // expects it in the second one.
- ins.Constant <<= 32
- ins.Src = asm.PseudoMapValue
-
- case elf.STT_NOTYPE:
- if bind == elf.STB_GLOBAL && rel.Section == elf.SHN_UNDEF {
- // This is a relocation generated by inline assembly.
- // We can't do more than assigning ins.Reference.
- break outer
- }
-
- // This is an ELF generated on clang < 8, which doesn't tag
- // relocations appropriately.
- fallthrough
-
- case elf.STT_OBJECT:
- if bind != elf.STB_GLOBAL {
- return fmt.Errorf("load: %s: unsupported binding: %s", name, bind)
- }
-
- ins.Src = asm.PseudoMapFD
-
- default:
- return fmt.Errorf("load: %s: unsupported relocation: %s", name, typ)
- }
-
- // Mark the instruction as needing an update when creating the
- // collection.
- if err := ins.RewriteMapPtr(-1); err != nil {
- return err
- }
-
- case ins.OpCode.JumpOp() == asm.Call:
- if ins.Src != asm.PseudoCall {
- return fmt.Errorf("call: %s: incorrect source register", name)
- }
-
- switch typ {
- case elf.STT_NOTYPE, elf.STT_FUNC:
- if bind != elf.STB_GLOBAL {
- return fmt.Errorf("call: %s: unsupported binding: %s", name, bind)
- }
-
- case elf.STT_SECTION:
- if bind != elf.STB_LOCAL {
- return fmt.Errorf("call: %s: unsupported binding: %s", name, bind)
- }
-
- // The function we want to call is in the indicated section,
- // at the offset encoded in the instruction itself. Reverse
- // the calculation to find the real function we're looking for.
- // A value of -1 references the first instruction in the section.
- offset := int64(int32(ins.Constant)+1) * asm.InstructionSize
- if offset < 0 {
- return fmt.Errorf("call: %s: invalid offset %d", name, offset)
- }
-
- sym, ok := ec.symbolsPerSection[rel.Section][uint64(offset)]
- if !ok {
- return fmt.Errorf("call: %s: no symbol at offset %d", name, offset)
- }
-
- ins.Constant = -1
- name = sym.Name
-
- default:
- return fmt.Errorf("call: %s: invalid symbol type %s", name, typ)
- }
-
- default:
- return fmt.Errorf("relocation for unsupported instruction: %s", ins.OpCode)
- }
-
- ins.Reference = name
- return nil
-}
-
-func (ec *elfCode) loadMaps(maps map[string]*MapSpec, mapSections map[elf.SectionIndex]*elf.Section) error {
- for idx, sec := range mapSections {
- syms := ec.symbolsPerSection[idx]
- if len(syms) == 0 {
- return fmt.Errorf("section %v: no symbols", sec.Name)
- }
-
- if sec.Size%uint64(len(syms)) != 0 {
- return fmt.Errorf("section %v: map descriptors are not of equal size", sec.Name)
- }
-
- var (
- r = sec.Open()
- size = sec.Size / uint64(len(syms))
- )
- for i, offset := 0, uint64(0); i < len(syms); i, offset = i+1, offset+size {
- mapSym, ok := syms[offset]
- if !ok {
- return fmt.Errorf("section %s: missing symbol for map at offset %d", sec.Name, offset)
- }
-
- if maps[mapSym.Name] != nil {
- return fmt.Errorf("section %v: map %v already exists", sec.Name, mapSym)
- }
-
- lr := io.LimitReader(r, int64(size))
-
- spec := MapSpec{
- Name: SanitizeName(mapSym.Name, -1),
- }
- switch {
- case binary.Read(lr, ec.ByteOrder, &spec.Type) != nil:
- return fmt.Errorf("map %v: missing type", mapSym)
- case binary.Read(lr, ec.ByteOrder, &spec.KeySize) != nil:
- return fmt.Errorf("map %v: missing key size", mapSym)
- case binary.Read(lr, ec.ByteOrder, &spec.ValueSize) != nil:
- return fmt.Errorf("map %v: missing value size", mapSym)
- case binary.Read(lr, ec.ByteOrder, &spec.MaxEntries) != nil:
- return fmt.Errorf("map %v: missing max entries", mapSym)
- case binary.Read(lr, ec.ByteOrder, &spec.Flags) != nil:
- return fmt.Errorf("map %v: missing flags", mapSym)
- }
-
- if _, err := io.Copy(internal.DiscardZeroes{}, lr); err != nil {
- return fmt.Errorf("map %v: unknown and non-zero fields in definition", mapSym)
- }
-
- maps[mapSym.Name] = &spec
- }
- }
-
- return nil
-}
-
-func (ec *elfCode) loadBTFMaps(maps map[string]*MapSpec, mapSections map[elf.SectionIndex]*elf.Section, spec *btf.Spec) error {
- if spec == nil {
- return fmt.Errorf("missing BTF")
- }
-
- for idx, sec := range mapSections {
- syms := ec.symbolsPerSection[idx]
- if len(syms) == 0 {
- return fmt.Errorf("section %v: no symbols", sec.Name)
- }
-
- for _, sym := range syms {
- name := sym.Name
- if maps[name] != nil {
- return fmt.Errorf("section %v: map %v already exists", sec.Name, sym)
- }
-
- mapSpec, err := mapSpecFromBTF(spec, name)
- if err != nil {
- return fmt.Errorf("map %v: %w", name, err)
- }
-
- maps[name] = mapSpec
- }
- }
-
- return nil
-}
-
-func mapSpecFromBTF(spec *btf.Spec, name string) (*MapSpec, error) {
- btfMap, btfMapMembers, err := spec.Map(name)
- if err != nil {
- return nil, fmt.Errorf("can't get BTF: %w", err)
- }
-
- keyType := btf.MapKey(btfMap)
- size, err := btf.Sizeof(keyType)
- if err != nil {
- return nil, fmt.Errorf("can't get size of BTF key: %w", err)
- }
- keySize := uint32(size)
-
- valueType := btf.MapValue(btfMap)
- size, err = btf.Sizeof(valueType)
- if err != nil {
- return nil, fmt.Errorf("can't get size of BTF value: %w", err)
- }
- valueSize := uint32(size)
-
- var (
- mapType, flags, maxEntries uint32
- )
- for _, member := range btfMapMembers {
- switch member.Name {
- case "type":
- mapType, err = uintFromBTF(member.Type)
- if err != nil {
- return nil, fmt.Errorf("can't get type: %w", err)
- }
-
- case "map_flags":
- flags, err = uintFromBTF(member.Type)
- if err != nil {
- return nil, fmt.Errorf("can't get BTF map flags: %w", err)
- }
-
- case "max_entries":
- maxEntries, err = uintFromBTF(member.Type)
- if err != nil {
- return nil, fmt.Errorf("can't get BTF map max entries: %w", err)
- }
-
- case "key_size":
- if _, isVoid := keyType.(*btf.Void); !isVoid {
- return nil, errors.New("both key and key_size given")
- }
-
- keySize, err = uintFromBTF(member.Type)
- if err != nil {
- return nil, fmt.Errorf("can't get BTF key size: %w", err)
- }
-
- case "value_size":
- if _, isVoid := valueType.(*btf.Void); !isVoid {
- return nil, errors.New("both value and value_size given")
- }
-
- valueSize, err = uintFromBTF(member.Type)
- if err != nil {
- return nil, fmt.Errorf("can't get BTF value size: %w", err)
- }
-
- case "pinning":
- pinning, err := uintFromBTF(member.Type)
- if err != nil {
- return nil, fmt.Errorf("can't get pinning: %w", err)
- }
-
- if pinning != 0 {
- return nil, fmt.Errorf("'pinning' attribute not supported: %w", ErrNotSupported)
- }
-
- case "key", "value":
- default:
- return nil, fmt.Errorf("unrecognized field %s in BTF map definition", member.Name)
- }
- }
-
- return &MapSpec{
- Type: MapType(mapType),
- KeySize: keySize,
- ValueSize: valueSize,
- MaxEntries: maxEntries,
- Flags: flags,
- BTF: btfMap,
- }, nil
-}
-
-// uintFromBTF resolves the __uint macro, which is a pointer to a sized
-// array, e.g. for int (*foo)[10], this function will return 10.
-func uintFromBTF(typ btf.Type) (uint32, error) {
- ptr, ok := typ.(*btf.Pointer)
- if !ok {
- return 0, fmt.Errorf("not a pointer: %v", typ)
- }
-
- arr, ok := ptr.Target.(*btf.Array)
- if !ok {
- return 0, fmt.Errorf("not a pointer to array: %v", typ)
- }
-
- return arr.Nelems, nil
-}
-
-func (ec *elfCode) loadDataSections(maps map[string]*MapSpec, dataSections map[elf.SectionIndex]*elf.Section, spec *btf.Spec) error {
- if spec == nil {
- return errors.New("data sections require BTF, make sure all consts are marked as static")
- }
-
- for _, sec := range dataSections {
- btfMap, err := spec.Datasec(sec.Name)
- if err != nil {
- return err
- }
-
- data, err := sec.Data()
- if err != nil {
- return fmt.Errorf("data section %s: can't get contents: %w", sec.Name, err)
- }
-
- if uint64(len(data)) > math.MaxUint32 {
- return fmt.Errorf("data section %s: contents exceed maximum size", sec.Name)
- }
-
- mapSpec := &MapSpec{
- Name: SanitizeName(sec.Name, -1),
- Type: Array,
- KeySize: 4,
- ValueSize: uint32(len(data)),
- MaxEntries: 1,
- Contents: []MapKV{{uint32(0), data}},
- BTF: btfMap,
- }
-
- switch sec.Name {
- case ".rodata":
- mapSpec.Flags = unix.BPF_F_RDONLY_PROG
- mapSpec.Freeze = true
- case ".bss":
- // The kernel already zero-initializes the map
- mapSpec.Contents = nil
- }
-
- maps[sec.Name] = mapSpec
- }
- return nil
-}
-
-func getProgType(sectionName string) (ProgramType, AttachType, string) {
- types := map[string]struct {
- progType ProgramType
- attachType AttachType
- }{
- // From https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/lib/bpf/libbpf.c
- "socket": {SocketFilter, AttachNone},
- "seccomp": {SocketFilter, AttachNone},
- "kprobe/": {Kprobe, AttachNone},
- "uprobe/": {Kprobe, AttachNone},
- "kretprobe/": {Kprobe, AttachNone},
- "uretprobe/": {Kprobe, AttachNone},
- "tracepoint/": {TracePoint, AttachNone},
- "raw_tracepoint/": {RawTracepoint, AttachNone},
- "xdp": {XDP, AttachNone},
- "perf_event": {PerfEvent, AttachNone},
- "lwt_in": {LWTIn, AttachNone},
- "lwt_out": {LWTOut, AttachNone},
- "lwt_xmit": {LWTXmit, AttachNone},
- "lwt_seg6local": {LWTSeg6Local, AttachNone},
- "sockops": {SockOps, AttachCGroupSockOps},
- "sk_skb/stream_parser": {SkSKB, AttachSkSKBStreamParser},
- "sk_skb/stream_verdict": {SkSKB, AttachSkSKBStreamParser},
- "sk_msg": {SkMsg, AttachSkSKBStreamVerdict},
- "lirc_mode2": {LircMode2, AttachLircMode2},
- "flow_dissector": {FlowDissector, AttachFlowDissector},
- "iter/": {Tracing, AttachTraceIter},
-
- "cgroup_skb/ingress": {CGroupSKB, AttachCGroupInetIngress},
- "cgroup_skb/egress": {CGroupSKB, AttachCGroupInetEgress},
- "cgroup/dev": {CGroupDevice, AttachCGroupDevice},
- "cgroup/skb": {CGroupSKB, AttachNone},
- "cgroup/sock": {CGroupSock, AttachCGroupInetSockCreate},
- "cgroup/post_bind4": {CGroupSock, AttachCGroupInet4PostBind},
- "cgroup/post_bind6": {CGroupSock, AttachCGroupInet6PostBind},
- "cgroup/bind4": {CGroupSockAddr, AttachCGroupInet4Bind},
- "cgroup/bind6": {CGroupSockAddr, AttachCGroupInet6Bind},
- "cgroup/connect4": {CGroupSockAddr, AttachCGroupInet4Connect},
- "cgroup/connect6": {CGroupSockAddr, AttachCGroupInet6Connect},
- "cgroup/sendmsg4": {CGroupSockAddr, AttachCGroupUDP4Sendmsg},
- "cgroup/sendmsg6": {CGroupSockAddr, AttachCGroupUDP6Sendmsg},
- "cgroup/recvmsg4": {CGroupSockAddr, AttachCGroupUDP4Recvmsg},
- "cgroup/recvmsg6": {CGroupSockAddr, AttachCGroupUDP6Recvmsg},
- "cgroup/sysctl": {CGroupSysctl, AttachCGroupSysctl},
- "cgroup/getsockopt": {CGroupSockopt, AttachCGroupGetsockopt},
- "cgroup/setsockopt": {CGroupSockopt, AttachCGroupSetsockopt},
- "classifier": {SchedCLS, AttachNone},
- "action": {SchedACT, AttachNone},
- }
-
- for prefix, t := range types {
- if !strings.HasPrefix(sectionName, prefix) {
- continue
- }
-
- if !strings.HasSuffix(prefix, "/") {
- return t.progType, t.attachType, ""
- }
-
- return t.progType, t.attachType, sectionName[len(prefix):]
- }
-
- return UnspecifiedProgram, AttachNone, ""
-}
-
-func (ec *elfCode) loadRelocations(sections map[elf.SectionIndex]*elf.Section) (map[elf.SectionIndex]map[uint64]elf.Symbol, map[elf.SectionIndex]bool, error) {
- result := make(map[elf.SectionIndex]map[uint64]elf.Symbol)
- targets := make(map[elf.SectionIndex]bool)
- for idx, sec := range sections {
- rels := make(map[uint64]elf.Symbol)
-
- if sec.Entsize < 16 {
- return nil, nil, fmt.Errorf("section %s: relocations are less than 16 bytes", sec.Name)
- }
-
- r := sec.Open()
- for off := uint64(0); off < sec.Size; off += sec.Entsize {
- ent := io.LimitReader(r, int64(sec.Entsize))
-
- var rel elf.Rel64
- if binary.Read(ent, ec.ByteOrder, &rel) != nil {
- return nil, nil, fmt.Errorf("can't parse relocation at offset %v", off)
- }
-
- symNo := int(elf.R_SYM64(rel.Info) - 1)
- if symNo >= len(ec.symbols) {
- return nil, nil, fmt.Errorf("relocation at offset %d: symbol %v doesnt exist", off, symNo)
- }
-
- symbol := ec.symbols[symNo]
- targets[symbol.Section] = true
- rels[rel.Off] = ec.symbols[symNo]
- }
-
- result[idx] = rels
- }
- return result, targets, nil
-}
-
-func symbolsPerSection(symbols []elf.Symbol) map[elf.SectionIndex]map[uint64]elf.Symbol {
- result := make(map[elf.SectionIndex]map[uint64]elf.Symbol)
- for _, sym := range symbols {
- switch elf.ST_TYPE(sym.Info) {
- case elf.STT_NOTYPE:
- // Older versions of LLVM doesn't tag
- // symbols correctly.
- break
- case elf.STT_OBJECT:
- break
- case elf.STT_FUNC:
- break
- default:
- continue
- }
-
- if sym.Section == elf.SHN_UNDEF || sym.Section >= elf.SHN_LORESERVE {
- continue
- }
-
- if sym.Name == "" {
- continue
- }
-
- idx := sym.Section
- if _, ok := result[idx]; !ok {
- result[idx] = make(map[uint64]elf.Symbol)
- }
- result[idx][sym.Value] = sym
- }
- return result
-}
diff --git a/vendor/github.com/cilium/ebpf/go.mod b/vendor/github.com/cilium/ebpf/go.mod
deleted file mode 100644
index a05cf85ed..000000000
--- a/vendor/github.com/cilium/ebpf/go.mod
+++ /dev/null
@@ -1,5 +0,0 @@
-module github.com/cilium/ebpf
-
-go 1.13
-
-require golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9
diff --git a/vendor/github.com/cilium/ebpf/internal/btf/btf.go b/vendor/github.com/cilium/ebpf/internal/btf/btf.go
deleted file mode 100644
index 3dd000a28..000000000
--- a/vendor/github.com/cilium/ebpf/internal/btf/btf.go
+++ /dev/null
@@ -1,716 +0,0 @@
-package btf
-
-import (
- "bytes"
- "debug/elf"
- "encoding/binary"
- "errors"
- "fmt"
- "io"
- "io/ioutil"
- "math"
- "os"
- "reflect"
- "sync"
- "unsafe"
-
- "github.com/cilium/ebpf/internal"
- "github.com/cilium/ebpf/internal/unix"
-)
-
-const btfMagic = 0xeB9F
-
-// Errors returned by BTF functions.
-var (
- ErrNotSupported = internal.ErrNotSupported
- ErrNotFound = errors.New("not found")
- ErrNoExtendedInfo = errors.New("no extended info")
-)
-
-// Spec represents decoded BTF.
-type Spec struct {
- rawTypes []rawType
- strings stringTable
- types map[string][]Type
- funcInfos map[string]extInfo
- lineInfos map[string]extInfo
- byteOrder binary.ByteOrder
-}
-
-type btfHeader struct {
- Magic uint16
- Version uint8
- Flags uint8
- HdrLen uint32
-
- TypeOff uint32
- TypeLen uint32
- StringOff uint32
- StringLen uint32
-}
-
-// LoadSpecFromReader reads BTF sections from an ELF.
-//
-// Returns a nil Spec and no error if no BTF was present.
-func LoadSpecFromReader(rd io.ReaderAt) (*Spec, error) {
- file, err := elf.NewFile(rd)
- if err != nil {
- return nil, err
- }
- defer file.Close()
-
- var (
- btfSection *elf.Section
- btfExtSection *elf.Section
- sectionSizes = make(map[string]uint32)
- )
-
- for _, sec := range file.Sections {
- switch sec.Name {
- case ".BTF":
- btfSection = sec
- case ".BTF.ext":
- btfExtSection = sec
- default:
- if sec.Type != elf.SHT_PROGBITS && sec.Type != elf.SHT_NOBITS {
- break
- }
-
- if sec.Size > math.MaxUint32 {
- return nil, fmt.Errorf("section %s exceeds maximum size", sec.Name)
- }
-
- sectionSizes[sec.Name] = uint32(sec.Size)
- }
- }
-
- if btfSection == nil {
- return nil, nil
- }
-
- symbols, err := file.Symbols()
- if err != nil {
- return nil, fmt.Errorf("can't read symbols: %v", err)
- }
-
- variableOffsets := make(map[variable]uint32)
- for _, symbol := range symbols {
- if idx := symbol.Section; idx >= elf.SHN_LORESERVE && idx <= elf.SHN_HIRESERVE {
- // Ignore things like SHN_ABS
- continue
- }
-
- secName := file.Sections[symbol.Section].Name
- if _, ok := sectionSizes[secName]; !ok {
- continue
- }
-
- if symbol.Value > math.MaxUint32 {
- return nil, fmt.Errorf("section %s: symbol %s: size exceeds maximum", secName, symbol.Name)
- }
-
- variableOffsets[variable{secName, symbol.Name}] = uint32(symbol.Value)
- }
-
- spec, err := loadNakedSpec(btfSection.Open(), file.ByteOrder, sectionSizes, variableOffsets)
- if err != nil {
- return nil, err
- }
-
- if btfExtSection == nil {
- return spec, nil
- }
-
- spec.funcInfos, spec.lineInfos, err = parseExtInfos(btfExtSection.Open(), file.ByteOrder, spec.strings)
- if err != nil {
- return nil, fmt.Errorf("can't read ext info: %w", err)
- }
-
- return spec, nil
-}
-
-func loadNakedSpec(btf io.ReadSeeker, bo binary.ByteOrder, sectionSizes map[string]uint32, variableOffsets map[variable]uint32) (*Spec, error) {
- rawTypes, rawStrings, err := parseBTF(btf, bo)
- if err != nil {
- return nil, err
- }
-
- err = fixupDatasec(rawTypes, rawStrings, sectionSizes, variableOffsets)
- if err != nil {
- return nil, err
- }
-
- types, err := inflateRawTypes(rawTypes, rawStrings)
- if err != nil {
- return nil, err
- }
-
- return &Spec{
- rawTypes: rawTypes,
- types: types,
- strings: rawStrings,
- byteOrder: bo,
- }, nil
-}
-
-var kernelBTF struct {
- sync.Mutex
- *Spec
-}
-
-// LoadKernelSpec returns the current kernel's BTF information.
-//
-// Requires a >= 5.5 kernel with CONFIG_DEBUG_INFO_BTF enabled. Returns
-// ErrNotSupported if BTF is not enabled.
-func LoadKernelSpec() (*Spec, error) {
- kernelBTF.Lock()
- defer kernelBTF.Unlock()
-
- if kernelBTF.Spec != nil {
- return kernelBTF.Spec, nil
- }
-
- var err error
- kernelBTF.Spec, err = loadKernelSpec()
- return kernelBTF.Spec, err
-}
-
-func loadKernelSpec() (*Spec, error) {
- fh, err := os.Open("/sys/kernel/btf/vmlinux")
- if os.IsNotExist(err) {
- return nil, fmt.Errorf("can't open kernel BTF at /sys/kernel/btf/vmlinux: %w", ErrNotFound)
- }
- if err != nil {
- return nil, fmt.Errorf("can't read kernel BTF: %s", err)
- }
- defer fh.Close()
-
- return loadNakedSpec(fh, internal.NativeEndian, nil, nil)
-}
-
-func parseBTF(btf io.ReadSeeker, bo binary.ByteOrder) ([]rawType, stringTable, error) {
- rawBTF, err := ioutil.ReadAll(btf)
- if err != nil {
- return nil, nil, fmt.Errorf("can't read BTF: %v", err)
- }
-
- rd := bytes.NewReader(rawBTF)
-
- var header btfHeader
- if err := binary.Read(rd, bo, &header); err != nil {
- return nil, nil, fmt.Errorf("can't read header: %v", err)
- }
-
- if header.Magic != btfMagic {
- return nil, nil, fmt.Errorf("incorrect magic value %v", header.Magic)
- }
-
- if header.Version != 1 {
- return nil, nil, fmt.Errorf("unexpected version %v", header.Version)
- }
-
- if header.Flags != 0 {
- return nil, nil, fmt.Errorf("unsupported flags %v", header.Flags)
- }
-
- remainder := int64(header.HdrLen) - int64(binary.Size(&header))
- if remainder < 0 {
- return nil, nil, errors.New("header is too short")
- }
-
- if _, err := io.CopyN(internal.DiscardZeroes{}, rd, remainder); err != nil {
- return nil, nil, fmt.Errorf("header padding: %v", err)
- }
-
- if _, err := rd.Seek(int64(header.HdrLen+header.StringOff), io.SeekStart); err != nil {
- return nil, nil, fmt.Errorf("can't seek to start of string section: %v", err)
- }
-
- rawStrings, err := readStringTable(io.LimitReader(rd, int64(header.StringLen)))
- if err != nil {
- return nil, nil, fmt.Errorf("can't read type names: %w", err)
- }
-
- if _, err := rd.Seek(int64(header.HdrLen+header.TypeOff), io.SeekStart); err != nil {
- return nil, nil, fmt.Errorf("can't seek to start of type section: %v", err)
- }
-
- rawTypes, err := readTypes(io.LimitReader(rd, int64(header.TypeLen)), bo)
- if err != nil {
- return nil, nil, fmt.Errorf("can't read types: %w", err)
- }
-
- return rawTypes, rawStrings, nil
-}
-
-type variable struct {
- section string
- name string
-}
-
-func fixupDatasec(rawTypes []rawType, rawStrings stringTable, sectionSizes map[string]uint32, variableOffsets map[variable]uint32) error {
- for i, rawType := range rawTypes {
- if rawType.Kind() != kindDatasec {
- continue
- }
-
- name, err := rawStrings.Lookup(rawType.NameOff)
- if err != nil {
- return err
- }
-
- if name == ".kconfig" || name == ".ksym" {
- return fmt.Errorf("reference to %s: %w", name, ErrNotSupported)
- }
-
- size, ok := sectionSizes[name]
- if !ok {
- return fmt.Errorf("data section %s: missing size", name)
- }
-
- rawTypes[i].SizeType = size
-
- secinfos := rawType.data.([]btfVarSecinfo)
- for j, secInfo := range secinfos {
- id := int(secInfo.Type - 1)
- if id >= len(rawTypes) {
- return fmt.Errorf("data section %s: invalid type id %d for variable %d", name, id, j)
- }
-
- varName, err := rawStrings.Lookup(rawTypes[id].NameOff)
- if err != nil {
- return fmt.Errorf("data section %s: can't get name for type %d: %w", name, id, err)
- }
-
- offset, ok := variableOffsets[variable{name, varName}]
- if !ok {
- return fmt.Errorf("data section %s: missing offset for variable %s", name, varName)
- }
-
- secinfos[j].Offset = offset
- }
- }
-
- return nil
-}
-
-type marshalOpts struct {
- ByteOrder binary.ByteOrder
- StripFuncLinkage bool
-}
-
-func (s *Spec) marshal(opts marshalOpts) ([]byte, error) {
- var (
- buf bytes.Buffer
- header = new(btfHeader)
- headerLen = binary.Size(header)
- )
-
- // Reserve space for the header. We have to write it last since
- // we don't know the size of the type section yet.
- _, _ = buf.Write(make([]byte, headerLen))
-
- // Write type section, just after the header.
- for _, raw := range s.rawTypes {
- switch {
- case opts.StripFuncLinkage && raw.Kind() == kindFunc:
- raw.SetLinkage(linkageStatic)
- }
-
- if err := raw.Marshal(&buf, opts.ByteOrder); err != nil {
- return nil, fmt.Errorf("can't marshal BTF: %w", err)
- }
- }
-
- typeLen := uint32(buf.Len() - headerLen)
-
- // Write string section after type section.
- _, _ = buf.Write(s.strings)
-
- // Fill out the header, and write it out.
- header = &btfHeader{
- Magic: btfMagic,
- Version: 1,
- Flags: 0,
- HdrLen: uint32(headerLen),
- TypeOff: 0,
- TypeLen: typeLen,
- StringOff: typeLen,
- StringLen: uint32(len(s.strings)),
- }
-
- raw := buf.Bytes()
- err := binary.Write(sliceWriter(raw[:headerLen]), opts.ByteOrder, header)
- if err != nil {
- return nil, fmt.Errorf("can't write header: %v", err)
- }
-
- return raw, nil
-}
-
-type sliceWriter []byte
-
-func (sw sliceWriter) Write(p []byte) (int, error) {
- if len(p) != len(sw) {
- return 0, errors.New("size doesn't match")
- }
-
- return copy(sw, p), nil
-}
-
-// Program finds the BTF for a specific section.
-//
-// Length is the number of bytes in the raw BPF instruction stream.
-//
-// Returns an error which may wrap ErrNoExtendedInfo if the Spec doesn't
-// contain extended BTF info.
-func (s *Spec) Program(name string, length uint64) (*Program, error) {
- if length == 0 {
- return nil, errors.New("length musn't be zero")
- }
-
- if s.funcInfos == nil && s.lineInfos == nil {
- return nil, fmt.Errorf("BTF for section %s: %w", name, ErrNoExtendedInfo)
- }
-
- funcInfos, funcOK := s.funcInfos[name]
- lineInfos, lineOK := s.lineInfos[name]
-
- if !funcOK && !lineOK {
- return nil, fmt.Errorf("no extended BTF info for section %s", name)
- }
-
- return &Program{s, length, funcInfos, lineInfos}, nil
-}
-
-// Map finds the BTF for a map.
-//
-// Returns an error if there is no BTF for the given name.
-func (s *Spec) Map(name string) (*Map, []Member, error) {
- var mapVar Var
- if err := s.FindType(name, &mapVar); err != nil {
- return nil, nil, err
- }
-
- mapStruct, ok := mapVar.Type.(*Struct)
- if !ok {
- return nil, nil, fmt.Errorf("expected struct, have %s", mapVar.Type)
- }
-
- var key, value Type
- for _, member := range mapStruct.Members {
- switch member.Name {
- case "key":
- key = member.Type
-
- case "value":
- value = member.Type
- }
- }
-
- if key == nil {
- key = (*Void)(nil)
- }
-
- if value == nil {
- value = (*Void)(nil)
- }
-
- return &Map{s, key, value}, mapStruct.Members, nil
-}
-
-// Datasec returns the BTF required to create maps which represent data sections.
-func (s *Spec) Datasec(name string) (*Map, error) {
- var datasec Datasec
- if err := s.FindType(name, &datasec); err != nil {
- return nil, fmt.Errorf("data section %s: can't get BTF: %w", name, err)
- }
-
- return &Map{s, &Void{}, &datasec}, nil
-}
-
-// FindType searches for a type with a specific name.
-//
-// hint determines the type of the returned Type.
-//
-// Returns an error wrapping ErrNotFound if no matching
-// type exists in spec.
-func (s *Spec) FindType(name string, typ Type) error {
- var (
- wanted = reflect.TypeOf(typ)
- candidate Type
- )
-
- for _, typ := range s.types[name] {
- if reflect.TypeOf(typ) != wanted {
- continue
- }
-
- if candidate != nil {
- return fmt.Errorf("type %s: multiple candidates for %T", name, typ)
- }
-
- candidate = typ
- }
-
- if candidate == nil {
- return fmt.Errorf("type %s: %w", name, ErrNotFound)
- }
-
- value := reflect.Indirect(reflect.ValueOf(copyType(candidate)))
- reflect.Indirect(reflect.ValueOf(typ)).Set(value)
- return nil
-}
-
-// Handle is a reference to BTF loaded into the kernel.
-type Handle struct {
- fd *internal.FD
-}
-
-// NewHandle loads BTF into the kernel.
-//
-// Returns ErrNotSupported if BTF is not supported.
-func NewHandle(spec *Spec) (*Handle, error) {
- if err := haveBTF(); err != nil {
- return nil, err
- }
-
- if spec.byteOrder != internal.NativeEndian {
- return nil, fmt.Errorf("can't load %s BTF on %s", spec.byteOrder, internal.NativeEndian)
- }
-
- btf, err := spec.marshal(marshalOpts{
- ByteOrder: internal.NativeEndian,
- StripFuncLinkage: haveFuncLinkage() != nil,
- })
- if err != nil {
- return nil, fmt.Errorf("can't marshal BTF: %w", err)
- }
-
- if uint64(len(btf)) > math.MaxUint32 {
- return nil, errors.New("BTF exceeds the maximum size")
- }
-
- attr := &bpfLoadBTFAttr{
- btf: internal.NewSlicePointer(btf),
- btfSize: uint32(len(btf)),
- }
-
- fd, err := bpfLoadBTF(attr)
- if err != nil {
- logBuf := make([]byte, 64*1024)
- attr.logBuf = internal.NewSlicePointer(logBuf)
- attr.btfLogSize = uint32(len(logBuf))
- attr.btfLogLevel = 1
- _, logErr := bpfLoadBTF(attr)
- return nil, internal.ErrorWithLog(err, logBuf, logErr)
- }
-
- return &Handle{fd}, nil
-}
-
-// Close destroys the handle.
-//
-// Subsequent calls to FD will return an invalid value.
-func (h *Handle) Close() error {
- return h.fd.Close()
-}
-
-// FD returns the file descriptor for the handle.
-func (h *Handle) FD() int {
- value, err := h.fd.Value()
- if err != nil {
- return -1
- }
-
- return int(value)
-}
-
-// Map is the BTF for a map.
-type Map struct {
- spec *Spec
- key, value Type
-}
-
-// MapSpec should be a method on Map, but is a free function
-// to hide it from users of the ebpf package.
-func MapSpec(m *Map) *Spec {
- return m.spec
-}
-
-// MapKey should be a method on Map, but is a free function
-// to hide it from users of the ebpf package.
-func MapKey(m *Map) Type {
- return m.key
-}
-
-// MapValue should be a method on Map, but is a free function
-// to hide it from users of the ebpf package.
-func MapValue(m *Map) Type {
- return m.value
-}
-
-// Program is the BTF information for a stream of instructions.
-type Program struct {
- spec *Spec
- length uint64
- funcInfos, lineInfos extInfo
-}
-
-// ProgramSpec returns the Spec needed for loading function and line infos into the kernel.
-//
-// This is a free function instead of a method to hide it from users
-// of package ebpf.
-func ProgramSpec(s *Program) *Spec {
- return s.spec
-}
-
-// ProgramAppend the information from other to the Program.
-//
-// This is a free function instead of a method to hide it from users
-// of package ebpf.
-func ProgramAppend(s, other *Program) error {
- funcInfos, err := s.funcInfos.append(other.funcInfos, s.length)
- if err != nil {
- return fmt.Errorf("func infos: %w", err)
- }
-
- lineInfos, err := s.lineInfos.append(other.lineInfos, s.length)
- if err != nil {
- return fmt.Errorf("line infos: %w", err)
- }
-
- s.length += other.length
- s.funcInfos = funcInfos
- s.lineInfos = lineInfos
- return nil
-}
-
-// ProgramFuncInfos returns the binary form of BTF function infos.
-//
-// This is a free function instead of a method to hide it from users
-// of package ebpf.
-func ProgramFuncInfos(s *Program) (recordSize uint32, bytes []byte, err error) {
- bytes, err = s.funcInfos.MarshalBinary()
- if err != nil {
- return 0, nil, err
- }
-
- return s.funcInfos.recordSize, bytes, nil
-}
-
-// ProgramLineInfos returns the binary form of BTF line infos.
-//
-// This is a free function instead of a method to hide it from users
-// of package ebpf.
-func ProgramLineInfos(s *Program) (recordSize uint32, bytes []byte, err error) {
- bytes, err = s.lineInfos.MarshalBinary()
- if err != nil {
- return 0, nil, err
- }
-
- return s.lineInfos.recordSize, bytes, nil
-}
-
-type bpfLoadBTFAttr struct {
- btf internal.Pointer
- logBuf internal.Pointer
- btfSize uint32
- btfLogSize uint32
- btfLogLevel uint32
-}
-
-func bpfLoadBTF(attr *bpfLoadBTFAttr) (*internal.FD, error) {
- const _BTFLoad = 18
-
- fd, err := internal.BPF(_BTFLoad, unsafe.Pointer(attr), unsafe.Sizeof(*attr))
- if err != nil {
- return nil, err
- }
-
- return internal.NewFD(uint32(fd)), nil
-}
-
-func marshalBTF(types interface{}, strings []byte, bo binary.ByteOrder) []byte {
- const minHeaderLength = 24
-
- typesLen := uint32(binary.Size(types))
- header := btfHeader{
- Magic: btfMagic,
- Version: 1,
- HdrLen: minHeaderLength,
- TypeOff: 0,
- TypeLen: typesLen,
- StringOff: typesLen,
- StringLen: uint32(len(strings)),
- }
-
- buf := new(bytes.Buffer)
- _ = binary.Write(buf, bo, &header)
- _ = binary.Write(buf, bo, types)
- buf.Write(strings)
-
- return buf.Bytes()
-}
-
-var haveBTF = internal.FeatureTest("BTF", "5.1", func() (bool, error) {
- var (
- types struct {
- Integer btfType
- Var btfType
- btfVar struct{ Linkage uint32 }
- }
- strings = []byte{0, 'a', 0}
- )
-
- // We use a BTF_KIND_VAR here, to make sure that
- // the kernel understands BTF at least as well as we
- // do. BTF_KIND_VAR was introduced ~5.1.
- types.Integer.SetKind(kindPointer)
- types.Var.NameOff = 1
- types.Var.SetKind(kindVar)
- types.Var.SizeType = 1
-
- btf := marshalBTF(&types, strings, internal.NativeEndian)
-
- fd, err := bpfLoadBTF(&bpfLoadBTFAttr{
- btf: internal.NewSlicePointer(btf),
- btfSize: uint32(len(btf)),
- })
- if err == nil {
- fd.Close()
- }
- // Check for EINVAL specifically, rather than err != nil since we
- // otherwise misdetect due to insufficient permissions.
- return !errors.Is(err, unix.EINVAL), nil
-})
-
-var haveFuncLinkage = internal.FeatureTest("BTF func linkage", "5.6", func() (bool, error) {
- var (
- types struct {
- FuncProto btfType
- Func btfType
- }
- strings = []byte{0, 'a', 0}
- )
-
- types.FuncProto.SetKind(kindFuncProto)
- types.Func.SetKind(kindFunc)
- types.Func.SizeType = 1 // aka FuncProto
- types.Func.NameOff = 1
- types.Func.SetLinkage(linkageGlobal)
-
- btf := marshalBTF(&types, strings, internal.NativeEndian)
-
- fd, err := bpfLoadBTF(&bpfLoadBTFAttr{
- btf: internal.NewSlicePointer(btf),
- btfSize: uint32(len(btf)),
- })
- if err == nil {
- fd.Close()
- }
-
- // Check for EINVAL specifically, rather than err != nil since we
- // otherwise misdetect due to insufficient permissions.
- return !errors.Is(err, unix.EINVAL), nil
-})
diff --git a/vendor/github.com/cilium/ebpf/internal/btf/btf_types.go b/vendor/github.com/cilium/ebpf/internal/btf/btf_types.go
deleted file mode 100644
index e34a87ecb..000000000
--- a/vendor/github.com/cilium/ebpf/internal/btf/btf_types.go
+++ /dev/null
@@ -1,259 +0,0 @@
-package btf
-
-import (
- "encoding/binary"
- "fmt"
- "io"
-)
-
-// btfKind describes a Type.
-type btfKind uint8
-
-// Equivalents of the BTF_KIND_* constants.
-const (
- kindUnknown btfKind = iota
- kindInt
- kindPointer
- kindArray
- kindStruct
- kindUnion
- kindEnum
- kindForward
- kindTypedef
- kindVolatile
- kindConst
- kindRestrict
- // Added ~4.20
- kindFunc
- kindFuncProto
- // Added ~5.1
- kindVar
- kindDatasec
-)
-
-type btfFuncLinkage uint8
-
-const (
- linkageStatic btfFuncLinkage = iota
- linkageGlobal
- linkageExtern
-)
-
-const (
- btfTypeKindShift = 24
- btfTypeKindLen = 4
- btfTypeVlenShift = 0
- btfTypeVlenMask = 16
-)
-
-// btfType is equivalent to struct btf_type in Documentation/bpf/btf.rst.
-type btfType struct {
- NameOff uint32
- /* "info" bits arrangement
- * bits 0-15: vlen (e.g. # of struct's members), linkage
- * bits 16-23: unused
- * bits 24-27: kind (e.g. int, ptr, array...etc)
- * bits 28-30: unused
- * bit 31: kind_flag, currently used by
- * struct, union and fwd
- */
- Info uint32
- /* "size" is used by INT, ENUM, STRUCT and UNION.
- * "size" tells the size of the type it is describing.
- *
- * "type" is used by PTR, TYPEDEF, VOLATILE, CONST, RESTRICT,
- * FUNC and FUNC_PROTO.
- * "type" is a type_id referring to another type.
- */
- SizeType uint32
-}
-
-func (k btfKind) String() string {
- switch k {
- case kindUnknown:
- return "Unknown"
- case kindInt:
- return "Integer"
- case kindPointer:
- return "Pointer"
- case kindArray:
- return "Array"
- case kindStruct:
- return "Struct"
- case kindUnion:
- return "Union"
- case kindEnum:
- return "Enumeration"
- case kindForward:
- return "Forward"
- case kindTypedef:
- return "Typedef"
- case kindVolatile:
- return "Volatile"
- case kindConst:
- return "Const"
- case kindRestrict:
- return "Restrict"
- case kindFunc:
- return "Function"
- case kindFuncProto:
- return "Function Proto"
- case kindVar:
- return "Variable"
- case kindDatasec:
- return "Section"
- default:
- return fmt.Sprintf("Unknown (%d)", k)
- }
-}
-
-func mask(len uint32) uint32 {
- return (1 << len) - 1
-}
-
-func (bt *btfType) info(len, shift uint32) uint32 {
- return (bt.Info >> shift) & mask(len)
-}
-
-func (bt *btfType) setInfo(value, len, shift uint32) {
- bt.Info &^= mask(len) << shift
- bt.Info |= (value & mask(len)) << shift
-}
-
-func (bt *btfType) Kind() btfKind {
- return btfKind(bt.info(btfTypeKindLen, btfTypeKindShift))
-}
-
-func (bt *btfType) SetKind(kind btfKind) {
- bt.setInfo(uint32(kind), btfTypeKindLen, btfTypeKindShift)
-}
-
-func (bt *btfType) Vlen() int {
- return int(bt.info(btfTypeVlenMask, btfTypeVlenShift))
-}
-
-func (bt *btfType) SetVlen(vlen int) {
- bt.setInfo(uint32(vlen), btfTypeVlenMask, btfTypeVlenShift)
-}
-
-func (bt *btfType) Linkage() btfFuncLinkage {
- return btfFuncLinkage(bt.info(btfTypeVlenMask, btfTypeVlenShift))
-}
-
-func (bt *btfType) SetLinkage(linkage btfFuncLinkage) {
- bt.setInfo(uint32(linkage), btfTypeVlenMask, btfTypeVlenShift)
-}
-
-func (bt *btfType) Type() TypeID {
- // TODO: Panic here if wrong kind?
- return TypeID(bt.SizeType)
-}
-
-func (bt *btfType) Size() uint32 {
- // TODO: Panic here if wrong kind?
- return bt.SizeType
-}
-
-type rawType struct {
- btfType
- data interface{}
-}
-
-func (rt *rawType) Marshal(w io.Writer, bo binary.ByteOrder) error {
- if err := binary.Write(w, bo, &rt.btfType); err != nil {
- return err
- }
-
- if rt.data == nil {
- return nil
- }
-
- return binary.Write(w, bo, rt.data)
-}
-
-type btfArray struct {
- Type TypeID
- IndexType TypeID
- Nelems uint32
-}
-
-type btfMember struct {
- NameOff uint32
- Type TypeID
- Offset uint32
-}
-
-type btfVarSecinfo struct {
- Type TypeID
- Offset uint32
- Size uint32
-}
-
-type btfVariable struct {
- Linkage uint32
-}
-
-type btfEnum struct {
- NameOff uint32
- Val int32
-}
-
-type btfParam struct {
- NameOff uint32
- Type TypeID
-}
-
-func readTypes(r io.Reader, bo binary.ByteOrder) ([]rawType, error) {
- var (
- header btfType
- types []rawType
- )
-
- for id := TypeID(1); ; id++ {
- if err := binary.Read(r, bo, &header); err == io.EOF {
- return types, nil
- } else if err != nil {
- return nil, fmt.Errorf("can't read type info for id %v: %v", id, err)
- }
-
- var data interface{}
- switch header.Kind() {
- case kindInt:
- data = new(uint32)
- case kindPointer:
- case kindArray:
- data = new(btfArray)
- case kindStruct:
- fallthrough
- case kindUnion:
- data = make([]btfMember, header.Vlen())
- case kindEnum:
- data = make([]btfEnum, header.Vlen())
- case kindForward:
- case kindTypedef:
- case kindVolatile:
- case kindConst:
- case kindRestrict:
- case kindFunc:
- case kindFuncProto:
- data = make([]btfParam, header.Vlen())
- case kindVar:
- data = new(btfVariable)
- case kindDatasec:
- data = make([]btfVarSecinfo, header.Vlen())
- default:
- return nil, fmt.Errorf("type id %v: unknown kind: %v", id, header.Kind())
- }
-
- if data == nil {
- types = append(types, rawType{header, nil})
- continue
- }
-
- if err := binary.Read(r, bo, data); err != nil {
- return nil, fmt.Errorf("type id %d: kind %v: can't read %T: %v", id, header.Kind(), data, err)
- }
-
- types = append(types, rawType{header, data})
- }
-}
diff --git a/vendor/github.com/cilium/ebpf/internal/btf/doc.go b/vendor/github.com/cilium/ebpf/internal/btf/doc.go
deleted file mode 100644
index ad2576cb2..000000000
--- a/vendor/github.com/cilium/ebpf/internal/btf/doc.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// Package btf handles data encoded according to the BPF Type Format.
-//
-// The canonical documentation lives in the Linux kernel repository and is
-// available at https://www.kernel.org/doc/html/latest/bpf/btf.html
-//
-// The API is very much unstable. You should only use this via the main
-// ebpf library.
-package btf
diff --git a/vendor/github.com/cilium/ebpf/internal/btf/ext_info.go b/vendor/github.com/cilium/ebpf/internal/btf/ext_info.go
deleted file mode 100644
index 28918ae9e..000000000
--- a/vendor/github.com/cilium/ebpf/internal/btf/ext_info.go
+++ /dev/null
@@ -1,182 +0,0 @@
-package btf
-
-import (
- "bytes"
- "encoding/binary"
- "errors"
- "fmt"
- "io"
- "io/ioutil"
-
- "github.com/cilium/ebpf/asm"
- "github.com/cilium/ebpf/internal"
-)
-
-type btfExtHeader struct {
- Magic uint16
- Version uint8
- Flags uint8
- HdrLen uint32
-
- FuncInfoOff uint32
- FuncInfoLen uint32
- LineInfoOff uint32
- LineInfoLen uint32
-}
-
-func parseExtInfos(r io.ReadSeeker, bo binary.ByteOrder, strings stringTable) (funcInfo, lineInfo map[string]extInfo, err error) {
- var header btfExtHeader
- if err := binary.Read(r, bo, &header); err != nil {
- return nil, nil, fmt.Errorf("can't read header: %v", err)
- }
-
- if header.Magic != btfMagic {
- return nil, nil, fmt.Errorf("incorrect magic value %v", header.Magic)
- }
-
- if header.Version != 1 {
- return nil, nil, fmt.Errorf("unexpected version %v", header.Version)
- }
-
- if header.Flags != 0 {
- return nil, nil, fmt.Errorf("unsupported flags %v", header.Flags)
- }
-
- remainder := int64(header.HdrLen) - int64(binary.Size(&header))
- if remainder < 0 {
- return nil, nil, errors.New("header is too short")
- }
-
- // Of course, the .BTF.ext header has different semantics than the
- // .BTF ext header. We need to ignore non-null values.
- _, err = io.CopyN(ioutil.Discard, r, remainder)
- if err != nil {
- return nil, nil, fmt.Errorf("header padding: %v", err)
- }
-
- if _, err := r.Seek(int64(header.HdrLen+header.FuncInfoOff), io.SeekStart); err != nil {
- return nil, nil, fmt.Errorf("can't seek to function info section: %v", err)
- }
-
- funcInfo, err = parseExtInfo(io.LimitReader(r, int64(header.FuncInfoLen)), bo, strings)
- if err != nil {
- return nil, nil, fmt.Errorf("function info: %w", err)
- }
-
- if _, err := r.Seek(int64(header.HdrLen+header.LineInfoOff), io.SeekStart); err != nil {
- return nil, nil, fmt.Errorf("can't seek to line info section: %v", err)
- }
-
- lineInfo, err = parseExtInfo(io.LimitReader(r, int64(header.LineInfoLen)), bo, strings)
- if err != nil {
- return nil, nil, fmt.Errorf("line info: %w", err)
- }
-
- return funcInfo, lineInfo, nil
-}
-
-type btfExtInfoSec struct {
- SecNameOff uint32
- NumInfo uint32
-}
-
-type extInfoRecord struct {
- InsnOff uint64
- Opaque []byte
-}
-
-type extInfo struct {
- recordSize uint32
- records []extInfoRecord
-}
-
-func (ei extInfo) append(other extInfo, offset uint64) (extInfo, error) {
- if other.recordSize != ei.recordSize {
- return extInfo{}, fmt.Errorf("ext_info record size mismatch, want %d (got %d)", ei.recordSize, other.recordSize)
- }
-
- records := make([]extInfoRecord, 0, len(ei.records)+len(other.records))
- records = append(records, ei.records...)
- for _, info := range other.records {
- records = append(records, extInfoRecord{
- InsnOff: info.InsnOff + offset,
- Opaque: info.Opaque,
- })
- }
- return extInfo{ei.recordSize, records}, nil
-}
-
-func (ei extInfo) MarshalBinary() ([]byte, error) {
- if len(ei.records) == 0 {
- return nil, nil
- }
-
- buf := bytes.NewBuffer(make([]byte, 0, int(ei.recordSize)*len(ei.records)))
- for _, info := range ei.records {
- // The kernel expects offsets in number of raw bpf instructions,
- // while the ELF tracks it in bytes.
- insnOff := uint32(info.InsnOff / asm.InstructionSize)
- if err := binary.Write(buf, internal.NativeEndian, insnOff); err != nil {
- return nil, fmt.Errorf("can't write instruction offset: %v", err)
- }
-
- buf.Write(info.Opaque)
- }
-
- return buf.Bytes(), nil
-}
-
-func parseExtInfo(r io.Reader, bo binary.ByteOrder, strings stringTable) (map[string]extInfo, error) {
- var recordSize uint32
- if err := binary.Read(r, bo, &recordSize); err != nil {
- return nil, fmt.Errorf("can't read record size: %v", err)
- }
-
- if recordSize < 4 {
- // Need at least insnOff
- return nil, errors.New("record size too short")
- }
-
- result := make(map[string]extInfo)
- for {
- var infoHeader btfExtInfoSec
- if err := binary.Read(r, bo, &infoHeader); err == io.EOF {
- return result, nil
- } else if err != nil {
- return nil, fmt.Errorf("can't read ext info header: %v", err)
- }
-
- secName, err := strings.Lookup(infoHeader.SecNameOff)
- if err != nil {
- return nil, fmt.Errorf("can't get section name: %w", err)
- }
-
- if infoHeader.NumInfo == 0 {
- return nil, fmt.Errorf("section %s has invalid number of records", secName)
- }
-
- var records []extInfoRecord
- for i := uint32(0); i < infoHeader.NumInfo; i++ {
- var byteOff uint32
- if err := binary.Read(r, bo, &byteOff); err != nil {
- return nil, fmt.Errorf("section %v: can't read extended info offset: %v", secName, err)
- }
-
- buf := make([]byte, int(recordSize-4))
- if _, err := io.ReadFull(r, buf); err != nil {
- return nil, fmt.Errorf("section %v: can't read record: %v", secName, err)
- }
-
- if byteOff%asm.InstructionSize != 0 {
- return nil, fmt.Errorf("section %v: offset %v is not aligned with instruction size", secName, byteOff)
- }
-
- records = append(records, extInfoRecord{uint64(byteOff), buf})
- }
-
- result[secName] = extInfo{
- recordSize,
- records,
- }
- }
-}
diff --git a/vendor/github.com/cilium/ebpf/internal/btf/strings.go b/vendor/github.com/cilium/ebpf/internal/btf/strings.go
deleted file mode 100644
index 8782643a0..000000000
--- a/vendor/github.com/cilium/ebpf/internal/btf/strings.go
+++ /dev/null
@@ -1,60 +0,0 @@
-package btf
-
-import (
- "bytes"
- "errors"
- "fmt"
- "io"
- "io/ioutil"
-)
-
-type stringTable []byte
-
-func readStringTable(r io.Reader) (stringTable, error) {
- contents, err := ioutil.ReadAll(r)
- if err != nil {
- return nil, fmt.Errorf("can't read string table: %v", err)
- }
-
- if len(contents) < 1 {
- return nil, errors.New("string table is empty")
- }
-
- if contents[0] != '\x00' {
- return nil, errors.New("first item in string table is non-empty")
- }
-
- if contents[len(contents)-1] != '\x00' {
- return nil, errors.New("string table isn't null terminated")
- }
-
- return stringTable(contents), nil
-}
-
-func (st stringTable) Lookup(offset uint32) (string, error) {
- if int64(offset) > int64(^uint(0)>>1) {
- return "", fmt.Errorf("offset %d overflows int", offset)
- }
-
- pos := int(offset)
- if pos >= len(st) {
- return "", fmt.Errorf("offset %d is out of bounds", offset)
- }
-
- if pos > 0 && st[pos-1] != '\x00' {
- return "", fmt.Errorf("offset %d isn't start of a string", offset)
- }
-
- str := st[pos:]
- end := bytes.IndexByte(str, '\x00')
- if end == -1 {
- return "", fmt.Errorf("offset %d isn't null terminated", offset)
- }
-
- return string(str[:end]), nil
-}
-
-func (st stringTable) LookupName(offset uint32) (Name, error) {
- str, err := st.Lookup(offset)
- return Name(str), err
-}
diff --git a/vendor/github.com/cilium/ebpf/internal/btf/types.go b/vendor/github.com/cilium/ebpf/internal/btf/types.go
deleted file mode 100644
index 264142abc..000000000
--- a/vendor/github.com/cilium/ebpf/internal/btf/types.go
+++ /dev/null
@@ -1,587 +0,0 @@
-package btf
-
-import (
- "errors"
- "fmt"
- "math"
-)
-
-const maxTypeDepth = 32
-
-// TypeID identifies a type in a BTF section.
-type TypeID uint32
-
-// ID implements part of the Type interface.
-func (tid TypeID) ID() TypeID {
- return tid
-}
-
-// Type represents a type described by BTF.
-type Type interface {
- ID() TypeID
-
- // Make a copy of the type, without copying Type members.
- copy() Type
-
- walk(*copyStack)
-}
-
-// Name identifies a type.
-//
-// Anonymous types have an empty name.
-type Name string
-
-func (n Name) name() string {
- return string(n)
-}
-
-// Void is the unit type of BTF.
-type Void struct{}
-
-func (v *Void) ID() TypeID { return 0 }
-func (v *Void) size() uint32 { return 0 }
-func (v *Void) copy() Type { return (*Void)(nil) }
-func (v *Void) walk(*copyStack) {}
-
-// Int is an integer of a given length.
-type Int struct {
- TypeID
- Name
-
- // The size of the integer in bytes.
- Size uint32
-}
-
-func (i *Int) size() uint32 { return i.Size }
-func (i *Int) walk(*copyStack) {}
-func (i *Int) copy() Type {
- cpy := *i
- return &cpy
-}
-
-// Pointer is a pointer to another type.
-type Pointer struct {
- TypeID
- Target Type
-}
-
-func (p *Pointer) size() uint32 { return 8 }
-func (p *Pointer) walk(cs *copyStack) { cs.push(&p.Target) }
-func (p *Pointer) copy() Type {
- cpy := *p
- return &cpy
-}
-
-// Array is an array with a fixed number of elements.
-type Array struct {
- TypeID
- Type Type
- Nelems uint32
-}
-
-func (arr *Array) walk(cs *copyStack) { cs.push(&arr.Type) }
-func (arr *Array) copy() Type {
- cpy := *arr
- return &cpy
-}
-
-// Struct is a compound type of consecutive members.
-type Struct struct {
- TypeID
- Name
- // The size of the struct including padding, in bytes
- Size uint32
- Members []Member
-}
-
-func (s *Struct) size() uint32 { return s.Size }
-
-func (s *Struct) walk(cs *copyStack) {
- for i := range s.Members {
- cs.push(&s.Members[i].Type)
- }
-}
-
-func (s *Struct) copy() Type {
- cpy := *s
- cpy.Members = make([]Member, len(s.Members))
- copy(cpy.Members, s.Members)
- return &cpy
-}
-
-// Union is a compound type where members occupy the same memory.
-type Union struct {
- TypeID
- Name
- // The size of the union including padding, in bytes.
- Size uint32
- Members []Member
-}
-
-func (u *Union) size() uint32 { return u.Size }
-
-func (u *Union) walk(cs *copyStack) {
- for i := range u.Members {
- cs.push(&u.Members[i].Type)
- }
-}
-
-func (u *Union) copy() Type {
- cpy := *u
- cpy.Members = make([]Member, len(u.Members))
- copy(cpy.Members, u.Members)
- return &cpy
-}
-
-// Member is part of a Struct or Union.
-//
-// It is not a valid Type.
-type Member struct {
- Name
- Type Type
- Offset uint32
-}
-
-// Enum lists possible values.
-type Enum struct {
- TypeID
- Name
-}
-
-func (e *Enum) size() uint32 { return 4 }
-func (e *Enum) walk(*copyStack) {}
-func (e *Enum) copy() Type {
- cpy := *e
- return &cpy
-}
-
-// Fwd is a forward declaration of a Type.
-type Fwd struct {
- TypeID
- Name
-}
-
-func (f *Fwd) walk(*copyStack) {}
-func (f *Fwd) copy() Type {
- cpy := *f
- return &cpy
-}
-
-// Typedef is an alias of a Type.
-type Typedef struct {
- TypeID
- Name
- Type Type
-}
-
-func (td *Typedef) walk(cs *copyStack) { cs.push(&td.Type) }
-func (td *Typedef) copy() Type {
- cpy := *td
- return &cpy
-}
-
-// Volatile is a modifier.
-type Volatile struct {
- TypeID
- Type Type
-}
-
-func (v *Volatile) walk(cs *copyStack) { cs.push(&v.Type) }
-func (v *Volatile) copy() Type {
- cpy := *v
- return &cpy
-}
-
-// Const is a modifier.
-type Const struct {
- TypeID
- Type Type
-}
-
-func (c *Const) walk(cs *copyStack) { cs.push(&c.Type) }
-func (c *Const) copy() Type {
- cpy := *c
- return &cpy
-}
-
-// Restrict is a modifier.
-type Restrict struct {
- TypeID
- Type Type
-}
-
-func (r *Restrict) walk(cs *copyStack) { cs.push(&r.Type) }
-func (r *Restrict) copy() Type {
- cpy := *r
- return &cpy
-}
-
-// Func is a function definition.
-type Func struct {
- TypeID
- Name
- Type Type
-}
-
-func (f *Func) walk(cs *copyStack) { cs.push(&f.Type) }
-func (f *Func) copy() Type {
- cpy := *f
- return &cpy
-}
-
-// FuncProto is a function declaration.
-type FuncProto struct {
- TypeID
- Return Type
- // Parameters not supported yet
-}
-
-func (fp *FuncProto) walk(cs *copyStack) { cs.push(&fp.Return) }
-func (fp *FuncProto) copy() Type {
- cpy := *fp
- return &cpy
-}
-
-// Var is a global variable.
-type Var struct {
- TypeID
- Name
- Type Type
-}
-
-func (v *Var) walk(cs *copyStack) { cs.push(&v.Type) }
-func (v *Var) copy() Type {
- cpy := *v
- return &cpy
-}
-
-// Datasec is a global program section containing data.
-type Datasec struct {
- TypeID
- Name
- Size uint32
- Vars []VarSecinfo
-}
-
-func (ds *Datasec) size() uint32 { return ds.Size }
-
-func (ds *Datasec) walk(cs *copyStack) {
- for i := range ds.Vars {
- cs.push(&ds.Vars[i].Type)
- }
-}
-
-func (ds *Datasec) copy() Type {
- cpy := *ds
- cpy.Vars = make([]VarSecinfo, len(ds.Vars))
- copy(cpy.Vars, ds.Vars)
- return &cpy
-}
-
-// VarSecinfo describes variable in a Datasec
-type VarSecinfo struct {
- Type Type
- Offset uint32
- Size uint32
-}
-
-type sizer interface {
- size() uint32
-}
-
-var (
- _ sizer = (*Int)(nil)
- _ sizer = (*Pointer)(nil)
- _ sizer = (*Struct)(nil)
- _ sizer = (*Union)(nil)
- _ sizer = (*Enum)(nil)
- _ sizer = (*Datasec)(nil)
-)
-
-// Sizeof returns the size of a type in bytes.
-//
-// Returns an error if the size can't be computed.
-func Sizeof(typ Type) (int, error) {
- var (
- n = int64(1)
- elem int64
- )
-
- for i := 0; i < maxTypeDepth; i++ {
- switch v := typ.(type) {
- case *Array:
- if n > 0 && int64(v.Nelems) > math.MaxInt64/n {
- return 0, errors.New("overflow")
- }
-
- // Arrays may be of zero length, which allows
- // n to be zero as well.
- n *= int64(v.Nelems)
- typ = v.Type
- continue
-
- case sizer:
- elem = int64(v.size())
-
- case *Typedef:
- typ = v.Type
- continue
- case *Volatile:
- typ = v.Type
- continue
- case *Const:
- typ = v.Type
- continue
- case *Restrict:
- typ = v.Type
- continue
-
- default:
- return 0, fmt.Errorf("unrecognized type %T", typ)
- }
-
- if n > 0 && elem > math.MaxInt64/n {
- return 0, errors.New("overflow")
- }
-
- size := n * elem
- if int64(int(size)) != size {
- return 0, errors.New("overflow")
- }
-
- return int(size), nil
- }
-
- return 0, errors.New("exceeded type depth")
-}
-
-// copy a Type recursively.
-//
-// typ may form a cycle.
-func copyType(typ Type) Type {
- var (
- copies = make(map[Type]Type)
- work copyStack
- )
-
- for t := &typ; t != nil; t = work.pop() {
- // *t is the identity of the type.
- if cpy := copies[*t]; cpy != nil {
- *t = cpy
- continue
- }
-
- cpy := (*t).copy()
- copies[*t] = cpy
- *t = cpy
-
- // Mark any nested types for copying.
- cpy.walk(&work)
- }
-
- return typ
-}
-
-// copyStack keeps track of pointers to types which still
-// need to be copied.
-type copyStack []*Type
-
-// push adds a type to the stack.
-func (cs *copyStack) push(t *Type) {
- *cs = append(*cs, t)
-}
-
-// pop returns the topmost Type, or nil.
-func (cs *copyStack) pop() *Type {
- n := len(*cs)
- if n == 0 {
- return nil
- }
-
- t := (*cs)[n-1]
- *cs = (*cs)[:n-1]
- return t
-}
-
-type namer interface {
- name() string
-}
-
-var _ namer = Name("")
-
-// inflateRawTypes takes a list of raw btf types linked via type IDs, and turns
-// it into a graph of Types connected via pointers.
-//
-// Returns a map of named types (so, where NameOff is non-zero). Since BTF ignores
-// compilation units, multiple types may share the same name. A Type may form a
-// cyclic graph by pointing at itself.
-func inflateRawTypes(rawTypes []rawType, rawStrings stringTable) (namedTypes map[string][]Type, err error) {
- type fixupDef struct {
- id TypeID
- expectedKind btfKind
- typ *Type
- }
-
- var fixups []fixupDef
- fixup := func(id TypeID, expectedKind btfKind, typ *Type) {
- fixups = append(fixups, fixupDef{id, expectedKind, typ})
- }
-
- convertMembers := func(raw []btfMember) ([]Member, error) {
- // NB: The fixup below relies on pre-allocating this array to
- // work, since otherwise append might re-allocate members.
- members := make([]Member, 0, len(raw))
- for i, btfMember := range raw {
- name, err := rawStrings.LookupName(btfMember.NameOff)
- if err != nil {
- return nil, fmt.Errorf("can't get name for member %d: %w", i, err)
- }
- members = append(members, Member{
- Name: name,
- Offset: btfMember.Offset,
- })
- }
- for i := range members {
- fixup(raw[i].Type, kindUnknown, &members[i].Type)
- }
- return members, nil
- }
-
- types := make([]Type, 0, len(rawTypes))
- types = append(types, (*Void)(nil))
- namedTypes = make(map[string][]Type)
-
- for i, raw := range rawTypes {
- var (
- // Void is defined to always be type ID 0, and is thus
- // omitted from BTF.
- id = TypeID(i + 1)
- typ Type
- )
-
- name, err := rawStrings.LookupName(raw.NameOff)
- if err != nil {
- return nil, fmt.Errorf("can't get name for type id %d: %w", id, err)
- }
-
- switch raw.Kind() {
- case kindInt:
- typ = &Int{id, name, raw.Size()}
-
- case kindPointer:
- ptr := &Pointer{id, nil}
- fixup(raw.Type(), kindUnknown, &ptr.Target)
- typ = ptr
-
- case kindArray:
- btfArr := raw.data.(*btfArray)
-
- // IndexType is unused according to btf.rst.
- // Don't make it available right now.
- arr := &Array{id, nil, btfArr.Nelems}
- fixup(btfArr.Type, kindUnknown, &arr.Type)
- typ = arr
-
- case kindStruct:
- members, err := convertMembers(raw.data.([]btfMember))
- if err != nil {
- return nil, fmt.Errorf("struct %s (id %d): %w", name, id, err)
- }
- typ = &Struct{id, name, raw.Size(), members}
-
- case kindUnion:
- members, err := convertMembers(raw.data.([]btfMember))
- if err != nil {
- return nil, fmt.Errorf("union %s (id %d): %w", name, id, err)
- }
- typ = &Union{id, name, raw.Size(), members}
-
- case kindEnum:
- typ = &Enum{id, name}
-
- case kindForward:
- typ = &Fwd{id, name}
-
- case kindTypedef:
- typedef := &Typedef{id, name, nil}
- fixup(raw.Type(), kindUnknown, &typedef.Type)
- typ = typedef
-
- case kindVolatile:
- volatile := &Volatile{id, nil}
- fixup(raw.Type(), kindUnknown, &volatile.Type)
- typ = volatile
-
- case kindConst:
- cnst := &Const{id, nil}
- fixup(raw.Type(), kindUnknown, &cnst.Type)
- typ = cnst
-
- case kindRestrict:
- restrict := &Restrict{id, nil}
- fixup(raw.Type(), kindUnknown, &restrict.Type)
- typ = restrict
-
- case kindFunc:
- fn := &Func{id, name, nil}
- fixup(raw.Type(), kindFuncProto, &fn.Type)
- typ = fn
-
- case kindFuncProto:
- fp := &FuncProto{id, nil}
- fixup(raw.Type(), kindUnknown, &fp.Return)
- typ = fp
-
- case kindVar:
- v := &Var{id, name, nil}
- fixup(raw.Type(), kindUnknown, &v.Type)
- typ = v
-
- case kindDatasec:
- btfVars := raw.data.([]btfVarSecinfo)
- vars := make([]VarSecinfo, 0, len(btfVars))
- for _, btfVar := range btfVars {
- vars = append(vars, VarSecinfo{
- Offset: btfVar.Offset,
- Size: btfVar.Size,
- })
- }
- for i := range vars {
- fixup(btfVars[i].Type, kindVar, &vars[i].Type)
- }
- typ = &Datasec{id, name, raw.SizeType, vars}
-
- default:
- return nil, fmt.Errorf("type id %d: unknown kind: %v", id, raw.Kind())
- }
-
- types = append(types, typ)
-
- if namer, ok := typ.(namer); ok {
- if name := namer.name(); name != "" {
- namedTypes[name] = append(namedTypes[name], typ)
- }
- }
- }
-
- for _, fixup := range fixups {
- i := int(fixup.id)
- if i >= len(types) {
- return nil, fmt.Errorf("reference to invalid type id: %d", fixup.id)
- }
-
- // Default void (id 0) to unknown
- rawKind := kindUnknown
- if i > 0 {
- rawKind = rawTypes[i-1].Kind()
- }
-
- if expected := fixup.expectedKind; expected != kindUnknown && rawKind != expected {
- return nil, fmt.Errorf("expected type id %d to have kind %s, found %s", fixup.id, expected, rawKind)
- }
-
- *fixup.typ = types[i]
- }
-
- return namedTypes, nil
-}
diff --git a/vendor/github.com/cilium/ebpf/internal/cpu.go b/vendor/github.com/cilium/ebpf/internal/cpu.go
deleted file mode 100644
index d3424ba43..000000000
--- a/vendor/github.com/cilium/ebpf/internal/cpu.go
+++ /dev/null
@@ -1,62 +0,0 @@
-package internal
-
-import (
- "fmt"
- "io/ioutil"
- "strings"
- "sync"
-)
-
-var sysCPU struct {
- once sync.Once
- err error
- num int
-}
-
-// PossibleCPUs returns the max number of CPUs a system may possibly have
-// Logical CPU numbers must be of the form 0-n
-func PossibleCPUs() (int, error) {
- sysCPU.once.Do(func() {
- sysCPU.num, sysCPU.err = parseCPUsFromFile("/sys/devices/system/cpu/possible")
- })
-
- return sysCPU.num, sysCPU.err
-}
-
-func parseCPUsFromFile(path string) (int, error) {
- spec, err := ioutil.ReadFile(path)
- if err != nil {
- return 0, err
- }
-
- n, err := parseCPUs(string(spec))
- if err != nil {
- return 0, fmt.Errorf("can't parse %s: %v", path, err)
- }
-
- return n, nil
-}
-
-// parseCPUs parses the number of cpus from a string produced
-// by bitmap_list_string() in the Linux kernel.
-// Multiple ranges are rejected, since they can't be unified
-// into a single number.
-// This is the format of /sys/devices/system/cpu/possible, it
-// is not suitable for /sys/devices/system/cpu/online, etc.
-func parseCPUs(spec string) (int, error) {
- if strings.Trim(spec, "\n") == "0" {
- return 1, nil
- }
-
- var low, high int
- n, err := fmt.Sscanf(spec, "%d-%d\n", &low, &high)
- if n != 2 || err != nil {
- return 0, fmt.Errorf("invalid format: %s", spec)
- }
- if low != 0 {
- return 0, fmt.Errorf("CPU spec doesn't start at zero: %s", spec)
- }
-
- // cpus is 0 indexed
- return high + 1, nil
-}
diff --git a/vendor/github.com/cilium/ebpf/internal/endian.go b/vendor/github.com/cilium/ebpf/internal/endian.go
deleted file mode 100644
index ac8a94e51..000000000
--- a/vendor/github.com/cilium/ebpf/internal/endian.go
+++ /dev/null
@@ -1,24 +0,0 @@
-package internal
-
-import (
- "encoding/binary"
- "unsafe"
-)
-
-// NativeEndian is set to either binary.BigEndian or binary.LittleEndian,
-// depending on the host's endianness.
-var NativeEndian binary.ByteOrder
-
-func init() {
- if isBigEndian() {
- NativeEndian = binary.BigEndian
- } else {
- NativeEndian = binary.LittleEndian
- }
-}
-
-func isBigEndian() (ret bool) {
- i := int(0x1)
- bs := (*[int(unsafe.Sizeof(i))]byte)(unsafe.Pointer(&i))
- return bs[0] == 0
-}
diff --git a/vendor/github.com/cilium/ebpf/internal/errors.go b/vendor/github.com/cilium/ebpf/internal/errors.go
deleted file mode 100644
index b6aee81f7..000000000
--- a/vendor/github.com/cilium/ebpf/internal/errors.go
+++ /dev/null
@@ -1,47 +0,0 @@
-package internal
-
-import (
- "bytes"
- "errors"
- "fmt"
- "strings"
-
- "github.com/cilium/ebpf/internal/unix"
-)
-
-// ErrorWithLog returns an error that includes logs from the
-// kernel verifier.
-//
-// logErr should be the error returned by the syscall that generated
-// the log. It is used to check for truncation of the output.
-func ErrorWithLog(err error, log []byte, logErr error) error {
- logStr := strings.Trim(CString(log), "\t\r\n ")
- if errors.Is(logErr, unix.ENOSPC) {
- logStr += " (truncated...)"
- }
-
- return &VerifierError{err, logStr}
-}
-
-// VerifierError includes information from the eBPF verifier.
-type VerifierError struct {
- cause error
- log string
-}
-
-func (le *VerifierError) Error() string {
- if le.log == "" {
- return le.cause.Error()
- }
-
- return fmt.Sprintf("%s: %s", le.cause, le.log)
-}
-
-// CString turns a NUL / zero terminated byte buffer into a string.
-func CString(in []byte) string {
- inLen := bytes.IndexByte(in, 0)
- if inLen == -1 {
- return ""
- }
- return string(in[:inLen])
-}
diff --git a/vendor/github.com/cilium/ebpf/internal/fd.go b/vendor/github.com/cilium/ebpf/internal/fd.go
deleted file mode 100644
index af04955bd..000000000
--- a/vendor/github.com/cilium/ebpf/internal/fd.go
+++ /dev/null
@@ -1,69 +0,0 @@
-package internal
-
-import (
- "errors"
- "fmt"
- "os"
- "runtime"
- "strconv"
-
- "github.com/cilium/ebpf/internal/unix"
-)
-
-var ErrClosedFd = errors.New("use of closed file descriptor")
-
-type FD struct {
- raw int64
-}
-
-func NewFD(value uint32) *FD {
- fd := &FD{int64(value)}
- runtime.SetFinalizer(fd, (*FD).Close)
- return fd
-}
-
-func (fd *FD) String() string {
- return strconv.FormatInt(fd.raw, 10)
-}
-
-func (fd *FD) Value() (uint32, error) {
- if fd.raw < 0 {
- return 0, ErrClosedFd
- }
-
- return uint32(fd.raw), nil
-}
-
-func (fd *FD) Close() error {
- if fd.raw < 0 {
- return nil
- }
-
- value := int(fd.raw)
- fd.raw = -1
-
- fd.Forget()
- return unix.Close(value)
-}
-
-func (fd *FD) Forget() {
- runtime.SetFinalizer(fd, nil)
-}
-
-func (fd *FD) Dup() (*FD, error) {
- if fd.raw < 0 {
- return nil, ErrClosedFd
- }
-
- dup, err := unix.FcntlInt(uintptr(fd.raw), unix.F_DUPFD_CLOEXEC, 0)
- if err != nil {
- return nil, fmt.Errorf("can't dup fd: %v", err)
- }
-
- return NewFD(uint32(dup)), nil
-}
-
-func (fd *FD) File(name string) *os.File {
- fd.Forget()
- return os.NewFile(uintptr(fd.raw), name)
-}
diff --git a/vendor/github.com/cilium/ebpf/internal/feature.go b/vendor/github.com/cilium/ebpf/internal/feature.go
deleted file mode 100644
index 7375b21ef..000000000
--- a/vendor/github.com/cilium/ebpf/internal/feature.go
+++ /dev/null
@@ -1,122 +0,0 @@
-package internal
-
-import (
- "errors"
- "fmt"
- "sync"
-)
-
-// ErrNotSupported indicates that a feature is not supported by the current kernel.
-var ErrNotSupported = errors.New("not supported")
-
-// UnsupportedFeatureError is returned by FeatureTest() functions.
-type UnsupportedFeatureError struct {
- // The minimum Linux mainline version required for this feature.
- // Used for the error string, and for sanity checking during testing.
- MinimumVersion Version
-
- // The name of the feature that isn't supported.
- Name string
-}
-
-func (ufe *UnsupportedFeatureError) Error() string {
- return fmt.Sprintf("%s not supported (requires >= %s)", ufe.Name, ufe.MinimumVersion)
-}
-
-// Is indicates that UnsupportedFeatureError is ErrNotSupported.
-func (ufe *UnsupportedFeatureError) Is(target error) bool {
- return target == ErrNotSupported
-}
-
-type featureTest struct {
- sync.Mutex
- successful bool
- result error
-}
-
-// FeatureTestFn is used to determine whether the kernel supports
-// a certain feature.
-//
-// The return values have the following semantics:
-//
-// err != nil: the test couldn't be executed
-// err == nil && available: the feature is available
-// err == nil && !available: the feature isn't available
-type FeatureTestFn func() (available bool, err error)
-
-// FeatureTest wraps a function so that it is run at most once.
-//
-// name should identify the tested feature, while version must be in the
-// form Major.Minor[.Patch].
-//
-// Returns an error wrapping ErrNotSupported if the feature is not supported.
-func FeatureTest(name, version string, fn FeatureTestFn) func() error {
- v, err := NewVersion(version)
- if err != nil {
- return func() error { return err }
- }
-
- ft := new(featureTest)
- return func() error {
- ft.Lock()
- defer ft.Unlock()
-
- if ft.successful {
- return ft.result
- }
-
- available, err := fn()
- if errors.Is(err, ErrNotSupported) {
- // The feature test aborted because a dependent feature
- // is missing, which we should cache.
- available = false
- } else if err != nil {
- // We couldn't execute the feature test to a point
- // where it could make a determination.
- // Don't cache the result, just return it.
- return fmt.Errorf("can't detect support for %s: %w", name, err)
- }
-
- ft.successful = true
- if !available {
- ft.result = &UnsupportedFeatureError{
- MinimumVersion: v,
- Name: name,
- }
- }
- return ft.result
- }
-}
-
-// A Version in the form Major.Minor.Patch.
-type Version [3]uint16
-
-// NewVersion creates a version from a string like "Major.Minor.Patch".
-//
-// Patch is optional.
-func NewVersion(ver string) (Version, error) {
- var major, minor, patch uint16
- n, _ := fmt.Sscanf(ver, "%d.%d.%d", &major, &minor, &patch)
- if n < 2 {
- return Version{}, fmt.Errorf("invalid version: %s", ver)
- }
- return Version{major, minor, patch}, nil
-}
-
-func (v Version) String() string {
- if v[2] == 0 {
- return fmt.Sprintf("v%d.%d", v[0], v[1])
- }
- return fmt.Sprintf("v%d.%d.%d", v[0], v[1], v[2])
-}
-
-// Less returns true if the version is less than another version.
-func (v Version) Less(other Version) bool {
- for i, a := range v {
- if a == other[i] {
- continue
- }
- return a < other[i]
- }
- return false
-}
diff --git a/vendor/github.com/cilium/ebpf/internal/io.go b/vendor/github.com/cilium/ebpf/internal/io.go
deleted file mode 100644
index fa7402782..000000000
--- a/vendor/github.com/cilium/ebpf/internal/io.go
+++ /dev/null
@@ -1,16 +0,0 @@
-package internal
-
-import "errors"
-
-// DiscardZeroes makes sure that all written bytes are zero
-// before discarding them.
-type DiscardZeroes struct{}
-
-func (DiscardZeroes) Write(p []byte) (int, error) {
- for _, b := range p {
- if b != 0 {
- return 0, errors.New("encountered non-zero byte")
- }
- }
- return len(p), nil
-}
diff --git a/vendor/github.com/cilium/ebpf/internal/ptr.go b/vendor/github.com/cilium/ebpf/internal/ptr.go
deleted file mode 100644
index a7f12b2db..000000000
--- a/vendor/github.com/cilium/ebpf/internal/ptr.go
+++ /dev/null
@@ -1,30 +0,0 @@
-package internal
-
-import "unsafe"
-
-// NewPointer creates a 64-bit pointer from an unsafe Pointer.
-func NewPointer(ptr unsafe.Pointer) Pointer {
- return Pointer{ptr: ptr}
-}
-
-// NewSlicePointer creates a 64-bit pointer from a byte slice.
-func NewSlicePointer(buf []byte) Pointer {
- if len(buf) == 0 {
- return Pointer{}
- }
-
- return Pointer{ptr: unsafe.Pointer(&buf[0])}
-}
-
-// NewStringPointer creates a 64-bit pointer from a string.
-func NewStringPointer(str string) Pointer {
- if str == "" {
- return Pointer{}
- }
-
- // The kernel expects strings to be zero terminated
- buf := make([]byte, len(str)+1)
- copy(buf, str)
-
- return Pointer{ptr: unsafe.Pointer(&buf[0])}
-}
diff --git a/vendor/github.com/cilium/ebpf/internal/ptr_32_be.go b/vendor/github.com/cilium/ebpf/internal/ptr_32_be.go
deleted file mode 100644
index a56fbcc8e..000000000
--- a/vendor/github.com/cilium/ebpf/internal/ptr_32_be.go
+++ /dev/null
@@ -1,14 +0,0 @@
-// +build armbe mips mips64p32
-
-package internal
-
-import (
- "unsafe"
-)
-
-// Pointer wraps an unsafe.Pointer to be 64bit to
-// conform to the syscall specification.
-type Pointer struct {
- pad uint32
- ptr unsafe.Pointer
-}
diff --git a/vendor/github.com/cilium/ebpf/internal/ptr_32_le.go b/vendor/github.com/cilium/ebpf/internal/ptr_32_le.go
deleted file mode 100644
index be2ecfca7..000000000
--- a/vendor/github.com/cilium/ebpf/internal/ptr_32_le.go
+++ /dev/null
@@ -1,14 +0,0 @@
-// +build 386 amd64p32 arm mipsle mips64p32le
-
-package internal
-
-import (
- "unsafe"
-)
-
-// Pointer wraps an unsafe.Pointer to be 64bit to
-// conform to the syscall specification.
-type Pointer struct {
- ptr unsafe.Pointer
- pad uint32
-}
diff --git a/vendor/github.com/cilium/ebpf/internal/ptr_64.go b/vendor/github.com/cilium/ebpf/internal/ptr_64.go
deleted file mode 100644
index 69452dceb..000000000
--- a/vendor/github.com/cilium/ebpf/internal/ptr_64.go
+++ /dev/null
@@ -1,14 +0,0 @@
-// +build !386,!amd64p32,!arm,!mipsle,!mips64p32le
-// +build !armbe,!mips,!mips64p32
-
-package internal
-
-import (
- "unsafe"
-)
-
-// Pointer wraps an unsafe.Pointer to be 64bit to
-// conform to the syscall specification.
-type Pointer struct {
- ptr unsafe.Pointer
-}
diff --git a/vendor/github.com/cilium/ebpf/internal/syscall.go b/vendor/github.com/cilium/ebpf/internal/syscall.go
deleted file mode 100644
index efbf40327..000000000
--- a/vendor/github.com/cilium/ebpf/internal/syscall.go
+++ /dev/null
@@ -1,139 +0,0 @@
-package internal
-
-import (
- "fmt"
- "path/filepath"
- "runtime"
- "unsafe"
-
- "github.com/cilium/ebpf/internal/unix"
-)
-
-//go:generate stringer -output syscall_string.go -type=BPFCmd
-
-// BPFCmd identifies a subcommand of the bpf syscall.
-type BPFCmd int
-
-// Well known BPF commands.
-const (
- BPF_MAP_CREATE BPFCmd = iota
- BPF_MAP_LOOKUP_ELEM
- BPF_MAP_UPDATE_ELEM
- BPF_MAP_DELETE_ELEM
- BPF_MAP_GET_NEXT_KEY
- BPF_PROG_LOAD
- BPF_OBJ_PIN
- BPF_OBJ_GET
- BPF_PROG_ATTACH
- BPF_PROG_DETACH
- BPF_PROG_TEST_RUN
- BPF_PROG_GET_NEXT_ID
- BPF_MAP_GET_NEXT_ID
- BPF_PROG_GET_FD_BY_ID
- BPF_MAP_GET_FD_BY_ID
- BPF_OBJ_GET_INFO_BY_FD
- BPF_PROG_QUERY
- BPF_RAW_TRACEPOINT_OPEN
- BPF_BTF_LOAD
- BPF_BTF_GET_FD_BY_ID
- BPF_TASK_FD_QUERY
- BPF_MAP_LOOKUP_AND_DELETE_ELEM
- BPF_MAP_FREEZE
- BPF_BTF_GET_NEXT_ID
- BPF_MAP_LOOKUP_BATCH
- BPF_MAP_LOOKUP_AND_DELETE_BATCH
- BPF_MAP_UPDATE_BATCH
- BPF_MAP_DELETE_BATCH
- BPF_LINK_CREATE
- BPF_LINK_UPDATE
- BPF_LINK_GET_FD_BY_ID
- BPF_LINK_GET_NEXT_ID
- BPF_ENABLE_STATS
- BPF_ITER_CREATE
-)
-
-// BPF wraps SYS_BPF.
-//
-// Any pointers contained in attr must use the Pointer type from this package.
-func BPF(cmd BPFCmd, attr unsafe.Pointer, size uintptr) (uintptr, error) {
- r1, _, errNo := unix.Syscall(unix.SYS_BPF, uintptr(cmd), uintptr(attr), size)
- runtime.KeepAlive(attr)
-
- var err error
- if errNo != 0 {
- err = errNo
- }
-
- return r1, err
-}
-
-type BPFProgAttachAttr struct {
- TargetFd uint32
- AttachBpfFd uint32
- AttachType uint32
- AttachFlags uint32
- ReplaceBpfFd uint32
-}
-
-func BPFProgAttach(attr *BPFProgAttachAttr) error {
- _, err := BPF(BPF_PROG_ATTACH, unsafe.Pointer(attr), unsafe.Sizeof(*attr))
- return err
-}
-
-type BPFProgDetachAttr struct {
- TargetFd uint32
- AttachBpfFd uint32
- AttachType uint32
-}
-
-func BPFProgDetach(attr *BPFProgDetachAttr) error {
- _, err := BPF(BPF_PROG_DETACH, unsafe.Pointer(attr), unsafe.Sizeof(*attr))
- return err
-}
-
-type bpfObjAttr struct {
- fileName Pointer
- fd uint32
- fileFlags uint32
-}
-
-const bpfFSType = 0xcafe4a11
-
-// BPFObjPin wraps BPF_OBJ_PIN.
-func BPFObjPin(fileName string, fd *FD) error {
- dirName := filepath.Dir(fileName)
- var statfs unix.Statfs_t
- if err := unix.Statfs(dirName, &statfs); err != nil {
- return err
- }
- if uint64(statfs.Type) != bpfFSType {
- return fmt.Errorf("%s is not on a bpf filesystem", fileName)
- }
-
- value, err := fd.Value()
- if err != nil {
- return err
- }
-
- attr := bpfObjAttr{
- fileName: NewStringPointer(fileName),
- fd: value,
- }
- _, err = BPF(BPF_OBJ_PIN, unsafe.Pointer(&attr), unsafe.Sizeof(attr))
- if err != nil {
- return fmt.Errorf("pin object %s: %w", fileName, err)
- }
- return nil
-}
-
-// BPFObjGet wraps BPF_OBJ_GET.
-func BPFObjGet(fileName string) (*FD, error) {
- attr := bpfObjAttr{
- fileName: NewStringPointer(fileName),
- }
- ptr, err := BPF(BPF_OBJ_GET, unsafe.Pointer(&attr), unsafe.Sizeof(attr))
- if err != nil {
- return nil, fmt.Errorf("get object %s: %w", fileName, err)
- }
- return NewFD(uint32(ptr)), nil
-}
diff --git a/vendor/github.com/cilium/ebpf/internal/syscall_string.go b/vendor/github.com/cilium/ebpf/internal/syscall_string.go
deleted file mode 100644
index 85df04779..000000000
--- a/vendor/github.com/cilium/ebpf/internal/syscall_string.go
+++ /dev/null
@@ -1,56 +0,0 @@
-// Code generated by "stringer -output syscall_string.go -type=BPFCmd"; DO NOT EDIT.
-
-package internal
-
-import "strconv"
-
-func _() {
- // An "invalid array index" compiler error signifies that the constant values have changed.
- // Re-run the stringer command to generate them again.
- var x [1]struct{}
- _ = x[BPF_MAP_CREATE-0]
- _ = x[BPF_MAP_LOOKUP_ELEM-1]
- _ = x[BPF_MAP_UPDATE_ELEM-2]
- _ = x[BPF_MAP_DELETE_ELEM-3]
- _ = x[BPF_MAP_GET_NEXT_KEY-4]
- _ = x[BPF_PROG_LOAD-5]
- _ = x[BPF_OBJ_PIN-6]
- _ = x[BPF_OBJ_GET-7]
- _ = x[BPF_PROG_ATTACH-8]
- _ = x[BPF_PROG_DETACH-9]
- _ = x[BPF_PROG_TEST_RUN-10]
- _ = x[BPF_PROG_GET_NEXT_ID-11]
- _ = x[BPF_MAP_GET_NEXT_ID-12]
- _ = x[BPF_PROG_GET_FD_BY_ID-13]
- _ = x[BPF_MAP_GET_FD_BY_ID-14]
- _ = x[BPF_OBJ_GET_INFO_BY_FD-15]
- _ = x[BPF_PROG_QUERY-16]
- _ = x[BPF_RAW_TRACEPOINT_OPEN-17]
- _ = x[BPF_BTF_LOAD-18]
- _ = x[BPF_BTF_GET_FD_BY_ID-19]
- _ = x[BPF_TASK_FD_QUERY-20]
- _ = x[BPF_MAP_LOOKUP_AND_DELETE_ELEM-21]
- _ = x[BPF_MAP_FREEZE-22]
- _ = x[BPF_BTF_GET_NEXT_ID-23]
- _ = x[BPF_MAP_LOOKUP_BATCH-24]
- _ = x[BPF_MAP_LOOKUP_AND_DELETE_BATCH-25]
- _ = x[BPF_MAP_UPDATE_BATCH-26]
- _ = x[BPF_MAP_DELETE_BATCH-27]
- _ = x[BPF_LINK_CREATE-28]
- _ = x[BPF_LINK_UPDATE-29]
- _ = x[BPF_LINK_GET_FD_BY_ID-30]
- _ = x[BPF_LINK_GET_NEXT_ID-31]
- _ = x[BPF_ENABLE_STATS-32]
- _ = x[BPF_ITER_CREATE-33]
-}
-
-const _BPFCmd_name = "BPF_MAP_CREATEBPF_MAP_LOOKUP_ELEMBPF_MAP_UPDATE_ELEMBPF_MAP_DELETE_ELEMBPF_MAP_GET_NEXT_KEYBPF_PROG_LOADBPF_OBJ_PINBPF_OBJ_GETBPF_PROG_ATTACHBPF_PROG_DETACHBPF_PROG_TEST_RUNBPF_PROG_GET_NEXT_IDBPF_MAP_GET_NEXT_IDBPF_PROG_GET_FD_BY_IDBPF_MAP_GET_FD_BY_IDBPF_OBJ_GET_INFO_BY_FDBPF_PROG_QUERYBPF_RAW_TRACEPOINT_OPENBPF_BTF_LOADBPF_BTF_GET_FD_BY_IDBPF_TASK_FD_QUERYBPF_MAP_LOOKUP_AND_DELETE_ELEMBPF_MAP_FREEZEBPF_BTF_GET_NEXT_IDBPF_MAP_LOOKUP_BATCHBPF_MAP_LOOKUP_AND_DELETE_BATCHBPF_MAP_UPDATE_BATCHBPF_MAP_DELETE_BATCHBPF_LINK_CREATEBPF_LINK_UPDATEBPF_LINK_GET_FD_BY_IDBPF_LINK_GET_NEXT_IDBPF_ENABLE_STATSBPF_ITER_CREATE"
-
-var _BPFCmd_index = [...]uint16{0, 14, 33, 52, 71, 91, 104, 115, 126, 141, 156, 173, 193, 212, 233, 253, 275, 289, 312, 324, 344, 361, 391, 405, 424, 444, 475, 495, 515, 530, 545, 566, 586, 602, 617}
-
-func (i BPFCmd) String() string {
- if i < 0 || i >= BPFCmd(len(_BPFCmd_index)-1) {
- return "BPFCmd(" + strconv.FormatInt(int64(i), 10) + ")"
- }
- return _BPFCmd_name[_BPFCmd_index[i]:_BPFCmd_index[i+1]]
-}
diff --git a/vendor/github.com/cilium/ebpf/internal/unix/types_linux.go b/vendor/github.com/cilium/ebpf/internal/unix/types_linux.go
deleted file mode 100644
index 9363d0be8..000000000
--- a/vendor/github.com/cilium/ebpf/internal/unix/types_linux.go
+++ /dev/null
@@ -1,150 +0,0 @@
-// +build linux
-
-package unix
-
-import (
- "syscall"
-
- linux "golang.org/x/sys/unix"
-)
-
-const (
- ENOENT = linux.ENOENT
- EEXIST = linux.EEXIST
- EAGAIN = linux.EAGAIN
- ENOSPC = linux.ENOSPC
- EINVAL = linux.EINVAL
- EPOLLIN = linux.EPOLLIN
- EINTR = linux.EINTR
- EPERM = linux.EPERM
- ESRCH = linux.ESRCH
- ENODEV = linux.ENODEV
- BPF_F_RDONLY_PROG = linux.BPF_F_RDONLY_PROG
- BPF_F_WRONLY_PROG = linux.BPF_F_WRONLY_PROG
- BPF_OBJ_NAME_LEN = linux.BPF_OBJ_NAME_LEN
- BPF_TAG_SIZE = linux.BPF_TAG_SIZE
- SYS_BPF = linux.SYS_BPF
- F_DUPFD_CLOEXEC = linux.F_DUPFD_CLOEXEC
- EPOLL_CTL_ADD = linux.EPOLL_CTL_ADD
- EPOLL_CLOEXEC = linux.EPOLL_CLOEXEC
- O_CLOEXEC = linux.O_CLOEXEC
- O_NONBLOCK = linux.O_NONBLOCK
- PROT_READ = linux.PROT_READ
- PROT_WRITE = linux.PROT_WRITE
- MAP_SHARED = linux.MAP_SHARED
- PERF_TYPE_SOFTWARE = linux.PERF_TYPE_SOFTWARE
- PERF_COUNT_SW_BPF_OUTPUT = linux.PERF_COUNT_SW_BPF_OUTPUT
- PerfBitWatermark = linux.PerfBitWatermark
- PERF_SAMPLE_RAW = linux.PERF_SAMPLE_RAW
- PERF_FLAG_FD_CLOEXEC = linux.PERF_FLAG_FD_CLOEXEC
- RLIM_INFINITY = linux.RLIM_INFINITY
- RLIMIT_MEMLOCK = linux.RLIMIT_MEMLOCK
-)
-
-// Statfs_t is a wrapper
-type Statfs_t = linux.Statfs_t
-
-// Rlimit is a wrapper
-type Rlimit = linux.Rlimit
-
-// Setrlimit is a wrapper
-func Setrlimit(resource int, rlim *Rlimit) (err error) {
- return linux.Setrlimit(resource, rlim)
-}
-
-// Syscall is a wrapper
-func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) {
- return linux.Syscall(trap, a1, a2, a3)
-}
-
-// FcntlInt is a wrapper
-func FcntlInt(fd uintptr, cmd, arg int) (int, error) {
- return linux.FcntlInt(fd, cmd, arg)
-}
-
-// Statfs is a wrapper
-func Statfs(path string, buf *Statfs_t) (err error) {
- return linux.Statfs(path, buf)
-}
-
-// Close is a wrapper
-func Close(fd int) (err error) {
- return linux.Close(fd)
-}
-
-// EpollEvent is a wrapper
-type EpollEvent = linux.EpollEvent
-
-// EpollWait is a wrapper
-func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
- return linux.EpollWait(epfd, events, msec)
-}
-
-// EpollCtl is a wrapper
-func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {
- return linux.EpollCtl(epfd, op, fd, event)
-}
-
-// Eventfd is a wrapper
-func Eventfd(initval uint, flags int) (fd int, err error) {
- return linux.Eventfd(initval, flags)
-}
-
-// Write is a wrapper
-func Write(fd int, p []byte) (n int, err error) {
- return linux.Write(fd, p)
-}
-
-// EpollCreate1 is a wrapper
-func EpollCreate1(flag int) (fd int, err error) {
- return linux.EpollCreate1(flag)
-}
-
-// PerfEventMmapPage is a wrapper
-type PerfEventMmapPage linux.PerfEventMmapPage
-
-// SetNonblock is a wrapper
-func SetNonblock(fd int, nonblocking bool) (err error) {
- return linux.SetNonblock(fd, nonblocking)
-}
-
-// Mmap is a wrapper
-func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) {
- return linux.Mmap(fd, offset, length, prot, flags)
-}
-
-// Munmap is a wrapper
-func Munmap(b []byte) (err error) {
- return linux.Munmap(b)
-}
-
-// PerfEventAttr is a wrapper
-type PerfEventAttr = linux.PerfEventAttr
-
-// PerfEventOpen is a wrapper
-func PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error) {
- return linux.PerfEventOpen(attr, pid, cpu, groupFd, flags)
-}
-
-// Utsname is a wrapper
-type Utsname = linux.Utsname
-
-// Uname is a wrapper
-func Uname(buf *Utsname) (err error) {
- return linux.Uname(buf)
-}
-
-// Getpid is a wrapper
-func Getpid() int {
- return linux.Getpid()
-}
-
-// Gettid is a wrapper
-func Gettid() int {
- return linux.Gettid()
-}
-
-// Tgkill is a wrapper
-func Tgkill(tgid int, tid int, sig syscall.Signal) (err error) {
- return linux.Tgkill(tgid, tid, sig)
-}
diff --git a/vendor/github.com/cilium/ebpf/internal/unix/types_other.go b/vendor/github.com/cilium/ebpf/internal/unix/types_other.go
deleted file mode 100644
index 2dea950f8..000000000
--- a/vendor/github.com/cilium/ebpf/internal/unix/types_other.go
+++ /dev/null
@@ -1,217 +0,0 @@
-// +build !linux
-
-package unix
-
-import (
- "fmt"
- "runtime"
- "syscall"
-)
-
-var errNonLinux = fmt.Errorf("unsupported platform %s/%s", runtime.GOOS, runtime.GOARCH)
-
-const (
- ENOENT = syscall.ENOENT
- EEXIST = syscall.EEXIST
- EAGAIN = syscall.EAGAIN
- ENOSPC = syscall.ENOSPC
- EINVAL = syscall.EINVAL
- EINTR = syscall.EINTR
- EPERM = syscall.EPERM
- ESRCH = syscall.ESRCH
- ENODEV = syscall.ENODEV
- BPF_F_RDONLY_PROG = 0
- BPF_F_WRONLY_PROG = 0
- BPF_OBJ_NAME_LEN = 0x10
- BPF_TAG_SIZE = 0x8
- SYS_BPF = 321
- F_DUPFD_CLOEXEC = 0x406
- EPOLLIN = 0x1
- EPOLL_CTL_ADD = 0x1
- EPOLL_CLOEXEC = 0x80000
- O_CLOEXEC = 0x80000
- O_NONBLOCK = 0x800
- PROT_READ = 0x1
- PROT_WRITE = 0x2
- MAP_SHARED = 0x1
- PERF_TYPE_SOFTWARE = 0x1
- PERF_COUNT_SW_BPF_OUTPUT = 0xa
- PerfBitWatermark = 0x4000
- PERF_SAMPLE_RAW = 0x400
- PERF_FLAG_FD_CLOEXEC = 0x8
- RLIM_INFINITY = 0x7fffffffffffffff
- RLIMIT_MEMLOCK = 8
-)
-
-// Statfs_t is a wrapper
-type Statfs_t struct {
- Type int64
- Bsize int64
- Blocks uint64
- Bfree uint64
- Bavail uint64
- Files uint64
- Ffree uint64
- Fsid [2]int32
- Namelen int64
- Frsize int64
- Flags int64
- Spare [4]int64
-}
-
-// Rlimit is a wrapper
-type Rlimit struct {
- Cur uint64
- Max uint64
-}
-
-// Setrlimit is a wrapper
-func Setrlimit(resource int, rlim *Rlimit) (err error) {
- return errNonLinux
-}
-
-// Syscall is a wrapper
-func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) {
- return 0, 0, syscall.Errno(1)
-}
-
-// FcntlInt is a wrapper
-func FcntlInt(fd uintptr, cmd, arg int) (int, error) {
- return -1, errNonLinux
-}
-
-// Statfs is a wrapper
-func Statfs(path string, buf *Statfs_t) error {
- return errNonLinux
-}
-
-// Close is a wrapper
-func Close(fd int) (err error) {
- return errNonLinux
-}
-
-// EpollEvent is a wrapper
-type EpollEvent struct {
- Events uint32
- Fd int32
- Pad int32
-}
-
-// EpollWait is a wrapper
-func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
- return 0, errNonLinux
-}
-
-// EpollCtl is a wrapper
-func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {
- return errNonLinux
-}
-
-// Eventfd is a wrapper
-func Eventfd(initval uint, flags int) (fd int, err error) {
- return 0, errNonLinux
-}
-
-// Write is a wrapper
-func Write(fd int, p []byte) (n int, err error) {
- return 0, errNonLinux
-}
-
-// EpollCreate1 is a wrapper
-func EpollCreate1(flag int) (fd int, err error) {
- return 0, errNonLinux
-}
-
-// PerfEventMmapPage is a wrapper
-type PerfEventMmapPage struct {
- Version uint32
- Compat_version uint32
- Lock uint32
- Index uint32
- Offset int64
- Time_enabled uint64
- Time_running uint64
- Capabilities uint64
- Pmc_width uint16
- Time_shift uint16
- Time_mult uint32
- Time_offset uint64
- Time_zero uint64
- Size uint32
-
- Data_head uint64
- Data_tail uint64
- Data_offset uint64
- Data_size uint64
- Aux_head uint64
- Aux_tail uint64
- Aux_offset uint64
- Aux_size uint64
-}
-
-// SetNonblock is a wrapper
-func SetNonblock(fd int, nonblocking bool) (err error) {
- return errNonLinux
-}
-
-// Mmap is a wrapper
-func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) {
- return []byte{}, errNonLinux
-}
-
-// Munmap is a wrapper
-func Munmap(b []byte) (err error) {
- return errNonLinux
-}
-
-// PerfEventAttr is a wrapper
-type PerfEventAttr struct {
- Type uint32
- Size uint32
- Config uint64
- Sample uint64
- Sample_type uint64
- Read_format uint64
- Bits uint64
- Wakeup uint32
- Bp_type uint32
- Ext1 uint64
- Ext2 uint64
- Branch_sample_type uint64
- Sample_regs_user uint64
- Sample_stack_user uint32
- Clockid int32
- Sample_regs_intr uint64
- Aux_watermark uint32
- Sample_max_stack uint16
-}
-
-// PerfEventOpen is a wrapper
-func PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error) {
- return 0, errNonLinux
-}
-
-// Utsname is a wrapper
-type Utsname struct {
- Release [65]byte
-}
-
-// Uname is a wrapper
-func Uname(buf *Utsname) (err error) {
- return errNonLinux
-}
-
-// Getpid is a wrapper
-func Getpid() int {
- return -1
-}
-
-// Gettid is a wrapper
-func Gettid() int {
- return -1
-}
-
-// Tgkill is a wrapper
-func Tgkill(tgid int, tid int, sig syscall.Signal) (err error) {
- return errNonLinux
-}
diff --git a/vendor/github.com/cilium/ebpf/linker.go b/vendor/github.com/cilium/ebpf/linker.go
deleted file mode 100644
index 1bb8f61c2..000000000
--- a/vendor/github.com/cilium/ebpf/linker.go
+++ /dev/null
@@ -1,86 +0,0 @@
-package ebpf
-
-import (
- "fmt"
-
- "github.com/cilium/ebpf/asm"
- "github.com/cilium/ebpf/internal/btf"
-)
-
-// link resolves bpf-to-bpf calls.
-//
-// Each library may contain multiple functions / labels, and is only linked
-// if prog references one of these functions.
-//
-// Libraries also linked.
-func link(prog *ProgramSpec, libs []*ProgramSpec) error {
- var (
- linked = make(map[*ProgramSpec]bool)
- pending = []asm.Instructions{prog.Instructions}
- insns asm.Instructions
- )
- for len(pending) > 0 {
- insns, pending = pending[0], pending[1:]
- for _, lib := range libs {
- if linked[lib] {
- continue
- }
-
- needed, err := needSection(insns, lib.Instructions)
- if err != nil {
- return fmt.Errorf("linking %s: %w", lib.Name, err)
- }
-
- if !needed {
- continue
- }
-
- linked[lib] = true
- prog.Instructions = append(prog.Instructions, lib.Instructions...)
- pending = append(pending, lib.Instructions)
-
- if prog.BTF != nil && lib.BTF != nil {
- if err := btf.ProgramAppend(prog.BTF, lib.BTF); err != nil {
- return fmt.Errorf("linking BTF of %s: %w", lib.Name, err)
- }
- }
- }
- }
-
- return nil
-}
-
-func needSection(insns, section asm.Instructions) (bool, error) {
- // A map of symbols to the libraries which contain them.
- symbols, err := section.SymbolOffsets()
- if err != nil {
- return false, err
- }
-
- for _, ins := range insns {
- if ins.Reference == "" {
- continue
- }
-
- if ins.OpCode.JumpOp() != asm.Call || ins.Src != asm.PseudoCall {
- continue
- }
-
- if ins.Constant != -1 {
- // This is already a valid call, no need to link again.
- continue
- }
-
- if _, ok := symbols[ins.Reference]; !ok {
- // Symbol isn't available in this section
- continue
- }
-
- // At this point we know that at least one function in the
- // library is called from insns, so we have to link it.
- return true, nil
- }
-
- // None of the functions in the section are called.
- return false, nil
-}
diff --git a/vendor/github.com/cilium/ebpf/map.go b/vendor/github.com/cilium/ebpf/map.go
deleted file mode 100644
index 461b995a5..000000000
--- a/vendor/github.com/cilium/ebpf/map.go
+++ /dev/null
@@ -1,798 +0,0 @@
-package ebpf
-
-import (
- "errors"
- "fmt"
- "strings"
-
- "github.com/cilium/ebpf/internal"
- "github.com/cilium/ebpf/internal/btf"
- "github.com/cilium/ebpf/internal/unix"
-)
-
-// Errors returned by Map and MapIterator methods.
-var (
- ErrKeyNotExist = errors.New("key does not exist")
- ErrKeyExist = errors.New("key already exists")
- ErrIterationAborted = errors.New("iteration aborted")
-)
-
-// MapID represents the unique ID of an eBPF map
-type MapID uint32
-
-// MapSpec defines a Map.
-type MapSpec struct {
- // Name is passed to the kernel as a debug aid. Must only contain
- // alpha numeric and '_' characters.
- Name string
- Type MapType
- KeySize uint32
- ValueSize uint32
- MaxEntries uint32
- Flags uint32
-
- // The initial contents of the map. May be nil.
- Contents []MapKV
-
- // Whether to freeze a map after setting its initial contents.
- Freeze bool
-
- // InnerMap is used as a template for ArrayOfMaps and HashOfMaps
- InnerMap *MapSpec
-
- // The BTF associated with this map.
- BTF *btf.Map
-}
-
-func (ms *MapSpec) String() string {
- return fmt.Sprintf("%s(keySize=%d, valueSize=%d, maxEntries=%d, flags=%d)", ms.Type, ms.KeySize, ms.ValueSize, ms.MaxEntries, ms.Flags)
-}
-
-// Copy returns a copy of the spec.
-//
-// MapSpec.Contents is a shallow copy.
-func (ms *MapSpec) Copy() *MapSpec {
- if ms == nil {
- return nil
- }
-
- cpy := *ms
- cpy.Contents = make([]MapKV, len(ms.Contents))
- copy(cpy.Contents, ms.Contents)
- cpy.InnerMap = ms.InnerMap.Copy()
- return &cpy
-}
-
-// MapKV is used to initialize the contents of a Map.
-type MapKV struct {
- Key interface{}
- Value interface{}
-}
-
-// Map represents a Map file descriptor.
-//
-// It is not safe to close a map which is used by other goroutines.
-//
-// Methods which take interface{} arguments by default encode
-// them using binary.Read/Write in the machine's native endianness.
-//
-// Implement encoding.BinaryMarshaler or encoding.BinaryUnmarshaler
-// if you require custom encoding.
-type Map struct {
- name string
- fd *internal.FD
- abi MapABI
- // Per CPU maps return values larger than the size in the spec
- fullValueSize int
-}
-
-// NewMapFromFD creates a map from a raw fd.
-//
-// You should not use fd after calling this function.
-func NewMapFromFD(fd int) (*Map, error) {
- if fd < 0 {
- return nil, errors.New("invalid fd")
- }
- bpfFd := internal.NewFD(uint32(fd))
-
- name, abi, err := newMapABIFromFd(bpfFd)
- if err != nil {
- bpfFd.Forget()
- return nil, err
- }
- return newMap(bpfFd, name, abi)
-}
-
-// NewMap creates a new Map.
-//
-// Creating a map for the first time will perform feature detection
-// by creating small, temporary maps.
-//
-// The caller is responsible for ensuring the process' rlimit is set
-// sufficiently high for locking memory during map creation. This can be done
-// by calling unix.Setrlimit with unix.RLIMIT_MEMLOCK prior to calling NewMap.
-func NewMap(spec *MapSpec) (*Map, error) {
- if spec.BTF == nil {
- return newMapWithBTF(spec, nil)
- }
-
- handle, err := btf.NewHandle(btf.MapSpec(spec.BTF))
- if err != nil && !errors.Is(err, btf.ErrNotSupported) {
- return nil, fmt.Errorf("can't load BTF: %w", err)
- }
-
- return newMapWithBTF(spec, handle)
-}
-
-func newMapWithBTF(spec *MapSpec, handle *btf.Handle) (*Map, error) {
- if spec.Type != ArrayOfMaps && spec.Type != HashOfMaps {
- return createMap(spec, nil, handle)
- }
-
- if spec.InnerMap == nil {
- return nil, fmt.Errorf("%s requires InnerMap", spec.Type)
- }
-
- template, err := createMap(spec.InnerMap, nil, handle)
- if err != nil {
- return nil, err
- }
- defer template.Close()
-
- return createMap(spec, template.fd, handle)
-}
-
-func createMap(spec *MapSpec, inner *internal.FD, handle *btf.Handle) (*Map, error) {
- abi := newMapABIFromSpec(spec)
-
- switch spec.Type {
- case ArrayOfMaps:
- fallthrough
- case HashOfMaps:
- if err := haveNestedMaps(); err != nil {
- return nil, err
- }
-
- if abi.ValueSize != 0 && abi.ValueSize != 4 {
- return nil, errors.New("ValueSize must be zero or four for map of map")
- }
- abi.ValueSize = 4
-
- case PerfEventArray:
- if abi.KeySize != 0 && abi.KeySize != 4 {
- return nil, errors.New("KeySize must be zero or four for perf event array")
- }
- abi.KeySize = 4
-
- if abi.ValueSize != 0 && abi.ValueSize != 4 {
- return nil, errors.New("ValueSize must be zero or four for perf event array")
- }
- abi.ValueSize = 4
-
- if abi.MaxEntries == 0 {
- n, err := internal.PossibleCPUs()
- if err != nil {
- return nil, fmt.Errorf("perf event array: %w", err)
- }
- abi.MaxEntries = uint32(n)
- }
- }
-
- if abi.Flags&(unix.BPF_F_RDONLY_PROG|unix.BPF_F_WRONLY_PROG) > 0 || spec.Freeze {
- if err := haveMapMutabilityModifiers(); err != nil {
- return nil, fmt.Errorf("map create: %w", err)
- }
- }
-
- attr := bpfMapCreateAttr{
- mapType: abi.Type,
- keySize: abi.KeySize,
- valueSize: abi.ValueSize,
- maxEntries: abi.MaxEntries,
- flags: abi.Flags,
- }
-
- if inner != nil {
- var err error
- attr.innerMapFd, err = inner.Value()
- if err != nil {
- return nil, fmt.Errorf("map create: %w", err)
- }
- }
-
- if handle != nil && spec.BTF != nil {
- attr.btfFd = uint32(handle.FD())
- attr.btfKeyTypeID = btf.MapKey(spec.BTF).ID()
- attr.btfValueTypeID = btf.MapValue(spec.BTF).ID()
- }
-
- if haveObjName() == nil {
- attr.mapName = newBPFObjName(spec.Name)
- }
-
- fd, err := bpfMapCreate(&attr)
- if err != nil {
- return nil, fmt.Errorf("map create: %w", err)
- }
-
- m, err := newMap(fd, spec.Name, abi)
- if err != nil {
- return nil, err
- }
-
- if err := m.populate(spec.Contents); err != nil {
- m.Close()
- return nil, fmt.Errorf("map create: can't set initial contents: %w", err)
- }
-
- if spec.Freeze {
- if err := m.Freeze(); err != nil {
- m.Close()
- return nil, fmt.Errorf("can't freeze map: %w", err)
- }
- }
-
- return m, nil
-}
-
-func newMap(fd *internal.FD, name string, abi *MapABI) (*Map, error) {
- m := &Map{
- name,
- fd,
- *abi,
- int(abi.ValueSize),
- }
-
- if !abi.Type.hasPerCPUValue() {
- return m, nil
- }
-
- possibleCPUs, err := internal.PossibleCPUs()
- if err != nil {
- return nil, err
- }
-
- m.fullValueSize = align(int(abi.ValueSize), 8) * possibleCPUs
- return m, nil
-}
-
-func (m *Map) String() string {
- if m.name != "" {
- return fmt.Sprintf("%s(%s)#%v", m.abi.Type, m.name, m.fd)
- }
- return fmt.Sprintf("%s#%v", m.abi.Type, m.fd)
-}
-
-// ABI gets the ABI of the Map
-func (m *Map) ABI() MapABI {
- return m.abi
-}
-
-// Lookup retrieves a value from a Map.
-//
-// Calls Close() on valueOut if it is of type **Map or **Program,
-// and *valueOut is not nil.
-//
-// Returns an error if the key doesn't exist, see IsNotExist.
-func (m *Map) Lookup(key, valueOut interface{}) error {
- valuePtr, valueBytes := makeBuffer(valueOut, m.fullValueSize)
-
- if err := m.lookup(key, valuePtr); err != nil {
- return err
- }
-
- if valueBytes == nil {
- return nil
- }
-
- if m.abi.Type.hasPerCPUValue() {
- return unmarshalPerCPUValue(valueOut, int(m.abi.ValueSize), valueBytes)
- }
-
- switch value := valueOut.(type) {
- case **Map:
- m, err := unmarshalMap(valueBytes)
- if err != nil {
- return err
- }
-
- (*value).Close()
- *value = m
- return nil
- case *Map:
- return fmt.Errorf("can't unmarshal into %T, need %T", value, (**Map)(nil))
- case Map:
- return fmt.Errorf("can't unmarshal into %T, need %T", value, (**Map)(nil))
-
- case **Program:
- p, err := unmarshalProgram(valueBytes)
- if err != nil {
- return err
- }
-
- (*value).Close()
- *value = p
- return nil
- case *Program:
- return fmt.Errorf("can't unmarshal into %T, need %T", value, (**Program)(nil))
- case Program:
- return fmt.Errorf("can't unmarshal into %T, need %T", value, (**Program)(nil))
-
- default:
- return unmarshalBytes(valueOut, valueBytes)
- }
-}
-
-// LookupAndDelete retrieves and deletes a value from a Map.
-//
-// Returns ErrKeyNotExist if the key doesn't exist.
-func (m *Map) LookupAndDelete(key, valueOut interface{}) error {
- valuePtr, valueBytes := makeBuffer(valueOut, m.fullValueSize)
-
- keyPtr, err := marshalPtr(key, int(m.abi.KeySize))
- if err != nil {
- return fmt.Errorf("can't marshal key: %w", err)
- }
-
- if err := bpfMapLookupAndDelete(m.fd, keyPtr, valuePtr); err != nil {
- return fmt.Errorf("lookup and delete failed: %w", err)
- }
-
- return unmarshalBytes(valueOut, valueBytes)
-}
-
-// LookupBytes gets a value from Map.
-//
-// Returns a nil value if a key doesn't exist.
-func (m *Map) LookupBytes(key interface{}) ([]byte, error) {
- valueBytes := make([]byte, m.fullValueSize)
- valuePtr := internal.NewSlicePointer(valueBytes)
-
- err := m.lookup(key, valuePtr)
- if errors.Is(err, ErrKeyNotExist) {
- return nil, nil
- }
-
- return valueBytes, err
-}
-
-func (m *Map) lookup(key interface{}, valueOut internal.Pointer) error {
- keyPtr, err := marshalPtr(key, int(m.abi.KeySize))
- if err != nil {
- return fmt.Errorf("can't marshal key: %w", err)
- }
-
- if err = bpfMapLookupElem(m.fd, keyPtr, valueOut); err != nil {
- return fmt.Errorf("lookup failed: %w", err)
- }
- return nil
-}
-
-// MapUpdateFlags controls the behaviour of the Map.Update call.
-//
-// The exact semantics depend on the specific MapType.
-type MapUpdateFlags uint64
-
-const (
- // UpdateAny creates a new element or update an existing one.
- UpdateAny MapUpdateFlags = iota
- // UpdateNoExist creates a new element.
- UpdateNoExist MapUpdateFlags = 1 << (iota - 1)
- // UpdateExist updates an existing element.
- UpdateExist
-)
-
-// Put replaces or creates a value in map.
-//
-// It is equivalent to calling Update with UpdateAny.
-func (m *Map) Put(key, value interface{}) error {
- return m.Update(key, value, UpdateAny)
-}
-
-// Update changes the value of a key.
-func (m *Map) Update(key, value interface{}, flags MapUpdateFlags) error {
- keyPtr, err := marshalPtr(key, int(m.abi.KeySize))
- if err != nil {
- return fmt.Errorf("can't marshal key: %w", err)
- }
-
- var valuePtr internal.Pointer
- if m.abi.Type.hasPerCPUValue() {
- valuePtr, err = marshalPerCPUValue(value, int(m.abi.ValueSize))
- } else {
- valuePtr, err = marshalPtr(value, int(m.abi.ValueSize))
- }
- if err != nil {
- return fmt.Errorf("can't marshal value: %w", err)
- }
-
- if err = bpfMapUpdateElem(m.fd, keyPtr, valuePtr, uint64(flags)); err != nil {
- return fmt.Errorf("update failed: %w", err)
- }
-
- return nil
-}
-
-// Delete removes a value.
-//
-// Returns ErrKeyNotExist if the key does not exist.
-func (m *Map) Delete(key interface{}) error {
- keyPtr, err := marshalPtr(key, int(m.abi.KeySize))
- if err != nil {
- return fmt.Errorf("can't marshal key: %w", err)
- }
-
- if err = bpfMapDeleteElem(m.fd, keyPtr); err != nil {
- return fmt.Errorf("delete failed: %w", err)
- }
- return nil
-}
-
-// NextKey finds the key following an initial key.
-//
-// See NextKeyBytes for details.
-//
-// Returns ErrKeyNotExist if there is no next key.
-func (m *Map) NextKey(key, nextKeyOut interface{}) error {
- nextKeyPtr, nextKeyBytes := makeBuffer(nextKeyOut, int(m.abi.KeySize))
-
- if err := m.nextKey(key, nextKeyPtr); err != nil {
- return err
- }
-
- if nextKeyBytes == nil {
- return nil
- }
-
- if err := unmarshalBytes(nextKeyOut, nextKeyBytes); err != nil {
- return fmt.Errorf("can't unmarshal next key: %w", err)
- }
- return nil
-}
-
-// NextKeyBytes returns the key following an initial key as a byte slice.
-//
-// Passing nil will return the first key.
-//
-// Use Iterate if you want to traverse all entries in the map.
-//
-// Returns nil if there are no more keys.
-func (m *Map) NextKeyBytes(key interface{}) ([]byte, error) {
- nextKey := make([]byte, m.abi.KeySize)
- nextKeyPtr := internal.NewSlicePointer(nextKey)
-
- err := m.nextKey(key, nextKeyPtr)
- if errors.Is(err, ErrKeyNotExist) {
- return nil, nil
- }
-
- return nextKey, err
-}
-
-func (m *Map) nextKey(key interface{}, nextKeyOut internal.Pointer) error {
- var (
- keyPtr internal.Pointer
- err error
- )
-
- if key != nil {
- keyPtr, err = marshalPtr(key, int(m.abi.KeySize))
- if err != nil {
- return fmt.Errorf("can't marshal key: %w", err)
- }
- }
-
- if err = bpfMapGetNextKey(m.fd, keyPtr, nextKeyOut); err != nil {
- return fmt.Errorf("next key failed: %w", err)
- }
- return nil
-}
-
-// Iterate traverses a map.
-//
-// It's safe to create multiple iterators at the same time.
-//
-// It's not possible to guarantee that all keys in a map will be
-// returned if there are concurrent modifications to the map.
-func (m *Map) Iterate() *MapIterator {
- return newMapIterator(m)
-}
-
-// Close removes a Map
-func (m *Map) Close() error {
- if m == nil {
- // This makes it easier to clean up when iterating maps
- // of maps / programs.
- return nil
- }
-
- return m.fd.Close()
-}
-
-// FD gets the file descriptor of the Map.
-//
-// Calling this function is invalid after Close has been called.
-func (m *Map) FD() int {
- fd, err := m.fd.Value()
- if err != nil {
- // Best effort: -1 is the number most likely to be an
- // invalid file descriptor.
- return -1
- }
-
- return int(fd)
-}
-
-// Clone creates a duplicate of the Map.
-//
-// Closing the duplicate does not affect the original, and vice versa.
-// Changes made to the map are reflected by both instances however.
-//
-// Cloning a nil Map returns nil.
-func (m *Map) Clone() (*Map, error) {
- if m == nil {
- return nil, nil
- }
-
- dup, err := m.fd.Dup()
- if err != nil {
- return nil, fmt.Errorf("can't clone map: %w", err)
- }
-
- return newMap(dup, m.name, &m.abi)
-}
-
-// Pin persists the map past the lifetime of the process that created it.
-//
-// This requires bpffs to be mounted above fileName. See http://cilium.readthedocs.io/en/doc-1.0/kubernetes/install/#mounting-the-bpf-fs-optional
-func (m *Map) Pin(fileName string) error {
- return internal.BPFObjPin(fileName, m.fd)
-}
-
-// Freeze prevents a map to be modified from user space.
-//
-// It makes no changes to kernel-side restrictions.
-func (m *Map) Freeze() error {
- if err := haveMapMutabilityModifiers(); err != nil {
- return fmt.Errorf("can't freeze map: %w", err)
- }
-
- if err := bpfMapFreeze(m.fd); err != nil {
- return fmt.Errorf("can't freeze map: %w", err)
- }
- return nil
-}
-
-func (m *Map) populate(contents []MapKV) error {
- for _, kv := range contents {
- if err := m.Put(kv.Key, kv.Value); err != nil {
- return fmt.Errorf("key %v: %w", kv.Key, err)
- }
- }
- return nil
-}
-
-// LoadPinnedMap load a Map from a BPF file.
-//
-// The function is not compatible with nested maps.
-// Use LoadPinnedMapExplicit in these situations.
-func LoadPinnedMap(fileName string) (*Map, error) {
- fd, err := internal.BPFObjGet(fileName)
- if err != nil {
- return nil, err
- }
- name, abi, err := newMapABIFromFd(fd)
- if err != nil {
- _ = fd.Close()
- return nil, err
- }
- return newMap(fd, name, abi)
-}
-
-// LoadPinnedMapExplicit loads a map with explicit parameters.
-func LoadPinnedMapExplicit(fileName string, abi *MapABI) (*Map, error) {
- fd, err := internal.BPFObjGet(fileName)
- if err != nil {
- return nil, err
- }
- return newMap(fd, "", abi)
-}
-
-func unmarshalMap(buf []byte) (*Map, error) {
- if len(buf) != 4 {
- return nil, errors.New("map id requires 4 byte value")
- }
-
- // Looking up an entry in a nested map or prog array returns an id,
- // not an fd.
- id := internal.NativeEndian.Uint32(buf)
- return NewMapFromID(MapID(id))
-}
-
-// MarshalBinary implements BinaryMarshaler.
-func (m *Map) MarshalBinary() ([]byte, error) {
- fd, err := m.fd.Value()
- if err != nil {
- return nil, err
- }
-
- buf := make([]byte, 4)
- internal.NativeEndian.PutUint32(buf, fd)
- return buf, nil
-}
-
-func patchValue(value []byte, typ btf.Type, replacements map[string]interface{}) error {
- replaced := make(map[string]bool)
- replace := func(name string, offset, size int, replacement interface{}) error {
- if offset+size > len(value) {
- return fmt.Errorf("%s: offset %d(+%d) is out of bounds", name, offset, size)
- }
-
- buf, err := marshalBytes(replacement, size)
- if err != nil {
- return fmt.Errorf("marshal %s: %w", name, err)
- }
-
- copy(value[offset:offset+size], buf)
- replaced[name] = true
- return nil
- }
-
- switch parent := typ.(type) {
- case *btf.Datasec:
- for _, secinfo := range parent.Vars {
- name := string(secinfo.Type.(*btf.Var).Name)
- replacement, ok := replacements[name]
- if !ok {
- continue
- }
-
- err := replace(name, int(secinfo.Offset), int(secinfo.Size), replacement)
- if err != nil {
- return err
- }
- }
-
- default:
- return fmt.Errorf("patching %T is not supported", typ)
- }
-
- if len(replaced) == len(replacements) {
- return nil
- }
-
- var missing []string
- for name := range replacements {
- if !replaced[name] {
- missing = append(missing, name)
- }
- }
-
- if len(missing) == 1 {
- return fmt.Errorf("unknown field: %s", missing[0])
- }
-
- return fmt.Errorf("unknown fields: %s", strings.Join(missing, ","))
-}
-
-// MapIterator iterates a Map.
-//
-// See Map.Iterate.
-type MapIterator struct {
- target *Map
- prevKey interface{}
- prevBytes []byte
- count, maxEntries uint32
- done bool
- err error
-}
-
-func newMapIterator(target *Map) *MapIterator {
- return &MapIterator{
- target: target,
- maxEntries: target.abi.MaxEntries,
- prevBytes: make([]byte, int(target.abi.KeySize)),
- }
-}
-
-// Next decodes the next key and value.
-//
-// Iterating a hash map from which keys are being deleted is not
-// safe. You may see the same key multiple times. Iteration may
-// also abort with an error, see IsIterationAborted.
-//
-// Returns false if there are no more entries. You must check
-// the result of Err afterwards.
-//
-// See Map.Get for further caveats around valueOut.
-func (mi *MapIterator) Next(keyOut, valueOut interface{}) bool {
- if mi.err != nil || mi.done {
- return false
- }
-
- for ; mi.count < mi.maxEntries; mi.count++ {
- var nextBytes []byte
- nextBytes, mi.err = mi.target.NextKeyBytes(mi.prevKey)
- if mi.err != nil {
- return false
- }
-
- if nextBytes == nil {
- mi.done = true
- return false
- }
-
- // The user can get access to nextBytes since unmarshalBytes
- // does not copy when unmarshaling into a []byte.
- // Make a copy to prevent accidental corruption of
- // iterator state.
- copy(mi.prevBytes, nextBytes)
- mi.prevKey = mi.prevBytes
-
- mi.err = mi.target.Lookup(nextBytes, valueOut)
- if errors.Is(mi.err, ErrKeyNotExist) {
- // Even though the key should be valid, we couldn't look up
- // its value. If we're iterating a hash map this is probably
- // because a concurrent delete removed the value before we
- // could get it. This means that the next call to NextKeyBytes
- // is very likely to restart iteration.
- // If we're iterating one of the fd maps like
- // ProgramArray it means that a given slot doesn't have
- // a valid fd associated. It's OK to continue to the next slot.
- continue
- }
- if mi.err != nil {
- return false
- }
-
- mi.err = unmarshalBytes(keyOut, nextBytes)
- return mi.err == nil
- }
-
- mi.err = fmt.Errorf("%w", ErrIterationAborted)
- return false
-}
-
-// Err returns any encountered error.
-//
-// The method must be called after Next returns nil.
-//
-// Returns ErrIterationAborted if it wasn't possible to do a full iteration.
-func (mi *MapIterator) Err() error {
- return mi.err
-}
-
-// MapGetNextID returns the ID of the next eBPF map.
-//
-// Returns ErrNotExist, if there is no next eBPF map.
-func MapGetNextID(startID MapID) (MapID, error) {
- id, err := objGetNextID(internal.BPF_MAP_GET_NEXT_ID, uint32(startID))
- return MapID(id), err
-}
-
-// NewMapFromID returns the map for a given id.
-//
-// Returns ErrNotExist, if there is no eBPF map with the given id.
-func NewMapFromID(id MapID) (*Map, error) {
- fd, err := bpfObjGetFDByID(internal.BPF_MAP_GET_FD_BY_ID, uint32(id))
- if err != nil {
- return nil, err
- }
-
- name, abi, err := newMapABIFromFd(fd)
- if err != nil {
- _ = fd.Close()
- return nil, err
- }
-
- return newMap(fd, name, abi)
-}
-
-// ID returns the systemwide unique ID of the map.
-func (m *Map) ID() (MapID, error) {
- info, err := bpfGetMapInfoByFD(m.fd)
- if err != nil {
- return MapID(0), err
- }
- return MapID(info.id), nil
-}
diff --git a/vendor/github.com/cilium/ebpf/marshalers.go b/vendor/github.com/cilium/ebpf/marshalers.go
deleted file mode 100644
index c0db2f6b0..000000000
--- a/vendor/github.com/cilium/ebpf/marshalers.go
+++ /dev/null
@@ -1,203 +0,0 @@
-package ebpf
-
-import (
- "bytes"
- "encoding"
- "encoding/binary"
- "errors"
- "fmt"
- "reflect"
- "runtime"
- "unsafe"
-
- "github.com/cilium/ebpf/internal"
-)
-
-func marshalPtr(data interface{}, length int) (internal.Pointer, error) {
- if data == nil {
- if length == 0 {
- return internal.NewPointer(nil), nil
- }
- return internal.Pointer{}, errors.New("can't use nil as key of map")
- }
-
- if ptr, ok := data.(unsafe.Pointer); ok {
- return internal.NewPointer(ptr), nil
- }
-
- buf, err := marshalBytes(data, length)
- if err != nil {
- return internal.Pointer{}, err
- }
-
- return internal.NewSlicePointer(buf), nil
-}
-
-func marshalBytes(data interface{}, length int) (buf []byte, err error) {
- switch value := data.(type) {
- case encoding.BinaryMarshaler:
- buf, err = value.MarshalBinary()
- case string:
- buf = []byte(value)
- case []byte:
- buf = value
- case unsafe.Pointer:
- err = errors.New("can't marshal from unsafe.Pointer")
- default:
- var wr bytes.Buffer
- err = binary.Write(&wr, internal.NativeEndian, value)
- if err != nil {
- err = fmt.Errorf("encoding %T: %v", value, err)
- }
- buf = wr.Bytes()
- }
- if err != nil {
- return nil, err
- }
-
- if len(buf) != length {
- return nil, fmt.Errorf("%T doesn't marshal to %d bytes", data, length)
- }
- return buf, nil
-}
-
-func makeBuffer(dst interface{}, length int) (internal.Pointer, []byte) {
- if ptr, ok := dst.(unsafe.Pointer); ok {
- return internal.NewPointer(ptr), nil
- }
-
- buf := make([]byte, length)
- return internal.NewSlicePointer(buf), buf
-}
-
-func unmarshalBytes(data interface{}, buf []byte) error {
- switch value := data.(type) {
- case unsafe.Pointer:
- sh := &reflect.SliceHeader{
- Data: uintptr(value),
- Len: len(buf),
- Cap: len(buf),
- }
-
- dst := *(*[]byte)(unsafe.Pointer(sh))
- copy(dst, buf)
- runtime.KeepAlive(value)
- return nil
- case encoding.BinaryUnmarshaler:
- return value.UnmarshalBinary(buf)
- case *string:
- *value = string(buf)
- return nil
- case *[]byte:
- *value = buf
- return nil
- case string:
- return errors.New("require pointer to string")
- case []byte:
- return errors.New("require pointer to []byte")
- default:
- rd := bytes.NewReader(buf)
- if err := binary.Read(rd, internal.NativeEndian, value); err != nil {
- return fmt.Errorf("decoding %T: %v", value, err)
- }
- return nil
- }
-}
-
-// marshalPerCPUValue encodes a slice containing one value per
-// possible CPU into a buffer of bytes.
-//
-// Values are initialized to zero if the slice has less elements than CPUs.
-//
-// slice must have a type like []elementType.
-func marshalPerCPUValue(slice interface{}, elemLength int) (internal.Pointer, error) {
- sliceType := reflect.TypeOf(slice)
- if sliceType.Kind() != reflect.Slice {
- return internal.Pointer{}, errors.New("per-CPU value requires slice")
- }
-
- possibleCPUs, err := internal.PossibleCPUs()
- if err != nil {
- return internal.Pointer{}, err
- }
-
- sliceValue := reflect.ValueOf(slice)
- sliceLen := sliceValue.Len()
- if sliceLen > possibleCPUs {
- return internal.Pointer{}, fmt.Errorf("per-CPU value exceeds number of CPUs")
- }
-
- alignedElemLength := align(elemLength, 8)
- buf := make([]byte, alignedElemLength*possibleCPUs)
-
- for i := 0; i < sliceLen; i++ {
- elem := sliceValue.Index(i).Interface()
- elemBytes, err := marshalBytes(elem, elemLength)
- if err != nil {
- return internal.Pointer{}, err
- }
-
- offset := i * alignedElemLength
- copy(buf[offset:offset+elemLength], elemBytes)
- }
-
- return internal.NewSlicePointer(buf), nil
-}
-
-// unmarshalPerCPUValue decodes a buffer into a slice containing one value per
-// possible CPU.
-//
-// valueOut must have a type like *[]elementType
-func unmarshalPerCPUValue(slicePtr interface{}, elemLength int, buf []byte) error {
- slicePtrType := reflect.TypeOf(slicePtr)
- if slicePtrType.Kind() != reflect.Ptr || slicePtrType.Elem().Kind() != reflect.Slice {
- return fmt.Errorf("per-cpu value requires pointer to slice")
- }
-
- possibleCPUs, err := internal.PossibleCPUs()
- if err != nil {
- return err
- }
-
- sliceType := slicePtrType.Elem()
- slice := reflect.MakeSlice(sliceType, possibleCPUs, possibleCPUs)
-
- sliceElemType := sliceType.Elem()
- sliceElemIsPointer := sliceElemType.Kind() == reflect.Ptr
- if sliceElemIsPointer {
- sliceElemType = sliceElemType.Elem()
- }
-
- step := len(buf) / possibleCPUs
- if step < elemLength {
- return fmt.Errorf("per-cpu element length is larger than available data")
- }
- for i := 0; i < possibleCPUs; i++ {
- var elem interface{}
- if sliceElemIsPointer {
- newElem := reflect.New(sliceElemType)
- slice.Index(i).Set(newElem)
- elem = newElem.Interface()
- } else {
- elem = slice.Index(i).Addr().Interface()
- }
-
- // Make a copy, since unmarshal can hold on to itemBytes
- elemBytes := make([]byte, elemLength)
- copy(elemBytes, buf[:elemLength])
-
- err := unmarshalBytes(elem, elemBytes)
- if err != nil {
- return fmt.Errorf("cpu %d: %w", i, err)
- }
-
- buf = buf[step:]
- }
-
- reflect.ValueOf(slicePtr).Elem().Set(slice)
- return nil
-}
-
-func align(n, alignment int) int {
- return (int(n) + alignment - 1) / alignment * alignment
-}
diff --git a/vendor/github.com/cilium/ebpf/prog.go b/vendor/github.com/cilium/ebpf/prog.go
deleted file mode 100644
index 429203f07..000000000
--- a/vendor/github.com/cilium/ebpf/prog.go
+++ /dev/null
@@ -1,622 +0,0 @@
-package ebpf
-
-import (
- "bytes"
- "encoding/binary"
- "errors"
- "fmt"
- "math"
- "strings"
- "time"
-
- "github.com/cilium/ebpf/asm"
- "github.com/cilium/ebpf/internal"
- "github.com/cilium/ebpf/internal/btf"
- "github.com/cilium/ebpf/internal/unix"
-)
-
-// ErrNotSupported is returned whenever the kernel doesn't support a feature.
-var ErrNotSupported = internal.ErrNotSupported
-
-// ProgramID represents the unique ID of an eBPF program
-type ProgramID uint32
-
-const (
- // Number of bytes to pad the output buffer for BPF_PROG_TEST_RUN.
- // This is currently the maximum of spare space allocated for SKB
- // and XDP programs, and equal to XDP_PACKET_HEADROOM + NET_IP_ALIGN.
- outputPad = 256 + 2
-)
-
-// DefaultVerifierLogSize is the default number of bytes allocated for the
-// verifier log.
-const DefaultVerifierLogSize = 64 * 1024
-
-// ProgramOptions control loading a program into the kernel.
-type ProgramOptions struct {
- // Controls the detail emitted by the kernel verifier. Set to non-zero
- // to enable logging.
- LogLevel uint32
- // Controls the output buffer size for the verifier. Defaults to
- // DefaultVerifierLogSize.
- LogSize int
-}
-
-// ProgramSpec defines a Program
-type ProgramSpec struct {
- // Name is passed to the kernel as a debug aid. Must only contain
- // alpha numeric and '_' characters.
- Name string
- // Type determines at which hook in the kernel a program will run.
- Type ProgramType
- AttachType AttachType
- // Name of a kernel data structure to attach to. It's interpretation
- // depends on Type and AttachType.
- AttachTo string
- Instructions asm.Instructions
-
- // License of the program. Some helpers are only available if
- // the license is deemed compatible with the GPL.
- //
- // See https://www.kernel.org/doc/html/latest/process/license-rules.html#id1
- License string
-
- // Version used by tracing programs.
- //
- // Deprecated: superseded by BTF.
- KernelVersion uint32
-
- // The BTF associated with this program. Changing Instructions
- // will most likely invalidate the contained data, and may
- // result in errors when attempting to load it into the kernel.
- BTF *btf.Program
-
- // The byte order this program was compiled for, may be nil.
- ByteOrder binary.ByteOrder
-}
-
-// Copy returns a copy of the spec.
-func (ps *ProgramSpec) Copy() *ProgramSpec {
- if ps == nil {
- return nil
- }
-
- cpy := *ps
- cpy.Instructions = make(asm.Instructions, len(ps.Instructions))
- copy(cpy.Instructions, ps.Instructions)
- return &cpy
-}
-
-// Program represents BPF program loaded into the kernel.
-//
-// It is not safe to close a Program which is used by other goroutines.
-type Program struct {
- // Contains the output of the kernel verifier if enabled,
- // otherwise it is empty.
- VerifierLog string
-
- fd *internal.FD
- name string
- abi ProgramABI
- attachType AttachType
-}
-
-// NewProgram creates a new Program.
-//
-// Loading a program for the first time will perform
-// feature detection by loading small, temporary programs.
-func NewProgram(spec *ProgramSpec) (*Program, error) {
- return NewProgramWithOptions(spec, ProgramOptions{})
-}
-
-// NewProgramWithOptions creates a new Program.
-//
-// Loading a program for the first time will perform
-// feature detection by loading small, temporary programs.
-func NewProgramWithOptions(spec *ProgramSpec, opts ProgramOptions) (*Program, error) {
- if spec.BTF == nil {
- return newProgramWithBTF(spec, nil, opts)
- }
-
- handle, err := btf.NewHandle(btf.ProgramSpec(spec.BTF))
- if err != nil && !errors.Is(err, btf.ErrNotSupported) {
- return nil, fmt.Errorf("can't load BTF: %w", err)
- }
-
- return newProgramWithBTF(spec, handle, opts)
-}
-
-func newProgramWithBTF(spec *ProgramSpec, btf *btf.Handle, opts ProgramOptions) (*Program, error) {
- attr, err := convertProgramSpec(spec, btf)
- if err != nil {
- return nil, err
- }
-
- logSize := DefaultVerifierLogSize
- if opts.LogSize > 0 {
- logSize = opts.LogSize
- }
-
- var logBuf []byte
- if opts.LogLevel > 0 {
- logBuf = make([]byte, logSize)
- attr.logLevel = opts.LogLevel
- attr.logSize = uint32(len(logBuf))
- attr.logBuf = internal.NewSlicePointer(logBuf)
- }
-
- fd, err := bpfProgLoad(attr)
- if err == nil {
- prog := newProgram(fd, spec.Name, &ProgramABI{spec.Type})
- prog.VerifierLog = internal.CString(logBuf)
- return prog, nil
- }
-
- logErr := err
- if opts.LogLevel == 0 {
- // Re-run with the verifier enabled to get better error messages.
- logBuf = make([]byte, logSize)
- attr.logLevel = 1
- attr.logSize = uint32(len(logBuf))
- attr.logBuf = internal.NewSlicePointer(logBuf)
-
- _, logErr = bpfProgLoad(attr)
- }
-
- err = internal.ErrorWithLog(err, logBuf, logErr)
- return nil, fmt.Errorf("can't load program: %w", err)
-}
-
-// NewProgramFromFD creates a program from a raw fd.
-//
-// You should not use fd after calling this function.
-//
-// Requires at least Linux 4.11.
-func NewProgramFromFD(fd int) (*Program, error) {
- if fd < 0 {
- return nil, errors.New("invalid fd")
- }
- bpfFd := internal.NewFD(uint32(fd))
-
- name, abi, err := newProgramABIFromFd(bpfFd)
- if err != nil {
- bpfFd.Forget()
- return nil, err
- }
-
- return newProgram(bpfFd, name, abi), nil
-}
-
-func newProgram(fd *internal.FD, name string, abi *ProgramABI) *Program {
- return &Program{
- name: name,
- fd: fd,
- abi: *abi,
- }
-}
-
-func convertProgramSpec(spec *ProgramSpec, handle *btf.Handle) (*bpfProgLoadAttr, error) {
- if len(spec.Instructions) == 0 {
- return nil, errors.New("Instructions cannot be empty")
- }
-
- if len(spec.License) == 0 {
- return nil, errors.New("License cannot be empty")
- }
-
- if spec.ByteOrder != nil && spec.ByteOrder != internal.NativeEndian {
- return nil, fmt.Errorf("can't load %s program on %s", spec.ByteOrder, internal.NativeEndian)
- }
-
- buf := bytes.NewBuffer(make([]byte, 0, len(spec.Instructions)*asm.InstructionSize))
- err := spec.Instructions.Marshal(buf, internal.NativeEndian)
- if err != nil {
- return nil, err
- }
-
- bytecode := buf.Bytes()
- insCount := uint32(len(bytecode) / asm.InstructionSize)
- attr := &bpfProgLoadAttr{
- progType: spec.Type,
- expectedAttachType: spec.AttachType,
- insCount: insCount,
- instructions: internal.NewSlicePointer(bytecode),
- license: internal.NewStringPointer(spec.License),
- kernelVersion: spec.KernelVersion,
- }
-
- if haveObjName() == nil {
- attr.progName = newBPFObjName(spec.Name)
- }
-
- if handle != nil && spec.BTF != nil {
- attr.progBTFFd = uint32(handle.FD())
-
- recSize, bytes, err := btf.ProgramLineInfos(spec.BTF)
- if err != nil {
- return nil, fmt.Errorf("can't get BTF line infos: %w", err)
- }
- attr.lineInfoRecSize = recSize
- attr.lineInfoCnt = uint32(uint64(len(bytes)) / uint64(recSize))
- attr.lineInfo = internal.NewSlicePointer(bytes)
-
- recSize, bytes, err = btf.ProgramFuncInfos(spec.BTF)
- if err != nil {
- return nil, fmt.Errorf("can't get BTF function infos: %w", err)
- }
- attr.funcInfoRecSize = recSize
- attr.funcInfoCnt = uint32(uint64(len(bytes)) / uint64(recSize))
- attr.funcInfo = internal.NewSlicePointer(bytes)
- }
-
- if spec.AttachTo != "" {
- target, err := resolveBTFType(spec.AttachTo, spec.Type, spec.AttachType)
- if err != nil {
- return nil, err
- }
- if target != nil {
- attr.attachBTFID = target.ID()
- }
- }
-
- return attr, nil
-}
-
-func (p *Program) String() string {
- if p.name != "" {
- return fmt.Sprintf("%s(%s)#%v", p.abi.Type, p.name, p.fd)
- }
- return fmt.Sprintf("%s#%v", p.abi.Type, p.fd)
-}
-
-// ABI gets the ABI of the Program
-func (p *Program) ABI() ProgramABI {
- return p.abi
-}
-
-// FD gets the file descriptor of the Program.
-//
-// It is invalid to call this function after Close has been called.
-func (p *Program) FD() int {
- fd, err := p.fd.Value()
- if err != nil {
- // Best effort: -1 is the number most likely to be an
- // invalid file descriptor.
- return -1
- }
-
- return int(fd)
-}
-
-// Clone creates a duplicate of the Program.
-//
-// Closing the duplicate does not affect the original, and vice versa.
-//
-// Cloning a nil Program returns nil.
-func (p *Program) Clone() (*Program, error) {
- if p == nil {
- return nil, nil
- }
-
- dup, err := p.fd.Dup()
- if err != nil {
- return nil, fmt.Errorf("can't clone program: %w", err)
- }
-
- return newProgram(dup, p.name, &p.abi), nil
-}
-
-// Pin persists the Program past the lifetime of the process that created it
-//
-// This requires bpffs to be mounted above fileName. See http://cilium.readthedocs.io/en/doc-1.0/kubernetes/install/#mounting-the-bpf-fs-optional
-func (p *Program) Pin(fileName string) error {
- if err := internal.BPFObjPin(fileName, p.fd); err != nil {
- return fmt.Errorf("can't pin program: %w", err)
- }
- return nil
-}
-
-// Close unloads the program from the kernel.
-func (p *Program) Close() error {
- if p == nil {
- return nil
- }
-
- return p.fd.Close()
-}
-
-// Test runs the Program in the kernel with the given input and returns the
-// value returned by the eBPF program. outLen may be zero.
-//
-// Note: the kernel expects at least 14 bytes input for an ethernet header for
-// XDP and SKB programs.
-//
-// This function requires at least Linux 4.12.
-func (p *Program) Test(in []byte) (uint32, []byte, error) {
- ret, out, _, err := p.testRun(in, 1, nil)
- if err != nil {
- return ret, nil, fmt.Errorf("can't test program: %w", err)
- }
- return ret, out, nil
-}
-
-// Benchmark runs the Program with the given input for a number of times
-// and returns the time taken per iteration.
-//
-// Returns the result of the last execution of the program and the time per
-// run or an error. reset is called whenever the benchmark syscall is
-// interrupted, and should be set to testing.B.ResetTimer or similar.
-//
-// Note: profiling a call to this function will skew it's results, see
-// https://github.com/cilium/ebpf/issues/24
-//
-// This function requires at least Linux 4.12.
-func (p *Program) Benchmark(in []byte, repeat int, reset func()) (uint32, time.Duration, error) {
- ret, _, total, err := p.testRun(in, repeat, reset)
- if err != nil {
- return ret, total, fmt.Errorf("can't benchmark program: %w", err)
- }
- return ret, total, nil
-}
-
-var haveProgTestRun = internal.FeatureTest("BPF_PROG_TEST_RUN", "4.12", func() (bool, error) {
- prog, err := NewProgram(&ProgramSpec{
- Type: SocketFilter,
- Instructions: asm.Instructions{
- asm.LoadImm(asm.R0, 0, asm.DWord),
- asm.Return(),
- },
- License: "MIT",
- })
- if err != nil {
- // This may be because we lack sufficient permissions, etc.
- return false, err
- }
- defer prog.Close()
-
- // Programs require at least 14 bytes input
- in := make([]byte, 14)
- attr := bpfProgTestRunAttr{
- fd: uint32(prog.FD()),
- dataSizeIn: uint32(len(in)),
- dataIn: internal.NewSlicePointer(in),
- }
-
- err = bpfProgTestRun(&attr)
-
- // Check for EINVAL specifically, rather than err != nil since we
- // otherwise misdetect due to insufficient permissions.
- return !errors.Is(err, unix.EINVAL), nil
-})
-
-func (p *Program) testRun(in []byte, repeat int, reset func()) (uint32, []byte, time.Duration, error) {
- if uint(repeat) > math.MaxUint32 {
- return 0, nil, 0, fmt.Errorf("repeat is too high")
- }
-
- if len(in) == 0 {
- return 0, nil, 0, fmt.Errorf("missing input")
- }
-
- if uint(len(in)) > math.MaxUint32 {
- return 0, nil, 0, fmt.Errorf("input is too long")
- }
-
- if err := haveProgTestRun(); err != nil {
- return 0, nil, 0, err
- }
-
- // Older kernels ignore the dataSizeOut argument when copying to user space.
- // Combined with things like bpf_xdp_adjust_head() we don't really know what the final
- // size will be. Hence we allocate an output buffer which we hope will always be large
- // enough, and panic if the kernel wrote past the end of the allocation.
- // See https://patchwork.ozlabs.org/cover/1006822/
- out := make([]byte, len(in)+outputPad)
-
- fd, err := p.fd.Value()
- if err != nil {
- return 0, nil, 0, err
- }
-
- attr := bpfProgTestRunAttr{
- fd: fd,
- dataSizeIn: uint32(len(in)),
- dataSizeOut: uint32(len(out)),
- dataIn: internal.NewSlicePointer(in),
- dataOut: internal.NewSlicePointer(out),
- repeat: uint32(repeat),
- }
-
- for {
- err = bpfProgTestRun(&attr)
- if err == nil {
- break
- }
-
- if errors.Is(err, unix.EINTR) {
- if reset != nil {
- reset()
- }
- continue
- }
-
- return 0, nil, 0, fmt.Errorf("can't run test: %w", err)
- }
-
- if int(attr.dataSizeOut) > cap(out) {
- // Houston, we have a problem. The program created more data than we allocated,
- // and the kernel wrote past the end of our buffer.
- panic("kernel wrote past end of output buffer")
- }
- out = out[:int(attr.dataSizeOut)]
-
- total := time.Duration(attr.duration) * time.Nanosecond
- return attr.retval, out, total, nil
-}
-
-func unmarshalProgram(buf []byte) (*Program, error) {
- if len(buf) != 4 {
- return nil, errors.New("program id requires 4 byte value")
- }
-
- // Looking up an entry in a nested map or prog array returns an id,
- // not an fd.
- id := internal.NativeEndian.Uint32(buf)
- return NewProgramFromID(ProgramID(id))
-}
-
-// MarshalBinary implements BinaryMarshaler.
-func (p *Program) MarshalBinary() ([]byte, error) {
- value, err := p.fd.Value()
- if err != nil {
- return nil, err
- }
-
- buf := make([]byte, 4)
- internal.NativeEndian.PutUint32(buf, value)
- return buf, nil
-}
-
-// Attach a Program.
-//
-// Deprecated: use link.RawAttachProgram instead.
-func (p *Program) Attach(fd int, typ AttachType, flags AttachFlags) error {
- if fd < 0 {
- return errors.New("invalid fd")
- }
-
- pfd, err := p.fd.Value()
- if err != nil {
- return err
- }
-
- attr := internal.BPFProgAttachAttr{
- TargetFd: uint32(fd),
- AttachBpfFd: pfd,
- AttachType: uint32(typ),
- AttachFlags: uint32(flags),
- }
-
- return internal.BPFProgAttach(&attr)
-}
-
-// Detach a Program.
-//
-// Deprecated: use link.RawDetachProgram instead.
-func (p *Program) Detach(fd int, typ AttachType, flags AttachFlags) error {
- if fd < 0 {
- return errors.New("invalid fd")
- }
-
- if flags != 0 {
- return errors.New("flags must be zero")
- }
-
- pfd, err := p.fd.Value()
- if err != nil {
- return err
- }
-
- attr := internal.BPFProgDetachAttr{
- TargetFd: uint32(fd),
- AttachBpfFd: pfd,
- AttachType: uint32(typ),
- }
-
- return internal.BPFProgDetach(&attr)
-}
-
-// LoadPinnedProgram loads a Program from a BPF file.
-//
-// Requires at least Linux 4.11.
-func LoadPinnedProgram(fileName string) (*Program, error) {
- fd, err := internal.BPFObjGet(fileName)
- if err != nil {
- return nil, err
- }
-
- name, abi, err := newProgramABIFromFd(fd)
- if err != nil {
- _ = fd.Close()
- return nil, fmt.Errorf("can't get ABI for %s: %w", fileName, err)
- }
-
- return newProgram(fd, name, abi), nil
-}
-
-// SanitizeName replaces all invalid characters in name.
-//
-// Use this to automatically generate valid names for maps and
-// programs at run time.
-//
-// Passing a negative value for replacement will delete characters
-// instead of replacing them.
-func SanitizeName(name string, replacement rune) string {
- return strings.Map(func(char rune) rune {
- if invalidBPFObjNameChar(char) {
- return replacement
- }
- return char
- }, name)
-}
-
-// ProgramGetNextID returns the ID of the next eBPF program.
-//
-// Returns ErrNotExist, if there is no next eBPF program.
-func ProgramGetNextID(startID ProgramID) (ProgramID, error) {
- id, err := objGetNextID(internal.BPF_PROG_GET_NEXT_ID, uint32(startID))
- return ProgramID(id), err
-}
-
-// NewProgramFromID returns the program for a given id.
-//
-// Returns ErrNotExist, if there is no eBPF program with the given id.
-func NewProgramFromID(id ProgramID) (*Program, error) {
- fd, err := bpfObjGetFDByID(internal.BPF_PROG_GET_FD_BY_ID, uint32(id))
- if err != nil {
- return nil, err
- }
-
- name, abi, err := newProgramABIFromFd(fd)
- if err != nil {
- _ = fd.Close()
- return nil, err
- }
-
- return newProgram(fd, name, abi), nil
-}
-
-// ID returns the systemwide unique ID of the program.
-func (p *Program) ID() (ProgramID, error) {
- info, err := bpfGetProgInfoByFD(p.fd)
- if err != nil {
- return ProgramID(0), err
- }
- return ProgramID(info.id), nil
-}
-
-func resolveBTFType(name string, progType ProgramType, attachType AttachType) (btf.Type, error) {
- kernel, err := btf.LoadKernelSpec()
- if err != nil {
- return nil, fmt.Errorf("can't resolve BTF type %s: %w", name, err)
- }
-
- type match struct {
- p ProgramType
- a AttachType
- }
-
- target := match{progType, attachType}
- switch target {
- case match{Tracing, AttachTraceIter}:
- var target btf.Func
- if err := kernel.FindType("bpf_iter_"+name, &target); err != nil {
- return nil, fmt.Errorf("can't resolve BTF for iterator %s: %w", name, err)
- }
-
- return &target, nil
-
- default:
- return nil, nil
- }
-}
diff --git a/vendor/github.com/cilium/ebpf/readme.md b/vendor/github.com/cilium/ebpf/readme.md
deleted file mode 100644
index cc8e89c75..000000000
--- a/vendor/github.com/cilium/ebpf/readme.md
+++ /dev/null
@@ -1,25 +0,0 @@
-eBPF
--------
-[](https://godoc.org/github.com/cilium/ebpf)
-
-eBPF is a pure Go library that provides utilities for loading, compiling, and debugging eBPF programs. It has minimal external dependencies and is intended to be used in long running processes.
-
-[ebpf/asm](https://godoc.org/github.com/cilium/ebpf/asm) contains a basic assembler.
-
-The library is maintained by [Cloudflare](https://www.cloudflare.com) and [Cilium](https://www.cilium.io). Feel free to [join](https://cilium.herokuapp.com/) the [libbpf-go](https://cilium.slack.com/messages/libbpf-go) channel on Slack.
-
-## Current status
-
-The package is production ready, but **the API is explicitly unstable
-right now**. Expect to update your code if you want to follow along.
-
-## Requirements
-
-* A version of Go that is [supported by upstream](https://golang.org/doc/devel/release.html#policy)
-* Linux 4.9, 4.19 or 5.4 (versions in-between should work, but are not tested)
-
-## Useful resources
-
-* [Cilium eBPF documentation](https://cilium.readthedocs.io/en/latest/bpf/#bpf-guide) (recommended)
-* [Linux documentation on BPF](http://elixir.free-electrons.com/linux/latest/source/Documentation/networking/filter.txt)
-* [eBPF features by Linux version](https://github.com/iovisor/bcc/blob/master/docs/kernel-versions.md)
diff --git a/vendor/github.com/cilium/ebpf/syscalls.go b/vendor/github.com/cilium/ebpf/syscalls.go
deleted file mode 100644
index 2b713d06a..000000000
--- a/vendor/github.com/cilium/ebpf/syscalls.go
+++ /dev/null
@@ -1,438 +0,0 @@
-package ebpf
-
-import (
- "errors"
- "fmt"
- "os"
- "unsafe"
-
- "github.com/cilium/ebpf/internal"
- "github.com/cilium/ebpf/internal/btf"
- "github.com/cilium/ebpf/internal/unix"
-)
-
-// Generic errors returned by BPF syscalls.
-var (
- ErrNotExist = errors.New("requested object does not exist")
-)
-
-// bpfObjName is a null-terminated string made up of
-// 'A-Za-z0-9_' characters.
-type bpfObjName [unix.BPF_OBJ_NAME_LEN]byte
-
-// newBPFObjName truncates the result if it is too long.
-func newBPFObjName(name string) bpfObjName {
- var result bpfObjName
- copy(result[:unix.BPF_OBJ_NAME_LEN-1], name)
- return result
-}
-
-func invalidBPFObjNameChar(char rune) bool {
- dotAllowed := objNameAllowsDot() == nil
-
- switch {
- case char >= 'A' && char <= 'Z':
- fallthrough
- case char >= 'a' && char <= 'z':
- fallthrough
- case char >= '0' && char <= '9':
- fallthrough
- case dotAllowed && char == '.':
- fallthrough
- case char == '_':
- return false
- default:
- return true
- }
-}
-
-type bpfMapCreateAttr struct {
- mapType MapType
- keySize uint32
- valueSize uint32
- maxEntries uint32
- flags uint32
- innerMapFd uint32 // since 4.12 56f668dfe00d
- numaNode uint32 // since 4.14 96eabe7a40aa
- mapName bpfObjName // since 4.15 ad5b177bd73f
- mapIfIndex uint32
- btfFd uint32
- btfKeyTypeID btf.TypeID
- btfValueTypeID btf.TypeID
-}
-
-type bpfMapOpAttr struct {
- mapFd uint32
- padding uint32
- key internal.Pointer
- value internal.Pointer
- flags uint64
-}
-
-type bpfMapInfo struct {
- mapType uint32
- id uint32
- keySize uint32
- valueSize uint32
- maxEntries uint32
- flags uint32
- mapName bpfObjName // since 4.15 ad5b177bd73f
-}
-
-type bpfProgLoadAttr struct {
- progType ProgramType
- insCount uint32
- instructions internal.Pointer
- license internal.Pointer
- logLevel uint32
- logSize uint32
- logBuf internal.Pointer
- kernelVersion uint32 // since 4.1 2541517c32be
- progFlags uint32 // since 4.11 e07b98d9bffe
- progName bpfObjName // since 4.15 067cae47771c
- progIfIndex uint32 // since 4.15 1f6f4cb7ba21
- expectedAttachType AttachType // since 4.17 5e43f899b03a
- progBTFFd uint32
- funcInfoRecSize uint32
- funcInfo internal.Pointer
- funcInfoCnt uint32
- lineInfoRecSize uint32
- lineInfo internal.Pointer
- lineInfoCnt uint32
- attachBTFID btf.TypeID
- attachProgFd uint32
-}
-
-type bpfProgInfo struct {
- progType uint32
- id uint32
- tag [unix.BPF_TAG_SIZE]byte
- jitedLen uint32
- xlatedLen uint32
- jited internal.Pointer
- xlated internal.Pointer
- loadTime uint64 // since 4.15 cb4d2b3f03d8
- createdByUID uint32
- nrMapIDs uint32
- mapIds internal.Pointer
- name bpfObjName
-}
-
-type bpfProgTestRunAttr struct {
- fd uint32
- retval uint32
- dataSizeIn uint32
- dataSizeOut uint32
- dataIn internal.Pointer
- dataOut internal.Pointer
- repeat uint32
- duration uint32
-}
-
-type bpfObjGetInfoByFDAttr struct {
- fd uint32
- infoLen uint32
- info internal.Pointer // May be either bpfMapInfo or bpfProgInfo
-}
-
-type bpfGetFDByIDAttr struct {
- id uint32
- next uint32
-}
-
-type bpfMapFreezeAttr struct {
- mapFd uint32
-}
-
-type bpfObjGetNextIDAttr struct {
- startID uint32
- nextID uint32
- openFlags uint32
-}
-
-func bpfProgLoad(attr *bpfProgLoadAttr) (*internal.FD, error) {
- for {
- fd, err := internal.BPF(internal.BPF_PROG_LOAD, unsafe.Pointer(attr), unsafe.Sizeof(*attr))
- // As of ~4.20 the verifier can be interrupted by a signal,
- // and returns EAGAIN in that case.
- if err == unix.EAGAIN {
- continue
- }
-
- if err != nil {
- return nil, err
- }
-
- return internal.NewFD(uint32(fd)), nil
- }
-}
-
-func bpfProgTestRun(attr *bpfProgTestRunAttr) error {
- _, err := internal.BPF(internal.BPF_PROG_TEST_RUN, unsafe.Pointer(attr), unsafe.Sizeof(*attr))
- return err
-}
-
-func bpfMapCreate(attr *bpfMapCreateAttr) (*internal.FD, error) {
- fd, err := internal.BPF(internal.BPF_MAP_CREATE, unsafe.Pointer(attr), unsafe.Sizeof(*attr))
- if errors.Is(err, os.ErrPermission) {
- return nil, errors.New("permission denied or insufficient rlimit to lock memory for map")
- }
-
- if err != nil {
- return nil, err
- }
-
- return internal.NewFD(uint32(fd)), nil
-}
-
-var haveNestedMaps = internal.FeatureTest("nested maps", "4.12", func() (bool, error) {
- inner, err := bpfMapCreate(&bpfMapCreateAttr{
- mapType: Array,
- keySize: 4,
- valueSize: 4,
- maxEntries: 1,
- })
- if err != nil {
- return false, err
- }
- defer inner.Close()
-
- innerFd, _ := inner.Value()
- nested, err := bpfMapCreate(&bpfMapCreateAttr{
- mapType: ArrayOfMaps,
- keySize: 4,
- valueSize: 4,
- maxEntries: 1,
- innerMapFd: innerFd,
- })
- if err != nil {
- return false, nil
- }
-
- _ = nested.Close()
- return true, nil
-})
-
-var haveMapMutabilityModifiers = internal.FeatureTest("read- and write-only maps", "5.2", func() (bool, error) {
- // This checks BPF_F_RDONLY_PROG and BPF_F_WRONLY_PROG. Since
- // BPF_MAP_FREEZE appeared in 5.2 as well we don't do a separate check.
- m, err := bpfMapCreate(&bpfMapCreateAttr{
- mapType: Array,
- keySize: 4,
- valueSize: 4,
- maxEntries: 1,
- flags: unix.BPF_F_RDONLY_PROG,
- })
- if err != nil {
- return false, nil
- }
- _ = m.Close()
- return true, nil
-})
-
-func bpfMapLookupElem(m *internal.FD, key, valueOut internal.Pointer) error {
- fd, err := m.Value()
- if err != nil {
- return err
- }
-
- attr := bpfMapOpAttr{
- mapFd: fd,
- key: key,
- value: valueOut,
- }
- _, err = internal.BPF(internal.BPF_MAP_LOOKUP_ELEM, unsafe.Pointer(&attr), unsafe.Sizeof(attr))
- return wrapMapError(err)
-}
-
-func bpfMapLookupAndDelete(m *internal.FD, key, valueOut internal.Pointer) error {
- fd, err := m.Value()
- if err != nil {
- return err
- }
-
- attr := bpfMapOpAttr{
- mapFd: fd,
- key: key,
- value: valueOut,
- }
- _, err = internal.BPF(internal.BPF_MAP_LOOKUP_AND_DELETE_ELEM, unsafe.Pointer(&attr), unsafe.Sizeof(attr))
- return wrapMapError(err)
-}
-
-func bpfMapUpdateElem(m *internal.FD, key, valueOut internal.Pointer, flags uint64) error {
- fd, err := m.Value()
- if err != nil {
- return err
- }
-
- attr := bpfMapOpAttr{
- mapFd: fd,
- key: key,
- value: valueOut,
- flags: flags,
- }
- _, err = internal.BPF(internal.BPF_MAP_UPDATE_ELEM, unsafe.Pointer(&attr), unsafe.Sizeof(attr))
- return wrapMapError(err)
-}
-
-func bpfMapDeleteElem(m *internal.FD, key internal.Pointer) error {
- fd, err := m.Value()
- if err != nil {
- return err
- }
-
- attr := bpfMapOpAttr{
- mapFd: fd,
- key: key,
- }
- _, err = internal.BPF(internal.BPF_MAP_DELETE_ELEM, unsafe.Pointer(&attr), unsafe.Sizeof(attr))
- return wrapMapError(err)
-}
-
-func bpfMapGetNextKey(m *internal.FD, key, nextKeyOut internal.Pointer) error {
- fd, err := m.Value()
- if err != nil {
- return err
- }
-
- attr := bpfMapOpAttr{
- mapFd: fd,
- key: key,
- value: nextKeyOut,
- }
- _, err = internal.BPF(internal.BPF_MAP_GET_NEXT_KEY, unsafe.Pointer(&attr), unsafe.Sizeof(attr))
- return wrapMapError(err)
-}
-
-func objGetNextID(cmd internal.BPFCmd, start uint32) (uint32, error) {
- attr := bpfObjGetNextIDAttr{
- startID: start,
- }
- _, err := internal.BPF(cmd, unsafe.Pointer(&attr), unsafe.Sizeof(attr))
- return attr.nextID, wrapObjError(err)
-}
-
-func wrapObjError(err error) error {
- if err == nil {
- return nil
- }
- if errors.Is(err, unix.ENOENT) {
- return fmt.Errorf("%w", ErrNotExist)
- }
-
- return errors.New(err.Error())
-}
-
-func wrapMapError(err error) error {
- if err == nil {
- return nil
- }
-
- if errors.Is(err, unix.ENOENT) {
- return ErrKeyNotExist
- }
-
- if errors.Is(err, unix.EEXIST) {
- return ErrKeyExist
- }
-
- return errors.New(err.Error())
-}
-
-func bpfMapFreeze(m *internal.FD) error {
- fd, err := m.Value()
- if err != nil {
- return err
- }
-
- attr := bpfMapFreezeAttr{
- mapFd: fd,
- }
- _, err = internal.BPF(internal.BPF_MAP_FREEZE, unsafe.Pointer(&attr), unsafe.Sizeof(attr))
- return err
-}
-
-func bpfGetObjectInfoByFD(fd *internal.FD, info unsafe.Pointer, size uintptr) error {
- value, err := fd.Value()
- if err != nil {
- return err
- }
-
- // available from 4.13
- attr := bpfObjGetInfoByFDAttr{
- fd: value,
- infoLen: uint32(size),
- info: internal.NewPointer(info),
- }
- _, err = internal.BPF(internal.BPF_OBJ_GET_INFO_BY_FD, unsafe.Pointer(&attr), unsafe.Sizeof(attr))
- if err != nil {
- return fmt.Errorf("fd %d: %w", fd, err)
- }
- return nil
-}
-
-func bpfGetProgInfoByFD(fd *internal.FD) (*bpfProgInfo, error) {
- var info bpfProgInfo
- if err := bpfGetObjectInfoByFD(fd, unsafe.Pointer(&info), unsafe.Sizeof(info)); err != nil {
- return nil, fmt.Errorf("can't get program info: %w", err)
- }
- return &info, nil
-}
-
-func bpfGetMapInfoByFD(fd *internal.FD) (*bpfMapInfo, error) {
- var info bpfMapInfo
- err := bpfGetObjectInfoByFD(fd, unsafe.Pointer(&info), unsafe.Sizeof(info))
- if err != nil {
- return nil, fmt.Errorf("can't get map info: %w", err)
- }
- return &info, nil
-}
-
-var haveObjName = internal.FeatureTest("object names", "4.15", func() (bool, error) {
- attr := bpfMapCreateAttr{
- mapType: Array,
- keySize: 4,
- valueSize: 4,
- maxEntries: 1,
- mapName: newBPFObjName("feature_test"),
- }
-
- fd, err := bpfMapCreate(&attr)
- if err != nil {
- return false, nil
- }
-
- _ = fd.Close()
- return true, nil
-})
-
-var objNameAllowsDot = internal.FeatureTest("dot in object names", "5.2", func() (bool, error) {
- if err := haveObjName(); err != nil {
- return false, err
- }
-
- attr := bpfMapCreateAttr{
- mapType: Array,
- keySize: 4,
- valueSize: 4,
- maxEntries: 1,
- mapName: newBPFObjName(".test"),
- }
-
- fd, err := bpfMapCreate(&attr)
- if err != nil {
- return false, nil
- }
-
- _ = fd.Close()
- return true, nil
-})
-
-func bpfObjGetFDByID(cmd internal.BPFCmd, id uint32) (*internal.FD, error) {
- attr := bpfGetFDByIDAttr{
- id: id,
- }
- ptr, err := internal.BPF(cmd, unsafe.Pointer(&attr), unsafe.Sizeof(attr))
- return internal.NewFD(uint32(ptr)), wrapObjError(err)
-}
diff --git a/vendor/github.com/cilium/ebpf/types.go b/vendor/github.com/cilium/ebpf/types.go
deleted file mode 100644
index 1ffc62123..000000000
--- a/vendor/github.com/cilium/ebpf/types.go
+++ /dev/null
@@ -1,196 +0,0 @@
-package ebpf
-
-//go:generate stringer -output types_string.go -type=MapType,ProgramType,AttachType
-
-// MapType indicates the type map structure
-// that will be initialized in the kernel.
-type MapType uint32
-
-// All the various map types that can be created
-const (
- UnspecifiedMap MapType = iota
- // Hash is a hash map
- Hash
- // Array is an array map
- Array
- // ProgramArray - A program array map is a special kind of array map whose map
- // values contain only file descriptors referring to other eBPF
- // programs. Thus, both the key_size and value_size must be
- // exactly four bytes. This map is used in conjunction with the
- // TailCall helper.
- ProgramArray
- // PerfEventArray - A perf event array is used in conjunction with PerfEventRead
- // and PerfEventOutput calls, to read the raw bpf_perf_data from the registers.
- PerfEventArray
- // PerCPUHash - This data structure is useful for people who have high performance
- // network needs and can reconcile adds at the end of some cycle, so that
- // hashes can be lock free without the use of XAdd, which can be costly.
- PerCPUHash
- // PerCPUArray - This data structure is useful for people who have high performance
- // network needs and can reconcile adds at the end of some cycle, so that
- // hashes can be lock free without the use of XAdd, which can be costly.
- // Each CPU gets a copy of this hash, the contents of all of which can be reconciled
- // later.
- PerCPUArray
- // StackTrace - This holds whole user and kernel stack traces, it can be retrieved with
- // GetStackID
- StackTrace
- // CGroupArray - This is a very niche structure used to help SKBInCGroup determine
- // if an skb is from a socket belonging to a specific cgroup
- CGroupArray
- // LRUHash - This allows you to create a small hash structure that will purge the
- // least recently used items rather than thow an error when you run out of memory
- LRUHash
- // LRUCPUHash - This is NOT like PerCPUHash, this structure is shared among the CPUs,
- // it has more to do with including the CPU id with the LRU calculation so that if a
- // particular CPU is using a value over-and-over again, then it will be saved, but if
- // a value is being retrieved a lot but sparsely across CPUs it is not as important, basically
- // giving weight to CPU locality over overall usage.
- LRUCPUHash
- // LPMTrie - This is an implementation of Longest-Prefix-Match Trie structure. It is useful,
- // for storing things like IP addresses which can be bit masked allowing for keys of differing
- // values to refer to the same reference based on their masks. See wikipedia for more details.
- LPMTrie
- // ArrayOfMaps - Each item in the array is another map. The inner map mustn't be a map of maps
- // itself.
- ArrayOfMaps
- // HashOfMaps - Each item in the hash map is another map. The inner map mustn't be a map of maps
- // itself.
- HashOfMaps
- // DevMap - Specialized map to store references to network devices.
- DevMap
- // SockMap - Specialized map to store references to sockets.
- SockMap
- // CPUMap - Specialized map to store references to CPUs.
- CPUMap
- // XSKMap - Specialized map for XDP programs to store references to open sockets.
- XSKMap
- // SockHash - Specialized hash to store references to sockets.
- SockHash
- // CGroupStorage - Special map for CGroups.
- CGroupStorage
- // ReusePortSockArray - Specialized map to store references to sockets that can be reused.
- ReusePortSockArray
- // PerCPUCGroupStorage - Special per CPU map for CGroups.
- PerCPUCGroupStorage
- // Queue - FIFO storage for BPF programs.
- Queue
- // Stack - LIFO storage for BPF programs.
- Stack
- // SkStorage - Specialized map for local storage at SK for BPF programs.
- SkStorage
- // DevMapHash - Hash-based indexing scheme for references to network devices.
- DevMapHash
-)
-
-// hasPerCPUValue returns true if the Map stores a value per CPU.
-func (mt MapType) hasPerCPUValue() bool {
- if mt == PerCPUHash || mt == PerCPUArray || mt == LRUCPUHash {
- return true
- }
- return false
-}
-
-// ProgramType of the eBPF program
-type ProgramType uint32
-
-// eBPF program types
-const (
- // Unrecognized program type
- UnspecifiedProgram ProgramType = iota
- // SocketFilter socket or seccomp filter
- SocketFilter
- // Kprobe program
- Kprobe
- // SchedCLS traffic control shaper
- SchedCLS
- // SchedACT routing control shaper
- SchedACT
- // TracePoint program
- TracePoint
- // XDP program
- XDP
- // PerfEvent program
- PerfEvent
- // CGroupSKB program
- CGroupSKB
- // CGroupSock program
- CGroupSock
- // LWTIn program
- LWTIn
- // LWTOut program
- LWTOut
- // LWTXmit program
- LWTXmit
- // SockOps program
- SockOps
- // SkSKB program
- SkSKB
- // CGroupDevice program
- CGroupDevice
- // SkMsg program
- SkMsg
- // RawTracepoint program
- RawTracepoint
- // CGroupSockAddr program
- CGroupSockAddr
- // LWTSeg6Local program
- LWTSeg6Local
- // LircMode2 program
- LircMode2
- // SkReuseport program
- SkReuseport
- // FlowDissector program
- FlowDissector
- // CGroupSysctl program
- CGroupSysctl
- // RawTracepointWritable program
- RawTracepointWritable
- // CGroupSockopt program
- CGroupSockopt
- // Tracing program
- Tracing
-)
-
-// AttachType of the eBPF program, needed to differentiate allowed context accesses in
-// some newer program types like CGroupSockAddr. Should be set to AttachNone if not required.
-// Will cause invalid argument (EINVAL) at program load time if set incorrectly.
-type AttachType uint32
-
-// AttachNone is an alias for AttachCGroupInetIngress for readability reasons
-const AttachNone AttachType = 0
-
-const (
- AttachCGroupInetIngress AttachType = iota
- AttachCGroupInetEgress
- AttachCGroupInetSockCreate
- AttachCGroupSockOps
- AttachSkSKBStreamParser
- AttachSkSKBStreamVerdict
- AttachCGroupDevice
- AttachSkMsgVerdict
- AttachCGroupInet4Bind
- AttachCGroupInet6Bind
- AttachCGroupInet4Connect
- AttachCGroupInet6Connect
- AttachCGroupInet4PostBind
- AttachCGroupInet6PostBind
- AttachCGroupUDP4Sendmsg
- AttachCGroupUDP6Sendmsg
- AttachLircMode2
- AttachFlowDissector
- AttachCGroupSysctl
- AttachCGroupUDP4Recvmsg
- AttachCGroupUDP6Recvmsg
- AttachCGroupGetsockopt
- AttachCGroupSetsockopt
- AttachTraceRawTp
- AttachTraceFEntry
- AttachTraceFExit
- AttachModifyReturn
- AttachLSMMac
- AttachTraceIter
-)
-
-// AttachFlags of the eBPF program used in BPF_PROG_ATTACH command
-type AttachFlags uint32
diff --git a/vendor/github.com/cilium/ebpf/types_string.go b/vendor/github.com/cilium/ebpf/types_string.go
deleted file mode 100644
index c7139578e..000000000
--- a/vendor/github.com/cilium/ebpf/types_string.go
+++ /dev/null
@@ -1,137 +0,0 @@
-// Code generated by "stringer -output types_string.go -type=MapType,ProgramType,AttachType"; DO NOT EDIT.
-
-package ebpf
-
-import "strconv"
-
-func _() {
- // An "invalid array index" compiler error signifies that the constant values have changed.
- // Re-run the stringer command to generate them again.
- var x [1]struct{}
- _ = x[UnspecifiedMap-0]
- _ = x[Hash-1]
- _ = x[Array-2]
- _ = x[ProgramArray-3]
- _ = x[PerfEventArray-4]
- _ = x[PerCPUHash-5]
- _ = x[PerCPUArray-6]
- _ = x[StackTrace-7]
- _ = x[CGroupArray-8]
- _ = x[LRUHash-9]
- _ = x[LRUCPUHash-10]
- _ = x[LPMTrie-11]
- _ = x[ArrayOfMaps-12]
- _ = x[HashOfMaps-13]
- _ = x[DevMap-14]
- _ = x[SockMap-15]
- _ = x[CPUMap-16]
- _ = x[XSKMap-17]
- _ = x[SockHash-18]
- _ = x[CGroupStorage-19]
- _ = x[ReusePortSockArray-20]
- _ = x[PerCPUCGroupStorage-21]
- _ = x[Queue-22]
- _ = x[Stack-23]
- _ = x[SkStorage-24]
- _ = x[DevMapHash-25]
-}
-
-const _MapType_name = "UnspecifiedMapHashArrayProgramArrayPerfEventArrayPerCPUHashPerCPUArrayStackTraceCGroupArrayLRUHashLRUCPUHashLPMTrieArrayOfMapsHashOfMapsDevMapSockMapCPUMapXSKMapSockHashCGroupStorageReusePortSockArrayPerCPUCGroupStorageQueueStackSkStorageDevMapHash"
-
-var _MapType_index = [...]uint8{0, 14, 18, 23, 35, 49, 59, 70, 80, 91, 98, 108, 115, 126, 136, 142, 149, 155, 161, 169, 182, 200, 219, 224, 229, 238, 248}
-
-func (i MapType) String() string {
- if i >= MapType(len(_MapType_index)-1) {
- return "MapType(" + strconv.FormatInt(int64(i), 10) + ")"
- }
- return _MapType_name[_MapType_index[i]:_MapType_index[i+1]]
-}
-func _() {
- // An "invalid array index" compiler error signifies that the constant values have changed.
- // Re-run the stringer command to generate them again.
- var x [1]struct{}
- _ = x[UnspecifiedProgram-0]
- _ = x[SocketFilter-1]
- _ = x[Kprobe-2]
- _ = x[SchedCLS-3]
- _ = x[SchedACT-4]
- _ = x[TracePoint-5]
- _ = x[XDP-6]
- _ = x[PerfEvent-7]
- _ = x[CGroupSKB-8]
- _ = x[CGroupSock-9]
- _ = x[LWTIn-10]
- _ = x[LWTOut-11]
- _ = x[LWTXmit-12]
- _ = x[SockOps-13]
- _ = x[SkSKB-14]
- _ = x[CGroupDevice-15]
- _ = x[SkMsg-16]
- _ = x[RawTracepoint-17]
- _ = x[CGroupSockAddr-18]
- _ = x[LWTSeg6Local-19]
- _ = x[LircMode2-20]
- _ = x[SkReuseport-21]
- _ = x[FlowDissector-22]
- _ = x[CGroupSysctl-23]
- _ = x[RawTracepointWritable-24]
- _ = x[CGroupSockopt-25]
- _ = x[Tracing-26]
-}
-
-const _ProgramType_name = "UnspecifiedProgramSocketFilterKprobeSchedCLSSchedACTTracePointXDPPerfEventCGroupSKBCGroupSockLWTInLWTOutLWTXmitSockOpsSkSKBCGroupDeviceSkMsgRawTracepointCGroupSockAddrLWTSeg6LocalLircMode2SkReuseportFlowDissectorCGroupSysctlRawTracepointWritableCGroupSockoptTracing"
-
-var _ProgramType_index = [...]uint16{0, 18, 30, 36, 44, 52, 62, 65, 74, 83, 93, 98, 104, 111, 118, 123, 135, 140, 153, 167, 179, 188, 199, 212, 224, 245, 258, 265}
-
-func (i ProgramType) String() string {
- if i >= ProgramType(len(_ProgramType_index)-1) {
- return "ProgramType(" + strconv.FormatInt(int64(i), 10) + ")"
- }
- return _ProgramType_name[_ProgramType_index[i]:_ProgramType_index[i+1]]
-}
-func _() {
- // An "invalid array index" compiler error signifies that the constant values have changed.
- // Re-run the stringer command to generate them again.
- var x [1]struct{}
- _ = x[AttachNone-0]
- _ = x[AttachCGroupInetIngress-0]
- _ = x[AttachCGroupInetEgress-1]
- _ = x[AttachCGroupInetSockCreate-2]
- _ = x[AttachCGroupSockOps-3]
- _ = x[AttachSkSKBStreamParser-4]
- _ = x[AttachSkSKBStreamVerdict-5]
- _ = x[AttachCGroupDevice-6]
- _ = x[AttachSkMsgVerdict-7]
- _ = x[AttachCGroupInet4Bind-8]
- _ = x[AttachCGroupInet6Bind-9]
- _ = x[AttachCGroupInet4Connect-10]
- _ = x[AttachCGroupInet6Connect-11]
- _ = x[AttachCGroupInet4PostBind-12]
- _ = x[AttachCGroupInet6PostBind-13]
- _ = x[AttachCGroupUDP4Sendmsg-14]
- _ = x[AttachCGroupUDP6Sendmsg-15]
- _ = x[AttachLircMode2-16]
- _ = x[AttachFlowDissector-17]
- _ = x[AttachCGroupSysctl-18]
- _ = x[AttachCGroupUDP4Recvmsg-19]
- _ = x[AttachCGroupUDP6Recvmsg-20]
- _ = x[AttachCGroupGetsockopt-21]
- _ = x[AttachCGroupSetsockopt-22]
- _ = x[AttachTraceRawTp-23]
- _ = x[AttachTraceFEntry-24]
- _ = x[AttachTraceFExit-25]
- _ = x[AttachModifyReturn-26]
- _ = x[AttachLSMMac-27]
- _ = x[AttachTraceIter-28]
-}
-
-const _AttachType_name = "AttachNoneAttachCGroupInetEgressAttachCGroupInetSockCreateAttachCGroupSockOpsAttachSkSKBStreamParserAttachSkSKBStreamVerdictAttachCGroupDeviceAttachSkMsgVerdictAttachCGroupInet4BindAttachCGroupInet6BindAttachCGroupInet4ConnectAttachCGroupInet6ConnectAttachCGroupInet4PostBindAttachCGroupInet6PostBindAttachCGroupUDP4SendmsgAttachCGroupUDP6SendmsgAttachLircMode2AttachFlowDissectorAttachCGroupSysctlAttachCGroupUDP4RecvmsgAttachCGroupUDP6RecvmsgAttachCGroupGetsockoptAttachCGroupSetsockoptAttachTraceRawTpAttachTraceFEntryAttachTraceFExitAttachModifyReturnAttachLSMMacAttachTraceIter"
-
-var _AttachType_index = [...]uint16{0, 10, 32, 58, 77, 100, 124, 142, 160, 181, 202, 226, 250, 275, 300, 323, 346, 361, 380, 398, 421, 444, 466, 488, 504, 521, 537, 555, 567, 582}
-
-func (i AttachType) String() string {
- if i >= AttachType(len(_AttachType_index)-1) {
- return "AttachType(" + strconv.FormatInt(int64(i), 10) + ")"
- }
- return _AttachType_name[_AttachType_index[i]:_AttachType_index[i+1]]
-}
diff --git a/vendor/github.com/containerd/cgroups/LICENSE b/vendor/github.com/containerd/cgroups/LICENSE
deleted file mode 100644
index 261eeb9e9..000000000
--- a/vendor/github.com/containerd/cgroups/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/vendor/github.com/containerd/cgroups/README.md b/vendor/github.com/containerd/cgroups/README.md
deleted file mode 100644
index d4b09f3d6..000000000
--- a/vendor/github.com/containerd/cgroups/README.md
+++ /dev/null
@@ -1,149 +0,0 @@
-# cgroups
-
-[](https://github.com/containerd/cgroups/actions?query=workflow%3ACI)
-[](https://codecov.io/gh/containerd/cgroups)
-[](https://godoc.org/github.com/containerd/cgroups)
-[](https://goreportcard.com/report/github.com/containerd/cgroups)
-
-Go package for creating, managing, inspecting, and destroying cgroups.
-The resources format for settings on the cgroup uses the OCI runtime-spec found
-[here](https://github.com/opencontainers/runtime-spec).
-
-## Examples
-
-### Create a new cgroup
-
-This creates a new cgroup using a static path for all subsystems under `/test`.
-
-* /sys/fs/cgroup/cpu/test
-* /sys/fs/cgroup/memory/test
-* etc....
-
-It uses a single hierarchy and specifies cpu shares as a resource constraint and
-uses the v1 implementation of cgroups.
-
-
-```go
-shares := uint64(100)
-control, err := cgroups.New(cgroups.V1, cgroups.StaticPath("/test"), &specs.LinuxResources{
- CPU: &specs.CPU{
- Shares: &shares,
- },
-})
-defer control.Delete()
-```
-
-### Create with systemd slice support
-
-
-```go
-control, err := cgroups.New(cgroups.Systemd, cgroups.Slice("system.slice", "runc-test"), &specs.LinuxResources{
- CPU: &specs.CPU{
- Shares: &shares,
- },
-})
-
-```
-
-### Load an existing cgroup
-
-```go
-control, err = cgroups.Load(cgroups.V1, cgroups.StaticPath("/test"))
-```
-
-### Add a process to the cgroup
-
-```go
-if err := control.Add(cgroups.Process{Pid:1234}); err != nil {
-}
-```
-
-### Update the cgroup
-
-To update the resources applied in the cgroup
-
-```go
-shares = uint64(200)
-if err := control.Update(&specs.LinuxResources{
- CPU: &specs.LinuxCPU{
- Shares: &shares,
- },
-}); err != nil {
-}
-```
-
-### Freeze and Thaw the cgroup
-
-```go
-if err := control.Freeze(); err != nil {
-}
-if err := control.Thaw(); err != nil {
-}
-```
-
-### List all processes in the cgroup or recursively
-
-```go
-processes, err := control.Processes(cgroups.Devices, recursive)
-```
-
-### Get Stats on the cgroup
-
-```go
-stats, err := control.Stat()
-```
-
-By adding `cgroups.IgnoreNotExist` all non-existent files will be ignored, e.g. swap memory stats without swap enabled
-```go
-stats, err := control.Stat(cgroups.IgnoreNotExist)
-```
-
-### Move process across cgroups
-
-This allows you to take processes from one cgroup and move them to another.
-
-```go
-err := control.MoveTo(destination)
-```
-
-### Create subcgroup
-
-```go
-subCgroup, err := control.New("child", resources)
-```
-
-### Registering for memory events
-
-This allows you to get notified by an eventfd for v1 memory cgroups events.
-
-```go
-event := cgroups.MemoryThresholdEvent(50 * 1024 * 1024, false)
-efd, err := control.RegisterMemoryEvent(event)
-```
-
-```go
-event := cgroups.MemoryPressureEvent(cgroups.MediumPressure, cgroups.DefaultMode)
-efd, err := control.RegisterMemoryEvent(event)
-```
-
-```go
-efd, err := control.OOMEventFD()
-// or by using RegisterMemoryEvent
-event := cgroups.OOMEvent()
-efd, err := control.RegisterMemoryEvent(event)
-```
-
-### Attention
-
-All static path should not include `/sys/fs/cgroup/` prefix, it should start with your own cgroups name
-
-## Project details
-
-Cgroups is a containerd sub-project, licensed under the [Apache 2.0 license](./LICENSE).
-As a containerd sub-project, you will find the:
-
- * [Project governance](https://github.com/containerd/project/blob/master/GOVERNANCE.md),
- * [Maintainers](https://github.com/containerd/project/blob/master/MAINTAINERS),
- * and [Contributing guidelines](https://github.com/containerd/project/blob/master/CONTRIBUTING.md)
-
-information in our [`containerd/project`](https://github.com/containerd/project) repository.
diff --git a/vendor/github.com/containerd/cgroups/blkio.go b/vendor/github.com/containerd/cgroups/blkio.go
deleted file mode 100644
index a837e19fb..000000000
--- a/vendor/github.com/containerd/cgroups/blkio.go
+++ /dev/null
@@ -1,358 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cgroups
-
-import (
- "bufio"
- "fmt"
- "io"
- "os"
- "path/filepath"
- "strconv"
- "strings"
-
- v1 "github.com/containerd/cgroups/stats/v1"
- specs "github.com/opencontainers/runtime-spec/specs-go"
-)
-
-// NewBlkio returns a Blkio controller given the root folder of cgroups.
-// It may optionally accept other configuration options, such as ProcRoot(path)
-func NewBlkio(root string, options ...func(controller *blkioController)) *blkioController {
- ctrl := &blkioController{
- root: filepath.Join(root, string(Blkio)),
- procRoot: "/proc",
- }
- for _, opt := range options {
- opt(ctrl)
- }
- return ctrl
-}
-
-// ProcRoot overrides the default location of the "/proc" filesystem
-func ProcRoot(path string) func(controller *blkioController) {
- return func(c *blkioController) {
- c.procRoot = path
- }
-}
-
-type blkioController struct {
- root string
- procRoot string
-}
-
-func (b *blkioController) Name() Name {
- return Blkio
-}
-
-func (b *blkioController) Path(path string) string {
- return filepath.Join(b.root, path)
-}
-
-func (b *blkioController) Create(path string, resources *specs.LinuxResources) error {
- if err := os.MkdirAll(b.Path(path), defaultDirPerm); err != nil {
- return err
- }
- if resources.BlockIO == nil {
- return nil
- }
- for _, t := range createBlkioSettings(resources.BlockIO) {
- if t.value != nil {
- if err := retryingWriteFile(
- filepath.Join(b.Path(path), "blkio."+t.name),
- t.format(t.value),
- defaultFilePerm,
- ); err != nil {
- return err
- }
- }
- }
- return nil
-}
-
-func (b *blkioController) Update(path string, resources *specs.LinuxResources) error {
- return b.Create(path, resources)
-}
-
-func (b *blkioController) Stat(path string, stats *v1.Metrics) error {
- stats.Blkio = &v1.BlkIOStat{}
-
- var settings []blkioStatSettings
-
- // Try to read CFQ stats available on all CFQ enabled kernels first
- if _, err := os.Lstat(filepath.Join(b.Path(path), "blkio.io_serviced_recursive")); err == nil {
- settings = []blkioStatSettings{
- {
- name: "sectors_recursive",
- entry: &stats.Blkio.SectorsRecursive,
- },
- {
- name: "io_service_bytes_recursive",
- entry: &stats.Blkio.IoServiceBytesRecursive,
- },
- {
- name: "io_serviced_recursive",
- entry: &stats.Blkio.IoServicedRecursive,
- },
- {
- name: "io_queued_recursive",
- entry: &stats.Blkio.IoQueuedRecursive,
- },
- {
- name: "io_service_time_recursive",
- entry: &stats.Blkio.IoServiceTimeRecursive,
- },
- {
- name: "io_wait_time_recursive",
- entry: &stats.Blkio.IoWaitTimeRecursive,
- },
- {
- name: "io_merged_recursive",
- entry: &stats.Blkio.IoMergedRecursive,
- },
- {
- name: "time_recursive",
- entry: &stats.Blkio.IoTimeRecursive,
- },
- }
- }
-
- f, err := os.Open(filepath.Join(b.procRoot, "diskstats"))
- if err != nil {
- return err
- }
- defer f.Close()
-
- devices, err := getDevices(f)
- if err != nil {
- return err
- }
-
- var size int
- for _, t := range settings {
- if err := b.readEntry(devices, path, t.name, t.entry); err != nil {
- return err
- }
- size += len(*t.entry)
- }
- if size > 0 {
- return nil
- }
-
- // Even the kernel is compiled with the CFQ scheduler, the cgroup may not use
- // block devices with the CFQ scheduler. If so, we should fallback to throttle.* files.
- settings = []blkioStatSettings{
- {
- name: "throttle.io_serviced",
- entry: &stats.Blkio.IoServicedRecursive,
- },
- {
- name: "throttle.io_service_bytes",
- entry: &stats.Blkio.IoServiceBytesRecursive,
- },
- }
- for _, t := range settings {
- if err := b.readEntry(devices, path, t.name, t.entry); err != nil {
- return err
- }
- }
- return nil
-}
-
-func (b *blkioController) readEntry(devices map[deviceKey]string, path, name string, entry *[]*v1.BlkIOEntry) error {
- f, err := os.Open(filepath.Join(b.Path(path), "blkio."+name))
- if err != nil {
- return err
- }
- defer f.Close()
- sc := bufio.NewScanner(f)
- for sc.Scan() {
- // format: dev type amount
- fields := strings.FieldsFunc(sc.Text(), splitBlkIOStatLine)
- if len(fields) < 3 {
- if len(fields) == 2 && fields[0] == "Total" {
- // skip total line
- continue
- } else {
- return fmt.Errorf("invalid line found while parsing %s: %s", path, sc.Text())
- }
- }
- major, err := strconv.ParseUint(fields[0], 10, 64)
- if err != nil {
- return err
- }
- minor, err := strconv.ParseUint(fields[1], 10, 64)
- if err != nil {
- return err
- }
- op := ""
- valueField := 2
- if len(fields) == 4 {
- op = fields[2]
- valueField = 3
- }
- v, err := strconv.ParseUint(fields[valueField], 10, 64)
- if err != nil {
- return err
- }
- *entry = append(*entry, &v1.BlkIOEntry{
- Device: devices[deviceKey{major, minor}],
- Major: major,
- Minor: minor,
- Op: op,
- Value: v,
- })
- }
- return sc.Err()
-}
-
-func createBlkioSettings(blkio *specs.LinuxBlockIO) []blkioSettings {
- settings := []blkioSettings{}
-
- if blkio.Weight != nil {
- settings = append(settings,
- blkioSettings{
- name: "weight",
- value: blkio.Weight,
- format: uintf,
- })
- }
- if blkio.LeafWeight != nil {
- settings = append(settings,
- blkioSettings{
- name: "leaf_weight",
- value: blkio.LeafWeight,
- format: uintf,
- })
- }
- for _, wd := range blkio.WeightDevice {
- if wd.Weight != nil {
- settings = append(settings,
- blkioSettings{
- name: "weight_device",
- value: wd,
- format: weightdev,
- })
- }
- if wd.LeafWeight != nil {
- settings = append(settings,
- blkioSettings{
- name: "leaf_weight_device",
- value: wd,
- format: weightleafdev,
- })
- }
- }
- for _, t := range []struct {
- name string
- list []specs.LinuxThrottleDevice
- }{
- {
- name: "throttle.read_bps_device",
- list: blkio.ThrottleReadBpsDevice,
- },
- {
- name: "throttle.read_iops_device",
- list: blkio.ThrottleReadIOPSDevice,
- },
- {
- name: "throttle.write_bps_device",
- list: blkio.ThrottleWriteBpsDevice,
- },
- {
- name: "throttle.write_iops_device",
- list: blkio.ThrottleWriteIOPSDevice,
- },
- } {
- for _, td := range t.list {
- settings = append(settings, blkioSettings{
- name: t.name,
- value: td,
- format: throttleddev,
- })
- }
- }
- return settings
-}
-
-type blkioSettings struct {
- name string
- value interface{}
- format func(v interface{}) []byte
-}
-
-type blkioStatSettings struct {
- name string
- entry *[]*v1.BlkIOEntry
-}
-
-func uintf(v interface{}) []byte {
- return []byte(strconv.FormatUint(uint64(*v.(*uint16)), 10))
-}
-
-func weightdev(v interface{}) []byte {
- wd := v.(specs.LinuxWeightDevice)
- return []byte(fmt.Sprintf("%d:%d %d", wd.Major, wd.Minor, *wd.Weight))
-}
-
-func weightleafdev(v interface{}) []byte {
- wd := v.(specs.LinuxWeightDevice)
- return []byte(fmt.Sprintf("%d:%d %d", wd.Major, wd.Minor, *wd.LeafWeight))
-}
-
-func throttleddev(v interface{}) []byte {
- td := v.(specs.LinuxThrottleDevice)
- return []byte(fmt.Sprintf("%d:%d %d", td.Major, td.Minor, td.Rate))
-}
-
-func splitBlkIOStatLine(r rune) bool {
- return r == ' ' || r == ':'
-}
-
-type deviceKey struct {
- major, minor uint64
-}
-
-// getDevices makes a best effort attempt to read all the devices into a map
-// keyed by major and minor number. Since devices may be mapped multiple times,
-// we err on taking the first occurrence.
-func getDevices(r io.Reader) (map[deviceKey]string, error) {
-
- var (
- s = bufio.NewScanner(r)
- devices = make(map[deviceKey]string)
- )
- for s.Scan() {
- fields := strings.Fields(s.Text())
- major, err := strconv.Atoi(fields[0])
- if err != nil {
- return nil, err
- }
- minor, err := strconv.Atoi(fields[1])
- if err != nil {
- return nil, err
- }
- key := deviceKey{
- major: uint64(major),
- minor: uint64(minor),
- }
- if _, ok := devices[key]; ok {
- continue
- }
- devices[key] = filepath.Join("/dev", fields[2])
- }
- return devices, s.Err()
-}
diff --git a/vendor/github.com/containerd/cgroups/cgroup.go b/vendor/github.com/containerd/cgroups/cgroup.go
deleted file mode 100644
index e0e014b28..000000000
--- a/vendor/github.com/containerd/cgroups/cgroup.go
+++ /dev/null
@@ -1,552 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cgroups
-
-import (
- "fmt"
- "os"
- "path/filepath"
- "strconv"
- "strings"
- "sync"
-
- v1 "github.com/containerd/cgroups/stats/v1"
- specs "github.com/opencontainers/runtime-spec/specs-go"
- "github.com/pkg/errors"
-)
-
-// New returns a new control via the cgroup cgroups interface
-func New(hierarchy Hierarchy, path Path, resources *specs.LinuxResources, opts ...InitOpts) (Cgroup, error) {
- config := newInitConfig()
- for _, o := range opts {
- if err := o(config); err != nil {
- return nil, err
- }
- }
- subsystems, err := hierarchy()
- if err != nil {
- return nil, err
- }
- var active []Subsystem
- for _, s := range subsystems {
- // check if subsystem exists
- if err := initializeSubsystem(s, path, resources); err != nil {
- if err == ErrControllerNotActive {
- if config.InitCheck != nil {
- if skerr := config.InitCheck(s, path, err); skerr != nil {
- if skerr != ErrIgnoreSubsystem {
- return nil, skerr
- }
- }
- }
- continue
- }
- return nil, err
- }
- active = append(active, s)
- }
- return &cgroup{
- path: path,
- subsystems: active,
- }, nil
-}
-
-// Load will load an existing cgroup and allow it to be controlled
-// All static path should not include `/sys/fs/cgroup/` prefix, it should start with your own cgroups name
-func Load(hierarchy Hierarchy, path Path, opts ...InitOpts) (Cgroup, error) {
- config := newInitConfig()
- for _, o := range opts {
- if err := o(config); err != nil {
- return nil, err
- }
- }
- var activeSubsystems []Subsystem
- subsystems, err := hierarchy()
- if err != nil {
- return nil, err
- }
- // check that the subsystems still exist, and keep only those that actually exist
- for _, s := range pathers(subsystems) {
- p, err := path(s.Name())
- if err != nil {
- if os.IsNotExist(errors.Cause(err)) {
- return nil, ErrCgroupDeleted
- }
- if err == ErrControllerNotActive {
- if config.InitCheck != nil {
- if skerr := config.InitCheck(s, path, err); skerr != nil {
- if skerr != ErrIgnoreSubsystem {
- return nil, skerr
- }
- }
- }
- continue
- }
- return nil, err
- }
- if _, err := os.Lstat(s.Path(p)); err != nil {
- if os.IsNotExist(err) {
- continue
- }
- return nil, err
- }
- activeSubsystems = append(activeSubsystems, s)
- }
- // if we do not have any active systems then the cgroup is deleted
- if len(activeSubsystems) == 0 {
- return nil, ErrCgroupDeleted
- }
- return &cgroup{
- path: path,
- subsystems: activeSubsystems,
- }, nil
-}
-
-type cgroup struct {
- path Path
-
- subsystems []Subsystem
- mu sync.Mutex
- err error
-}
-
-// New returns a new sub cgroup
-func (c *cgroup) New(name string, resources *specs.LinuxResources) (Cgroup, error) {
- c.mu.Lock()
- defer c.mu.Unlock()
- if c.err != nil {
- return nil, c.err
- }
- path := subPath(c.path, name)
- for _, s := range c.subsystems {
- if err := initializeSubsystem(s, path, resources); err != nil {
- return nil, err
- }
- }
- return &cgroup{
- path: path,
- subsystems: c.subsystems,
- }, nil
-}
-
-// Subsystems returns all the subsystems that are currently being
-// consumed by the group
-func (c *cgroup) Subsystems() []Subsystem {
- return c.subsystems
-}
-
-// Add moves the provided process into the new cgroup
-func (c *cgroup) Add(process Process) error {
- if process.Pid <= 0 {
- return ErrInvalidPid
- }
- c.mu.Lock()
- defer c.mu.Unlock()
- if c.err != nil {
- return c.err
- }
- return c.add(process)
-}
-
-func (c *cgroup) add(process Process) error {
- for _, s := range pathers(c.subsystems) {
- p, err := c.path(s.Name())
- if err != nil {
- return err
- }
- if err := retryingWriteFile(
- filepath.Join(s.Path(p), cgroupProcs),
- []byte(strconv.Itoa(process.Pid)),
- defaultFilePerm,
- ); err != nil {
- return err
- }
- }
- return nil
-}
-
-// AddTask moves the provided tasks (threads) into the new cgroup
-func (c *cgroup) AddTask(process Process) error {
- if process.Pid <= 0 {
- return ErrInvalidPid
- }
- c.mu.Lock()
- defer c.mu.Unlock()
- if c.err != nil {
- return c.err
- }
- return c.addTask(process)
-}
-
-func (c *cgroup) addTask(process Process) error {
- for _, s := range pathers(c.subsystems) {
- p, err := c.path(s.Name())
- if err != nil {
- return err
- }
- if err := retryingWriteFile(
- filepath.Join(s.Path(p), cgroupTasks),
- []byte(strconv.Itoa(process.Pid)),
- defaultFilePerm,
- ); err != nil {
- return err
- }
- }
- return nil
-}
-
-// Delete will remove the control group from each of the subsystems registered
-func (c *cgroup) Delete() error {
- c.mu.Lock()
- defer c.mu.Unlock()
- if c.err != nil {
- return c.err
- }
- var errs []string
- for _, s := range c.subsystems {
- if d, ok := s.(deleter); ok {
- sp, err := c.path(s.Name())
- if err != nil {
- return err
- }
- if err := d.Delete(sp); err != nil {
- errs = append(errs, string(s.Name()))
- }
- continue
- }
- if p, ok := s.(pather); ok {
- sp, err := c.path(s.Name())
- if err != nil {
- return err
- }
- path := p.Path(sp)
- if err := remove(path); err != nil {
- errs = append(errs, path)
- }
- }
- }
- if len(errs) > 0 {
- return fmt.Errorf("cgroups: unable to remove paths %s", strings.Join(errs, ", "))
- }
- c.err = ErrCgroupDeleted
- return nil
-}
-
-// Stat returns the current metrics for the cgroup
-func (c *cgroup) Stat(handlers ...ErrorHandler) (*v1.Metrics, error) {
- c.mu.Lock()
- defer c.mu.Unlock()
- if c.err != nil {
- return nil, c.err
- }
- if len(handlers) == 0 {
- handlers = append(handlers, errPassthrough)
- }
- var (
- stats = &v1.Metrics{
- CPU: &v1.CPUStat{
- Throttling: &v1.Throttle{},
- Usage: &v1.CPUUsage{},
- },
- }
- wg = &sync.WaitGroup{}
- errs = make(chan error, len(c.subsystems))
- )
- for _, s := range c.subsystems {
- if ss, ok := s.(stater); ok {
- sp, err := c.path(s.Name())
- if err != nil {
- return nil, err
- }
- wg.Add(1)
- go func() {
- defer wg.Done()
- if err := ss.Stat(sp, stats); err != nil {
- for _, eh := range handlers {
- if herr := eh(err); herr != nil {
- errs <- herr
- }
- }
- }
- }()
- }
- }
- wg.Wait()
- close(errs)
- for err := range errs {
- return nil, err
- }
- return stats, nil
-}
-
-// Update updates the cgroup with the new resource values provided
-//
-// Be prepared to handle EBUSY when trying to update a cgroup with
-// live processes and other operations like Stats being performed at the
-// same time
-func (c *cgroup) Update(resources *specs.LinuxResources) error {
- c.mu.Lock()
- defer c.mu.Unlock()
- if c.err != nil {
- return c.err
- }
- for _, s := range c.subsystems {
- if u, ok := s.(updater); ok {
- sp, err := c.path(s.Name())
- if err != nil {
- return err
- }
- if err := u.Update(sp, resources); err != nil {
- return err
- }
- }
- }
- return nil
-}
-
-// Processes returns the processes running inside the cgroup along
-// with the subsystem used, pid, and path
-func (c *cgroup) Processes(subsystem Name, recursive bool) ([]Process, error) {
- c.mu.Lock()
- defer c.mu.Unlock()
- if c.err != nil {
- return nil, c.err
- }
- return c.processes(subsystem, recursive)
-}
-
-func (c *cgroup) processes(subsystem Name, recursive bool) ([]Process, error) {
- s := c.getSubsystem(subsystem)
- sp, err := c.path(subsystem)
- if err != nil {
- return nil, err
- }
- path := s.(pather).Path(sp)
- var processes []Process
- err = filepath.Walk(path, func(p string, info os.FileInfo, err error) error {
- if err != nil {
- return err
- }
- if !recursive && info.IsDir() {
- if p == path {
- return nil
- }
- return filepath.SkipDir
- }
- dir, name := filepath.Split(p)
- if name != cgroupProcs {
- return nil
- }
- procs, err := readPids(dir, subsystem)
- if err != nil {
- return err
- }
- processes = append(processes, procs...)
- return nil
- })
- return processes, err
-}
-
-// Tasks returns the tasks running inside the cgroup along
-// with the subsystem used, pid, and path
-func (c *cgroup) Tasks(subsystem Name, recursive bool) ([]Task, error) {
- c.mu.Lock()
- defer c.mu.Unlock()
- if c.err != nil {
- return nil, c.err
- }
- return c.tasks(subsystem, recursive)
-}
-
-func (c *cgroup) tasks(subsystem Name, recursive bool) ([]Task, error) {
- s := c.getSubsystem(subsystem)
- sp, err := c.path(subsystem)
- if err != nil {
- return nil, err
- }
- path := s.(pather).Path(sp)
- var tasks []Task
- err = filepath.Walk(path, func(p string, info os.FileInfo, err error) error {
- if err != nil {
- return err
- }
- if !recursive && info.IsDir() {
- if p == path {
- return nil
- }
- return filepath.SkipDir
- }
- dir, name := filepath.Split(p)
- if name != cgroupTasks {
- return nil
- }
- procs, err := readTasksPids(dir, subsystem)
- if err != nil {
- return err
- }
- tasks = append(tasks, procs...)
- return nil
- })
- return tasks, err
-}
-
-// Freeze freezes the entire cgroup and all the processes inside it
-func (c *cgroup) Freeze() error {
- c.mu.Lock()
- defer c.mu.Unlock()
- if c.err != nil {
- return c.err
- }
- s := c.getSubsystem(Freezer)
- if s == nil {
- return ErrFreezerNotSupported
- }
- sp, err := c.path(Freezer)
- if err != nil {
- return err
- }
- return s.(*freezerController).Freeze(sp)
-}
-
-// Thaw thaws out the cgroup and all the processes inside it
-func (c *cgroup) Thaw() error {
- c.mu.Lock()
- defer c.mu.Unlock()
- if c.err != nil {
- return c.err
- }
- s := c.getSubsystem(Freezer)
- if s == nil {
- return ErrFreezerNotSupported
- }
- sp, err := c.path(Freezer)
- if err != nil {
- return err
- }
- return s.(*freezerController).Thaw(sp)
-}
-
-// OOMEventFD returns the memory cgroup's out of memory event fd that triggers
-// when processes inside the cgroup receive an oom event. Returns
-// ErrMemoryNotSupported if memory cgroups is not supported.
-func (c *cgroup) OOMEventFD() (uintptr, error) {
- c.mu.Lock()
- defer c.mu.Unlock()
- if c.err != nil {
- return 0, c.err
- }
- s := c.getSubsystem(Memory)
- if s == nil {
- return 0, ErrMemoryNotSupported
- }
- sp, err := c.path(Memory)
- if err != nil {
- return 0, err
- }
- return s.(*memoryController).memoryEvent(sp, OOMEvent())
-}
-
-// RegisterMemoryEvent allows the ability to register for all v1 memory cgroups
-// notifications.
-func (c *cgroup) RegisterMemoryEvent(event MemoryEvent) (uintptr, error) {
- c.mu.Lock()
- defer c.mu.Unlock()
- if c.err != nil {
- return 0, c.err
- }
- s := c.getSubsystem(Memory)
- if s == nil {
- return 0, ErrMemoryNotSupported
- }
- sp, err := c.path(Memory)
- if err != nil {
- return 0, err
- }
- return s.(*memoryController).memoryEvent(sp, event)
-}
-
-// State returns the state of the cgroup and its processes
-func (c *cgroup) State() State {
- c.mu.Lock()
- defer c.mu.Unlock()
- c.checkExists()
- if c.err != nil && c.err == ErrCgroupDeleted {
- return Deleted
- }
- s := c.getSubsystem(Freezer)
- if s == nil {
- return Thawed
- }
- sp, err := c.path(Freezer)
- if err != nil {
- return Unknown
- }
- state, err := s.(*freezerController).state(sp)
- if err != nil {
- return Unknown
- }
- return state
-}
-
-// MoveTo does a recursive move subsystem by subsystem of all the processes
-// inside the group
-func (c *cgroup) MoveTo(destination Cgroup) error {
- c.mu.Lock()
- defer c.mu.Unlock()
- if c.err != nil {
- return c.err
- }
- for _, s := range c.subsystems {
- processes, err := c.processes(s.Name(), true)
- if err != nil {
- return err
- }
- for _, p := range processes {
- if err := destination.Add(p); err != nil {
- if strings.Contains(err.Error(), "no such process") {
- continue
- }
- return err
- }
- }
- }
- return nil
-}
-
-func (c *cgroup) getSubsystem(n Name) Subsystem {
- for _, s := range c.subsystems {
- if s.Name() == n {
- return s
- }
- }
- return nil
-}
-
-func (c *cgroup) checkExists() {
- for _, s := range pathers(c.subsystems) {
- p, err := c.path(s.Name())
- if err != nil {
- return
- }
- if _, err := os.Lstat(s.Path(p)); err != nil {
- if os.IsNotExist(err) {
- c.err = ErrCgroupDeleted
- return
- }
- }
- }
-}
diff --git a/vendor/github.com/containerd/cgroups/control.go b/vendor/github.com/containerd/cgroups/control.go
deleted file mode 100644
index a4cb9b832..000000000
--- a/vendor/github.com/containerd/cgroups/control.go
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cgroups
-
-import (
- "os"
-
- v1 "github.com/containerd/cgroups/stats/v1"
- specs "github.com/opencontainers/runtime-spec/specs-go"
-)
-
-const (
- cgroupProcs = "cgroup.procs"
- cgroupTasks = "tasks"
- defaultDirPerm = 0755
-)
-
-// defaultFilePerm is a var so that the test framework can change the filemode
-// of all files created when the tests are running. The difference between the
-// tests and real world use is that files like "cgroup.procs" will exist when writing
-// to a read cgroup filesystem and do not exist prior when running in the tests.
-// this is set to a non 0 value in the test code
-var defaultFilePerm = os.FileMode(0)
-
-type Process struct {
- // Subsystem is the name of the subsystem that the process is in
- Subsystem Name
- // Pid is the process id of the process
- Pid int
- // Path is the full path of the subsystem and location that the process is in
- Path string
-}
-
-type Task struct {
- // Subsystem is the name of the subsystem that the task is in
- Subsystem Name
- // Pid is the process id of the task
- Pid int
- // Path is the full path of the subsystem and location that the task is in
- Path string
-}
-
-// Cgroup handles interactions with the individual groups to perform
-// actions on them as them main interface to this cgroup package
-type Cgroup interface {
- // New creates a new cgroup under the calling cgroup
- New(string, *specs.LinuxResources) (Cgroup, error)
- // Add adds a process to the cgroup (cgroup.procs)
- Add(Process) error
- // AddTask adds a process to the cgroup (tasks)
- AddTask(Process) error
- // Delete removes the cgroup as a whole
- Delete() error
- // MoveTo moves all the processes under the calling cgroup to the provided one
- // subsystems are moved one at a time
- MoveTo(Cgroup) error
- // Stat returns the stats for all subsystems in the cgroup
- Stat(...ErrorHandler) (*v1.Metrics, error)
- // Update updates all the subsystems with the provided resource changes
- Update(resources *specs.LinuxResources) error
- // Processes returns all the processes in a select subsystem for the cgroup
- Processes(Name, bool) ([]Process, error)
- // Tasks returns all the tasks in a select subsystem for the cgroup
- Tasks(Name, bool) ([]Task, error)
- // Freeze freezes or pauses all processes inside the cgroup
- Freeze() error
- // Thaw thaw or resumes all processes inside the cgroup
- Thaw() error
- // OOMEventFD returns the memory subsystem's event fd for OOM events
- OOMEventFD() (uintptr, error)
- // RegisterMemoryEvent returns the memory subsystems event fd for whatever memory event was
- // registered for. Can alternatively register for the oom event with this method.
- RegisterMemoryEvent(MemoryEvent) (uintptr, error)
- // State returns the cgroups current state
- State() State
- // Subsystems returns all the subsystems in the cgroup
- Subsystems() []Subsystem
-}
diff --git a/vendor/github.com/containerd/cgroups/cpu.go b/vendor/github.com/containerd/cgroups/cpu.go
deleted file mode 100644
index 27024f17b..000000000
--- a/vendor/github.com/containerd/cgroups/cpu.go
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cgroups
-
-import (
- "bufio"
- "os"
- "path/filepath"
- "strconv"
-
- v1 "github.com/containerd/cgroups/stats/v1"
- specs "github.com/opencontainers/runtime-spec/specs-go"
-)
-
-func NewCpu(root string) *cpuController {
- return &cpuController{
- root: filepath.Join(root, string(Cpu)),
- }
-}
-
-type cpuController struct {
- root string
-}
-
-func (c *cpuController) Name() Name {
- return Cpu
-}
-
-func (c *cpuController) Path(path string) string {
- return filepath.Join(c.root, path)
-}
-
-func (c *cpuController) Create(path string, resources *specs.LinuxResources) error {
- if err := os.MkdirAll(c.Path(path), defaultDirPerm); err != nil {
- return err
- }
- if cpu := resources.CPU; cpu != nil {
- for _, t := range []struct {
- name string
- ivalue *int64
- uvalue *uint64
- }{
- {
- name: "rt_period_us",
- uvalue: cpu.RealtimePeriod,
- },
- {
- name: "rt_runtime_us",
- ivalue: cpu.RealtimeRuntime,
- },
- {
- name: "shares",
- uvalue: cpu.Shares,
- },
- {
- name: "cfs_period_us",
- uvalue: cpu.Period,
- },
- {
- name: "cfs_quota_us",
- ivalue: cpu.Quota,
- },
- } {
- var value []byte
- if t.uvalue != nil {
- value = []byte(strconv.FormatUint(*t.uvalue, 10))
- } else if t.ivalue != nil {
- value = []byte(strconv.FormatInt(*t.ivalue, 10))
- }
- if value != nil {
- if err := retryingWriteFile(
- filepath.Join(c.Path(path), "cpu."+t.name),
- value,
- defaultFilePerm,
- ); err != nil {
- return err
- }
- }
- }
- }
- return nil
-}
-
-func (c *cpuController) Update(path string, resources *specs.LinuxResources) error {
- return c.Create(path, resources)
-}
-
-func (c *cpuController) Stat(path string, stats *v1.Metrics) error {
- f, err := os.Open(filepath.Join(c.Path(path), "cpu.stat"))
- if err != nil {
- return err
- }
- defer f.Close()
- // get or create the cpu field because cpuacct can also set values on this struct
- sc := bufio.NewScanner(f)
- for sc.Scan() {
- key, v, err := parseKV(sc.Text())
- if err != nil {
- return err
- }
- switch key {
- case "nr_periods":
- stats.CPU.Throttling.Periods = v
- case "nr_throttled":
- stats.CPU.Throttling.ThrottledPeriods = v
- case "throttled_time":
- stats.CPU.Throttling.ThrottledTime = v
- }
- }
- return sc.Err()
-}
diff --git a/vendor/github.com/containerd/cgroups/cpuacct.go b/vendor/github.com/containerd/cgroups/cpuacct.go
deleted file mode 100644
index e5fc864bd..000000000
--- a/vendor/github.com/containerd/cgroups/cpuacct.go
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cgroups
-
-import (
- "fmt"
- "io/ioutil"
- "path/filepath"
- "strconv"
- "strings"
-
- v1 "github.com/containerd/cgroups/stats/v1"
-)
-
-const nanosecondsInSecond = 1000000000
-
-var clockTicks = getClockTicks()
-
-func NewCpuacct(root string) *cpuacctController {
- return &cpuacctController{
- root: filepath.Join(root, string(Cpuacct)),
- }
-}
-
-type cpuacctController struct {
- root string
-}
-
-func (c *cpuacctController) Name() Name {
- return Cpuacct
-}
-
-func (c *cpuacctController) Path(path string) string {
- return filepath.Join(c.root, path)
-}
-
-func (c *cpuacctController) Stat(path string, stats *v1.Metrics) error {
- user, kernel, err := c.getUsage(path)
- if err != nil {
- return err
- }
- total, err := readUint(filepath.Join(c.Path(path), "cpuacct.usage"))
- if err != nil {
- return err
- }
- percpu, err := c.percpuUsage(path)
- if err != nil {
- return err
- }
- stats.CPU.Usage.Total = total
- stats.CPU.Usage.User = user
- stats.CPU.Usage.Kernel = kernel
- stats.CPU.Usage.PerCPU = percpu
- return nil
-}
-
-func (c *cpuacctController) percpuUsage(path string) ([]uint64, error) {
- var usage []uint64
- data, err := ioutil.ReadFile(filepath.Join(c.Path(path), "cpuacct.usage_percpu"))
- if err != nil {
- return nil, err
- }
- for _, v := range strings.Fields(string(data)) {
- u, err := strconv.ParseUint(v, 10, 64)
- if err != nil {
- return nil, err
- }
- usage = append(usage, u)
- }
- return usage, nil
-}
-
-func (c *cpuacctController) getUsage(path string) (user uint64, kernel uint64, err error) {
- statPath := filepath.Join(c.Path(path), "cpuacct.stat")
- data, err := ioutil.ReadFile(statPath)
- if err != nil {
- return 0, 0, err
- }
- fields := strings.Fields(string(data))
- if len(fields) != 4 {
- return 0, 0, fmt.Errorf("%q is expected to have 4 fields", statPath)
- }
- for _, t := range []struct {
- index int
- name string
- value *uint64
- }{
- {
- index: 0,
- name: "user",
- value: &user,
- },
- {
- index: 2,
- name: "system",
- value: &kernel,
- },
- } {
- if fields[t.index] != t.name {
- return 0, 0, fmt.Errorf("expected field %q but found %q in %q", t.name, fields[t.index], statPath)
- }
- v, err := strconv.ParseUint(fields[t.index+1], 10, 64)
- if err != nil {
- return 0, 0, err
- }
- *t.value = v
- }
- return (user * nanosecondsInSecond) / clockTicks, (kernel * nanosecondsInSecond) / clockTicks, nil
-}
diff --git a/vendor/github.com/containerd/cgroups/cpuset.go b/vendor/github.com/containerd/cgroups/cpuset.go
deleted file mode 100644
index 3cae173bd..000000000
--- a/vendor/github.com/containerd/cgroups/cpuset.go
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cgroups
-
-import (
- "bytes"
- "fmt"
- "io/ioutil"
- "os"
- "path/filepath"
-
- specs "github.com/opencontainers/runtime-spec/specs-go"
-)
-
-func NewCpuset(root string) *cpusetController {
- return &cpusetController{
- root: filepath.Join(root, string(Cpuset)),
- }
-}
-
-type cpusetController struct {
- root string
-}
-
-func (c *cpusetController) Name() Name {
- return Cpuset
-}
-
-func (c *cpusetController) Path(path string) string {
- return filepath.Join(c.root, path)
-}
-
-func (c *cpusetController) Create(path string, resources *specs.LinuxResources) error {
- if err := c.ensureParent(c.Path(path), c.root); err != nil {
- return err
- }
- if err := os.MkdirAll(c.Path(path), defaultDirPerm); err != nil {
- return err
- }
- if err := c.copyIfNeeded(c.Path(path), filepath.Dir(c.Path(path))); err != nil {
- return err
- }
- if resources.CPU != nil {
- for _, t := range []struct {
- name string
- value string
- }{
- {
- name: "cpus",
- value: resources.CPU.Cpus,
- },
- {
- name: "mems",
- value: resources.CPU.Mems,
- },
- } {
- if t.value != "" {
- if err := retryingWriteFile(
- filepath.Join(c.Path(path), "cpuset."+t.name),
- []byte(t.value),
- defaultFilePerm,
- ); err != nil {
- return err
- }
- }
- }
- }
- return nil
-}
-
-func (c *cpusetController) Update(path string, resources *specs.LinuxResources) error {
- return c.Create(path, resources)
-}
-
-func (c *cpusetController) getValues(path string) (cpus []byte, mems []byte, err error) {
- if cpus, err = ioutil.ReadFile(filepath.Join(path, "cpuset.cpus")); err != nil && !os.IsNotExist(err) {
- return
- }
- if mems, err = ioutil.ReadFile(filepath.Join(path, "cpuset.mems")); err != nil && !os.IsNotExist(err) {
- return
- }
- return cpus, mems, nil
-}
-
-// ensureParent makes sure that the parent directory of current is created
-// and populated with the proper cpus and mems files copied from
-// it's parent.
-func (c *cpusetController) ensureParent(current, root string) error {
- parent := filepath.Dir(current)
- if _, err := filepath.Rel(root, parent); err != nil {
- return nil
- }
- // Avoid infinite recursion.
- if parent == current {
- return fmt.Errorf("cpuset: cgroup parent path outside cgroup root")
- }
- if cleanPath(parent) != root {
- if err := c.ensureParent(parent, root); err != nil {
- return err
- }
- }
- if err := os.MkdirAll(current, defaultDirPerm); err != nil {
- return err
- }
- return c.copyIfNeeded(current, parent)
-}
-
-// copyIfNeeded copies the cpuset.cpus and cpuset.mems from the parent
-// directory to the current directory if the file's contents are 0
-func (c *cpusetController) copyIfNeeded(current, parent string) error {
- var (
- err error
- currentCpus, currentMems []byte
- parentCpus, parentMems []byte
- )
- if currentCpus, currentMems, err = c.getValues(current); err != nil {
- return err
- }
- if parentCpus, parentMems, err = c.getValues(parent); err != nil {
- return err
- }
- if isEmpty(currentCpus) {
- if err := retryingWriteFile(
- filepath.Join(current, "cpuset.cpus"),
- parentCpus,
- defaultFilePerm,
- ); err != nil {
- return err
- }
- }
- if isEmpty(currentMems) {
- if err := retryingWriteFile(
- filepath.Join(current, "cpuset.mems"),
- parentMems,
- defaultFilePerm,
- ); err != nil {
- return err
- }
- }
- return nil
-}
-
-func isEmpty(b []byte) bool {
- return len(bytes.Trim(b, "\n")) == 0
-}
diff --git a/vendor/github.com/containerd/cgroups/devices.go b/vendor/github.com/containerd/cgroups/devices.go
deleted file mode 100644
index 7792566d5..000000000
--- a/vendor/github.com/containerd/cgroups/devices.go
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cgroups
-
-import (
- "fmt"
- "os"
- "path/filepath"
-
- specs "github.com/opencontainers/runtime-spec/specs-go"
-)
-
-const (
- allowDeviceFile = "devices.allow"
- denyDeviceFile = "devices.deny"
- wildcard = -1
-)
-
-func NewDevices(root string) *devicesController {
- return &devicesController{
- root: filepath.Join(root, string(Devices)),
- }
-}
-
-type devicesController struct {
- root string
-}
-
-func (d *devicesController) Name() Name {
- return Devices
-}
-
-func (d *devicesController) Path(path string) string {
- return filepath.Join(d.root, path)
-}
-
-func (d *devicesController) Create(path string, resources *specs.LinuxResources) error {
- if err := os.MkdirAll(d.Path(path), defaultDirPerm); err != nil {
- return err
- }
- for _, device := range resources.Devices {
- file := denyDeviceFile
- if device.Allow {
- file = allowDeviceFile
- }
- if device.Type == "" {
- device.Type = "a"
- }
- if err := retryingWriteFile(
- filepath.Join(d.Path(path), file),
- []byte(deviceString(device)),
- defaultFilePerm,
- ); err != nil {
- return err
- }
- }
- return nil
-}
-
-func (d *devicesController) Update(path string, resources *specs.LinuxResources) error {
- return d.Create(path, resources)
-}
-
-func deviceString(device specs.LinuxDeviceCgroup) string {
- return fmt.Sprintf("%s %s:%s %s",
- device.Type,
- deviceNumber(device.Major),
- deviceNumber(device.Minor),
- device.Access,
- )
-}
-
-func deviceNumber(number *int64) string {
- if number == nil || *number == wildcard {
- return "*"
- }
- return fmt.Sprint(*number)
-}
diff --git a/vendor/github.com/containerd/cgroups/errors.go b/vendor/github.com/containerd/cgroups/errors.go
deleted file mode 100644
index f1ad8315c..000000000
--- a/vendor/github.com/containerd/cgroups/errors.go
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cgroups
-
-import (
- "errors"
- "os"
-)
-
-var (
- ErrInvalidPid = errors.New("cgroups: pid must be greater than 0")
- ErrMountPointNotExist = errors.New("cgroups: cgroup mountpoint does not exist")
- ErrInvalidFormat = errors.New("cgroups: parsing file with invalid format failed")
- ErrFreezerNotSupported = errors.New("cgroups: freezer cgroup not supported on this system")
- ErrMemoryNotSupported = errors.New("cgroups: memory cgroup not supported on this system")
- ErrCgroupDeleted = errors.New("cgroups: cgroup deleted")
- ErrNoCgroupMountDestination = errors.New("cgroups: cannot find cgroup mount destination")
-)
-
-// ErrorHandler is a function that handles and acts on errors
-type ErrorHandler func(err error) error
-
-// IgnoreNotExist ignores any errors that are for not existing files
-func IgnoreNotExist(err error) error {
- if os.IsNotExist(err) {
- return nil
- }
- return err
-}
-
-func errPassthrough(err error) error {
- return err
-}
diff --git a/vendor/github.com/containerd/cgroups/freezer.go b/vendor/github.com/containerd/cgroups/freezer.go
deleted file mode 100644
index 59a7e7128..000000000
--- a/vendor/github.com/containerd/cgroups/freezer.go
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cgroups
-
-import (
- "io/ioutil"
- "path/filepath"
- "strings"
- "time"
-)
-
-func NewFreezer(root string) *freezerController {
- return &freezerController{
- root: filepath.Join(root, string(Freezer)),
- }
-}
-
-type freezerController struct {
- root string
-}
-
-func (f *freezerController) Name() Name {
- return Freezer
-}
-
-func (f *freezerController) Path(path string) string {
- return filepath.Join(f.root, path)
-}
-
-func (f *freezerController) Freeze(path string) error {
- return f.waitState(path, Frozen)
-}
-
-func (f *freezerController) Thaw(path string) error {
- return f.waitState(path, Thawed)
-}
-
-func (f *freezerController) changeState(path string, state State) error {
- return retryingWriteFile(
- filepath.Join(f.root, path, "freezer.state"),
- []byte(strings.ToUpper(string(state))),
- defaultFilePerm,
- )
-}
-
-func (f *freezerController) state(path string) (State, error) {
- current, err := ioutil.ReadFile(filepath.Join(f.root, path, "freezer.state"))
- if err != nil {
- return "", err
- }
- return State(strings.ToLower(strings.TrimSpace(string(current)))), nil
-}
-
-func (f *freezerController) waitState(path string, state State) error {
- for {
- if err := f.changeState(path, state); err != nil {
- return err
- }
- current, err := f.state(path)
- if err != nil {
- return err
- }
- if current == state {
- return nil
- }
- time.Sleep(1 * time.Millisecond)
- }
-}
diff --git a/vendor/github.com/containerd/cgroups/go.mod b/vendor/github.com/containerd/cgroups/go.mod
deleted file mode 100644
index 64be56187..000000000
--- a/vendor/github.com/containerd/cgroups/go.mod
+++ /dev/null
@@ -1,18 +0,0 @@
-module github.com/containerd/cgroups
-
-go 1.13
-
-require (
- github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775
- github.com/coreos/go-systemd/v22 v22.0.0
- github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
- github.com/docker/go-units v0.4.0
- github.com/godbus/dbus/v5 v5.0.3
- github.com/gogo/protobuf v1.3.1
- github.com/opencontainers/runtime-spec v1.0.2
- github.com/pkg/errors v0.9.1
- github.com/sirupsen/logrus v1.6.0
- github.com/stretchr/testify v1.2.2
- github.com/urfave/cli v1.22.2
- golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9
-)
diff --git a/vendor/github.com/containerd/cgroups/hierarchy.go b/vendor/github.com/containerd/cgroups/hierarchy.go
deleted file mode 100644
index ca3f1b938..000000000
--- a/vendor/github.com/containerd/cgroups/hierarchy.go
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cgroups
-
-// Hierarchy enables both unified and split hierarchy for cgroups
-type Hierarchy func() ([]Subsystem, error)
diff --git a/vendor/github.com/containerd/cgroups/hugetlb.go b/vendor/github.com/containerd/cgroups/hugetlb.go
deleted file mode 100644
index c0eb03b24..000000000
--- a/vendor/github.com/containerd/cgroups/hugetlb.go
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cgroups
-
-import (
- "os"
- "path/filepath"
- "strconv"
- "strings"
-
- v1 "github.com/containerd/cgroups/stats/v1"
- specs "github.com/opencontainers/runtime-spec/specs-go"
-)
-
-func NewHugetlb(root string) (*hugetlbController, error) {
- sizes, err := hugePageSizes()
- if err != nil {
- return nil, err
- }
-
- return &hugetlbController{
- root: filepath.Join(root, string(Hugetlb)),
- sizes: sizes,
- }, nil
-}
-
-type hugetlbController struct {
- root string
- sizes []string
-}
-
-func (h *hugetlbController) Name() Name {
- return Hugetlb
-}
-
-func (h *hugetlbController) Path(path string) string {
- return filepath.Join(h.root, path)
-}
-
-func (h *hugetlbController) Create(path string, resources *specs.LinuxResources) error {
- if err := os.MkdirAll(h.Path(path), defaultDirPerm); err != nil {
- return err
- }
- for _, limit := range resources.HugepageLimits {
- if err := retryingWriteFile(
- filepath.Join(h.Path(path), strings.Join([]string{"hugetlb", limit.Pagesize, "limit_in_bytes"}, ".")),
- []byte(strconv.FormatUint(limit.Limit, 10)),
- defaultFilePerm,
- ); err != nil {
- return err
- }
- }
- return nil
-}
-
-func (h *hugetlbController) Stat(path string, stats *v1.Metrics) error {
- for _, size := range h.sizes {
- s, err := h.readSizeStat(path, size)
- if err != nil {
- return err
- }
- stats.Hugetlb = append(stats.Hugetlb, s)
- }
- return nil
-}
-
-func (h *hugetlbController) readSizeStat(path, size string) (*v1.HugetlbStat, error) {
- s := v1.HugetlbStat{
- Pagesize: size,
- }
- for _, t := range []struct {
- name string
- value *uint64
- }{
- {
- name: "usage_in_bytes",
- value: &s.Usage,
- },
- {
- name: "max_usage_in_bytes",
- value: &s.Max,
- },
- {
- name: "failcnt",
- value: &s.Failcnt,
- },
- } {
- v, err := readUint(filepath.Join(h.Path(path), strings.Join([]string{"hugetlb", size, t.name}, ".")))
- if err != nil {
- return nil, err
- }
- *t.value = v
- }
- return &s, nil
-}
diff --git a/vendor/github.com/containerd/cgroups/memory.go b/vendor/github.com/containerd/cgroups/memory.go
deleted file mode 100644
index d3810c5ae..000000000
--- a/vendor/github.com/containerd/cgroups/memory.go
+++ /dev/null
@@ -1,475 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cgroups
-
-import (
- "bufio"
- "fmt"
- "io"
- "os"
- "path/filepath"
- "strconv"
- "strings"
- "syscall"
-
- v1 "github.com/containerd/cgroups/stats/v1"
- specs "github.com/opencontainers/runtime-spec/specs-go"
- "golang.org/x/sys/unix"
-)
-
-// MemoryEvent is an interface that V1 memory Cgroup notifications implement. Arg returns the
-// file name whose fd should be written to "cgroups.event_control". EventFile returns the name of
-// the file that supports the notification api e.g. "memory.usage_in_bytes".
-type MemoryEvent interface {
- Arg() string
- EventFile() string
-}
-
-type memoryThresholdEvent struct {
- threshold uint64
- swap bool
-}
-
-// MemoryThresholdEvent returns a new memory threshold event to be used with RegisterMemoryEvent.
-// If swap is true, the event will be registered using memory.memsw.usage_in_bytes
-func MemoryThresholdEvent(threshold uint64, swap bool) MemoryEvent {
- return &memoryThresholdEvent{
- threshold,
- swap,
- }
-}
-
-func (m *memoryThresholdEvent) Arg() string {
- return strconv.FormatUint(m.threshold, 10)
-}
-
-func (m *memoryThresholdEvent) EventFile() string {
- if m.swap {
- return "memory.memsw.usage_in_bytes"
- }
- return "memory.usage_in_bytes"
-}
-
-type oomEvent struct{}
-
-// OOMEvent returns a new oom event to be used with RegisterMemoryEvent.
-func OOMEvent() MemoryEvent {
- return &oomEvent{}
-}
-
-func (oom *oomEvent) Arg() string {
- return ""
-}
-
-func (oom *oomEvent) EventFile() string {
- return "memory.oom_control"
-}
-
-type memoryPressureEvent struct {
- pressureLevel MemoryPressureLevel
- hierarchy EventNotificationMode
-}
-
-// MemoryPressureEvent returns a new memory pressure event to be used with RegisterMemoryEvent.
-func MemoryPressureEvent(pressureLevel MemoryPressureLevel, hierarchy EventNotificationMode) MemoryEvent {
- return &memoryPressureEvent{
- pressureLevel,
- hierarchy,
- }
-}
-
-func (m *memoryPressureEvent) Arg() string {
- return string(m.pressureLevel) + "," + string(m.hierarchy)
-}
-
-func (m *memoryPressureEvent) EventFile() string {
- return "memory.pressure_level"
-}
-
-// MemoryPressureLevel corresponds to the memory pressure levels defined
-// for memory cgroups.
-type MemoryPressureLevel string
-
-// The three memory pressure levels are as follows.
-// - The "low" level means that the system is reclaiming memory for new
-// allocations. Monitoring this reclaiming activity might be useful for
-// maintaining cache level. Upon notification, the program (typically
-// "Activity Manager") might analyze vmstat and act in advance (i.e.
-// prematurely shutdown unimportant services).
-// - The "medium" level means that the system is experiencing medium memory
-// pressure, the system might be making swap, paging out active file caches,
-// etc. Upon this event applications may decide to further analyze
-// vmstat/zoneinfo/memcg or internal memory usage statistics and free any
-// resources that can be easily reconstructed or re-read from a disk.
-// - The "critical" level means that the system is actively thrashing, it is
-// about to out of memory (OOM) or even the in-kernel OOM killer is on its
-// way to trigger. Applications should do whatever they can to help the
-// system. It might be too late to consult with vmstat or any other
-// statistics, so it is advisable to take an immediate action.
-// "https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt" Section 11
-const (
- LowPressure MemoryPressureLevel = "low"
- MediumPressure MemoryPressureLevel = "medium"
- CriticalPressure MemoryPressureLevel = "critical"
-)
-
-// EventNotificationMode corresponds to the notification modes
-// for the memory cgroups pressure level notifications.
-type EventNotificationMode string
-
-// There are three optional modes that specify different propagation behavior:
-// - "default": this is the default behavior specified above. This mode is the
-// same as omitting the optional mode parameter, preserved by backwards
-// compatibility.
-// - "hierarchy": events always propagate up to the root, similar to the default
-// behavior, except that propagation continues regardless of whether there are
-// event listeners at each level, with the "hierarchy" mode. In the above
-// example, groups A, B, and C will receive notification of memory pressure.
-// - "local": events are pass-through, i.e. they only receive notifications when
-// memory pressure is experienced in the memcg for which the notification is
-// registered. In the above example, group C will receive notification if
-// registered for "local" notification and the group experiences memory
-// pressure. However, group B will never receive notification, regardless if
-// there is an event listener for group C or not, if group B is registered for
-// local notification.
-// "https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt" Section 11
-const (
- DefaultMode EventNotificationMode = "default"
- LocalMode EventNotificationMode = "local"
- HierarchyMode EventNotificationMode = "hierarchy"
-)
-
-// NewMemory returns a Memory controller given the root folder of cgroups.
-// It may optionally accept other configuration options, such as IgnoreModules(...)
-func NewMemory(root string, options ...func(*memoryController)) *memoryController {
- mc := &memoryController{
- root: filepath.Join(root, string(Memory)),
- ignored: map[string]struct{}{},
- }
- for _, opt := range options {
- opt(mc)
- }
- return mc
-}
-
-// IgnoreModules configure the memory controller to not read memory metrics for some
-// module names (e.g. passing "memsw" would avoid all the memory.memsw.* entries)
-func IgnoreModules(names ...string) func(*memoryController) {
- return func(mc *memoryController) {
- for _, name := range names {
- mc.ignored[name] = struct{}{}
- }
- }
-}
-
-// OptionalSwap allows the memory controller to not fail if cgroups is not accounting
-// Swap memory (there are no memory.memsw.* entries)
-func OptionalSwap() func(*memoryController) {
- return func(mc *memoryController) {
- _, err := os.Stat(filepath.Join(mc.root, "memory.memsw.usage_in_bytes"))
- if os.IsNotExist(err) {
- mc.ignored["memsw"] = struct{}{}
- }
- }
-}
-
-type memoryController struct {
- root string
- ignored map[string]struct{}
-}
-
-func (m *memoryController) Name() Name {
- return Memory
-}
-
-func (m *memoryController) Path(path string) string {
- return filepath.Join(m.root, path)
-}
-
-func (m *memoryController) Create(path string, resources *specs.LinuxResources) error {
- if err := os.MkdirAll(m.Path(path), defaultDirPerm); err != nil {
- return err
- }
- if resources.Memory == nil {
- return nil
- }
- if resources.Memory.Kernel != nil {
- // Check if kernel memory is enabled
- // We have to limit the kernel memory here as it won't be accounted at all
- // until a limit is set on the cgroup and limit cannot be set once the
- // cgroup has children, or if there are already tasks in the cgroup.
- for _, i := range []int64{1, -1} {
- if err := retryingWriteFile(
- filepath.Join(m.Path(path), "memory.kmem.limit_in_bytes"),
- []byte(strconv.FormatInt(i, 10)),
- defaultFilePerm,
- ); err != nil {
- return checkEBUSY(err)
- }
- }
- }
- return m.set(path, getMemorySettings(resources))
-}
-
-func (m *memoryController) Update(path string, resources *specs.LinuxResources) error {
- if resources.Memory == nil {
- return nil
- }
- g := func(v *int64) bool {
- return v != nil && *v > 0
- }
- settings := getMemorySettings(resources)
- if g(resources.Memory.Limit) && g(resources.Memory.Swap) {
- // if the updated swap value is larger than the current memory limit set the swap changes first
- // then set the memory limit as swap must always be larger than the current limit
- current, err := readUint(filepath.Join(m.Path(path), "memory.limit_in_bytes"))
- if err != nil {
- return err
- }
- if current < uint64(*resources.Memory.Swap) {
- settings[0], settings[1] = settings[1], settings[0]
- }
- }
- return m.set(path, settings)
-}
-
-func (m *memoryController) Stat(path string, stats *v1.Metrics) error {
- f, err := os.Open(filepath.Join(m.Path(path), "memory.stat"))
- if err != nil {
- return err
- }
- defer f.Close()
- stats.Memory = &v1.MemoryStat{
- Usage: &v1.MemoryEntry{},
- Swap: &v1.MemoryEntry{},
- Kernel: &v1.MemoryEntry{},
- KernelTCP: &v1.MemoryEntry{},
- }
- if err := m.parseStats(f, stats.Memory); err != nil {
- return err
- }
- for _, t := range []struct {
- module string
- entry *v1.MemoryEntry
- }{
- {
- module: "",
- entry: stats.Memory.Usage,
- },
- {
- module: "memsw",
- entry: stats.Memory.Swap,
- },
- {
- module: "kmem",
- entry: stats.Memory.Kernel,
- },
- {
- module: "kmem.tcp",
- entry: stats.Memory.KernelTCP,
- },
- } {
- if _, ok := m.ignored[t.module]; ok {
- continue
- }
- for _, tt := range []struct {
- name string
- value *uint64
- }{
- {
- name: "usage_in_bytes",
- value: &t.entry.Usage,
- },
- {
- name: "max_usage_in_bytes",
- value: &t.entry.Max,
- },
- {
- name: "failcnt",
- value: &t.entry.Failcnt,
- },
- {
- name: "limit_in_bytes",
- value: &t.entry.Limit,
- },
- } {
- parts := []string{"memory"}
- if t.module != "" {
- parts = append(parts, t.module)
- }
- parts = append(parts, tt.name)
- v, err := readUint(filepath.Join(m.Path(path), strings.Join(parts, ".")))
- if err != nil {
- return err
- }
- *tt.value = v
- }
- }
- return nil
-}
-
-func (m *memoryController) parseStats(r io.Reader, stat *v1.MemoryStat) error {
- var (
- raw = make(map[string]uint64)
- sc = bufio.NewScanner(r)
- line int
- )
- for sc.Scan() {
- key, v, err := parseKV(sc.Text())
- if err != nil {
- return fmt.Errorf("%d: %v", line, err)
- }
- raw[key] = v
- line++
- }
- if err := sc.Err(); err != nil {
- return err
- }
- stat.Cache = raw["cache"]
- stat.RSS = raw["rss"]
- stat.RSSHuge = raw["rss_huge"]
- stat.MappedFile = raw["mapped_file"]
- stat.Dirty = raw["dirty"]
- stat.Writeback = raw["writeback"]
- stat.PgPgIn = raw["pgpgin"]
- stat.PgPgOut = raw["pgpgout"]
- stat.PgFault = raw["pgfault"]
- stat.PgMajFault = raw["pgmajfault"]
- stat.InactiveAnon = raw["inactive_anon"]
- stat.ActiveAnon = raw["active_anon"]
- stat.InactiveFile = raw["inactive_file"]
- stat.ActiveFile = raw["active_file"]
- stat.Unevictable = raw["unevictable"]
- stat.HierarchicalMemoryLimit = raw["hierarchical_memory_limit"]
- stat.HierarchicalSwapLimit = raw["hierarchical_memsw_limit"]
- stat.TotalCache = raw["total_cache"]
- stat.TotalRSS = raw["total_rss"]
- stat.TotalRSSHuge = raw["total_rss_huge"]
- stat.TotalMappedFile = raw["total_mapped_file"]
- stat.TotalDirty = raw["total_dirty"]
- stat.TotalWriteback = raw["total_writeback"]
- stat.TotalPgPgIn = raw["total_pgpgin"]
- stat.TotalPgPgOut = raw["total_pgpgout"]
- stat.TotalPgFault = raw["total_pgfault"]
- stat.TotalPgMajFault = raw["total_pgmajfault"]
- stat.TotalInactiveAnon = raw["total_inactive_anon"]
- stat.TotalActiveAnon = raw["total_active_anon"]
- stat.TotalInactiveFile = raw["total_inactive_file"]
- stat.TotalActiveFile = raw["total_active_file"]
- stat.TotalUnevictable = raw["total_unevictable"]
- return nil
-}
-
-func (m *memoryController) set(path string, settings []memorySettings) error {
- for _, t := range settings {
- if t.value != nil {
- if err := retryingWriteFile(
- filepath.Join(m.Path(path), "memory."+t.name),
- []byte(strconv.FormatInt(*t.value, 10)),
- defaultFilePerm,
- ); err != nil {
- return err
- }
- }
- }
- return nil
-}
-
-type memorySettings struct {
- name string
- value *int64
-}
-
-func getMemorySettings(resources *specs.LinuxResources) []memorySettings {
- mem := resources.Memory
- var swappiness *int64
- if mem.Swappiness != nil {
- v := int64(*mem.Swappiness)
- swappiness = &v
- }
- return []memorySettings{
- {
- name: "limit_in_bytes",
- value: mem.Limit,
- },
- {
- name: "soft_limit_in_bytes",
- value: mem.Reservation,
- },
- {
- name: "memsw.limit_in_bytes",
- value: mem.Swap,
- },
- {
- name: "kmem.limit_in_bytes",
- value: mem.Kernel,
- },
- {
- name: "kmem.tcp.limit_in_bytes",
- value: mem.KernelTCP,
- },
- {
- name: "oom_control",
- value: getOomControlValue(mem),
- },
- {
- name: "swappiness",
- value: swappiness,
- },
- }
-}
-
-func checkEBUSY(err error) error {
- if pathErr, ok := err.(*os.PathError); ok {
- if errNo, ok := pathErr.Err.(syscall.Errno); ok {
- if errNo == unix.EBUSY {
- return fmt.Errorf(
- "failed to set memory.kmem.limit_in_bytes, because either tasks have already joined this cgroup or it has children")
- }
- }
- }
- return err
-}
-
-func getOomControlValue(mem *specs.LinuxMemory) *int64 {
- if mem.DisableOOMKiller != nil && *mem.DisableOOMKiller {
- i := int64(1)
- return &i
- }
- return nil
-}
-
-func (m *memoryController) memoryEvent(path string, event MemoryEvent) (uintptr, error) {
- root := m.Path(path)
- efd, err := unix.Eventfd(0, unix.EFD_CLOEXEC)
- if err != nil {
- return 0, err
- }
- evtFile, err := os.Open(filepath.Join(root, event.EventFile()))
- if err != nil {
- unix.Close(efd)
- return 0, err
- }
- defer evtFile.Close()
- data := fmt.Sprintf("%d %d %s", efd, evtFile.Fd(), event.Arg())
- evctlPath := filepath.Join(root, "cgroup.event_control")
- if err := retryingWriteFile(evctlPath, []byte(data), 0700); err != nil {
- unix.Close(efd)
- return 0, err
- }
- return uintptr(efd), nil
-}
diff --git a/vendor/github.com/containerd/cgroups/named.go b/vendor/github.com/containerd/cgroups/named.go
deleted file mode 100644
index 06b16c3b1..000000000
--- a/vendor/github.com/containerd/cgroups/named.go
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cgroups
-
-import "path/filepath"
-
-func NewNamed(root string, name Name) *namedController {
- return &namedController{
- root: root,
- name: name,
- }
-}
-
-type namedController struct {
- root string
- name Name
-}
-
-func (n *namedController) Name() Name {
- return n.name
-}
-
-func (n *namedController) Path(path string) string {
- return filepath.Join(n.root, string(n.name), path)
-}
diff --git a/vendor/github.com/containerd/cgroups/net_cls.go b/vendor/github.com/containerd/cgroups/net_cls.go
deleted file mode 100644
index 28882575a..000000000
--- a/vendor/github.com/containerd/cgroups/net_cls.go
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cgroups
-
-import (
- "os"
- "path/filepath"
- "strconv"
-
- specs "github.com/opencontainers/runtime-spec/specs-go"
-)
-
-func NewNetCls(root string) *netclsController {
- return &netclsController{
- root: filepath.Join(root, string(NetCLS)),
- }
-}
-
-type netclsController struct {
- root string
-}
-
-func (n *netclsController) Name() Name {
- return NetCLS
-}
-
-func (n *netclsController) Path(path string) string {
- return filepath.Join(n.root, path)
-}
-
-func (n *netclsController) Create(path string, resources *specs.LinuxResources) error {
- if err := os.MkdirAll(n.Path(path), defaultDirPerm); err != nil {
- return err
- }
- if resources.Network != nil && resources.Network.ClassID != nil && *resources.Network.ClassID > 0 {
- return retryingWriteFile(
- filepath.Join(n.Path(path), "net_cls.classid"),
- []byte(strconv.FormatUint(uint64(*resources.Network.ClassID), 10)),
- defaultFilePerm,
- )
- }
- return nil
-}
diff --git a/vendor/github.com/containerd/cgroups/net_prio.go b/vendor/github.com/containerd/cgroups/net_prio.go
deleted file mode 100644
index 6362fd084..000000000
--- a/vendor/github.com/containerd/cgroups/net_prio.go
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cgroups
-
-import (
- "fmt"
- "os"
- "path/filepath"
-
- specs "github.com/opencontainers/runtime-spec/specs-go"
-)
-
-func NewNetPrio(root string) *netprioController {
- return &netprioController{
- root: filepath.Join(root, string(NetPrio)),
- }
-}
-
-type netprioController struct {
- root string
-}
-
-func (n *netprioController) Name() Name {
- return NetPrio
-}
-
-func (n *netprioController) Path(path string) string {
- return filepath.Join(n.root, path)
-}
-
-func (n *netprioController) Create(path string, resources *specs.LinuxResources) error {
- if err := os.MkdirAll(n.Path(path), defaultDirPerm); err != nil {
- return err
- }
- if resources.Network != nil {
- for _, prio := range resources.Network.Priorities {
- if err := retryingWriteFile(
- filepath.Join(n.Path(path), "net_prio.ifpriomap"),
- formatPrio(prio.Name, prio.Priority),
- defaultFilePerm,
- ); err != nil {
- return err
- }
- }
- }
- return nil
-}
-
-func formatPrio(name string, prio uint32) []byte {
- return []byte(fmt.Sprintf("%s %d", name, prio))
-}
diff --git a/vendor/github.com/containerd/cgroups/opts.go b/vendor/github.com/containerd/cgroups/opts.go
deleted file mode 100644
index a1449e298..000000000
--- a/vendor/github.com/containerd/cgroups/opts.go
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cgroups
-
-import (
- "github.com/pkg/errors"
-)
-
-var (
- // ErrIgnoreSubsystem allows the specific subsystem to be skipped
- ErrIgnoreSubsystem = errors.New("skip subsystem")
- // ErrDevicesRequired is returned when the devices subsystem is required but
- // does not exist or is not active
- ErrDevicesRequired = errors.New("devices subsystem is required")
-)
-
-// InitOpts allows configuration for the creation or loading of a cgroup
-type InitOpts func(*InitConfig) error
-
-// InitConfig provides configuration options for the creation
-// or loading of a cgroup and its subsystems
-type InitConfig struct {
- // InitCheck can be used to check initialization errors from the subsystem
- InitCheck InitCheck
-}
-
-func newInitConfig() *InitConfig {
- return &InitConfig{
- InitCheck: RequireDevices,
- }
-}
-
-// InitCheck allows subsystems errors to be checked when initialized or loaded
-type InitCheck func(Subsystem, Path, error) error
-
-// AllowAny allows any subsystem errors to be skipped
-func AllowAny(_ Subsystem, _ Path, _ error) error {
- return ErrIgnoreSubsystem
-}
-
-// RequireDevices requires the device subsystem but no others
-func RequireDevices(s Subsystem, _ Path, _ error) error {
- if s.Name() == Devices {
- return ErrDevicesRequired
- }
- return ErrIgnoreSubsystem
-}
diff --git a/vendor/github.com/containerd/cgroups/paths.go b/vendor/github.com/containerd/cgroups/paths.go
deleted file mode 100644
index 27197ecad..000000000
--- a/vendor/github.com/containerd/cgroups/paths.go
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cgroups
-
-import (
- "fmt"
- "path/filepath"
-
- "github.com/pkg/errors"
-)
-
-type Path func(subsystem Name) (string, error)
-
-func RootPath(subsystem Name) (string, error) {
- return "/", nil
-}
-
-// StaticPath returns a static path to use for all cgroups
-func StaticPath(path string) Path {
- return func(_ Name) (string, error) {
- return path, nil
- }
-}
-
-// NestedPath will nest the cgroups based on the calling processes cgroup
-// placing its child processes inside its own path
-func NestedPath(suffix string) Path {
- paths, err := parseCgroupFile("/proc/self/cgroup")
- if err != nil {
- return errorPath(err)
- }
- return existingPath(paths, suffix)
-}
-
-// PidPath will return the correct cgroup paths for an existing process running inside a cgroup
-// This is commonly used for the Load function to restore an existing container
-func PidPath(pid int) Path {
- p := fmt.Sprintf("/proc/%d/cgroup", pid)
- paths, err := parseCgroupFile(p)
- if err != nil {
- return errorPath(errors.Wrapf(err, "parse cgroup file %s", p))
- }
- return existingPath(paths, "")
-}
-
-// ErrControllerNotActive is returned when a controller is not supported or enabled
-var ErrControllerNotActive = errors.New("controller is not supported")
-
-func existingPath(paths map[string]string, suffix string) Path {
- // localize the paths based on the root mount dest for nested cgroups
- for n, p := range paths {
- dest, err := getCgroupDestination(n)
- if err != nil {
- return errorPath(err)
- }
- rel, err := filepath.Rel(dest, p)
- if err != nil {
- return errorPath(err)
- }
- if rel == "." {
- rel = dest
- }
- paths[n] = filepath.Join("/", rel)
- }
- return func(name Name) (string, error) {
- root, ok := paths[string(name)]
- if !ok {
- if root, ok = paths["name="+string(name)]; !ok {
- return "", ErrControllerNotActive
- }
- }
- if suffix != "" {
- return filepath.Join(root, suffix), nil
- }
- return root, nil
- }
-}
-
-func subPath(path Path, subName string) Path {
- return func(name Name) (string, error) {
- p, err := path(name)
- if err != nil {
- return "", err
- }
- return filepath.Join(p, subName), nil
- }
-}
-
-func errorPath(err error) Path {
- return func(_ Name) (string, error) {
- return "", err
- }
-}
diff --git a/vendor/github.com/containerd/cgroups/perf_event.go b/vendor/github.com/containerd/cgroups/perf_event.go
deleted file mode 100644
index 648786db6..000000000
--- a/vendor/github.com/containerd/cgroups/perf_event.go
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cgroups
-
-import "path/filepath"
-
-func NewPerfEvent(root string) *PerfEventController {
- return &PerfEventController{
- root: filepath.Join(root, string(PerfEvent)),
- }
-}
-
-type PerfEventController struct {
- root string
-}
-
-func (p *PerfEventController) Name() Name {
- return PerfEvent
-}
-
-func (p *PerfEventController) Path(path string) string {
- return filepath.Join(p.root, path)
-}
diff --git a/vendor/github.com/containerd/cgroups/pids.go b/vendor/github.com/containerd/cgroups/pids.go
deleted file mode 100644
index ce78e44c1..000000000
--- a/vendor/github.com/containerd/cgroups/pids.go
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cgroups
-
-import (
- "io/ioutil"
- "os"
- "path/filepath"
- "strconv"
- "strings"
-
- v1 "github.com/containerd/cgroups/stats/v1"
- specs "github.com/opencontainers/runtime-spec/specs-go"
-)
-
-func NewPids(root string) *pidsController {
- return &pidsController{
- root: filepath.Join(root, string(Pids)),
- }
-}
-
-type pidsController struct {
- root string
-}
-
-func (p *pidsController) Name() Name {
- return Pids
-}
-
-func (p *pidsController) Path(path string) string {
- return filepath.Join(p.root, path)
-}
-
-func (p *pidsController) Create(path string, resources *specs.LinuxResources) error {
- if err := os.MkdirAll(p.Path(path), defaultDirPerm); err != nil {
- return err
- }
- if resources.Pids != nil && resources.Pids.Limit > 0 {
- return retryingWriteFile(
- filepath.Join(p.Path(path), "pids.max"),
- []byte(strconv.FormatInt(resources.Pids.Limit, 10)),
- defaultFilePerm,
- )
- }
- return nil
-}
-
-func (p *pidsController) Update(path string, resources *specs.LinuxResources) error {
- return p.Create(path, resources)
-}
-
-func (p *pidsController) Stat(path string, stats *v1.Metrics) error {
- current, err := readUint(filepath.Join(p.Path(path), "pids.current"))
- if err != nil {
- return err
- }
- var max uint64
- maxData, err := ioutil.ReadFile(filepath.Join(p.Path(path), "pids.max"))
- if err != nil {
- return err
- }
- if maxS := strings.TrimSpace(string(maxData)); maxS != "max" {
- if max, err = parseUint(maxS, 10, 64); err != nil {
- return err
- }
- }
- stats.Pids = &v1.PidsStat{
- Current: current,
- Limit: max,
- }
- return nil
-}
diff --git a/vendor/github.com/containerd/cgroups/rdma.go b/vendor/github.com/containerd/cgroups/rdma.go
deleted file mode 100644
index b6f0d416c..000000000
--- a/vendor/github.com/containerd/cgroups/rdma.go
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cgroups
-
-import (
- "io/ioutil"
- "math"
- "os"
- "path/filepath"
- "strconv"
- "strings"
-
- v1 "github.com/containerd/cgroups/stats/v1"
- specs "github.com/opencontainers/runtime-spec/specs-go"
-)
-
-type rdmaController struct {
- root string
-}
-
-func (p *rdmaController) Name() Name {
- return Rdma
-}
-
-func (p *rdmaController) Path(path string) string {
- return filepath.Join(p.root, path)
-}
-
-func NewRdma(root string) *rdmaController {
- return &rdmaController{
- root: filepath.Join(root, string(Rdma)),
- }
-}
-
-func createCmdString(device string, limits *specs.LinuxRdma) string {
- var cmdString string
-
- cmdString = device
- if limits.HcaHandles != nil {
- cmdString = cmdString + " " + "hca_handle=" + strconv.FormatUint(uint64(*limits.HcaHandles), 10)
- }
-
- if limits.HcaObjects != nil {
- cmdString = cmdString + " " + "hca_object=" + strconv.FormatUint(uint64(*limits.HcaObjects), 10)
- }
- return cmdString
-}
-
-func (p *rdmaController) Create(path string, resources *specs.LinuxResources) error {
- if err := os.MkdirAll(p.Path(path), defaultDirPerm); err != nil {
- return err
- }
-
- for device, limit := range resources.Rdma {
- if device != "" && (limit.HcaHandles != nil || limit.HcaObjects != nil) {
- return retryingWriteFile(
- filepath.Join(p.Path(path), "rdma.max"),
- []byte(createCmdString(device, &limit)),
- defaultFilePerm,
- )
- }
- }
- return nil
-}
-
-func (p *rdmaController) Update(path string, resources *specs.LinuxResources) error {
- return p.Create(path, resources)
-}
-
-func parseRdmaKV(raw string, entry *v1.RdmaEntry) {
- var value uint64
- var err error
-
- parts := strings.Split(raw, "=")
- switch len(parts) {
- case 2:
- if parts[1] == "max" {
- value = math.MaxUint32
- } else {
- value, err = parseUint(parts[1], 10, 32)
- if err != nil {
- return
- }
- }
- if parts[0] == "hca_handle" {
- entry.HcaHandles = uint32(value)
- } else if parts[0] == "hca_object" {
- entry.HcaObjects = uint32(value)
- }
- }
-}
-
-func toRdmaEntry(strEntries []string) []*v1.RdmaEntry {
- var rdmaEntries []*v1.RdmaEntry
- for i := range strEntries {
- parts := strings.Fields(strEntries[i])
- switch len(parts) {
- case 3:
- entry := new(v1.RdmaEntry)
- entry.Device = parts[0]
- parseRdmaKV(parts[1], entry)
- parseRdmaKV(parts[2], entry)
-
- rdmaEntries = append(rdmaEntries, entry)
- default:
- continue
- }
- }
- return rdmaEntries
-}
-
-func (p *rdmaController) Stat(path string, stats *v1.Metrics) error {
-
- currentData, err := ioutil.ReadFile(filepath.Join(p.Path(path), "rdma.current"))
- if err != nil {
- return err
- }
- currentPerDevices := strings.Split(string(currentData), "\n")
-
- maxData, err := ioutil.ReadFile(filepath.Join(p.Path(path), "rdma.max"))
- if err != nil {
- return err
- }
- maxPerDevices := strings.Split(string(maxData), "\n")
-
- // If device got removed between reading two files, ignore returning
- // stats.
- if len(currentPerDevices) != len(maxPerDevices) {
- return nil
- }
-
- currentEntries := toRdmaEntry(currentPerDevices)
- maxEntries := toRdmaEntry(maxPerDevices)
-
- stats.Rdma = &v1.RdmaStat{
- Current: currentEntries,
- Limit: maxEntries,
- }
- return nil
-}
diff --git a/vendor/github.com/containerd/cgroups/state.go b/vendor/github.com/containerd/cgroups/state.go
deleted file mode 100644
index cfeabbbc6..000000000
--- a/vendor/github.com/containerd/cgroups/state.go
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cgroups
-
-// State is a type that represents the state of the current cgroup
-type State string
-
-const (
- Unknown State = ""
- Thawed State = "thawed"
- Frozen State = "frozen"
- Freezing State = "freezing"
- Deleted State = "deleted"
-)
diff --git a/vendor/github.com/containerd/cgroups/stats/v1/doc.go b/vendor/github.com/containerd/cgroups/stats/v1/doc.go
deleted file mode 100644
index 23f3cdd4b..000000000
--- a/vendor/github.com/containerd/cgroups/stats/v1/doc.go
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package v1
diff --git a/vendor/github.com/containerd/cgroups/stats/v1/metrics.pb.go b/vendor/github.com/containerd/cgroups/stats/v1/metrics.pb.go
deleted file mode 100644
index 713376d5e..000000000
--- a/vendor/github.com/containerd/cgroups/stats/v1/metrics.pb.go
+++ /dev/null
@@ -1,5714 +0,0 @@
-// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: github.com/containerd/cgroups/stats/v1/metrics.proto
-
-package v1
-
-import (
- fmt "fmt"
- _ "github.com/gogo/protobuf/gogoproto"
- proto "github.com/gogo/protobuf/proto"
- io "io"
- math "math"
- reflect "reflect"
- strings "strings"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
-
-type Metrics struct {
- Hugetlb []*HugetlbStat `protobuf:"bytes,1,rep,name=hugetlb,proto3" json:"hugetlb,omitempty"`
- Pids *PidsStat `protobuf:"bytes,2,opt,name=pids,proto3" json:"pids,omitempty"`
- CPU *CPUStat `protobuf:"bytes,3,opt,name=cpu,proto3" json:"cpu,omitempty"`
- Memory *MemoryStat `protobuf:"bytes,4,opt,name=memory,proto3" json:"memory,omitempty"`
- Blkio *BlkIOStat `protobuf:"bytes,5,opt,name=blkio,proto3" json:"blkio,omitempty"`
- Rdma *RdmaStat `protobuf:"bytes,6,opt,name=rdma,proto3" json:"rdma,omitempty"`
- Network []*NetworkStat `protobuf:"bytes,7,rep,name=network,proto3" json:"network,omitempty"`
- CgroupStats *CgroupStats `protobuf:"bytes,8,opt,name=cgroup_stats,json=cgroupStats,proto3" json:"cgroup_stats,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Metrics) Reset() { *m = Metrics{} }
-func (*Metrics) ProtoMessage() {}
-func (*Metrics) Descriptor() ([]byte, []int) {
- return fileDescriptor_a17b2d87c332bfaa, []int{0}
-}
-func (m *Metrics) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Metrics) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_Metrics.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *Metrics) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Metrics.Merge(m, src)
-}
-func (m *Metrics) XXX_Size() int {
- return m.Size()
-}
-func (m *Metrics) XXX_DiscardUnknown() {
- xxx_messageInfo_Metrics.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Metrics proto.InternalMessageInfo
-
-type HugetlbStat struct {
- Usage uint64 `protobuf:"varint,1,opt,name=usage,proto3" json:"usage,omitempty"`
- Max uint64 `protobuf:"varint,2,opt,name=max,proto3" json:"max,omitempty"`
- Failcnt uint64 `protobuf:"varint,3,opt,name=failcnt,proto3" json:"failcnt,omitempty"`
- Pagesize string `protobuf:"bytes,4,opt,name=pagesize,proto3" json:"pagesize,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *HugetlbStat) Reset() { *m = HugetlbStat{} }
-func (*HugetlbStat) ProtoMessage() {}
-func (*HugetlbStat) Descriptor() ([]byte, []int) {
- return fileDescriptor_a17b2d87c332bfaa, []int{1}
-}
-func (m *HugetlbStat) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *HugetlbStat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_HugetlbStat.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *HugetlbStat) XXX_Merge(src proto.Message) {
- xxx_messageInfo_HugetlbStat.Merge(m, src)
-}
-func (m *HugetlbStat) XXX_Size() int {
- return m.Size()
-}
-func (m *HugetlbStat) XXX_DiscardUnknown() {
- xxx_messageInfo_HugetlbStat.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_HugetlbStat proto.InternalMessageInfo
-
-type PidsStat struct {
- Current uint64 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"`
- Limit uint64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *PidsStat) Reset() { *m = PidsStat{} }
-func (*PidsStat) ProtoMessage() {}
-func (*PidsStat) Descriptor() ([]byte, []int) {
- return fileDescriptor_a17b2d87c332bfaa, []int{2}
-}
-func (m *PidsStat) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PidsStat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_PidsStat.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *PidsStat) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PidsStat.Merge(m, src)
-}
-func (m *PidsStat) XXX_Size() int {
- return m.Size()
-}
-func (m *PidsStat) XXX_DiscardUnknown() {
- xxx_messageInfo_PidsStat.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_PidsStat proto.InternalMessageInfo
-
-type CPUStat struct {
- Usage *CPUUsage `protobuf:"bytes,1,opt,name=usage,proto3" json:"usage,omitempty"`
- Throttling *Throttle `protobuf:"bytes,2,opt,name=throttling,proto3" json:"throttling,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *CPUStat) Reset() { *m = CPUStat{} }
-func (*CPUStat) ProtoMessage() {}
-func (*CPUStat) Descriptor() ([]byte, []int) {
- return fileDescriptor_a17b2d87c332bfaa, []int{3}
-}
-func (m *CPUStat) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *CPUStat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_CPUStat.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *CPUStat) XXX_Merge(src proto.Message) {
- xxx_messageInfo_CPUStat.Merge(m, src)
-}
-func (m *CPUStat) XXX_Size() int {
- return m.Size()
-}
-func (m *CPUStat) XXX_DiscardUnknown() {
- xxx_messageInfo_CPUStat.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CPUStat proto.InternalMessageInfo
-
-type CPUUsage struct {
- // values in nanoseconds
- Total uint64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
- Kernel uint64 `protobuf:"varint,2,opt,name=kernel,proto3" json:"kernel,omitempty"`
- User uint64 `protobuf:"varint,3,opt,name=user,proto3" json:"user,omitempty"`
- PerCPU []uint64 `protobuf:"varint,4,rep,packed,name=per_cpu,json=perCpu,proto3" json:"per_cpu,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *CPUUsage) Reset() { *m = CPUUsage{} }
-func (*CPUUsage) ProtoMessage() {}
-func (*CPUUsage) Descriptor() ([]byte, []int) {
- return fileDescriptor_a17b2d87c332bfaa, []int{4}
-}
-func (m *CPUUsage) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *CPUUsage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_CPUUsage.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *CPUUsage) XXX_Merge(src proto.Message) {
- xxx_messageInfo_CPUUsage.Merge(m, src)
-}
-func (m *CPUUsage) XXX_Size() int {
- return m.Size()
-}
-func (m *CPUUsage) XXX_DiscardUnknown() {
- xxx_messageInfo_CPUUsage.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CPUUsage proto.InternalMessageInfo
-
-type Throttle struct {
- Periods uint64 `protobuf:"varint,1,opt,name=periods,proto3" json:"periods,omitempty"`
- ThrottledPeriods uint64 `protobuf:"varint,2,opt,name=throttled_periods,json=throttledPeriods,proto3" json:"throttled_periods,omitempty"`
- ThrottledTime uint64 `protobuf:"varint,3,opt,name=throttled_time,json=throttledTime,proto3" json:"throttled_time,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Throttle) Reset() { *m = Throttle{} }
-func (*Throttle) ProtoMessage() {}
-func (*Throttle) Descriptor() ([]byte, []int) {
- return fileDescriptor_a17b2d87c332bfaa, []int{5}
-}
-func (m *Throttle) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Throttle) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_Throttle.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *Throttle) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Throttle.Merge(m, src)
-}
-func (m *Throttle) XXX_Size() int {
- return m.Size()
-}
-func (m *Throttle) XXX_DiscardUnknown() {
- xxx_messageInfo_Throttle.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Throttle proto.InternalMessageInfo
-
-type MemoryStat struct {
- Cache uint64 `protobuf:"varint,1,opt,name=cache,proto3" json:"cache,omitempty"`
- RSS uint64 `protobuf:"varint,2,opt,name=rss,proto3" json:"rss,omitempty"`
- RSSHuge uint64 `protobuf:"varint,3,opt,name=rss_huge,json=rssHuge,proto3" json:"rss_huge,omitempty"`
- MappedFile uint64 `protobuf:"varint,4,opt,name=mapped_file,json=mappedFile,proto3" json:"mapped_file,omitempty"`
- Dirty uint64 `protobuf:"varint,5,opt,name=dirty,proto3" json:"dirty,omitempty"`
- Writeback uint64 `protobuf:"varint,6,opt,name=writeback,proto3" json:"writeback,omitempty"`
- PgPgIn uint64 `protobuf:"varint,7,opt,name=pg_pg_in,json=pgPgIn,proto3" json:"pg_pg_in,omitempty"`
- PgPgOut uint64 `protobuf:"varint,8,opt,name=pg_pg_out,json=pgPgOut,proto3" json:"pg_pg_out,omitempty"`
- PgFault uint64 `protobuf:"varint,9,opt,name=pg_fault,json=pgFault,proto3" json:"pg_fault,omitempty"`
- PgMajFault uint64 `protobuf:"varint,10,opt,name=pg_maj_fault,json=pgMajFault,proto3" json:"pg_maj_fault,omitempty"`
- InactiveAnon uint64 `protobuf:"varint,11,opt,name=inactive_anon,json=inactiveAnon,proto3" json:"inactive_anon,omitempty"`
- ActiveAnon uint64 `protobuf:"varint,12,opt,name=active_anon,json=activeAnon,proto3" json:"active_anon,omitempty"`
- InactiveFile uint64 `protobuf:"varint,13,opt,name=inactive_file,json=inactiveFile,proto3" json:"inactive_file,omitempty"`
- ActiveFile uint64 `protobuf:"varint,14,opt,name=active_file,json=activeFile,proto3" json:"active_file,omitempty"`
- Unevictable uint64 `protobuf:"varint,15,opt,name=unevictable,proto3" json:"unevictable,omitempty"`
- HierarchicalMemoryLimit uint64 `protobuf:"varint,16,opt,name=hierarchical_memory_limit,json=hierarchicalMemoryLimit,proto3" json:"hierarchical_memory_limit,omitempty"`
- HierarchicalSwapLimit uint64 `protobuf:"varint,17,opt,name=hierarchical_swap_limit,json=hierarchicalSwapLimit,proto3" json:"hierarchical_swap_limit,omitempty"`
- TotalCache uint64 `protobuf:"varint,18,opt,name=total_cache,json=totalCache,proto3" json:"total_cache,omitempty"`
- TotalRSS uint64 `protobuf:"varint,19,opt,name=total_rss,json=totalRss,proto3" json:"total_rss,omitempty"`
- TotalRSSHuge uint64 `protobuf:"varint,20,opt,name=total_rss_huge,json=totalRssHuge,proto3" json:"total_rss_huge,omitempty"`
- TotalMappedFile uint64 `protobuf:"varint,21,opt,name=total_mapped_file,json=totalMappedFile,proto3" json:"total_mapped_file,omitempty"`
- TotalDirty uint64 `protobuf:"varint,22,opt,name=total_dirty,json=totalDirty,proto3" json:"total_dirty,omitempty"`
- TotalWriteback uint64 `protobuf:"varint,23,opt,name=total_writeback,json=totalWriteback,proto3" json:"total_writeback,omitempty"`
- TotalPgPgIn uint64 `protobuf:"varint,24,opt,name=total_pg_pg_in,json=totalPgPgIn,proto3" json:"total_pg_pg_in,omitempty"`
- TotalPgPgOut uint64 `protobuf:"varint,25,opt,name=total_pg_pg_out,json=totalPgPgOut,proto3" json:"total_pg_pg_out,omitempty"`
- TotalPgFault uint64 `protobuf:"varint,26,opt,name=total_pg_fault,json=totalPgFault,proto3" json:"total_pg_fault,omitempty"`
- TotalPgMajFault uint64 `protobuf:"varint,27,opt,name=total_pg_maj_fault,json=totalPgMajFault,proto3" json:"total_pg_maj_fault,omitempty"`
- TotalInactiveAnon uint64 `protobuf:"varint,28,opt,name=total_inactive_anon,json=totalInactiveAnon,proto3" json:"total_inactive_anon,omitempty"`
- TotalActiveAnon uint64 `protobuf:"varint,29,opt,name=total_active_anon,json=totalActiveAnon,proto3" json:"total_active_anon,omitempty"`
- TotalInactiveFile uint64 `protobuf:"varint,30,opt,name=total_inactive_file,json=totalInactiveFile,proto3" json:"total_inactive_file,omitempty"`
- TotalActiveFile uint64 `protobuf:"varint,31,opt,name=total_active_file,json=totalActiveFile,proto3" json:"total_active_file,omitempty"`
- TotalUnevictable uint64 `protobuf:"varint,32,opt,name=total_unevictable,json=totalUnevictable,proto3" json:"total_unevictable,omitempty"`
- Usage *MemoryEntry `protobuf:"bytes,33,opt,name=usage,proto3" json:"usage,omitempty"`
- Swap *MemoryEntry `protobuf:"bytes,34,opt,name=swap,proto3" json:"swap,omitempty"`
- Kernel *MemoryEntry `protobuf:"bytes,35,opt,name=kernel,proto3" json:"kernel,omitempty"`
- KernelTCP *MemoryEntry `protobuf:"bytes,36,opt,name=kernel_tcp,json=kernelTcp,proto3" json:"kernel_tcp,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *MemoryStat) Reset() { *m = MemoryStat{} }
-func (*MemoryStat) ProtoMessage() {}
-func (*MemoryStat) Descriptor() ([]byte, []int) {
- return fileDescriptor_a17b2d87c332bfaa, []int{6}
-}
-func (m *MemoryStat) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *MemoryStat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_MemoryStat.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *MemoryStat) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MemoryStat.Merge(m, src)
-}
-func (m *MemoryStat) XXX_Size() int {
- return m.Size()
-}
-func (m *MemoryStat) XXX_DiscardUnknown() {
- xxx_messageInfo_MemoryStat.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_MemoryStat proto.InternalMessageInfo
-
-type MemoryEntry struct {
- Limit uint64 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"`
- Usage uint64 `protobuf:"varint,2,opt,name=usage,proto3" json:"usage,omitempty"`
- Max uint64 `protobuf:"varint,3,opt,name=max,proto3" json:"max,omitempty"`
- Failcnt uint64 `protobuf:"varint,4,opt,name=failcnt,proto3" json:"failcnt,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *MemoryEntry) Reset() { *m = MemoryEntry{} }
-func (*MemoryEntry) ProtoMessage() {}
-func (*MemoryEntry) Descriptor() ([]byte, []int) {
- return fileDescriptor_a17b2d87c332bfaa, []int{7}
-}
-func (m *MemoryEntry) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *MemoryEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_MemoryEntry.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *MemoryEntry) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MemoryEntry.Merge(m, src)
-}
-func (m *MemoryEntry) XXX_Size() int {
- return m.Size()
-}
-func (m *MemoryEntry) XXX_DiscardUnknown() {
- xxx_messageInfo_MemoryEntry.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_MemoryEntry proto.InternalMessageInfo
-
-type BlkIOStat struct {
- IoServiceBytesRecursive []*BlkIOEntry `protobuf:"bytes,1,rep,name=io_service_bytes_recursive,json=ioServiceBytesRecursive,proto3" json:"io_service_bytes_recursive,omitempty"`
- IoServicedRecursive []*BlkIOEntry `protobuf:"bytes,2,rep,name=io_serviced_recursive,json=ioServicedRecursive,proto3" json:"io_serviced_recursive,omitempty"`
- IoQueuedRecursive []*BlkIOEntry `protobuf:"bytes,3,rep,name=io_queued_recursive,json=ioQueuedRecursive,proto3" json:"io_queued_recursive,omitempty"`
- IoServiceTimeRecursive []*BlkIOEntry `protobuf:"bytes,4,rep,name=io_service_time_recursive,json=ioServiceTimeRecursive,proto3" json:"io_service_time_recursive,omitempty"`
- IoWaitTimeRecursive []*BlkIOEntry `protobuf:"bytes,5,rep,name=io_wait_time_recursive,json=ioWaitTimeRecursive,proto3" json:"io_wait_time_recursive,omitempty"`
- IoMergedRecursive []*BlkIOEntry `protobuf:"bytes,6,rep,name=io_merged_recursive,json=ioMergedRecursive,proto3" json:"io_merged_recursive,omitempty"`
- IoTimeRecursive []*BlkIOEntry `protobuf:"bytes,7,rep,name=io_time_recursive,json=ioTimeRecursive,proto3" json:"io_time_recursive,omitempty"`
- SectorsRecursive []*BlkIOEntry `protobuf:"bytes,8,rep,name=sectors_recursive,json=sectorsRecursive,proto3" json:"sectors_recursive,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *BlkIOStat) Reset() { *m = BlkIOStat{} }
-func (*BlkIOStat) ProtoMessage() {}
-func (*BlkIOStat) Descriptor() ([]byte, []int) {
- return fileDescriptor_a17b2d87c332bfaa, []int{8}
-}
-func (m *BlkIOStat) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *BlkIOStat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_BlkIOStat.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *BlkIOStat) XXX_Merge(src proto.Message) {
- xxx_messageInfo_BlkIOStat.Merge(m, src)
-}
-func (m *BlkIOStat) XXX_Size() int {
- return m.Size()
-}
-func (m *BlkIOStat) XXX_DiscardUnknown() {
- xxx_messageInfo_BlkIOStat.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_BlkIOStat proto.InternalMessageInfo
-
-type BlkIOEntry struct {
- Op string `protobuf:"bytes,1,opt,name=op,proto3" json:"op,omitempty"`
- Device string `protobuf:"bytes,2,opt,name=device,proto3" json:"device,omitempty"`
- Major uint64 `protobuf:"varint,3,opt,name=major,proto3" json:"major,omitempty"`
- Minor uint64 `protobuf:"varint,4,opt,name=minor,proto3" json:"minor,omitempty"`
- Value uint64 `protobuf:"varint,5,opt,name=value,proto3" json:"value,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *BlkIOEntry) Reset() { *m = BlkIOEntry{} }
-func (*BlkIOEntry) ProtoMessage() {}
-func (*BlkIOEntry) Descriptor() ([]byte, []int) {
- return fileDescriptor_a17b2d87c332bfaa, []int{9}
-}
-func (m *BlkIOEntry) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *BlkIOEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_BlkIOEntry.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *BlkIOEntry) XXX_Merge(src proto.Message) {
- xxx_messageInfo_BlkIOEntry.Merge(m, src)
-}
-func (m *BlkIOEntry) XXX_Size() int {
- return m.Size()
-}
-func (m *BlkIOEntry) XXX_DiscardUnknown() {
- xxx_messageInfo_BlkIOEntry.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_BlkIOEntry proto.InternalMessageInfo
-
-type RdmaStat struct {
- Current []*RdmaEntry `protobuf:"bytes,1,rep,name=current,proto3" json:"current,omitempty"`
- Limit []*RdmaEntry `protobuf:"bytes,2,rep,name=limit,proto3" json:"limit,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *RdmaStat) Reset() { *m = RdmaStat{} }
-func (*RdmaStat) ProtoMessage() {}
-func (*RdmaStat) Descriptor() ([]byte, []int) {
- return fileDescriptor_a17b2d87c332bfaa, []int{10}
-}
-func (m *RdmaStat) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *RdmaStat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_RdmaStat.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *RdmaStat) XXX_Merge(src proto.Message) {
- xxx_messageInfo_RdmaStat.Merge(m, src)
-}
-func (m *RdmaStat) XXX_Size() int {
- return m.Size()
-}
-func (m *RdmaStat) XXX_DiscardUnknown() {
- xxx_messageInfo_RdmaStat.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_RdmaStat proto.InternalMessageInfo
-
-type RdmaEntry struct {
- Device string `protobuf:"bytes,1,opt,name=device,proto3" json:"device,omitempty"`
- HcaHandles uint32 `protobuf:"varint,2,opt,name=hca_handles,json=hcaHandles,proto3" json:"hca_handles,omitempty"`
- HcaObjects uint32 `protobuf:"varint,3,opt,name=hca_objects,json=hcaObjects,proto3" json:"hca_objects,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *RdmaEntry) Reset() { *m = RdmaEntry{} }
-func (*RdmaEntry) ProtoMessage() {}
-func (*RdmaEntry) Descriptor() ([]byte, []int) {
- return fileDescriptor_a17b2d87c332bfaa, []int{11}
-}
-func (m *RdmaEntry) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *RdmaEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_RdmaEntry.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *RdmaEntry) XXX_Merge(src proto.Message) {
- xxx_messageInfo_RdmaEntry.Merge(m, src)
-}
-func (m *RdmaEntry) XXX_Size() int {
- return m.Size()
-}
-func (m *RdmaEntry) XXX_DiscardUnknown() {
- xxx_messageInfo_RdmaEntry.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_RdmaEntry proto.InternalMessageInfo
-
-type NetworkStat struct {
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- RxBytes uint64 `protobuf:"varint,2,opt,name=rx_bytes,json=rxBytes,proto3" json:"rx_bytes,omitempty"`
- RxPackets uint64 `protobuf:"varint,3,opt,name=rx_packets,json=rxPackets,proto3" json:"rx_packets,omitempty"`
- RxErrors uint64 `protobuf:"varint,4,opt,name=rx_errors,json=rxErrors,proto3" json:"rx_errors,omitempty"`
- RxDropped uint64 `protobuf:"varint,5,opt,name=rx_dropped,json=rxDropped,proto3" json:"rx_dropped,omitempty"`
- TxBytes uint64 `protobuf:"varint,6,opt,name=tx_bytes,json=txBytes,proto3" json:"tx_bytes,omitempty"`
- TxPackets uint64 `protobuf:"varint,7,opt,name=tx_packets,json=txPackets,proto3" json:"tx_packets,omitempty"`
- TxErrors uint64 `protobuf:"varint,8,opt,name=tx_errors,json=txErrors,proto3" json:"tx_errors,omitempty"`
- TxDropped uint64 `protobuf:"varint,9,opt,name=tx_dropped,json=txDropped,proto3" json:"tx_dropped,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *NetworkStat) Reset() { *m = NetworkStat{} }
-func (*NetworkStat) ProtoMessage() {}
-func (*NetworkStat) Descriptor() ([]byte, []int) {
- return fileDescriptor_a17b2d87c332bfaa, []int{12}
-}
-func (m *NetworkStat) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *NetworkStat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_NetworkStat.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *NetworkStat) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NetworkStat.Merge(m, src)
-}
-func (m *NetworkStat) XXX_Size() int {
- return m.Size()
-}
-func (m *NetworkStat) XXX_DiscardUnknown() {
- xxx_messageInfo_NetworkStat.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NetworkStat proto.InternalMessageInfo
-
-// CgroupStats exports per-cgroup statistics.
-type CgroupStats struct {
- // number of tasks sleeping
- NrSleeping uint64 `protobuf:"varint,1,opt,name=nr_sleeping,json=nrSleeping,proto3" json:"nr_sleeping,omitempty"`
- // number of tasks running
- NrRunning uint64 `protobuf:"varint,2,opt,name=nr_running,json=nrRunning,proto3" json:"nr_running,omitempty"`
- // number of tasks in stopped state
- NrStopped uint64 `protobuf:"varint,3,opt,name=nr_stopped,json=nrStopped,proto3" json:"nr_stopped,omitempty"`
- // number of tasks in uninterruptible state
- NrUninterruptible uint64 `protobuf:"varint,4,opt,name=nr_uninterruptible,json=nrUninterruptible,proto3" json:"nr_uninterruptible,omitempty"`
- // number of tasks waiting on IO
- NrIoWait uint64 `protobuf:"varint,5,opt,name=nr_io_wait,json=nrIoWait,proto3" json:"nr_io_wait,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *CgroupStats) Reset() { *m = CgroupStats{} }
-func (*CgroupStats) ProtoMessage() {}
-func (*CgroupStats) Descriptor() ([]byte, []int) {
- return fileDescriptor_a17b2d87c332bfaa, []int{13}
-}
-func (m *CgroupStats) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *CgroupStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_CgroupStats.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *CgroupStats) XXX_Merge(src proto.Message) {
- xxx_messageInfo_CgroupStats.Merge(m, src)
-}
-func (m *CgroupStats) XXX_Size() int {
- return m.Size()
-}
-func (m *CgroupStats) XXX_DiscardUnknown() {
- xxx_messageInfo_CgroupStats.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CgroupStats proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*Metrics)(nil), "io.containerd.cgroups.v1.Metrics")
- proto.RegisterType((*HugetlbStat)(nil), "io.containerd.cgroups.v1.HugetlbStat")
- proto.RegisterType((*PidsStat)(nil), "io.containerd.cgroups.v1.PidsStat")
- proto.RegisterType((*CPUStat)(nil), "io.containerd.cgroups.v1.CPUStat")
- proto.RegisterType((*CPUUsage)(nil), "io.containerd.cgroups.v1.CPUUsage")
- proto.RegisterType((*Throttle)(nil), "io.containerd.cgroups.v1.Throttle")
- proto.RegisterType((*MemoryStat)(nil), "io.containerd.cgroups.v1.MemoryStat")
- proto.RegisterType((*MemoryEntry)(nil), "io.containerd.cgroups.v1.MemoryEntry")
- proto.RegisterType((*BlkIOStat)(nil), "io.containerd.cgroups.v1.BlkIOStat")
- proto.RegisterType((*BlkIOEntry)(nil), "io.containerd.cgroups.v1.BlkIOEntry")
- proto.RegisterType((*RdmaStat)(nil), "io.containerd.cgroups.v1.RdmaStat")
- proto.RegisterType((*RdmaEntry)(nil), "io.containerd.cgroups.v1.RdmaEntry")
- proto.RegisterType((*NetworkStat)(nil), "io.containerd.cgroups.v1.NetworkStat")
- proto.RegisterType((*CgroupStats)(nil), "io.containerd.cgroups.v1.CgroupStats")
-}
-
-func init() {
- proto.RegisterFile("github.com/containerd/cgroups/stats/v1/metrics.proto", fileDescriptor_a17b2d87c332bfaa)
-}
-
-var fileDescriptor_a17b2d87c332bfaa = []byte{
- // 1669 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x58, 0x4f, 0x73, 0x1b, 0xb7,
- 0x15, 0x0f, 0xc5, 0x95, 0xc8, 0x7d, 0x94, 0x6c, 0x09, 0xfe, 0xb7, 0x52, 0x1c, 0x51, 0xa1, 0xec,
- 0xd6, 0xad, 0xa7, 0xd2, 0x24, 0xed, 0x78, 0xea, 0x34, 0x99, 0x4e, 0xa4, 0x24, 0x63, 0x4f, 0xab,
- 0x9a, 0x59, 0x4a, 0x93, 0xf6, 0xb4, 0x03, 0x2e, 0xe1, 0x25, 0xac, 0xe5, 0x62, 0x83, 0xc5, 0x52,
- 0x74, 0x4f, 0x3d, 0x74, 0xa6, 0xa7, 0x7e, 0xa0, 0x7e, 0x83, 0x1c, 0x7b, 0xe9, 0x4c, 0x7b, 0xd1,
- 0x34, 0xfc, 0x1c, 0x3d, 0x74, 0x80, 0x87, 0xfd, 0x43, 0xc7, 0xb2, 0xc2, 0xdb, 0xe2, 0xe1, 0xf7,
- 0x7e, 0xef, 0xe1, 0xe1, 0x07, 0xe0, 0x91, 0xf0, 0xab, 0x88, 0xab, 0x71, 0x3e, 0x3c, 0x08, 0xc5,
- 0xe4, 0x30, 0x14, 0x89, 0xa2, 0x3c, 0x61, 0x72, 0x74, 0x18, 0x46, 0x52, 0xe4, 0x69, 0x76, 0x98,
- 0x29, 0xaa, 0xb2, 0xc3, 0xe9, 0x47, 0x87, 0x13, 0xa6, 0x24, 0x0f, 0xb3, 0x83, 0x54, 0x0a, 0x25,
- 0x88, 0xc7, 0xc5, 0x41, 0x85, 0x3e, 0xb0, 0xe8, 0x83, 0xe9, 0x47, 0x3b, 0xb7, 0x23, 0x11, 0x09,
- 0x03, 0x3a, 0xd4, 0x5f, 0x88, 0xef, 0xfd, 0xaf, 0x09, 0xad, 0x13, 0x64, 0x20, 0xbf, 0x85, 0xd6,
- 0x38, 0x8f, 0x98, 0x8a, 0x87, 0x5e, 0x63, 0xaf, 0xf9, 0xa8, 0xf3, 0xf1, 0xc3, 0x83, 0xab, 0xd8,
- 0x0e, 0x9e, 0x21, 0x70, 0xa0, 0xa8, 0xf2, 0x0b, 0x2f, 0xf2, 0x04, 0x9c, 0x94, 0x8f, 0x32, 0x6f,
- 0x65, 0xaf, 0xf1, 0xa8, 0xf3, 0x71, 0xef, 0x6a, 0xef, 0x3e, 0x1f, 0x65, 0xc6, 0xd5, 0xe0, 0xc9,
- 0xa7, 0xd0, 0x0c, 0xd3, 0xdc, 0x6b, 0x1a, 0xb7, 0x0f, 0xaf, 0x76, 0x3b, 0xee, 0x9f, 0x69, 0xaf,
- 0xa3, 0xd6, 0xfc, 0xb2, 0xdb, 0x3c, 0xee, 0x9f, 0xf9, 0xda, 0x8d, 0x7c, 0x0a, 0x6b, 0x13, 0x36,
- 0x11, 0xf2, 0xb5, 0xe7, 0x18, 0x82, 0x07, 0x57, 0x13, 0x9c, 0x18, 0x9c, 0x89, 0x6c, 0x7d, 0xc8,
- 0x53, 0x58, 0x1d, 0xc6, 0xe7, 0x5c, 0x78, 0xab, 0xc6, 0x79, 0xff, 0x6a, 0xe7, 0xa3, 0xf8, 0xfc,
- 0xf9, 0x0b, 0xe3, 0x8b, 0x1e, 0x7a, 0xb9, 0x72, 0x34, 0xa1, 0xde, 0xda, 0x75, 0xcb, 0xf5, 0x47,
- 0x13, 0x8a, 0xcb, 0xd5, 0x78, 0x5d, 0xe7, 0x84, 0xa9, 0x0b, 0x21, 0xcf, 0xbd, 0xd6, 0x75, 0x75,
- 0xfe, 0x03, 0x02, 0xb1, 0xce, 0xd6, 0x8b, 0x3c, 0x83, 0x75, 0x84, 0x04, 0x46, 0x05, 0x5e, 0xdb,
- 0x24, 0xf0, 0x0e, 0x96, 0x63, 0xf3, 0xa9, 0x49, 0x32, 0xbf, 0x13, 0x56, 0x83, 0xde, 0x39, 0x74,
- 0x6a, 0x3b, 0x49, 0x6e, 0xc3, 0x6a, 0x9e, 0xd1, 0x88, 0x79, 0x8d, 0xbd, 0xc6, 0x23, 0xc7, 0xc7,
- 0x01, 0xd9, 0x84, 0xe6, 0x84, 0xce, 0xcc, 0xae, 0x3a, 0xbe, 0xfe, 0x24, 0x1e, 0xb4, 0x5e, 0x52,
- 0x1e, 0x87, 0x89, 0x32, 0x9b, 0xe6, 0xf8, 0xc5, 0x90, 0xec, 0x40, 0x3b, 0xa5, 0x11, 0xcb, 0xf8,
- 0x9f, 0x99, 0xd9, 0x0e, 0xd7, 0x2f, 0xc7, 0xbd, 0x4f, 0xa0, 0x5d, 0x6c, 0xbc, 0x66, 0x08, 0x73,
- 0x29, 0x59, 0xa2, 0x6c, 0xac, 0x62, 0xa8, 0x73, 0x88, 0xf9, 0x84, 0x2b, 0x1b, 0x0f, 0x07, 0xbd,
- 0xbf, 0x35, 0xa0, 0x65, 0xb7, 0x9f, 0xfc, 0xba, 0x9e, 0xe5, 0x3b, 0x0b, 0x7f, 0xdc, 0x3f, 0x3b,
- 0xd3, 0xc8, 0x62, 0x25, 0x47, 0x00, 0x6a, 0x2c, 0x85, 0x52, 0x31, 0x4f, 0xa2, 0xeb, 0x65, 0x7a,
- 0x8a, 0x58, 0xe6, 0xd7, 0xbc, 0x7a, 0xdf, 0x42, 0xbb, 0xa0, 0xd5, 0xb9, 0x2a, 0xa1, 0x68, 0x5c,
- 0xd4, 0xcb, 0x0c, 0xc8, 0x5d, 0x58, 0x3b, 0x67, 0x32, 0x61, 0xb1, 0x5d, 0x82, 0x1d, 0x11, 0x02,
- 0x4e, 0x9e, 0x31, 0x69, 0x4b, 0x66, 0xbe, 0xc9, 0x3e, 0xb4, 0x52, 0x26, 0x03, 0x2d, 0x7f, 0x67,
- 0xaf, 0xf9, 0xc8, 0x39, 0x82, 0xf9, 0x65, 0x77, 0xad, 0xcf, 0xa4, 0x96, 0xf7, 0x5a, 0xca, 0xe4,
- 0x71, 0x9a, 0xf7, 0x66, 0xd0, 0x2e, 0x52, 0xd1, 0x85, 0x4b, 0x99, 0xe4, 0x62, 0x94, 0x15, 0x85,
- 0xb3, 0x43, 0xf2, 0x18, 0xb6, 0x6c, 0x9a, 0x6c, 0x14, 0x14, 0x18, 0xcc, 0x60, 0xb3, 0x9c, 0xe8,
- 0x5b, 0xf0, 0x43, 0xb8, 0x51, 0x81, 0x15, 0x9f, 0x30, 0x9b, 0xd5, 0x46, 0x69, 0x3d, 0xe5, 0x13,
- 0xd6, 0xfb, 0x4f, 0x07, 0xa0, 0x3a, 0x34, 0x7a, 0xbd, 0x21, 0x0d, 0xc7, 0xa5, 0x3e, 0xcc, 0x80,
- 0x6c, 0x43, 0x53, 0x66, 0x36, 0x14, 0x9e, 0x4d, 0x7f, 0x30, 0xf0, 0xb5, 0x8d, 0xfc, 0x04, 0xda,
- 0x32, 0xcb, 0x02, 0x7d, 0x41, 0x60, 0x80, 0xa3, 0xce, 0xfc, 0xb2, 0xdb, 0xf2, 0x07, 0x03, 0x2d,
- 0x3b, 0xbf, 0x25, 0xb3, 0x4c, 0x7f, 0x90, 0x2e, 0x74, 0x26, 0x34, 0x4d, 0xd9, 0x28, 0x78, 0xc9,
- 0x63, 0x54, 0x8e, 0xe3, 0x03, 0x9a, 0xbe, 0xe2, 0xb1, 0xa9, 0xf4, 0x88, 0x4b, 0xf5, 0xda, 0x1c,
- 0x53, 0xc7, 0xc7, 0x01, 0xb9, 0x0f, 0xee, 0x85, 0xe4, 0x8a, 0x0d, 0x69, 0x78, 0x6e, 0x8e, 0xa1,
- 0xe3, 0x57, 0x06, 0xe2, 0x41, 0x3b, 0x8d, 0x82, 0x34, 0x0a, 0x78, 0xe2, 0xb5, 0x70, 0x27, 0xd2,
- 0xa8, 0x1f, 0x3d, 0x4f, 0xc8, 0x0e, 0xb8, 0x38, 0x23, 0x72, 0x65, 0x4e, 0x8f, 0x2e, 0x63, 0xd4,
- 0x8f, 0x5e, 0xe4, 0x8a, 0x6c, 0x1b, 0xaf, 0x97, 0x34, 0x8f, 0x95, 0xe7, 0x16, 0x53, 0x5f, 0xe9,
- 0x21, 0xd9, 0x83, 0xf5, 0x34, 0x0a, 0x26, 0xf4, 0x95, 0x9d, 0x06, 0x4c, 0x33, 0x8d, 0x4e, 0xe8,
- 0x2b, 0x44, 0xec, 0xc3, 0x06, 0x4f, 0x68, 0xa8, 0xf8, 0x94, 0x05, 0x34, 0x11, 0x89, 0xd7, 0x31,
- 0x90, 0xf5, 0xc2, 0xf8, 0x79, 0x22, 0x12, 0xbd, 0xd8, 0x3a, 0x64, 0x1d, 0x59, 0x6a, 0x80, 0x3a,
- 0x8b, 0xa9, 0xc7, 0xc6, 0x22, 0x8b, 0xa9, 0x48, 0xc5, 0x62, 0x20, 0x37, 0xea, 0x2c, 0x06, 0xb0,
- 0x07, 0x9d, 0x3c, 0x61, 0x53, 0x1e, 0x2a, 0x3a, 0x8c, 0x99, 0x77, 0xd3, 0x00, 0xea, 0x26, 0xf2,
- 0x09, 0x6c, 0x8f, 0x39, 0x93, 0x54, 0x86, 0x63, 0x1e, 0xd2, 0x38, 0xc0, 0x2b, 0x31, 0xc0, 0xe3,
- 0xb7, 0x69, 0xf0, 0xf7, 0xea, 0x00, 0x54, 0xc2, 0xef, 0xf5, 0x34, 0x79, 0x02, 0x0b, 0x53, 0x41,
- 0x76, 0x41, 0x53, 0xeb, 0xb9, 0x65, 0x3c, 0xef, 0xd4, 0xa7, 0x07, 0x17, 0x34, 0x45, 0xbf, 0x2e,
- 0x74, 0xcc, 0x29, 0x09, 0x50, 0x48, 0x04, 0xd3, 0x36, 0xa6, 0x63, 0xa3, 0xa6, 0x9f, 0x81, 0x8b,
- 0x00, 0xad, 0xa9, 0x5b, 0x46, 0x33, 0xeb, 0xf3, 0xcb, 0x6e, 0xfb, 0x54, 0x1b, 0xb5, 0xb0, 0xda,
- 0x66, 0xda, 0xcf, 0x32, 0xf2, 0x04, 0x6e, 0x94, 0x50, 0xd4, 0xd8, 0x6d, 0x83, 0xdf, 0x9c, 0x5f,
- 0x76, 0xd7, 0x0b, 0xbc, 0x11, 0xda, 0x7a, 0xe1, 0x63, 0xd4, 0xf6, 0x73, 0xd8, 0x42, 0xbf, 0xba,
- 0xe6, 0xee, 0x98, 0x4c, 0x6e, 0x9a, 0x89, 0x93, 0x4a, 0x78, 0x65, 0xbe, 0x28, 0xbf, 0xbb, 0xb5,
- 0x7c, 0xbf, 0x30, 0x1a, 0xfc, 0x29, 0xa0, 0x4f, 0x50, 0x29, 0xf1, 0x9e, 0x01, 0x61, 0x6e, 0xdf,
- 0x94, 0x72, 0xdc, 0x2f, 0xb2, 0x2d, 0x45, 0xe9, 0xe1, 0x96, 0x18, 0x6b, 0x1f, 0x95, 0xf9, 0xb0,
- 0x60, 0xab, 0xf4, 0xb9, 0x8d, 0x9b, 0x5f, 0xa2, 0xb4, 0x48, 0x1f, 0xd4, 0xb8, 0x50, 0x8b, 0x3b,
- 0x0b, 0x28, 0x54, 0xe3, 0x63, 0x20, 0x25, 0xaa, 0x52, 0xed, 0xfb, 0xb5, 0x85, 0xf6, 0x2b, 0xe9,
- 0x1e, 0xc0, 0x2d, 0x04, 0x2f, 0x0a, 0xf8, 0xbe, 0x41, 0x63, 0xbd, 0x9e, 0xd7, 0x55, 0x5c, 0x16,
- 0xb1, 0x8e, 0xfe, 0xa0, 0xc6, 0xfd, 0x79, 0x85, 0xfd, 0x21, 0xb7, 0x29, 0xf9, 0xee, 0x5b, 0xb8,
- 0x4d, 0xd1, 0xdf, 0xe4, 0x36, 0xe8, 0xee, 0x0f, 0xb8, 0x0d, 0xf6, 0x71, 0x81, 0xad, 0x8b, 0x7d,
- 0xcf, 0x5e, 0x7b, 0x7a, 0xe2, 0xac, 0xa6, 0xf8, 0xdf, 0x14, 0x4f, 0xc7, 0x87, 0xd7, 0x3d, 0x99,
- 0xa8, 0xf5, 0x2f, 0x13, 0x25, 0x5f, 0x17, 0xaf, 0xc7, 0x53, 0x70, 0xb4, 0xca, 0xbd, 0xde, 0x32,
- 0xbe, 0xc6, 0x85, 0x7c, 0x56, 0x3e, 0x09, 0xfb, 0xcb, 0x38, 0x17, 0x2f, 0xc7, 0x00, 0x00, 0xbf,
- 0x02, 0x15, 0xa6, 0xde, 0x83, 0x25, 0x28, 0x8e, 0x36, 0xe6, 0x97, 0x5d, 0xf7, 0x77, 0xc6, 0xf9,
- 0xf4, 0xb8, 0xef, 0xbb, 0xc8, 0x73, 0x1a, 0xa6, 0x3d, 0x06, 0x9d, 0x1a, 0xb0, 0x7a, 0x77, 0x1b,
- 0xb5, 0x77, 0xb7, 0xea, 0x08, 0x56, 0xde, 0xd2, 0x11, 0x34, 0xdf, 0xda, 0x11, 0x38, 0x0b, 0x1d,
- 0x41, 0xef, 0x5f, 0xab, 0xe0, 0x96, 0xad, 0x13, 0xa1, 0xb0, 0xc3, 0x45, 0x90, 0x31, 0x39, 0xe5,
- 0x21, 0x0b, 0x86, 0xaf, 0x15, 0xcb, 0x02, 0xc9, 0xc2, 0x5c, 0x66, 0x7c, 0xca, 0x6c, 0xdb, 0xf9,
- 0xe0, 0x9a, 0x1e, 0x0c, 0x6b, 0x73, 0x8f, 0x8b, 0x01, 0xd2, 0x1c, 0x69, 0x16, 0xbf, 0x20, 0x21,
- 0x7f, 0x84, 0x3b, 0x55, 0x88, 0x51, 0x8d, 0x7d, 0x65, 0x09, 0xf6, 0x5b, 0x25, 0xfb, 0xa8, 0x62,
- 0x3e, 0x85, 0x5b, 0x5c, 0x04, 0xdf, 0xe6, 0x2c, 0x5f, 0xe0, 0x6d, 0x2e, 0xc1, 0xbb, 0xc5, 0xc5,
- 0xd7, 0xc6, 0xbf, 0x62, 0x0d, 0x60, 0xbb, 0x56, 0x12, 0xfd, 0x16, 0xd7, 0xb8, 0x9d, 0x25, 0xb8,
- 0xef, 0x96, 0x39, 0xeb, 0xb7, 0xbb, 0x0a, 0xf0, 0x27, 0xb8, 0xcb, 0x45, 0x70, 0x41, 0xb9, 0x7a,
- 0x93, 0x7d, 0x75, 0xb9, 0x8a, 0x7c, 0x43, 0xb9, 0x5a, 0xa4, 0xc6, 0x8a, 0x4c, 0x98, 0x8c, 0x16,
- 0x2a, 0xb2, 0xb6, 0x5c, 0x45, 0x4e, 0x8c, 0x7f, 0xc5, 0xda, 0x87, 0x2d, 0x2e, 0xde, 0xcc, 0xb5,
- 0xb5, 0x04, 0xe7, 0x4d, 0x2e, 0x16, 0xf3, 0xfc, 0x1a, 0xb6, 0x32, 0x16, 0x2a, 0x21, 0xeb, 0x6a,
- 0x6b, 0x2f, 0xc1, 0xb8, 0x69, 0xdd, 0x4b, 0xca, 0xde, 0x14, 0xa0, 0x9a, 0x27, 0x37, 0x60, 0x45,
- 0xa4, 0xe6, 0xe8, 0xb8, 0xfe, 0x8a, 0x48, 0x75, 0x0f, 0x38, 0xd2, 0xd7, 0x0e, 0x1e, 0x1c, 0xd7,
- 0xb7, 0x23, 0x7d, 0x9e, 0x26, 0xf4, 0x95, 0x28, 0x9a, 0x40, 0x1c, 0x18, 0x2b, 0x4f, 0x84, 0xb4,
- 0x67, 0x07, 0x07, 0xda, 0x3a, 0xa5, 0x71, 0xce, 0x8a, 0x9e, 0xc7, 0x0c, 0x7a, 0x7f, 0x6d, 0x40,
- 0xbb, 0xf8, 0x41, 0x41, 0x3e, 0xab, 0xb7, 0xd1, 0xcd, 0x77, 0xff, 0x7e, 0xd1, 0x4e, 0xb8, 0x98,
- 0xb2, 0xd7, 0x7e, 0x5a, 0xf5, 0xda, 0x3f, 0xda, 0xd9, 0x36, 0xe4, 0x0c, 0xdc, 0xd2, 0x56, 0x5b,
- 0x6d, 0x63, 0x61, 0xb5, 0x5d, 0xe8, 0x8c, 0x43, 0x1a, 0x8c, 0x69, 0x32, 0x8a, 0x19, 0x76, 0x88,
- 0x1b, 0x3e, 0x8c, 0x43, 0xfa, 0x0c, 0x2d, 0x05, 0x40, 0x0c, 0x5f, 0xb1, 0x50, 0x65, 0xa6, 0x28,
- 0x08, 0x78, 0x81, 0x96, 0xde, 0xdf, 0x57, 0xa0, 0x53, 0xfb, 0x0d, 0xa4, 0x7b, 0xe8, 0x84, 0x4e,
- 0x8a, 0x38, 0xe6, 0x5b, 0x77, 0x6c, 0x72, 0x86, 0x77, 0x89, 0xbd, 0xa6, 0x5a, 0x72, 0x66, 0x2e,
- 0x05, 0xf2, 0x01, 0x80, 0x9c, 0x05, 0x29, 0x0d, 0xcf, 0x99, 0xa5, 0x77, 0x7c, 0x57, 0xce, 0xfa,
- 0x68, 0x20, 0xef, 0x83, 0x2b, 0x67, 0x01, 0x93, 0x52, 0xc8, 0xcc, 0xd6, 0xbe, 0x2d, 0x67, 0x5f,
- 0x9a, 0xb1, 0xf5, 0x1d, 0x49, 0xa1, 0x7b, 0x01, 0xbb, 0x07, 0xae, 0x9c, 0x7d, 0x81, 0x06, 0x1d,
- 0x55, 0x15, 0x51, 0xb1, 0xf5, 0x6c, 0xa9, 0x2a, 0xaa, 0xaa, 0xa2, 0x62, 0xeb, 0xe9, 0xaa, 0x7a,
- 0x54, 0x55, 0x46, 0xc5, 0xee, 0xb3, 0xad, 0x6a, 0x51, 0x55, 0x15, 0xd5, 0x2d, 0x7c, 0x6d, 0xd4,
- 0xde, 0x3f, 0x1a, 0xd0, 0xa9, 0xfd, 0x9a, 0xd3, 0x05, 0x4c, 0x64, 0x90, 0xc5, 0x8c, 0xa5, 0xfa,
- 0x27, 0x0d, 0xde, 0xdd, 0x90, 0xc8, 0x81, 0xb5, 0x68, 0xbe, 0x44, 0x06, 0x32, 0x4f, 0x92, 0xe2,
- 0x27, 0x8f, 0xe3, 0xbb, 0x89, 0xf4, 0xd1, 0x60, 0xa7, 0x33, 0x85, 0xe1, 0x9a, 0xc5, 0xf4, 0x00,
- 0x0d, 0xe4, 0x17, 0x40, 0x12, 0x19, 0xe4, 0x09, 0x4f, 0x14, 0x93, 0x32, 0x4f, 0x15, 0x1f, 0x96,
- 0xed, 0xf9, 0x56, 0x22, 0xcf, 0x16, 0x27, 0xc8, 0x7d, 0xc3, 0x66, 0x2f, 0x1b, 0x5b, 0xb2, 0x76,
- 0x22, 0x9f, 0x9b, 0x9b, 0xe3, 0xc8, 0xfb, 0xee, 0xfb, 0xdd, 0xf7, 0xfe, 0xfd, 0xfd, 0xee, 0x7b,
- 0x7f, 0x99, 0xef, 0x36, 0xbe, 0x9b, 0xef, 0x36, 0xfe, 0x39, 0xdf, 0x6d, 0xfc, 0x77, 0xbe, 0xdb,
- 0x18, 0xae, 0x99, 0x3f, 0x23, 0x7e, 0xf9, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb9, 0x78, 0x66,
- 0x06, 0xf4, 0x10, 0x00, 0x00,
-}
-
-func (m *Metrics) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *Metrics) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if len(m.Hugetlb) > 0 {
- for _, msg := range m.Hugetlb {
- dAtA[i] = 0xa
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(msg.Size()))
- n, err := msg.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n
- }
- }
- if m.Pids != nil {
- dAtA[i] = 0x12
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Pids.Size()))
- n1, err := m.Pids.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n1
- }
- if m.CPU != nil {
- dAtA[i] = 0x1a
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.CPU.Size()))
- n2, err := m.CPU.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n2
- }
- if m.Memory != nil {
- dAtA[i] = 0x22
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Memory.Size()))
- n3, err := m.Memory.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n3
- }
- if m.Blkio != nil {
- dAtA[i] = 0x2a
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Blkio.Size()))
- n4, err := m.Blkio.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n4
- }
- if m.Rdma != nil {
- dAtA[i] = 0x32
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Rdma.Size()))
- n5, err := m.Rdma.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n5
- }
- if len(m.Network) > 0 {
- for _, msg := range m.Network {
- dAtA[i] = 0x3a
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(msg.Size()))
- n, err := msg.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n
- }
- }
- if m.CgroupStats != nil {
- dAtA[i] = 0x42
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.CgroupStats.Size()))
- n6, err := m.CgroupStats.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n6
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *HugetlbStat) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *HugetlbStat) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Usage != 0 {
- dAtA[i] = 0x8
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Usage))
- }
- if m.Max != 0 {
- dAtA[i] = 0x10
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Max))
- }
- if m.Failcnt != 0 {
- dAtA[i] = 0x18
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Failcnt))
- }
- if len(m.Pagesize) > 0 {
- dAtA[i] = 0x22
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(len(m.Pagesize)))
- i += copy(dAtA[i:], m.Pagesize)
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *PidsStat) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *PidsStat) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Current != 0 {
- dAtA[i] = 0x8
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Current))
- }
- if m.Limit != 0 {
- dAtA[i] = 0x10
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Limit))
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *CPUStat) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *CPUStat) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Usage != nil {
- dAtA[i] = 0xa
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Usage.Size()))
- n7, err := m.Usage.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n7
- }
- if m.Throttling != nil {
- dAtA[i] = 0x12
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Throttling.Size()))
- n8, err := m.Throttling.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n8
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *CPUUsage) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *CPUUsage) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Total != 0 {
- dAtA[i] = 0x8
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Total))
- }
- if m.Kernel != 0 {
- dAtA[i] = 0x10
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Kernel))
- }
- if m.User != 0 {
- dAtA[i] = 0x18
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.User))
- }
- if len(m.PerCPU) > 0 {
- dAtA10 := make([]byte, len(m.PerCPU)*10)
- var j9 int
- for _, num := range m.PerCPU {
- for num >= 1<<7 {
- dAtA10[j9] = uint8(uint64(num)&0x7f | 0x80)
- num >>= 7
- j9++
- }
- dAtA10[j9] = uint8(num)
- j9++
- }
- dAtA[i] = 0x22
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(j9))
- i += copy(dAtA[i:], dAtA10[:j9])
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *Throttle) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *Throttle) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Periods != 0 {
- dAtA[i] = 0x8
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Periods))
- }
- if m.ThrottledPeriods != 0 {
- dAtA[i] = 0x10
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.ThrottledPeriods))
- }
- if m.ThrottledTime != 0 {
- dAtA[i] = 0x18
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.ThrottledTime))
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *MemoryStat) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *MemoryStat) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Cache != 0 {
- dAtA[i] = 0x8
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Cache))
- }
- if m.RSS != 0 {
- dAtA[i] = 0x10
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.RSS))
- }
- if m.RSSHuge != 0 {
- dAtA[i] = 0x18
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.RSSHuge))
- }
- if m.MappedFile != 0 {
- dAtA[i] = 0x20
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.MappedFile))
- }
- if m.Dirty != 0 {
- dAtA[i] = 0x28
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Dirty))
- }
- if m.Writeback != 0 {
- dAtA[i] = 0x30
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Writeback))
- }
- if m.PgPgIn != 0 {
- dAtA[i] = 0x38
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.PgPgIn))
- }
- if m.PgPgOut != 0 {
- dAtA[i] = 0x40
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.PgPgOut))
- }
- if m.PgFault != 0 {
- dAtA[i] = 0x48
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.PgFault))
- }
- if m.PgMajFault != 0 {
- dAtA[i] = 0x50
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.PgMajFault))
- }
- if m.InactiveAnon != 0 {
- dAtA[i] = 0x58
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.InactiveAnon))
- }
- if m.ActiveAnon != 0 {
- dAtA[i] = 0x60
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.ActiveAnon))
- }
- if m.InactiveFile != 0 {
- dAtA[i] = 0x68
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.InactiveFile))
- }
- if m.ActiveFile != 0 {
- dAtA[i] = 0x70
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.ActiveFile))
- }
- if m.Unevictable != 0 {
- dAtA[i] = 0x78
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Unevictable))
- }
- if m.HierarchicalMemoryLimit != 0 {
- dAtA[i] = 0x80
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.HierarchicalMemoryLimit))
- }
- if m.HierarchicalSwapLimit != 0 {
- dAtA[i] = 0x88
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.HierarchicalSwapLimit))
- }
- if m.TotalCache != 0 {
- dAtA[i] = 0x90
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.TotalCache))
- }
- if m.TotalRSS != 0 {
- dAtA[i] = 0x98
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.TotalRSS))
- }
- if m.TotalRSSHuge != 0 {
- dAtA[i] = 0xa0
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.TotalRSSHuge))
- }
- if m.TotalMappedFile != 0 {
- dAtA[i] = 0xa8
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.TotalMappedFile))
- }
- if m.TotalDirty != 0 {
- dAtA[i] = 0xb0
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.TotalDirty))
- }
- if m.TotalWriteback != 0 {
- dAtA[i] = 0xb8
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.TotalWriteback))
- }
- if m.TotalPgPgIn != 0 {
- dAtA[i] = 0xc0
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.TotalPgPgIn))
- }
- if m.TotalPgPgOut != 0 {
- dAtA[i] = 0xc8
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.TotalPgPgOut))
- }
- if m.TotalPgFault != 0 {
- dAtA[i] = 0xd0
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.TotalPgFault))
- }
- if m.TotalPgMajFault != 0 {
- dAtA[i] = 0xd8
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.TotalPgMajFault))
- }
- if m.TotalInactiveAnon != 0 {
- dAtA[i] = 0xe0
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.TotalInactiveAnon))
- }
- if m.TotalActiveAnon != 0 {
- dAtA[i] = 0xe8
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.TotalActiveAnon))
- }
- if m.TotalInactiveFile != 0 {
- dAtA[i] = 0xf0
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.TotalInactiveFile))
- }
- if m.TotalActiveFile != 0 {
- dAtA[i] = 0xf8
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.TotalActiveFile))
- }
- if m.TotalUnevictable != 0 {
- dAtA[i] = 0x80
- i++
- dAtA[i] = 0x2
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.TotalUnevictable))
- }
- if m.Usage != nil {
- dAtA[i] = 0x8a
- i++
- dAtA[i] = 0x2
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Usage.Size()))
- n11, err := m.Usage.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n11
- }
- if m.Swap != nil {
- dAtA[i] = 0x92
- i++
- dAtA[i] = 0x2
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Swap.Size()))
- n12, err := m.Swap.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n12
- }
- if m.Kernel != nil {
- dAtA[i] = 0x9a
- i++
- dAtA[i] = 0x2
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Kernel.Size()))
- n13, err := m.Kernel.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n13
- }
- if m.KernelTCP != nil {
- dAtA[i] = 0xa2
- i++
- dAtA[i] = 0x2
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.KernelTCP.Size()))
- n14, err := m.KernelTCP.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n14
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *MemoryEntry) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *MemoryEntry) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Limit != 0 {
- dAtA[i] = 0x8
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Limit))
- }
- if m.Usage != 0 {
- dAtA[i] = 0x10
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Usage))
- }
- if m.Max != 0 {
- dAtA[i] = 0x18
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Max))
- }
- if m.Failcnt != 0 {
- dAtA[i] = 0x20
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Failcnt))
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *BlkIOStat) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *BlkIOStat) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if len(m.IoServiceBytesRecursive) > 0 {
- for _, msg := range m.IoServiceBytesRecursive {
- dAtA[i] = 0xa
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(msg.Size()))
- n, err := msg.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n
- }
- }
- if len(m.IoServicedRecursive) > 0 {
- for _, msg := range m.IoServicedRecursive {
- dAtA[i] = 0x12
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(msg.Size()))
- n, err := msg.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n
- }
- }
- if len(m.IoQueuedRecursive) > 0 {
- for _, msg := range m.IoQueuedRecursive {
- dAtA[i] = 0x1a
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(msg.Size()))
- n, err := msg.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n
- }
- }
- if len(m.IoServiceTimeRecursive) > 0 {
- for _, msg := range m.IoServiceTimeRecursive {
- dAtA[i] = 0x22
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(msg.Size()))
- n, err := msg.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n
- }
- }
- if len(m.IoWaitTimeRecursive) > 0 {
- for _, msg := range m.IoWaitTimeRecursive {
- dAtA[i] = 0x2a
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(msg.Size()))
- n, err := msg.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n
- }
- }
- if len(m.IoMergedRecursive) > 0 {
- for _, msg := range m.IoMergedRecursive {
- dAtA[i] = 0x32
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(msg.Size()))
- n, err := msg.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n
- }
- }
- if len(m.IoTimeRecursive) > 0 {
- for _, msg := range m.IoTimeRecursive {
- dAtA[i] = 0x3a
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(msg.Size()))
- n, err := msg.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n
- }
- }
- if len(m.SectorsRecursive) > 0 {
- for _, msg := range m.SectorsRecursive {
- dAtA[i] = 0x42
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(msg.Size()))
- n, err := msg.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n
- }
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *BlkIOEntry) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *BlkIOEntry) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if len(m.Op) > 0 {
- dAtA[i] = 0xa
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(len(m.Op)))
- i += copy(dAtA[i:], m.Op)
- }
- if len(m.Device) > 0 {
- dAtA[i] = 0x12
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(len(m.Device)))
- i += copy(dAtA[i:], m.Device)
- }
- if m.Major != 0 {
- dAtA[i] = 0x18
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Major))
- }
- if m.Minor != 0 {
- dAtA[i] = 0x20
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Minor))
- }
- if m.Value != 0 {
- dAtA[i] = 0x28
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Value))
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *RdmaStat) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *RdmaStat) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if len(m.Current) > 0 {
- for _, msg := range m.Current {
- dAtA[i] = 0xa
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(msg.Size()))
- n, err := msg.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n
- }
- }
- if len(m.Limit) > 0 {
- for _, msg := range m.Limit {
- dAtA[i] = 0x12
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(msg.Size()))
- n, err := msg.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n
- }
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *RdmaEntry) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *RdmaEntry) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if len(m.Device) > 0 {
- dAtA[i] = 0xa
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(len(m.Device)))
- i += copy(dAtA[i:], m.Device)
- }
- if m.HcaHandles != 0 {
- dAtA[i] = 0x10
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.HcaHandles))
- }
- if m.HcaObjects != 0 {
- dAtA[i] = 0x18
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.HcaObjects))
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *NetworkStat) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *NetworkStat) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if len(m.Name) > 0 {
- dAtA[i] = 0xa
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(len(m.Name)))
- i += copy(dAtA[i:], m.Name)
- }
- if m.RxBytes != 0 {
- dAtA[i] = 0x10
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.RxBytes))
- }
- if m.RxPackets != 0 {
- dAtA[i] = 0x18
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.RxPackets))
- }
- if m.RxErrors != 0 {
- dAtA[i] = 0x20
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.RxErrors))
- }
- if m.RxDropped != 0 {
- dAtA[i] = 0x28
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.RxDropped))
- }
- if m.TxBytes != 0 {
- dAtA[i] = 0x30
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.TxBytes))
- }
- if m.TxPackets != 0 {
- dAtA[i] = 0x38
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.TxPackets))
- }
- if m.TxErrors != 0 {
- dAtA[i] = 0x40
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.TxErrors))
- }
- if m.TxDropped != 0 {
- dAtA[i] = 0x48
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.TxDropped))
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *CgroupStats) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *CgroupStats) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.NrSleeping != 0 {
- dAtA[i] = 0x8
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.NrSleeping))
- }
- if m.NrRunning != 0 {
- dAtA[i] = 0x10
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.NrRunning))
- }
- if m.NrStopped != 0 {
- dAtA[i] = 0x18
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.NrStopped))
- }
- if m.NrUninterruptible != 0 {
- dAtA[i] = 0x20
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.NrUninterruptible))
- }
- if m.NrIoWait != 0 {
- dAtA[i] = 0x28
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.NrIoWait))
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func encodeVarintMetrics(dAtA []byte, offset int, v uint64) int {
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return offset + 1
-}
-func (m *Metrics) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.Hugetlb) > 0 {
- for _, e := range m.Hugetlb {
- l = e.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- }
- if m.Pids != nil {
- l = m.Pids.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- if m.CPU != nil {
- l = m.CPU.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- if m.Memory != nil {
- l = m.Memory.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- if m.Blkio != nil {
- l = m.Blkio.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- if m.Rdma != nil {
- l = m.Rdma.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- if len(m.Network) > 0 {
- for _, e := range m.Network {
- l = e.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- }
- if m.CgroupStats != nil {
- l = m.CgroupStats.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *HugetlbStat) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Usage != 0 {
- n += 1 + sovMetrics(uint64(m.Usage))
- }
- if m.Max != 0 {
- n += 1 + sovMetrics(uint64(m.Max))
- }
- if m.Failcnt != 0 {
- n += 1 + sovMetrics(uint64(m.Failcnt))
- }
- l = len(m.Pagesize)
- if l > 0 {
- n += 1 + l + sovMetrics(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *PidsStat) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Current != 0 {
- n += 1 + sovMetrics(uint64(m.Current))
- }
- if m.Limit != 0 {
- n += 1 + sovMetrics(uint64(m.Limit))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *CPUStat) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Usage != nil {
- l = m.Usage.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- if m.Throttling != nil {
- l = m.Throttling.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *CPUUsage) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Total != 0 {
- n += 1 + sovMetrics(uint64(m.Total))
- }
- if m.Kernel != 0 {
- n += 1 + sovMetrics(uint64(m.Kernel))
- }
- if m.User != 0 {
- n += 1 + sovMetrics(uint64(m.User))
- }
- if len(m.PerCPU) > 0 {
- l = 0
- for _, e := range m.PerCPU {
- l += sovMetrics(uint64(e))
- }
- n += 1 + sovMetrics(uint64(l)) + l
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *Throttle) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Periods != 0 {
- n += 1 + sovMetrics(uint64(m.Periods))
- }
- if m.ThrottledPeriods != 0 {
- n += 1 + sovMetrics(uint64(m.ThrottledPeriods))
- }
- if m.ThrottledTime != 0 {
- n += 1 + sovMetrics(uint64(m.ThrottledTime))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *MemoryStat) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Cache != 0 {
- n += 1 + sovMetrics(uint64(m.Cache))
- }
- if m.RSS != 0 {
- n += 1 + sovMetrics(uint64(m.RSS))
- }
- if m.RSSHuge != 0 {
- n += 1 + sovMetrics(uint64(m.RSSHuge))
- }
- if m.MappedFile != 0 {
- n += 1 + sovMetrics(uint64(m.MappedFile))
- }
- if m.Dirty != 0 {
- n += 1 + sovMetrics(uint64(m.Dirty))
- }
- if m.Writeback != 0 {
- n += 1 + sovMetrics(uint64(m.Writeback))
- }
- if m.PgPgIn != 0 {
- n += 1 + sovMetrics(uint64(m.PgPgIn))
- }
- if m.PgPgOut != 0 {
- n += 1 + sovMetrics(uint64(m.PgPgOut))
- }
- if m.PgFault != 0 {
- n += 1 + sovMetrics(uint64(m.PgFault))
- }
- if m.PgMajFault != 0 {
- n += 1 + sovMetrics(uint64(m.PgMajFault))
- }
- if m.InactiveAnon != 0 {
- n += 1 + sovMetrics(uint64(m.InactiveAnon))
- }
- if m.ActiveAnon != 0 {
- n += 1 + sovMetrics(uint64(m.ActiveAnon))
- }
- if m.InactiveFile != 0 {
- n += 1 + sovMetrics(uint64(m.InactiveFile))
- }
- if m.ActiveFile != 0 {
- n += 1 + sovMetrics(uint64(m.ActiveFile))
- }
- if m.Unevictable != 0 {
- n += 1 + sovMetrics(uint64(m.Unevictable))
- }
- if m.HierarchicalMemoryLimit != 0 {
- n += 2 + sovMetrics(uint64(m.HierarchicalMemoryLimit))
- }
- if m.HierarchicalSwapLimit != 0 {
- n += 2 + sovMetrics(uint64(m.HierarchicalSwapLimit))
- }
- if m.TotalCache != 0 {
- n += 2 + sovMetrics(uint64(m.TotalCache))
- }
- if m.TotalRSS != 0 {
- n += 2 + sovMetrics(uint64(m.TotalRSS))
- }
- if m.TotalRSSHuge != 0 {
- n += 2 + sovMetrics(uint64(m.TotalRSSHuge))
- }
- if m.TotalMappedFile != 0 {
- n += 2 + sovMetrics(uint64(m.TotalMappedFile))
- }
- if m.TotalDirty != 0 {
- n += 2 + sovMetrics(uint64(m.TotalDirty))
- }
- if m.TotalWriteback != 0 {
- n += 2 + sovMetrics(uint64(m.TotalWriteback))
- }
- if m.TotalPgPgIn != 0 {
- n += 2 + sovMetrics(uint64(m.TotalPgPgIn))
- }
- if m.TotalPgPgOut != 0 {
- n += 2 + sovMetrics(uint64(m.TotalPgPgOut))
- }
- if m.TotalPgFault != 0 {
- n += 2 + sovMetrics(uint64(m.TotalPgFault))
- }
- if m.TotalPgMajFault != 0 {
- n += 2 + sovMetrics(uint64(m.TotalPgMajFault))
- }
- if m.TotalInactiveAnon != 0 {
- n += 2 + sovMetrics(uint64(m.TotalInactiveAnon))
- }
- if m.TotalActiveAnon != 0 {
- n += 2 + sovMetrics(uint64(m.TotalActiveAnon))
- }
- if m.TotalInactiveFile != 0 {
- n += 2 + sovMetrics(uint64(m.TotalInactiveFile))
- }
- if m.TotalActiveFile != 0 {
- n += 2 + sovMetrics(uint64(m.TotalActiveFile))
- }
- if m.TotalUnevictable != 0 {
- n += 2 + sovMetrics(uint64(m.TotalUnevictable))
- }
- if m.Usage != nil {
- l = m.Usage.Size()
- n += 2 + l + sovMetrics(uint64(l))
- }
- if m.Swap != nil {
- l = m.Swap.Size()
- n += 2 + l + sovMetrics(uint64(l))
- }
- if m.Kernel != nil {
- l = m.Kernel.Size()
- n += 2 + l + sovMetrics(uint64(l))
- }
- if m.KernelTCP != nil {
- l = m.KernelTCP.Size()
- n += 2 + l + sovMetrics(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *MemoryEntry) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Limit != 0 {
- n += 1 + sovMetrics(uint64(m.Limit))
- }
- if m.Usage != 0 {
- n += 1 + sovMetrics(uint64(m.Usage))
- }
- if m.Max != 0 {
- n += 1 + sovMetrics(uint64(m.Max))
- }
- if m.Failcnt != 0 {
- n += 1 + sovMetrics(uint64(m.Failcnt))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *BlkIOStat) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.IoServiceBytesRecursive) > 0 {
- for _, e := range m.IoServiceBytesRecursive {
- l = e.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- }
- if len(m.IoServicedRecursive) > 0 {
- for _, e := range m.IoServicedRecursive {
- l = e.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- }
- if len(m.IoQueuedRecursive) > 0 {
- for _, e := range m.IoQueuedRecursive {
- l = e.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- }
- if len(m.IoServiceTimeRecursive) > 0 {
- for _, e := range m.IoServiceTimeRecursive {
- l = e.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- }
- if len(m.IoWaitTimeRecursive) > 0 {
- for _, e := range m.IoWaitTimeRecursive {
- l = e.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- }
- if len(m.IoMergedRecursive) > 0 {
- for _, e := range m.IoMergedRecursive {
- l = e.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- }
- if len(m.IoTimeRecursive) > 0 {
- for _, e := range m.IoTimeRecursive {
- l = e.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- }
- if len(m.SectorsRecursive) > 0 {
- for _, e := range m.SectorsRecursive {
- l = e.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *BlkIOEntry) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Op)
- if l > 0 {
- n += 1 + l + sovMetrics(uint64(l))
- }
- l = len(m.Device)
- if l > 0 {
- n += 1 + l + sovMetrics(uint64(l))
- }
- if m.Major != 0 {
- n += 1 + sovMetrics(uint64(m.Major))
- }
- if m.Minor != 0 {
- n += 1 + sovMetrics(uint64(m.Minor))
- }
- if m.Value != 0 {
- n += 1 + sovMetrics(uint64(m.Value))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *RdmaStat) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.Current) > 0 {
- for _, e := range m.Current {
- l = e.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- }
- if len(m.Limit) > 0 {
- for _, e := range m.Limit {
- l = e.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *RdmaEntry) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Device)
- if l > 0 {
- n += 1 + l + sovMetrics(uint64(l))
- }
- if m.HcaHandles != 0 {
- n += 1 + sovMetrics(uint64(m.HcaHandles))
- }
- if m.HcaObjects != 0 {
- n += 1 + sovMetrics(uint64(m.HcaObjects))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *NetworkStat) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Name)
- if l > 0 {
- n += 1 + l + sovMetrics(uint64(l))
- }
- if m.RxBytes != 0 {
- n += 1 + sovMetrics(uint64(m.RxBytes))
- }
- if m.RxPackets != 0 {
- n += 1 + sovMetrics(uint64(m.RxPackets))
- }
- if m.RxErrors != 0 {
- n += 1 + sovMetrics(uint64(m.RxErrors))
- }
- if m.RxDropped != 0 {
- n += 1 + sovMetrics(uint64(m.RxDropped))
- }
- if m.TxBytes != 0 {
- n += 1 + sovMetrics(uint64(m.TxBytes))
- }
- if m.TxPackets != 0 {
- n += 1 + sovMetrics(uint64(m.TxPackets))
- }
- if m.TxErrors != 0 {
- n += 1 + sovMetrics(uint64(m.TxErrors))
- }
- if m.TxDropped != 0 {
- n += 1 + sovMetrics(uint64(m.TxDropped))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *CgroupStats) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.NrSleeping != 0 {
- n += 1 + sovMetrics(uint64(m.NrSleeping))
- }
- if m.NrRunning != 0 {
- n += 1 + sovMetrics(uint64(m.NrRunning))
- }
- if m.NrStopped != 0 {
- n += 1 + sovMetrics(uint64(m.NrStopped))
- }
- if m.NrUninterruptible != 0 {
- n += 1 + sovMetrics(uint64(m.NrUninterruptible))
- }
- if m.NrIoWait != 0 {
- n += 1 + sovMetrics(uint64(m.NrIoWait))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func sovMetrics(x uint64) (n int) {
- for {
- n++
- x >>= 7
- if x == 0 {
- break
- }
- }
- return n
-}
-func sozMetrics(x uint64) (n int) {
- return sovMetrics(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-func (this *Metrics) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&Metrics{`,
- `Hugetlb:` + strings.Replace(fmt.Sprintf("%v", this.Hugetlb), "HugetlbStat", "HugetlbStat", 1) + `,`,
- `Pids:` + strings.Replace(fmt.Sprintf("%v", this.Pids), "PidsStat", "PidsStat", 1) + `,`,
- `CPU:` + strings.Replace(fmt.Sprintf("%v", this.CPU), "CPUStat", "CPUStat", 1) + `,`,
- `Memory:` + strings.Replace(fmt.Sprintf("%v", this.Memory), "MemoryStat", "MemoryStat", 1) + `,`,
- `Blkio:` + strings.Replace(fmt.Sprintf("%v", this.Blkio), "BlkIOStat", "BlkIOStat", 1) + `,`,
- `Rdma:` + strings.Replace(fmt.Sprintf("%v", this.Rdma), "RdmaStat", "RdmaStat", 1) + `,`,
- `Network:` + strings.Replace(fmt.Sprintf("%v", this.Network), "NetworkStat", "NetworkStat", 1) + `,`,
- `CgroupStats:` + strings.Replace(fmt.Sprintf("%v", this.CgroupStats), "CgroupStats", "CgroupStats", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *HugetlbStat) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&HugetlbStat{`,
- `Usage:` + fmt.Sprintf("%v", this.Usage) + `,`,
- `Max:` + fmt.Sprintf("%v", this.Max) + `,`,
- `Failcnt:` + fmt.Sprintf("%v", this.Failcnt) + `,`,
- `Pagesize:` + fmt.Sprintf("%v", this.Pagesize) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *PidsStat) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&PidsStat{`,
- `Current:` + fmt.Sprintf("%v", this.Current) + `,`,
- `Limit:` + fmt.Sprintf("%v", this.Limit) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *CPUStat) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&CPUStat{`,
- `Usage:` + strings.Replace(fmt.Sprintf("%v", this.Usage), "CPUUsage", "CPUUsage", 1) + `,`,
- `Throttling:` + strings.Replace(fmt.Sprintf("%v", this.Throttling), "Throttle", "Throttle", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *CPUUsage) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&CPUUsage{`,
- `Total:` + fmt.Sprintf("%v", this.Total) + `,`,
- `Kernel:` + fmt.Sprintf("%v", this.Kernel) + `,`,
- `User:` + fmt.Sprintf("%v", this.User) + `,`,
- `PerCPU:` + fmt.Sprintf("%v", this.PerCPU) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *Throttle) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&Throttle{`,
- `Periods:` + fmt.Sprintf("%v", this.Periods) + `,`,
- `ThrottledPeriods:` + fmt.Sprintf("%v", this.ThrottledPeriods) + `,`,
- `ThrottledTime:` + fmt.Sprintf("%v", this.ThrottledTime) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *MemoryStat) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&MemoryStat{`,
- `Cache:` + fmt.Sprintf("%v", this.Cache) + `,`,
- `RSS:` + fmt.Sprintf("%v", this.RSS) + `,`,
- `RSSHuge:` + fmt.Sprintf("%v", this.RSSHuge) + `,`,
- `MappedFile:` + fmt.Sprintf("%v", this.MappedFile) + `,`,
- `Dirty:` + fmt.Sprintf("%v", this.Dirty) + `,`,
- `Writeback:` + fmt.Sprintf("%v", this.Writeback) + `,`,
- `PgPgIn:` + fmt.Sprintf("%v", this.PgPgIn) + `,`,
- `PgPgOut:` + fmt.Sprintf("%v", this.PgPgOut) + `,`,
- `PgFault:` + fmt.Sprintf("%v", this.PgFault) + `,`,
- `PgMajFault:` + fmt.Sprintf("%v", this.PgMajFault) + `,`,
- `InactiveAnon:` + fmt.Sprintf("%v", this.InactiveAnon) + `,`,
- `ActiveAnon:` + fmt.Sprintf("%v", this.ActiveAnon) + `,`,
- `InactiveFile:` + fmt.Sprintf("%v", this.InactiveFile) + `,`,
- `ActiveFile:` + fmt.Sprintf("%v", this.ActiveFile) + `,`,
- `Unevictable:` + fmt.Sprintf("%v", this.Unevictable) + `,`,
- `HierarchicalMemoryLimit:` + fmt.Sprintf("%v", this.HierarchicalMemoryLimit) + `,`,
- `HierarchicalSwapLimit:` + fmt.Sprintf("%v", this.HierarchicalSwapLimit) + `,`,
- `TotalCache:` + fmt.Sprintf("%v", this.TotalCache) + `,`,
- `TotalRSS:` + fmt.Sprintf("%v", this.TotalRSS) + `,`,
- `TotalRSSHuge:` + fmt.Sprintf("%v", this.TotalRSSHuge) + `,`,
- `TotalMappedFile:` + fmt.Sprintf("%v", this.TotalMappedFile) + `,`,
- `TotalDirty:` + fmt.Sprintf("%v", this.TotalDirty) + `,`,
- `TotalWriteback:` + fmt.Sprintf("%v", this.TotalWriteback) + `,`,
- `TotalPgPgIn:` + fmt.Sprintf("%v", this.TotalPgPgIn) + `,`,
- `TotalPgPgOut:` + fmt.Sprintf("%v", this.TotalPgPgOut) + `,`,
- `TotalPgFault:` + fmt.Sprintf("%v", this.TotalPgFault) + `,`,
- `TotalPgMajFault:` + fmt.Sprintf("%v", this.TotalPgMajFault) + `,`,
- `TotalInactiveAnon:` + fmt.Sprintf("%v", this.TotalInactiveAnon) + `,`,
- `TotalActiveAnon:` + fmt.Sprintf("%v", this.TotalActiveAnon) + `,`,
- `TotalInactiveFile:` + fmt.Sprintf("%v", this.TotalInactiveFile) + `,`,
- `TotalActiveFile:` + fmt.Sprintf("%v", this.TotalActiveFile) + `,`,
- `TotalUnevictable:` + fmt.Sprintf("%v", this.TotalUnevictable) + `,`,
- `Usage:` + strings.Replace(fmt.Sprintf("%v", this.Usage), "MemoryEntry", "MemoryEntry", 1) + `,`,
- `Swap:` + strings.Replace(fmt.Sprintf("%v", this.Swap), "MemoryEntry", "MemoryEntry", 1) + `,`,
- `Kernel:` + strings.Replace(fmt.Sprintf("%v", this.Kernel), "MemoryEntry", "MemoryEntry", 1) + `,`,
- `KernelTCP:` + strings.Replace(fmt.Sprintf("%v", this.KernelTCP), "MemoryEntry", "MemoryEntry", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *MemoryEntry) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&MemoryEntry{`,
- `Limit:` + fmt.Sprintf("%v", this.Limit) + `,`,
- `Usage:` + fmt.Sprintf("%v", this.Usage) + `,`,
- `Max:` + fmt.Sprintf("%v", this.Max) + `,`,
- `Failcnt:` + fmt.Sprintf("%v", this.Failcnt) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *BlkIOStat) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&BlkIOStat{`,
- `IoServiceBytesRecursive:` + strings.Replace(fmt.Sprintf("%v", this.IoServiceBytesRecursive), "BlkIOEntry", "BlkIOEntry", 1) + `,`,
- `IoServicedRecursive:` + strings.Replace(fmt.Sprintf("%v", this.IoServicedRecursive), "BlkIOEntry", "BlkIOEntry", 1) + `,`,
- `IoQueuedRecursive:` + strings.Replace(fmt.Sprintf("%v", this.IoQueuedRecursive), "BlkIOEntry", "BlkIOEntry", 1) + `,`,
- `IoServiceTimeRecursive:` + strings.Replace(fmt.Sprintf("%v", this.IoServiceTimeRecursive), "BlkIOEntry", "BlkIOEntry", 1) + `,`,
- `IoWaitTimeRecursive:` + strings.Replace(fmt.Sprintf("%v", this.IoWaitTimeRecursive), "BlkIOEntry", "BlkIOEntry", 1) + `,`,
- `IoMergedRecursive:` + strings.Replace(fmt.Sprintf("%v", this.IoMergedRecursive), "BlkIOEntry", "BlkIOEntry", 1) + `,`,
- `IoTimeRecursive:` + strings.Replace(fmt.Sprintf("%v", this.IoTimeRecursive), "BlkIOEntry", "BlkIOEntry", 1) + `,`,
- `SectorsRecursive:` + strings.Replace(fmt.Sprintf("%v", this.SectorsRecursive), "BlkIOEntry", "BlkIOEntry", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *BlkIOEntry) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&BlkIOEntry{`,
- `Op:` + fmt.Sprintf("%v", this.Op) + `,`,
- `Device:` + fmt.Sprintf("%v", this.Device) + `,`,
- `Major:` + fmt.Sprintf("%v", this.Major) + `,`,
- `Minor:` + fmt.Sprintf("%v", this.Minor) + `,`,
- `Value:` + fmt.Sprintf("%v", this.Value) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *RdmaStat) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&RdmaStat{`,
- `Current:` + strings.Replace(fmt.Sprintf("%v", this.Current), "RdmaEntry", "RdmaEntry", 1) + `,`,
- `Limit:` + strings.Replace(fmt.Sprintf("%v", this.Limit), "RdmaEntry", "RdmaEntry", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *RdmaEntry) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&RdmaEntry{`,
- `Device:` + fmt.Sprintf("%v", this.Device) + `,`,
- `HcaHandles:` + fmt.Sprintf("%v", this.HcaHandles) + `,`,
- `HcaObjects:` + fmt.Sprintf("%v", this.HcaObjects) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *NetworkStat) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&NetworkStat{`,
- `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
- `RxBytes:` + fmt.Sprintf("%v", this.RxBytes) + `,`,
- `RxPackets:` + fmt.Sprintf("%v", this.RxPackets) + `,`,
- `RxErrors:` + fmt.Sprintf("%v", this.RxErrors) + `,`,
- `RxDropped:` + fmt.Sprintf("%v", this.RxDropped) + `,`,
- `TxBytes:` + fmt.Sprintf("%v", this.TxBytes) + `,`,
- `TxPackets:` + fmt.Sprintf("%v", this.TxPackets) + `,`,
- `TxErrors:` + fmt.Sprintf("%v", this.TxErrors) + `,`,
- `TxDropped:` + fmt.Sprintf("%v", this.TxDropped) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *CgroupStats) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&CgroupStats{`,
- `NrSleeping:` + fmt.Sprintf("%v", this.NrSleeping) + `,`,
- `NrRunning:` + fmt.Sprintf("%v", this.NrRunning) + `,`,
- `NrStopped:` + fmt.Sprintf("%v", this.NrStopped) + `,`,
- `NrUninterruptible:` + fmt.Sprintf("%v", this.NrUninterruptible) + `,`,
- `NrIoWait:` + fmt.Sprintf("%v", this.NrIoWait) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func valueToStringMetrics(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
-}
-func (m *Metrics) 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 ErrIntOverflowMetrics
- }
- 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: Metrics: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: Metrics: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Hugetlb", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Hugetlb = append(m.Hugetlb, &HugetlbStat{})
- if err := m.Hugetlb[len(m.Hugetlb)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Pids", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Pids == nil {
- m.Pids = &PidsStat{}
- }
- if err := m.Pids.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field CPU", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.CPU == nil {
- m.CPU = &CPUStat{}
- }
- if err := m.CPU.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 4:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Memory", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Memory == nil {
- m.Memory = &MemoryStat{}
- }
- if err := m.Memory.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 5:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Blkio", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Blkio == nil {
- m.Blkio = &BlkIOStat{}
- }
- if err := m.Blkio.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 6:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Rdma", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Rdma == nil {
- m.Rdma = &RdmaStat{}
- }
- if err := m.Rdma.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 7:
- 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 ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Network = append(m.Network, &NetworkStat{})
- if err := m.Network[len(m.Network)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 8:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field CgroupStats", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.CgroupStats == nil {
- m.CgroupStats = &CgroupStats{}
- }
- if err := m.CgroupStats.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipMetrics(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *HugetlbStat) 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 ErrIntOverflowMetrics
- }
- 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: HugetlbStat: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: HugetlbStat: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Usage", wireType)
- }
- m.Usage = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Usage |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Max", wireType)
- }
- m.Max = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Max |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Failcnt", wireType)
- }
- m.Failcnt = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Failcnt |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Pagesize", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- 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 ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Pagesize = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipMetrics(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *PidsStat) 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 ErrIntOverflowMetrics
- }
- 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: PidsStat: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: PidsStat: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Current", wireType)
- }
- m.Current = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Current |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType)
- }
- m.Limit = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Limit |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipMetrics(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *CPUStat) 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 ErrIntOverflowMetrics
- }
- 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: CPUStat: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: CPUStat: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Usage", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Usage == nil {
- m.Usage = &CPUUsage{}
- }
- if err := m.Usage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Throttling", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Throttling == nil {
- m.Throttling = &Throttle{}
- }
- if err := m.Throttling.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipMetrics(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *CPUUsage) 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 ErrIntOverflowMetrics
- }
- 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: CPUUsage: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: CPUUsage: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType)
- }
- m.Total = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Total |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Kernel", wireType)
- }
- m.Kernel = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Kernel |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field User", wireType)
- }
- m.User = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.User |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType == 0 {
- var v uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.PerCPU = append(m.PerCPU, v)
- } else if wireType == 2 {
- var packedLen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- packedLen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if packedLen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + packedLen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- 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.PerCPU) == 0 {
- m.PerCPU = make([]uint64, 0, elementCount)
- }
- for iNdEx < postIndex {
- var v uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.PerCPU = append(m.PerCPU, v)
- }
- } else {
- return fmt.Errorf("proto: wrong wireType = %d for field PerCPU", wireType)
- }
- default:
- iNdEx = preIndex
- skippy, err := skipMetrics(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *Throttle) 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 ErrIntOverflowMetrics
- }
- 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: Throttle: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: Throttle: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Periods", wireType)
- }
- m.Periods = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Periods |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field ThrottledPeriods", wireType)
- }
- m.ThrottledPeriods = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.ThrottledPeriods |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field ThrottledTime", wireType)
- }
- m.ThrottledTime = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.ThrottledTime |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipMetrics(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *MemoryStat) 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 ErrIntOverflowMetrics
- }
- 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: MemoryStat: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: MemoryStat: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Cache", wireType)
- }
- m.Cache = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Cache |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field RSS", wireType)
- }
- m.RSS = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.RSS |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field RSSHuge", wireType)
- }
- m.RSSHuge = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.RSSHuge |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field MappedFile", wireType)
- }
- m.MappedFile = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.MappedFile |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 5:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Dirty", wireType)
- }
- m.Dirty = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Dirty |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 6:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Writeback", wireType)
- }
- m.Writeback = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Writeback |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 7:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field PgPgIn", wireType)
- }
- m.PgPgIn = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.PgPgIn |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 8:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field PgPgOut", wireType)
- }
- m.PgPgOut = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.PgPgOut |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 9:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field PgFault", wireType)
- }
- m.PgFault = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.PgFault |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 10:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field PgMajFault", wireType)
- }
- m.PgMajFault = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.PgMajFault |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 11:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field InactiveAnon", wireType)
- }
- m.InactiveAnon = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.InactiveAnon |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 12:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field ActiveAnon", wireType)
- }
- m.ActiveAnon = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.ActiveAnon |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 13:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field InactiveFile", wireType)
- }
- m.InactiveFile = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.InactiveFile |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 14:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field ActiveFile", wireType)
- }
- m.ActiveFile = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.ActiveFile |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 15:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Unevictable", wireType)
- }
- m.Unevictable = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Unevictable |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 16:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field HierarchicalMemoryLimit", wireType)
- }
- m.HierarchicalMemoryLimit = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.HierarchicalMemoryLimit |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 17:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field HierarchicalSwapLimit", wireType)
- }
- m.HierarchicalSwapLimit = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.HierarchicalSwapLimit |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 18:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field TotalCache", wireType)
- }
- m.TotalCache = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.TotalCache |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 19:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field TotalRSS", wireType)
- }
- m.TotalRSS = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.TotalRSS |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 20:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field TotalRSSHuge", wireType)
- }
- m.TotalRSSHuge = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.TotalRSSHuge |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 21:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field TotalMappedFile", wireType)
- }
- m.TotalMappedFile = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.TotalMappedFile |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 22:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field TotalDirty", wireType)
- }
- m.TotalDirty = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.TotalDirty |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 23:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field TotalWriteback", wireType)
- }
- m.TotalWriteback = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.TotalWriteback |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 24:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field TotalPgPgIn", wireType)
- }
- m.TotalPgPgIn = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.TotalPgPgIn |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 25:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field TotalPgPgOut", wireType)
- }
- m.TotalPgPgOut = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.TotalPgPgOut |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 26:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field TotalPgFault", wireType)
- }
- m.TotalPgFault = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.TotalPgFault |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 27:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field TotalPgMajFault", wireType)
- }
- m.TotalPgMajFault = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.TotalPgMajFault |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 28:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field TotalInactiveAnon", wireType)
- }
- m.TotalInactiveAnon = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.TotalInactiveAnon |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 29:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field TotalActiveAnon", wireType)
- }
- m.TotalActiveAnon = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.TotalActiveAnon |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 30:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field TotalInactiveFile", wireType)
- }
- m.TotalInactiveFile = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.TotalInactiveFile |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 31:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field TotalActiveFile", wireType)
- }
- m.TotalActiveFile = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.TotalActiveFile |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 32:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field TotalUnevictable", wireType)
- }
- m.TotalUnevictable = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.TotalUnevictable |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 33:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Usage", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Usage == nil {
- m.Usage = &MemoryEntry{}
- }
- if err := m.Usage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 34:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Swap", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Swap == nil {
- m.Swap = &MemoryEntry{}
- }
- if err := m.Swap.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 35:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Kernel", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Kernel == nil {
- m.Kernel = &MemoryEntry{}
- }
- if err := m.Kernel.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 36:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field KernelTCP", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.KernelTCP == nil {
- m.KernelTCP = &MemoryEntry{}
- }
- if err := m.KernelTCP.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipMetrics(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *MemoryEntry) 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 ErrIntOverflowMetrics
- }
- 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: MemoryEntry: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: MemoryEntry: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType)
- }
- m.Limit = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Limit |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Usage", wireType)
- }
- m.Usage = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Usage |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Max", wireType)
- }
- m.Max = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Max |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Failcnt", wireType)
- }
- m.Failcnt = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Failcnt |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipMetrics(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *BlkIOStat) 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 ErrIntOverflowMetrics
- }
- 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: BlkIOStat: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: BlkIOStat: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field IoServiceBytesRecursive", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.IoServiceBytesRecursive = append(m.IoServiceBytesRecursive, &BlkIOEntry{})
- if err := m.IoServiceBytesRecursive[len(m.IoServiceBytesRecursive)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field IoServicedRecursive", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.IoServicedRecursive = append(m.IoServicedRecursive, &BlkIOEntry{})
- if err := m.IoServicedRecursive[len(m.IoServicedRecursive)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field IoQueuedRecursive", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.IoQueuedRecursive = append(m.IoQueuedRecursive, &BlkIOEntry{})
- if err := m.IoQueuedRecursive[len(m.IoQueuedRecursive)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 4:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field IoServiceTimeRecursive", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.IoServiceTimeRecursive = append(m.IoServiceTimeRecursive, &BlkIOEntry{})
- if err := m.IoServiceTimeRecursive[len(m.IoServiceTimeRecursive)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 5:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field IoWaitTimeRecursive", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.IoWaitTimeRecursive = append(m.IoWaitTimeRecursive, &BlkIOEntry{})
- if err := m.IoWaitTimeRecursive[len(m.IoWaitTimeRecursive)-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 IoMergedRecursive", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.IoMergedRecursive = append(m.IoMergedRecursive, &BlkIOEntry{})
- if err := m.IoMergedRecursive[len(m.IoMergedRecursive)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 7:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field IoTimeRecursive", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.IoTimeRecursive = append(m.IoTimeRecursive, &BlkIOEntry{})
- if err := m.IoTimeRecursive[len(m.IoTimeRecursive)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 8:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field SectorsRecursive", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.SectorsRecursive = append(m.SectorsRecursive, &BlkIOEntry{})
- if err := m.SectorsRecursive[len(m.SectorsRecursive)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipMetrics(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *BlkIOEntry) 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 ErrIntOverflowMetrics
- }
- 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: BlkIOEntry: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: BlkIOEntry: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Op", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- 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 ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Op = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Device", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- 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 ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Device = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Major", wireType)
- }
- m.Major = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Major |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Minor", wireType)
- }
- m.Minor = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Minor |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 5:
- 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 ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Value |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipMetrics(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *RdmaStat) 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 ErrIntOverflowMetrics
- }
- 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: RdmaStat: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: RdmaStat: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Current", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Current = append(m.Current, &RdmaEntry{})
- if err := m.Current[len(m.Current)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Limit = append(m.Limit, &RdmaEntry{})
- if err := m.Limit[len(m.Limit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipMetrics(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *RdmaEntry) 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 ErrIntOverflowMetrics
- }
- 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: RdmaEntry: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: RdmaEntry: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Device", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- 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 ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Device = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field HcaHandles", wireType)
- }
- m.HcaHandles = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.HcaHandles |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field HcaObjects", wireType)
- }
- m.HcaObjects = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.HcaObjects |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipMetrics(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *NetworkStat) 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 ErrIntOverflowMetrics
- }
- 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: NetworkStat: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: NetworkStat: 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 ErrIntOverflowMetrics
- }
- 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 ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Name = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field RxBytes", wireType)
- }
- m.RxBytes = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.RxBytes |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field RxPackets", wireType)
- }
- m.RxPackets = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.RxPackets |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field RxErrors", wireType)
- }
- m.RxErrors = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.RxErrors |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 5:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field RxDropped", wireType)
- }
- m.RxDropped = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.RxDropped |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 6:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field TxBytes", wireType)
- }
- m.TxBytes = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.TxBytes |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 7:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field TxPackets", wireType)
- }
- m.TxPackets = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.TxPackets |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 8:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field TxErrors", wireType)
- }
- m.TxErrors = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.TxErrors |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 9:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field TxDropped", wireType)
- }
- m.TxDropped = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.TxDropped |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipMetrics(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *CgroupStats) 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 ErrIntOverflowMetrics
- }
- 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: CgroupStats: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: CgroupStats: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field NrSleeping", wireType)
- }
- m.NrSleeping = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.NrSleeping |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field NrRunning", wireType)
- }
- m.NrRunning = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.NrRunning |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field NrStopped", wireType)
- }
- m.NrStopped = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.NrStopped |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field NrUninterruptible", wireType)
- }
- m.NrUninterruptible = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.NrUninterruptible |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 5:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field NrIoWait", wireType)
- }
- m.NrIoWait = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.NrIoWait |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipMetrics(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func skipMetrics(dAtA []byte) (n int, err error) {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if dAtA[iNdEx-1] < 0x80 {
- break
- }
- }
- return iNdEx, nil
- case 1:
- iNdEx += 8
- return iNdEx, nil
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if length < 0 {
- return 0, ErrInvalidLengthMetrics
- }
- iNdEx += length
- if iNdEx < 0 {
- return 0, ErrInvalidLengthMetrics
- }
- return iNdEx, nil
- case 3:
- for {
- var innerWire uint64
- var start int = iNdEx
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- innerWire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- innerWireType := int(innerWire & 0x7)
- if innerWireType == 4 {
- break
- }
- next, err := skipMetrics(dAtA[start:])
- if err != nil {
- return 0, err
- }
- iNdEx = start + next
- if iNdEx < 0 {
- return 0, ErrInvalidLengthMetrics
- }
- }
- return iNdEx, nil
- case 4:
- return iNdEx, nil
- case 5:
- iNdEx += 4
- return iNdEx, nil
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- }
- panic("unreachable")
-}
-
-var (
- ErrInvalidLengthMetrics = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowMetrics = fmt.Errorf("proto: integer overflow")
-)
diff --git a/vendor/github.com/containerd/cgroups/stats/v1/metrics.proto b/vendor/github.com/containerd/cgroups/stats/v1/metrics.proto
deleted file mode 100644
index ba6be851d..000000000
--- a/vendor/github.com/containerd/cgroups/stats/v1/metrics.proto
+++ /dev/null
@@ -1,151 +0,0 @@
-syntax = "proto3";
-
-package io.containerd.cgroups.v1;
-
-import "gogoproto/gogo.proto";
-
-message Metrics {
- repeated HugetlbStat hugetlb = 1;
- PidsStat pids = 2;
- CPUStat cpu = 3 [(gogoproto.customname) = "CPU"];
- MemoryStat memory = 4;
- BlkIOStat blkio = 5;
- RdmaStat rdma = 6;
- repeated NetworkStat network = 7;
- CgroupStats cgroup_stats = 8;
-}
-
-message HugetlbStat {
- uint64 usage = 1;
- uint64 max = 2;
- uint64 failcnt = 3;
- string pagesize = 4;
-}
-
-message PidsStat {
- uint64 current = 1;
- uint64 limit = 2;
-}
-
-message CPUStat {
- CPUUsage usage = 1;
- Throttle throttling = 2;
-}
-
-message CPUUsage {
- // values in nanoseconds
- uint64 total = 1;
- uint64 kernel = 2;
- uint64 user = 3;
- repeated uint64 per_cpu = 4 [(gogoproto.customname) = "PerCPU"];
-
-}
-
-message Throttle {
- uint64 periods = 1;
- uint64 throttled_periods = 2;
- uint64 throttled_time = 3;
-}
-
-message MemoryStat {
- uint64 cache = 1;
- uint64 rss = 2 [(gogoproto.customname) = "RSS"];
- uint64 rss_huge = 3 [(gogoproto.customname) = "RSSHuge"];
- uint64 mapped_file = 4;
- uint64 dirty = 5;
- uint64 writeback = 6;
- uint64 pg_pg_in = 7;
- uint64 pg_pg_out = 8;
- uint64 pg_fault = 9;
- uint64 pg_maj_fault = 10;
- uint64 inactive_anon = 11;
- uint64 active_anon = 12;
- uint64 inactive_file = 13;
- uint64 active_file = 14;
- uint64 unevictable = 15;
- uint64 hierarchical_memory_limit = 16;
- uint64 hierarchical_swap_limit = 17;
- uint64 total_cache = 18;
- uint64 total_rss = 19 [(gogoproto.customname) = "TotalRSS"];
- uint64 total_rss_huge = 20 [(gogoproto.customname) = "TotalRSSHuge"];
- uint64 total_mapped_file = 21;
- uint64 total_dirty = 22;
- uint64 total_writeback = 23;
- uint64 total_pg_pg_in = 24;
- uint64 total_pg_pg_out = 25;
- uint64 total_pg_fault = 26;
- uint64 total_pg_maj_fault = 27;
- uint64 total_inactive_anon = 28;
- uint64 total_active_anon = 29;
- uint64 total_inactive_file = 30;
- uint64 total_active_file = 31;
- uint64 total_unevictable = 32;
- MemoryEntry usage = 33;
- MemoryEntry swap = 34;
- MemoryEntry kernel = 35;
- MemoryEntry kernel_tcp = 36 [(gogoproto.customname) = "KernelTCP"];
-
-}
-
-message MemoryEntry {
- uint64 limit = 1;
- uint64 usage = 2;
- uint64 max = 3;
- uint64 failcnt = 4;
-}
-
-message BlkIOStat {
- repeated BlkIOEntry io_service_bytes_recursive = 1;
- repeated BlkIOEntry io_serviced_recursive = 2;
- repeated BlkIOEntry io_queued_recursive = 3;
- repeated BlkIOEntry io_service_time_recursive = 4;
- repeated BlkIOEntry io_wait_time_recursive = 5;
- repeated BlkIOEntry io_merged_recursive = 6;
- repeated BlkIOEntry io_time_recursive = 7;
- repeated BlkIOEntry sectors_recursive = 8;
-}
-
-message BlkIOEntry {
- string op = 1;
- string device = 2;
- uint64 major = 3;
- uint64 minor = 4;
- uint64 value = 5;
-}
-
-message RdmaStat {
- repeated RdmaEntry current = 1;
- repeated RdmaEntry limit = 2;
-}
-
-message RdmaEntry {
- string device = 1;
- uint32 hca_handles = 2;
- uint32 hca_objects = 3;
-}
-
-message NetworkStat {
- string name = 1;
- uint64 rx_bytes = 2;
- uint64 rx_packets = 3;
- uint64 rx_errors = 4;
- uint64 rx_dropped = 5;
- uint64 tx_bytes = 6;
- uint64 tx_packets = 7;
- uint64 tx_errors = 8;
- uint64 tx_dropped = 9;
-}
-
-// CgroupStats exports per-cgroup statistics.
-message CgroupStats {
- // number of tasks sleeping
- uint64 nr_sleeping = 1;
- // number of tasks running
- uint64 nr_running = 2;
- // number of tasks in stopped state
- uint64 nr_stopped = 3;
- // number of tasks in uninterruptible state
- uint64 nr_uninterruptible = 4;
- // number of tasks waiting on IO
- uint64 nr_io_wait = 5;
-}
diff --git a/vendor/github.com/containerd/cgroups/subsystem.go b/vendor/github.com/containerd/cgroups/subsystem.go
deleted file mode 100644
index 1349fc667..000000000
--- a/vendor/github.com/containerd/cgroups/subsystem.go
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cgroups
-
-import (
- "fmt"
-
- v1 "github.com/containerd/cgroups/stats/v1"
- specs "github.com/opencontainers/runtime-spec/specs-go"
-)
-
-// Name is a typed name for a cgroup subsystem
-type Name string
-
-const (
- Devices Name = "devices"
- Hugetlb Name = "hugetlb"
- Freezer Name = "freezer"
- Pids Name = "pids"
- NetCLS Name = "net_cls"
- NetPrio Name = "net_prio"
- PerfEvent Name = "perf_event"
- Cpuset Name = "cpuset"
- Cpu Name = "cpu"
- Cpuacct Name = "cpuacct"
- Memory Name = "memory"
- Blkio Name = "blkio"
- Rdma Name = "rdma"
-)
-
-// Subsystems returns a complete list of the default cgroups
-// available on most linux systems
-func Subsystems() []Name {
- n := []Name{
- Hugetlb,
- Freezer,
- Pids,
- NetCLS,
- NetPrio,
- PerfEvent,
- Cpuset,
- Cpu,
- Cpuacct,
- Memory,
- Blkio,
- Rdma,
- }
- if !isUserNS {
- n = append(n, Devices)
- }
- return n
-}
-
-type Subsystem interface {
- Name() Name
-}
-
-type pather interface {
- Subsystem
- Path(path string) string
-}
-
-type creator interface {
- Subsystem
- Create(path string, resources *specs.LinuxResources) error
-}
-
-type deleter interface {
- Subsystem
- Delete(path string) error
-}
-
-type stater interface {
- Subsystem
- Stat(path string, stats *v1.Metrics) error
-}
-
-type updater interface {
- Subsystem
- Update(path string, resources *specs.LinuxResources) error
-}
-
-// SingleSubsystem returns a single cgroup subsystem within the base Hierarchy
-func SingleSubsystem(baseHierarchy Hierarchy, subsystem Name) Hierarchy {
- return func() ([]Subsystem, error) {
- subsystems, err := baseHierarchy()
- if err != nil {
- return nil, err
- }
- for _, s := range subsystems {
- if s.Name() == subsystem {
- return []Subsystem{
- s,
- }, nil
- }
- }
- return nil, fmt.Errorf("unable to find subsystem %s", subsystem)
- }
-}
diff --git a/vendor/github.com/containerd/cgroups/systemd.go b/vendor/github.com/containerd/cgroups/systemd.go
deleted file mode 100644
index c17f34a62..000000000
--- a/vendor/github.com/containerd/cgroups/systemd.go
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cgroups
-
-import (
- "path/filepath"
- "strings"
- "sync"
-
- systemdDbus "github.com/coreos/go-systemd/v22/dbus"
- "github.com/godbus/dbus/v5"
- specs "github.com/opencontainers/runtime-spec/specs-go"
-)
-
-const (
- SystemdDbus Name = "systemd"
- defaultSlice = "system.slice"
-)
-
-var (
- canDelegate bool
- once sync.Once
-)
-
-func Systemd() ([]Subsystem, error) {
- root, err := v1MountPoint()
- if err != nil {
- return nil, err
- }
- defaultSubsystems, err := defaults(root)
- if err != nil {
- return nil, err
- }
- s, err := NewSystemd(root)
- if err != nil {
- return nil, err
- }
- // make sure the systemd controller is added first
- return append([]Subsystem{s}, defaultSubsystems...), nil
-}
-
-func Slice(slice, name string) Path {
- if slice == "" {
- slice = defaultSlice
- }
- return func(subsystem Name) (string, error) {
- return filepath.Join(slice, name), nil
- }
-}
-
-func NewSystemd(root string) (*SystemdController, error) {
- return &SystemdController{
- root: root,
- }, nil
-}
-
-type SystemdController struct {
- mu sync.Mutex
- root string
-}
-
-func (s *SystemdController) Name() Name {
- return SystemdDbus
-}
-
-func (s *SystemdController) Create(path string, _ *specs.LinuxResources) error {
- conn, err := systemdDbus.New()
- if err != nil {
- return err
- }
- defer conn.Close()
- slice, name := splitName(path)
- // We need to see if systemd can handle the delegate property
- // Systemd will return an error if it cannot handle delegate regardless
- // of its bool setting.
- checkDelegate := func() {
- canDelegate = true
- dlSlice := newProperty("Delegate", true)
- if _, err := conn.StartTransientUnit(slice, "testdelegate", []systemdDbus.Property{dlSlice}, nil); err != nil {
- if dbusError, ok := err.(dbus.Error); ok {
- // Starting with systemd v237, Delegate is not even a property of slices anymore,
- // so the D-Bus call fails with "InvalidArgs" error.
- if strings.Contains(dbusError.Name, "org.freedesktop.DBus.Error.PropertyReadOnly") || strings.Contains(dbusError.Name, "org.freedesktop.DBus.Error.InvalidArgs") {
- canDelegate = false
- }
- }
- }
-
- conn.StopUnit(slice, "testDelegate", nil)
- }
- once.Do(checkDelegate)
- properties := []systemdDbus.Property{
- systemdDbus.PropDescription("cgroup " + name),
- systemdDbus.PropWants(slice),
- newProperty("DefaultDependencies", false),
- newProperty("MemoryAccounting", true),
- newProperty("CPUAccounting", true),
- newProperty("BlockIOAccounting", true),
- }
-
- // If we can delegate, we add the property back in
- if canDelegate {
- properties = append(properties, newProperty("Delegate", true))
- }
-
- ch := make(chan string)
- _, err = conn.StartTransientUnit(name, "replace", properties, ch)
- if err != nil {
- return err
- }
- <-ch
- return nil
-}
-
-func (s *SystemdController) Delete(path string) error {
- conn, err := systemdDbus.New()
- if err != nil {
- return err
- }
- defer conn.Close()
- _, name := splitName(path)
- ch := make(chan string)
- _, err = conn.StopUnit(name, "replace", ch)
- if err != nil {
- return err
- }
- <-ch
- return nil
-}
-
-func newProperty(name string, units interface{}) systemdDbus.Property {
- return systemdDbus.Property{
- Name: name,
- Value: dbus.MakeVariant(units),
- }
-}
-
-func splitName(path string) (slice string, unit string) {
- slice, unit = filepath.Split(path)
- return strings.TrimSuffix(slice, "/"), unit
-}
diff --git a/vendor/github.com/containerd/cgroups/ticks.go b/vendor/github.com/containerd/cgroups/ticks.go
deleted file mode 100644
index 84dc38d0c..000000000
--- a/vendor/github.com/containerd/cgroups/ticks.go
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cgroups
-
-func getClockTicks() uint64 {
- // The value comes from `C.sysconf(C._SC_CLK_TCK)`, and
- // on Linux it's a constant which is safe to be hard coded,
- // so we can avoid using cgo here.
- // See https://github.com/containerd/cgroups/pull/12 for
- // more details.
- return 100
-}
diff --git a/vendor/github.com/containerd/cgroups/utils.go b/vendor/github.com/containerd/cgroups/utils.go
deleted file mode 100644
index fed9af029..000000000
--- a/vendor/github.com/containerd/cgroups/utils.go
+++ /dev/null
@@ -1,399 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cgroups
-
-import (
- "bufio"
- "errors"
- "fmt"
- "io"
- "io/ioutil"
- "os"
- "path/filepath"
- "strconv"
- "strings"
- "sync"
- "syscall"
- "time"
-
- units "github.com/docker/go-units"
- specs "github.com/opencontainers/runtime-spec/specs-go"
- "golang.org/x/sys/unix"
-)
-
-var (
- isUserNS = runningInUserNS()
- checkMode sync.Once
- cgMode CGMode
-)
-
-const unifiedMountpoint = "/sys/fs/cgroup"
-
-// CGMode is the cgroups mode of the host system
-type CGMode int
-
-const (
- // Unavailable cgroup mountpoint
- Unavailable CGMode = iota
- // Legacy cgroups v1
- Legacy
- // Hybrid with cgroups v1 and v2 controllers mounted
- Hybrid
- // Unified with only cgroups v2 mounted
- Unified
-)
-
-// Mode returns the cgroups mode running on the host
-func Mode() CGMode {
- checkMode.Do(func() {
- var st unix.Statfs_t
- if err := unix.Statfs(unifiedMountpoint, &st); err != nil {
- cgMode = Unavailable
- return
- }
- switch st.Type {
- case unix.CGROUP2_SUPER_MAGIC:
- cgMode = Unified
- default:
- cgMode = Legacy
- if err := unix.Statfs(filepath.Join(unifiedMountpoint, "unified"), &st); err != nil {
- return
- }
- if st.Type == unix.CGROUP2_SUPER_MAGIC {
- cgMode = Hybrid
- }
- }
- })
- return cgMode
-}
-
-// runningInUserNS detects whether we are currently running in a user namespace.
-// Copied from github.com/lxc/lxd/shared/util.go
-func runningInUserNS() bool {
- file, err := os.Open("/proc/self/uid_map")
- if err != nil {
- // This kernel-provided file only exists if user namespaces are supported
- return false
- }
- defer file.Close()
-
- buf := bufio.NewReader(file)
- l, _, err := buf.ReadLine()
- if err != nil {
- return false
- }
-
- line := string(l)
- var a, b, c int64
- fmt.Sscanf(line, "%d %d %d", &a, &b, &c)
- /*
- * We assume we are in the initial user namespace if we have a full
- * range - 4294967295 uids starting at uid 0.
- */
- if a == 0 && b == 0 && c == 4294967295 {
- return false
- }
- return true
-}
-
-// defaults returns all known groups
-func defaults(root string) ([]Subsystem, error) {
- h, err := NewHugetlb(root)
- if err != nil && !os.IsNotExist(err) {
- return nil, err
- }
- s := []Subsystem{
- NewNamed(root, "systemd"),
- NewFreezer(root),
- NewPids(root),
- NewNetCls(root),
- NewNetPrio(root),
- NewPerfEvent(root),
- NewCpuset(root),
- NewCpu(root),
- NewCpuacct(root),
- NewMemory(root),
- NewBlkio(root),
- NewRdma(root),
- }
- // only add the devices cgroup if we are not in a user namespace
- // because modifications are not allowed
- if !isUserNS {
- s = append(s, NewDevices(root))
- }
- // add the hugetlb cgroup if error wasn't due to missing hugetlb
- // cgroup support on the host
- if err == nil {
- s = append(s, h)
- }
- return s, nil
-}
-
-// remove will remove a cgroup path handling EAGAIN and EBUSY errors and
-// retrying the remove after a exp timeout
-func remove(path string) error {
- delay := 10 * time.Millisecond
- for i := 0; i < 5; i++ {
- if i != 0 {
- time.Sleep(delay)
- delay *= 2
- }
- if err := os.RemoveAll(path); err == nil {
- return nil
- }
- }
- return fmt.Errorf("cgroups: unable to remove path %q", path)
-}
-
-// readPids will read all the pids of processes in a cgroup by the provided path
-func readPids(path string, subsystem Name) ([]Process, error) {
- f, err := os.Open(filepath.Join(path, cgroupProcs))
- if err != nil {
- return nil, err
- }
- defer f.Close()
- var (
- out []Process
- s = bufio.NewScanner(f)
- )
- for s.Scan() {
- if t := s.Text(); t != "" {
- pid, err := strconv.Atoi(t)
- if err != nil {
- return nil, err
- }
- out = append(out, Process{
- Pid: pid,
- Subsystem: subsystem,
- Path: path,
- })
- }
- }
- if err := s.Err(); err != nil {
- // failed to read all pids?
- return nil, err
- }
- return out, nil
-}
-
-// readTasksPids will read all the pids of tasks in a cgroup by the provided path
-func readTasksPids(path string, subsystem Name) ([]Task, error) {
- f, err := os.Open(filepath.Join(path, cgroupTasks))
- if err != nil {
- return nil, err
- }
- defer f.Close()
- var (
- out []Task
- s = bufio.NewScanner(f)
- )
- for s.Scan() {
- if t := s.Text(); t != "" {
- pid, err := strconv.Atoi(t)
- if err != nil {
- return nil, err
- }
- out = append(out, Task{
- Pid: pid,
- Subsystem: subsystem,
- Path: path,
- })
- }
- }
- if err := s.Err(); err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func hugePageSizes() ([]string, error) {
- var (
- pageSizes []string
- sizeList = []string{"B", "KB", "MB", "GB", "TB", "PB"}
- )
- files, err := ioutil.ReadDir("/sys/kernel/mm/hugepages")
- if err != nil {
- return nil, err
- }
- for _, st := range files {
- nameArray := strings.Split(st.Name(), "-")
- pageSize, err := units.RAMInBytes(nameArray[1])
- if err != nil {
- return nil, err
- }
- pageSizes = append(pageSizes, units.CustomSize("%g%s", float64(pageSize), 1024.0, sizeList))
- }
- return pageSizes, nil
-}
-
-func readUint(path string) (uint64, error) {
- v, err := ioutil.ReadFile(path)
- if err != nil {
- return 0, err
- }
- return parseUint(strings.TrimSpace(string(v)), 10, 64)
-}
-
-func parseUint(s string, base, bitSize int) (uint64, error) {
- v, err := strconv.ParseUint(s, base, bitSize)
- if err != nil {
- intValue, intErr := strconv.ParseInt(s, base, bitSize)
- // 1. Handle negative values greater than MinInt64 (and)
- // 2. Handle negative values lesser than MinInt64
- if intErr == nil && intValue < 0 {
- return 0, nil
- } else if intErr != nil &&
- intErr.(*strconv.NumError).Err == strconv.ErrRange &&
- intValue < 0 {
- return 0, nil
- }
- return 0, err
- }
- return v, nil
-}
-
-func parseKV(raw string) (string, uint64, error) {
- parts := strings.Fields(raw)
- switch len(parts) {
- case 2:
- v, err := parseUint(parts[1], 10, 64)
- if err != nil {
- return "", 0, err
- }
- return parts[0], v, nil
- default:
- return "", 0, ErrInvalidFormat
- }
-}
-
-func parseCgroupFile(path string) (map[string]string, error) {
- f, err := os.Open(path)
- if err != nil {
- return nil, err
- }
- defer f.Close()
- return parseCgroupFromReader(f)
-}
-
-func parseCgroupFromReader(r io.Reader) (map[string]string, error) {
- var (
- cgroups = make(map[string]string)
- s = bufio.NewScanner(r)
- )
- for s.Scan() {
- var (
- text = s.Text()
- parts = strings.SplitN(text, ":", 3)
- )
- if len(parts) < 3 {
- return nil, fmt.Errorf("invalid cgroup entry: %q", text)
- }
- for _, subs := range strings.Split(parts[1], ",") {
- if subs != "" {
- cgroups[subs] = parts[2]
- }
- }
- }
- if err := s.Err(); err != nil {
- return nil, err
- }
- return cgroups, nil
-}
-
-func getCgroupDestination(subsystem string) (string, error) {
- f, err := os.Open("/proc/self/mountinfo")
- if err != nil {
- return "", err
- }
- defer f.Close()
- s := bufio.NewScanner(f)
- for s.Scan() {
- fields := strings.Split(s.Text(), " ")
- if len(fields) < 10 {
- // broken mountinfo?
- continue
- }
- if fields[len(fields)-3] != "cgroup" {
- continue
- }
- for _, opt := range strings.Split(fields[len(fields)-1], ",") {
- if opt == subsystem {
- return fields[3], nil
- }
- }
- }
- if err := s.Err(); err != nil {
- return "", err
- }
- return "", ErrNoCgroupMountDestination
-}
-
-func pathers(subystems []Subsystem) []pather {
- var out []pather
- for _, s := range subystems {
- if p, ok := s.(pather); ok {
- out = append(out, p)
- }
- }
- return out
-}
-
-func initializeSubsystem(s Subsystem, path Path, resources *specs.LinuxResources) error {
- if c, ok := s.(creator); ok {
- p, err := path(s.Name())
- if err != nil {
- return err
- }
- if err := c.Create(p, resources); err != nil {
- return err
- }
- } else if c, ok := s.(pather); ok {
- p, err := path(s.Name())
- if err != nil {
- return err
- }
- // do the default create if the group does not have a custom one
- if err := os.MkdirAll(c.Path(p), defaultDirPerm); err != nil {
- return err
- }
- }
- return nil
-}
-
-func cleanPath(path string) string {
- if path == "" {
- return ""
- }
- path = filepath.Clean(path)
- if !filepath.IsAbs(path) {
- path, _ = filepath.Rel(string(os.PathSeparator), filepath.Clean(string(os.PathSeparator)+path))
- }
- return path
-}
-
-func retryingWriteFile(path string, data []byte, mode os.FileMode) error {
- // Retry writes on EINTR; see:
- // https://github.com/golang/go/issues/38033
- for {
- err := ioutil.WriteFile(path, data, mode)
- if err == nil {
- return nil
- } else if !errors.Is(err, syscall.EINTR) {
- return err
- }
- }
-}
diff --git a/vendor/github.com/containerd/cgroups/v1.go b/vendor/github.com/containerd/cgroups/v1.go
deleted file mode 100644
index 2ec215c06..000000000
--- a/vendor/github.com/containerd/cgroups/v1.go
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cgroups
-
-import (
- "bufio"
- "fmt"
- "os"
- "path/filepath"
- "strings"
-)
-
-// V1 returns all the groups in the default cgroups mountpoint in a single hierarchy
-func V1() ([]Subsystem, error) {
- root, err := v1MountPoint()
- if err != nil {
- return nil, err
- }
- subsystems, err := defaults(root)
- if err != nil {
- return nil, err
- }
- var enabled []Subsystem
- for _, s := range pathers(subsystems) {
- // check and remove the default groups that do not exist
- if _, err := os.Lstat(s.Path("/")); err == nil {
- enabled = append(enabled, s)
- }
- }
- return enabled, nil
-}
-
-// v1MountPoint returns the mount point where the cgroup
-// mountpoints are mounted in a single hiearchy
-func v1MountPoint() (string, error) {
- f, err := os.Open("/proc/self/mountinfo")
- if err != nil {
- return "", err
- }
- defer f.Close()
- scanner := bufio.NewScanner(f)
- for scanner.Scan() {
- var (
- text = scanner.Text()
- fields = strings.Split(text, " ")
- numFields = len(fields)
- )
- if numFields < 10 {
- return "", fmt.Errorf("mountinfo: bad entry %q", text)
- }
- if fields[numFields-3] == "cgroup" {
- return filepath.Dir(fields[4]), nil
- }
- }
- if err := scanner.Err(); err != nil {
- return "", err
- }
- return "", ErrMountPointNotExist
-}
diff --git a/vendor/github.com/containerd/cgroups/v2/cpu.go b/vendor/github.com/containerd/cgroups/v2/cpu.go
deleted file mode 100644
index 65282ff08..000000000
--- a/vendor/github.com/containerd/cgroups/v2/cpu.go
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package v2
-
-import (
- "math"
- "strconv"
- "strings"
-)
-
-type CPUMax string
-
-func NewCPUMax(quota *int64, period *uint64) CPUMax {
- max := "max"
- if quota != nil {
- max = strconv.FormatInt(*quota, 10)
- }
- return CPUMax(strings.Join([]string{max, strconv.FormatUint(*period, 10)}, " "))
-}
-
-type CPU struct {
- Weight *uint64
- Max CPUMax
- Cpus string
- Mems string
-}
-
-func (c CPUMax) extractQuotaAndPeriod() (int64, uint64) {
- var (
- quota int64
- period uint64
- )
- values := strings.Split(string(c), " ")
- if values[0] == "max" {
- quota = math.MaxInt64
- } else {
- quota, _ = strconv.ParseInt(values[0], 10, 64)
- }
- period, _ = strconv.ParseUint(values[1], 10, 64)
- return quota, period
-}
-
-func (r *CPU) Values() (o []Value) {
- if r.Weight != nil {
- o = append(o, Value{
- filename: "cpu.weight",
- value: *r.Weight,
- })
- }
- if r.Max != "" {
- o = append(o, Value{
- filename: "cpu.max",
- value: r.Max,
- })
- }
- if r.Cpus != "" {
- o = append(o, Value{
- filename: "cpuset.cpus",
- value: r.Cpus,
- })
- }
- if r.Mems != "" {
- o = append(o, Value{
- filename: "cpuset.mems",
- value: r.Mems,
- })
- }
- return o
-}
diff --git a/vendor/github.com/containerd/cgroups/v2/devicefilter.go b/vendor/github.com/containerd/cgroups/v2/devicefilter.go
deleted file mode 100644
index 4b8c32be9..000000000
--- a/vendor/github.com/containerd/cgroups/v2/devicefilter.go
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-// Devicefilter containes eBPF device filter program
-//
-// The implementation is based on https://github.com/containers/crun/blob/0.10.2/src/libcrun/ebpf.c
-//
-// Although ebpf.c is originally licensed under LGPL-3.0-or-later, the author (Giuseppe Scrivano)
-// agreed to relicense the file in Apache License 2.0: https://github.com/opencontainers/runc/issues/2144#issuecomment-543116397
-//
-// This particular Go implementation based on runc version
-// https://github.com/opencontainers/runc/blob/master/libcontainer/cgroups/ebpf/devicefilter/devicefilter.go
-package v2
-
-import (
- "fmt"
- "math"
-
- "github.com/cilium/ebpf/asm"
- "github.com/opencontainers/runtime-spec/specs-go"
- "github.com/pkg/errors"
- "golang.org/x/sys/unix"
-)
-
-const (
- // license string format is same as kernel MODULE_LICENSE macro
- license = "Apache"
-)
-
-// DeviceFilter returns eBPF device filter program and its license string
-func DeviceFilter(devices []specs.LinuxDeviceCgroup) (asm.Instructions, string, error) {
- p := &program{}
- p.init()
- for i := len(devices) - 1; i >= 0; i-- {
- if err := p.appendDevice(devices[i]); err != nil {
- return nil, "", err
- }
- }
- insts, err := p.finalize()
- return insts, license, err
-}
-
-type program struct {
- insts asm.Instructions
- hasWildCard bool
- blockID int
-}
-
-func (p *program) init() {
- // struct bpf_cgroup_dev_ctx: https://elixir.bootlin.com/linux/v5.3.6/source/include/uapi/linux/bpf.h#L3423
- /*
- u32 access_type
- u32 major
- u32 minor
- */
- // R2 <- type (lower 16 bit of u32 access_type at R1[0])
- p.insts = append(p.insts,
- asm.LoadMem(asm.R2, asm.R1, 0, asm.Half))
-
- // R3 <- access (upper 16 bit of u32 access_type at R1[0])
- p.insts = append(p.insts,
- asm.LoadMem(asm.R3, asm.R1, 0, asm.Word),
- // RSh: bitwise shift right
- asm.RSh.Imm32(asm.R3, 16))
-
- // R4 <- major (u32 major at R1[4])
- p.insts = append(p.insts,
- asm.LoadMem(asm.R4, asm.R1, 4, asm.Word))
-
- // R5 <- minor (u32 minor at R1[8])
- p.insts = append(p.insts,
- asm.LoadMem(asm.R5, asm.R1, 8, asm.Word))
-}
-
-// appendDevice needs to be called from the last element of OCI linux.resources.devices to the head element.
-func (p *program) appendDevice(dev specs.LinuxDeviceCgroup) error {
- if p.blockID < 0 {
- return errors.New("the program is finalized")
- }
- if p.hasWildCard {
- // All entries after wildcard entry are ignored
- return nil
- }
-
- bpfType := int32(-1)
- hasType := true
- switch dev.Type {
- case string('c'):
- bpfType = int32(unix.BPF_DEVCG_DEV_CHAR)
- case string('b'):
- bpfType = int32(unix.BPF_DEVCG_DEV_BLOCK)
- case string('a'):
- hasType = false
- default:
- // if not specified in OCI json, typ is set to DeviceTypeAll
- return errors.Errorf("invalid DeviceType %q", dev.Type)
- }
- if *dev.Major > math.MaxUint32 {
- return errors.Errorf("invalid major %d", *dev.Major)
- }
- if *dev.Minor > math.MaxUint32 {
- return errors.Errorf("invalid minor %d", *dev.Major)
- }
- hasMajor := *dev.Major >= 0 // if not specified in OCI json, major is set to -1
- hasMinor := *dev.Minor >= 0
- bpfAccess := int32(0)
- for _, r := range dev.Access {
- switch r {
- case 'r':
- bpfAccess |= unix.BPF_DEVCG_ACC_READ
- case 'w':
- bpfAccess |= unix.BPF_DEVCG_ACC_WRITE
- case 'm':
- bpfAccess |= unix.BPF_DEVCG_ACC_MKNOD
- default:
- return errors.Errorf("unknown device access %v", r)
- }
- }
- // If the access is rwm, skip the check.
- hasAccess := bpfAccess != (unix.BPF_DEVCG_ACC_READ | unix.BPF_DEVCG_ACC_WRITE | unix.BPF_DEVCG_ACC_MKNOD)
-
- blockSym := fmt.Sprintf("block-%d", p.blockID)
- nextBlockSym := fmt.Sprintf("block-%d", p.blockID+1)
- prevBlockLastIdx := len(p.insts) - 1
- if hasType {
- p.insts = append(p.insts,
- // if (R2 != bpfType) goto next
- asm.JNE.Imm(asm.R2, bpfType, nextBlockSym),
- )
- }
- if hasAccess {
- p.insts = append(p.insts,
- // if (R3 & bpfAccess == 0 /* use R1 as a temp var */) goto next
- asm.Mov.Reg32(asm.R1, asm.R3),
- asm.And.Imm32(asm.R1, bpfAccess),
- asm.JEq.Imm(asm.R1, 0, nextBlockSym),
- )
- }
- if hasMajor {
- p.insts = append(p.insts,
- // if (R4 != major) goto next
- asm.JNE.Imm(asm.R4, int32(*dev.Major), nextBlockSym),
- )
- }
- if hasMinor {
- p.insts = append(p.insts,
- // if (R5 != minor) goto next
- asm.JNE.Imm(asm.R5, int32(*dev.Minor), nextBlockSym),
- )
- }
- if !hasType && !hasAccess && !hasMajor && !hasMinor {
- p.hasWildCard = true
- }
- p.insts = append(p.insts, acceptBlock(dev.Allow)...)
- // set blockSym to the first instruction we added in this iteration
- p.insts[prevBlockLastIdx+1] = p.insts[prevBlockLastIdx+1].Sym(blockSym)
- p.blockID++
- return nil
-}
-
-func (p *program) finalize() (asm.Instructions, error) {
- if p.hasWildCard {
- // acceptBlock with asm.Return() is already inserted
- return p.insts, nil
- }
- blockSym := fmt.Sprintf("block-%d", p.blockID)
- p.insts = append(p.insts,
- // R0 <- 0
- asm.Mov.Imm32(asm.R0, 0).Sym(blockSym),
- asm.Return(),
- )
- p.blockID = -1
- return p.insts, nil
-}
-
-func acceptBlock(accept bool) asm.Instructions {
- v := int32(0)
- if accept {
- v = 1
- }
- return []asm.Instruction{
- // R0 <- v
- asm.Mov.Imm32(asm.R0, v),
- asm.Return(),
- }
-}
diff --git a/vendor/github.com/containerd/cgroups/v2/ebpf.go b/vendor/github.com/containerd/cgroups/v2/ebpf.go
deleted file mode 100644
index adda75508..000000000
--- a/vendor/github.com/containerd/cgroups/v2/ebpf.go
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package v2
-
-import (
- "github.com/cilium/ebpf"
- "github.com/cilium/ebpf/asm"
- "github.com/opencontainers/runtime-spec/specs-go"
- "github.com/pkg/errors"
- "golang.org/x/sys/unix"
-)
-
-// LoadAttachCgroupDeviceFilter installs eBPF device filter program to /sys/fs/cgroup/ directory.
-//
-// Requires the system to be running in cgroup2 unified-mode with kernel >= 4.15 .
-//
-// https://github.com/torvalds/linux/commit/ebc614f687369f9df99828572b1d85a7c2de3d92
-func LoadAttachCgroupDeviceFilter(insts asm.Instructions, license string, dirFD int) (func() error, error) {
- nilCloser := func() error {
- return nil
- }
- spec := &ebpf.ProgramSpec{
- Type: ebpf.CGroupDevice,
- Instructions: insts,
- License: license,
- }
- prog, err := ebpf.NewProgram(spec)
- if err != nil {
- return nilCloser, err
- }
- if err := prog.Attach(dirFD, ebpf.AttachCGroupDevice, unix.BPF_F_ALLOW_MULTI); err != nil {
- return nilCloser, errors.Wrap(err, "failed to call BPF_PROG_ATTACH (BPF_CGROUP_DEVICE, BPF_F_ALLOW_MULTI)")
- }
- closer := func() error {
- if err := prog.Detach(dirFD, ebpf.AttachCGroupDevice, unix.BPF_F_ALLOW_MULTI); err != nil {
- return errors.Wrap(err, "failed to call BPF_PROG_DETACH (BPF_CGROUP_DEVICE, BPF_F_ALLOW_MULTI)")
- }
- return nil
- }
- return closer, nil
-}
-
-func isRWM(cgroupPermissions string) bool {
- r := false
- w := false
- m := false
- for _, rn := range cgroupPermissions {
- switch rn {
- case 'r':
- r = true
- case 'w':
- w = true
- case 'm':
- m = true
- }
- }
- return r && w && m
-}
-
-// the logic is from runc
-// https://github.com/opencontainers/runc/blob/master/libcontainer/cgroups/fs/devices_v2.go#L44
-func canSkipEBPFError(devices []specs.LinuxDeviceCgroup) bool {
- for _, dev := range devices {
- if dev.Allow || !isRWM(dev.Access) {
- return false
- }
- }
- return true
-}
diff --git a/vendor/github.com/containerd/cgroups/v2/errors.go b/vendor/github.com/containerd/cgroups/v2/errors.go
deleted file mode 100644
index dfab548e3..000000000
--- a/vendor/github.com/containerd/cgroups/v2/errors.go
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package v2
-
-import (
- "errors"
- "os"
-)
-
-var (
- ErrInvalidPid = errors.New("cgroups: pid must be greater than 0")
- ErrMountPointNotExist = errors.New("cgroups: cgroup mountpoint does not exist")
- ErrInvalidFormat = errors.New("cgroups: parsing file with invalid format failed")
- ErrFreezerNotSupported = errors.New("cgroups: freezer cgroup (v2) not supported on this system")
- ErrMemoryNotSupported = errors.New("cgroups: memory cgroup (v2) not supported on this system")
- ErrPidsNotSupported = errors.New("cgroups: pids cgroup (v2) not supported on this system")
- ErrCPUNotSupported = errors.New("cgroups: cpu cgroup (v2) not supported on this system")
- ErrCgroupDeleted = errors.New("cgroups: cgroup deleted")
- ErrNoCgroupMountDestination = errors.New("cgroups: cannot find cgroup mount destination")
- ErrInvalidGroupPath = errors.New("cgroups: invalid group path")
-)
-
-// ErrorHandler is a function that handles and acts on errors
-type ErrorHandler func(err error) error
-
-// IgnoreNotExist ignores any errors that are for not existing files
-func IgnoreNotExist(err error) error {
- if os.IsNotExist(err) {
- return nil
- }
- return err
-}
diff --git a/vendor/github.com/containerd/cgroups/v2/hugetlb.go b/vendor/github.com/containerd/cgroups/v2/hugetlb.go
deleted file mode 100644
index 16b35bd78..000000000
--- a/vendor/github.com/containerd/cgroups/v2/hugetlb.go
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package v2
-
-import "strings"
-
-type HugeTlb []HugeTlbEntry
-
-type HugeTlbEntry struct {
- HugePageSize string
- Limit uint64
-}
-
-func (r *HugeTlb) Values() (o []Value) {
- for _, e := range *r {
- o = append(o, Value{
- filename: strings.Join([]string{"hugetlb", e.HugePageSize, "max"}, "."),
- value: e.Limit,
- })
- }
-
- return o
-}
diff --git a/vendor/github.com/containerd/cgroups/v2/io.go b/vendor/github.com/containerd/cgroups/v2/io.go
deleted file mode 100644
index 70078d576..000000000
--- a/vendor/github.com/containerd/cgroups/v2/io.go
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package v2
-
-import "fmt"
-
-type IOType string
-
-const (
- ReadBPS IOType = "rbps"
- WriteBPS IOType = "wbps"
- ReadIOPS IOType = "riops"
- WriteIOPS IOType = "wiops"
-)
-
-type BFQ struct {
- Weight uint16
-}
-
-type Entry struct {
- Type IOType
- Major int64
- Minor int64
- Rate uint64
-}
-
-func (e Entry) String() string {
- return fmt.Sprintf("%d:%d %s=%d", e.Major, e.Minor, e.Type, e.Rate)
-}
-
-type IO struct {
- BFQ BFQ
- Max []Entry
-}
-
-func (i *IO) Values() (o []Value) {
- if i.BFQ.Weight != 0 {
- o = append(o, Value{
- filename: "io.bfq.weight",
- value: i.BFQ.Weight,
- })
- }
- for _, e := range i.Max {
- o = append(o, Value{
- filename: "io.max",
- value: e.String(),
- })
- }
- return o
-}
diff --git a/vendor/github.com/containerd/cgroups/v2/manager.go b/vendor/github.com/containerd/cgroups/v2/manager.go
deleted file mode 100644
index 3bb546cb6..000000000
--- a/vendor/github.com/containerd/cgroups/v2/manager.go
+++ /dev/null
@@ -1,782 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package v2
-
-import (
- "bufio"
- "io/ioutil"
- "math"
- "os"
- "path/filepath"
- "strconv"
- "strings"
- "syscall"
- "time"
-
- "github.com/containerd/cgroups/v2/stats"
- systemdDbus "github.com/coreos/go-systemd/v22/dbus"
- "github.com/godbus/dbus/v5"
- "github.com/opencontainers/runtime-spec/specs-go"
- "github.com/pkg/errors"
- "github.com/sirupsen/logrus"
- "golang.org/x/sys/unix"
-)
-
-const (
- subtreeControl = "cgroup.subtree_control"
- controllersFile = "cgroup.controllers"
- defaultCgroup2Path = "/sys/fs/cgroup"
- defaultSlice = "system.slice"
-)
-
-var (
- canDelegate bool
-)
-
-type Event struct {
- Low uint64
- High uint64
- Max uint64
- OOM uint64
- OOMKill uint64
-}
-
-// Resources for a cgroups v2 unified hierarchy
-type Resources struct {
- CPU *CPU
- Memory *Memory
- Pids *Pids
- IO *IO
- RDMA *RDMA
- HugeTlb *HugeTlb
- // When len(Devices) is zero, devices are not controlled
- Devices []specs.LinuxDeviceCgroup
-}
-
-// Values returns the raw filenames and values that
-// can be written to the unified hierarchy
-func (r *Resources) Values() (o []Value) {
- if r.CPU != nil {
- o = append(o, r.CPU.Values()...)
- }
- if r.Memory != nil {
- o = append(o, r.Memory.Values()...)
- }
- if r.Pids != nil {
- o = append(o, r.Pids.Values()...)
- }
- if r.IO != nil {
- o = append(o, r.IO.Values()...)
- }
- if r.RDMA != nil {
- o = append(o, r.RDMA.Values()...)
- }
- if r.HugeTlb != nil {
- o = append(o, r.HugeTlb.Values()...)
- }
- return o
-}
-
-// EnabledControllers returns the list of all not nil resource controllers
-func (r *Resources) EnabledControllers() (c []string) {
- if r.CPU != nil {
- c = append(c, "cpu")
- c = append(c, "cpuset")
- }
- if r.Memory != nil {
- c = append(c, "memory")
- }
- if r.Pids != nil {
- c = append(c, "pids")
- }
- if r.IO != nil {
- c = append(c, "io")
- }
- if r.RDMA != nil {
- c = append(c, "rdma")
- }
- if r.HugeTlb != nil {
- c = append(c, "hugetlb")
- }
- return
-}
-
-// Value of a cgroup setting
-type Value struct {
- filename string
- value interface{}
-}
-
-// write the value to the full, absolute path, of a unified hierarchy
-func (c *Value) write(path string, perm os.FileMode) error {
- var data []byte
- switch t := c.value.(type) {
- case uint64:
- data = []byte(strconv.FormatUint(t, 10))
- case uint16:
- data = []byte(strconv.FormatUint(uint64(t), 10))
- case int64:
- data = []byte(strconv.FormatInt(t, 10))
- case []byte:
- data = t
- case string:
- data = []byte(t)
- case CPUMax:
- data = []byte(t)
- default:
- return ErrInvalidFormat
- }
-
- // Retry writes on EINTR; see:
- // https://github.com/golang/go/issues/38033
- for {
- err := ioutil.WriteFile(
- filepath.Join(path, c.filename),
- data,
- perm,
- )
- if err == nil {
- return nil
- } else if !errors.Is(err, syscall.EINTR) {
- return err
- }
- }
-}
-
-func writeValues(path string, values []Value) error {
- for _, o := range values {
- if err := o.write(path, defaultFilePerm); err != nil {
- return err
- }
- }
- return nil
-}
-
-func NewManager(mountpoint string, group string, resources *Resources) (*Manager, error) {
- if resources == nil {
- return nil, errors.New("resources reference is nil")
- }
- if err := VerifyGroupPath(group); err != nil {
- return nil, err
- }
- path := filepath.Join(mountpoint, group)
- if err := os.MkdirAll(path, defaultDirPerm); err != nil {
- return nil, err
- }
- m := Manager{
- unifiedMountpoint: mountpoint,
- path: path,
- }
- if err := m.ToggleControllers(resources.EnabledControllers(), Enable); err != nil {
- // clean up cgroup dir on failure
- os.Remove(path)
- return nil, err
- }
- if err := setResources(path, resources); err != nil {
- os.Remove(path)
- return nil, err
- }
- return &m, nil
-}
-
-func LoadManager(mountpoint string, group string) (*Manager, error) {
- if err := VerifyGroupPath(group); err != nil {
- return nil, err
- }
- path := filepath.Join(mountpoint, group)
- return &Manager{
- unifiedMountpoint: mountpoint,
- path: path,
- }, nil
-}
-
-type Manager struct {
- unifiedMountpoint string
- path string
-}
-
-func setResources(path string, resources *Resources) error {
- if resources != nil {
- if err := writeValues(path, resources.Values()); err != nil {
- return err
- }
- if err := setDevices(path, resources.Devices); err != nil {
- return err
- }
- }
- return nil
-}
-
-func (c *Manager) RootControllers() ([]string, error) {
- b, err := ioutil.ReadFile(filepath.Join(c.unifiedMountpoint, controllersFile))
- if err != nil {
- return nil, err
- }
- return strings.Fields(string(b)), nil
-}
-
-func (c *Manager) Controllers() ([]string, error) {
- b, err := ioutil.ReadFile(filepath.Join(c.path, controllersFile))
- if err != nil {
- return nil, err
- }
- return strings.Fields(string(b)), nil
-}
-
-type ControllerToggle int
-
-const (
- Enable ControllerToggle = iota + 1
- Disable
-)
-
-func toggleFunc(controllers []string, prefix string) []string {
- out := make([]string, len(controllers))
- for i, c := range controllers {
- out[i] = prefix + c
- }
- return out
-}
-
-func (c *Manager) ToggleControllers(controllers []string, t ControllerToggle) error {
- // when c.path is like /foo/bar/baz, the following files need to be written:
- // * /sys/fs/cgroup/cgroup.subtree_control
- // * /sys/fs/cgroup/foo/cgroup.subtree_control
- // * /sys/fs/cgroup/foo/bar/cgroup.subtree_control
- // Note that /sys/fs/cgroup/foo/bar/baz/cgroup.subtree_control does not need to be written.
- split := strings.Split(c.path, "/")
- var lastErr error
- for i := range split {
- f := strings.Join(split[:i], "/")
- if !strings.HasPrefix(f, c.unifiedMountpoint) || f == c.path {
- continue
- }
- filePath := filepath.Join(f, subtreeControl)
- if err := c.writeSubtreeControl(filePath, controllers, t); err != nil {
- // When running as rootless, the user may face EPERM on parent groups, but it is neglible when the
- // controller is already written.
- // So we only return the last error.
- lastErr = errors.Wrapf(err, "failed to write subtree controllers %+v to %q", controllers, filePath)
- }
- }
- return lastErr
-}
-
-func (c *Manager) writeSubtreeControl(filePath string, controllers []string, t ControllerToggle) error {
- f, err := os.OpenFile(filePath, os.O_WRONLY, 0)
- if err != nil {
- return err
- }
- defer f.Close()
- switch t {
- case Enable:
- controllers = toggleFunc(controllers, "+")
- case Disable:
- controllers = toggleFunc(controllers, "-")
- }
- _, err = f.WriteString(strings.Join(controllers, " "))
- return err
-}
-
-func (c *Manager) NewChild(name string, resources *Resources) (*Manager, error) {
- if strings.HasPrefix(name, "/") {
- return nil, errors.New("name must be relative")
- }
- path := filepath.Join(c.path, name)
- if err := os.MkdirAll(path, defaultDirPerm); err != nil {
- return nil, err
- }
- if err := setResources(path, resources); err != nil {
- // clean up cgroup dir on failure
- os.Remove(path)
- return nil, err
- }
- return &Manager{
- unifiedMountpoint: c.unifiedMountpoint,
- path: path,
- }, nil
-}
-
-func (c *Manager) AddProc(pid uint64) error {
- v := Value{
- filename: cgroupProcs,
- value: pid,
- }
- return writeValues(c.path, []Value{v})
-}
-
-func (c *Manager) Delete() error {
- return remove(c.path)
-}
-
-func (c *Manager) Procs(recursive bool) ([]uint64, error) {
- var processes []uint64
- err := filepath.Walk(c.path, func(p string, info os.FileInfo, err error) error {
- if err != nil {
- return err
- }
- if !recursive && info.IsDir() {
- if p == c.path {
- return nil
- }
- return filepath.SkipDir
- }
- _, name := filepath.Split(p)
- if name != cgroupProcs {
- return nil
- }
- procs, err := parseCgroupProcsFile(p)
- if err != nil {
- return err
- }
- processes = append(processes, procs...)
- return nil
- })
- return processes, err
-}
-
-var singleValueFiles = []string{
- "pids.current",
- "pids.max",
-}
-
-func (c *Manager) Stat() (*stats.Metrics, error) {
- controllers, err := c.Controllers()
- if err != nil {
- return nil, err
- }
- out := make(map[string]interface{})
- for _, controller := range controllers {
- switch controller {
- case "cpu", "memory":
- if err := readKVStatsFile(c.path, controller+".stat", out); err != nil {
- if os.IsNotExist(err) {
- continue
- }
- return nil, err
- }
- }
- }
- for _, name := range singleValueFiles {
- if err := readSingleFile(c.path, name, out); err != nil {
- if os.IsNotExist(err) {
- continue
- }
- return nil, err
- }
- }
- memoryEvents := make(map[string]interface{})
- if err := readKVStatsFile(c.path, "memory.events", memoryEvents); err != nil {
- if !os.IsNotExist(err) {
- return nil, err
- }
- }
- var metrics stats.Metrics
-
- metrics.Pids = &stats.PidsStat{
- Current: getPidValue("pids.current", out),
- Limit: getPidValue("pids.max", out),
- }
- metrics.CPU = &stats.CPUStat{
- UsageUsec: getUint64Value("usage_usec", out),
- UserUsec: getUint64Value("user_usec", out),
- SystemUsec: getUint64Value("system_usec", out),
- NrPeriods: getUint64Value("nr_periods", out),
- NrThrottled: getUint64Value("nr_throttled", out),
- ThrottledUsec: getUint64Value("throttled_usec", out),
- }
- metrics.Memory = &stats.MemoryStat{
- Anon: getUint64Value("anon", out),
- File: getUint64Value("file", out),
- KernelStack: getUint64Value("kernel_stack", out),
- Slab: getUint64Value("slab", out),
- Sock: getUint64Value("sock", out),
- Shmem: getUint64Value("shmem", out),
- FileMapped: getUint64Value("file_mapped", out),
- FileDirty: getUint64Value("file_dirty", out),
- FileWriteback: getUint64Value("file_writeback", out),
- AnonThp: getUint64Value("anon_thp", out),
- InactiveAnon: getUint64Value("inactive_anon", out),
- ActiveAnon: getUint64Value("active_anon", out),
- InactiveFile: getUint64Value("inactive_file", out),
- ActiveFile: getUint64Value("active_file", out),
- Unevictable: getUint64Value("unevictable", out),
- SlabReclaimable: getUint64Value("slab_reclaimable", out),
- SlabUnreclaimable: getUint64Value("slab_unreclaimable", out),
- Pgfault: getUint64Value("pgfault", out),
- Pgmajfault: getUint64Value("pgmajfault", out),
- WorkingsetRefault: getUint64Value("workingset_refault", out),
- WorkingsetActivate: getUint64Value("workingset_activate", out),
- WorkingsetNodereclaim: getUint64Value("workingset_nodereclaim", out),
- Pgrefill: getUint64Value("pgrefill", out),
- Pgscan: getUint64Value("pgscan", out),
- Pgsteal: getUint64Value("pgsteal", out),
- Pgactivate: getUint64Value("pgactivate", out),
- Pgdeactivate: getUint64Value("pgdeactivate", out),
- Pglazyfree: getUint64Value("pglazyfree", out),
- Pglazyfreed: getUint64Value("pglazyfreed", out),
- ThpFaultAlloc: getUint64Value("thp_fault_alloc", out),
- ThpCollapseAlloc: getUint64Value("thp_collapse_alloc", out),
- Usage: getStatFileContentUint64(filepath.Join(c.path, "memory.current")),
- UsageLimit: getStatFileContentUint64(filepath.Join(c.path, "memory.max")),
- SwapUsage: getStatFileContentUint64(filepath.Join(c.path, "memory.swap.current")),
- SwapLimit: getStatFileContentUint64(filepath.Join(c.path, "memory.swap.max")),
- }
- if len(memoryEvents) > 0 {
- metrics.MemoryEvents = &stats.MemoryEvents{
- Low: getUint64Value("low", memoryEvents),
- High: getUint64Value("high", memoryEvents),
- Max: getUint64Value("max", memoryEvents),
- Oom: getUint64Value("oom", memoryEvents),
- OomKill: getUint64Value("oom_kill", memoryEvents),
- }
- }
- metrics.Io = &stats.IOStat{Usage: readIoStats(c.path)}
- metrics.Rdma = &stats.RdmaStat{
- Current: rdmaStats(filepath.Join(c.path, "rdma.current")),
- Limit: rdmaStats(filepath.Join(c.path, "rdma.max")),
- }
- metrics.Hugetlb = readHugeTlbStats(c.path)
-
- return &metrics, nil
-}
-
-func getUint64Value(key string, out map[string]interface{}) uint64 {
- v, ok := out[key]
- if !ok {
- return 0
- }
- switch t := v.(type) {
- case uint64:
- return t
- }
- return 0
-}
-
-func getPidValue(key string, out map[string]interface{}) uint64 {
- v, ok := out[key]
- if !ok {
- return 0
- }
- switch t := v.(type) {
- case uint64:
- return t
- case string:
- if t == "max" {
- return math.MaxUint64
- }
- }
- return 0
-}
-
-func readSingleFile(path string, file string, out map[string]interface{}) error {
- f, err := os.Open(filepath.Join(path, file))
- if err != nil {
- return err
- }
- defer f.Close()
- data, err := ioutil.ReadAll(f)
- if err != nil {
- return err
- }
- s := strings.TrimSpace(string(data))
- v, err := parseUint(s, 10, 64)
- if err != nil {
- // if we cannot parse as a uint, parse as a string
- out[file] = s
- return nil
- }
- out[file] = v
- return nil
-}
-
-func readKVStatsFile(path string, file string, out map[string]interface{}) error {
- f, err := os.Open(filepath.Join(path, file))
- if err != nil {
- return err
- }
- defer f.Close()
-
- s := bufio.NewScanner(f)
- for s.Scan() {
- name, value, err := parseKV(s.Text())
- if err != nil {
- return errors.Wrapf(err, "error while parsing %s (line=%q)", filepath.Join(path, file), s.Text())
- }
- out[name] = value
- }
- return s.Err()
-}
-
-func (c *Manager) Freeze() error {
- return c.freeze(c.path, Frozen)
-}
-
-func (c *Manager) Thaw() error {
- return c.freeze(c.path, Thawed)
-}
-
-func (c *Manager) freeze(path string, state State) error {
- values := state.Values()
- for {
- if err := writeValues(path, values); err != nil {
- return err
- }
- current, err := fetchState(path)
- if err != nil {
- return err
- }
- if current == state {
- return nil
- }
- time.Sleep(1 * time.Millisecond)
- }
-}
-
-// MemoryEventFD returns inotify file descriptor and 'memory.events' inotify watch descriptor
-func (c *Manager) MemoryEventFD() (int, uint32, error) {
- fpath := filepath.Join(c.path, "memory.events")
- fd, err := syscall.InotifyInit()
- if err != nil {
- return 0, 0, errors.Errorf("Failed to create inotify fd")
- }
- wd, err := syscall.InotifyAddWatch(fd, fpath, unix.IN_MODIFY)
- if wd < 0 {
- syscall.Close(fd)
- return 0, 0, errors.Errorf("Failed to add inotify watch for %q", fpath)
- }
-
- return fd, uint32(wd), nil
-}
-
-func (c *Manager) EventChan() (<-chan Event, <-chan error) {
- ec := make(chan Event)
- errCh := make(chan error)
- go c.waitForEvents(ec, errCh)
-
- return ec, nil
-}
-
-func (c *Manager) waitForEvents(ec chan<- Event, errCh chan<- error) {
- fd, wd, err := c.MemoryEventFD()
-
- defer syscall.InotifyRmWatch(fd, wd)
- defer syscall.Close(fd)
-
- if err != nil {
- errCh <- err
- return
- }
-
- for {
- buffer := make([]byte, syscall.SizeofInotifyEvent*10)
- bytesRead, err := syscall.Read(fd, buffer)
- if err != nil {
- errCh <- err
- return
- }
- if bytesRead >= syscall.SizeofInotifyEvent {
- out := make(map[string]interface{})
- if err := readKVStatsFile(c.path, "memory.events", out); err == nil {
- e := Event{}
- if v, ok := out["high"]; ok {
- e.High, ok = v.(uint64)
- if !ok {
- errCh <- errors.Errorf("cannot convert high to uint64: %+v", v)
- return
- }
- }
- if v, ok := out["low"]; ok {
- e.Low, ok = v.(uint64)
- if !ok {
- errCh <- errors.Errorf("cannot convert low to uint64: %+v", v)
- return
- }
- }
- if v, ok := out["max"]; ok {
- e.Max, ok = v.(uint64)
- if !ok {
- errCh <- errors.Errorf("cannot convert max to uint64: %+v", v)
- return
- }
- }
- if v, ok := out["oom"]; ok {
- e.OOM, ok = v.(uint64)
- if !ok {
- errCh <- errors.Errorf("cannot convert oom to uint64: %+v", v)
- return
- }
- }
- if v, ok := out["oom_kill"]; ok {
- e.OOMKill, ok = v.(uint64)
- if !ok {
- errCh <- errors.Errorf("cannot convert oom_kill to uint64: %+v", v)
- return
- }
- }
- ec <- e
- } else {
- errCh <- err
- return
- }
- }
- }
-}
-
-func setDevices(path string, devices []specs.LinuxDeviceCgroup) error {
- if len(devices) == 0 {
- return nil
- }
- insts, license, err := DeviceFilter(devices)
- if err != nil {
- return err
- }
- dirFD, err := unix.Open(path, unix.O_DIRECTORY|unix.O_RDONLY, 0600)
- if err != nil {
- return errors.Errorf("cannot get dir FD for %s", path)
- }
- defer unix.Close(dirFD)
- if _, err := LoadAttachCgroupDeviceFilter(insts, license, dirFD); err != nil {
- if !canSkipEBPFError(devices) {
- return err
- }
- }
- return nil
-}
-
-func NewSystemd(slice, group string, pid int, resources *Resources) (*Manager, error) {
- if slice == "" {
- slice = defaultSlice
- }
- path := filepath.Join(defaultCgroup2Path, slice, group)
- conn, err := systemdDbus.New()
- if err != nil {
- return &Manager{}, err
- }
- defer conn.Close()
-
- properties := []systemdDbus.Property{
- systemdDbus.PropDescription("cgroup " + group),
- newSystemdProperty("DefaultDependencies", false),
- newSystemdProperty("MemoryAccounting", true),
- newSystemdProperty("CPUAccounting", true),
- newSystemdProperty("IOAccounting", true),
- }
-
- // if we create a slice, the parent is defined via a Wants=
- if strings.HasSuffix(group, ".slice") {
- properties = append(properties, systemdDbus.PropWants(defaultSlice))
- } else {
- // otherwise, we use Slice=
- properties = append(properties, systemdDbus.PropSlice(defaultSlice))
- }
-
- // only add pid if its valid, -1 is used w/ general slice creation.
- if pid != -1 {
- properties = append(properties, newSystemdProperty("PIDs", []uint32{uint32(pid)}))
- }
-
- if resources.Memory != nil && *resources.Memory.Max != 0 {
- properties = append(properties,
- newSystemdProperty("MemoryMax", uint64(*resources.Memory.Max)))
- }
-
- if resources.CPU != nil && *resources.CPU.Weight != 0 {
- properties = append(properties,
- newSystemdProperty("CPUWeight", *resources.CPU.Weight))
- }
-
- if resources.CPU != nil && resources.CPU.Max != "" {
- quota, period := resources.CPU.Max.extractQuotaAndPeriod()
- // cpu.cfs_quota_us and cpu.cfs_period_us are controlled by systemd.
- // corresponds to USEC_INFINITY in systemd
- // if USEC_INFINITY is provided, CPUQuota is left unbound by systemd
- // always setting a property value ensures we can apply a quota and remove it later
- cpuQuotaPerSecUSec := uint64(math.MaxUint64)
- if quota > 0 {
- // systemd converts CPUQuotaPerSecUSec (microseconds per CPU second) to CPUQuota
- // (integer percentage of CPU) internally. This means that if a fractional percent of
- // CPU is indicated by Resources.CpuQuota, we need to round up to the nearest
- // 10ms (1% of a second) such that child cgroups can set the cpu.cfs_quota_us they expect.
- cpuQuotaPerSecUSec = uint64(quota*1000000) / period
- if cpuQuotaPerSecUSec%10000 != 0 {
- cpuQuotaPerSecUSec = ((cpuQuotaPerSecUSec / 10000) + 1) * 10000
- }
- }
- properties = append(properties,
- newSystemdProperty("CPUQuotaPerSecUSec", cpuQuotaPerSecUSec))
- }
-
- // If we can delegate, we add the property back in
- if canDelegate {
- properties = append(properties, newSystemdProperty("Delegate", true))
- }
-
- if resources.Pids != nil && resources.Pids.Max > 0 {
- properties = append(properties,
- newSystemdProperty("TasksAccounting", true),
- newSystemdProperty("TasksMax", uint64(resources.Pids.Max)))
- }
-
- statusChan := make(chan string, 1)
- if _, err := conn.StartTransientUnit(group, "replace", properties, statusChan); err == nil {
- select {
- case <-statusChan:
- case <-time.After(time.Second):
- logrus.Warnf("Timed out while waiting for StartTransientUnit(%s) completion signal from dbus. Continuing...", group)
- }
- } else if !isUnitExists(err) {
- return &Manager{}, err
- }
-
- return &Manager{
- path: path,
- }, nil
-}
-
-func LoadSystemd(slice, group string) (*Manager, error) {
- if slice == "" {
- slice = defaultSlice
- }
- group = filepath.Join(defaultCgroup2Path, slice, group)
- return &Manager{
- path: group,
- }, nil
-}
-
-func (c *Manager) DeleteSystemd() error {
- conn, err := systemdDbus.New()
- if err != nil {
- return err
- }
- defer conn.Close()
- group := systemdUnitFromPath(c.path)
- ch := make(chan string)
- _, err = conn.StopUnit(group, "replace", ch)
- if err != nil {
- return err
- }
- <-ch
- return nil
-}
-
-func newSystemdProperty(name string, units interface{}) systemdDbus.Property {
- return systemdDbus.Property{
- Name: name,
- Value: dbus.MakeVariant(units),
- }
-}
diff --git a/vendor/github.com/containerd/cgroups/v2/memory.go b/vendor/github.com/containerd/cgroups/v2/memory.go
deleted file mode 100644
index 72f94b738..000000000
--- a/vendor/github.com/containerd/cgroups/v2/memory.go
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package v2
-
-type Memory struct {
- Swap *int64
- Max *int64
- Low *int64
- High *int64
-}
-
-func (r *Memory) Values() (o []Value) {
- if r.Swap != nil {
- o = append(o, Value{
- filename: "memory.swap.max",
- value: *r.Swap,
- })
- }
- if r.Max != nil {
- o = append(o, Value{
- filename: "memory.max",
- value: *r.Max,
- })
- }
- if r.Low != nil {
- o = append(o, Value{
- filename: "memory.low",
- value: *r.Low,
- })
- }
- if r.High != nil {
- o = append(o, Value{
- filename: "memory.high",
- value: *r.High,
- })
- }
- return o
-}
diff --git a/vendor/github.com/containerd/cgroups/v2/paths.go b/vendor/github.com/containerd/cgroups/v2/paths.go
deleted file mode 100644
index c4778c142..000000000
--- a/vendor/github.com/containerd/cgroups/v2/paths.go
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package v2
-
-import (
- "fmt"
- "path/filepath"
- "strings"
-)
-
-// NestedGroupPath will nest the cgroups based on the calling processes cgroup
-// placing its child processes inside its own path
-func NestedGroupPath(suffix string) (string, error) {
- path, err := parseCgroupFile("/proc/self/cgroup")
- if err != nil {
- return "", err
- }
- return filepath.Join(path, suffix), nil
-}
-
-// PidGroupPath will return the correct cgroup paths for an existing process running inside a cgroup
-// This is commonly used for the Load function to restore an existing container
-func PidGroupPath(pid int) (string, error) {
- p := fmt.Sprintf("/proc/%d/cgroup", pid)
- return parseCgroupFile(p)
-}
-
-// VerifyGroupPath verifies the format of group path string g.
-// The format is same as the third field in /proc/PID/cgroup.
-// e.g. "/user.slice/user-1001.slice/session-1.scope"
-//
-// g must be a "clean" absolute path starts with "/", and must not contain "/sys/fs/cgroup" prefix.
-//
-// VerifyGroupPath doesn't verify whether g actually exists on the system.
-func VerifyGroupPath(g string) error {
- if !strings.HasPrefix(g, "/") {
- return ErrInvalidGroupPath
- }
- if filepath.Clean(g) != g {
- return ErrInvalidGroupPath
- }
- if strings.HasPrefix(g, "/sys/fs/cgroup") {
- return ErrInvalidGroupPath
- }
- return nil
-}
diff --git a/vendor/github.com/containerd/cgroups/v2/pids.go b/vendor/github.com/containerd/cgroups/v2/pids.go
deleted file mode 100644
index 0b5aa0c3b..000000000
--- a/vendor/github.com/containerd/cgroups/v2/pids.go
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package v2
-
-import "strconv"
-
-type Pids struct {
- Max int64
-}
-
-func (r *Pids) Values() (o []Value) {
- if r.Max != 0 {
- limit := "max"
- if r.Max > 0 {
- limit = strconv.FormatInt(r.Max, 10)
- }
- o = append(o, Value{
- filename: "pids.max",
- value: limit,
- })
- }
- return o
-}
diff --git a/vendor/github.com/containerd/cgroups/v2/rdma.go b/vendor/github.com/containerd/cgroups/v2/rdma.go
deleted file mode 100644
index 44caa4f57..000000000
--- a/vendor/github.com/containerd/cgroups/v2/rdma.go
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package v2
-
-import (
- "fmt"
-)
-
-type RDMA struct {
- Limit []RDMAEntry
-}
-
-type RDMAEntry struct {
- Device string
- HcaHandles uint32
- HcaObjects uint32
-}
-
-func (r RDMAEntry) String() string {
- return fmt.Sprintf("%s hca_handle=%d hca_object=%d", r.Device, r.HcaHandles, r.HcaObjects)
-}
-
-func (r *RDMA) Values() (o []Value) {
- for _, e := range r.Limit {
- o = append(o, Value{
- filename: "rdma.max",
- value: e.String(),
- })
- }
-
- return o
-}
diff --git a/vendor/github.com/containerd/cgroups/v2/state.go b/vendor/github.com/containerd/cgroups/v2/state.go
deleted file mode 100644
index 09b75b6c3..000000000
--- a/vendor/github.com/containerd/cgroups/v2/state.go
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package v2
-
-import (
- "io/ioutil"
- "path/filepath"
- "strings"
-)
-
-// State is a type that represents the state of the current cgroup
-type State string
-
-const (
- Unknown State = ""
- Thawed State = "thawed"
- Frozen State = "frozen"
- Deleted State = "deleted"
-
- cgroupFreeze = "cgroup.freeze"
-)
-
-func (s State) Values() []Value {
- v := Value{
- filename: cgroupFreeze,
- }
- switch s {
- case Frozen:
- v.value = "1"
- case Thawed:
- v.value = "0"
- }
- return []Value{
- v,
- }
-}
-
-func fetchState(path string) (State, error) {
- current, err := ioutil.ReadFile(filepath.Join(path, cgroupFreeze))
- if err != nil {
- return Unknown, err
- }
- switch strings.TrimSpace(string(current)) {
- case "1":
- return Frozen, nil
- case "0":
- return Thawed, nil
- default:
- return Unknown, nil
- }
-}
diff --git a/vendor/github.com/containerd/cgroups/v2/stats/doc.go b/vendor/github.com/containerd/cgroups/v2/stats/doc.go
deleted file mode 100644
index e51e12f80..000000000
--- a/vendor/github.com/containerd/cgroups/v2/stats/doc.go
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package stats
diff --git a/vendor/github.com/containerd/cgroups/v2/stats/metrics.pb.go b/vendor/github.com/containerd/cgroups/v2/stats/metrics.pb.go
deleted file mode 100644
index dd54edb69..000000000
--- a/vendor/github.com/containerd/cgroups/v2/stats/metrics.pb.go
+++ /dev/null
@@ -1,3950 +0,0 @@
-// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: github.com/containerd/cgroups/v2/stats/metrics.proto
-
-package stats
-
-import (
- fmt "fmt"
- _ "github.com/gogo/protobuf/gogoproto"
- proto "github.com/gogo/protobuf/proto"
- io "io"
- math "math"
- reflect "reflect"
- strings "strings"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
-
-type Metrics struct {
- Pids *PidsStat `protobuf:"bytes,1,opt,name=pids,proto3" json:"pids,omitempty"`
- CPU *CPUStat `protobuf:"bytes,2,opt,name=cpu,proto3" json:"cpu,omitempty"`
- Memory *MemoryStat `protobuf:"bytes,4,opt,name=memory,proto3" json:"memory,omitempty"`
- Rdma *RdmaStat `protobuf:"bytes,5,opt,name=rdma,proto3" json:"rdma,omitempty"`
- Io *IOStat `protobuf:"bytes,6,opt,name=io,proto3" json:"io,omitempty"`
- Hugetlb []*HugeTlbStat `protobuf:"bytes,7,rep,name=hugetlb,proto3" json:"hugetlb,omitempty"`
- MemoryEvents *MemoryEvents `protobuf:"bytes,8,opt,name=memory_events,json=memoryEvents,proto3" json:"memory_events,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Metrics) Reset() { *m = Metrics{} }
-func (*Metrics) ProtoMessage() {}
-func (*Metrics) Descriptor() ([]byte, []int) {
- return fileDescriptor_2fc6005842049e6b, []int{0}
-}
-func (m *Metrics) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Metrics) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_Metrics.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *Metrics) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Metrics.Merge(m, src)
-}
-func (m *Metrics) XXX_Size() int {
- return m.Size()
-}
-func (m *Metrics) XXX_DiscardUnknown() {
- xxx_messageInfo_Metrics.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Metrics proto.InternalMessageInfo
-
-type PidsStat struct {
- Current uint64 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"`
- Limit uint64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *PidsStat) Reset() { *m = PidsStat{} }
-func (*PidsStat) ProtoMessage() {}
-func (*PidsStat) Descriptor() ([]byte, []int) {
- return fileDescriptor_2fc6005842049e6b, []int{1}
-}
-func (m *PidsStat) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PidsStat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_PidsStat.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *PidsStat) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PidsStat.Merge(m, src)
-}
-func (m *PidsStat) XXX_Size() int {
- return m.Size()
-}
-func (m *PidsStat) XXX_DiscardUnknown() {
- xxx_messageInfo_PidsStat.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_PidsStat proto.InternalMessageInfo
-
-type CPUStat struct {
- UsageUsec uint64 `protobuf:"varint,1,opt,name=usage_usec,json=usageUsec,proto3" json:"usage_usec,omitempty"`
- UserUsec uint64 `protobuf:"varint,2,opt,name=user_usec,json=userUsec,proto3" json:"user_usec,omitempty"`
- SystemUsec uint64 `protobuf:"varint,3,opt,name=system_usec,json=systemUsec,proto3" json:"system_usec,omitempty"`
- NrPeriods uint64 `protobuf:"varint,4,opt,name=nr_periods,json=nrPeriods,proto3" json:"nr_periods,omitempty"`
- NrThrottled uint64 `protobuf:"varint,5,opt,name=nr_throttled,json=nrThrottled,proto3" json:"nr_throttled,omitempty"`
- ThrottledUsec uint64 `protobuf:"varint,6,opt,name=throttled_usec,json=throttledUsec,proto3" json:"throttled_usec,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *CPUStat) Reset() { *m = CPUStat{} }
-func (*CPUStat) ProtoMessage() {}
-func (*CPUStat) Descriptor() ([]byte, []int) {
- return fileDescriptor_2fc6005842049e6b, []int{2}
-}
-func (m *CPUStat) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *CPUStat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_CPUStat.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *CPUStat) XXX_Merge(src proto.Message) {
- xxx_messageInfo_CPUStat.Merge(m, src)
-}
-func (m *CPUStat) XXX_Size() int {
- return m.Size()
-}
-func (m *CPUStat) XXX_DiscardUnknown() {
- xxx_messageInfo_CPUStat.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CPUStat proto.InternalMessageInfo
-
-type MemoryStat struct {
- Anon uint64 `protobuf:"varint,1,opt,name=anon,proto3" json:"anon,omitempty"`
- File uint64 `protobuf:"varint,2,opt,name=file,proto3" json:"file,omitempty"`
- KernelStack uint64 `protobuf:"varint,3,opt,name=kernel_stack,json=kernelStack,proto3" json:"kernel_stack,omitempty"`
- Slab uint64 `protobuf:"varint,4,opt,name=slab,proto3" json:"slab,omitempty"`
- Sock uint64 `protobuf:"varint,5,opt,name=sock,proto3" json:"sock,omitempty"`
- Shmem uint64 `protobuf:"varint,6,opt,name=shmem,proto3" json:"shmem,omitempty"`
- FileMapped uint64 `protobuf:"varint,7,opt,name=file_mapped,json=fileMapped,proto3" json:"file_mapped,omitempty"`
- FileDirty uint64 `protobuf:"varint,8,opt,name=file_dirty,json=fileDirty,proto3" json:"file_dirty,omitempty"`
- FileWriteback uint64 `protobuf:"varint,9,opt,name=file_writeback,json=fileWriteback,proto3" json:"file_writeback,omitempty"`
- AnonThp uint64 `protobuf:"varint,10,opt,name=anon_thp,json=anonThp,proto3" json:"anon_thp,omitempty"`
- InactiveAnon uint64 `protobuf:"varint,11,opt,name=inactive_anon,json=inactiveAnon,proto3" json:"inactive_anon,omitempty"`
- ActiveAnon uint64 `protobuf:"varint,12,opt,name=active_anon,json=activeAnon,proto3" json:"active_anon,omitempty"`
- InactiveFile uint64 `protobuf:"varint,13,opt,name=inactive_file,json=inactiveFile,proto3" json:"inactive_file,omitempty"`
- ActiveFile uint64 `protobuf:"varint,14,opt,name=active_file,json=activeFile,proto3" json:"active_file,omitempty"`
- Unevictable uint64 `protobuf:"varint,15,opt,name=unevictable,proto3" json:"unevictable,omitempty"`
- SlabReclaimable uint64 `protobuf:"varint,16,opt,name=slab_reclaimable,json=slabReclaimable,proto3" json:"slab_reclaimable,omitempty"`
- SlabUnreclaimable uint64 `protobuf:"varint,17,opt,name=slab_unreclaimable,json=slabUnreclaimable,proto3" json:"slab_unreclaimable,omitempty"`
- Pgfault uint64 `protobuf:"varint,18,opt,name=pgfault,proto3" json:"pgfault,omitempty"`
- Pgmajfault uint64 `protobuf:"varint,19,opt,name=pgmajfault,proto3" json:"pgmajfault,omitempty"`
- WorkingsetRefault uint64 `protobuf:"varint,20,opt,name=workingset_refault,json=workingsetRefault,proto3" json:"workingset_refault,omitempty"`
- WorkingsetActivate uint64 `protobuf:"varint,21,opt,name=workingset_activate,json=workingsetActivate,proto3" json:"workingset_activate,omitempty"`
- WorkingsetNodereclaim uint64 `protobuf:"varint,22,opt,name=workingset_nodereclaim,json=workingsetNodereclaim,proto3" json:"workingset_nodereclaim,omitempty"`
- Pgrefill uint64 `protobuf:"varint,23,opt,name=pgrefill,proto3" json:"pgrefill,omitempty"`
- Pgscan uint64 `protobuf:"varint,24,opt,name=pgscan,proto3" json:"pgscan,omitempty"`
- Pgsteal uint64 `protobuf:"varint,25,opt,name=pgsteal,proto3" json:"pgsteal,omitempty"`
- Pgactivate uint64 `protobuf:"varint,26,opt,name=pgactivate,proto3" json:"pgactivate,omitempty"`
- Pgdeactivate uint64 `protobuf:"varint,27,opt,name=pgdeactivate,proto3" json:"pgdeactivate,omitempty"`
- Pglazyfree uint64 `protobuf:"varint,28,opt,name=pglazyfree,proto3" json:"pglazyfree,omitempty"`
- Pglazyfreed uint64 `protobuf:"varint,29,opt,name=pglazyfreed,proto3" json:"pglazyfreed,omitempty"`
- ThpFaultAlloc uint64 `protobuf:"varint,30,opt,name=thp_fault_alloc,json=thpFaultAlloc,proto3" json:"thp_fault_alloc,omitempty"`
- ThpCollapseAlloc uint64 `protobuf:"varint,31,opt,name=thp_collapse_alloc,json=thpCollapseAlloc,proto3" json:"thp_collapse_alloc,omitempty"`
- Usage uint64 `protobuf:"varint,32,opt,name=usage,proto3" json:"usage,omitempty"`
- UsageLimit uint64 `protobuf:"varint,33,opt,name=usage_limit,json=usageLimit,proto3" json:"usage_limit,omitempty"`
- SwapUsage uint64 `protobuf:"varint,34,opt,name=swap_usage,json=swapUsage,proto3" json:"swap_usage,omitempty"`
- SwapLimit uint64 `protobuf:"varint,35,opt,name=swap_limit,json=swapLimit,proto3" json:"swap_limit,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *MemoryStat) Reset() { *m = MemoryStat{} }
-func (*MemoryStat) ProtoMessage() {}
-func (*MemoryStat) Descriptor() ([]byte, []int) {
- return fileDescriptor_2fc6005842049e6b, []int{3}
-}
-func (m *MemoryStat) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *MemoryStat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_MemoryStat.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *MemoryStat) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MemoryStat.Merge(m, src)
-}
-func (m *MemoryStat) XXX_Size() int {
- return m.Size()
-}
-func (m *MemoryStat) XXX_DiscardUnknown() {
- xxx_messageInfo_MemoryStat.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_MemoryStat proto.InternalMessageInfo
-
-type MemoryEvents struct {
- Low uint64 `protobuf:"varint,1,opt,name=low,proto3" json:"low,omitempty"`
- High uint64 `protobuf:"varint,2,opt,name=high,proto3" json:"high,omitempty"`
- Max uint64 `protobuf:"varint,3,opt,name=max,proto3" json:"max,omitempty"`
- Oom uint64 `protobuf:"varint,4,opt,name=oom,proto3" json:"oom,omitempty"`
- OomKill uint64 `protobuf:"varint,5,opt,name=oom_kill,json=oomKill,proto3" json:"oom_kill,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *MemoryEvents) Reset() { *m = MemoryEvents{} }
-func (*MemoryEvents) ProtoMessage() {}
-func (*MemoryEvents) Descriptor() ([]byte, []int) {
- return fileDescriptor_2fc6005842049e6b, []int{4}
-}
-func (m *MemoryEvents) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *MemoryEvents) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_MemoryEvents.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *MemoryEvents) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MemoryEvents.Merge(m, src)
-}
-func (m *MemoryEvents) XXX_Size() int {
- return m.Size()
-}
-func (m *MemoryEvents) XXX_DiscardUnknown() {
- xxx_messageInfo_MemoryEvents.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_MemoryEvents proto.InternalMessageInfo
-
-type RdmaStat struct {
- Current []*RdmaEntry `protobuf:"bytes,1,rep,name=current,proto3" json:"current,omitempty"`
- Limit []*RdmaEntry `protobuf:"bytes,2,rep,name=limit,proto3" json:"limit,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *RdmaStat) Reset() { *m = RdmaStat{} }
-func (*RdmaStat) ProtoMessage() {}
-func (*RdmaStat) Descriptor() ([]byte, []int) {
- return fileDescriptor_2fc6005842049e6b, []int{5}
-}
-func (m *RdmaStat) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *RdmaStat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_RdmaStat.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *RdmaStat) XXX_Merge(src proto.Message) {
- xxx_messageInfo_RdmaStat.Merge(m, src)
-}
-func (m *RdmaStat) XXX_Size() int {
- return m.Size()
-}
-func (m *RdmaStat) XXX_DiscardUnknown() {
- xxx_messageInfo_RdmaStat.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_RdmaStat proto.InternalMessageInfo
-
-type RdmaEntry struct {
- Device string `protobuf:"bytes,1,opt,name=device,proto3" json:"device,omitempty"`
- HcaHandles uint32 `protobuf:"varint,2,opt,name=hca_handles,json=hcaHandles,proto3" json:"hca_handles,omitempty"`
- HcaObjects uint32 `protobuf:"varint,3,opt,name=hca_objects,json=hcaObjects,proto3" json:"hca_objects,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *RdmaEntry) Reset() { *m = RdmaEntry{} }
-func (*RdmaEntry) ProtoMessage() {}
-func (*RdmaEntry) Descriptor() ([]byte, []int) {
- return fileDescriptor_2fc6005842049e6b, []int{6}
-}
-func (m *RdmaEntry) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *RdmaEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_RdmaEntry.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *RdmaEntry) XXX_Merge(src proto.Message) {
- xxx_messageInfo_RdmaEntry.Merge(m, src)
-}
-func (m *RdmaEntry) XXX_Size() int {
- return m.Size()
-}
-func (m *RdmaEntry) XXX_DiscardUnknown() {
- xxx_messageInfo_RdmaEntry.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_RdmaEntry proto.InternalMessageInfo
-
-type IOStat struct {
- Usage []*IOEntry `protobuf:"bytes,1,rep,name=usage,proto3" json:"usage,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *IOStat) Reset() { *m = IOStat{} }
-func (*IOStat) ProtoMessage() {}
-func (*IOStat) Descriptor() ([]byte, []int) {
- return fileDescriptor_2fc6005842049e6b, []int{7}
-}
-func (m *IOStat) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *IOStat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_IOStat.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *IOStat) XXX_Merge(src proto.Message) {
- xxx_messageInfo_IOStat.Merge(m, src)
-}
-func (m *IOStat) XXX_Size() int {
- return m.Size()
-}
-func (m *IOStat) XXX_DiscardUnknown() {
- xxx_messageInfo_IOStat.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_IOStat proto.InternalMessageInfo
-
-type IOEntry struct {
- Major uint64 `protobuf:"varint,1,opt,name=major,proto3" json:"major,omitempty"`
- Minor uint64 `protobuf:"varint,2,opt,name=minor,proto3" json:"minor,omitempty"`
- Rbytes uint64 `protobuf:"varint,3,opt,name=rbytes,proto3" json:"rbytes,omitempty"`
- Wbytes uint64 `protobuf:"varint,4,opt,name=wbytes,proto3" json:"wbytes,omitempty"`
- Rios uint64 `protobuf:"varint,5,opt,name=rios,proto3" json:"rios,omitempty"`
- Wios uint64 `protobuf:"varint,6,opt,name=wios,proto3" json:"wios,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *IOEntry) Reset() { *m = IOEntry{} }
-func (*IOEntry) ProtoMessage() {}
-func (*IOEntry) Descriptor() ([]byte, []int) {
- return fileDescriptor_2fc6005842049e6b, []int{8}
-}
-func (m *IOEntry) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *IOEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_IOEntry.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *IOEntry) XXX_Merge(src proto.Message) {
- xxx_messageInfo_IOEntry.Merge(m, src)
-}
-func (m *IOEntry) XXX_Size() int {
- return m.Size()
-}
-func (m *IOEntry) XXX_DiscardUnknown() {
- xxx_messageInfo_IOEntry.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_IOEntry proto.InternalMessageInfo
-
-type HugeTlbStat struct {
- Current uint64 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"`
- Max uint64 `protobuf:"varint,2,opt,name=max,proto3" json:"max,omitempty"`
- Pagesize string `protobuf:"bytes,3,opt,name=pagesize,proto3" json:"pagesize,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *HugeTlbStat) Reset() { *m = HugeTlbStat{} }
-func (*HugeTlbStat) ProtoMessage() {}
-func (*HugeTlbStat) Descriptor() ([]byte, []int) {
- return fileDescriptor_2fc6005842049e6b, []int{9}
-}
-func (m *HugeTlbStat) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *HugeTlbStat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_HugeTlbStat.Marshal(b, m, deterministic)
- } else {
- b = b[:cap(b)]
- n, err := m.MarshalTo(b)
- if err != nil {
- return nil, err
- }
- return b[:n], nil
- }
-}
-func (m *HugeTlbStat) XXX_Merge(src proto.Message) {
- xxx_messageInfo_HugeTlbStat.Merge(m, src)
-}
-func (m *HugeTlbStat) XXX_Size() int {
- return m.Size()
-}
-func (m *HugeTlbStat) XXX_DiscardUnknown() {
- xxx_messageInfo_HugeTlbStat.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_HugeTlbStat proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*Metrics)(nil), "io.containerd.cgroups.v2.Metrics")
- proto.RegisterType((*PidsStat)(nil), "io.containerd.cgroups.v2.PidsStat")
- proto.RegisterType((*CPUStat)(nil), "io.containerd.cgroups.v2.CPUStat")
- proto.RegisterType((*MemoryStat)(nil), "io.containerd.cgroups.v2.MemoryStat")
- proto.RegisterType((*MemoryEvents)(nil), "io.containerd.cgroups.v2.MemoryEvents")
- proto.RegisterType((*RdmaStat)(nil), "io.containerd.cgroups.v2.RdmaStat")
- proto.RegisterType((*RdmaEntry)(nil), "io.containerd.cgroups.v2.RdmaEntry")
- proto.RegisterType((*IOStat)(nil), "io.containerd.cgroups.v2.IOStat")
- proto.RegisterType((*IOEntry)(nil), "io.containerd.cgroups.v2.IOEntry")
- proto.RegisterType((*HugeTlbStat)(nil), "io.containerd.cgroups.v2.HugeTlbStat")
-}
-
-func init() {
- proto.RegisterFile("github.com/containerd/cgroups/v2/stats/metrics.proto", fileDescriptor_2fc6005842049e6b)
-}
-
-var fileDescriptor_2fc6005842049e6b = []byte{
- // 1198 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x56, 0x4d, 0x73, 0xd4, 0x46,
- 0x13, 0x66, 0xed, 0xc5, 0xeb, 0xed, 0xb5, 0xc1, 0x0c, 0x86, 0x57, 0xc0, 0xcb, 0xda, 0x5e, 0x02,
- 0x45, 0xaa, 0x92, 0xdd, 0x94, 0xf3, 0x55, 0x49, 0x91, 0x4a, 0x19, 0x02, 0x45, 0x8a, 0x10, 0x5c,
- 0x02, 0x57, 0x8e, 0xaa, 0x59, 0x69, 0x2c, 0x0d, 0x96, 0x34, 0xaa, 0x99, 0x91, 0x1d, 0x73, 0xca,
- 0x21, 0xd7, 0x54, 0x7e, 0x4d, 0xfe, 0x03, 0xb7, 0xe4, 0x98, 0x53, 0x2a, 0xf8, 0x97, 0xa4, 0xba,
- 0x67, 0x64, 0x29, 0x07, 0x43, 0x6e, 0xd3, 0x4f, 0x3f, 0xdd, 0xea, 0x8f, 0x99, 0x6e, 0xc1, 0x27,
- 0xa9, 0xb4, 0x59, 0x3d, 0x9f, 0xc6, 0xaa, 0x98, 0xc5, 0xaa, 0xb4, 0x5c, 0x96, 0x42, 0x27, 0xb3,
- 0x38, 0xd5, 0xaa, 0xae, 0xcc, 0xec, 0x70, 0x7b, 0x66, 0x2c, 0xb7, 0x66, 0x56, 0x08, 0xab, 0x65,
- 0x6c, 0xa6, 0x95, 0x56, 0x56, 0xb1, 0x40, 0xaa, 0x69, 0xcb, 0x9e, 0x7a, 0xf6, 0xf4, 0x70, 0xfb,
- 0xfa, 0x7a, 0xaa, 0x52, 0x45, 0xa4, 0x19, 0x9e, 0x1c, 0x7f, 0xf2, 0xdb, 0x22, 0x0c, 0x9e, 0x3a,
- 0x0f, 0xec, 0x33, 0xe8, 0x57, 0x32, 0x31, 0x41, 0x6f, 0xb3, 0x77, 0x77, 0xb4, 0x3d, 0x99, 0x9e,
- 0xe5, 0x6a, 0xba, 0x2b, 0x13, 0xf3, 0xdc, 0x72, 0x1b, 0x12, 0x9f, 0xdd, 0x83, 0xc5, 0xb8, 0xaa,
- 0x83, 0x05, 0x32, 0xdb, 0x3a, 0xdb, 0xec, 0xc1, 0xee, 0x1e, 0x5a, 0xdd, 0x1f, 0x9c, 0xfc, 0xb5,
- 0xb1, 0xf8, 0x60, 0x77, 0x2f, 0x44, 0x33, 0x76, 0x0f, 0x96, 0x0a, 0x51, 0x28, 0x7d, 0x1c, 0xf4,
- 0xc9, 0xc1, 0x7b, 0x67, 0x3b, 0x78, 0x4a, 0x3c, 0xfa, 0xb2, 0xb7, 0xc1, 0x98, 0x75, 0x52, 0xf0,
- 0xe0, 0xfc, 0xbb, 0x62, 0x0e, 0x93, 0x82, 0xbb, 0x98, 0x91, 0xcf, 0x3e, 0x82, 0x05, 0xa9, 0x82,
- 0x25, 0xb2, 0xda, 0x3c, 0xdb, 0xea, 0xdb, 0x67, 0x64, 0xb3, 0x20, 0x15, 0xfb, 0x1a, 0x06, 0x59,
- 0x9d, 0x0a, 0x9b, 0xcf, 0x83, 0xc1, 0xe6, 0xe2, 0xdd, 0xd1, 0xf6, 0xed, 0xb3, 0xcd, 0x1e, 0xd7,
- 0xa9, 0x78, 0x91, 0xcf, 0xc9, 0xb6, 0xb1, 0x62, 0x4f, 0x60, 0xd5, 0x05, 0x1d, 0x89, 0x43, 0x51,
- 0x5a, 0x13, 0x2c, 0xd3, 0xd7, 0xef, 0xbc, 0x2b, 0xdf, 0x87, 0xc4, 0x0e, 0x57, 0x8a, 0x8e, 0x34,
- 0xf9, 0x12, 0x96, 0x9b, 0x2e, 0xb0, 0x00, 0x06, 0x71, 0xad, 0xb5, 0x28, 0x2d, 0xb5, 0xae, 0x1f,
- 0x36, 0x22, 0x5b, 0x87, 0xf3, 0xb9, 0x2c, 0xa4, 0xa5, 0xde, 0xf4, 0x43, 0x27, 0x4c, 0x7e, 0xef,
- 0xc1, 0xc0, 0xf7, 0x82, 0xdd, 0x04, 0xa8, 0x0d, 0x4f, 0x45, 0x54, 0x1b, 0x11, 0x7b, 0xf3, 0x21,
- 0x21, 0x7b, 0x46, 0xc4, 0xec, 0x06, 0x0c, 0x6b, 0x23, 0xb4, 0xd3, 0x3a, 0x27, 0xcb, 0x08, 0x90,
- 0x72, 0x03, 0x46, 0xe6, 0xd8, 0x58, 0x51, 0x38, 0xf5, 0x22, 0xa9, 0xc1, 0x41, 0x44, 0xb8, 0x09,
- 0x50, 0xea, 0xa8, 0x12, 0x5a, 0xaa, 0xc4, 0x50, 0x7b, 0xfb, 0xe1, 0xb0, 0xd4, 0xbb, 0x0e, 0x60,
- 0x5b, 0xb0, 0x52, 0xea, 0xc8, 0x66, 0x5a, 0x59, 0x9b, 0x8b, 0x84, 0x7a, 0xd8, 0x0f, 0x47, 0xa5,
- 0x7e, 0xd1, 0x40, 0xec, 0x36, 0x5c, 0x38, 0xd5, 0xbb, 0xaf, 0x2c, 0x11, 0x69, 0xf5, 0x14, 0xc5,
- 0x0f, 0x4d, 0x7e, 0x1d, 0x02, 0xb4, 0x97, 0x83, 0x31, 0xe8, 0xf3, 0x52, 0x95, 0x3e, 0x1d, 0x3a,
- 0x23, 0xb6, 0x2f, 0x73, 0xe1, 0x93, 0xa0, 0x33, 0x06, 0x70, 0x20, 0x74, 0x29, 0xf2, 0xc8, 0x58,
- 0x1e, 0x1f, 0xf8, 0x0c, 0x46, 0x0e, 0x7b, 0x8e, 0x10, 0x9a, 0x99, 0x9c, 0xcf, 0x7d, 0xf0, 0x74,
- 0x26, 0x4c, 0xc5, 0x07, 0x3e, 0x5e, 0x3a, 0x63, 0xa5, 0x4d, 0x56, 0x88, 0xc2, 0xc7, 0xe7, 0x04,
- 0xac, 0x10, 0x7e, 0x28, 0x2a, 0x78, 0x55, 0x89, 0x24, 0x18, 0xb8, 0x0a, 0x21, 0xf4, 0x94, 0x10,
- 0xac, 0x10, 0x11, 0x12, 0xa9, 0xed, 0x31, 0x5d, 0x88, 0x7e, 0x38, 0x44, 0xe4, 0x1b, 0x04, 0x30,
- 0x7d, 0x52, 0x1f, 0x69, 0x69, 0xc5, 0x1c, 0x43, 0x1c, 0xba, 0xf4, 0x11, 0xfd, 0xa1, 0x01, 0xd9,
- 0x35, 0x58, 0xc6, 0x1c, 0x23, 0x9b, 0x55, 0x01, 0xb8, 0x1b, 0x80, 0xf2, 0x8b, 0xac, 0x62, 0xb7,
- 0x60, 0x55, 0x96, 0x3c, 0xb6, 0xf2, 0x50, 0x44, 0x54, 0x93, 0x11, 0xe9, 0x57, 0x1a, 0x70, 0x07,
- 0x6b, 0xb3, 0x01, 0xa3, 0x2e, 0x65, 0xc5, 0x85, 0xd9, 0x21, 0x74, 0xbd, 0x50, 0x15, 0x57, 0xff,
- 0xed, 0xe5, 0x11, 0x56, 0xb3, 0xf5, 0x42, 0x94, 0x0b, 0x5d, 0x2f, 0x44, 0xd8, 0x84, 0x51, 0x5d,
- 0x8a, 0x43, 0x19, 0x5b, 0x3e, 0xcf, 0x45, 0x70, 0xd1, 0x55, 0xbb, 0x03, 0xb1, 0xf7, 0x61, 0x0d,
- 0x2b, 0x1c, 0x69, 0x11, 0xe7, 0x5c, 0x16, 0x44, 0x5b, 0x23, 0xda, 0x45, 0xc4, 0xc3, 0x16, 0x66,
- 0x1f, 0x02, 0x23, 0x6a, 0x5d, 0x76, 0xc9, 0x97, 0x88, 0x7c, 0x09, 0x35, 0x7b, 0x5d, 0x05, 0xbe,
- 0x91, 0x2a, 0xdd, 0xe7, 0x75, 0x6e, 0x03, 0xe6, 0x2a, 0xe4, 0x45, 0x36, 0x06, 0xa8, 0xd2, 0x82,
- 0xbf, 0x74, 0xca, 0xcb, 0x2e, 0xea, 0x16, 0xc1, 0x0f, 0x1d, 0x29, 0x7d, 0x20, 0xcb, 0xd4, 0x08,
- 0x1b, 0x69, 0xe1, 0x78, 0xeb, 0xee, 0x43, 0xad, 0x26, 0x74, 0x0a, 0x36, 0x83, 0xcb, 0x1d, 0x3a,
- 0x65, 0xcf, 0xad, 0x08, 0xae, 0x10, 0xbf, 0xe3, 0x69, 0xc7, 0x6b, 0xd8, 0xa7, 0x70, 0xb5, 0x63,
- 0x50, 0xaa, 0x44, 0xf8, 0xb8, 0x83, 0xab, 0x64, 0x73, 0xa5, 0xd5, 0x7e, 0xdf, 0x2a, 0xd9, 0x75,
- 0x58, 0xae, 0x52, 0x2d, 0xf6, 0x65, 0x9e, 0x07, 0xff, 0x73, 0x0f, 0xb3, 0x91, 0xd9, 0x55, 0x58,
- 0xaa, 0x52, 0x13, 0xf3, 0x32, 0x08, 0x48, 0xe3, 0x25, 0x57, 0x04, 0x63, 0x05, 0xcf, 0x83, 0x6b,
- 0x4d, 0x11, 0x48, 0x74, 0x45, 0x38, 0x0d, 0xf6, 0x7a, 0x53, 0x84, 0x06, 0x61, 0x13, 0x58, 0xa9,
- 0xd2, 0x44, 0x9c, 0x32, 0x6e, 0xb8, 0xfe, 0x77, 0x31, 0xe7, 0x23, 0xe7, 0xaf, 0x8e, 0xf7, 0xb5,
- 0x10, 0xc1, 0xff, 0x1b, 0x1f, 0x0d, 0x82, 0xed, 0x6f, 0xa5, 0x24, 0xb8, 0xe9, 0xda, 0xdf, 0x81,
- 0xd8, 0x1d, 0xb8, 0x68, 0xb3, 0x2a, 0xa2, 0x42, 0x46, 0x3c, 0xcf, 0x55, 0x1c, 0x8c, 0x9b, 0xe7,
- 0x5e, 0x3d, 0x42, 0x74, 0x07, 0x41, 0xf6, 0x01, 0x30, 0xe4, 0xc5, 0x2a, 0xcf, 0x79, 0x65, 0x84,
- 0xa7, 0x6e, 0x10, 0x75, 0xcd, 0x66, 0xd5, 0x03, 0xaf, 0x70, 0xec, 0x75, 0x38, 0x4f, 0x03, 0x2d,
- 0xd8, 0x74, 0x4f, 0x93, 0x04, 0xbc, 0xad, 0x6e, 0xf0, 0xb9, 0x01, 0xb9, 0xe5, 0xc2, 0x25, 0xe8,
- 0x3b, 0x44, 0xf0, 0x69, 0x9a, 0x23, 0x5e, 0x45, 0xce, 0x76, 0xe2, 0x9e, 0x26, 0x22, 0x7b, 0x64,
- 0xdf, 0xa8, 0x9d, 0xf9, 0xad, 0x56, 0x4d, 0xd6, 0x13, 0x03, 0x2b, 0xdd, 0xe9, 0xcd, 0xd6, 0x60,
- 0x31, 0x57, 0x47, 0x7e, 0x22, 0xe1, 0x11, 0xa7, 0x48, 0x26, 0xd3, 0xac, 0x19, 0x48, 0x78, 0x46,
- 0x56, 0xc1, 0x7f, 0xf4, 0x73, 0x08, 0x8f, 0x88, 0x28, 0x55, 0xf8, 0xf1, 0x83, 0x47, 0x7c, 0xec,
- 0x4a, 0x15, 0xd1, 0x01, 0x36, 0xde, 0x4d, 0xa0, 0x81, 0x52, 0xc5, 0x13, 0x99, 0xe7, 0x93, 0x9f,
- 0x7b, 0xb0, 0xdc, 0xec, 0x39, 0xf6, 0x55, 0x77, 0x2b, 0xe0, 0xbe, 0xba, 0xf5, 0xf6, 0xe5, 0xf8,
- 0xb0, 0xb4, 0xfa, 0xb8, 0x5d, 0x1d, 0x5f, 0xb4, 0xab, 0xe3, 0x3f, 0x1b, 0xfb, 0xfd, 0x22, 0x60,
- 0x78, 0x8a, 0xe1, 0x5d, 0x4c, 0xf0, 0x81, 0x0b, 0xca, 0x7d, 0x18, 0x7a, 0x09, 0xeb, 0x9f, 0xc5,
- 0x3c, 0xca, 0x78, 0x99, 0xe4, 0xc2, 0x50, 0x15, 0x56, 0x43, 0xc8, 0x62, 0xfe, 0xd8, 0x21, 0x0d,
- 0x41, 0xcd, 0x5f, 0x8a, 0xd8, 0x1a, 0xaa, 0x89, 0x23, 0x3c, 0x73, 0xc8, 0x64, 0x07, 0x96, 0xdc,
- 0x7a, 0x66, 0x9f, 0x37, 0x1d, 0x76, 0x89, 0x6e, 0xbd, 0x6d, 0x9f, 0xfb, 0x48, 0x89, 0x3f, 0xf9,
- 0xa5, 0x07, 0x03, 0x0f, 0xe1, 0x35, 0x29, 0xf8, 0x4b, 0xa5, 0x7d, 0x8f, 0x9c, 0x40, 0xa8, 0x2c,
- 0x95, 0x6e, 0x36, 0x28, 0x09, 0x98, 0x94, 0x9e, 0x1f, 0x5b, 0x61, 0x7c, 0xab, 0xbc, 0x84, 0xf8,
- 0x91, 0xc3, 0x5d, 0xc3, 0xbc, 0x84, 0xbd, 0xd6, 0x52, 0x99, 0x66, 0x63, 0xe0, 0x19, 0xb1, 0x23,
- 0xc4, 0xdc, 0xc2, 0xa0, 0xf3, 0x64, 0x0f, 0x46, 0x9d, 0x5f, 0x87, 0xb7, 0x2c, 0x76, 0x7f, 0x51,
- 0x16, 0xda, 0x8b, 0x82, 0xf3, 0x80, 0xa7, 0xc2, 0xc8, 0x57, 0x82, 0x82, 0x1a, 0x86, 0xa7, 0xf2,
- 0xfd, 0xe0, 0xf5, 0x9b, 0xf1, 0xb9, 0x3f, 0xdf, 0x8c, 0xcf, 0xfd, 0x74, 0x32, 0xee, 0xbd, 0x3e,
- 0x19, 0xf7, 0xfe, 0x38, 0x19, 0xf7, 0xfe, 0x3e, 0x19, 0xf7, 0xe6, 0x4b, 0xf4, 0x17, 0xf8, 0xf1,
- 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x4f, 0x2b, 0x30, 0xd6, 0x6d, 0x0a, 0x00, 0x00,
-}
-
-func (m *Metrics) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *Metrics) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Pids != nil {
- dAtA[i] = 0xa
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Pids.Size()))
- n1, err := m.Pids.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n1
- }
- if m.CPU != nil {
- dAtA[i] = 0x12
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.CPU.Size()))
- n2, err := m.CPU.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n2
- }
- if m.Memory != nil {
- dAtA[i] = 0x22
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Memory.Size()))
- n3, err := m.Memory.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n3
- }
- if m.Rdma != nil {
- dAtA[i] = 0x2a
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Rdma.Size()))
- n4, err := m.Rdma.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n4
- }
- if m.Io != nil {
- dAtA[i] = 0x32
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Io.Size()))
- n5, err := m.Io.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n5
- }
- if len(m.Hugetlb) > 0 {
- for _, msg := range m.Hugetlb {
- dAtA[i] = 0x3a
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(msg.Size()))
- n, err := msg.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n
- }
- }
- if m.MemoryEvents != nil {
- dAtA[i] = 0x42
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.MemoryEvents.Size()))
- n6, err := m.MemoryEvents.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n6
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *PidsStat) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *PidsStat) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Current != 0 {
- dAtA[i] = 0x8
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Current))
- }
- if m.Limit != 0 {
- dAtA[i] = 0x10
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Limit))
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *CPUStat) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *CPUStat) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.UsageUsec != 0 {
- dAtA[i] = 0x8
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.UsageUsec))
- }
- if m.UserUsec != 0 {
- dAtA[i] = 0x10
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.UserUsec))
- }
- if m.SystemUsec != 0 {
- dAtA[i] = 0x18
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.SystemUsec))
- }
- if m.NrPeriods != 0 {
- dAtA[i] = 0x20
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.NrPeriods))
- }
- if m.NrThrottled != 0 {
- dAtA[i] = 0x28
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.NrThrottled))
- }
- if m.ThrottledUsec != 0 {
- dAtA[i] = 0x30
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.ThrottledUsec))
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *MemoryStat) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *MemoryStat) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Anon != 0 {
- dAtA[i] = 0x8
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Anon))
- }
- if m.File != 0 {
- dAtA[i] = 0x10
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.File))
- }
- if m.KernelStack != 0 {
- dAtA[i] = 0x18
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.KernelStack))
- }
- if m.Slab != 0 {
- dAtA[i] = 0x20
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Slab))
- }
- if m.Sock != 0 {
- dAtA[i] = 0x28
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Sock))
- }
- if m.Shmem != 0 {
- dAtA[i] = 0x30
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Shmem))
- }
- if m.FileMapped != 0 {
- dAtA[i] = 0x38
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.FileMapped))
- }
- if m.FileDirty != 0 {
- dAtA[i] = 0x40
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.FileDirty))
- }
- if m.FileWriteback != 0 {
- dAtA[i] = 0x48
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.FileWriteback))
- }
- if m.AnonThp != 0 {
- dAtA[i] = 0x50
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.AnonThp))
- }
- if m.InactiveAnon != 0 {
- dAtA[i] = 0x58
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.InactiveAnon))
- }
- if m.ActiveAnon != 0 {
- dAtA[i] = 0x60
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.ActiveAnon))
- }
- if m.InactiveFile != 0 {
- dAtA[i] = 0x68
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.InactiveFile))
- }
- if m.ActiveFile != 0 {
- dAtA[i] = 0x70
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.ActiveFile))
- }
- if m.Unevictable != 0 {
- dAtA[i] = 0x78
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Unevictable))
- }
- if m.SlabReclaimable != 0 {
- dAtA[i] = 0x80
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.SlabReclaimable))
- }
- if m.SlabUnreclaimable != 0 {
- dAtA[i] = 0x88
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.SlabUnreclaimable))
- }
- if m.Pgfault != 0 {
- dAtA[i] = 0x90
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Pgfault))
- }
- if m.Pgmajfault != 0 {
- dAtA[i] = 0x98
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Pgmajfault))
- }
- if m.WorkingsetRefault != 0 {
- dAtA[i] = 0xa0
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.WorkingsetRefault))
- }
- if m.WorkingsetActivate != 0 {
- dAtA[i] = 0xa8
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.WorkingsetActivate))
- }
- if m.WorkingsetNodereclaim != 0 {
- dAtA[i] = 0xb0
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.WorkingsetNodereclaim))
- }
- if m.Pgrefill != 0 {
- dAtA[i] = 0xb8
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Pgrefill))
- }
- if m.Pgscan != 0 {
- dAtA[i] = 0xc0
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Pgscan))
- }
- if m.Pgsteal != 0 {
- dAtA[i] = 0xc8
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Pgsteal))
- }
- if m.Pgactivate != 0 {
- dAtA[i] = 0xd0
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Pgactivate))
- }
- if m.Pgdeactivate != 0 {
- dAtA[i] = 0xd8
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Pgdeactivate))
- }
- if m.Pglazyfree != 0 {
- dAtA[i] = 0xe0
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Pglazyfree))
- }
- if m.Pglazyfreed != 0 {
- dAtA[i] = 0xe8
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Pglazyfreed))
- }
- if m.ThpFaultAlloc != 0 {
- dAtA[i] = 0xf0
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.ThpFaultAlloc))
- }
- if m.ThpCollapseAlloc != 0 {
- dAtA[i] = 0xf8
- i++
- dAtA[i] = 0x1
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.ThpCollapseAlloc))
- }
- if m.Usage != 0 {
- dAtA[i] = 0x80
- i++
- dAtA[i] = 0x2
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Usage))
- }
- if m.UsageLimit != 0 {
- dAtA[i] = 0x88
- i++
- dAtA[i] = 0x2
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.UsageLimit))
- }
- if m.SwapUsage != 0 {
- dAtA[i] = 0x90
- i++
- dAtA[i] = 0x2
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.SwapUsage))
- }
- if m.SwapLimit != 0 {
- dAtA[i] = 0x98
- i++
- dAtA[i] = 0x2
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.SwapLimit))
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *MemoryEvents) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *MemoryEvents) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Low != 0 {
- dAtA[i] = 0x8
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Low))
- }
- if m.High != 0 {
- dAtA[i] = 0x10
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.High))
- }
- if m.Max != 0 {
- dAtA[i] = 0x18
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Max))
- }
- if m.Oom != 0 {
- dAtA[i] = 0x20
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Oom))
- }
- if m.OomKill != 0 {
- dAtA[i] = 0x28
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.OomKill))
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *RdmaStat) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *RdmaStat) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if len(m.Current) > 0 {
- for _, msg := range m.Current {
- dAtA[i] = 0xa
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(msg.Size()))
- n, err := msg.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n
- }
- }
- if len(m.Limit) > 0 {
- for _, msg := range m.Limit {
- dAtA[i] = 0x12
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(msg.Size()))
- n, err := msg.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n
- }
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *RdmaEntry) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *RdmaEntry) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if len(m.Device) > 0 {
- dAtA[i] = 0xa
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(len(m.Device)))
- i += copy(dAtA[i:], m.Device)
- }
- if m.HcaHandles != 0 {
- dAtA[i] = 0x10
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.HcaHandles))
- }
- if m.HcaObjects != 0 {
- dAtA[i] = 0x18
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.HcaObjects))
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *IOStat) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *IOStat) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if len(m.Usage) > 0 {
- for _, msg := range m.Usage {
- dAtA[i] = 0xa
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(msg.Size()))
- n, err := msg.MarshalTo(dAtA[i:])
- if err != nil {
- return 0, err
- }
- i += n
- }
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *IOEntry) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *IOEntry) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Major != 0 {
- dAtA[i] = 0x8
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Major))
- }
- if m.Minor != 0 {
- dAtA[i] = 0x10
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Minor))
- }
- if m.Rbytes != 0 {
- dAtA[i] = 0x18
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Rbytes))
- }
- if m.Wbytes != 0 {
- dAtA[i] = 0x20
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Wbytes))
- }
- if m.Rios != 0 {
- dAtA[i] = 0x28
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Rios))
- }
- if m.Wios != 0 {
- dAtA[i] = 0x30
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Wios))
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func (m *HugeTlbStat) Marshal() (dAtA []byte, err error) {
- size := m.Size()
- dAtA = make([]byte, size)
- n, err := m.MarshalTo(dAtA)
- if err != nil {
- return nil, err
- }
- return dAtA[:n], nil
-}
-
-func (m *HugeTlbStat) MarshalTo(dAtA []byte) (int, error) {
- var i int
- _ = i
- var l int
- _ = l
- if m.Current != 0 {
- dAtA[i] = 0x8
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Current))
- }
- if m.Max != 0 {
- dAtA[i] = 0x10
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(m.Max))
- }
- if len(m.Pagesize) > 0 {
- dAtA[i] = 0x1a
- i++
- i = encodeVarintMetrics(dAtA, i, uint64(len(m.Pagesize)))
- i += copy(dAtA[i:], m.Pagesize)
- }
- if m.XXX_unrecognized != nil {
- i += copy(dAtA[i:], m.XXX_unrecognized)
- }
- return i, nil
-}
-
-func encodeVarintMetrics(dAtA []byte, offset int, v uint64) int {
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return offset + 1
-}
-func (m *Metrics) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Pids != nil {
- l = m.Pids.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- if m.CPU != nil {
- l = m.CPU.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- if m.Memory != nil {
- l = m.Memory.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- if m.Rdma != nil {
- l = m.Rdma.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- if m.Io != nil {
- l = m.Io.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- if len(m.Hugetlb) > 0 {
- for _, e := range m.Hugetlb {
- l = e.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- }
- if m.MemoryEvents != nil {
- l = m.MemoryEvents.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *PidsStat) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Current != 0 {
- n += 1 + sovMetrics(uint64(m.Current))
- }
- if m.Limit != 0 {
- n += 1 + sovMetrics(uint64(m.Limit))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *CPUStat) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.UsageUsec != 0 {
- n += 1 + sovMetrics(uint64(m.UsageUsec))
- }
- if m.UserUsec != 0 {
- n += 1 + sovMetrics(uint64(m.UserUsec))
- }
- if m.SystemUsec != 0 {
- n += 1 + sovMetrics(uint64(m.SystemUsec))
- }
- if m.NrPeriods != 0 {
- n += 1 + sovMetrics(uint64(m.NrPeriods))
- }
- if m.NrThrottled != 0 {
- n += 1 + sovMetrics(uint64(m.NrThrottled))
- }
- if m.ThrottledUsec != 0 {
- n += 1 + sovMetrics(uint64(m.ThrottledUsec))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *MemoryStat) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Anon != 0 {
- n += 1 + sovMetrics(uint64(m.Anon))
- }
- if m.File != 0 {
- n += 1 + sovMetrics(uint64(m.File))
- }
- if m.KernelStack != 0 {
- n += 1 + sovMetrics(uint64(m.KernelStack))
- }
- if m.Slab != 0 {
- n += 1 + sovMetrics(uint64(m.Slab))
- }
- if m.Sock != 0 {
- n += 1 + sovMetrics(uint64(m.Sock))
- }
- if m.Shmem != 0 {
- n += 1 + sovMetrics(uint64(m.Shmem))
- }
- if m.FileMapped != 0 {
- n += 1 + sovMetrics(uint64(m.FileMapped))
- }
- if m.FileDirty != 0 {
- n += 1 + sovMetrics(uint64(m.FileDirty))
- }
- if m.FileWriteback != 0 {
- n += 1 + sovMetrics(uint64(m.FileWriteback))
- }
- if m.AnonThp != 0 {
- n += 1 + sovMetrics(uint64(m.AnonThp))
- }
- if m.InactiveAnon != 0 {
- n += 1 + sovMetrics(uint64(m.InactiveAnon))
- }
- if m.ActiveAnon != 0 {
- n += 1 + sovMetrics(uint64(m.ActiveAnon))
- }
- if m.InactiveFile != 0 {
- n += 1 + sovMetrics(uint64(m.InactiveFile))
- }
- if m.ActiveFile != 0 {
- n += 1 + sovMetrics(uint64(m.ActiveFile))
- }
- if m.Unevictable != 0 {
- n += 1 + sovMetrics(uint64(m.Unevictable))
- }
- if m.SlabReclaimable != 0 {
- n += 2 + sovMetrics(uint64(m.SlabReclaimable))
- }
- if m.SlabUnreclaimable != 0 {
- n += 2 + sovMetrics(uint64(m.SlabUnreclaimable))
- }
- if m.Pgfault != 0 {
- n += 2 + sovMetrics(uint64(m.Pgfault))
- }
- if m.Pgmajfault != 0 {
- n += 2 + sovMetrics(uint64(m.Pgmajfault))
- }
- if m.WorkingsetRefault != 0 {
- n += 2 + sovMetrics(uint64(m.WorkingsetRefault))
- }
- if m.WorkingsetActivate != 0 {
- n += 2 + sovMetrics(uint64(m.WorkingsetActivate))
- }
- if m.WorkingsetNodereclaim != 0 {
- n += 2 + sovMetrics(uint64(m.WorkingsetNodereclaim))
- }
- if m.Pgrefill != 0 {
- n += 2 + sovMetrics(uint64(m.Pgrefill))
- }
- if m.Pgscan != 0 {
- n += 2 + sovMetrics(uint64(m.Pgscan))
- }
- if m.Pgsteal != 0 {
- n += 2 + sovMetrics(uint64(m.Pgsteal))
- }
- if m.Pgactivate != 0 {
- n += 2 + sovMetrics(uint64(m.Pgactivate))
- }
- if m.Pgdeactivate != 0 {
- n += 2 + sovMetrics(uint64(m.Pgdeactivate))
- }
- if m.Pglazyfree != 0 {
- n += 2 + sovMetrics(uint64(m.Pglazyfree))
- }
- if m.Pglazyfreed != 0 {
- n += 2 + sovMetrics(uint64(m.Pglazyfreed))
- }
- if m.ThpFaultAlloc != 0 {
- n += 2 + sovMetrics(uint64(m.ThpFaultAlloc))
- }
- if m.ThpCollapseAlloc != 0 {
- n += 2 + sovMetrics(uint64(m.ThpCollapseAlloc))
- }
- if m.Usage != 0 {
- n += 2 + sovMetrics(uint64(m.Usage))
- }
- if m.UsageLimit != 0 {
- n += 2 + sovMetrics(uint64(m.UsageLimit))
- }
- if m.SwapUsage != 0 {
- n += 2 + sovMetrics(uint64(m.SwapUsage))
- }
- if m.SwapLimit != 0 {
- n += 2 + sovMetrics(uint64(m.SwapLimit))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *MemoryEvents) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Low != 0 {
- n += 1 + sovMetrics(uint64(m.Low))
- }
- if m.High != 0 {
- n += 1 + sovMetrics(uint64(m.High))
- }
- if m.Max != 0 {
- n += 1 + sovMetrics(uint64(m.Max))
- }
- if m.Oom != 0 {
- n += 1 + sovMetrics(uint64(m.Oom))
- }
- if m.OomKill != 0 {
- n += 1 + sovMetrics(uint64(m.OomKill))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *RdmaStat) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.Current) > 0 {
- for _, e := range m.Current {
- l = e.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- }
- if len(m.Limit) > 0 {
- for _, e := range m.Limit {
- l = e.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *RdmaEntry) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Device)
- if l > 0 {
- n += 1 + l + sovMetrics(uint64(l))
- }
- if m.HcaHandles != 0 {
- n += 1 + sovMetrics(uint64(m.HcaHandles))
- }
- if m.HcaObjects != 0 {
- n += 1 + sovMetrics(uint64(m.HcaObjects))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *IOStat) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.Usage) > 0 {
- for _, e := range m.Usage {
- l = e.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *IOEntry) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Major != 0 {
- n += 1 + sovMetrics(uint64(m.Major))
- }
- if m.Minor != 0 {
- n += 1 + sovMetrics(uint64(m.Minor))
- }
- if m.Rbytes != 0 {
- n += 1 + sovMetrics(uint64(m.Rbytes))
- }
- if m.Wbytes != 0 {
- n += 1 + sovMetrics(uint64(m.Wbytes))
- }
- if m.Rios != 0 {
- n += 1 + sovMetrics(uint64(m.Rios))
- }
- if m.Wios != 0 {
- n += 1 + sovMetrics(uint64(m.Wios))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *HugeTlbStat) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Current != 0 {
- n += 1 + sovMetrics(uint64(m.Current))
- }
- if m.Max != 0 {
- n += 1 + sovMetrics(uint64(m.Max))
- }
- l = len(m.Pagesize)
- if l > 0 {
- n += 1 + l + sovMetrics(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func sovMetrics(x uint64) (n int) {
- for {
- n++
- x >>= 7
- if x == 0 {
- break
- }
- }
- return n
-}
-func sozMetrics(x uint64) (n int) {
- return sovMetrics(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-func (this *Metrics) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&Metrics{`,
- `Pids:` + strings.Replace(fmt.Sprintf("%v", this.Pids), "PidsStat", "PidsStat", 1) + `,`,
- `CPU:` + strings.Replace(fmt.Sprintf("%v", this.CPU), "CPUStat", "CPUStat", 1) + `,`,
- `Memory:` + strings.Replace(fmt.Sprintf("%v", this.Memory), "MemoryStat", "MemoryStat", 1) + `,`,
- `Rdma:` + strings.Replace(fmt.Sprintf("%v", this.Rdma), "RdmaStat", "RdmaStat", 1) + `,`,
- `Io:` + strings.Replace(fmt.Sprintf("%v", this.Io), "IOStat", "IOStat", 1) + `,`,
- `Hugetlb:` + strings.Replace(fmt.Sprintf("%v", this.Hugetlb), "HugeTlbStat", "HugeTlbStat", 1) + `,`,
- `MemoryEvents:` + strings.Replace(fmt.Sprintf("%v", this.MemoryEvents), "MemoryEvents", "MemoryEvents", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *PidsStat) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&PidsStat{`,
- `Current:` + fmt.Sprintf("%v", this.Current) + `,`,
- `Limit:` + fmt.Sprintf("%v", this.Limit) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *CPUStat) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&CPUStat{`,
- `UsageUsec:` + fmt.Sprintf("%v", this.UsageUsec) + `,`,
- `UserUsec:` + fmt.Sprintf("%v", this.UserUsec) + `,`,
- `SystemUsec:` + fmt.Sprintf("%v", this.SystemUsec) + `,`,
- `NrPeriods:` + fmt.Sprintf("%v", this.NrPeriods) + `,`,
- `NrThrottled:` + fmt.Sprintf("%v", this.NrThrottled) + `,`,
- `ThrottledUsec:` + fmt.Sprintf("%v", this.ThrottledUsec) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *MemoryStat) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&MemoryStat{`,
- `Anon:` + fmt.Sprintf("%v", this.Anon) + `,`,
- `File:` + fmt.Sprintf("%v", this.File) + `,`,
- `KernelStack:` + fmt.Sprintf("%v", this.KernelStack) + `,`,
- `Slab:` + fmt.Sprintf("%v", this.Slab) + `,`,
- `Sock:` + fmt.Sprintf("%v", this.Sock) + `,`,
- `Shmem:` + fmt.Sprintf("%v", this.Shmem) + `,`,
- `FileMapped:` + fmt.Sprintf("%v", this.FileMapped) + `,`,
- `FileDirty:` + fmt.Sprintf("%v", this.FileDirty) + `,`,
- `FileWriteback:` + fmt.Sprintf("%v", this.FileWriteback) + `,`,
- `AnonThp:` + fmt.Sprintf("%v", this.AnonThp) + `,`,
- `InactiveAnon:` + fmt.Sprintf("%v", this.InactiveAnon) + `,`,
- `ActiveAnon:` + fmt.Sprintf("%v", this.ActiveAnon) + `,`,
- `InactiveFile:` + fmt.Sprintf("%v", this.InactiveFile) + `,`,
- `ActiveFile:` + fmt.Sprintf("%v", this.ActiveFile) + `,`,
- `Unevictable:` + fmt.Sprintf("%v", this.Unevictable) + `,`,
- `SlabReclaimable:` + fmt.Sprintf("%v", this.SlabReclaimable) + `,`,
- `SlabUnreclaimable:` + fmt.Sprintf("%v", this.SlabUnreclaimable) + `,`,
- `Pgfault:` + fmt.Sprintf("%v", this.Pgfault) + `,`,
- `Pgmajfault:` + fmt.Sprintf("%v", this.Pgmajfault) + `,`,
- `WorkingsetRefault:` + fmt.Sprintf("%v", this.WorkingsetRefault) + `,`,
- `WorkingsetActivate:` + fmt.Sprintf("%v", this.WorkingsetActivate) + `,`,
- `WorkingsetNodereclaim:` + fmt.Sprintf("%v", this.WorkingsetNodereclaim) + `,`,
- `Pgrefill:` + fmt.Sprintf("%v", this.Pgrefill) + `,`,
- `Pgscan:` + fmt.Sprintf("%v", this.Pgscan) + `,`,
- `Pgsteal:` + fmt.Sprintf("%v", this.Pgsteal) + `,`,
- `Pgactivate:` + fmt.Sprintf("%v", this.Pgactivate) + `,`,
- `Pgdeactivate:` + fmt.Sprintf("%v", this.Pgdeactivate) + `,`,
- `Pglazyfree:` + fmt.Sprintf("%v", this.Pglazyfree) + `,`,
- `Pglazyfreed:` + fmt.Sprintf("%v", this.Pglazyfreed) + `,`,
- `ThpFaultAlloc:` + fmt.Sprintf("%v", this.ThpFaultAlloc) + `,`,
- `ThpCollapseAlloc:` + fmt.Sprintf("%v", this.ThpCollapseAlloc) + `,`,
- `Usage:` + fmt.Sprintf("%v", this.Usage) + `,`,
- `UsageLimit:` + fmt.Sprintf("%v", this.UsageLimit) + `,`,
- `SwapUsage:` + fmt.Sprintf("%v", this.SwapUsage) + `,`,
- `SwapLimit:` + fmt.Sprintf("%v", this.SwapLimit) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *MemoryEvents) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&MemoryEvents{`,
- `Low:` + fmt.Sprintf("%v", this.Low) + `,`,
- `High:` + fmt.Sprintf("%v", this.High) + `,`,
- `Max:` + fmt.Sprintf("%v", this.Max) + `,`,
- `Oom:` + fmt.Sprintf("%v", this.Oom) + `,`,
- `OomKill:` + fmt.Sprintf("%v", this.OomKill) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *RdmaStat) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&RdmaStat{`,
- `Current:` + strings.Replace(fmt.Sprintf("%v", this.Current), "RdmaEntry", "RdmaEntry", 1) + `,`,
- `Limit:` + strings.Replace(fmt.Sprintf("%v", this.Limit), "RdmaEntry", "RdmaEntry", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *RdmaEntry) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&RdmaEntry{`,
- `Device:` + fmt.Sprintf("%v", this.Device) + `,`,
- `HcaHandles:` + fmt.Sprintf("%v", this.HcaHandles) + `,`,
- `HcaObjects:` + fmt.Sprintf("%v", this.HcaObjects) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *IOStat) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&IOStat{`,
- `Usage:` + strings.Replace(fmt.Sprintf("%v", this.Usage), "IOEntry", "IOEntry", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *IOEntry) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&IOEntry{`,
- `Major:` + fmt.Sprintf("%v", this.Major) + `,`,
- `Minor:` + fmt.Sprintf("%v", this.Minor) + `,`,
- `Rbytes:` + fmt.Sprintf("%v", this.Rbytes) + `,`,
- `Wbytes:` + fmt.Sprintf("%v", this.Wbytes) + `,`,
- `Rios:` + fmt.Sprintf("%v", this.Rios) + `,`,
- `Wios:` + fmt.Sprintf("%v", this.Wios) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *HugeTlbStat) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&HugeTlbStat{`,
- `Current:` + fmt.Sprintf("%v", this.Current) + `,`,
- `Max:` + fmt.Sprintf("%v", this.Max) + `,`,
- `Pagesize:` + fmt.Sprintf("%v", this.Pagesize) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func valueToStringMetrics(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
-}
-func (m *Metrics) 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 ErrIntOverflowMetrics
- }
- 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: Metrics: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: Metrics: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Pids", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Pids == nil {
- m.Pids = &PidsStat{}
- }
- if err := m.Pids.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field CPU", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.CPU == nil {
- m.CPU = &CPUStat{}
- }
- if err := m.CPU.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 4:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Memory", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Memory == nil {
- m.Memory = &MemoryStat{}
- }
- if err := m.Memory.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 5:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Rdma", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Rdma == nil {
- m.Rdma = &RdmaStat{}
- }
- if err := m.Rdma.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 6:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Io", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Io == nil {
- m.Io = &IOStat{}
- }
- if err := m.Io.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 7:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Hugetlb", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Hugetlb = append(m.Hugetlb, &HugeTlbStat{})
- if err := m.Hugetlb[len(m.Hugetlb)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 8:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field MemoryEvents", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.MemoryEvents == nil {
- m.MemoryEvents = &MemoryEvents{}
- }
- if err := m.MemoryEvents.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipMetrics(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *PidsStat) 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 ErrIntOverflowMetrics
- }
- 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: PidsStat: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: PidsStat: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Current", wireType)
- }
- m.Current = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Current |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType)
- }
- m.Limit = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Limit |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipMetrics(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *CPUStat) 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 ErrIntOverflowMetrics
- }
- 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: CPUStat: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: CPUStat: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field UsageUsec", wireType)
- }
- m.UsageUsec = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.UsageUsec |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field UserUsec", wireType)
- }
- m.UserUsec = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.UserUsec |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field SystemUsec", wireType)
- }
- m.SystemUsec = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.SystemUsec |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field NrPeriods", wireType)
- }
- m.NrPeriods = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.NrPeriods |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 5:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field NrThrottled", wireType)
- }
- m.NrThrottled = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.NrThrottled |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 6:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field ThrottledUsec", wireType)
- }
- m.ThrottledUsec = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.ThrottledUsec |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipMetrics(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *MemoryStat) 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 ErrIntOverflowMetrics
- }
- 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: MemoryStat: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: MemoryStat: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Anon", wireType)
- }
- m.Anon = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Anon |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field File", wireType)
- }
- m.File = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.File |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field KernelStack", wireType)
- }
- m.KernelStack = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.KernelStack |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Slab", wireType)
- }
- m.Slab = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Slab |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 5:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Sock", wireType)
- }
- m.Sock = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Sock |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 6:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Shmem", wireType)
- }
- m.Shmem = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Shmem |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 7:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field FileMapped", wireType)
- }
- m.FileMapped = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.FileMapped |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 8:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field FileDirty", wireType)
- }
- m.FileDirty = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.FileDirty |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 9:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field FileWriteback", wireType)
- }
- m.FileWriteback = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.FileWriteback |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 10:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field AnonThp", wireType)
- }
- m.AnonThp = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.AnonThp |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 11:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field InactiveAnon", wireType)
- }
- m.InactiveAnon = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.InactiveAnon |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 12:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field ActiveAnon", wireType)
- }
- m.ActiveAnon = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.ActiveAnon |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 13:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field InactiveFile", wireType)
- }
- m.InactiveFile = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.InactiveFile |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 14:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field ActiveFile", wireType)
- }
- m.ActiveFile = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.ActiveFile |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 15:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Unevictable", wireType)
- }
- m.Unevictable = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Unevictable |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 16:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field SlabReclaimable", wireType)
- }
- m.SlabReclaimable = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.SlabReclaimable |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 17:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field SlabUnreclaimable", wireType)
- }
- m.SlabUnreclaimable = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.SlabUnreclaimable |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 18:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Pgfault", wireType)
- }
- m.Pgfault = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Pgfault |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 19:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Pgmajfault", wireType)
- }
- m.Pgmajfault = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Pgmajfault |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 20:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field WorkingsetRefault", wireType)
- }
- m.WorkingsetRefault = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.WorkingsetRefault |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 21:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field WorkingsetActivate", wireType)
- }
- m.WorkingsetActivate = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.WorkingsetActivate |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 22:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field WorkingsetNodereclaim", wireType)
- }
- m.WorkingsetNodereclaim = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.WorkingsetNodereclaim |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 23:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Pgrefill", wireType)
- }
- m.Pgrefill = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Pgrefill |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 24:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Pgscan", wireType)
- }
- m.Pgscan = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Pgscan |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 25:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Pgsteal", wireType)
- }
- m.Pgsteal = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Pgsteal |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 26:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Pgactivate", wireType)
- }
- m.Pgactivate = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Pgactivate |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 27:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Pgdeactivate", wireType)
- }
- m.Pgdeactivate = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Pgdeactivate |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 28:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Pglazyfree", wireType)
- }
- m.Pglazyfree = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Pglazyfree |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 29:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Pglazyfreed", wireType)
- }
- m.Pglazyfreed = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Pglazyfreed |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 30:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field ThpFaultAlloc", wireType)
- }
- m.ThpFaultAlloc = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.ThpFaultAlloc |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 31:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field ThpCollapseAlloc", wireType)
- }
- m.ThpCollapseAlloc = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.ThpCollapseAlloc |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 32:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Usage", wireType)
- }
- m.Usage = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Usage |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 33:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field UsageLimit", wireType)
- }
- m.UsageLimit = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.UsageLimit |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 34:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field SwapUsage", wireType)
- }
- m.SwapUsage = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.SwapUsage |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 35:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field SwapLimit", wireType)
- }
- m.SwapLimit = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.SwapLimit |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipMetrics(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *MemoryEvents) 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 ErrIntOverflowMetrics
- }
- 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: MemoryEvents: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: MemoryEvents: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Low", wireType)
- }
- m.Low = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Low |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field High", wireType)
- }
- m.High = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.High |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Max", wireType)
- }
- m.Max = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Max |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Oom", wireType)
- }
- m.Oom = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Oom |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 5:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field OomKill", wireType)
- }
- m.OomKill = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.OomKill |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipMetrics(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *RdmaStat) 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 ErrIntOverflowMetrics
- }
- 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: RdmaStat: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: RdmaStat: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Current", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Current = append(m.Current, &RdmaEntry{})
- if err := m.Current[len(m.Current)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Limit = append(m.Limit, &RdmaEntry{})
- if err := m.Limit[len(m.Limit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipMetrics(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *RdmaEntry) 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 ErrIntOverflowMetrics
- }
- 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: RdmaEntry: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: RdmaEntry: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Device", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- 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 ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Device = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field HcaHandles", wireType)
- }
- m.HcaHandles = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.HcaHandles |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field HcaObjects", wireType)
- }
- m.HcaObjects = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.HcaObjects |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipMetrics(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *IOStat) 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 ErrIntOverflowMetrics
- }
- 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: IOStat: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: IOStat: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Usage", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Usage = append(m.Usage, &IOEntry{})
- if err := m.Usage[len(m.Usage)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipMetrics(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *IOEntry) 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 ErrIntOverflowMetrics
- }
- 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: IOEntry: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: IOEntry: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Major", wireType)
- }
- m.Major = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Major |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Minor", wireType)
- }
- m.Minor = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Minor |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Rbytes", wireType)
- }
- m.Rbytes = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Rbytes |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Wbytes", wireType)
- }
- m.Wbytes = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Wbytes |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 5:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Rios", wireType)
- }
- m.Rios = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Rios |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 6:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Wios", wireType)
- }
- m.Wios = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Wios |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipMetrics(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *HugeTlbStat) 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 ErrIntOverflowMetrics
- }
- 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: HugeTlbStat: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: HugeTlbStat: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Current", wireType)
- }
- m.Current = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Current |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Max", wireType)
- }
- m.Max = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Max |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Pagesize", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- 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 ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Pagesize = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipMetrics(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func skipMetrics(dAtA []byte) (n int, err error) {
- l := len(dAtA)
- iNdEx := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if dAtA[iNdEx-1] < 0x80 {
- break
- }
- }
- return iNdEx, nil
- case 1:
- iNdEx += 8
- return iNdEx, nil
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if length < 0 {
- return 0, ErrInvalidLengthMetrics
- }
- iNdEx += length
- if iNdEx < 0 {
- return 0, ErrInvalidLengthMetrics
- }
- return iNdEx, nil
- case 3:
- for {
- var innerWire uint64
- var start int = iNdEx
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- innerWire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- innerWireType := int(innerWire & 0x7)
- if innerWireType == 4 {
- break
- }
- next, err := skipMetrics(dAtA[start:])
- if err != nil {
- return 0, err
- }
- iNdEx = start + next
- if iNdEx < 0 {
- return 0, ErrInvalidLengthMetrics
- }
- }
- return iNdEx, nil
- case 4:
- return iNdEx, nil
- case 5:
- iNdEx += 4
- return iNdEx, nil
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- }
- panic("unreachable")
-}
-
-var (
- ErrInvalidLengthMetrics = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowMetrics = fmt.Errorf("proto: integer overflow")
-)
diff --git a/vendor/github.com/containerd/cgroups/v2/stats/metrics.proto b/vendor/github.com/containerd/cgroups/v2/stats/metrics.proto
deleted file mode 100644
index 8ac472e46..000000000
--- a/vendor/github.com/containerd/cgroups/v2/stats/metrics.proto
+++ /dev/null
@@ -1,105 +0,0 @@
-syntax = "proto3";
-
-package io.containerd.cgroups.v2;
-
- import "gogoproto/gogo.proto";
-
-message Metrics {
- PidsStat pids = 1;
- CPUStat cpu = 2 [(gogoproto.customname) = "CPU"];
- MemoryStat memory = 4;
- RdmaStat rdma = 5;
- IOStat io = 6;
- repeated HugeTlbStat hugetlb = 7;
- MemoryEvents memory_events = 8;
-}
-
-message PidsStat {
- uint64 current = 1;
- uint64 limit = 2;
-}
-
-message CPUStat {
- uint64 usage_usec = 1;
- uint64 user_usec = 2;
- uint64 system_usec = 3;
- uint64 nr_periods = 4;
- uint64 nr_throttled = 5;
- uint64 throttled_usec = 6;
-}
-
-message MemoryStat {
- uint64 anon = 1;
- uint64 file = 2;
- uint64 kernel_stack = 3;
- uint64 slab = 4;
- uint64 sock = 5;
- uint64 shmem = 6;
- uint64 file_mapped = 7;
- uint64 file_dirty = 8;
- uint64 file_writeback = 9;
- uint64 anon_thp = 10;
- uint64 inactive_anon = 11;
- uint64 active_anon = 12;
- uint64 inactive_file = 13;
- uint64 active_file = 14;
- uint64 unevictable = 15;
- uint64 slab_reclaimable = 16;
- uint64 slab_unreclaimable = 17;
- uint64 pgfault = 18;
- uint64 pgmajfault = 19;
- uint64 workingset_refault = 20;
- uint64 workingset_activate = 21;
- uint64 workingset_nodereclaim = 22;
- uint64 pgrefill = 23;
- uint64 pgscan = 24;
- uint64 pgsteal = 25;
- uint64 pgactivate = 26;
- uint64 pgdeactivate = 27;
- uint64 pglazyfree = 28;
- uint64 pglazyfreed = 29;
- uint64 thp_fault_alloc = 30;
- uint64 thp_collapse_alloc = 31;
- uint64 usage = 32;
- uint64 usage_limit = 33;
- uint64 swap_usage = 34;
- uint64 swap_limit = 35;
-}
-
-message MemoryEvents {
- uint64 low = 1;
- uint64 high = 2;
- uint64 max = 3;
- uint64 oom = 4;
- uint64 oom_kill = 5;
-}
-
-message RdmaStat {
- repeated RdmaEntry current = 1;
- repeated RdmaEntry limit = 2;
-}
-
-message RdmaEntry {
- string device = 1;
- uint32 hca_handles = 2;
- uint32 hca_objects = 3;
-}
-
-message IOStat {
- repeated IOEntry usage = 1;
-}
-
-message IOEntry {
- uint64 major = 1;
- uint64 minor = 2;
- uint64 rbytes = 3;
- uint64 wbytes = 4;
- uint64 rios = 5;
- uint64 wios = 6;
-}
-
-message HugeTlbStat {
- uint64 current = 1;
- uint64 max = 2;
- string pagesize = 3;
-}
diff --git a/vendor/github.com/containerd/cgroups/v2/utils.go b/vendor/github.com/containerd/cgroups/v2/utils.go
deleted file mode 100644
index 8b8d654d6..000000000
--- a/vendor/github.com/containerd/cgroups/v2/utils.go
+++ /dev/null
@@ -1,436 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package v2
-
-import (
- "bufio"
- "fmt"
- "io"
- "io/ioutil"
- "math"
- "os"
- "path/filepath"
- "strconv"
- "strings"
- "time"
-
- "github.com/containerd/cgroups/v2/stats"
- "github.com/godbus/dbus/v5"
- "github.com/opencontainers/runtime-spec/specs-go"
- "github.com/pkg/errors"
- "github.com/sirupsen/logrus"
-)
-
-const (
- cgroupProcs = "cgroup.procs"
- defaultDirPerm = 0755
-)
-
-// defaultFilePerm is a var so that the test framework can change the filemode
-// of all files created when the tests are running. The difference between the
-// tests and real world use is that files like "cgroup.procs" will exist when writing
-// to a read cgroup filesystem and do not exist prior when running in the tests.
-// this is set to a non 0 value in the test code
-var defaultFilePerm = os.FileMode(0)
-
-// remove will remove a cgroup path handling EAGAIN and EBUSY errors and
-// retrying the remove after a exp timeout
-func remove(path string) error {
- var err error
- delay := 10 * time.Millisecond
- for i := 0; i < 5; i++ {
- if i != 0 {
- time.Sleep(delay)
- delay *= 2
- }
- if err = os.RemoveAll(path); err == nil {
- return nil
- }
- }
- return errors.Wrapf(err, "cgroups: unable to remove path %q", path)
-}
-
-// parseCgroupProcsFile parses /sys/fs/cgroup/$GROUPPATH/cgroup.procs
-func parseCgroupProcsFile(path string) ([]uint64, error) {
- f, err := os.Open(path)
- if err != nil {
- return nil, err
- }
- defer f.Close()
- var (
- out []uint64
- s = bufio.NewScanner(f)
- )
- for s.Scan() {
- if t := s.Text(); t != "" {
- pid, err := strconv.ParseUint(t, 10, 0)
- if err != nil {
- return nil, err
- }
- out = append(out, pid)
- }
- }
- if err := s.Err(); err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func parseKV(raw string) (string, interface{}, error) {
- parts := strings.Fields(raw)
- switch len(parts) {
- case 2:
- v, err := parseUint(parts[1], 10, 64)
- if err != nil {
- // if we cannot parse as a uint, parse as a string
- return parts[0], parts[1], nil
- }
- return parts[0], v, nil
- default:
- return "", 0, ErrInvalidFormat
- }
-}
-
-func parseUint(s string, base, bitSize int) (uint64, error) {
- v, err := strconv.ParseUint(s, base, bitSize)
- if err != nil {
- intValue, intErr := strconv.ParseInt(s, base, bitSize)
- // 1. Handle negative values greater than MinInt64 (and)
- // 2. Handle negative values lesser than MinInt64
- if intErr == nil && intValue < 0 {
- return 0, nil
- } else if intErr != nil &&
- intErr.(*strconv.NumError).Err == strconv.ErrRange &&
- intValue < 0 {
- return 0, nil
- }
- return 0, err
- }
- return v, nil
-}
-
-// parseCgroupFile parses /proc/PID/cgroup file and return string
-func parseCgroupFile(path string) (string, error) {
- f, err := os.Open(path)
- if err != nil {
- return "", err
- }
- defer f.Close()
- return parseCgroupFromReader(f)
-}
-
-func parseCgroupFromReader(r io.Reader) (string, error) {
- var (
- s = bufio.NewScanner(r)
- )
- for s.Scan() {
- var (
- text = s.Text()
- parts = strings.SplitN(text, ":", 3)
- )
- if len(parts) < 3 {
- return "", fmt.Errorf("invalid cgroup entry: %q", text)
- }
- // text is like "0::/user.slice/user-1001.slice/session-1.scope"
- if parts[0] == "0" && parts[1] == "" {
- return parts[2], nil
- }
- }
- if err := s.Err(); err != nil {
- return "", err
- }
- return "", fmt.Errorf("cgroup path not found")
-}
-
-// ToResources converts the oci LinuxResources struct into a
-// v2 Resources type for use with this package.
-//
-// converting cgroups configuration from v1 to v2
-// ref: https://github.com/containers/crun/blob/master/crun.1.md#cgroup-v2
-func ToResources(spec *specs.LinuxResources) *Resources {
- var resources Resources
- if cpu := spec.CPU; cpu != nil {
- resources.CPU = &CPU{
- Cpus: cpu.Cpus,
- Mems: cpu.Mems,
- }
- if shares := cpu.Shares; shares != nil {
- convertedWeight := 1 + ((*shares-2)*9999)/262142
- resources.CPU.Weight = &convertedWeight
- }
- if period := cpu.Period; period != nil {
- resources.CPU.Max = NewCPUMax(cpu.Quota, period)
- }
- }
- if mem := spec.Memory; mem != nil {
- resources.Memory = &Memory{}
- if swap := mem.Swap; swap != nil {
- resources.Memory.Swap = swap
- }
- if l := mem.Limit; l != nil {
- resources.Memory.Max = l
- }
- if l := mem.Reservation; l != nil {
- resources.Memory.Low = l
- }
- }
- if hugetlbs := spec.HugepageLimits; hugetlbs != nil {
- hugeTlbUsage := HugeTlb{}
- for _, hugetlb := range hugetlbs {
- hugeTlbUsage = append(hugeTlbUsage, HugeTlbEntry{
- HugePageSize: hugetlb.Pagesize,
- Limit: hugetlb.Limit,
- })
- }
- resources.HugeTlb = &hugeTlbUsage
- }
- if pids := spec.Pids; pids != nil {
- resources.Pids = &Pids{
- Max: pids.Limit,
- }
- }
- if i := spec.BlockIO; i != nil {
- resources.IO = &IO{}
- if i.Weight != nil {
- resources.IO.BFQ.Weight = 1 + (*i.Weight-10)*9999/990
- }
- for t, devices := range map[IOType][]specs.LinuxThrottleDevice{
- ReadBPS: i.ThrottleReadBpsDevice,
- WriteBPS: i.ThrottleWriteBpsDevice,
- ReadIOPS: i.ThrottleReadIOPSDevice,
- WriteIOPS: i.ThrottleWriteIOPSDevice,
- } {
- for _, d := range devices {
- resources.IO.Max = append(resources.IO.Max, Entry{
- Type: t,
- Major: d.Major,
- Minor: d.Minor,
- Rate: d.Rate,
- })
- }
- }
- }
- if i := spec.Rdma; i != nil {
- resources.RDMA = &RDMA{}
- for device, value := range spec.Rdma {
- if device != "" && (value.HcaHandles != nil || value.HcaObjects != nil) {
- resources.RDMA.Limit = append(resources.RDMA.Limit, RDMAEntry{
- Device: device,
- HcaHandles: *value.HcaHandles,
- HcaObjects: *value.HcaObjects,
- })
- }
- }
- }
-
- return &resources
-}
-
-// Gets uint64 parsed content of single value cgroup stat file
-func getStatFileContentUint64(filePath string) uint64 {
- contents, err := ioutil.ReadFile(filePath)
- if err != nil {
- return 0
- }
- trimmed := strings.TrimSpace(string(contents))
- if trimmed == "max" {
- return math.MaxUint64
- }
-
- res, err := parseUint(trimmed, 10, 64)
- if err != nil {
- logrus.Errorf("unable to parse %q as a uint from Cgroup file %q", string(contents), filePath)
- return res
- }
-
- return res
-}
-
-func readIoStats(path string) []*stats.IOEntry {
- // more details on the io.stat file format: https://www.kernel.org/doc/Documentation/cgroup-v2.txt
- var usage []*stats.IOEntry
- fpath := filepath.Join(path, "io.stat")
- currentData, err := ioutil.ReadFile(fpath)
- if err != nil {
- return usage
- }
- entries := strings.Split(string(currentData), "\n")
-
- for _, entry := range entries {
- parts := strings.Split(entry, " ")
- if len(parts) < 2 {
- continue
- }
- majmin := strings.Split(parts[0], ":")
- if len(majmin) != 2 {
- continue
- }
- major, err := strconv.ParseUint(majmin[0], 10, 0)
- if err != nil {
- return usage
- }
- minor, err := strconv.ParseUint(majmin[1], 10, 0)
- if err != nil {
- return usage
- }
- parts = parts[1:]
- ioEntry := stats.IOEntry{
- Major: major,
- Minor: minor,
- }
- for _, s := range parts {
- keyPairValue := strings.Split(s, "=")
- if len(keyPairValue) != 2 {
- continue
- }
- v, err := strconv.ParseUint(keyPairValue[1], 10, 0)
- if err != nil {
- continue
- }
- switch keyPairValue[0] {
- case "rbytes":
- ioEntry.Rbytes = v
- case "wbytes":
- ioEntry.Wbytes = v
- case "rios":
- ioEntry.Rios = v
- case "wios":
- ioEntry.Wios = v
- }
- }
- usage = append(usage, &ioEntry)
- }
- return usage
-}
-
-func rdmaStats(filepath string) []*stats.RdmaEntry {
- currentData, err := ioutil.ReadFile(filepath)
- if err != nil {
- return []*stats.RdmaEntry{}
- }
- return toRdmaEntry(strings.Split(string(currentData), "\n"))
-}
-
-func parseRdmaKV(raw string, entry *stats.RdmaEntry) {
- var value uint64
- var err error
-
- parts := strings.Split(raw, "=")
- switch len(parts) {
- case 2:
- if parts[1] == "max" {
- value = math.MaxUint32
- } else {
- value, err = parseUint(parts[1], 10, 32)
- if err != nil {
- return
- }
- }
- if parts[0] == "hca_handle" {
- entry.HcaHandles = uint32(value)
- } else if parts[0] == "hca_object" {
- entry.HcaObjects = uint32(value)
- }
- }
-}
-
-func toRdmaEntry(strEntries []string) []*stats.RdmaEntry {
- var rdmaEntries []*stats.RdmaEntry
- for i := range strEntries {
- parts := strings.Fields(strEntries[i])
- switch len(parts) {
- case 3:
- entry := new(stats.RdmaEntry)
- entry.Device = parts[0]
- parseRdmaKV(parts[1], entry)
- parseRdmaKV(parts[2], entry)
-
- rdmaEntries = append(rdmaEntries, entry)
- default:
- continue
- }
- }
- return rdmaEntries
-}
-
-// isUnitExists returns true if the error is that a systemd unit already exists.
-func isUnitExists(err error) bool {
- if err != nil {
- if dbusError, ok := err.(dbus.Error); ok {
- return strings.Contains(dbusError.Name, "org.freedesktop.systemd1.UnitExists")
- }
- }
- return false
-}
-
-func systemdUnitFromPath(path string) string {
- _, unit := filepath.Split(path)
- return unit
-}
-
-func readHugeTlbStats(path string) []*stats.HugeTlbStat {
- var usage = []*stats.HugeTlbStat{}
- var keyUsage = make(map[string]*stats.HugeTlbStat)
- f, err := os.Open(path)
- if err != nil {
- return usage
- }
- files, err := f.Readdir(-1)
- f.Close()
- if err != nil {
- return usage
- }
-
- for _, file := range files {
- if strings.Contains(file.Name(), "hugetlb") &&
- (strings.HasSuffix(file.Name(), "max") || strings.HasSuffix(file.Name(), "current")) {
- var hugeTlb *stats.HugeTlbStat
- var ok bool
- fileName := strings.Split(file.Name(), ".")
- pageSize := fileName[1]
- if hugeTlb, ok = keyUsage[pageSize]; !ok {
- hugeTlb = &stats.HugeTlbStat{}
- }
- hugeTlb.Pagesize = pageSize
- out, err := ioutil.ReadFile(filepath.Join(path, file.Name()))
- if err != nil {
- continue
- }
- var value uint64
- stringVal := strings.TrimSpace(string(out))
- if stringVal == "max" {
- value = math.MaxUint64
- } else {
- value, err = strconv.ParseUint(stringVal, 10, 64)
- }
- if err != nil {
- continue
- }
- switch fileName[2] {
- case "max":
- hugeTlb.Max = value
- case "current":
- hugeTlb.Current = value
- }
- keyUsage[pageSize] = hugeTlb
- }
- }
- for _, entry := range keyUsage {
- usage = append(usage, entry)
- }
- return usage
-}
diff --git a/vendor/github.com/containerd/console/LICENSE b/vendor/github.com/containerd/console/LICENSE
deleted file mode 100644
index 584149b6e..000000000
--- a/vendor/github.com/containerd/console/LICENSE
+++ /dev/null
@@ -1,191 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- https://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- 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
-
- https://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/vendor/github.com/containerd/console/README.md b/vendor/github.com/containerd/console/README.md
deleted file mode 100644
index 5392fdaf1..000000000
--- a/vendor/github.com/containerd/console/README.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# console
-
-[](https://travis-ci.org/containerd/console)
-
-Golang package for dealing with consoles. Light on deps and a simple API.
-
-## Modifying the current process
-
-```go
-current := console.Current()
-defer current.Reset()
-
-if err := current.SetRaw(); err != nil {
-}
-ws, err := current.Size()
-current.Resize(ws)
-```
-
-## Project details
-
-console is a containerd sub-project, licensed under the [Apache 2.0 license](./LICENSE).
-As a containerd sub-project, you will find the:
- * [Project governance](https://github.com/containerd/project/blob/master/GOVERNANCE.md),
- * [Maintainers](https://github.com/containerd/project/blob/master/MAINTAINERS),
- * and [Contributing guidelines](https://github.com/containerd/project/blob/master/CONTRIBUTING.md)
-
-information in our [`containerd/project`](https://github.com/containerd/project) repository.
diff --git a/vendor/github.com/containerd/console/console.go b/vendor/github.com/containerd/console/console.go
deleted file mode 100644
index 6a36d1477..000000000
--- a/vendor/github.com/containerd/console/console.go
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package console
-
-import (
- "errors"
- "io"
- "os"
-)
-
-var ErrNotAConsole = errors.New("provided file is not a console")
-
-type File interface {
- io.ReadWriteCloser
-
- // Fd returns its file descriptor
- Fd() uintptr
- // Name returns its file name
- Name() string
-}
-
-type Console interface {
- File
-
- // Resize resizes the console to the provided window size
- Resize(WinSize) error
- // ResizeFrom resizes the calling console to the size of the
- // provided console
- ResizeFrom(Console) error
- // SetRaw sets the console in raw mode
- SetRaw() error
- // DisableEcho disables echo on the console
- DisableEcho() error
- // Reset restores the console to its orignal state
- Reset() error
- // Size returns the window size of the console
- Size() (WinSize, error)
-}
-
-// WinSize specifies the window size of the console
-type WinSize struct {
- // Height of the console
- Height uint16
- // Width of the console
- Width uint16
- x uint16
- y uint16
-}
-
-// Current returns the current processes console
-func Current() Console {
- c, err := ConsoleFromFile(os.Stdin)
- if err != nil {
- // stdin should always be a console for the design
- // of this function
- panic(err)
- }
- return c
-}
-
-// ConsoleFromFile returns a console using the provided file
-func ConsoleFromFile(f File) (Console, error) {
- if err := checkConsole(f); err != nil {
- return nil, err
- }
- return newMaster(f)
-}
diff --git a/vendor/github.com/containerd/console/console_linux.go b/vendor/github.com/containerd/console/console_linux.go
deleted file mode 100644
index c1c839ee3..000000000
--- a/vendor/github.com/containerd/console/console_linux.go
+++ /dev/null
@@ -1,280 +0,0 @@
-// +build linux
-
-/*
- 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 console
-
-import (
- "io"
- "os"
- "sync"
-
- "golang.org/x/sys/unix"
-)
-
-const (
- maxEvents = 128
-)
-
-// Epoller manages multiple epoll consoles using edge-triggered epoll api so we
-// dont have to deal with repeated wake-up of EPOLLER or EPOLLHUP.
-// For more details, see:
-// - https://github.com/systemd/systemd/pull/4262
-// - https://github.com/moby/moby/issues/27202
-//
-// Example usage of Epoller and EpollConsole can be as follow:
-//
-// epoller, _ := NewEpoller()
-// epollConsole, _ := epoller.Add(console)
-// go epoller.Wait()
-// var (
-// b bytes.Buffer
-// wg sync.WaitGroup
-// )
-// wg.Add(1)
-// go func() {
-// io.Copy(&b, epollConsole)
-// wg.Done()
-// }()
-// // perform I/O on the console
-// epollConsole.Shutdown(epoller.CloseConsole)
-// wg.Wait()
-// epollConsole.Close()
-type Epoller struct {
- efd int
- mu sync.Mutex
- fdMapping map[int]*EpollConsole
- closeOnce sync.Once
-}
-
-// NewEpoller returns an instance of epoller with a valid epoll fd.
-func NewEpoller() (*Epoller, error) {
- efd, err := unix.EpollCreate1(unix.EPOLL_CLOEXEC)
- if err != nil {
- return nil, err
- }
- return &Epoller{
- efd: efd,
- fdMapping: make(map[int]*EpollConsole),
- }, nil
-}
-
-// Add creates an epoll console based on the provided console. The console will
-// be registered with EPOLLET (i.e. using edge-triggered notification) and its
-// file descriptor will be set to non-blocking mode. After this, user should use
-// the return console to perform I/O.
-func (e *Epoller) Add(console Console) (*EpollConsole, error) {
- sysfd := int(console.Fd())
- // Set sysfd to non-blocking mode
- if err := unix.SetNonblock(sysfd, true); err != nil {
- return nil, err
- }
-
- ev := unix.EpollEvent{
- Events: unix.EPOLLIN | unix.EPOLLOUT | unix.EPOLLRDHUP | unix.EPOLLET,
- Fd: int32(sysfd),
- }
- if err := unix.EpollCtl(e.efd, unix.EPOLL_CTL_ADD, sysfd, &ev); err != nil {
- return nil, err
- }
- ef := &EpollConsole{
- Console: console,
- sysfd: sysfd,
- readc: sync.NewCond(&sync.Mutex{}),
- writec: sync.NewCond(&sync.Mutex{}),
- }
- e.mu.Lock()
- e.fdMapping[sysfd] = ef
- e.mu.Unlock()
- return ef, nil
-}
-
-// Wait starts the loop to wait for its consoles' notifications and signal
-// appropriate console that it can perform I/O.
-func (e *Epoller) Wait() error {
- events := make([]unix.EpollEvent, maxEvents)
- for {
- n, err := unix.EpollWait(e.efd, events, -1)
- if err != nil {
- // EINTR: The call was interrupted by a signal handler before either
- // any of the requested events occurred or the timeout expired
- if err == unix.EINTR {
- continue
- }
- return err
- }
- for i := 0; i < n; i++ {
- ev := &events[i]
- // the console is ready to be read from
- if ev.Events&(unix.EPOLLIN|unix.EPOLLHUP|unix.EPOLLERR) != 0 {
- if epfile := e.getConsole(int(ev.Fd)); epfile != nil {
- epfile.signalRead()
- }
- }
- // the console is ready to be written to
- if ev.Events&(unix.EPOLLOUT|unix.EPOLLHUP|unix.EPOLLERR) != 0 {
- if epfile := e.getConsole(int(ev.Fd)); epfile != nil {
- epfile.signalWrite()
- }
- }
- }
- }
-}
-
-// CloseConsole unregisters the console's file descriptor from epoll interface
-func (e *Epoller) CloseConsole(fd int) error {
- e.mu.Lock()
- defer e.mu.Unlock()
- delete(e.fdMapping, fd)
- return unix.EpollCtl(e.efd, unix.EPOLL_CTL_DEL, fd, &unix.EpollEvent{})
-}
-
-func (e *Epoller) getConsole(sysfd int) *EpollConsole {
- e.mu.Lock()
- f := e.fdMapping[sysfd]
- e.mu.Unlock()
- return f
-}
-
-// Close closes the epoll fd
-func (e *Epoller) Close() error {
- closeErr := os.ErrClosed // default to "file already closed"
- e.closeOnce.Do(func() {
- closeErr = unix.Close(e.efd)
- })
- return closeErr
-}
-
-// EpollConsole acts like a console but registers its file descriptor with an
-// epoll fd and uses epoll API to perform I/O.
-type EpollConsole struct {
- Console
- readc *sync.Cond
- writec *sync.Cond
- sysfd int
- closed bool
-}
-
-// Read reads up to len(p) bytes into p. It returns the number of bytes read
-// (0 <= n <= len(p)) and any error encountered.
-//
-// If the console's read returns EAGAIN or EIO, we assume that it's a
-// temporary error because the other side went away and wait for the signal
-// generated by epoll event to continue.
-func (ec *EpollConsole) Read(p []byte) (n int, err error) {
- var read int
- ec.readc.L.Lock()
- defer ec.readc.L.Unlock()
- for {
- read, err = ec.Console.Read(p[n:])
- n += read
- if err != nil {
- var hangup bool
- if perr, ok := err.(*os.PathError); ok {
- hangup = (perr.Err == unix.EAGAIN || perr.Err == unix.EIO)
- } else {
- hangup = (err == unix.EAGAIN || err == unix.EIO)
- }
- // if the other end disappear, assume this is temporary and wait for the
- // signal to continue again. Unless we didnt read anything and the
- // console is already marked as closed then we should exit
- if hangup && !(n == 0 && len(p) > 0 && ec.closed) {
- ec.readc.Wait()
- continue
- }
- }
- break
- }
- // if we didnt read anything then return io.EOF to end gracefully
- if n == 0 && len(p) > 0 && err == nil {
- err = io.EOF
- }
- // signal for others that we finished the read
- ec.readc.Signal()
- return n, err
-}
-
-// Writes len(p) bytes from p to the console. It returns the number of bytes
-// written from p (0 <= n <= len(p)) and any error encountered that caused
-// the write to stop early.
-//
-// If writes to the console returns EAGAIN or EIO, we assume that it's a
-// temporary error because the other side went away and wait for the signal
-// generated by epoll event to continue.
-func (ec *EpollConsole) Write(p []byte) (n int, err error) {
- var written int
- ec.writec.L.Lock()
- defer ec.writec.L.Unlock()
- for {
- written, err = ec.Console.Write(p[n:])
- n += written
- if err != nil {
- var hangup bool
- if perr, ok := err.(*os.PathError); ok {
- hangup = (perr.Err == unix.EAGAIN || perr.Err == unix.EIO)
- } else {
- hangup = (err == unix.EAGAIN || err == unix.EIO)
- }
- // if the other end disappears, assume this is temporary and wait for the
- // signal to continue again.
- if hangup {
- ec.writec.Wait()
- continue
- }
- }
- // unrecoverable error, break the loop and return the error
- break
- }
- if n < len(p) && err == nil {
- err = io.ErrShortWrite
- }
- // signal for others that we finished the write
- ec.writec.Signal()
- return n, err
-}
-
-// Shutdown closes the file descriptor and signals call waiters for this fd.
-// It accepts a callback which will be called with the console's fd. The
-// callback typically will be used to do further cleanup such as unregister the
-// console's fd from the epoll interface.
-// User should call Shutdown and wait for all I/O operation to be finished
-// before closing the console.
-func (ec *EpollConsole) Shutdown(close func(int) error) error {
- ec.readc.L.Lock()
- defer ec.readc.L.Unlock()
- ec.writec.L.Lock()
- defer ec.writec.L.Unlock()
-
- ec.readc.Broadcast()
- ec.writec.Broadcast()
- ec.closed = true
- return close(ec.sysfd)
-}
-
-// signalRead signals that the console is readable.
-func (ec *EpollConsole) signalRead() {
- ec.readc.L.Lock()
- ec.readc.Signal()
- ec.readc.L.Unlock()
-}
-
-// signalWrite signals that the console is writable.
-func (ec *EpollConsole) signalWrite() {
- ec.writec.L.Lock()
- ec.writec.Signal()
- ec.writec.L.Unlock()
-}
diff --git a/vendor/github.com/containerd/console/console_unix.go b/vendor/github.com/containerd/console/console_unix.go
deleted file mode 100644
index 315f1d0c9..000000000
--- a/vendor/github.com/containerd/console/console_unix.go
+++ /dev/null
@@ -1,158 +0,0 @@
-// +build darwin freebsd linux openbsd solaris
-
-/*
- 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 console
-
-import (
- "os"
-
- "golang.org/x/sys/unix"
-)
-
-// NewPty creates a new pty pair
-// The master is returned as the first console and a string
-// with the path to the pty slave is returned as the second
-func NewPty() (Console, string, error) {
- f, err := os.OpenFile("/dev/ptmx", unix.O_RDWR|unix.O_NOCTTY|unix.O_CLOEXEC, 0)
- if err != nil {
- return nil, "", err
- }
- slave, err := ptsname(f)
- if err != nil {
- return nil, "", err
- }
- if err := unlockpt(f); err != nil {
- return nil, "", err
- }
- m, err := newMaster(f)
- if err != nil {
- return nil, "", err
- }
- return m, slave, nil
-}
-
-type master struct {
- f File
- original *unix.Termios
-}
-
-func (m *master) Read(b []byte) (int, error) {
- return m.f.Read(b)
-}
-
-func (m *master) Write(b []byte) (int, error) {
- return m.f.Write(b)
-}
-
-func (m *master) Close() error {
- return m.f.Close()
-}
-
-func (m *master) Resize(ws WinSize) error {
- return tcswinsz(m.f.Fd(), ws)
-}
-
-func (m *master) ResizeFrom(c Console) error {
- ws, err := c.Size()
- if err != nil {
- return err
- }
- return m.Resize(ws)
-}
-
-func (m *master) Reset() error {
- if m.original == nil {
- return nil
- }
- return tcset(m.f.Fd(), m.original)
-}
-
-func (m *master) getCurrent() (unix.Termios, error) {
- var termios unix.Termios
- if err := tcget(m.f.Fd(), &termios); err != nil {
- return unix.Termios{}, err
- }
- return termios, nil
-}
-
-func (m *master) SetRaw() error {
- rawState, err := m.getCurrent()
- if err != nil {
- return err
- }
- rawState = cfmakeraw(rawState)
- rawState.Oflag = rawState.Oflag | unix.OPOST
- return tcset(m.f.Fd(), &rawState)
-}
-
-func (m *master) DisableEcho() error {
- rawState, err := m.getCurrent()
- if err != nil {
- return err
- }
- rawState.Lflag = rawState.Lflag &^ unix.ECHO
- return tcset(m.f.Fd(), &rawState)
-}
-
-func (m *master) Size() (WinSize, error) {
- return tcgwinsz(m.f.Fd())
-}
-
-func (m *master) Fd() uintptr {
- return m.f.Fd()
-}
-
-func (m *master) Name() string {
- return m.f.Name()
-}
-
-// checkConsole checks if the provided file is a console
-func checkConsole(f File) error {
- var termios unix.Termios
- if tcget(f.Fd(), &termios) != nil {
- return ErrNotAConsole
- }
- return nil
-}
-
-func newMaster(f File) (Console, error) {
- m := &master{
- f: f,
- }
- t, err := m.getCurrent()
- if err != nil {
- return nil, err
- }
- m.original = &t
- return m, nil
-}
-
-// ClearONLCR sets the necessary tty_ioctl(4)s to ensure that a pty pair
-// created by us acts normally. In particular, a not-very-well-known default of
-// Linux unix98 ptys is that they have +onlcr by default. While this isn't a
-// problem for terminal emulators, because we relay data from the terminal we
-// also relay that funky line discipline.
-func ClearONLCR(fd uintptr) error {
- return setONLCR(fd, false)
-}
-
-// SetONLCR sets the necessary tty_ioctl(4)s to ensure that a pty pair
-// created by us acts as intended for a terminal emulator.
-func SetONLCR(fd uintptr) error {
- return setONLCR(fd, true)
-}
diff --git a/vendor/github.com/containerd/console/console_windows.go b/vendor/github.com/containerd/console/console_windows.go
deleted file mode 100644
index 129a92883..000000000
--- a/vendor/github.com/containerd/console/console_windows.go
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package console
-
-import (
- "fmt"
- "os"
-
- "github.com/pkg/errors"
- "golang.org/x/sys/windows"
-)
-
-var (
- vtInputSupported bool
- ErrNotImplemented = errors.New("not implemented")
-)
-
-func (m *master) initStdios() {
- m.in = windows.Handle(os.Stdin.Fd())
- if err := windows.GetConsoleMode(m.in, &m.inMode); err == nil {
- // Validate that windows.ENABLE_VIRTUAL_TERMINAL_INPUT is supported, but do not set it.
- if err = windows.SetConsoleMode(m.in, m.inMode|windows.ENABLE_VIRTUAL_TERMINAL_INPUT); err == nil {
- vtInputSupported = true
- }
- // Unconditionally set the console mode back even on failure because SetConsoleMode
- // remembers invalid bits on input handles.
- windows.SetConsoleMode(m.in, m.inMode)
- } else {
- fmt.Printf("failed to get console mode for stdin: %v\n", err)
- }
-
- m.out = windows.Handle(os.Stdout.Fd())
- if err := windows.GetConsoleMode(m.out, &m.outMode); err == nil {
- if err := windows.SetConsoleMode(m.out, m.outMode|windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING); err == nil {
- m.outMode |= windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING
- } else {
- windows.SetConsoleMode(m.out, m.outMode)
- }
- } else {
- fmt.Printf("failed to get console mode for stdout: %v\n", err)
- }
-
- m.err = windows.Handle(os.Stderr.Fd())
- if err := windows.GetConsoleMode(m.err, &m.errMode); err == nil {
- if err := windows.SetConsoleMode(m.err, m.errMode|windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING); err == nil {
- m.errMode |= windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING
- } else {
- windows.SetConsoleMode(m.err, m.errMode)
- }
- } else {
- fmt.Printf("failed to get console mode for stderr: %v\n", err)
- }
-}
-
-type master struct {
- in windows.Handle
- inMode uint32
-
- out windows.Handle
- outMode uint32
-
- err windows.Handle
- errMode uint32
-}
-
-func (m *master) SetRaw() error {
- if err := makeInputRaw(m.in, m.inMode); err != nil {
- return err
- }
-
- // Set StdOut and StdErr to raw mode, we ignore failures since
- // windows.DISABLE_NEWLINE_AUTO_RETURN might not be supported on this version of
- // Windows.
-
- windows.SetConsoleMode(m.out, m.outMode|windows.DISABLE_NEWLINE_AUTO_RETURN)
-
- windows.SetConsoleMode(m.err, m.errMode|windows.DISABLE_NEWLINE_AUTO_RETURN)
-
- return nil
-}
-
-func (m *master) Reset() error {
- for _, s := range []struct {
- fd windows.Handle
- mode uint32
- }{
- {m.in, m.inMode},
- {m.out, m.outMode},
- {m.err, m.errMode},
- } {
- if err := windows.SetConsoleMode(s.fd, s.mode); err != nil {
- return errors.Wrap(err, "unable to restore console mode")
- }
- }
-
- return nil
-}
-
-func (m *master) Size() (WinSize, error) {
- var info windows.ConsoleScreenBufferInfo
- err := windows.GetConsoleScreenBufferInfo(m.out, &info)
- if err != nil {
- return WinSize{}, errors.Wrap(err, "unable to get console info")
- }
-
- winsize := WinSize{
- Width: uint16(info.Window.Right - info.Window.Left + 1),
- Height: uint16(info.Window.Bottom - info.Window.Top + 1),
- }
-
- return winsize, nil
-}
-
-func (m *master) Resize(ws WinSize) error {
- return ErrNotImplemented
-}
-
-func (m *master) ResizeFrom(c Console) error {
- return ErrNotImplemented
-}
-
-func (m *master) DisableEcho() error {
- mode := m.inMode &^ windows.ENABLE_ECHO_INPUT
- mode |= windows.ENABLE_PROCESSED_INPUT
- mode |= windows.ENABLE_LINE_INPUT
-
- if err := windows.SetConsoleMode(m.in, mode); err != nil {
- return errors.Wrap(err, "unable to set console to disable echo")
- }
-
- return nil
-}
-
-func (m *master) Close() error {
- return nil
-}
-
-func (m *master) Read(b []byte) (int, error) {
- return os.Stdin.Read(b)
-}
-
-func (m *master) Write(b []byte) (int, error) {
- return os.Stdout.Write(b)
-}
-
-func (m *master) Fd() uintptr {
- return uintptr(m.in)
-}
-
-// on windows, console can only be made from os.Std{in,out,err}, hence there
-// isnt a single name here we can use. Return a dummy "console" value in this
-// case should be sufficient.
-func (m *master) Name() string {
- return "console"
-}
-
-// makeInputRaw puts the terminal (Windows Console) connected to the given
-// file descriptor into raw mode
-func makeInputRaw(fd windows.Handle, mode uint32) error {
- // See
- // -- https://msdn.microsoft.com/en-us/library/windows/desktop/ms686033(v=vs.85).aspx
- // -- https://msdn.microsoft.com/en-us/library/windows/desktop/ms683462(v=vs.85).aspx
-
- // Disable these modes
- mode &^= windows.ENABLE_ECHO_INPUT
- mode &^= windows.ENABLE_LINE_INPUT
- mode &^= windows.ENABLE_MOUSE_INPUT
- mode &^= windows.ENABLE_WINDOW_INPUT
- mode &^= windows.ENABLE_PROCESSED_INPUT
-
- // Enable these modes
- mode |= windows.ENABLE_EXTENDED_FLAGS
- mode |= windows.ENABLE_INSERT_MODE
- mode |= windows.ENABLE_QUICK_EDIT_MODE
-
- if vtInputSupported {
- mode |= windows.ENABLE_VIRTUAL_TERMINAL_INPUT
- }
-
- if err := windows.SetConsoleMode(fd, mode); err != nil {
- return errors.Wrap(err, "unable to set console to raw mode")
- }
-
- return nil
-}
-
-func checkConsole(f File) error {
- var mode uint32
- if err := windows.GetConsoleMode(windows.Handle(f.Fd()), &mode); err != nil {
- return err
- }
- return nil
-}
-
-func newMaster(f File) (Console, error) {
- if f != os.Stdin && f != os.Stdout && f != os.Stderr {
- return nil, errors.New("creating a console from a file is not supported on windows")
- }
- m := &master{}
- m.initStdios()
- return m, nil
-}
diff --git a/vendor/github.com/containerd/console/go.mod b/vendor/github.com/containerd/console/go.mod
deleted file mode 100644
index 97b587d62..000000000
--- a/vendor/github.com/containerd/console/go.mod
+++ /dev/null
@@ -1,8 +0,0 @@
-module github.com/containerd/console
-
-go 1.13
-
-require (
- github.com/pkg/errors v0.8.1
- golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e
-)
diff --git a/vendor/github.com/containerd/console/tc_darwin.go b/vendor/github.com/containerd/console/tc_darwin.go
deleted file mode 100644
index b0128abb0..000000000
--- a/vendor/github.com/containerd/console/tc_darwin.go
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package console
-
-import (
- "fmt"
- "os"
- "unsafe"
-
- "golang.org/x/sys/unix"
-)
-
-const (
- cmdTcGet = unix.TIOCGETA
- cmdTcSet = unix.TIOCSETA
-)
-
-func ioctl(fd, flag, data uintptr) error {
- if _, _, err := unix.Syscall(unix.SYS_IOCTL, fd, flag, data); err != 0 {
- return err
- }
- return nil
-}
-
-// unlockpt unlocks the slave pseudoterminal device corresponding to the master pseudoterminal referred to by f.
-// unlockpt should be called before opening the slave side of a pty.
-func unlockpt(f *os.File) error {
- var u int32
- return ioctl(f.Fd(), unix.TIOCPTYUNLK, uintptr(unsafe.Pointer(&u)))
-}
-
-// ptsname retrieves the name of the first available pts for the given master.
-func ptsname(f *os.File) (string, error) {
- n, err := unix.IoctlGetInt(int(f.Fd()), unix.TIOCPTYGNAME)
- if err != nil {
- return "", err
- }
- return fmt.Sprintf("/dev/pts/%d", n), nil
-}
diff --git a/vendor/github.com/containerd/console/tc_freebsd.go b/vendor/github.com/containerd/console/tc_freebsd.go
deleted file mode 100644
index 04583a615..000000000
--- a/vendor/github.com/containerd/console/tc_freebsd.go
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package console
-
-import (
- "fmt"
- "os"
-
- "golang.org/x/sys/unix"
-)
-
-const (
- cmdTcGet = unix.TIOCGETA
- cmdTcSet = unix.TIOCSETA
-)
-
-// unlockpt unlocks the slave pseudoterminal device corresponding to the master pseudoterminal referred to by f.
-// unlockpt should be called before opening the slave side of a pty.
-// This does not exist on FreeBSD, it does not allocate controlling terminals on open
-func unlockpt(f *os.File) error {
- return nil
-}
-
-// ptsname retrieves the name of the first available pts for the given master.
-func ptsname(f *os.File) (string, error) {
- n, err := unix.IoctlGetInt(int(f.Fd()), unix.TIOCGPTN)
- if err != nil {
- return "", err
- }
- return fmt.Sprintf("/dev/pts/%d", n), nil
-}
diff --git a/vendor/github.com/containerd/console/tc_linux.go b/vendor/github.com/containerd/console/tc_linux.go
deleted file mode 100644
index 1bdd68e6d..000000000
--- a/vendor/github.com/containerd/console/tc_linux.go
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package console
-
-import (
- "fmt"
- "os"
- "unsafe"
-
- "golang.org/x/sys/unix"
-)
-
-const (
- cmdTcGet = unix.TCGETS
- cmdTcSet = unix.TCSETS
-)
-
-// unlockpt unlocks the slave pseudoterminal device corresponding to the master pseudoterminal referred to by f.
-// unlockpt should be called before opening the slave side of a pty.
-func unlockpt(f *os.File) error {
- var u int32
- if _, _, err := unix.Syscall(unix.SYS_IOCTL, f.Fd(), unix.TIOCSPTLCK, uintptr(unsafe.Pointer(&u))); err != 0 {
- return err
- }
- return nil
-}
-
-// ptsname retrieves the name of the first available pts for the given master.
-func ptsname(f *os.File) (string, error) {
- var u uint32
- if _, _, err := unix.Syscall(unix.SYS_IOCTL, f.Fd(), unix.TIOCGPTN, uintptr(unsafe.Pointer(&u))); err != 0 {
- return "", err
- }
- return fmt.Sprintf("/dev/pts/%d", u), nil
-}
diff --git a/vendor/github.com/containerd/console/tc_openbsd_cgo.go b/vendor/github.com/containerd/console/tc_openbsd_cgo.go
deleted file mode 100644
index f0cec06a7..000000000
--- a/vendor/github.com/containerd/console/tc_openbsd_cgo.go
+++ /dev/null
@@ -1,51 +0,0 @@
-// +build openbsd,cgo
-
-/*
- 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 console
-
-import (
- "os"
-
- "golang.org/x/sys/unix"
-)
-
-//#include
-import "C"
-
-const (
- cmdTcGet = unix.TIOCGETA
- cmdTcSet = unix.TIOCSETA
-)
-
-// ptsname retrieves the name of the first available pts for the given master.
-func ptsname(f *os.File) (string, error) {
- ptspath, err := C.ptsname(C.int(f.Fd()))
- if err != nil {
- return "", err
- }
- return C.GoString(ptspath), nil
-}
-
-// unlockpt unlocks the slave pseudoterminal device corresponding to the master pseudoterminal referred to by f.
-// unlockpt should be called before opening the slave side of a pty.
-func unlockpt(f *os.File) error {
- if _, err := C.grantpt(C.int(f.Fd())); err != nil {
- return err
- }
- return nil
-}
diff --git a/vendor/github.com/containerd/console/tc_openbsd_nocgo.go b/vendor/github.com/containerd/console/tc_openbsd_nocgo.go
deleted file mode 100644
index daccce205..000000000
--- a/vendor/github.com/containerd/console/tc_openbsd_nocgo.go
+++ /dev/null
@@ -1,47 +0,0 @@
-// +build openbsd,!cgo
-
-/*
- 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.
-*/
-
-//
-// Implementing the functions below requires cgo support. Non-cgo stubs
-// versions are defined below to enable cross-compilation of source code
-// that depends on these functions, but the resultant cross-compiled
-// binaries cannot actually be used. If the stub function(s) below are
-// actually invoked they will display an error message and cause the
-// calling process to exit.
-//
-
-package console
-
-import (
- "os"
-
- "golang.org/x/sys/unix"
-)
-
-const (
- cmdTcGet = unix.TIOCGETA
- cmdTcSet = unix.TIOCSETA
-)
-
-func ptsname(f *os.File) (string, error) {
- panic("ptsname() support requires cgo.")
-}
-
-func unlockpt(f *os.File) error {
- panic("unlockpt() support requires cgo.")
-}
diff --git a/vendor/github.com/containerd/console/tc_solaris_cgo.go b/vendor/github.com/containerd/console/tc_solaris_cgo.go
deleted file mode 100644
index e36a68edd..000000000
--- a/vendor/github.com/containerd/console/tc_solaris_cgo.go
+++ /dev/null
@@ -1,51 +0,0 @@
-// +build solaris,cgo
-
-/*
- 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 console
-
-import (
- "os"
-
- "golang.org/x/sys/unix"
-)
-
-//#include
-import "C"
-
-const (
- cmdTcGet = unix.TCGETS
- cmdTcSet = unix.TCSETS
-)
-
-// ptsname retrieves the name of the first available pts for the given master.
-func ptsname(f *os.File) (string, error) {
- ptspath, err := C.ptsname(C.int(f.Fd()))
- if err != nil {
- return "", err
- }
- return C.GoString(ptspath), nil
-}
-
-// unlockpt unlocks the slave pseudoterminal device corresponding to the master pseudoterminal referred to by f.
-// unlockpt should be called before opening the slave side of a pty.
-func unlockpt(f *os.File) error {
- if _, err := C.grantpt(C.int(f.Fd())); err != nil {
- return err
- }
- return nil
-}
diff --git a/vendor/github.com/containerd/console/tc_solaris_nocgo.go b/vendor/github.com/containerd/console/tc_solaris_nocgo.go
deleted file mode 100644
index eb0bd2c36..000000000
--- a/vendor/github.com/containerd/console/tc_solaris_nocgo.go
+++ /dev/null
@@ -1,47 +0,0 @@
-// +build solaris,!cgo
-
-/*
- 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.
-*/
-
-//
-// Implementing the functions below requires cgo support. Non-cgo stubs
-// versions are defined below to enable cross-compilation of source code
-// that depends on these functions, but the resultant cross-compiled
-// binaries cannot actually be used. If the stub function(s) below are
-// actually invoked they will display an error message and cause the
-// calling process to exit.
-//
-
-package console
-
-import (
- "os"
-
- "golang.org/x/sys/unix"
-)
-
-const (
- cmdTcGet = unix.TCGETS
- cmdTcSet = unix.TCSETS
-)
-
-func ptsname(f *os.File) (string, error) {
- panic("ptsname() support requires cgo.")
-}
-
-func unlockpt(f *os.File) error {
- panic("unlockpt() support requires cgo.")
-}
diff --git a/vendor/github.com/containerd/console/tc_unix.go b/vendor/github.com/containerd/console/tc_unix.go
deleted file mode 100644
index 7ae773c53..000000000
--- a/vendor/github.com/containerd/console/tc_unix.go
+++ /dev/null
@@ -1,91 +0,0 @@
-// +build darwin freebsd linux openbsd solaris
-
-/*
- 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 console
-
-import (
- "golang.org/x/sys/unix"
-)
-
-func tcget(fd uintptr, p *unix.Termios) error {
- termios, err := unix.IoctlGetTermios(int(fd), cmdTcGet)
- if err != nil {
- return err
- }
- *p = *termios
- return nil
-}
-
-func tcset(fd uintptr, p *unix.Termios) error {
- return unix.IoctlSetTermios(int(fd), cmdTcSet, p)
-}
-
-func tcgwinsz(fd uintptr) (WinSize, error) {
- var ws WinSize
-
- uws, err := unix.IoctlGetWinsize(int(fd), unix.TIOCGWINSZ)
- if err != nil {
- return ws, err
- }
-
- // Translate from unix.Winsize to console.WinSize
- ws.Height = uws.Row
- ws.Width = uws.Col
- ws.x = uws.Xpixel
- ws.y = uws.Ypixel
- return ws, nil
-}
-
-func tcswinsz(fd uintptr, ws WinSize) error {
- // Translate from console.WinSize to unix.Winsize
-
- var uws unix.Winsize
- uws.Row = ws.Height
- uws.Col = ws.Width
- uws.Xpixel = ws.x
- uws.Ypixel = ws.y
-
- return unix.IoctlSetWinsize(int(fd), unix.TIOCSWINSZ, &uws)
-}
-
-func setONLCR(fd uintptr, enable bool) error {
- var termios unix.Termios
- if err := tcget(fd, &termios); err != nil {
- return err
- }
- if enable {
- // Set +onlcr so we can act like a real terminal
- termios.Oflag |= unix.ONLCR
- } else {
- // Set -onlcr so we don't have to deal with \r.
- termios.Oflag &^= unix.ONLCR
- }
- return tcset(fd, &termios)
-}
-
-func cfmakeraw(t unix.Termios) unix.Termios {
- t.Iflag &^= (unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | unix.INLCR | unix.IGNCR | unix.ICRNL | unix.IXON)
- t.Oflag &^= unix.OPOST
- t.Lflag &^= (unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | unix.IEXTEN)
- t.Cflag &^= (unix.CSIZE | unix.PARENB)
- t.Cflag &^= unix.CS8
- t.Cc[unix.VMIN] = 1
- t.Cc[unix.VTIME] = 0
-
- return t
-}
diff --git a/vendor/github.com/containerd/containerd/LICENSE b/vendor/github.com/containerd/containerd/LICENSE
deleted file mode 100644
index 584149b6e..000000000
--- a/vendor/github.com/containerd/containerd/LICENSE
+++ /dev/null
@@ -1,191 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- https://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- 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
-
- https://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/vendor/github.com/containerd/containerd/NOTICE b/vendor/github.com/containerd/containerd/NOTICE
deleted file mode 100644
index 8915f0277..000000000
--- a/vendor/github.com/containerd/containerd/NOTICE
+++ /dev/null
@@ -1,16 +0,0 @@
-Docker
-Copyright 2012-2015 Docker, Inc.
-
-This product includes software developed at Docker, Inc. (https://www.docker.com).
-
-The following is courtesy of our legal counsel:
-
-
-Use and transfer of Docker may be subject to certain restrictions by the
-United States and other governments.
-It is your responsibility to ensure that your use and/or transfer does not
-violate applicable laws.
-
-For more information, please see https://www.bis.doc.gov
-
-See also https://www.apache.org/dev/crypto.html and/or seek legal counsel.
diff --git a/vendor/github.com/containerd/containerd/README.md b/vendor/github.com/containerd/containerd/README.md
deleted file mode 100644
index a973d5156..000000000
--- a/vendor/github.com/containerd/containerd/README.md
+++ /dev/null
@@ -1,289 +0,0 @@
-
-
-[](https://godoc.org/github.com/containerd/containerd)
-[](https://github.com/containerd/containerd/actions?query=workflow%3ACI)
-[](https://ci.appveyor.com/project/mlaventure/containerd-3g73f?branch=master)
-[](https://github.com/containerd/containerd/actions?query=workflow%3ANightly)
-[](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fcontainerd%2Fcontainerd?ref=badge_shield)
-[](https://goreportcard.com/report/github.com/containerd/containerd)
-[](https://bestpractices.coreinfrastructure.org/projects/1271)
-
-containerd is an industry-standard container runtime with an emphasis on simplicity, robustness and portability. It is available as a daemon for Linux and Windows, which can manage the complete container lifecycle of its host system: image transfer and storage, container execution and supervision, low-level storage and network attachments, etc.
-
-containerd is designed to be embedded into a larger system, rather than being used directly by developers or end-users.
-
-
-
-## Getting Started
-
-See our documentation on [containerd.io](https://containerd.io):
-* [for ops and admins](docs/ops.md)
-* [namespaces](docs/namespaces.md)
-* [client options](docs/client-opts.md)
-
-See how to build containerd from source at [BUILDING](BUILDING.md).
-
-If you are interested in trying out containerd see our example at [Getting Started](docs/getting-started.md).
-
-## Nightly builds
-
-There are nightly builds available for download [here](https://github.com/containerd/containerd/actions?query=workflow%3ANightly).
-Binaries are generated from `master` branch every night for `Linux` and `Windows`.
-
-Please be aware: nightly builds might have critical bugs, it's not recommended for use in prodution and no support provided.
-
-## Runtime Requirements
-
-Runtime requirements for containerd are very minimal. Most interactions with
-the Linux and Windows container feature sets are handled via [runc](https://github.com/opencontainers/runc) and/or
-OS-specific libraries (e.g. [hcsshim](https://github.com/Microsoft/hcsshim) for Microsoft). The current required version of `runc` is always listed in [RUNC.md](/RUNC.md).
-
-There are specific features
-used by containerd core code and snapshotters that will require a minimum kernel
-version on Linux. With the understood caveat of distro kernel versioning, a
-reasonable starting point for Linux is a minimum 4.x kernel version.
-
-The overlay filesystem snapshotter, used by default, uses features that were
-finalized in the 4.x kernel series. If you choose to use btrfs, there may
-be more flexibility in kernel version (minimum recommended is 3.18), but will
-require the btrfs kernel module and btrfs tools to be installed on your Linux
-distribution.
-
-To use Linux checkpoint and restore features, you will need `criu` installed on
-your system. See more details in [Checkpoint and Restore](#checkpoint-and-restore).
-
-Build requirements for developers are listed in [BUILDING](BUILDING.md).
-
-## Features
-
-### Client
-
-containerd offers a full client package to help you integrate containerd into your platform.
-
-```go
-
-import (
- "github.com/containerd/containerd"
- "github.com/containerd/containerd/cio"
-)
-
-
-func main() {
- client, err := containerd.New("/run/containerd/containerd.sock")
- defer client.Close()
-}
-
-```
-
-### Namespaces
-
-Namespaces allow multiple consumers to use the same containerd without conflicting with each other. It has the benefit of sharing content but still having separation with containers and images.
-
-To set a namespace for requests to the API:
-
-```go
-context = context.Background()
-// create a context for docker
-docker = namespaces.WithNamespace(context, "docker")
-
-containerd, err := client.NewContainer(docker, "id")
-```
-
-To set a default namespace on the client:
-
-```go
-client, err := containerd.New(address, containerd.WithDefaultNamespace("docker"))
-```
-
-### Distribution
-
-```go
-// pull an image
-image, err := client.Pull(context, "docker.io/library/redis:latest")
-
-// push an image
-err := client.Push(context, "docker.io/library/redis:latest", image.Target())
-```
-
-### Containers
-
-In containerd, a container is a metadata object. Resources such as an OCI runtime specification, image, root filesystem, and other metadata can be attached to a container.
-
-```go
-redis, err := client.NewContainer(context, "redis-master")
-defer redis.Delete(context)
-```
-
-### OCI Runtime Specification
-
-containerd fully supports the OCI runtime specification for running containers. We have built in functions to help you generate runtime specifications based on images as well as custom parameters.
-
-You can specify options when creating a container about how to modify the specification.
-
-```go
-redis, err := client.NewContainer(context, "redis-master", containerd.WithNewSpec(oci.WithImageConfig(image)))
-```
-
-### Root Filesystems
-
-containerd allows you to use overlay or snapshot filesystems with your containers. It comes with builtin support for overlayfs and btrfs.
-
-```go
-// pull an image and unpack it into the configured snapshotter
-image, err := client.Pull(context, "docker.io/library/redis:latest", containerd.WithPullUnpack)
-
-// allocate a new RW root filesystem for a container based on the image
-redis, err := client.NewContainer(context, "redis-master",
- containerd.WithNewSnapshot("redis-rootfs", image),
- containerd.WithNewSpec(oci.WithImageConfig(image)),
-)
-
-// use a readonly filesystem with multiple containers
-for i := 0; i < 10; i++ {
- id := fmt.Sprintf("id-%s", i)
- container, err := client.NewContainer(ctx, id,
- containerd.WithNewSnapshotView(id, image),
- containerd.WithNewSpec(oci.WithImageConfig(image)),
- )
-}
-```
-
-### Tasks
-
-Taking a container object and turning it into a runnable process on a system is done by creating a new `Task` from the container. A task represents the runnable object within containerd.
-
-```go
-// create a new task
-task, err := redis.NewTask(context, cio.NewCreator(cio.WithStdio))
-defer task.Delete(context)
-
-// the task is now running and has a pid that can be use to setup networking
-// or other runtime settings outside of containerd
-pid := task.Pid()
-
-// start the redis-server process inside the container
-err := task.Start(context)
-
-// wait for the task to exit and get the exit status
-status, err := task.Wait(context)
-```
-
-### Checkpoint and Restore
-
-If you have [criu](https://criu.org/Main_Page) installed on your machine you can checkpoint and restore containers and their tasks. This allow you to clone and/or live migrate containers to other machines.
-
-```go
-// checkpoint the task then push it to a registry
-checkpoint, err := task.Checkpoint(context)
-
-err := client.Push(context, "myregistry/checkpoints/redis:master", checkpoint)
-
-// on a new machine pull the checkpoint and restore the redis container
-checkpoint, err := client.Pull(context, "myregistry/checkpoints/redis:master")
-
-redis, err = client.NewContainer(context, "redis-master", containerd.WithNewSnapshot("redis-rootfs", checkpoint))
-defer container.Delete(context)
-
-task, err = redis.NewTask(context, cio.NewCreator(cio.WithStdio), containerd.WithTaskCheckpoint(checkpoint))
-defer task.Delete(context)
-
-err := task.Start(context)
-```
-
-### Snapshot Plugins
-
-In addition to the built-in Snapshot plugins in containerd, additional external
-plugins can be configured using GRPC. An external plugin is made available using
-the configured name and appears as a plugin alongside the built-in ones.
-
-To add an external snapshot plugin, add the plugin to containerd's config file
-(by default at `/etc/containerd/config.toml`). The string following
-`proxy_plugin.` will be used as the name of the snapshotter and the address
-should refer to a socket with a GRPC listener serving containerd's Snapshot
-GRPC API. Remember to restart containerd for any configuration changes to take
-effect.
-
-```
-[proxy_plugins]
- [proxy_plugins.customsnapshot]
- type = "snapshot"
- address = "/var/run/mysnapshotter.sock"
-```
-
-See [PLUGINS.md](PLUGINS.md) for how to create plugins
-
-### Releases and API Stability
-
-Please see [RELEASES.md](RELEASES.md) for details on versioning and stability
-of containerd components.
-
-Downloadable 64-bit Intel/AMD binaries of all official releases are available on
-our [releases page](https://github.com/containerd/containerd/releases), as well as
-auto-published to the [cri-containerd-release storage bucket](https://console.cloud.google.com/storage/browser/cri-containerd-release?pli=1).
-
-For other architectures and distribution support, you will find that many
-Linux distributions package their own containerd and provide it across several
-architectures, such as [Canonical's Ubuntu packaging](https://launchpad.net/ubuntu/bionic/+package/containerd).
-
-#### Enabling command auto-completion
-
-Starting with containerd 1.4, the urfave client feature for auto-creation of bash and zsh
-autocompletion data is enabled. To use the autocomplete feature in a bash shell for example, source
-the autocomplete/ctr file in your `.bashrc`, or manually like:
-
-```
-$ source ./contrib/autocomplete/ctr
-```
-
-#### Distribution of `ctr` autocomplete for bash and zsh
-
-For bash, copy the `contrib/autocomplete/ctr` script into
-`/etc/bash_completion.d/` and rename it to `ctr`. The `zsh_autocomplete`
-file is also available and can be used similarly for zsh users.
-
-Provide documentation to users to `source` this file into their shell if
-you don't place the autocomplete file in a location where it is automatically
-loaded for the user's shell environment.
-
-### Communication
-
-For async communication and long running discussions please use issues and pull requests on the github repo.
-This will be the best place to discuss design and implementation.
-
-For sync communication we have a community slack with a #containerd channel that everyone is welcome to join and chat about development.
-
-**Slack:** Catch us in the #containerd and #containerd-dev channels on dockercommunity.slack.com.
-[Click here for an invite to docker community slack.](https://dockr.ly/slack)
-
-### Security audit
-
-A third party security audit was performed by Cure53 in 4Q2018; the [full report](docs/SECURITY_AUDIT.pdf) is available in our docs/ directory.
-
-### Reporting security issues
-
-__If you are reporting a security issue, please reach out discreetly at security@containerd.io__.
-
-## Licenses
-
-The containerd codebase is released under the [Apache 2.0 license](LICENSE).
-The README.md file, and files in the "docs" folder are licensed under the
-Creative Commons Attribution 4.0 International License. You may obtain a
-copy of the license, titled CC-BY-4.0, at http://creativecommons.org/licenses/by/4.0/.
-
-## Project details
-
-**containerd** is the primary open source project within the broader containerd GitHub repository.
-However, all projects within the repo have common maintainership, governance, and contributing
-guidelines which are stored in a `project` repository commonly for all containerd projects.
-
-Please find all these core project documents, including the:
- * [Project governance](https://github.com/containerd/project/blob/master/GOVERNANCE.md),
- * [Maintainers](https://github.com/containerd/project/blob/master/MAINTAINERS),
- * and [Contributing guidelines](https://github.com/containerd/project/blob/master/CONTRIBUTING.md)
-
-information in our [`containerd/project`](https://github.com/containerd/project) repository.
-
-## Adoption
-
-Interested to see who is using containerd? Are you using containerd in a project?
-Please add yourself via pull request to our [ADOPTERS.md](./ADOPTERS.md) file.
diff --git a/vendor/github.com/containerd/containerd/api/README.md b/vendor/github.com/containerd/containerd/api/README.md
deleted file mode 100644
index f6eb28c6a..000000000
--- a/vendor/github.com/containerd/containerd/api/README.md
+++ /dev/null
@@ -1,18 +0,0 @@
-This directory contains the GRPC API definitions for containerd.
-
-All defined services and messages have been aggregated into `*.pb.txt`
-descriptors files in this directory. Definitions present here are considered
-frozen after the release.
-
-At release time, the current `next.pb.txt` file will be moved into place to
-freeze the API changes for the minor version. For example, when 1.0.0 is
-released, `next.pb.txt` should be moved to `1.0.txt`. Notice that we leave off
-the patch number, since the API will be completely locked down for a given
-patch series.
-
-We may find that by default, protobuf descriptors are too noisy to lock down
-API changes. In that case, we may filter out certain fields in the descriptors,
-possibly regenerating for old versions.
-
-This process is similar to the [process used to ensure backwards compatibility
-in Go](https://github.com/golang/go/tree/master/api).
diff --git a/vendor/github.com/containerd/containerd/api/events/container.pb.go b/vendor/github.com/containerd/containerd/api/events/container.pb.go
deleted file mode 100644
index 0c1e0a939..000000000
--- a/vendor/github.com/containerd/containerd/api/events/container.pb.go
+++ /dev/null
@@ -1,1425 +0,0 @@
-// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: github.com/containerd/containerd/api/events/container.proto
-
-package events
-
-import (
- fmt "fmt"
- github_com_containerd_typeurl "github.com/containerd/typeurl"
- proto "github.com/gogo/protobuf/proto"
- github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
- types "github.com/gogo/protobuf/types"
- io "io"
- math "math"
- math_bits "math/bits"
- reflect "reflect"
- strings "strings"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
-
-type ContainerCreate struct {
- ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
- Image string `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"`
- Runtime *ContainerCreate_Runtime `protobuf:"bytes,3,opt,name=runtime,proto3" json:"runtime,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ContainerCreate) Reset() { *m = ContainerCreate{} }
-func (*ContainerCreate) ProtoMessage() {}
-func (*ContainerCreate) Descriptor() ([]byte, []int) {
- return fileDescriptor_0d1f05b8626f83ea, []int{0}
-}
-func (m *ContainerCreate) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ContainerCreate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ContainerCreate.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 *ContainerCreate) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ContainerCreate.Merge(m, src)
-}
-func (m *ContainerCreate) XXX_Size() int {
- return m.Size()
-}
-func (m *ContainerCreate) XXX_DiscardUnknown() {
- xxx_messageInfo_ContainerCreate.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ContainerCreate proto.InternalMessageInfo
-
-type ContainerCreate_Runtime struct {
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- Options *types.Any `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ContainerCreate_Runtime) Reset() { *m = ContainerCreate_Runtime{} }
-func (*ContainerCreate_Runtime) ProtoMessage() {}
-func (*ContainerCreate_Runtime) Descriptor() ([]byte, []int) {
- return fileDescriptor_0d1f05b8626f83ea, []int{0, 0}
-}
-func (m *ContainerCreate_Runtime) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ContainerCreate_Runtime) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ContainerCreate_Runtime.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 *ContainerCreate_Runtime) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ContainerCreate_Runtime.Merge(m, src)
-}
-func (m *ContainerCreate_Runtime) XXX_Size() int {
- return m.Size()
-}
-func (m *ContainerCreate_Runtime) XXX_DiscardUnknown() {
- xxx_messageInfo_ContainerCreate_Runtime.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ContainerCreate_Runtime proto.InternalMessageInfo
-
-type ContainerUpdate struct {
- ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
- Image string `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"`
- 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"`
- SnapshotKey string `protobuf:"bytes,4,opt,name=snapshot_key,json=snapshotKey,proto3" json:"snapshot_key,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ContainerUpdate) Reset() { *m = ContainerUpdate{} }
-func (*ContainerUpdate) ProtoMessage() {}
-func (*ContainerUpdate) Descriptor() ([]byte, []int) {
- return fileDescriptor_0d1f05b8626f83ea, []int{1}
-}
-func (m *ContainerUpdate) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ContainerUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ContainerUpdate.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 *ContainerUpdate) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ContainerUpdate.Merge(m, src)
-}
-func (m *ContainerUpdate) XXX_Size() int {
- return m.Size()
-}
-func (m *ContainerUpdate) XXX_DiscardUnknown() {
- xxx_messageInfo_ContainerUpdate.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ContainerUpdate proto.InternalMessageInfo
-
-type ContainerDelete struct {
- ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ContainerDelete) Reset() { *m = ContainerDelete{} }
-func (*ContainerDelete) ProtoMessage() {}
-func (*ContainerDelete) Descriptor() ([]byte, []int) {
- return fileDescriptor_0d1f05b8626f83ea, []int{2}
-}
-func (m *ContainerDelete) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ContainerDelete) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ContainerDelete.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 *ContainerDelete) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ContainerDelete.Merge(m, src)
-}
-func (m *ContainerDelete) XXX_Size() int {
- return m.Size()
-}
-func (m *ContainerDelete) XXX_DiscardUnknown() {
- xxx_messageInfo_ContainerDelete.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ContainerDelete proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*ContainerCreate)(nil), "containerd.events.ContainerCreate")
- proto.RegisterType((*ContainerCreate_Runtime)(nil), "containerd.events.ContainerCreate.Runtime")
- proto.RegisterType((*ContainerUpdate)(nil), "containerd.events.ContainerUpdate")
- proto.RegisterMapType((map[string]string)(nil), "containerd.events.ContainerUpdate.LabelsEntry")
- proto.RegisterType((*ContainerDelete)(nil), "containerd.events.ContainerDelete")
-}
-
-func init() {
- proto.RegisterFile("github.com/containerd/containerd/api/events/container.proto", fileDescriptor_0d1f05b8626f83ea)
-}
-
-var fileDescriptor_0d1f05b8626f83ea = []byte{
- // 413 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xc1, 0x0a, 0xd3, 0x30,
- 0x18, 0xc7, 0x97, 0x76, 0x6e, 0x98, 0x0a, 0x6a, 0x18, 0x52, 0x7b, 0xa8, 0x73, 0xa7, 0xe9, 0x21,
- 0x85, 0x7a, 0x51, 0x77, 0xd1, 0x6d, 0x0a, 0xa2, 0x82, 0x14, 0x84, 0xe1, 0x45, 0xd2, 0x35, 0xeb,
- 0x82, 0x6d, 0x52, 0xda, 0x74, 0xd0, 0x9b, 0x8f, 0xe2, 0xe3, 0xec, 0xe8, 0xc1, 0x83, 0x27, 0x71,
- 0x05, 0xdf, 0xc0, 0x07, 0x90, 0x26, 0xeb, 0x56, 0x14, 0x95, 0x9d, 0xfa, 0xcf, 0xd7, 0xff, 0x3f,
- 0xdf, 0xf7, 0xfb, 0x08, 0x9c, 0xc5, 0x4c, 0x6e, 0xcb, 0x10, 0xaf, 0x45, 0xea, 0xad, 0x05, 0x97,
- 0x84, 0x71, 0x9a, 0x47, 0x5d, 0x49, 0x32, 0xe6, 0xd1, 0x1d, 0xe5, 0xb2, 0x38, 0x57, 0x71, 0x96,
- 0x0b, 0x29, 0xd0, 0xcd, 0xb3, 0x0d, 0x6b, 0x8b, 0x73, 0x3b, 0x16, 0x22, 0x4e, 0xa8, 0xa7, 0x0c,
- 0x61, 0xb9, 0xf1, 0x08, 0xaf, 0xb4, 0xdb, 0x19, 0xc5, 0x22, 0x16, 0x4a, 0x7a, 0x8d, 0x3a, 0x56,
- 0x9f, 0xfc, 0x77, 0x80, 0xd3, 0x55, 0x59, 0x52, 0xc6, 0x8c, 0x7b, 0x1b, 0x46, 0x93, 0x28, 0x23,
- 0x72, 0xab, 0x6f, 0x98, 0x7c, 0x01, 0xf0, 0xfa, 0xa2, 0xb5, 0x2f, 0x72, 0x4a, 0x24, 0x45, 0xb7,
- 0xa0, 0xc1, 0x22, 0x1b, 0x8c, 0xc1, 0xf4, 0xea, 0x7c, 0x50, 0x7f, 0xbb, 0x63, 0xbc, 0x58, 0x06,
- 0x06, 0x8b, 0xd0, 0x08, 0x5e, 0x61, 0x29, 0x89, 0xa9, 0x6d, 0x34, 0xbf, 0x02, 0x7d, 0x40, 0x4b,
- 0x38, 0xcc, 0x4b, 0x2e, 0x59, 0x4a, 0x6d, 0x73, 0x0c, 0xa6, 0x96, 0x7f, 0x1f, 0xff, 0x41, 0x86,
- 0x7f, 0x6b, 0x81, 0x03, 0x9d, 0x08, 0xda, 0xa8, 0xf3, 0x1a, 0x0e, 0x8f, 0x35, 0x84, 0x60, 0x9f,
- 0x93, 0x94, 0xea, 0x01, 0x02, 0xa5, 0x11, 0x86, 0x43, 0x91, 0x49, 0x26, 0x78, 0xa1, 0x9a, 0x5b,
- 0xfe, 0x08, 0xeb, 0x5d, 0xe1, 0x16, 0x10, 0x3f, 0xe5, 0x55, 0xd0, 0x9a, 0x26, 0x3f, 0xba, 0x58,
- 0x6f, 0xb3, 0xe8, 0x72, 0xac, 0xe7, 0x70, 0x90, 0x90, 0x90, 0x26, 0x85, 0x6d, 0x8e, 0xcd, 0xa9,
- 0xe5, 0xe3, 0x7f, 0x51, 0xe9, 0x0e, 0xf8, 0x95, 0x0a, 0x3c, 0xe3, 0x32, 0xaf, 0x82, 0x63, 0x1a,
- 0xdd, 0x85, 0xd7, 0x0a, 0x4e, 0xb2, 0x62, 0x2b, 0xe4, 0xfb, 0x0f, 0xb4, 0xb2, 0xfb, 0xaa, 0x89,
- 0xd5, 0xd6, 0x5e, 0xd2, 0xca, 0x79, 0x04, 0xad, 0x4e, 0x12, 0xdd, 0x80, 0x66, 0x63, 0xd4, 0xf8,
- 0x8d, 0x6c, 0x26, 0xdc, 0x91, 0xa4, 0x3c, 0x4d, 0xa8, 0x0e, 0x8f, 0x8d, 0x87, 0x60, 0x72, 0xaf,
- 0x83, 0xb9, 0xa4, 0x09, 0xfd, 0x3b, 0xe6, 0xfc, 0xcd, 0xfe, 0xe0, 0xf6, 0xbe, 0x1e, 0xdc, 0xde,
- 0xc7, 0xda, 0x05, 0xfb, 0xda, 0x05, 0x9f, 0x6b, 0x17, 0x7c, 0xaf, 0x5d, 0xf0, 0xe9, 0xa7, 0x0b,
- 0xde, 0xf9, 0x17, 0x3c, 0xe5, 0x99, 0xfe, 0xac, 0xc0, 0xca, 0x08, 0x07, 0x6a, 0xff, 0x0f, 0x7e,
- 0x05, 0x00, 0x00, 0xff, 0xff, 0xf5, 0x09, 0xe0, 0xd6, 0x0b, 0x03, 0x00, 0x00,
-}
-
-// Field returns the value for the given fieldpath as a string, if defined.
-// If the value is not defined, the second value will be false.
-func (m *ContainerCreate) Field(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- case "id":
- return string(m.ID), len(m.ID) > 0
- case "image":
- return string(m.Image), len(m.Image) > 0
- case "runtime":
- // NOTE(stevvooe): This is probably not correct in many cases.
- // We assume that the target message also implements the Field
- // method, which isn't likely true in a lot of cases.
- //
- // If you have a broken build and have found this comment,
- // you may be closer to a solution.
- if m.Runtime == nil {
- return "", false
- }
-
- return m.Runtime.Field(fieldpath[1:])
- }
- return "", false
-}
-
-// Field returns the value for the given fieldpath as a string, if defined.
-// If the value is not defined, the second value will be false.
-func (m *ContainerCreate_Runtime) Field(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- case "name":
- return string(m.Name), len(m.Name) > 0
- case "options":
- decoded, err := github_com_containerd_typeurl.UnmarshalAny(m.Options)
- if err != nil {
- return "", false
- }
-
- adaptor, ok := decoded.(interface{ Field([]string) (string, bool) })
- if !ok {
- return "", false
- }
- return adaptor.Field(fieldpath[1:])
- }
- return "", false
-}
-
-// Field returns the value for the given fieldpath as a string, if defined.
-// If the value is not defined, the second value will be false.
-func (m *ContainerUpdate) Field(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- case "id":
- return string(m.ID), len(m.ID) > 0
- case "image":
- return string(m.Image), len(m.Image) > 0
- case "labels":
- // Labels fields have been special-cased by name. If this breaks,
- // add better special casing to fieldpath plugin.
- if len(m.Labels) == 0 {
- return "", false
- }
- value, ok := m.Labels[strings.Join(fieldpath[1:], ".")]
- return value, ok
- case "snapshot_key":
- return string(m.SnapshotKey), len(m.SnapshotKey) > 0
- }
- return "", false
-}
-
-// Field returns the value for the given fieldpath as a string, if defined.
-// If the value is not defined, the second value will be false.
-func (m *ContainerDelete) Field(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- case "id":
- return string(m.ID), len(m.ID) > 0
- }
- return "", false
-}
-func (m *ContainerCreate) 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 *ContainerCreate) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ContainerCreate) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Runtime != nil {
- {
- size, err := m.Runtime.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintContainer(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x1a
- }
- if len(m.Image) > 0 {
- i -= len(m.Image)
- copy(dAtA[i:], m.Image)
- i = encodeVarintContainer(dAtA, i, uint64(len(m.Image)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.ID) > 0 {
- i -= len(m.ID)
- copy(dAtA[i:], m.ID)
- i = encodeVarintContainer(dAtA, i, uint64(len(m.ID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ContainerCreate_Runtime) 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 *ContainerCreate_Runtime) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ContainerCreate_Runtime) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Options != nil {
- {
- size, err := m.Options.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintContainer(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x12
- }
- if len(m.Name) > 0 {
- i -= len(m.Name)
- copy(dAtA[i:], m.Name)
- i = encodeVarintContainer(dAtA, i, uint64(len(m.Name)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ContainerUpdate) 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 *ContainerUpdate) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ContainerUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.SnapshotKey) > 0 {
- i -= len(m.SnapshotKey)
- copy(dAtA[i:], m.SnapshotKey)
- i = encodeVarintContainer(dAtA, i, uint64(len(m.SnapshotKey)))
- 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 = encodeVarintContainer(dAtA, i, uint64(len(v)))
- i--
- dAtA[i] = 0x12
- i -= len(k)
- copy(dAtA[i:], k)
- i = encodeVarintContainer(dAtA, i, uint64(len(k)))
- i--
- dAtA[i] = 0xa
- i = encodeVarintContainer(dAtA, i, uint64(baseI-i))
- i--
- dAtA[i] = 0x1a
- }
- }
- if len(m.Image) > 0 {
- i -= len(m.Image)
- copy(dAtA[i:], m.Image)
- i = encodeVarintContainer(dAtA, i, uint64(len(m.Image)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.ID) > 0 {
- i -= len(m.ID)
- copy(dAtA[i:], m.ID)
- i = encodeVarintContainer(dAtA, i, uint64(len(m.ID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ContainerDelete) 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 *ContainerDelete) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ContainerDelete) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.ID) > 0 {
- i -= len(m.ID)
- copy(dAtA[i:], m.ID)
- i = encodeVarintContainer(dAtA, i, uint64(len(m.ID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func encodeVarintContainer(dAtA []byte, offset int, v uint64) int {
- offset -= sovContainer(v)
- base := offset
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return base
-}
-func (m *ContainerCreate) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ID)
- if l > 0 {
- n += 1 + l + sovContainer(uint64(l))
- }
- l = len(m.Image)
- if l > 0 {
- n += 1 + l + sovContainer(uint64(l))
- }
- if m.Runtime != nil {
- l = m.Runtime.Size()
- n += 1 + l + sovContainer(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ContainerCreate_Runtime) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Name)
- if l > 0 {
- n += 1 + l + sovContainer(uint64(l))
- }
- if m.Options != nil {
- l = m.Options.Size()
- n += 1 + l + sovContainer(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ContainerUpdate) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ID)
- if l > 0 {
- n += 1 + l + sovContainer(uint64(l))
- }
- l = len(m.Image)
- if l > 0 {
- n += 1 + l + sovContainer(uint64(l))
- }
- if len(m.Labels) > 0 {
- for k, v := range m.Labels {
- _ = k
- _ = v
- mapEntrySize := 1 + len(k) + sovContainer(uint64(len(k))) + 1 + len(v) + sovContainer(uint64(len(v)))
- n += mapEntrySize + 1 + sovContainer(uint64(mapEntrySize))
- }
- }
- l = len(m.SnapshotKey)
- if l > 0 {
- n += 1 + l + sovContainer(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ContainerDelete) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ID)
- if l > 0 {
- n += 1 + l + sovContainer(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func sovContainer(x uint64) (n int) {
- return (math_bits.Len64(x|1) + 6) / 7
-}
-func sozContainer(x uint64) (n int) {
- return sovContainer(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-func (this *ContainerCreate) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ContainerCreate{`,
- `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
- `Image:` + fmt.Sprintf("%v", this.Image) + `,`,
- `Runtime:` + strings.Replace(fmt.Sprintf("%v", this.Runtime), "ContainerCreate_Runtime", "ContainerCreate_Runtime", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ContainerCreate_Runtime) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ContainerCreate_Runtime{`,
- `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
- `Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "Any", "types.Any", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ContainerUpdate) 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 += "}"
- s := strings.Join([]string{`&ContainerUpdate{`,
- `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
- `Image:` + fmt.Sprintf("%v", this.Image) + `,`,
- `Labels:` + mapStringForLabels + `,`,
- `SnapshotKey:` + fmt.Sprintf("%v", this.SnapshotKey) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ContainerDelete) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ContainerDelete{`,
- `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func valueToStringContainer(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
-}
-func (m *ContainerCreate) 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 ErrIntOverflowContainer
- }
- 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: ContainerCreate: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ContainerCreate: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainer
- }
- 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 ErrInvalidLengthContainer
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthContainer
- }
- 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 Image", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainer
- }
- 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 ErrInvalidLengthContainer
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthContainer
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Image = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Runtime", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainer
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContainer
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContainer
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Runtime == nil {
- m.Runtime = &ContainerCreate_Runtime{}
- }
- if err := m.Runtime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContainer(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContainer
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContainer
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ContainerCreate_Runtime) 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 ErrIntOverflowContainer
- }
- 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: Runtime: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: Runtime: 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 ErrIntOverflowContainer
- }
- 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 ErrInvalidLengthContainer
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthContainer
- }
- 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 Options", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainer
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContainer
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContainer
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Options == nil {
- m.Options = &types.Any{}
- }
- if err := m.Options.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContainer(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContainer
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContainer
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ContainerUpdate) 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 ErrIntOverflowContainer
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: ContainerUpdate: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ContainerUpdate: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainer
- }
- 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 ErrInvalidLengthContainer
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthContainer
- }
- 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 Image", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainer
- }
- 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 ErrInvalidLengthContainer
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthContainer
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Image = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- 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 ErrIntOverflowContainer
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContainer
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContainer
- }
- 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 ErrIntOverflowContainer
- }
- 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 ErrIntOverflowContainer
- }
- 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 ErrInvalidLengthContainer
- }
- postStringIndexmapkey := iNdEx + intStringLenmapkey
- if postStringIndexmapkey < 0 {
- return ErrInvalidLengthContainer
- }
- 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 ErrIntOverflowContainer
- }
- 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 ErrInvalidLengthContainer
- }
- postStringIndexmapvalue := iNdEx + intStringLenmapvalue
- if postStringIndexmapvalue < 0 {
- return ErrInvalidLengthContainer
- }
- if postStringIndexmapvalue > l {
- return io.ErrUnexpectedEOF
- }
- mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
- iNdEx = postStringIndexmapvalue
- } else {
- iNdEx = entryPreIndex
- skippy, err := skipContainer(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContainer
- }
- if (iNdEx + skippy) > postIndex {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- m.Labels[mapkey] = mapvalue
- iNdEx = postIndex
- case 4:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field SnapshotKey", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainer
- }
- 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 ErrInvalidLengthContainer
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthContainer
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.SnapshotKey = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContainer(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContainer
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContainer
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ContainerDelete) 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 ErrIntOverflowContainer
- }
- 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: ContainerDelete: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ContainerDelete: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainer
- }
- 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 ErrInvalidLengthContainer
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthContainer
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContainer(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContainer
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContainer
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func skipContainer(dAtA []byte) (n int, err error) {
- l := len(dAtA)
- iNdEx := 0
- depth := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowContainer
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowContainer
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if dAtA[iNdEx-1] < 0x80 {
- break
- }
- }
- case 1:
- iNdEx += 8
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowContainer
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if length < 0 {
- return 0, ErrInvalidLengthContainer
- }
- iNdEx += length
- case 3:
- depth++
- case 4:
- if depth == 0 {
- return 0, ErrUnexpectedEndOfGroupContainer
- }
- depth--
- case 5:
- iNdEx += 4
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- if iNdEx < 0 {
- return 0, ErrInvalidLengthContainer
- }
- if depth == 0 {
- return iNdEx, nil
- }
- }
- return 0, io.ErrUnexpectedEOF
-}
-
-var (
- ErrInvalidLengthContainer = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowContainer = fmt.Errorf("proto: integer overflow")
- ErrUnexpectedEndOfGroupContainer = fmt.Errorf("proto: unexpected end of group")
-)
diff --git a/vendor/github.com/containerd/containerd/api/events/container.proto b/vendor/github.com/containerd/containerd/api/events/container.proto
deleted file mode 100644
index 13aa5848c..000000000
--- a/vendor/github.com/containerd/containerd/api/events/container.proto
+++ /dev/null
@@ -1,31 +0,0 @@
-syntax = "proto3";
-
-package containerd.events;
-
-import "google/protobuf/any.proto";
-import weak "gogoproto/gogo.proto";
-import weak "github.com/containerd/containerd/protobuf/plugin/fieldpath.proto";
-
-option go_package = "github.com/containerd/containerd/api/events;events";
-option (containerd.plugin.fieldpath_all) = true;
-
-message ContainerCreate {
- string id = 1;
- string image = 2;
- message Runtime {
- string name = 1;
- google.protobuf.Any options = 2;
- }
- Runtime runtime = 3;
-}
-
-message ContainerUpdate {
- string id = 1;
- string image = 2;
- map labels = 3;
- string snapshot_key = 4;
-}
-
-message ContainerDelete {
- string id = 1;
-}
diff --git a/vendor/github.com/containerd/containerd/api/events/content.pb.go b/vendor/github.com/containerd/containerd/api/events/content.pb.go
deleted file mode 100644
index 959ea72d8..000000000
--- a/vendor/github.com/containerd/containerd/api/events/content.pb.go
+++ /dev/null
@@ -1,362 +0,0 @@
-// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: github.com/containerd/containerd/api/events/content.proto
-
-package events
-
-import (
- fmt "fmt"
- proto "github.com/gogo/protobuf/proto"
- github_com_opencontainers_go_digest "github.com/opencontainers/go-digest"
- io "io"
- math "math"
- math_bits "math/bits"
- reflect "reflect"
- strings "strings"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
-
-type ContentDelete struct {
- Digest github_com_opencontainers_go_digest.Digest `protobuf:"bytes,1,opt,name=digest,proto3,customtype=github.com/opencontainers/go-digest.Digest" json:"digest"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ContentDelete) Reset() { *m = ContentDelete{} }
-func (*ContentDelete) ProtoMessage() {}
-func (*ContentDelete) Descriptor() ([]byte, []int) {
- return fileDescriptor_dfb34b8b808e2ecd, []int{0}
-}
-func (m *ContentDelete) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ContentDelete) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ContentDelete.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 *ContentDelete) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ContentDelete.Merge(m, src)
-}
-func (m *ContentDelete) XXX_Size() int {
- return m.Size()
-}
-func (m *ContentDelete) XXX_DiscardUnknown() {
- xxx_messageInfo_ContentDelete.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ContentDelete proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*ContentDelete)(nil), "containerd.events.ContentDelete")
-}
-
-func init() {
- proto.RegisterFile("github.com/containerd/containerd/api/events/content.proto", fileDescriptor_dfb34b8b808e2ecd)
-}
-
-var fileDescriptor_dfb34b8b808e2ecd = []byte{
- // 228 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x4c, 0xcf, 0x2c, 0xc9,
- 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d,
- 0x4a, 0x41, 0x66, 0x26, 0x16, 0x64, 0xea, 0xa7, 0x96, 0xa5, 0xe6, 0x95, 0x14, 0x83, 0x45, 0x53,
- 0xf3, 0x4a, 0xf4, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0x04, 0x11, 0x8a, 0xf4, 0x20, 0x0a, 0xa4,
- 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0xb2, 0xfa, 0x20, 0x16, 0x44, 0xa1, 0x94, 0x03, 0x41, 0x3b,
- 0xc0, 0xea, 0x92, 0x4a, 0xd3, 0xf4, 0x0b, 0x72, 0x4a, 0xd3, 0x33, 0xf3, 0xf4, 0xd3, 0x32, 0x53,
- 0x73, 0x52, 0x0a, 0x12, 0x4b, 0x32, 0x20, 0x26, 0x28, 0x45, 0x73, 0xf1, 0x3a, 0x43, 0xec, 0x76,
- 0x49, 0xcd, 0x49, 0x2d, 0x49, 0x15, 0xf2, 0xe2, 0x62, 0x4b, 0xc9, 0x4c, 0x4f, 0x2d, 0x2e, 0x91,
- 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x74, 0x32, 0x3a, 0x71, 0x4f, 0x9e, 0xe1, 0xd6, 0x3d, 0x79, 0x2d,
- 0x24, 0xab, 0xf2, 0x0b, 0x52, 0xf3, 0xe0, 0x76, 0x14, 0xeb, 0xa7, 0xe7, 0xeb, 0x42, 0xb4, 0xe8,
- 0xb9, 0x80, 0xa9, 0x20, 0xa8, 0x09, 0x4e, 0x01, 0x27, 0x1e, 0xca, 0x31, 0xdc, 0x78, 0x28, 0xc7,
- 0xd0, 0xf0, 0x48, 0x8e, 0xf1, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92,
- 0x63, 0x5c, 0xf0, 0x45, 0x8e, 0x31, 0xca, 0x88, 0x84, 0x00, 0xb2, 0x86, 0x50, 0x11, 0x0c, 0x11,
- 0x8c, 0x49, 0x6c, 0x60, 0x97, 0x1b, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x4b, 0x78, 0x99, 0xee,
- 0x61, 0x01, 0x00, 0x00,
-}
-
-// Field returns the value for the given fieldpath as a string, if defined.
-// If the value is not defined, the second value will be false.
-func (m *ContentDelete) Field(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- case "digest":
- return string(m.Digest), len(m.Digest) > 0
- }
- return "", false
-}
-func (m *ContentDelete) 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 *ContentDelete) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ContentDelete) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Digest) > 0 {
- i -= len(m.Digest)
- copy(dAtA[i:], m.Digest)
- i = encodeVarintContent(dAtA, i, uint64(len(m.Digest)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func encodeVarintContent(dAtA []byte, offset int, v uint64) int {
- offset -= sovContent(v)
- base := offset
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return base
-}
-func (m *ContentDelete) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Digest)
- if l > 0 {
- n += 1 + l + sovContent(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func sovContent(x uint64) (n int) {
- return (math_bits.Len64(x|1) + 6) / 7
-}
-func sozContent(x uint64) (n int) {
- return sovContent(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-func (this *ContentDelete) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ContentDelete{`,
- `Digest:` + fmt.Sprintf("%v", this.Digest) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func valueToStringContent(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
-}
-func (m *ContentDelete) 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 ErrIntOverflowContent
- }
- 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: ContentDelete: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ContentDelete: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Digest", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- 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 ErrInvalidLengthContent
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Digest = github_com_opencontainers_go_digest.Digest(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContent(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func skipContent(dAtA []byte) (n int, err error) {
- l := len(dAtA)
- iNdEx := 0
- depth := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowContent
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowContent
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if dAtA[iNdEx-1] < 0x80 {
- break
- }
- }
- case 1:
- iNdEx += 8
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowContent
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if length < 0 {
- return 0, ErrInvalidLengthContent
- }
- iNdEx += length
- case 3:
- depth++
- case 4:
- if depth == 0 {
- return 0, ErrUnexpectedEndOfGroupContent
- }
- depth--
- case 5:
- iNdEx += 4
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- if iNdEx < 0 {
- return 0, ErrInvalidLengthContent
- }
- if depth == 0 {
- return iNdEx, nil
- }
- }
- return 0, io.ErrUnexpectedEOF
-}
-
-var (
- ErrInvalidLengthContent = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowContent = fmt.Errorf("proto: integer overflow")
- ErrUnexpectedEndOfGroupContent = fmt.Errorf("proto: unexpected end of group")
-)
diff --git a/vendor/github.com/containerd/containerd/api/events/content.proto b/vendor/github.com/containerd/containerd/api/events/content.proto
deleted file mode 100644
index aba50716f..000000000
--- a/vendor/github.com/containerd/containerd/api/events/content.proto
+++ /dev/null
@@ -1,13 +0,0 @@
-syntax = "proto3";
-
-package containerd.events;
-
-import weak "gogoproto/gogo.proto";
-import weak "github.com/containerd/containerd/protobuf/plugin/fieldpath.proto";
-
-option go_package = "github.com/containerd/containerd/api/events;events";
-option (containerd.plugin.fieldpath_all) = true;
-
-message ContentDelete {
- string digest = 1 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
-}
diff --git a/vendor/github.com/containerd/containerd/api/events/doc.go b/vendor/github.com/containerd/containerd/api/events/doc.go
deleted file mode 100644
index 354bef79f..000000000
--- a/vendor/github.com/containerd/containerd/api/events/doc.go
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-// Package events has protobuf types for various events that are used in
-// containerd.
-package events
diff --git a/vendor/github.com/containerd/containerd/api/events/image.pb.go b/vendor/github.com/containerd/containerd/api/events/image.pb.go
deleted file mode 100644
index 13f60b017..000000000
--- a/vendor/github.com/containerd/containerd/api/events/image.pb.go
+++ /dev/null
@@ -1,1118 +0,0 @@
-// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: github.com/containerd/containerd/api/events/image.proto
-
-package events
-
-import (
- fmt "fmt"
- proto "github.com/gogo/protobuf/proto"
- github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
- io "io"
- math "math"
- math_bits "math/bits"
- reflect "reflect"
- strings "strings"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
-
-type ImageCreate struct {
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- Labels map[string]string `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ImageCreate) Reset() { *m = ImageCreate{} }
-func (*ImageCreate) ProtoMessage() {}
-func (*ImageCreate) Descriptor() ([]byte, []int) {
- return fileDescriptor_7085610f7b33e042, []int{0}
-}
-func (m *ImageCreate) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ImageCreate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ImageCreate.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 *ImageCreate) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ImageCreate.Merge(m, src)
-}
-func (m *ImageCreate) XXX_Size() int {
- return m.Size()
-}
-func (m *ImageCreate) XXX_DiscardUnknown() {
- xxx_messageInfo_ImageCreate.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ImageCreate proto.InternalMessageInfo
-
-type ImageUpdate struct {
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- Labels map[string]string `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ImageUpdate) Reset() { *m = ImageUpdate{} }
-func (*ImageUpdate) ProtoMessage() {}
-func (*ImageUpdate) Descriptor() ([]byte, []int) {
- return fileDescriptor_7085610f7b33e042, []int{1}
-}
-func (m *ImageUpdate) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ImageUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ImageUpdate.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 *ImageUpdate) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ImageUpdate.Merge(m, src)
-}
-func (m *ImageUpdate) XXX_Size() int {
- return m.Size()
-}
-func (m *ImageUpdate) XXX_DiscardUnknown() {
- xxx_messageInfo_ImageUpdate.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ImageUpdate proto.InternalMessageInfo
-
-type ImageDelete struct {
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ImageDelete) Reset() { *m = ImageDelete{} }
-func (*ImageDelete) ProtoMessage() {}
-func (*ImageDelete) Descriptor() ([]byte, []int) {
- return fileDescriptor_7085610f7b33e042, []int{2}
-}
-func (m *ImageDelete) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ImageDelete) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ImageDelete.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 *ImageDelete) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ImageDelete.Merge(m, src)
-}
-func (m *ImageDelete) XXX_Size() int {
- return m.Size()
-}
-func (m *ImageDelete) XXX_DiscardUnknown() {
- xxx_messageInfo_ImageDelete.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ImageDelete proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*ImageCreate)(nil), "containerd.services.images.v1.ImageCreate")
- proto.RegisterMapType((map[string]string)(nil), "containerd.services.images.v1.ImageCreate.LabelsEntry")
- proto.RegisterType((*ImageUpdate)(nil), "containerd.services.images.v1.ImageUpdate")
- proto.RegisterMapType((map[string]string)(nil), "containerd.services.images.v1.ImageUpdate.LabelsEntry")
- proto.RegisterType((*ImageDelete)(nil), "containerd.services.images.v1.ImageDelete")
-}
-
-func init() {
- proto.RegisterFile("github.com/containerd/containerd/api/events/image.proto", fileDescriptor_7085610f7b33e042)
-}
-
-var fileDescriptor_7085610f7b33e042 = []byte{
- // 292 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0x4f, 0xcf, 0x2c, 0xc9,
- 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d,
- 0x4a, 0x41, 0x66, 0x26, 0x16, 0x64, 0xea, 0xa7, 0x96, 0xa5, 0xe6, 0x95, 0x14, 0xeb, 0x67, 0xe6,
- 0x26, 0xa6, 0xa7, 0xea, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0xc9, 0x22, 0x94, 0xe8, 0x15, 0xa7,
- 0x16, 0x95, 0x65, 0x26, 0xa7, 0x16, 0xeb, 0x81, 0x15, 0x14, 0xeb, 0x95, 0x19, 0x4a, 0x39, 0x10,
- 0x34, 0x17, 0x6c, 0x4c, 0x52, 0x69, 0x9a, 0x7e, 0x41, 0x4e, 0x69, 0x7a, 0x66, 0x9e, 0x7e, 0x5a,
- 0x66, 0x6a, 0x4e, 0x4a, 0x41, 0x62, 0x49, 0x06, 0xc4, 0x02, 0xa5, 0x35, 0x8c, 0x5c, 0xdc, 0x9e,
- 0x20, 0xf3, 0x9c, 0x8b, 0x52, 0x13, 0x4b, 0x52, 0x85, 0x84, 0xb8, 0x58, 0xf2, 0x12, 0x73, 0x53,
- 0x25, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0xc0, 0x6c, 0x21, 0x3f, 0x2e, 0xb6, 0x9c, 0xc4, 0xa4,
- 0xd4, 0x9c, 0x62, 0x09, 0x26, 0x05, 0x66, 0x0d, 0x6e, 0x23, 0x33, 0x3d, 0xbc, 0xae, 0xd2, 0x43,
- 0x32, 0x4f, 0xcf, 0x07, 0xac, 0xd1, 0x35, 0xaf, 0xa4, 0xa8, 0x32, 0x08, 0x6a, 0x8a, 0x94, 0x25,
- 0x17, 0x37, 0x92, 0xb0, 0x90, 0x00, 0x17, 0x73, 0x76, 0x6a, 0x25, 0xd4, 0x46, 0x10, 0x53, 0x48,
- 0x84, 0x8b, 0xb5, 0x2c, 0x31, 0xa7, 0x34, 0x55, 0x82, 0x09, 0x2c, 0x06, 0xe1, 0x58, 0x31, 0x59,
- 0x30, 0x22, 0x9c, 0x1b, 0x5a, 0x90, 0x42, 0x55, 0xe7, 0x42, 0xcc, 0xa3, 0xb6, 0x73, 0x15, 0xa1,
- 0xae, 0x75, 0x49, 0xcd, 0x49, 0xc5, 0xee, 0x5a, 0xa7, 0x80, 0x13, 0x0f, 0xe5, 0x18, 0x6e, 0x3c,
- 0x94, 0x63, 0x68, 0x78, 0x24, 0xc7, 0x78, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f,
- 0x1e, 0xc9, 0x31, 0x2e, 0xf8, 0x22, 0xc7, 0x18, 0x65, 0x44, 0x42, 0xc2, 0xb1, 0x86, 0x50, 0x11,
- 0x0c, 0x49, 0x6c, 0xe0, 0xb8, 0x35, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x41, 0x80, 0x92, 0x17,
- 0x77, 0x02, 0x00, 0x00,
-}
-
-// Field returns the value for the given fieldpath as a string, if defined.
-// If the value is not defined, the second value will be false.
-func (m *ImageCreate) Field(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- case "name":
- return string(m.Name), len(m.Name) > 0
- case "labels":
- // Labels fields have been special-cased by name. If this breaks,
- // add better special casing to fieldpath plugin.
- if len(m.Labels) == 0 {
- return "", false
- }
- value, ok := m.Labels[strings.Join(fieldpath[1:], ".")]
- return value, ok
- }
- return "", false
-}
-
-// Field returns the value for the given fieldpath as a string, if defined.
-// If the value is not defined, the second value will be false.
-func (m *ImageUpdate) Field(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- case "name":
- return string(m.Name), len(m.Name) > 0
- case "labels":
- // Labels fields have been special-cased by name. If this breaks,
- // add better special casing to fieldpath plugin.
- if len(m.Labels) == 0 {
- return "", false
- }
- value, ok := m.Labels[strings.Join(fieldpath[1:], ".")]
- return value, ok
- }
- return "", false
-}
-
-// Field returns the value for the given fieldpath as a string, if defined.
-// If the value is not defined, the second value will be false.
-func (m *ImageDelete) Field(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- case "name":
- return string(m.Name), len(m.Name) > 0
- }
- return "", false
-}
-func (m *ImageCreate) 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 *ImageCreate) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ImageCreate) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Labels) > 0 {
- for k := range m.Labels {
- v := m.Labels[k]
- baseI := i
- i -= len(v)
- copy(dAtA[i:], v)
- i = encodeVarintImage(dAtA, i, uint64(len(v)))
- i--
- dAtA[i] = 0x12
- i -= len(k)
- copy(dAtA[i:], k)
- i = encodeVarintImage(dAtA, i, uint64(len(k)))
- i--
- dAtA[i] = 0xa
- i = encodeVarintImage(dAtA, i, uint64(baseI-i))
- i--
- dAtA[i] = 0x12
- }
- }
- if len(m.Name) > 0 {
- i -= len(m.Name)
- copy(dAtA[i:], m.Name)
- i = encodeVarintImage(dAtA, i, uint64(len(m.Name)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ImageUpdate) 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 *ImageUpdate) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ImageUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Labels) > 0 {
- for k := range m.Labels {
- v := m.Labels[k]
- baseI := i
- i -= len(v)
- copy(dAtA[i:], v)
- i = encodeVarintImage(dAtA, i, uint64(len(v)))
- i--
- dAtA[i] = 0x12
- i -= len(k)
- copy(dAtA[i:], k)
- i = encodeVarintImage(dAtA, i, uint64(len(k)))
- i--
- dAtA[i] = 0xa
- i = encodeVarintImage(dAtA, i, uint64(baseI-i))
- i--
- dAtA[i] = 0x12
- }
- }
- if len(m.Name) > 0 {
- i -= len(m.Name)
- copy(dAtA[i:], m.Name)
- i = encodeVarintImage(dAtA, i, uint64(len(m.Name)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ImageDelete) 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 *ImageDelete) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ImageDelete) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Name) > 0 {
- i -= len(m.Name)
- copy(dAtA[i:], m.Name)
- i = encodeVarintImage(dAtA, i, uint64(len(m.Name)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func encodeVarintImage(dAtA []byte, offset int, v uint64) int {
- offset -= sovImage(v)
- base := offset
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return base
-}
-func (m *ImageCreate) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Name)
- if l > 0 {
- n += 1 + l + sovImage(uint64(l))
- }
- if len(m.Labels) > 0 {
- for k, v := range m.Labels {
- _ = k
- _ = v
- mapEntrySize := 1 + len(k) + sovImage(uint64(len(k))) + 1 + len(v) + sovImage(uint64(len(v)))
- n += mapEntrySize + 1 + sovImage(uint64(mapEntrySize))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ImageUpdate) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Name)
- if l > 0 {
- n += 1 + l + sovImage(uint64(l))
- }
- if len(m.Labels) > 0 {
- for k, v := range m.Labels {
- _ = k
- _ = v
- mapEntrySize := 1 + len(k) + sovImage(uint64(len(k))) + 1 + len(v) + sovImage(uint64(len(v)))
- n += mapEntrySize + 1 + sovImage(uint64(mapEntrySize))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ImageDelete) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Name)
- if l > 0 {
- n += 1 + l + sovImage(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func sovImage(x uint64) (n int) {
- return (math_bits.Len64(x|1) + 6) / 7
-}
-func sozImage(x uint64) (n int) {
- return sovImage(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-func (this *ImageCreate) 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 += "}"
- s := strings.Join([]string{`&ImageCreate{`,
- `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
- `Labels:` + mapStringForLabels + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ImageUpdate) 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 += "}"
- s := strings.Join([]string{`&ImageUpdate{`,
- `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
- `Labels:` + mapStringForLabels + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ImageDelete) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ImageDelete{`,
- `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func valueToStringImage(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
-}
-func (m *ImageCreate) 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 ErrIntOverflowImage
- }
- 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: ImageCreate: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ImageCreate: 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 ErrIntOverflowImage
- }
- 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 ErrInvalidLengthImage
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthImage
- }
- 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 Labels", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowImage
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthImage
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthImage
- }
- 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 ErrIntOverflowImage
- }
- 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 ErrIntOverflowImage
- }
- 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 ErrInvalidLengthImage
- }
- postStringIndexmapkey := iNdEx + intStringLenmapkey
- if postStringIndexmapkey < 0 {
- return ErrInvalidLengthImage
- }
- 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 ErrIntOverflowImage
- }
- 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 ErrInvalidLengthImage
- }
- postStringIndexmapvalue := iNdEx + intStringLenmapvalue
- if postStringIndexmapvalue < 0 {
- return ErrInvalidLengthImage
- }
- if postStringIndexmapvalue > l {
- return io.ErrUnexpectedEOF
- }
- mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
- iNdEx = postStringIndexmapvalue
- } else {
- iNdEx = entryPreIndex
- skippy, err := skipImage(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthImage
- }
- if (iNdEx + skippy) > postIndex {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- m.Labels[mapkey] = mapvalue
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipImage(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthImage
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthImage
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ImageUpdate) 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 ErrIntOverflowImage
- }
- 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: ImageUpdate: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ImageUpdate: 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 ErrIntOverflowImage
- }
- 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 ErrInvalidLengthImage
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthImage
- }
- 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 Labels", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowImage
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthImage
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthImage
- }
- 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 ErrIntOverflowImage
- }
- 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 ErrIntOverflowImage
- }
- 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 ErrInvalidLengthImage
- }
- postStringIndexmapkey := iNdEx + intStringLenmapkey
- if postStringIndexmapkey < 0 {
- return ErrInvalidLengthImage
- }
- 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 ErrIntOverflowImage
- }
- 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 ErrInvalidLengthImage
- }
- postStringIndexmapvalue := iNdEx + intStringLenmapvalue
- if postStringIndexmapvalue < 0 {
- return ErrInvalidLengthImage
- }
- if postStringIndexmapvalue > l {
- return io.ErrUnexpectedEOF
- }
- mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
- iNdEx = postStringIndexmapvalue
- } else {
- iNdEx = entryPreIndex
- skippy, err := skipImage(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthImage
- }
- if (iNdEx + skippy) > postIndex {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- m.Labels[mapkey] = mapvalue
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipImage(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthImage
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthImage
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ImageDelete) 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 ErrIntOverflowImage
- }
- 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: ImageDelete: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ImageDelete: 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 ErrIntOverflowImage
- }
- 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 ErrInvalidLengthImage
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthImage
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Name = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipImage(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthImage
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthImage
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func skipImage(dAtA []byte) (n int, err error) {
- l := len(dAtA)
- iNdEx := 0
- depth := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowImage
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowImage
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if dAtA[iNdEx-1] < 0x80 {
- break
- }
- }
- case 1:
- iNdEx += 8
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowImage
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if length < 0 {
- return 0, ErrInvalidLengthImage
- }
- iNdEx += length
- case 3:
- depth++
- case 4:
- if depth == 0 {
- return 0, ErrUnexpectedEndOfGroupImage
- }
- depth--
- case 5:
- iNdEx += 4
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- if iNdEx < 0 {
- return 0, ErrInvalidLengthImage
- }
- if depth == 0 {
- return iNdEx, nil
- }
- }
- return 0, io.ErrUnexpectedEOF
-}
-
-var (
- ErrInvalidLengthImage = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowImage = fmt.Errorf("proto: integer overflow")
- ErrUnexpectedEndOfGroupImage = fmt.Errorf("proto: unexpected end of group")
-)
diff --git a/vendor/github.com/containerd/containerd/api/events/image.proto b/vendor/github.com/containerd/containerd/api/events/image.proto
deleted file mode 100644
index 470c3a2fa..000000000
--- a/vendor/github.com/containerd/containerd/api/events/image.proto
+++ /dev/null
@@ -1,22 +0,0 @@
-syntax = "proto3";
-
-package containerd.services.images.v1;
-
-import weak "github.com/containerd/containerd/protobuf/plugin/fieldpath.proto";
-
-option go_package = "github.com/containerd/containerd/api/events;events";
-option (containerd.plugin.fieldpath_all) = true;
-
-message ImageCreate {
- string name = 1;
- map labels = 2;
-}
-
-message ImageUpdate {
- string name = 1;
- map labels = 2;
-}
-
-message ImageDelete {
- string name = 1;
-}
diff --git a/vendor/github.com/containerd/containerd/api/events/namespace.pb.go b/vendor/github.com/containerd/containerd/api/events/namespace.pb.go
deleted file mode 100644
index 37c3b78cf..000000000
--- a/vendor/github.com/containerd/containerd/api/events/namespace.pb.go
+++ /dev/null
@@ -1,1118 +0,0 @@
-// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: github.com/containerd/containerd/api/events/namespace.proto
-
-package events
-
-import (
- fmt "fmt"
- proto "github.com/gogo/protobuf/proto"
- github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
- io "io"
- math "math"
- math_bits "math/bits"
- reflect "reflect"
- strings "strings"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
-
-type NamespaceCreate struct {
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- Labels map[string]string `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *NamespaceCreate) Reset() { *m = NamespaceCreate{} }
-func (*NamespaceCreate) ProtoMessage() {}
-func (*NamespaceCreate) Descriptor() ([]byte, []int) {
- return fileDescriptor_6cd45d1d5adffe29, []int{0}
-}
-func (m *NamespaceCreate) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *NamespaceCreate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_NamespaceCreate.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 *NamespaceCreate) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NamespaceCreate.Merge(m, src)
-}
-func (m *NamespaceCreate) XXX_Size() int {
- return m.Size()
-}
-func (m *NamespaceCreate) XXX_DiscardUnknown() {
- xxx_messageInfo_NamespaceCreate.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NamespaceCreate proto.InternalMessageInfo
-
-type NamespaceUpdate struct {
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- Labels map[string]string `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *NamespaceUpdate) Reset() { *m = NamespaceUpdate{} }
-func (*NamespaceUpdate) ProtoMessage() {}
-func (*NamespaceUpdate) Descriptor() ([]byte, []int) {
- return fileDescriptor_6cd45d1d5adffe29, []int{1}
-}
-func (m *NamespaceUpdate) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *NamespaceUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_NamespaceUpdate.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 *NamespaceUpdate) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NamespaceUpdate.Merge(m, src)
-}
-func (m *NamespaceUpdate) XXX_Size() int {
- return m.Size()
-}
-func (m *NamespaceUpdate) XXX_DiscardUnknown() {
- xxx_messageInfo_NamespaceUpdate.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NamespaceUpdate proto.InternalMessageInfo
-
-type NamespaceDelete struct {
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *NamespaceDelete) Reset() { *m = NamespaceDelete{} }
-func (*NamespaceDelete) ProtoMessage() {}
-func (*NamespaceDelete) Descriptor() ([]byte, []int) {
- return fileDescriptor_6cd45d1d5adffe29, []int{2}
-}
-func (m *NamespaceDelete) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *NamespaceDelete) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_NamespaceDelete.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 *NamespaceDelete) XXX_Merge(src proto.Message) {
- xxx_messageInfo_NamespaceDelete.Merge(m, src)
-}
-func (m *NamespaceDelete) XXX_Size() int {
- return m.Size()
-}
-func (m *NamespaceDelete) XXX_DiscardUnknown() {
- xxx_messageInfo_NamespaceDelete.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_NamespaceDelete proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*NamespaceCreate)(nil), "containerd.events.NamespaceCreate")
- proto.RegisterMapType((map[string]string)(nil), "containerd.events.NamespaceCreate.LabelsEntry")
- proto.RegisterType((*NamespaceUpdate)(nil), "containerd.events.NamespaceUpdate")
- proto.RegisterMapType((map[string]string)(nil), "containerd.events.NamespaceUpdate.LabelsEntry")
- proto.RegisterType((*NamespaceDelete)(nil), "containerd.events.NamespaceDelete")
-}
-
-func init() {
- proto.RegisterFile("github.com/containerd/containerd/api/events/namespace.proto", fileDescriptor_6cd45d1d5adffe29)
-}
-
-var fileDescriptor_6cd45d1d5adffe29 = []byte{
- // 296 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x4e, 0xcf, 0x2c, 0xc9,
- 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d,
- 0x4a, 0x41, 0x66, 0x26, 0x16, 0x64, 0xea, 0xa7, 0x96, 0xa5, 0xe6, 0x95, 0x14, 0xeb, 0xe7, 0x25,
- 0xe6, 0xa6, 0x16, 0x17, 0x24, 0x26, 0xa7, 0xea, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x09, 0x22,
- 0x94, 0xe9, 0x41, 0x94, 0x48, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0x65, 0xf5, 0x41, 0x2c, 0x88,
- 0x42, 0x29, 0x07, 0x82, 0xb6, 0x80, 0xd5, 0x25, 0x95, 0xa6, 0xe9, 0x17, 0xe4, 0x94, 0xa6, 0x67,
- 0xe6, 0xe9, 0xa7, 0x65, 0xa6, 0xe6, 0xa4, 0x14, 0x24, 0x96, 0x64, 0x40, 0x4c, 0x50, 0x5a, 0xc1,
- 0xc8, 0xc5, 0xef, 0x07, 0xb3, 0xde, 0xb9, 0x28, 0x35, 0xb1, 0x24, 0x55, 0x48, 0x88, 0x8b, 0x05,
- 0xe4, 0x22, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x30, 0x5b, 0xc8, 0x8d, 0x8b, 0x2d, 0x27,
- 0x31, 0x29, 0x35, 0xa7, 0x58, 0x82, 0x49, 0x81, 0x59, 0x83, 0xdb, 0x48, 0x4f, 0x0f, 0xc3, 0x8d,
- 0x7a, 0x68, 0xe6, 0xe8, 0xf9, 0x80, 0x35, 0xb8, 0xe6, 0x95, 0x14, 0x55, 0x06, 0x41, 0x75, 0x4b,
- 0x59, 0x72, 0x71, 0x23, 0x09, 0x0b, 0x09, 0x70, 0x31, 0x67, 0xa7, 0x56, 0x42, 0x6d, 0x02, 0x31,
- 0x85, 0x44, 0xb8, 0x58, 0xcb, 0x12, 0x73, 0x4a, 0x53, 0x25, 0x98, 0xc0, 0x62, 0x10, 0x8e, 0x15,
- 0x93, 0x05, 0x23, 0xaa, 0x53, 0x43, 0x0b, 0x52, 0xa8, 0xe2, 0x54, 0x88, 0x39, 0xd4, 0x76, 0xaa,
- 0x2a, 0x92, 0x4b, 0x5d, 0x52, 0x73, 0x52, 0xb1, 0xbb, 0xd4, 0x29, 0xe0, 0xc4, 0x43, 0x39, 0x86,
- 0x1b, 0x0f, 0xe5, 0x18, 0x1a, 0x1e, 0xc9, 0x31, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c,
- 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x0b, 0xbe, 0xc8, 0x31, 0x46, 0x19, 0x91, 0x90, 0x84, 0xac, 0x21,
- 0x54, 0x04, 0x43, 0x04, 0x63, 0x12, 0x1b, 0x38, 0x66, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff,
- 0x00, 0x50, 0x87, 0x59, 0x83, 0x02, 0x00, 0x00,
-}
-
-// Field returns the value for the given fieldpath as a string, if defined.
-// If the value is not defined, the second value will be false.
-func (m *NamespaceCreate) Field(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- case "name":
- return string(m.Name), len(m.Name) > 0
- case "labels":
- // Labels fields have been special-cased by name. If this breaks,
- // add better special casing to fieldpath plugin.
- if len(m.Labels) == 0 {
- return "", false
- }
- value, ok := m.Labels[strings.Join(fieldpath[1:], ".")]
- return value, ok
- }
- return "", false
-}
-
-// Field returns the value for the given fieldpath as a string, if defined.
-// If the value is not defined, the second value will be false.
-func (m *NamespaceUpdate) Field(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- case "name":
- return string(m.Name), len(m.Name) > 0
- case "labels":
- // Labels fields have been special-cased by name. If this breaks,
- // add better special casing to fieldpath plugin.
- if len(m.Labels) == 0 {
- return "", false
- }
- value, ok := m.Labels[strings.Join(fieldpath[1:], ".")]
- return value, ok
- }
- return "", false
-}
-
-// Field returns the value for the given fieldpath as a string, if defined.
-// If the value is not defined, the second value will be false.
-func (m *NamespaceDelete) Field(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- case "name":
- return string(m.Name), len(m.Name) > 0
- }
- return "", false
-}
-func (m *NamespaceCreate) 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 *NamespaceCreate) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *NamespaceCreate) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Labels) > 0 {
- for k := range m.Labels {
- v := m.Labels[k]
- baseI := i
- i -= len(v)
- copy(dAtA[i:], v)
- i = encodeVarintNamespace(dAtA, i, uint64(len(v)))
- i--
- dAtA[i] = 0x12
- i -= len(k)
- copy(dAtA[i:], k)
- i = encodeVarintNamespace(dAtA, i, uint64(len(k)))
- i--
- dAtA[i] = 0xa
- i = encodeVarintNamespace(dAtA, i, uint64(baseI-i))
- i--
- dAtA[i] = 0x12
- }
- }
- if len(m.Name) > 0 {
- i -= len(m.Name)
- copy(dAtA[i:], m.Name)
- i = encodeVarintNamespace(dAtA, i, uint64(len(m.Name)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *NamespaceUpdate) 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 *NamespaceUpdate) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *NamespaceUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Labels) > 0 {
- for k := range m.Labels {
- v := m.Labels[k]
- baseI := i
- i -= len(v)
- copy(dAtA[i:], v)
- i = encodeVarintNamespace(dAtA, i, uint64(len(v)))
- i--
- dAtA[i] = 0x12
- i -= len(k)
- copy(dAtA[i:], k)
- i = encodeVarintNamespace(dAtA, i, uint64(len(k)))
- i--
- dAtA[i] = 0xa
- i = encodeVarintNamespace(dAtA, i, uint64(baseI-i))
- i--
- dAtA[i] = 0x12
- }
- }
- if len(m.Name) > 0 {
- i -= len(m.Name)
- copy(dAtA[i:], m.Name)
- i = encodeVarintNamespace(dAtA, i, uint64(len(m.Name)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *NamespaceDelete) 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 *NamespaceDelete) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *NamespaceDelete) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Name) > 0 {
- i -= len(m.Name)
- copy(dAtA[i:], m.Name)
- i = encodeVarintNamespace(dAtA, i, uint64(len(m.Name)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func encodeVarintNamespace(dAtA []byte, offset int, v uint64) int {
- offset -= sovNamespace(v)
- base := offset
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return base
-}
-func (m *NamespaceCreate) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Name)
- if l > 0 {
- n += 1 + l + sovNamespace(uint64(l))
- }
- if len(m.Labels) > 0 {
- for k, v := range m.Labels {
- _ = k
- _ = v
- mapEntrySize := 1 + len(k) + sovNamespace(uint64(len(k))) + 1 + len(v) + sovNamespace(uint64(len(v)))
- n += mapEntrySize + 1 + sovNamespace(uint64(mapEntrySize))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *NamespaceUpdate) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Name)
- if l > 0 {
- n += 1 + l + sovNamespace(uint64(l))
- }
- if len(m.Labels) > 0 {
- for k, v := range m.Labels {
- _ = k
- _ = v
- mapEntrySize := 1 + len(k) + sovNamespace(uint64(len(k))) + 1 + len(v) + sovNamespace(uint64(len(v)))
- n += mapEntrySize + 1 + sovNamespace(uint64(mapEntrySize))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *NamespaceDelete) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Name)
- if l > 0 {
- n += 1 + l + sovNamespace(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func sovNamespace(x uint64) (n int) {
- return (math_bits.Len64(x|1) + 6) / 7
-}
-func sozNamespace(x uint64) (n int) {
- return sovNamespace(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-func (this *NamespaceCreate) 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 += "}"
- s := strings.Join([]string{`&NamespaceCreate{`,
- `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
- `Labels:` + mapStringForLabels + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *NamespaceUpdate) 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 += "}"
- s := strings.Join([]string{`&NamespaceUpdate{`,
- `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
- `Labels:` + mapStringForLabels + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *NamespaceDelete) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&NamespaceDelete{`,
- `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func valueToStringNamespace(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
-}
-func (m *NamespaceCreate) 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 ErrIntOverflowNamespace
- }
- 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: NamespaceCreate: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: NamespaceCreate: 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 ErrIntOverflowNamespace
- }
- 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 ErrInvalidLengthNamespace
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthNamespace
- }
- 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 Labels", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNamespace
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthNamespace
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthNamespace
- }
- 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 ErrIntOverflowNamespace
- }
- 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 ErrIntOverflowNamespace
- }
- 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 ErrInvalidLengthNamespace
- }
- postStringIndexmapkey := iNdEx + intStringLenmapkey
- if postStringIndexmapkey < 0 {
- return ErrInvalidLengthNamespace
- }
- 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 ErrIntOverflowNamespace
- }
- 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 ErrInvalidLengthNamespace
- }
- postStringIndexmapvalue := iNdEx + intStringLenmapvalue
- if postStringIndexmapvalue < 0 {
- return ErrInvalidLengthNamespace
- }
- if postStringIndexmapvalue > l {
- return io.ErrUnexpectedEOF
- }
- mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
- iNdEx = postStringIndexmapvalue
- } else {
- iNdEx = entryPreIndex
- skippy, err := skipNamespace(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthNamespace
- }
- if (iNdEx + skippy) > postIndex {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- m.Labels[mapkey] = mapvalue
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipNamespace(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthNamespace
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthNamespace
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *NamespaceUpdate) 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 ErrIntOverflowNamespace
- }
- 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: NamespaceUpdate: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: NamespaceUpdate: 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 ErrIntOverflowNamespace
- }
- 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 ErrInvalidLengthNamespace
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthNamespace
- }
- 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 Labels", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNamespace
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthNamespace
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthNamespace
- }
- 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 ErrIntOverflowNamespace
- }
- 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 ErrIntOverflowNamespace
- }
- 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 ErrInvalidLengthNamespace
- }
- postStringIndexmapkey := iNdEx + intStringLenmapkey
- if postStringIndexmapkey < 0 {
- return ErrInvalidLengthNamespace
- }
- 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 ErrIntOverflowNamespace
- }
- 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 ErrInvalidLengthNamespace
- }
- postStringIndexmapvalue := iNdEx + intStringLenmapvalue
- if postStringIndexmapvalue < 0 {
- return ErrInvalidLengthNamespace
- }
- if postStringIndexmapvalue > l {
- return io.ErrUnexpectedEOF
- }
- mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
- iNdEx = postStringIndexmapvalue
- } else {
- iNdEx = entryPreIndex
- skippy, err := skipNamespace(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthNamespace
- }
- if (iNdEx + skippy) > postIndex {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- m.Labels[mapkey] = mapvalue
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipNamespace(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthNamespace
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthNamespace
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *NamespaceDelete) 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 ErrIntOverflowNamespace
- }
- 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: NamespaceDelete: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: NamespaceDelete: 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 ErrIntOverflowNamespace
- }
- 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 ErrInvalidLengthNamespace
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthNamespace
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Name = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipNamespace(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthNamespace
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthNamespace
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func skipNamespace(dAtA []byte) (n int, err error) {
- l := len(dAtA)
- iNdEx := 0
- depth := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowNamespace
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowNamespace
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if dAtA[iNdEx-1] < 0x80 {
- break
- }
- }
- case 1:
- iNdEx += 8
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowNamespace
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if length < 0 {
- return 0, ErrInvalidLengthNamespace
- }
- iNdEx += length
- case 3:
- depth++
- case 4:
- if depth == 0 {
- return 0, ErrUnexpectedEndOfGroupNamespace
- }
- depth--
- case 5:
- iNdEx += 4
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- if iNdEx < 0 {
- return 0, ErrInvalidLengthNamespace
- }
- if depth == 0 {
- return iNdEx, nil
- }
- }
- return 0, io.ErrUnexpectedEOF
-}
-
-var (
- ErrInvalidLengthNamespace = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowNamespace = fmt.Errorf("proto: integer overflow")
- ErrUnexpectedEndOfGroupNamespace = fmt.Errorf("proto: unexpected end of group")
-)
diff --git a/vendor/github.com/containerd/containerd/api/events/namespace.proto b/vendor/github.com/containerd/containerd/api/events/namespace.proto
deleted file mode 100644
index 45deae79a..000000000
--- a/vendor/github.com/containerd/containerd/api/events/namespace.proto
+++ /dev/null
@@ -1,23 +0,0 @@
-syntax = "proto3";
-
-package containerd.events;
-
-import weak "gogoproto/gogo.proto";
-import weak "github.com/containerd/containerd/protobuf/plugin/fieldpath.proto";
-
-option go_package = "github.com/containerd/containerd/api/events;events";
-option (containerd.plugin.fieldpath_all) = true;
-
-message NamespaceCreate {
- string name = 1;
- map labels = 2;
-}
-
-message NamespaceUpdate {
- string name = 1;
- map labels = 2;
-}
-
-message NamespaceDelete {
- string name = 1;
-}
diff --git a/vendor/github.com/containerd/containerd/api/events/snapshot.pb.go b/vendor/github.com/containerd/containerd/api/events/snapshot.pb.go
deleted file mode 100644
index 539297004..000000000
--- a/vendor/github.com/containerd/containerd/api/events/snapshot.pb.go
+++ /dev/null
@@ -1,857 +0,0 @@
-// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: github.com/containerd/containerd/api/events/snapshot.proto
-
-package events
-
-import (
- fmt "fmt"
- proto "github.com/gogo/protobuf/proto"
- io "io"
- math "math"
- math_bits "math/bits"
- reflect "reflect"
- strings "strings"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
-
-type SnapshotPrepare struct {
- Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
- Parent string `protobuf:"bytes,2,opt,name=parent,proto3" json:"parent,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *SnapshotPrepare) Reset() { *m = SnapshotPrepare{} }
-func (*SnapshotPrepare) ProtoMessage() {}
-func (*SnapshotPrepare) Descriptor() ([]byte, []int) {
- return fileDescriptor_bd6c184d3d9aa5f2, []int{0}
-}
-func (m *SnapshotPrepare) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *SnapshotPrepare) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_SnapshotPrepare.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 *SnapshotPrepare) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SnapshotPrepare.Merge(m, src)
-}
-func (m *SnapshotPrepare) XXX_Size() int {
- return m.Size()
-}
-func (m *SnapshotPrepare) XXX_DiscardUnknown() {
- xxx_messageInfo_SnapshotPrepare.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_SnapshotPrepare proto.InternalMessageInfo
-
-type SnapshotCommit struct {
- Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
- Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *SnapshotCommit) Reset() { *m = SnapshotCommit{} }
-func (*SnapshotCommit) ProtoMessage() {}
-func (*SnapshotCommit) Descriptor() ([]byte, []int) {
- return fileDescriptor_bd6c184d3d9aa5f2, []int{1}
-}
-func (m *SnapshotCommit) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *SnapshotCommit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_SnapshotCommit.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 *SnapshotCommit) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SnapshotCommit.Merge(m, src)
-}
-func (m *SnapshotCommit) XXX_Size() int {
- return m.Size()
-}
-func (m *SnapshotCommit) XXX_DiscardUnknown() {
- xxx_messageInfo_SnapshotCommit.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_SnapshotCommit proto.InternalMessageInfo
-
-type SnapshotRemove struct {
- Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *SnapshotRemove) Reset() { *m = SnapshotRemove{} }
-func (*SnapshotRemove) ProtoMessage() {}
-func (*SnapshotRemove) Descriptor() ([]byte, []int) {
- return fileDescriptor_bd6c184d3d9aa5f2, []int{2}
-}
-func (m *SnapshotRemove) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *SnapshotRemove) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_SnapshotRemove.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 *SnapshotRemove) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SnapshotRemove.Merge(m, src)
-}
-func (m *SnapshotRemove) XXX_Size() int {
- return m.Size()
-}
-func (m *SnapshotRemove) XXX_DiscardUnknown() {
- xxx_messageInfo_SnapshotRemove.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_SnapshotRemove proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*SnapshotPrepare)(nil), "containerd.events.SnapshotPrepare")
- proto.RegisterType((*SnapshotCommit)(nil), "containerd.events.SnapshotCommit")
- proto.RegisterType((*SnapshotRemove)(nil), "containerd.events.SnapshotRemove")
-}
-
-func init() {
- proto.RegisterFile("github.com/containerd/containerd/api/events/snapshot.proto", fileDescriptor_bd6c184d3d9aa5f2)
-}
-
-var fileDescriptor_bd6c184d3d9aa5f2 = []byte{
- // 235 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x4a, 0xcf, 0x2c, 0xc9,
- 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d,
- 0x4a, 0x41, 0x66, 0x26, 0x16, 0x64, 0xea, 0xa7, 0x96, 0xa5, 0xe6, 0x95, 0x14, 0xeb, 0x17, 0xe7,
- 0x25, 0x16, 0x14, 0x67, 0xe4, 0x97, 0xe8, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x09, 0x22, 0x54,
- 0xe9, 0x41, 0x54, 0x48, 0x39, 0x10, 0x34, 0x0e, 0xac, 0x35, 0xa9, 0x34, 0x4d, 0xbf, 0x20, 0xa7,
- 0x34, 0x3d, 0x33, 0x4f, 0x3f, 0x2d, 0x33, 0x35, 0x27, 0xa5, 0x20, 0xb1, 0x24, 0x03, 0x62, 0xa8,
- 0x92, 0x35, 0x17, 0x7f, 0x30, 0xd4, 0x9a, 0x80, 0xa2, 0xd4, 0x82, 0xc4, 0xa2, 0x54, 0x21, 0x01,
- 0x2e, 0xe6, 0xec, 0xd4, 0x4a, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x10, 0x53, 0x48, 0x8c,
- 0x8b, 0x0d, 0x24, 0x93, 0x57, 0x22, 0xc1, 0x04, 0x16, 0x84, 0xf2, 0x94, 0xcc, 0xb8, 0xf8, 0x60,
- 0x9a, 0x9d, 0xf3, 0x73, 0x73, 0x33, 0x4b, 0xb0, 0xe8, 0x15, 0xe2, 0x62, 0xc9, 0x4b, 0xcc, 0x4d,
- 0x85, 0xea, 0x04, 0xb3, 0x95, 0x94, 0x10, 0xfa, 0x82, 0x52, 0x73, 0xf3, 0xcb, 0xb0, 0xd8, 0xe9,
- 0x14, 0x70, 0xe2, 0xa1, 0x1c, 0xc3, 0x8d, 0x87, 0x72, 0x0c, 0x0d, 0x8f, 0xe4, 0x18, 0x4f, 0x3c,
- 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x05, 0x5f, 0xe4, 0x18, 0xa3,
- 0x8c, 0x48, 0x08, 0x47, 0x6b, 0x08, 0x15, 0xc1, 0x90, 0xc4, 0x06, 0xf6, 0xb3, 0x31, 0x20, 0x00,
- 0x00, 0xff, 0xff, 0x69, 0x66, 0xa9, 0x2a, 0x86, 0x01, 0x00, 0x00,
-}
-
-// Field returns the value for the given fieldpath as a string, if defined.
-// If the value is not defined, the second value will be false.
-func (m *SnapshotPrepare) Field(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- case "key":
- return string(m.Key), len(m.Key) > 0
- case "parent":
- return string(m.Parent), len(m.Parent) > 0
- }
- return "", false
-}
-
-// Field returns the value for the given fieldpath as a string, if defined.
-// If the value is not defined, the second value will be false.
-func (m *SnapshotCommit) Field(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- case "key":
- return string(m.Key), len(m.Key) > 0
- case "name":
- return string(m.Name), len(m.Name) > 0
- }
- return "", false
-}
-
-// Field returns the value for the given fieldpath as a string, if defined.
-// If the value is not defined, the second value will be false.
-func (m *SnapshotRemove) Field(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- case "key":
- return string(m.Key), len(m.Key) > 0
- }
- return "", false
-}
-func (m *SnapshotPrepare) 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 *SnapshotPrepare) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *SnapshotPrepare) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Parent) > 0 {
- i -= len(m.Parent)
- copy(dAtA[i:], m.Parent)
- i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Parent)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.Key) > 0 {
- i -= len(m.Key)
- copy(dAtA[i:], m.Key)
- i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Key)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *SnapshotCommit) 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 *SnapshotCommit) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *SnapshotCommit) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Name) > 0 {
- i -= len(m.Name)
- copy(dAtA[i:], m.Name)
- i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Name)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.Key) > 0 {
- i -= len(m.Key)
- copy(dAtA[i:], m.Key)
- i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Key)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *SnapshotRemove) 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 *SnapshotRemove) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *SnapshotRemove) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Key) > 0 {
- i -= len(m.Key)
- copy(dAtA[i:], m.Key)
- i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Key)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func encodeVarintSnapshot(dAtA []byte, offset int, v uint64) int {
- offset -= sovSnapshot(v)
- base := offset
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return base
-}
-func (m *SnapshotPrepare) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Key)
- if l > 0 {
- n += 1 + l + sovSnapshot(uint64(l))
- }
- l = len(m.Parent)
- if l > 0 {
- n += 1 + l + sovSnapshot(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *SnapshotCommit) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Key)
- if l > 0 {
- n += 1 + l + sovSnapshot(uint64(l))
- }
- l = len(m.Name)
- if l > 0 {
- n += 1 + l + sovSnapshot(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *SnapshotRemove) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Key)
- if l > 0 {
- n += 1 + l + sovSnapshot(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func sovSnapshot(x uint64) (n int) {
- return (math_bits.Len64(x|1) + 6) / 7
-}
-func sozSnapshot(x uint64) (n int) {
- return sovSnapshot(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-func (this *SnapshotPrepare) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&SnapshotPrepare{`,
- `Key:` + fmt.Sprintf("%v", this.Key) + `,`,
- `Parent:` + fmt.Sprintf("%v", this.Parent) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *SnapshotCommit) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&SnapshotCommit{`,
- `Key:` + fmt.Sprintf("%v", this.Key) + `,`,
- `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *SnapshotRemove) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&SnapshotRemove{`,
- `Key:` + fmt.Sprintf("%v", this.Key) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func valueToStringSnapshot(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
-}
-func (m *SnapshotPrepare) 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 ErrIntOverflowSnapshot
- }
- 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: SnapshotPrepare: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: SnapshotPrepare: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshot
- }
- 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 ErrInvalidLengthSnapshot
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshot
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Key = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Parent", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshot
- }
- 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 ErrInvalidLengthSnapshot
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshot
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Parent = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipSnapshot(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthSnapshot
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthSnapshot
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *SnapshotCommit) 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 ErrIntOverflowSnapshot
- }
- 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: SnapshotCommit: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: SnapshotCommit: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshot
- }
- 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 ErrInvalidLengthSnapshot
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshot
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Key = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshot
- }
- 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 ErrInvalidLengthSnapshot
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshot
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Name = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipSnapshot(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthSnapshot
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthSnapshot
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *SnapshotRemove) 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 ErrIntOverflowSnapshot
- }
- 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: SnapshotRemove: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: SnapshotRemove: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshot
- }
- 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 ErrInvalidLengthSnapshot
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshot
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Key = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipSnapshot(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthSnapshot
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthSnapshot
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func skipSnapshot(dAtA []byte) (n int, err error) {
- l := len(dAtA)
- iNdEx := 0
- depth := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowSnapshot
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowSnapshot
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if dAtA[iNdEx-1] < 0x80 {
- break
- }
- }
- case 1:
- iNdEx += 8
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowSnapshot
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if length < 0 {
- return 0, ErrInvalidLengthSnapshot
- }
- iNdEx += length
- case 3:
- depth++
- case 4:
- if depth == 0 {
- return 0, ErrUnexpectedEndOfGroupSnapshot
- }
- depth--
- case 5:
- iNdEx += 4
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- if iNdEx < 0 {
- return 0, ErrInvalidLengthSnapshot
- }
- if depth == 0 {
- return iNdEx, nil
- }
- }
- return 0, io.ErrUnexpectedEOF
-}
-
-var (
- ErrInvalidLengthSnapshot = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowSnapshot = fmt.Errorf("proto: integer overflow")
- ErrUnexpectedEndOfGroupSnapshot = fmt.Errorf("proto: unexpected end of group")
-)
diff --git a/vendor/github.com/containerd/containerd/api/events/snapshot.proto b/vendor/github.com/containerd/containerd/api/events/snapshot.proto
deleted file mode 100644
index 425eeec8e..000000000
--- a/vendor/github.com/containerd/containerd/api/events/snapshot.proto
+++ /dev/null
@@ -1,22 +0,0 @@
-syntax = "proto3";
-
-package containerd.events;
-
-import weak "github.com/containerd/containerd/protobuf/plugin/fieldpath.proto";
-
-option go_package = "github.com/containerd/containerd/api/events;events";
-option (containerd.plugin.fieldpath_all) = true;
-
-message SnapshotPrepare {
- string key = 1;
- string parent = 2;
-}
-
-message SnapshotCommit {
- string key = 1;
- string name = 2;
-}
-
-message SnapshotRemove {
- string key = 1;
-}
diff --git a/vendor/github.com/containerd/containerd/api/events/task.pb.go b/vendor/github.com/containerd/containerd/api/events/task.pb.go
deleted file mode 100644
index 0f16695e3..000000000
--- a/vendor/github.com/containerd/containerd/api/events/task.pb.go
+++ /dev/null
@@ -1,3294 +0,0 @@
-// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: github.com/containerd/containerd/api/events/task.proto
-
-package events
-
-import (
- fmt "fmt"
- types "github.com/containerd/containerd/api/types"
- proto "github.com/gogo/protobuf/proto"
- _ "github.com/gogo/protobuf/types"
- github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
- io "io"
- math "math"
- math_bits "math/bits"
- reflect "reflect"
- strings "strings"
- time "time"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-var _ = time.Kitchen
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
-
-type TaskCreate struct {
- ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
- Bundle string `protobuf:"bytes,2,opt,name=bundle,proto3" json:"bundle,omitempty"`
- Rootfs []*types.Mount `protobuf:"bytes,3,rep,name=rootfs,proto3" json:"rootfs,omitempty"`
- IO *TaskIO `protobuf:"bytes,4,opt,name=io,proto3" json:"io,omitempty"`
- Checkpoint string `protobuf:"bytes,5,opt,name=checkpoint,proto3" json:"checkpoint,omitempty"`
- Pid uint32 `protobuf:"varint,6,opt,name=pid,proto3" json:"pid,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *TaskCreate) Reset() { *m = TaskCreate{} }
-func (*TaskCreate) ProtoMessage() {}
-func (*TaskCreate) Descriptor() ([]byte, []int) {
- return fileDescriptor_8db0813f7adfb63c, []int{0}
-}
-func (m *TaskCreate) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *TaskCreate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_TaskCreate.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 *TaskCreate) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TaskCreate.Merge(m, src)
-}
-func (m *TaskCreate) XXX_Size() int {
- return m.Size()
-}
-func (m *TaskCreate) XXX_DiscardUnknown() {
- xxx_messageInfo_TaskCreate.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_TaskCreate proto.InternalMessageInfo
-
-type TaskStart struct {
- ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
- Pid uint32 `protobuf:"varint,2,opt,name=pid,proto3" json:"pid,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *TaskStart) Reset() { *m = TaskStart{} }
-func (*TaskStart) ProtoMessage() {}
-func (*TaskStart) Descriptor() ([]byte, []int) {
- return fileDescriptor_8db0813f7adfb63c, []int{1}
-}
-func (m *TaskStart) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *TaskStart) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_TaskStart.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 *TaskStart) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TaskStart.Merge(m, src)
-}
-func (m *TaskStart) XXX_Size() int {
- return m.Size()
-}
-func (m *TaskStart) XXX_DiscardUnknown() {
- xxx_messageInfo_TaskStart.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_TaskStart proto.InternalMessageInfo
-
-type TaskDelete struct {
- ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
- Pid uint32 `protobuf:"varint,2,opt,name=pid,proto3" json:"pid,omitempty"`
- ExitStatus uint32 `protobuf:"varint,3,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"`
- ExitedAt time.Time `protobuf:"bytes,4,opt,name=exited_at,json=exitedAt,proto3,stdtime" json:"exited_at"`
- // id is the specific exec. By default if omitted will be `""` thus matches
- // the init exec of the task matching `container_id`.
- ID string `protobuf:"bytes,5,opt,name=id,proto3" json:"id,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *TaskDelete) Reset() { *m = TaskDelete{} }
-func (*TaskDelete) ProtoMessage() {}
-func (*TaskDelete) Descriptor() ([]byte, []int) {
- return fileDescriptor_8db0813f7adfb63c, []int{2}
-}
-func (m *TaskDelete) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *TaskDelete) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_TaskDelete.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 *TaskDelete) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TaskDelete.Merge(m, src)
-}
-func (m *TaskDelete) XXX_Size() int {
- return m.Size()
-}
-func (m *TaskDelete) XXX_DiscardUnknown() {
- xxx_messageInfo_TaskDelete.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_TaskDelete proto.InternalMessageInfo
-
-type TaskIO struct {
- Stdin string `protobuf:"bytes,1,opt,name=stdin,proto3" json:"stdin,omitempty"`
- Stdout string `protobuf:"bytes,2,opt,name=stdout,proto3" json:"stdout,omitempty"`
- Stderr string `protobuf:"bytes,3,opt,name=stderr,proto3" json:"stderr,omitempty"`
- Terminal bool `protobuf:"varint,4,opt,name=terminal,proto3" json:"terminal,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *TaskIO) Reset() { *m = TaskIO{} }
-func (*TaskIO) ProtoMessage() {}
-func (*TaskIO) Descriptor() ([]byte, []int) {
- return fileDescriptor_8db0813f7adfb63c, []int{3}
-}
-func (m *TaskIO) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *TaskIO) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_TaskIO.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 *TaskIO) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TaskIO.Merge(m, src)
-}
-func (m *TaskIO) XXX_Size() int {
- return m.Size()
-}
-func (m *TaskIO) XXX_DiscardUnknown() {
- xxx_messageInfo_TaskIO.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_TaskIO proto.InternalMessageInfo
-
-type TaskExit struct {
- ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
- ID string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
- Pid uint32 `protobuf:"varint,3,opt,name=pid,proto3" json:"pid,omitempty"`
- ExitStatus uint32 `protobuf:"varint,4,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"`
- ExitedAt time.Time `protobuf:"bytes,5,opt,name=exited_at,json=exitedAt,proto3,stdtime" json:"exited_at"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *TaskExit) Reset() { *m = TaskExit{} }
-func (*TaskExit) ProtoMessage() {}
-func (*TaskExit) Descriptor() ([]byte, []int) {
- return fileDescriptor_8db0813f7adfb63c, []int{4}
-}
-func (m *TaskExit) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *TaskExit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_TaskExit.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 *TaskExit) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TaskExit.Merge(m, src)
-}
-func (m *TaskExit) XXX_Size() int {
- return m.Size()
-}
-func (m *TaskExit) XXX_DiscardUnknown() {
- xxx_messageInfo_TaskExit.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_TaskExit proto.InternalMessageInfo
-
-type TaskOOM struct {
- ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *TaskOOM) Reset() { *m = TaskOOM{} }
-func (*TaskOOM) ProtoMessage() {}
-func (*TaskOOM) Descriptor() ([]byte, []int) {
- return fileDescriptor_8db0813f7adfb63c, []int{5}
-}
-func (m *TaskOOM) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *TaskOOM) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_TaskOOM.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 *TaskOOM) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TaskOOM.Merge(m, src)
-}
-func (m *TaskOOM) XXX_Size() int {
- return m.Size()
-}
-func (m *TaskOOM) XXX_DiscardUnknown() {
- xxx_messageInfo_TaskOOM.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_TaskOOM proto.InternalMessageInfo
-
-type TaskExecAdded struct {
- ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
- ExecID string `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *TaskExecAdded) Reset() { *m = TaskExecAdded{} }
-func (*TaskExecAdded) ProtoMessage() {}
-func (*TaskExecAdded) Descriptor() ([]byte, []int) {
- return fileDescriptor_8db0813f7adfb63c, []int{6}
-}
-func (m *TaskExecAdded) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *TaskExecAdded) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_TaskExecAdded.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 *TaskExecAdded) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TaskExecAdded.Merge(m, src)
-}
-func (m *TaskExecAdded) XXX_Size() int {
- return m.Size()
-}
-func (m *TaskExecAdded) XXX_DiscardUnknown() {
- xxx_messageInfo_TaskExecAdded.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_TaskExecAdded proto.InternalMessageInfo
-
-type TaskExecStarted struct {
- ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
- ExecID string `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"`
- Pid uint32 `protobuf:"varint,3,opt,name=pid,proto3" json:"pid,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *TaskExecStarted) Reset() { *m = TaskExecStarted{} }
-func (*TaskExecStarted) ProtoMessage() {}
-func (*TaskExecStarted) Descriptor() ([]byte, []int) {
- return fileDescriptor_8db0813f7adfb63c, []int{7}
-}
-func (m *TaskExecStarted) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *TaskExecStarted) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_TaskExecStarted.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 *TaskExecStarted) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TaskExecStarted.Merge(m, src)
-}
-func (m *TaskExecStarted) XXX_Size() int {
- return m.Size()
-}
-func (m *TaskExecStarted) XXX_DiscardUnknown() {
- xxx_messageInfo_TaskExecStarted.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_TaskExecStarted proto.InternalMessageInfo
-
-type TaskPaused struct {
- ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *TaskPaused) Reset() { *m = TaskPaused{} }
-func (*TaskPaused) ProtoMessage() {}
-func (*TaskPaused) Descriptor() ([]byte, []int) {
- return fileDescriptor_8db0813f7adfb63c, []int{8}
-}
-func (m *TaskPaused) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *TaskPaused) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_TaskPaused.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 *TaskPaused) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TaskPaused.Merge(m, src)
-}
-func (m *TaskPaused) XXX_Size() int {
- return m.Size()
-}
-func (m *TaskPaused) XXX_DiscardUnknown() {
- xxx_messageInfo_TaskPaused.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_TaskPaused proto.InternalMessageInfo
-
-type TaskResumed struct {
- ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *TaskResumed) Reset() { *m = TaskResumed{} }
-func (*TaskResumed) ProtoMessage() {}
-func (*TaskResumed) Descriptor() ([]byte, []int) {
- return fileDescriptor_8db0813f7adfb63c, []int{9}
-}
-func (m *TaskResumed) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *TaskResumed) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_TaskResumed.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 *TaskResumed) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TaskResumed.Merge(m, src)
-}
-func (m *TaskResumed) XXX_Size() int {
- return m.Size()
-}
-func (m *TaskResumed) XXX_DiscardUnknown() {
- xxx_messageInfo_TaskResumed.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_TaskResumed proto.InternalMessageInfo
-
-type TaskCheckpointed struct {
- ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
- Checkpoint string `protobuf:"bytes,2,opt,name=checkpoint,proto3" json:"checkpoint,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *TaskCheckpointed) Reset() { *m = TaskCheckpointed{} }
-func (*TaskCheckpointed) ProtoMessage() {}
-func (*TaskCheckpointed) Descriptor() ([]byte, []int) {
- return fileDescriptor_8db0813f7adfb63c, []int{10}
-}
-func (m *TaskCheckpointed) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *TaskCheckpointed) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_TaskCheckpointed.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 *TaskCheckpointed) XXX_Merge(src proto.Message) {
- xxx_messageInfo_TaskCheckpointed.Merge(m, src)
-}
-func (m *TaskCheckpointed) XXX_Size() int {
- return m.Size()
-}
-func (m *TaskCheckpointed) XXX_DiscardUnknown() {
- xxx_messageInfo_TaskCheckpointed.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_TaskCheckpointed proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*TaskCreate)(nil), "containerd.events.TaskCreate")
- proto.RegisterType((*TaskStart)(nil), "containerd.events.TaskStart")
- proto.RegisterType((*TaskDelete)(nil), "containerd.events.TaskDelete")
- proto.RegisterType((*TaskIO)(nil), "containerd.events.TaskIO")
- proto.RegisterType((*TaskExit)(nil), "containerd.events.TaskExit")
- proto.RegisterType((*TaskOOM)(nil), "containerd.events.TaskOOM")
- proto.RegisterType((*TaskExecAdded)(nil), "containerd.events.TaskExecAdded")
- proto.RegisterType((*TaskExecStarted)(nil), "containerd.events.TaskExecStarted")
- proto.RegisterType((*TaskPaused)(nil), "containerd.events.TaskPaused")
- proto.RegisterType((*TaskResumed)(nil), "containerd.events.TaskResumed")
- proto.RegisterType((*TaskCheckpointed)(nil), "containerd.events.TaskCheckpointed")
-}
-
-func init() {
- proto.RegisterFile("github.com/containerd/containerd/api/events/task.proto", fileDescriptor_8db0813f7adfb63c)
-}
-
-var fileDescriptor_8db0813f7adfb63c = []byte{
- // 644 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xcd, 0x6e, 0xd3, 0x40,
- 0x10, 0xc7, 0x63, 0xa7, 0x75, 0xd3, 0x09, 0x55, 0x8b, 0x55, 0x95, 0x90, 0x83, 0x1d, 0x99, 0x4b,
- 0x4e, 0xb6, 0x08, 0x12, 0x17, 0x84, 0xd4, 0xa4, 0xe1, 0x90, 0x43, 0x95, 0xe2, 0xf6, 0x50, 0x71,
- 0x89, 0x36, 0xd9, 0x4d, 0xb2, 0x34, 0xf1, 0x5a, 0xf6, 0x18, 0x15, 0x89, 0x03, 0x8f, 0xc0, 0x23,
- 0xf0, 0x38, 0x3d, 0x20, 0xc4, 0x91, 0x53, 0xa0, 0x7e, 0x00, 0x4e, 0x3c, 0x00, 0x5a, 0xaf, 0x93,
- 0xb6, 0x54, 0x7c, 0x59, 0xe2, 0x94, 0x9d, 0xd9, 0xd9, 0xff, 0xec, 0xfc, 0x76, 0x3c, 0x81, 0xc7,
- 0x13, 0x8e, 0xd3, 0x64, 0xe8, 0x8e, 0xc4, 0xdc, 0x1b, 0x89, 0x00, 0x09, 0x0f, 0x58, 0x44, 0xaf,
- 0x2f, 0x49, 0xc8, 0x3d, 0xf6, 0x8a, 0x05, 0x18, 0x7b, 0x48, 0xe2, 0x33, 0x37, 0x8c, 0x04, 0x0a,
- 0xf3, 0xee, 0x55, 0x84, 0xab, 0x76, 0xeb, 0xbb, 0x13, 0x31, 0x11, 0xd9, 0xae, 0x27, 0x57, 0x2a,
- 0xb0, 0x6e, 0x4f, 0x84, 0x98, 0xcc, 0x98, 0x97, 0x59, 0xc3, 0x64, 0xec, 0x21, 0x9f, 0xb3, 0x18,
- 0xc9, 0x3c, 0xcc, 0x03, 0xfe, 0xee, 0x06, 0xf8, 0x3a, 0x64, 0xb1, 0x37, 0x17, 0x49, 0x80, 0xf9,
- 0xb9, 0xfd, 0x3f, 0x9e, 0x5b, 0xa5, 0x0c, 0x67, 0xc9, 0x84, 0x07, 0xde, 0x98, 0xb3, 0x19, 0x0d,
- 0x09, 0x4e, 0x95, 0x82, 0xf3, 0x4d, 0x03, 0x38, 0x21, 0xf1, 0xd9, 0x41, 0xc4, 0x08, 0x32, 0xb3,
- 0x05, 0x77, 0x56, 0x87, 0x07, 0x9c, 0xd6, 0xb4, 0x86, 0xd6, 0xdc, 0xec, 0x6c, 0xa7, 0x0b, 0xbb,
- 0x7a, 0xb0, 0xf4, 0xf7, 0xba, 0x7e, 0x75, 0x15, 0xd4, 0xa3, 0xe6, 0x1e, 0x18, 0xc3, 0x24, 0xa0,
- 0x33, 0x56, 0xd3, 0x65, 0xb4, 0x9f, 0x5b, 0xa6, 0x07, 0x46, 0x24, 0x04, 0x8e, 0xe3, 0x5a, 0xb9,
- 0x51, 0x6e, 0x56, 0x5b, 0xf7, 0xdc, 0x6b, 0xbc, 0xb2, 0x5a, 0xdc, 0x43, 0x59, 0x8b, 0x9f, 0x87,
- 0x99, 0x0f, 0x41, 0xe7, 0xa2, 0xb6, 0xd6, 0xd0, 0x9a, 0xd5, 0xd6, 0x7d, 0xf7, 0x16, 0x5c, 0x57,
- 0xde, 0xb3, 0xd7, 0xef, 0x18, 0xe9, 0xc2, 0xd6, 0x7b, 0x7d, 0x5f, 0xe7, 0xc2, 0xb4, 0x00, 0x46,
- 0x53, 0x36, 0x3a, 0x0b, 0x05, 0x0f, 0xb0, 0xb6, 0x9e, 0xe5, 0xbf, 0xe6, 0x31, 0x77, 0xa0, 0x1c,
- 0x72, 0x5a, 0x33, 0x1a, 0x5a, 0x73, 0xcb, 0x97, 0x4b, 0xe7, 0x39, 0x6c, 0x4a, 0x9d, 0x63, 0x24,
- 0x11, 0x16, 0x2a, 0x37, 0x97, 0xd4, 0xaf, 0x24, 0x3f, 0xe6, 0x0c, 0xbb, 0x6c, 0xc6, 0x0a, 0x32,
- 0xbc, 0x25, 0x6a, 0xda, 0x50, 0x65, 0xe7, 0x1c, 0x07, 0x31, 0x12, 0x4c, 0x24, 0x42, 0xb9, 0x03,
- 0xd2, 0x75, 0x9c, 0x79, 0xcc, 0x36, 0x6c, 0x4a, 0x8b, 0xd1, 0x01, 0xc1, 0x1c, 0x5a, 0xdd, 0x55,
- 0x8d, 0xe6, 0x2e, 0x5f, 0xdd, 0x3d, 0x59, 0x36, 0x5a, 0xa7, 0x72, 0xb1, 0xb0, 0x4b, 0xef, 0xbe,
- 0xd8, 0x9a, 0x5f, 0x51, 0xc7, 0xda, 0x68, 0xee, 0x81, 0xce, 0xa9, 0xa2, 0x96, 0x53, 0xed, 0xfa,
- 0x3a, 0xa7, 0xce, 0x4b, 0x30, 0x14, 0x6b, 0x73, 0x17, 0xd6, 0x63, 0xa4, 0x3c, 0x50, 0x45, 0xf8,
- 0xca, 0x90, 0x2f, 0x1e, 0x23, 0x15, 0x09, 0x2e, 0x5f, 0x5c, 0x59, 0xb9, 0x9f, 0x45, 0x51, 0x76,
- 0x5d, 0xe5, 0x67, 0x51, 0x64, 0xd6, 0xa1, 0x82, 0x2c, 0x9a, 0xf3, 0x80, 0xcc, 0xb2, 0x9b, 0x56,
- 0xfc, 0x95, 0xed, 0x7c, 0xd0, 0xa0, 0x22, 0x93, 0x3d, 0x3b, 0xe7, 0x58, 0xb0, 0xfd, 0xf4, 0x9c,
- 0xdc, 0x8d, 0x22, 0x96, 0x48, 0xcb, 0xbf, 0x44, 0xba, 0xf6, 0x7b, 0xa4, 0xeb, 0x45, 0x90, 0x3a,
- 0x4f, 0x61, 0x43, 0x56, 0xd3, 0xef, 0x1f, 0x16, 0x29, 0xc6, 0x99, 0xc2, 0x96, 0x82, 0xc1, 0x46,
- 0x6d, 0x4a, 0x19, 0x2d, 0x44, 0xe4, 0x01, 0x6c, 0xb0, 0x73, 0x36, 0x1a, 0xac, 0xb0, 0x40, 0xba,
- 0xb0, 0x0d, 0xa9, 0xd9, 0xeb, 0xfa, 0x86, 0xdc, 0xea, 0x51, 0xe7, 0x0d, 0x6c, 0x2f, 0x33, 0x65,
- 0xdf, 0xc2, 0x7f, 0xcc, 0x75, 0xfb, 0x29, 0x9c, 0x7d, 0xf5, 0xc5, 0x1c, 0x91, 0x24, 0x2e, 0x96,
- 0xd8, 0x69, 0x43, 0x55, 0x2a, 0xf8, 0x2c, 0x4e, 0xe6, 0x05, 0x25, 0xc6, 0xb0, 0x93, 0x8d, 0xbe,
- 0xd5, 0xb8, 0x28, 0xc8, 0xe0, 0xe6, 0x10, 0xd2, 0x7f, 0x1e, 0x42, 0x9d, 0xa3, 0x8b, 0x4b, 0xab,
- 0xf4, 0xf9, 0xd2, 0x2a, 0xbd, 0x4d, 0x2d, 0xed, 0x22, 0xb5, 0xb4, 0x4f, 0xa9, 0xa5, 0x7d, 0x4d,
- 0x2d, 0xed, 0xfd, 0x77, 0x4b, 0x7b, 0xd1, 0xfa, 0x87, 0x7f, 0x9f, 0x27, 0xea, 0xe7, 0xb4, 0x74,
- 0x5a, 0x1e, 0x1a, 0x59, 0x47, 0x3e, 0xfa, 0x11, 0x00, 0x00, 0xff, 0xff, 0xc5, 0x58, 0x0f, 0xec,
- 0xbe, 0x06, 0x00, 0x00,
-}
-
-// Field returns the value for the given fieldpath as a string, if defined.
-// If the value is not defined, the second value will be false.
-func (m *TaskCreate) Field(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- // unhandled: rootfs
- // unhandled: pid
- case "container_id":
- return string(m.ContainerID), len(m.ContainerID) > 0
- case "bundle":
- return string(m.Bundle), len(m.Bundle) > 0
- case "io":
- // NOTE(stevvooe): This is probably not correct in many cases.
- // We assume that the target message also implements the Field
- // method, which isn't likely true in a lot of cases.
- //
- // If you have a broken build and have found this comment,
- // you may be closer to a solution.
- if m.IO == nil {
- return "", false
- }
-
- return m.IO.Field(fieldpath[1:])
- case "checkpoint":
- return string(m.Checkpoint), len(m.Checkpoint) > 0
- }
- return "", false
-}
-
-// Field returns the value for the given fieldpath as a string, if defined.
-// If the value is not defined, the second value will be false.
-func (m *TaskStart) Field(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- // unhandled: pid
- case "container_id":
- return string(m.ContainerID), len(m.ContainerID) > 0
- }
- return "", false
-}
-
-// Field returns the value for the given fieldpath as a string, if defined.
-// If the value is not defined, the second value will be false.
-func (m *TaskDelete) Field(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- // unhandled: pid
- // unhandled: exit_status
- // unhandled: exited_at
- case "container_id":
- return string(m.ContainerID), len(m.ContainerID) > 0
- case "id":
- return string(m.ID), len(m.ID) > 0
- }
- return "", false
-}
-
-// Field returns the value for the given fieldpath as a string, if defined.
-// If the value is not defined, the second value will be false.
-func (m *TaskIO) Field(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- case "stdin":
- return string(m.Stdin), len(m.Stdin) > 0
- case "stdout":
- return string(m.Stdout), len(m.Stdout) > 0
- case "stderr":
- return string(m.Stderr), len(m.Stderr) > 0
- case "terminal":
- return fmt.Sprint(m.Terminal), true
- }
- return "", false
-}
-
-// Field returns the value for the given fieldpath as a string, if defined.
-// If the value is not defined, the second value will be false.
-func (m *TaskExit) Field(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- // unhandled: pid
- // unhandled: exit_status
- // unhandled: exited_at
- case "container_id":
- return string(m.ContainerID), len(m.ContainerID) > 0
- case "id":
- return string(m.ID), len(m.ID) > 0
- }
- return "", false
-}
-
-// Field returns the value for the given fieldpath as a string, if defined.
-// If the value is not defined, the second value will be false.
-func (m *TaskOOM) Field(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- case "container_id":
- return string(m.ContainerID), len(m.ContainerID) > 0
- }
- return "", false
-}
-
-// Field returns the value for the given fieldpath as a string, if defined.
-// If the value is not defined, the second value will be false.
-func (m *TaskExecAdded) Field(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- case "container_id":
- return string(m.ContainerID), len(m.ContainerID) > 0
- case "exec_id":
- return string(m.ExecID), len(m.ExecID) > 0
- }
- return "", false
-}
-
-// Field returns the value for the given fieldpath as a string, if defined.
-// If the value is not defined, the second value will be false.
-func (m *TaskExecStarted) Field(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- // unhandled: pid
- case "container_id":
- return string(m.ContainerID), len(m.ContainerID) > 0
- case "exec_id":
- return string(m.ExecID), len(m.ExecID) > 0
- }
- return "", false
-}
-
-// Field returns the value for the given fieldpath as a string, if defined.
-// If the value is not defined, the second value will be false.
-func (m *TaskPaused) Field(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- case "container_id":
- return string(m.ContainerID), len(m.ContainerID) > 0
- }
- return "", false
-}
-
-// Field returns the value for the given fieldpath as a string, if defined.
-// If the value is not defined, the second value will be false.
-func (m *TaskResumed) Field(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- case "container_id":
- return string(m.ContainerID), len(m.ContainerID) > 0
- }
- return "", false
-}
-
-// Field returns the value for the given fieldpath as a string, if defined.
-// If the value is not defined, the second value will be false.
-func (m *TaskCheckpointed) Field(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- case "container_id":
- return string(m.ContainerID), len(m.ContainerID) > 0
- case "checkpoint":
- return string(m.Checkpoint), len(m.Checkpoint) > 0
- }
- return "", false
-}
-func (m *TaskCreate) 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 *TaskCreate) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *TaskCreate) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Pid != 0 {
- i = encodeVarintTask(dAtA, i, uint64(m.Pid))
- i--
- dAtA[i] = 0x30
- }
- if len(m.Checkpoint) > 0 {
- i -= len(m.Checkpoint)
- copy(dAtA[i:], m.Checkpoint)
- i = encodeVarintTask(dAtA, i, uint64(len(m.Checkpoint)))
- i--
- dAtA[i] = 0x2a
- }
- if m.IO != nil {
- {
- size, err := m.IO.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintTask(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x22
- }
- if len(m.Rootfs) > 0 {
- for iNdEx := len(m.Rootfs) - 1; iNdEx >= 0; iNdEx-- {
- {
- size, err := m.Rootfs[iNdEx].MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintTask(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x1a
- }
- }
- if len(m.Bundle) > 0 {
- i -= len(m.Bundle)
- copy(dAtA[i:], m.Bundle)
- i = encodeVarintTask(dAtA, i, uint64(len(m.Bundle)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.ContainerID) > 0 {
- i -= len(m.ContainerID)
- copy(dAtA[i:], m.ContainerID)
- i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *TaskStart) 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 *TaskStart) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *TaskStart) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Pid != 0 {
- i = encodeVarintTask(dAtA, i, uint64(m.Pid))
- i--
- dAtA[i] = 0x10
- }
- if len(m.ContainerID) > 0 {
- i -= len(m.ContainerID)
- copy(dAtA[i:], m.ContainerID)
- i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *TaskDelete) 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 *TaskDelete) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *TaskDelete) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.ID) > 0 {
- i -= len(m.ID)
- copy(dAtA[i:], m.ID)
- i = encodeVarintTask(dAtA, i, uint64(len(m.ID)))
- i--
- dAtA[i] = 0x2a
- }
- n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt):])
- if err2 != nil {
- return 0, err2
- }
- i -= n2
- i = encodeVarintTask(dAtA, i, uint64(n2))
- i--
- dAtA[i] = 0x22
- if m.ExitStatus != 0 {
- i = encodeVarintTask(dAtA, i, uint64(m.ExitStatus))
- i--
- dAtA[i] = 0x18
- }
- if m.Pid != 0 {
- i = encodeVarintTask(dAtA, i, uint64(m.Pid))
- i--
- dAtA[i] = 0x10
- }
- if len(m.ContainerID) > 0 {
- i -= len(m.ContainerID)
- copy(dAtA[i:], m.ContainerID)
- i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *TaskIO) 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 *TaskIO) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *TaskIO) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Terminal {
- i--
- if m.Terminal {
- dAtA[i] = 1
- } else {
- dAtA[i] = 0
- }
- i--
- dAtA[i] = 0x20
- }
- if len(m.Stderr) > 0 {
- i -= len(m.Stderr)
- copy(dAtA[i:], m.Stderr)
- i = encodeVarintTask(dAtA, i, uint64(len(m.Stderr)))
- i--
- dAtA[i] = 0x1a
- }
- if len(m.Stdout) > 0 {
- i -= len(m.Stdout)
- copy(dAtA[i:], m.Stdout)
- i = encodeVarintTask(dAtA, i, uint64(len(m.Stdout)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.Stdin) > 0 {
- i -= len(m.Stdin)
- copy(dAtA[i:], m.Stdin)
- i = encodeVarintTask(dAtA, i, uint64(len(m.Stdin)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *TaskExit) 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 *TaskExit) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *TaskExit) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt):])
- if err3 != nil {
- return 0, err3
- }
- i -= n3
- i = encodeVarintTask(dAtA, i, uint64(n3))
- i--
- dAtA[i] = 0x2a
- if m.ExitStatus != 0 {
- i = encodeVarintTask(dAtA, i, uint64(m.ExitStatus))
- i--
- dAtA[i] = 0x20
- }
- if m.Pid != 0 {
- i = encodeVarintTask(dAtA, i, uint64(m.Pid))
- i--
- dAtA[i] = 0x18
- }
- if len(m.ID) > 0 {
- i -= len(m.ID)
- copy(dAtA[i:], m.ID)
- i = encodeVarintTask(dAtA, i, uint64(len(m.ID)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.ContainerID) > 0 {
- i -= len(m.ContainerID)
- copy(dAtA[i:], m.ContainerID)
- i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *TaskOOM) 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 *TaskOOM) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *TaskOOM) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.ContainerID) > 0 {
- i -= len(m.ContainerID)
- copy(dAtA[i:], m.ContainerID)
- i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *TaskExecAdded) 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 *TaskExecAdded) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *TaskExecAdded) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.ExecID) > 0 {
- i -= len(m.ExecID)
- copy(dAtA[i:], m.ExecID)
- i = encodeVarintTask(dAtA, i, uint64(len(m.ExecID)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.ContainerID) > 0 {
- i -= len(m.ContainerID)
- copy(dAtA[i:], m.ContainerID)
- i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *TaskExecStarted) 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 *TaskExecStarted) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *TaskExecStarted) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Pid != 0 {
- i = encodeVarintTask(dAtA, i, uint64(m.Pid))
- i--
- dAtA[i] = 0x18
- }
- if len(m.ExecID) > 0 {
- i -= len(m.ExecID)
- copy(dAtA[i:], m.ExecID)
- i = encodeVarintTask(dAtA, i, uint64(len(m.ExecID)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.ContainerID) > 0 {
- i -= len(m.ContainerID)
- copy(dAtA[i:], m.ContainerID)
- i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *TaskPaused) 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 *TaskPaused) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *TaskPaused) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.ContainerID) > 0 {
- i -= len(m.ContainerID)
- copy(dAtA[i:], m.ContainerID)
- i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *TaskResumed) 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 *TaskResumed) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *TaskResumed) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.ContainerID) > 0 {
- i -= len(m.ContainerID)
- copy(dAtA[i:], m.ContainerID)
- i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *TaskCheckpointed) 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 *TaskCheckpointed) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *TaskCheckpointed) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Checkpoint) > 0 {
- i -= len(m.Checkpoint)
- copy(dAtA[i:], m.Checkpoint)
- i = encodeVarintTask(dAtA, i, uint64(len(m.Checkpoint)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.ContainerID) > 0 {
- i -= len(m.ContainerID)
- copy(dAtA[i:], m.ContainerID)
- i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func encodeVarintTask(dAtA []byte, offset int, v uint64) int {
- offset -= sovTask(v)
- base := offset
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return base
-}
-func (m *TaskCreate) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ContainerID)
- if l > 0 {
- n += 1 + l + sovTask(uint64(l))
- }
- l = len(m.Bundle)
- if l > 0 {
- n += 1 + l + sovTask(uint64(l))
- }
- if len(m.Rootfs) > 0 {
- for _, e := range m.Rootfs {
- l = e.Size()
- n += 1 + l + sovTask(uint64(l))
- }
- }
- if m.IO != nil {
- l = m.IO.Size()
- n += 1 + l + sovTask(uint64(l))
- }
- l = len(m.Checkpoint)
- if l > 0 {
- n += 1 + l + sovTask(uint64(l))
- }
- if m.Pid != 0 {
- n += 1 + sovTask(uint64(m.Pid))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *TaskStart) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ContainerID)
- if l > 0 {
- n += 1 + l + sovTask(uint64(l))
- }
- if m.Pid != 0 {
- n += 1 + sovTask(uint64(m.Pid))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *TaskDelete) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ContainerID)
- if l > 0 {
- n += 1 + l + sovTask(uint64(l))
- }
- if m.Pid != 0 {
- n += 1 + sovTask(uint64(m.Pid))
- }
- if m.ExitStatus != 0 {
- n += 1 + sovTask(uint64(m.ExitStatus))
- }
- l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt)
- n += 1 + l + sovTask(uint64(l))
- l = len(m.ID)
- if l > 0 {
- n += 1 + l + sovTask(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *TaskIO) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Stdin)
- if l > 0 {
- n += 1 + l + sovTask(uint64(l))
- }
- l = len(m.Stdout)
- if l > 0 {
- n += 1 + l + sovTask(uint64(l))
- }
- l = len(m.Stderr)
- if l > 0 {
- n += 1 + l + sovTask(uint64(l))
- }
- if m.Terminal {
- n += 2
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *TaskExit) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ContainerID)
- if l > 0 {
- n += 1 + l + sovTask(uint64(l))
- }
- l = len(m.ID)
- if l > 0 {
- n += 1 + l + sovTask(uint64(l))
- }
- if m.Pid != 0 {
- n += 1 + sovTask(uint64(m.Pid))
- }
- if m.ExitStatus != 0 {
- n += 1 + sovTask(uint64(m.ExitStatus))
- }
- l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt)
- n += 1 + l + sovTask(uint64(l))
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *TaskOOM) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ContainerID)
- if l > 0 {
- n += 1 + l + sovTask(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *TaskExecAdded) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ContainerID)
- if l > 0 {
- n += 1 + l + sovTask(uint64(l))
- }
- l = len(m.ExecID)
- if l > 0 {
- n += 1 + l + sovTask(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *TaskExecStarted) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ContainerID)
- if l > 0 {
- n += 1 + l + sovTask(uint64(l))
- }
- l = len(m.ExecID)
- if l > 0 {
- n += 1 + l + sovTask(uint64(l))
- }
- if m.Pid != 0 {
- n += 1 + sovTask(uint64(m.Pid))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *TaskPaused) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ContainerID)
- if l > 0 {
- n += 1 + l + sovTask(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *TaskResumed) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ContainerID)
- if l > 0 {
- n += 1 + l + sovTask(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *TaskCheckpointed) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ContainerID)
- if l > 0 {
- n += 1 + l + sovTask(uint64(l))
- }
- l = len(m.Checkpoint)
- if l > 0 {
- n += 1 + l + sovTask(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func sovTask(x uint64) (n int) {
- return (math_bits.Len64(x|1) + 6) / 7
-}
-func sozTask(x uint64) (n int) {
- return sovTask(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-func (this *TaskCreate) String() string {
- if this == nil {
- return "nil"
- }
- repeatedStringForRootfs := "[]*Mount{"
- for _, f := range this.Rootfs {
- repeatedStringForRootfs += strings.Replace(fmt.Sprintf("%v", f), "Mount", "types.Mount", 1) + ","
- }
- repeatedStringForRootfs += "}"
- s := strings.Join([]string{`&TaskCreate{`,
- `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
- `Bundle:` + fmt.Sprintf("%v", this.Bundle) + `,`,
- `Rootfs:` + repeatedStringForRootfs + `,`,
- `IO:` + strings.Replace(this.IO.String(), "TaskIO", "TaskIO", 1) + `,`,
- `Checkpoint:` + fmt.Sprintf("%v", this.Checkpoint) + `,`,
- `Pid:` + fmt.Sprintf("%v", this.Pid) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *TaskStart) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&TaskStart{`,
- `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
- `Pid:` + fmt.Sprintf("%v", this.Pid) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *TaskDelete) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&TaskDelete{`,
- `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
- `Pid:` + fmt.Sprintf("%v", this.Pid) + `,`,
- `ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`,
- `ExitedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ExitedAt), "Timestamp", "types1.Timestamp", 1), `&`, ``, 1) + `,`,
- `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *TaskIO) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&TaskIO{`,
- `Stdin:` + fmt.Sprintf("%v", this.Stdin) + `,`,
- `Stdout:` + fmt.Sprintf("%v", this.Stdout) + `,`,
- `Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`,
- `Terminal:` + fmt.Sprintf("%v", this.Terminal) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *TaskExit) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&TaskExit{`,
- `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
- `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
- `Pid:` + fmt.Sprintf("%v", this.Pid) + `,`,
- `ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`,
- `ExitedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ExitedAt), "Timestamp", "types1.Timestamp", 1), `&`, ``, 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *TaskOOM) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&TaskOOM{`,
- `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *TaskExecAdded) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&TaskExecAdded{`,
- `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
- `ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *TaskExecStarted) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&TaskExecStarted{`,
- `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
- `ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`,
- `Pid:` + fmt.Sprintf("%v", this.Pid) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *TaskPaused) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&TaskPaused{`,
- `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *TaskResumed) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&TaskResumed{`,
- `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *TaskCheckpointed) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&TaskCheckpointed{`,
- `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
- `Checkpoint:` + fmt.Sprintf("%v", this.Checkpoint) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func valueToStringTask(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
-}
-func (m *TaskCreate) 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 ErrIntOverflowTask
- }
- 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: TaskCreate: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: TaskCreate: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- 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 ErrInvalidLengthTask
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ContainerID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Bundle", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- 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 ErrInvalidLengthTask
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Bundle = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Rootfs", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthTask
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Rootfs = append(m.Rootfs, &types.Mount{})
- if err := m.Rootfs[len(m.Rootfs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 4:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field IO", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthTask
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.IO == nil {
- m.IO = &TaskIO{}
- }
- if err := m.IO.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 5:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Checkpoint", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- 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 ErrInvalidLengthTask
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Checkpoint = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 6:
- 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 ErrIntOverflowTask
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Pid |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipTask(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTask
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTask
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *TaskStart) 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 ErrIntOverflowTask
- }
- 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: TaskStart: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: TaskStart: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- 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 ErrInvalidLengthTask
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ContainerID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- 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 ErrIntOverflowTask
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Pid |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipTask(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTask
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTask
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *TaskDelete) 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 ErrIntOverflowTask
- }
- 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: TaskDelete: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: TaskDelete: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- 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 ErrInvalidLengthTask
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ContainerID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- 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 ErrIntOverflowTask
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Pid |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field ExitStatus", wireType)
- }
- m.ExitStatus = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.ExitStatus |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ExitedAt", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthTask
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ExitedAt, dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 5:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- 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 ErrInvalidLengthTask
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTask(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTask
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTask
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *TaskIO) 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 ErrIntOverflowTask
- }
- 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: TaskIO: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: TaskIO: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Stdin", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- 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 ErrInvalidLengthTask
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Stdin = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Stdout", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- 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 ErrInvalidLengthTask
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Stdout = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Stderr", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- 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 ErrInvalidLengthTask
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Stderr = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 4:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Terminal", wireType)
- }
- var v int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.Terminal = bool(v != 0)
- default:
- iNdEx = preIndex
- skippy, err := skipTask(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTask
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTask
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *TaskExit) 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 ErrIntOverflowTask
- }
- 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: TaskExit: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: TaskExit: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- 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 ErrInvalidLengthTask
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ContainerID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- 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 ErrInvalidLengthTask
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- 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 ErrIntOverflowTask
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Pid |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field ExitStatus", wireType)
- }
- m.ExitStatus = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.ExitStatus |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 5:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ExitedAt", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthTask
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ExitedAt, dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTask(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTask
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTask
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *TaskOOM) 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 ErrIntOverflowTask
- }
- 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: TaskOOM: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: TaskOOM: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- 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 ErrInvalidLengthTask
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ContainerID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTask(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTask
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTask
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *TaskExecAdded) 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 ErrIntOverflowTask
- }
- 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: TaskExecAdded: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: TaskExecAdded: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- 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 ErrInvalidLengthTask
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ContainerID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ExecID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- 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 ErrInvalidLengthTask
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ExecID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTask(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTask
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTask
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *TaskExecStarted) 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 ErrIntOverflowTask
- }
- 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: TaskExecStarted: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: TaskExecStarted: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- 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 ErrInvalidLengthTask
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ContainerID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ExecID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- 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 ErrInvalidLengthTask
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ExecID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- 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 ErrIntOverflowTask
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Pid |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipTask(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTask
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTask
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *TaskPaused) 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 ErrIntOverflowTask
- }
- 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: TaskPaused: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: TaskPaused: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- 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 ErrInvalidLengthTask
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ContainerID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTask(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTask
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTask
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *TaskResumed) 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 ErrIntOverflowTask
- }
- 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: TaskResumed: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: TaskResumed: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- 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 ErrInvalidLengthTask
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ContainerID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTask(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTask
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTask
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *TaskCheckpointed) 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 ErrIntOverflowTask
- }
- 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: TaskCheckpointed: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: TaskCheckpointed: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- 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 ErrInvalidLengthTask
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ContainerID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Checkpoint", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- 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 ErrInvalidLengthTask
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Checkpoint = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTask(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTask
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTask
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func skipTask(dAtA []byte) (n int, err error) {
- l := len(dAtA)
- iNdEx := 0
- depth := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowTask
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowTask
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if dAtA[iNdEx-1] < 0x80 {
- break
- }
- }
- case 1:
- iNdEx += 8
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowTask
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if length < 0 {
- return 0, ErrInvalidLengthTask
- }
- iNdEx += length
- case 3:
- depth++
- case 4:
- if depth == 0 {
- return 0, ErrUnexpectedEndOfGroupTask
- }
- depth--
- case 5:
- iNdEx += 4
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- if iNdEx < 0 {
- return 0, ErrInvalidLengthTask
- }
- if depth == 0 {
- return iNdEx, nil
- }
- }
- return 0, io.ErrUnexpectedEOF
-}
-
-var (
- ErrInvalidLengthTask = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowTask = fmt.Errorf("proto: integer overflow")
- ErrUnexpectedEndOfGroupTask = fmt.Errorf("proto: unexpected end of group")
-)
diff --git a/vendor/github.com/containerd/containerd/api/events/task.proto b/vendor/github.com/containerd/containerd/api/events/task.proto
deleted file mode 100644
index 0b9ba6172..000000000
--- a/vendor/github.com/containerd/containerd/api/events/task.proto
+++ /dev/null
@@ -1,78 +0,0 @@
-syntax = "proto3";
-
-package containerd.events;
-
-import weak "gogoproto/gogo.proto";
-import "google/protobuf/timestamp.proto";
-import "github.com/containerd/containerd/api/types/mount.proto";
-import weak "github.com/containerd/containerd/protobuf/plugin/fieldpath.proto";
-
-option go_package = "github.com/containerd/containerd/api/events;events";
-option (containerd.plugin.fieldpath_all) = true;
-
-message TaskCreate {
- string container_id = 1;
- string bundle = 2;
- repeated containerd.types.Mount rootfs = 3;
- TaskIO io = 4 [(gogoproto.customname) = "IO"];
- string checkpoint = 5;
- uint32 pid = 6;
-}
-
-message TaskStart {
- string container_id = 1;
- uint32 pid = 2;
-}
-
-message TaskDelete {
- string container_id = 1;
- uint32 pid = 2;
- uint32 exit_status = 3;
- google.protobuf.Timestamp exited_at = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
- // id is the specific exec. By default if omitted will be `""` thus matches
- // the init exec of the task matching `container_id`.
- string id = 5;
-}
-
-message TaskIO {
- string stdin = 1;
- string stdout = 2;
- string stderr = 3;
- bool terminal = 4;
-}
-
-message TaskExit {
- string container_id = 1;
- string id = 2;
- uint32 pid = 3;
- uint32 exit_status = 4;
- google.protobuf.Timestamp exited_at = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
-}
-
-message TaskOOM {
- string container_id = 1;
-}
-
-message TaskExecAdded {
- string container_id = 1;
- string exec_id = 2;
-}
-
-message TaskExecStarted {
- string container_id = 1;
- string exec_id = 2;
- uint32 pid = 3;
-}
-
-message TaskPaused {
- string container_id = 1;
-}
-
-message TaskResumed {
- string container_id = 1;
-}
-
-message TaskCheckpointed {
- string container_id = 1;
- string checkpoint = 2;
-}
diff --git a/vendor/github.com/containerd/containerd/api/services/containers/v1/containers.pb.go b/vendor/github.com/containerd/containerd/api/services/containers/v1/containers.pb.go
deleted file mode 100644
index d951b2683..000000000
--- a/vendor/github.com/containerd/containerd/api/services/containers/v1/containers.pb.go
+++ /dev/null
@@ -1,3620 +0,0 @@
-// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: github.com/containerd/containerd/api/services/containers/v1/containers.proto
-
-package containers
-
-import (
- context "context"
- fmt "fmt"
- proto "github.com/gogo/protobuf/proto"
- github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
- github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
- types "github.com/gogo/protobuf/types"
- grpc "google.golang.org/grpc"
- codes "google.golang.org/grpc/codes"
- status "google.golang.org/grpc/status"
- io "io"
- math "math"
- math_bits "math/bits"
- reflect "reflect"
- strings "strings"
- time "time"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-var _ = time.Kitchen
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
-
-type Container struct {
- // ID is the user-specified identifier.
- //
- // This field may not be updated.
- ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
- // Labels provides an area to include arbitrary data on containers.
- //
- // The combined size of a key/value pair cannot exceed 4096 bytes.
- //
- // Note that to add a new value to this field, read the existing set and
- // include the entire result in the update call.
- Labels map[string]string `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- // Image contains the reference of the image used to build the
- // specification and snapshots for running this container.
- //
- // If this field is updated, the spec and rootfs needed to updated, as well.
- Image string `protobuf:"bytes,3,opt,name=image,proto3" json:"image,omitempty"`
- // Runtime specifies which runtime to use for executing this container.
- Runtime *Container_Runtime `protobuf:"bytes,4,opt,name=runtime,proto3" json:"runtime,omitempty"`
- // Spec to be used when creating the container. This is runtime specific.
- Spec *types.Any `protobuf:"bytes,5,opt,name=spec,proto3" json:"spec,omitempty"`
- // Snapshotter specifies the snapshotter name used for rootfs
- Snapshotter string `protobuf:"bytes,6,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"`
- // SnapshotKey specifies the snapshot key to use for the container's root
- // filesystem. When starting a task from this container, a caller should
- // look up the mounts from the snapshot service and include those on the
- // task create request.
- //
- // Snapshots referenced in this field will not be garbage collected.
- //
- // This field is set to empty when the rootfs is not a snapshot.
- //
- // This field may be updated.
- SnapshotKey string `protobuf:"bytes,7,opt,name=snapshot_key,json=snapshotKey,proto3" json:"snapshot_key,omitempty"`
- // CreatedAt is the time the container was first created.
- CreatedAt time.Time `protobuf:"bytes,8,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at"`
- // UpdatedAt is the last time the container was mutated.
- UpdatedAt time.Time `protobuf:"bytes,9,opt,name=updated_at,json=updatedAt,proto3,stdtime" json:"updated_at"`
- // Extensions allow clients to provide zero or more blobs that are directly
- // associated with the container. One may provide protobuf, json, or other
- // encoding formats. The primary use of this is to further decorate the
- // container object with fields that may be specific to a client integration.
- //
- // The key portion of this map should identify a "name" for the extension
- // that should be unique against other extensions. When updating extension
- // data, one should only update the specified extension using field paths
- // to select a specific map key.
- Extensions map[string]types.Any `protobuf:"bytes,10,rep,name=extensions,proto3" json:"extensions" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Container) Reset() { *m = Container{} }
-func (*Container) ProtoMessage() {}
-func (*Container) Descriptor() ([]byte, []int) {
- return fileDescriptor_311afb8e15951042, []int{0}
-}
-func (m *Container) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Container) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_Container.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 *Container) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Container.Merge(m, src)
-}
-func (m *Container) XXX_Size() int {
- return m.Size()
-}
-func (m *Container) XXX_DiscardUnknown() {
- xxx_messageInfo_Container.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Container proto.InternalMessageInfo
-
-type Container_Runtime struct {
- // Name is the name of the runtime.
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- // Options specify additional runtime initialization options.
- Options *types.Any `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Container_Runtime) Reset() { *m = Container_Runtime{} }
-func (*Container_Runtime) ProtoMessage() {}
-func (*Container_Runtime) Descriptor() ([]byte, []int) {
- return fileDescriptor_311afb8e15951042, []int{0, 1}
-}
-func (m *Container_Runtime) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Container_Runtime) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_Container_Runtime.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 *Container_Runtime) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Container_Runtime.Merge(m, src)
-}
-func (m *Container_Runtime) XXX_Size() int {
- return m.Size()
-}
-func (m *Container_Runtime) XXX_DiscardUnknown() {
- xxx_messageInfo_Container_Runtime.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Container_Runtime proto.InternalMessageInfo
-
-type GetContainerRequest struct {
- ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *GetContainerRequest) Reset() { *m = GetContainerRequest{} }
-func (*GetContainerRequest) ProtoMessage() {}
-func (*GetContainerRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_311afb8e15951042, []int{1}
-}
-func (m *GetContainerRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *GetContainerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_GetContainerRequest.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 *GetContainerRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GetContainerRequest.Merge(m, src)
-}
-func (m *GetContainerRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *GetContainerRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_GetContainerRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GetContainerRequest proto.InternalMessageInfo
-
-type GetContainerResponse struct {
- Container Container `protobuf:"bytes,1,opt,name=container,proto3" json:"container"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *GetContainerResponse) Reset() { *m = GetContainerResponse{} }
-func (*GetContainerResponse) ProtoMessage() {}
-func (*GetContainerResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_311afb8e15951042, []int{2}
-}
-func (m *GetContainerResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *GetContainerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_GetContainerResponse.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 *GetContainerResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GetContainerResponse.Merge(m, src)
-}
-func (m *GetContainerResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *GetContainerResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_GetContainerResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GetContainerResponse proto.InternalMessageInfo
-
-type ListContainersRequest struct {
- // Filters contains one or more filters using the syntax defined in the
- // containerd filter package.
- //
- // The returned result will be those that match any of the provided
- // filters. Expanded, containers that match the following will be
- // returned:
- //
- // filters[0] or filters[1] or ... or filters[n-1] or filters[n]
- //
- // If filters is zero-length or nil, all items will be returned.
- Filters []string `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ListContainersRequest) Reset() { *m = ListContainersRequest{} }
-func (*ListContainersRequest) ProtoMessage() {}
-func (*ListContainersRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_311afb8e15951042, []int{3}
-}
-func (m *ListContainersRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ListContainersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ListContainersRequest.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 *ListContainersRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ListContainersRequest.Merge(m, src)
-}
-func (m *ListContainersRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *ListContainersRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_ListContainersRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ListContainersRequest proto.InternalMessageInfo
-
-type ListContainersResponse struct {
- Containers []Container `protobuf:"bytes,1,rep,name=containers,proto3" json:"containers"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ListContainersResponse) Reset() { *m = ListContainersResponse{} }
-func (*ListContainersResponse) ProtoMessage() {}
-func (*ListContainersResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_311afb8e15951042, []int{4}
-}
-func (m *ListContainersResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ListContainersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ListContainersResponse.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 *ListContainersResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ListContainersResponse.Merge(m, src)
-}
-func (m *ListContainersResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *ListContainersResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_ListContainersResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ListContainersResponse proto.InternalMessageInfo
-
-type CreateContainerRequest struct {
- Container Container `protobuf:"bytes,1,opt,name=container,proto3" json:"container"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *CreateContainerRequest) Reset() { *m = CreateContainerRequest{} }
-func (*CreateContainerRequest) ProtoMessage() {}
-func (*CreateContainerRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_311afb8e15951042, []int{5}
-}
-func (m *CreateContainerRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *CreateContainerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_CreateContainerRequest.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 *CreateContainerRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_CreateContainerRequest.Merge(m, src)
-}
-func (m *CreateContainerRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *CreateContainerRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_CreateContainerRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CreateContainerRequest proto.InternalMessageInfo
-
-type CreateContainerResponse struct {
- Container Container `protobuf:"bytes,1,opt,name=container,proto3" json:"container"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *CreateContainerResponse) Reset() { *m = CreateContainerResponse{} }
-func (*CreateContainerResponse) ProtoMessage() {}
-func (*CreateContainerResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_311afb8e15951042, []int{6}
-}
-func (m *CreateContainerResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *CreateContainerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_CreateContainerResponse.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 *CreateContainerResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_CreateContainerResponse.Merge(m, src)
-}
-func (m *CreateContainerResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *CreateContainerResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_CreateContainerResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CreateContainerResponse proto.InternalMessageInfo
-
-// UpdateContainerRequest updates the metadata on one or more container.
-//
-// The operation should follow semantics described in
-// https://developers.google.com/protocol-buffers/docs/reference/csharp/class/google/protobuf/well-known-types/field-mask,
-// unless otherwise qualified.
-type UpdateContainerRequest struct {
- // Container provides the target values, as declared by the mask, for the update.
- //
- // The ID field must be set.
- Container Container `protobuf:"bytes,1,opt,name=container,proto3" json:"container"`
- // UpdateMask specifies which fields to perform the update on. If empty,
- // the operation applies to all fields.
- UpdateMask *types.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *UpdateContainerRequest) Reset() { *m = UpdateContainerRequest{} }
-func (*UpdateContainerRequest) ProtoMessage() {}
-func (*UpdateContainerRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_311afb8e15951042, []int{7}
-}
-func (m *UpdateContainerRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *UpdateContainerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_UpdateContainerRequest.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 *UpdateContainerRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_UpdateContainerRequest.Merge(m, src)
-}
-func (m *UpdateContainerRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *UpdateContainerRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_UpdateContainerRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_UpdateContainerRequest proto.InternalMessageInfo
-
-type UpdateContainerResponse struct {
- Container Container `protobuf:"bytes,1,opt,name=container,proto3" json:"container"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *UpdateContainerResponse) Reset() { *m = UpdateContainerResponse{} }
-func (*UpdateContainerResponse) ProtoMessage() {}
-func (*UpdateContainerResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_311afb8e15951042, []int{8}
-}
-func (m *UpdateContainerResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *UpdateContainerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_UpdateContainerResponse.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 *UpdateContainerResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_UpdateContainerResponse.Merge(m, src)
-}
-func (m *UpdateContainerResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *UpdateContainerResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_UpdateContainerResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_UpdateContainerResponse proto.InternalMessageInfo
-
-type DeleteContainerRequest struct {
- ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *DeleteContainerRequest) Reset() { *m = DeleteContainerRequest{} }
-func (*DeleteContainerRequest) ProtoMessage() {}
-func (*DeleteContainerRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_311afb8e15951042, []int{9}
-}
-func (m *DeleteContainerRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *DeleteContainerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_DeleteContainerRequest.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 *DeleteContainerRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_DeleteContainerRequest.Merge(m, src)
-}
-func (m *DeleteContainerRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *DeleteContainerRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_DeleteContainerRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_DeleteContainerRequest proto.InternalMessageInfo
-
-type ListContainerMessage struct {
- Container *Container `protobuf:"bytes,1,opt,name=container,proto3" json:"container,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ListContainerMessage) Reset() { *m = ListContainerMessage{} }
-func (*ListContainerMessage) ProtoMessage() {}
-func (*ListContainerMessage) Descriptor() ([]byte, []int) {
- return fileDescriptor_311afb8e15951042, []int{10}
-}
-func (m *ListContainerMessage) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ListContainerMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ListContainerMessage.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 *ListContainerMessage) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ListContainerMessage.Merge(m, src)
-}
-func (m *ListContainerMessage) XXX_Size() int {
- return m.Size()
-}
-func (m *ListContainerMessage) XXX_DiscardUnknown() {
- xxx_messageInfo_ListContainerMessage.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ListContainerMessage proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*Container)(nil), "containerd.services.containers.v1.Container")
- proto.RegisterMapType((map[string]types.Any)(nil), "containerd.services.containers.v1.Container.ExtensionsEntry")
- proto.RegisterMapType((map[string]string)(nil), "containerd.services.containers.v1.Container.LabelsEntry")
- proto.RegisterType((*Container_Runtime)(nil), "containerd.services.containers.v1.Container.Runtime")
- proto.RegisterType((*GetContainerRequest)(nil), "containerd.services.containers.v1.GetContainerRequest")
- proto.RegisterType((*GetContainerResponse)(nil), "containerd.services.containers.v1.GetContainerResponse")
- proto.RegisterType((*ListContainersRequest)(nil), "containerd.services.containers.v1.ListContainersRequest")
- proto.RegisterType((*ListContainersResponse)(nil), "containerd.services.containers.v1.ListContainersResponse")
- proto.RegisterType((*CreateContainerRequest)(nil), "containerd.services.containers.v1.CreateContainerRequest")
- proto.RegisterType((*CreateContainerResponse)(nil), "containerd.services.containers.v1.CreateContainerResponse")
- proto.RegisterType((*UpdateContainerRequest)(nil), "containerd.services.containers.v1.UpdateContainerRequest")
- proto.RegisterType((*UpdateContainerResponse)(nil), "containerd.services.containers.v1.UpdateContainerResponse")
- proto.RegisterType((*DeleteContainerRequest)(nil), "containerd.services.containers.v1.DeleteContainerRequest")
- proto.RegisterType((*ListContainerMessage)(nil), "containerd.services.containers.v1.ListContainerMessage")
-}
-
-func init() {
- proto.RegisterFile("github.com/containerd/containerd/api/services/containers/v1/containers.proto", fileDescriptor_311afb8e15951042)
-}
-
-var fileDescriptor_311afb8e15951042 = []byte{
- // 820 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcb, 0x6e, 0x13, 0x49,
- 0x14, 0x75, 0xdb, 0x4e, 0x3b, 0xbe, 0x1e, 0x69, 0x46, 0x35, 0x1e, 0x4f, 0x4f, 0x8f, 0x64, 0x3b,
- 0x5e, 0x59, 0xa3, 0xa1, 0x9d, 0x18, 0x44, 0x5e, 0x6c, 0xe2, 0xbc, 0x04, 0x24, 0x28, 0xea, 0x80,
- 0x84, 0x60, 0x11, 0xda, 0x76, 0xc5, 0x69, 0xdc, 0x2f, 0xba, 0xca, 0x16, 0x16, 0x8b, 0xc0, 0x1f,
- 0xb0, 0xe3, 0x13, 0xf8, 0x95, 0x2c, 0x59, 0xb2, 0x0a, 0xc4, 0xe2, 0x43, 0x50, 0x57, 0x57, 0xbb,
- 0x3b, 0x7e, 0x80, 0x9d, 0x90, 0x5d, 0x5d, 0xd7, 0x3d, 0xf7, 0x9e, 0x3a, 0xb7, 0x4e, 0xb9, 0x61,
- 0xaf, 0xa5, 0xd3, 0x93, 0x4e, 0x5d, 0x69, 0xd8, 0x66, 0xa5, 0x61, 0x5b, 0x54, 0xd3, 0x2d, 0xec,
- 0x36, 0xa3, 0x4b, 0xcd, 0xd1, 0x2b, 0x04, 0xbb, 0x5d, 0xbd, 0x81, 0x49, 0xf8, 0x3b, 0xa9, 0x74,
- 0x97, 0x22, 0x91, 0xe2, 0xb8, 0x36, 0xb5, 0xd1, 0x42, 0x88, 0x53, 0x02, 0x8c, 0x12, 0xc9, 0xea,
- 0x2e, 0xc9, 0xd9, 0x96, 0xdd, 0xb2, 0x59, 0x76, 0xc5, 0x5b, 0xf9, 0x40, 0xf9, 0x9f, 0x96, 0x6d,
- 0xb7, 0x0c, 0x5c, 0x61, 0x51, 0xbd, 0x73, 0x5c, 0xd1, 0xac, 0x1e, 0xdf, 0xfa, 0x77, 0x78, 0x0b,
- 0x9b, 0x0e, 0x0d, 0x36, 0x8b, 0xc3, 0x9b, 0xc7, 0x3a, 0x36, 0x9a, 0x47, 0xa6, 0x46, 0xda, 0x3c,
- 0xa3, 0x30, 0x9c, 0x41, 0x75, 0x13, 0x13, 0xaa, 0x99, 0x8e, 0x9f, 0x50, 0xfa, 0x20, 0x42, 0x7a,
- 0x33, 0xa0, 0x88, 0x72, 0x10, 0xd7, 0x9b, 0x92, 0x50, 0x14, 0xca, 0xe9, 0x9a, 0xd8, 0x3f, 0x2f,
- 0xc4, 0xef, 0x6f, 0xa9, 0x71, 0xbd, 0x89, 0x0e, 0x40, 0x34, 0xb4, 0x3a, 0x36, 0x88, 0x14, 0x2f,
- 0x26, 0xca, 0x99, 0xea, 0x8a, 0xf2, 0xd3, 0xa3, 0x2a, 0x83, 0xaa, 0xca, 0x1e, 0x83, 0x6e, 0x5b,
- 0xd4, 0xed, 0xa9, 0xbc, 0x0e, 0xca, 0xc2, 0x9c, 0x6e, 0x6a, 0x2d, 0x2c, 0x25, 0xbc, 0x66, 0xaa,
- 0x1f, 0xa0, 0x47, 0x90, 0x72, 0x3b, 0x96, 0xc7, 0x51, 0x4a, 0x16, 0x85, 0x72, 0xa6, 0x7a, 0x67,
- 0xa6, 0x46, 0xaa, 0x8f, 0x55, 0x83, 0x22, 0xa8, 0x0c, 0x49, 0xe2, 0xe0, 0x86, 0x34, 0xc7, 0x8a,
- 0x65, 0x15, 0x5f, 0x0d, 0x25, 0x50, 0x43, 0xd9, 0xb0, 0x7a, 0x2a, 0xcb, 0x40, 0x45, 0xc8, 0x10,
- 0x4b, 0x73, 0xc8, 0x89, 0x4d, 0x29, 0x76, 0x25, 0x91, 0xb1, 0x8a, 0xfe, 0x84, 0x16, 0xe0, 0xb7,
- 0x20, 0x3c, 0x6a, 0xe3, 0x9e, 0x94, 0xba, 0x9c, 0xf2, 0x10, 0xf7, 0xd0, 0x26, 0x40, 0xc3, 0xc5,
- 0x1a, 0xc5, 0xcd, 0x23, 0x8d, 0x4a, 0xf3, 0xac, 0xa9, 0x3c, 0xd2, 0xf4, 0x71, 0x30, 0x82, 0xda,
- 0xfc, 0xd9, 0x79, 0x21, 0xf6, 0xfe, 0x4b, 0x41, 0x50, 0xd3, 0x1c, 0xb7, 0x41, 0xbd, 0x22, 0x1d,
- 0xa7, 0x19, 0x14, 0x49, 0xcf, 0x52, 0x84, 0xe3, 0x36, 0x28, 0xaa, 0x03, 0xe0, 0xd7, 0x14, 0x5b,
- 0x44, 0xb7, 0x2d, 0x22, 0x01, 0x1b, 0xda, 0xbd, 0x99, 0xb4, 0xdc, 0x1e, 0xc0, 0xd9, 0xe0, 0x6a,
- 0x49, 0xaf, 0x8d, 0x1a, 0xa9, 0x2a, 0xaf, 0x42, 0x26, 0x32, 0x59, 0xf4, 0x07, 0x24, 0x3c, 0x59,
- 0xd8, 0xe5, 0x51, 0xbd, 0xa5, 0x37, 0xe3, 0xae, 0x66, 0x74, 0xb0, 0x14, 0xf7, 0x67, 0xcc, 0x82,
- 0xb5, 0xf8, 0x8a, 0x20, 0xef, 0x43, 0x8a, 0xcf, 0x0a, 0x21, 0x48, 0x5a, 0x9a, 0x89, 0x39, 0x8e,
- 0xad, 0x91, 0x02, 0x29, 0xdb, 0xa1, 0x8c, 0x7a, 0xfc, 0x07, 0x93, 0x0b, 0x92, 0xe4, 0x43, 0xf8,
- 0x7d, 0x88, 0xee, 0x18, 0x36, 0xff, 0x45, 0xd9, 0x4c, 0x2a, 0x19, 0x72, 0x2c, 0xdd, 0x82, 0x3f,
- 0x77, 0x31, 0x1d, 0x08, 0xa2, 0xe2, 0x57, 0x1d, 0x4c, 0xe8, 0x24, 0x8b, 0x94, 0x4e, 0x20, 0x7b,
- 0x39, 0x9d, 0x38, 0xb6, 0x45, 0x30, 0x3a, 0x80, 0xf4, 0x40, 0x62, 0x06, 0xcb, 0x54, 0xff, 0x9f,
- 0x65, 0x10, 0x5c, 0xf8, 0xb0, 0x48, 0x69, 0x09, 0xfe, 0xda, 0xd3, 0x49, 0xd8, 0x8a, 0x04, 0xd4,
- 0x24, 0x48, 0x1d, 0xeb, 0x06, 0xc5, 0x2e, 0x91, 0x84, 0x62, 0xa2, 0x9c, 0x56, 0x83, 0xb0, 0x64,
- 0x40, 0x6e, 0x18, 0xc2, 0xe9, 0xa9, 0x00, 0x61, 0x63, 0x06, 0xbb, 0x1a, 0xbf, 0x48, 0x95, 0xd2,
- 0x4b, 0xc8, 0x6d, 0xb2, 0xeb, 0x3c, 0x22, 0xde, 0xaf, 0x17, 0xa3, 0x0d, 0x7f, 0x8f, 0xf4, 0xba,
- 0x31, 0xe5, 0x3f, 0x0a, 0x90, 0x7b, 0xc2, 0x3c, 0x76, 0xf3, 0x27, 0x43, 0xeb, 0x90, 0xf1, 0xfd,
- 0xcc, 0xde, 0x73, 0x7e, 0x6b, 0x47, 0x1f, 0x82, 0x1d, 0xef, 0xc9, 0xdf, 0xd7, 0x48, 0x5b, 0xe5,
- 0xcf, 0x86, 0xb7, 0xf6, 0x64, 0x19, 0x21, 0x7a, 0x63, 0xb2, 0x2c, 0x42, 0x6e, 0x0b, 0x1b, 0x78,
- 0x8c, 0x2a, 0x93, 0xcc, 0x52, 0x87, 0xec, 0xa5, 0xfb, 0xb8, 0x8f, 0x09, 0xf1, 0xde, 0xff, 0x07,
- 0xd7, 0xe4, 0x16, 0x61, 0x55, 0xfd, 0x36, 0x07, 0x10, 0x5e, 0x78, 0xd4, 0x85, 0xc4, 0x2e, 0xa6,
- 0xe8, 0xee, 0x14, 0xe5, 0xc6, 0xd8, 0x5e, 0x5e, 0x9e, 0x19, 0xc7, 0xe5, 0x7e, 0x03, 0x49, 0xef,
- 0xa8, 0x68, 0x9a, 0xbf, 0xcc, 0xb1, 0xb6, 0x96, 0x57, 0xaf, 0x80, 0xe4, 0xcd, 0xdf, 0x09, 0x00,
- 0xde, 0xd6, 0x21, 0x75, 0xb1, 0x66, 0x5e, 0x83, 0xc3, 0xf2, 0xac, 0x48, 0x3e, 0xd1, 0x45, 0x01,
- 0x9d, 0x82, 0xe8, 0x3b, 0x14, 0x4d, 0x73, 0x90, 0xf1, 0x0f, 0x87, 0xbc, 0x76, 0x15, 0x28, 0x17,
- 0xe1, 0x14, 0x44, 0xdf, 0x0b, 0x53, 0x11, 0x18, 0xef, 0xef, 0xa9, 0x08, 0x4c, 0x72, 0xdc, 0x73,
- 0x10, 0x7d, 0x7f, 0x4c, 0x45, 0x60, 0xbc, 0x95, 0xe4, 0xdc, 0x88, 0xf3, 0xb7, 0xbd, 0x2f, 0xc1,
- 0xda, 0x8b, 0xb3, 0x8b, 0x7c, 0xec, 0xf3, 0x45, 0x3e, 0xf6, 0xb6, 0x9f, 0x17, 0xce, 0xfa, 0x79,
- 0xe1, 0x53, 0x3f, 0x2f, 0x7c, 0xed, 0xe7, 0x85, 0x67, 0x3b, 0xd7, 0xf8, 0xb8, 0x5d, 0x0f, 0xa3,
- 0xa7, 0xb1, 0xba, 0xc8, 0x7a, 0xde, 0xfe, 0x1e, 0x00, 0x00, 0xff, 0xff, 0xd0, 0xae, 0xca, 0xcb,
- 0x2f, 0x0b, 0x00, 0x00,
-}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ context.Context
-var _ grpc.ClientConn
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion4
-
-// ContainersClient is the client API for Containers service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type ContainersClient interface {
- Get(ctx context.Context, in *GetContainerRequest, opts ...grpc.CallOption) (*GetContainerResponse, error)
- List(ctx context.Context, in *ListContainersRequest, opts ...grpc.CallOption) (*ListContainersResponse, error)
- ListStream(ctx context.Context, in *ListContainersRequest, opts ...grpc.CallOption) (Containers_ListStreamClient, error)
- Create(ctx context.Context, in *CreateContainerRequest, opts ...grpc.CallOption) (*CreateContainerResponse, error)
- Update(ctx context.Context, in *UpdateContainerRequest, opts ...grpc.CallOption) (*UpdateContainerResponse, error)
- Delete(ctx context.Context, in *DeleteContainerRequest, opts ...grpc.CallOption) (*types.Empty, error)
-}
-
-type containersClient struct {
- cc *grpc.ClientConn
-}
-
-func NewContainersClient(cc *grpc.ClientConn) ContainersClient {
- return &containersClient{cc}
-}
-
-func (c *containersClient) Get(ctx context.Context, in *GetContainerRequest, opts ...grpc.CallOption) (*GetContainerResponse, error) {
- out := new(GetContainerResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.containers.v1.Containers/Get", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *containersClient) List(ctx context.Context, in *ListContainersRequest, opts ...grpc.CallOption) (*ListContainersResponse, error) {
- out := new(ListContainersResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.containers.v1.Containers/List", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *containersClient) ListStream(ctx context.Context, in *ListContainersRequest, opts ...grpc.CallOption) (Containers_ListStreamClient, error) {
- stream, err := c.cc.NewStream(ctx, &_Containers_serviceDesc.Streams[0], "/containerd.services.containers.v1.Containers/ListStream", opts...)
- if err != nil {
- return nil, err
- }
- x := &containersListStreamClient{stream}
- if err := x.ClientStream.SendMsg(in); err != nil {
- return nil, err
- }
- if err := x.ClientStream.CloseSend(); err != nil {
- return nil, err
- }
- return x, nil
-}
-
-type Containers_ListStreamClient interface {
- Recv() (*ListContainerMessage, error)
- grpc.ClientStream
-}
-
-type containersListStreamClient struct {
- grpc.ClientStream
-}
-
-func (x *containersListStreamClient) Recv() (*ListContainerMessage, error) {
- m := new(ListContainerMessage)
- if err := x.ClientStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
-}
-
-func (c *containersClient) Create(ctx context.Context, in *CreateContainerRequest, opts ...grpc.CallOption) (*CreateContainerResponse, error) {
- out := new(CreateContainerResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.containers.v1.Containers/Create", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *containersClient) Update(ctx context.Context, in *UpdateContainerRequest, opts ...grpc.CallOption) (*UpdateContainerResponse, error) {
- out := new(UpdateContainerResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.containers.v1.Containers/Update", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *containersClient) Delete(ctx context.Context, in *DeleteContainerRequest, opts ...grpc.CallOption) (*types.Empty, error) {
- out := new(types.Empty)
- err := c.cc.Invoke(ctx, "/containerd.services.containers.v1.Containers/Delete", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// ContainersServer is the server API for Containers service.
-type ContainersServer interface {
- Get(context.Context, *GetContainerRequest) (*GetContainerResponse, error)
- List(context.Context, *ListContainersRequest) (*ListContainersResponse, error)
- ListStream(*ListContainersRequest, Containers_ListStreamServer) error
- Create(context.Context, *CreateContainerRequest) (*CreateContainerResponse, error)
- Update(context.Context, *UpdateContainerRequest) (*UpdateContainerResponse, error)
- Delete(context.Context, *DeleteContainerRequest) (*types.Empty, error)
-}
-
-// UnimplementedContainersServer can be embedded to have forward compatible implementations.
-type UnimplementedContainersServer struct {
-}
-
-func (*UnimplementedContainersServer) Get(ctx context.Context, req *GetContainerRequest) (*GetContainerResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
-}
-func (*UnimplementedContainersServer) List(ctx context.Context, req *ListContainersRequest) (*ListContainersResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
-}
-func (*UnimplementedContainersServer) ListStream(req *ListContainersRequest, srv Containers_ListStreamServer) error {
- return status.Errorf(codes.Unimplemented, "method ListStream not implemented")
-}
-func (*UnimplementedContainersServer) Create(ctx context.Context, req *CreateContainerRequest) (*CreateContainerResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
-}
-func (*UnimplementedContainersServer) Update(ctx context.Context, req *UpdateContainerRequest) (*UpdateContainerResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
-}
-func (*UnimplementedContainersServer) Delete(ctx context.Context, req *DeleteContainerRequest) (*types.Empty, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
-}
-
-func RegisterContainersServer(s *grpc.Server, srv ContainersServer) {
- s.RegisterService(&_Containers_serviceDesc, srv)
-}
-
-func _Containers_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(GetContainerRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ContainersServer).Get(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.containers.v1.Containers/Get",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ContainersServer).Get(ctx, req.(*GetContainerRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Containers_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(ListContainersRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ContainersServer).List(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.containers.v1.Containers/List",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ContainersServer).List(ctx, req.(*ListContainersRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Containers_ListStream_Handler(srv interface{}, stream grpc.ServerStream) error {
- m := new(ListContainersRequest)
- if err := stream.RecvMsg(m); err != nil {
- return err
- }
- return srv.(ContainersServer).ListStream(m, &containersListStreamServer{stream})
-}
-
-type Containers_ListStreamServer interface {
- Send(*ListContainerMessage) error
- grpc.ServerStream
-}
-
-type containersListStreamServer struct {
- grpc.ServerStream
-}
-
-func (x *containersListStreamServer) Send(m *ListContainerMessage) error {
- return x.ServerStream.SendMsg(m)
-}
-
-func _Containers_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(CreateContainerRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ContainersServer).Create(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.containers.v1.Containers/Create",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ContainersServer).Create(ctx, req.(*CreateContainerRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Containers_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(UpdateContainerRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ContainersServer).Update(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.containers.v1.Containers/Update",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ContainersServer).Update(ctx, req.(*UpdateContainerRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Containers_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(DeleteContainerRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ContainersServer).Delete(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.containers.v1.Containers/Delete",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ContainersServer).Delete(ctx, req.(*DeleteContainerRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-var _Containers_serviceDesc = grpc.ServiceDesc{
- ServiceName: "containerd.services.containers.v1.Containers",
- HandlerType: (*ContainersServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "Get",
- Handler: _Containers_Get_Handler,
- },
- {
- MethodName: "List",
- Handler: _Containers_List_Handler,
- },
- {
- MethodName: "Create",
- Handler: _Containers_Create_Handler,
- },
- {
- MethodName: "Update",
- Handler: _Containers_Update_Handler,
- },
- {
- MethodName: "Delete",
- Handler: _Containers_Delete_Handler,
- },
- },
- Streams: []grpc.StreamDesc{
- {
- StreamName: "ListStream",
- Handler: _Containers_ListStream_Handler,
- ServerStreams: true,
- },
- },
- Metadata: "github.com/containerd/containerd/api/services/containers/v1/containers.proto",
-}
-
-func (m *Container) 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 *Container) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *Container) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Extensions) > 0 {
- for k := range m.Extensions {
- v := m.Extensions[k]
- baseI := i
- {
- size, err := (&v).MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintContainers(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x12
- i -= len(k)
- copy(dAtA[i:], k)
- i = encodeVarintContainers(dAtA, i, uint64(len(k)))
- i--
- dAtA[i] = 0xa
- i = encodeVarintContainers(dAtA, i, uint64(baseI-i))
- i--
- dAtA[i] = 0x52
- }
- }
- n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.UpdatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.UpdatedAt):])
- if err2 != nil {
- return 0, err2
- }
- i -= n2
- i = encodeVarintContainers(dAtA, i, uint64(n2))
- i--
- dAtA[i] = 0x4a
- n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt):])
- if err3 != nil {
- return 0, err3
- }
- i -= n3
- i = encodeVarintContainers(dAtA, i, uint64(n3))
- i--
- dAtA[i] = 0x42
- if len(m.SnapshotKey) > 0 {
- i -= len(m.SnapshotKey)
- copy(dAtA[i:], m.SnapshotKey)
- i = encodeVarintContainers(dAtA, i, uint64(len(m.SnapshotKey)))
- i--
- dAtA[i] = 0x3a
- }
- if len(m.Snapshotter) > 0 {
- i -= len(m.Snapshotter)
- copy(dAtA[i:], m.Snapshotter)
- i = encodeVarintContainers(dAtA, i, uint64(len(m.Snapshotter)))
- i--
- dAtA[i] = 0x32
- }
- if m.Spec != nil {
- {
- size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintContainers(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x2a
- }
- if m.Runtime != nil {
- {
- size, err := m.Runtime.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintContainers(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x22
- }
- if len(m.Image) > 0 {
- i -= len(m.Image)
- copy(dAtA[i:], m.Image)
- i = encodeVarintContainers(dAtA, i, uint64(len(m.Image)))
- i--
- dAtA[i] = 0x1a
- }
- if len(m.Labels) > 0 {
- for k := range m.Labels {
- v := m.Labels[k]
- baseI := i
- i -= len(v)
- copy(dAtA[i:], v)
- i = encodeVarintContainers(dAtA, i, uint64(len(v)))
- i--
- dAtA[i] = 0x12
- i -= len(k)
- copy(dAtA[i:], k)
- i = encodeVarintContainers(dAtA, i, uint64(len(k)))
- i--
- dAtA[i] = 0xa
- i = encodeVarintContainers(dAtA, i, uint64(baseI-i))
- i--
- dAtA[i] = 0x12
- }
- }
- if len(m.ID) > 0 {
- i -= len(m.ID)
- copy(dAtA[i:], m.ID)
- i = encodeVarintContainers(dAtA, i, uint64(len(m.ID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *Container_Runtime) 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 *Container_Runtime) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *Container_Runtime) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Options != nil {
- {
- size, err := m.Options.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintContainers(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x12
- }
- if len(m.Name) > 0 {
- i -= len(m.Name)
- copy(dAtA[i:], m.Name)
- i = encodeVarintContainers(dAtA, i, uint64(len(m.Name)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *GetContainerRequest) 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 *GetContainerRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *GetContainerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.ID) > 0 {
- i -= len(m.ID)
- copy(dAtA[i:], m.ID)
- i = encodeVarintContainers(dAtA, i, uint64(len(m.ID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *GetContainerResponse) 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 *GetContainerResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *GetContainerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- {
- size, err := m.Container.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintContainers(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func (m *ListContainersRequest) 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 *ListContainersRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ListContainersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Filters) > 0 {
- for iNdEx := len(m.Filters) - 1; iNdEx >= 0; iNdEx-- {
- i -= len(m.Filters[iNdEx])
- copy(dAtA[i:], m.Filters[iNdEx])
- i = encodeVarintContainers(dAtA, i, uint64(len(m.Filters[iNdEx])))
- i--
- dAtA[i] = 0xa
- }
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ListContainersResponse) 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 *ListContainersResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ListContainersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- 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 = encodeVarintContainers(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- }
- }
- return len(dAtA) - i, nil
-}
-
-func (m *CreateContainerRequest) 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 *CreateContainerRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *CreateContainerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- {
- size, err := m.Container.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintContainers(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func (m *CreateContainerResponse) 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 *CreateContainerResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *CreateContainerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- {
- size, err := m.Container.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintContainers(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func (m *UpdateContainerRequest) 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 *UpdateContainerRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *UpdateContainerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.UpdateMask != nil {
- {
- size, err := m.UpdateMask.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintContainers(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x12
- }
- {
- size, err := m.Container.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintContainers(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func (m *UpdateContainerResponse) 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 *UpdateContainerResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *UpdateContainerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- {
- size, err := m.Container.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintContainers(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func (m *DeleteContainerRequest) 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 *DeleteContainerRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *DeleteContainerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.ID) > 0 {
- i -= len(m.ID)
- copy(dAtA[i:], m.ID)
- i = encodeVarintContainers(dAtA, i, uint64(len(m.ID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ListContainerMessage) 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 *ListContainerMessage) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ListContainerMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Container != nil {
- {
- size, err := m.Container.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintContainers(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func encodeVarintContainers(dAtA []byte, offset int, v uint64) int {
- offset -= sovContainers(v)
- base := offset
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return base
-}
-func (m *Container) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ID)
- if l > 0 {
- n += 1 + l + sovContainers(uint64(l))
- }
- if len(m.Labels) > 0 {
- for k, v := range m.Labels {
- _ = k
- _ = v
- mapEntrySize := 1 + len(k) + sovContainers(uint64(len(k))) + 1 + len(v) + sovContainers(uint64(len(v)))
- n += mapEntrySize + 1 + sovContainers(uint64(mapEntrySize))
- }
- }
- l = len(m.Image)
- if l > 0 {
- n += 1 + l + sovContainers(uint64(l))
- }
- if m.Runtime != nil {
- l = m.Runtime.Size()
- n += 1 + l + sovContainers(uint64(l))
- }
- if m.Spec != nil {
- l = m.Spec.Size()
- n += 1 + l + sovContainers(uint64(l))
- }
- l = len(m.Snapshotter)
- if l > 0 {
- n += 1 + l + sovContainers(uint64(l))
- }
- l = len(m.SnapshotKey)
- if l > 0 {
- n += 1 + l + sovContainers(uint64(l))
- }
- l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt)
- n += 1 + l + sovContainers(uint64(l))
- l = github_com_gogo_protobuf_types.SizeOfStdTime(m.UpdatedAt)
- n += 1 + l + sovContainers(uint64(l))
- if len(m.Extensions) > 0 {
- for k, v := range m.Extensions {
- _ = k
- _ = v
- l = v.Size()
- mapEntrySize := 1 + len(k) + sovContainers(uint64(len(k))) + 1 + l + sovContainers(uint64(l))
- n += mapEntrySize + 1 + sovContainers(uint64(mapEntrySize))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *Container_Runtime) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Name)
- if l > 0 {
- n += 1 + l + sovContainers(uint64(l))
- }
- if m.Options != nil {
- l = m.Options.Size()
- n += 1 + l + sovContainers(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *GetContainerRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ID)
- if l > 0 {
- n += 1 + l + sovContainers(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *GetContainerResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = m.Container.Size()
- n += 1 + l + sovContainers(uint64(l))
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ListContainersRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.Filters) > 0 {
- for _, s := range m.Filters {
- l = len(s)
- n += 1 + l + sovContainers(uint64(l))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ListContainersResponse) 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 + sovContainers(uint64(l))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *CreateContainerRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = m.Container.Size()
- n += 1 + l + sovContainers(uint64(l))
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *CreateContainerResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = m.Container.Size()
- n += 1 + l + sovContainers(uint64(l))
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *UpdateContainerRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = m.Container.Size()
- n += 1 + l + sovContainers(uint64(l))
- if m.UpdateMask != nil {
- l = m.UpdateMask.Size()
- n += 1 + l + sovContainers(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *UpdateContainerResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = m.Container.Size()
- n += 1 + l + sovContainers(uint64(l))
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *DeleteContainerRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ID)
- if l > 0 {
- n += 1 + l + sovContainers(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ListContainerMessage) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Container != nil {
- l = m.Container.Size()
- n += 1 + l + sovContainers(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func sovContainers(x uint64) (n int) {
- return (math_bits.Len64(x|1) + 6) / 7
-}
-func sozContainers(x uint64) (n int) {
- return sovContainers(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-func (this *Container) 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 += "}"
- keysForExtensions := make([]string, 0, len(this.Extensions))
- for k, _ := range this.Extensions {
- keysForExtensions = append(keysForExtensions, k)
- }
- github_com_gogo_protobuf_sortkeys.Strings(keysForExtensions)
- mapStringForExtensions := "map[string]types.Any{"
- for _, k := range keysForExtensions {
- mapStringForExtensions += fmt.Sprintf("%v: %v,", k, this.Extensions[k])
- }
- mapStringForExtensions += "}"
- s := strings.Join([]string{`&Container{`,
- `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
- `Labels:` + mapStringForLabels + `,`,
- `Image:` + fmt.Sprintf("%v", this.Image) + `,`,
- `Runtime:` + strings.Replace(fmt.Sprintf("%v", this.Runtime), "Container_Runtime", "Container_Runtime", 1) + `,`,
- `Spec:` + strings.Replace(fmt.Sprintf("%v", this.Spec), "Any", "types.Any", 1) + `,`,
- `Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`,
- `SnapshotKey:` + fmt.Sprintf("%v", this.SnapshotKey) + `,`,
- `CreatedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.CreatedAt), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`,
- `UpdatedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.UpdatedAt), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`,
- `Extensions:` + mapStringForExtensions + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *Container_Runtime) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&Container_Runtime{`,
- `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
- `Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "Any", "types.Any", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *GetContainerRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&GetContainerRequest{`,
- `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *GetContainerResponse) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&GetContainerResponse{`,
- `Container:` + strings.Replace(strings.Replace(this.Container.String(), "Container", "Container", 1), `&`, ``, 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ListContainersRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ListContainersRequest{`,
- `Filters:` + fmt.Sprintf("%v", this.Filters) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ListContainersResponse) String() string {
- if this == nil {
- return "nil"
- }
- repeatedStringForContainers := "[]Container{"
- for _, f := range this.Containers {
- repeatedStringForContainers += strings.Replace(strings.Replace(f.String(), "Container", "Container", 1), `&`, ``, 1) + ","
- }
- repeatedStringForContainers += "}"
- s := strings.Join([]string{`&ListContainersResponse{`,
- `Containers:` + repeatedStringForContainers + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *CreateContainerRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&CreateContainerRequest{`,
- `Container:` + strings.Replace(strings.Replace(this.Container.String(), "Container", "Container", 1), `&`, ``, 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *CreateContainerResponse) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&CreateContainerResponse{`,
- `Container:` + strings.Replace(strings.Replace(this.Container.String(), "Container", "Container", 1), `&`, ``, 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *UpdateContainerRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&UpdateContainerRequest{`,
- `Container:` + strings.Replace(strings.Replace(this.Container.String(), "Container", "Container", 1), `&`, ``, 1) + `,`,
- `UpdateMask:` + strings.Replace(fmt.Sprintf("%v", this.UpdateMask), "FieldMask", "types.FieldMask", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *UpdateContainerResponse) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&UpdateContainerResponse{`,
- `Container:` + strings.Replace(strings.Replace(this.Container.String(), "Container", "Container", 1), `&`, ``, 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *DeleteContainerRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&DeleteContainerRequest{`,
- `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ListContainerMessage) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ListContainerMessage{`,
- `Container:` + strings.Replace(this.Container.String(), "Container", "Container", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func valueToStringContainers(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
-}
-func (m *Container) 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 ErrIntOverflowContainers
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: Container: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: Container: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainers
- }
- 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 ErrInvalidLengthContainers
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthContainers
- }
- 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 Labels", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainers
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContainers
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContainers
- }
- 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 ErrIntOverflowContainers
- }
- 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 ErrIntOverflowContainers
- }
- 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 ErrInvalidLengthContainers
- }
- postStringIndexmapkey := iNdEx + intStringLenmapkey
- if postStringIndexmapkey < 0 {
- return ErrInvalidLengthContainers
- }
- 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 ErrIntOverflowContainers
- }
- 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 ErrInvalidLengthContainers
- }
- postStringIndexmapvalue := iNdEx + intStringLenmapvalue
- if postStringIndexmapvalue < 0 {
- return ErrInvalidLengthContainers
- }
- if postStringIndexmapvalue > l {
- return io.ErrUnexpectedEOF
- }
- mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
- iNdEx = postStringIndexmapvalue
- } else {
- iNdEx = entryPreIndex
- skippy, err := skipContainers(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContainers
- }
- if (iNdEx + skippy) > postIndex {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- m.Labels[mapkey] = mapvalue
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainers
- }
- 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 ErrInvalidLengthContainers
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthContainers
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Image = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 4:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Runtime", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainers
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContainers
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContainers
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Runtime == nil {
- m.Runtime = &Container_Runtime{}
- }
- if err := m.Runtime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 5:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainers
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContainers
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContainers
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Spec == nil {
- m.Spec = &types.Any{}
- }
- if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 6:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainers
- }
- 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 ErrInvalidLengthContainers
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthContainers
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Snapshotter = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 7:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field SnapshotKey", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainers
- }
- 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 ErrInvalidLengthContainers
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthContainers
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.SnapshotKey = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 8:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainers
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContainers
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContainers
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CreatedAt, dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 9:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field UpdatedAt", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainers
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContainers
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContainers
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.UpdatedAt, dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 10:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Extensions", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainers
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContainers
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContainers
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Extensions == nil {
- m.Extensions = make(map[string]types.Any)
- }
- var mapkey string
- mapvalue := &types.Any{}
- for iNdEx < postIndex {
- entryPreIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainers
- }
- 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 ErrIntOverflowContainers
- }
- 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 ErrInvalidLengthContainers
- }
- postStringIndexmapkey := iNdEx + intStringLenmapkey
- if postStringIndexmapkey < 0 {
- return ErrInvalidLengthContainers
- }
- if postStringIndexmapkey > l {
- return io.ErrUnexpectedEOF
- }
- mapkey = string(dAtA[iNdEx:postStringIndexmapkey])
- iNdEx = postStringIndexmapkey
- } else if fieldNum == 2 {
- var mapmsglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainers
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- mapmsglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if mapmsglen < 0 {
- return ErrInvalidLengthContainers
- }
- postmsgIndex := iNdEx + mapmsglen
- if postmsgIndex < 0 {
- return ErrInvalidLengthContainers
- }
- if postmsgIndex > l {
- return io.ErrUnexpectedEOF
- }
- mapvalue = &types.Any{}
- if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil {
- return err
- }
- iNdEx = postmsgIndex
- } else {
- iNdEx = entryPreIndex
- skippy, err := skipContainers(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContainers
- }
- if (iNdEx + skippy) > postIndex {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- m.Extensions[mapkey] = *mapvalue
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContainers(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContainers
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContainers
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *Container_Runtime) 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 ErrIntOverflowContainers
- }
- 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: Runtime: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: Runtime: 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 ErrIntOverflowContainers
- }
- 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 ErrInvalidLengthContainers
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthContainers
- }
- 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 Options", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainers
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContainers
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContainers
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Options == nil {
- m.Options = &types.Any{}
- }
- if err := m.Options.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContainers(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContainers
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContainers
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *GetContainerRequest) 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 ErrIntOverflowContainers
- }
- 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: GetContainerRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: GetContainerRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainers
- }
- 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 ErrInvalidLengthContainers
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthContainers
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContainers(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContainers
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContainers
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *GetContainerResponse) 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 ErrIntOverflowContainers
- }
- 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: GetContainerResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: GetContainerResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainers
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContainers
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContainers
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.Container.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContainers(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContainers
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContainers
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ListContainersRequest) 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 ErrIntOverflowContainers
- }
- 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: ListContainersRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ListContainersRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainers
- }
- 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 ErrInvalidLengthContainers
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthContainers
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Filters = append(m.Filters, string(dAtA[iNdEx:postIndex]))
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContainers(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContainers
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContainers
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ListContainersResponse) 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 ErrIntOverflowContainers
- }
- 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: ListContainersResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ListContainersResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- 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 ErrIntOverflowContainers
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContainers
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContainers
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Containers = append(m.Containers, Container{})
- if err := m.Containers[len(m.Containers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContainers(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContainers
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContainers
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *CreateContainerRequest) 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 ErrIntOverflowContainers
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: CreateContainerRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: CreateContainerRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainers
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContainers
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContainers
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.Container.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContainers(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContainers
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContainers
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *CreateContainerResponse) 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 ErrIntOverflowContainers
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: CreateContainerResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: CreateContainerResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainers
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContainers
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContainers
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.Container.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContainers(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContainers
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContainers
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *UpdateContainerRequest) 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 ErrIntOverflowContainers
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: UpdateContainerRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: UpdateContainerRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainers
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContainers
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContainers
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.Container.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field UpdateMask", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainers
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContainers
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContainers
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.UpdateMask == nil {
- m.UpdateMask = &types.FieldMask{}
- }
- if err := m.UpdateMask.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContainers(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContainers
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContainers
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *UpdateContainerResponse) 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 ErrIntOverflowContainers
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= uint64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- fieldNum := int32(wire >> 3)
- wireType := int(wire & 0x7)
- if wireType == 4 {
- return fmt.Errorf("proto: UpdateContainerResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: UpdateContainerResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainers
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContainers
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContainers
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.Container.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContainers(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContainers
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContainers
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *DeleteContainerRequest) 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 ErrIntOverflowContainers
- }
- 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: DeleteContainerRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: DeleteContainerRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainers
- }
- 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 ErrInvalidLengthContainers
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthContainers
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContainers(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContainers
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContainers
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ListContainerMessage) 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 ErrIntOverflowContainers
- }
- 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: ListContainerMessage: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ListContainerMessage: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContainers
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContainers
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContainers
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Container == nil {
- m.Container = &Container{}
- }
- if err := m.Container.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContainers(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContainers
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContainers
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func skipContainers(dAtA []byte) (n int, err error) {
- l := len(dAtA)
- iNdEx := 0
- depth := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowContainers
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowContainers
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if dAtA[iNdEx-1] < 0x80 {
- break
- }
- }
- case 1:
- iNdEx += 8
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowContainers
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if length < 0 {
- return 0, ErrInvalidLengthContainers
- }
- iNdEx += length
- case 3:
- depth++
- case 4:
- if depth == 0 {
- return 0, ErrUnexpectedEndOfGroupContainers
- }
- depth--
- case 5:
- iNdEx += 4
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- if iNdEx < 0 {
- return 0, ErrInvalidLengthContainers
- }
- if depth == 0 {
- return iNdEx, nil
- }
- }
- return 0, io.ErrUnexpectedEOF
-}
-
-var (
- ErrInvalidLengthContainers = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowContainers = fmt.Errorf("proto: integer overflow")
- ErrUnexpectedEndOfGroupContainers = fmt.Errorf("proto: unexpected end of group")
-)
diff --git a/vendor/github.com/containerd/containerd/api/services/containers/v1/containers.proto b/vendor/github.com/containerd/containerd/api/services/containers/v1/containers.proto
deleted file mode 100644
index d491f46cf..000000000
--- a/vendor/github.com/containerd/containerd/api/services/containers/v1/containers.proto
+++ /dev/null
@@ -1,163 +0,0 @@
-syntax = "proto3";
-
-package containerd.services.containers.v1;
-
-import weak "gogoproto/gogo.proto";
-import "google/protobuf/any.proto";
-import "google/protobuf/empty.proto";
-import "google/protobuf/field_mask.proto";
-import "google/protobuf/timestamp.proto";
-
-option go_package = "github.com/containerd/containerd/api/services/containers/v1;containers";
-
-// Containers provides metadata storage for containers used in the execution
-// service.
-//
-// The objects here provide an state-independent view of containers for use in
-// management and resource pinning. From that perspective, containers do not
-// have a "state" but rather this is the set of resources that will be
-// considered in use by the container.
-//
-// From the perspective of the execution service, these objects represent the
-// base parameters for creating a container process.
-//
-// In general, when looking to add fields for this type, first ask yourself
-// whether or not the function of the field has to do with runtime execution or
-// is invariant of the runtime state of the container. If it has to do with
-// runtime, or changes as the "container" is started and stops, it probably
-// doesn't belong on this object.
-service Containers {
- rpc Get(GetContainerRequest) returns (GetContainerResponse);
- rpc List(ListContainersRequest) returns (ListContainersResponse);
- rpc ListStream(ListContainersRequest) returns (stream ListContainerMessage);
- rpc Create(CreateContainerRequest) returns (CreateContainerResponse);
- rpc Update(UpdateContainerRequest) returns (UpdateContainerResponse);
- rpc Delete(DeleteContainerRequest) returns (google.protobuf.Empty);
-}
-
-message Container {
- // ID is the user-specified identifier.
- //
- // This field may not be updated.
- string id = 1;
-
- // Labels provides an area to include arbitrary data on containers.
- //
- // The combined size of a key/value pair cannot exceed 4096 bytes.
- //
- // Note that to add a new value to this field, read the existing set and
- // include the entire result in the update call.
- map labels = 2;
-
- // Image contains the reference of the image used to build the
- // specification and snapshots for running this container.
- //
- // If this field is updated, the spec and rootfs needed to updated, as well.
- string image = 3;
-
- message Runtime {
- // Name is the name of the runtime.
- string name = 1;
- // Options specify additional runtime initialization options.
- google.protobuf.Any options = 2;
- }
- // Runtime specifies which runtime to use for executing this container.
- Runtime runtime = 4;
-
- // Spec to be used when creating the container. This is runtime specific.
- google.protobuf.Any spec = 5;
-
- // Snapshotter specifies the snapshotter name used for rootfs
- string snapshotter = 6;
-
- // SnapshotKey specifies the snapshot key to use for the container's root
- // filesystem. When starting a task from this container, a caller should
- // look up the mounts from the snapshot service and include those on the
- // task create request.
- //
- // Snapshots referenced in this field will not be garbage collected.
- //
- // This field is set to empty when the rootfs is not a snapshot.
- //
- // This field may be updated.
- string snapshot_key = 7;
-
- // CreatedAt is the time the container was first created.
- google.protobuf.Timestamp created_at = 8 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
-
- // UpdatedAt is the last time the container was mutated.
- google.protobuf.Timestamp updated_at = 9 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
-
- // Extensions allow clients to provide zero or more blobs that are directly
- // associated with the container. One may provide protobuf, json, or other
- // encoding formats. The primary use of this is to further decorate the
- // container object with fields that may be specific to a client integration.
- //
- // The key portion of this map should identify a "name" for the extension
- // that should be unique against other extensions. When updating extension
- // data, one should only update the specified extension using field paths
- // to select a specific map key.
- map extensions = 10 [(gogoproto.nullable) = false];
-}
-
-message GetContainerRequest {
- string id = 1;
-}
-
-message GetContainerResponse {
- Container container = 1 [(gogoproto.nullable) = false];
-}
-
-message ListContainersRequest {
- // Filters contains one or more filters using the syntax defined in the
- // containerd filter package.
- //
- // The returned result will be those that match any of the provided
- // filters. Expanded, containers that match the following will be
- // returned:
- //
- // filters[0] or filters[1] or ... or filters[n-1] or filters[n]
- //
- // If filters is zero-length or nil, all items will be returned.
- repeated string filters = 1;
-}
-
-message ListContainersResponse {
- repeated Container containers = 1 [(gogoproto.nullable) = false];
-}
-
-message CreateContainerRequest {
- Container container = 1 [(gogoproto.nullable) = false];
-}
-
-message CreateContainerResponse {
- Container container = 1 [(gogoproto.nullable) = false];
-}
-
-// UpdateContainerRequest updates the metadata on one or more container.
-//
-// The operation should follow semantics described in
-// https://developers.google.com/protocol-buffers/docs/reference/csharp/class/google/protobuf/well-known-types/field-mask,
-// unless otherwise qualified.
-message UpdateContainerRequest {
- // Container provides the target values, as declared by the mask, for the update.
- //
- // The ID field must be set.
- Container container = 1 [(gogoproto.nullable) = false];
-
- // UpdateMask specifies which fields to perform the update on. If empty,
- // the operation applies to all fields.
- google.protobuf.FieldMask update_mask = 2;
-}
-
-message UpdateContainerResponse {
- Container container = 1 [(gogoproto.nullable) = false];
-}
-
-message DeleteContainerRequest {
- string id = 1;
-}
-
-message ListContainerMessage {
- Container container = 1;
-}
diff --git a/vendor/github.com/containerd/containerd/api/services/content/v1/content.pb.go b/vendor/github.com/containerd/containerd/api/services/content/v1/content.pb.go
deleted file mode 100644
index 1cf0aaa91..000000000
--- a/vendor/github.com/containerd/containerd/api/services/content/v1/content.pb.go
+++ /dev/null
@@ -1,5479 +0,0 @@
-// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: github.com/containerd/containerd/api/services/content/v1/content.proto
-
-package content
-
-import (
- context "context"
- fmt "fmt"
- proto "github.com/gogo/protobuf/proto"
- github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
- github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
- types "github.com/gogo/protobuf/types"
- github_com_opencontainers_go_digest "github.com/opencontainers/go-digest"
- grpc "google.golang.org/grpc"
- codes "google.golang.org/grpc/codes"
- status "google.golang.org/grpc/status"
- io "io"
- math "math"
- math_bits "math/bits"
- reflect "reflect"
- strings "strings"
- time "time"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-var _ = time.Kitchen
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
-
-// WriteAction defines the behavior of a WriteRequest.
-type WriteAction int32
-
-const (
- // WriteActionStat instructs the writer to return the current status while
- // holding the lock on the write.
- WriteActionStat WriteAction = 0
- // WriteActionWrite sets the action for the write request to write data.
- //
- // Any data included will be written at the provided offset. The
- // transaction will be left open for further writes.
- //
- // This is the default.
- WriteActionWrite WriteAction = 1
- // WriteActionCommit will write any outstanding data in the message and
- // commit the write, storing it under the digest.
- //
- // This can be used in a single message to send the data, verify it and
- // commit it.
- //
- // This action will always terminate the write.
- WriteActionCommit WriteAction = 2
-)
-
-var WriteAction_name = map[int32]string{
- 0: "STAT",
- 1: "WRITE",
- 2: "COMMIT",
-}
-
-var WriteAction_value = map[string]int32{
- "STAT": 0,
- "WRITE": 1,
- "COMMIT": 2,
-}
-
-func (x WriteAction) String() string {
- return proto.EnumName(WriteAction_name, int32(x))
-}
-
-func (WriteAction) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_468430ba3e400391, []int{0}
-}
-
-type Info struct {
- // Digest is the hash identity of the blob.
- Digest github_com_opencontainers_go_digest.Digest `protobuf:"bytes,1,opt,name=digest,proto3,customtype=github.com/opencontainers/go-digest.Digest" json:"digest"`
- // Size is the total number of bytes in the blob.
- Size_ int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
- // CreatedAt provides the time at which the blob was committed.
- CreatedAt time.Time `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at"`
- // UpdatedAt provides the time the info was last updated.
- UpdatedAt time.Time `protobuf:"bytes,4,opt,name=updated_at,json=updatedAt,proto3,stdtime" json:"updated_at"`
- // Labels are arbitrary data on snapshots.
- //
- // The combined size of a key/value pair cannot exceed 4096 bytes.
- Labels map[string]string `protobuf:"bytes,5,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Info) Reset() { *m = Info{} }
-func (*Info) ProtoMessage() {}
-func (*Info) Descriptor() ([]byte, []int) {
- return fileDescriptor_468430ba3e400391, []int{0}
-}
-func (m *Info) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Info) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_Info.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 *Info) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Info.Merge(m, src)
-}
-func (m *Info) XXX_Size() int {
- return m.Size()
-}
-func (m *Info) XXX_DiscardUnknown() {
- xxx_messageInfo_Info.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Info proto.InternalMessageInfo
-
-type InfoRequest struct {
- Digest github_com_opencontainers_go_digest.Digest `protobuf:"bytes,1,opt,name=digest,proto3,customtype=github.com/opencontainers/go-digest.Digest" json:"digest"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *InfoRequest) Reset() { *m = InfoRequest{} }
-func (*InfoRequest) ProtoMessage() {}
-func (*InfoRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_468430ba3e400391, []int{1}
-}
-func (m *InfoRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *InfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_InfoRequest.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 *InfoRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_InfoRequest.Merge(m, src)
-}
-func (m *InfoRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *InfoRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_InfoRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_InfoRequest proto.InternalMessageInfo
-
-type InfoResponse struct {
- Info Info `protobuf:"bytes,1,opt,name=info,proto3" json:"info"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *InfoResponse) Reset() { *m = InfoResponse{} }
-func (*InfoResponse) ProtoMessage() {}
-func (*InfoResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_468430ba3e400391, []int{2}
-}
-func (m *InfoResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *InfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_InfoResponse.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 *InfoResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_InfoResponse.Merge(m, src)
-}
-func (m *InfoResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *InfoResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_InfoResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_InfoResponse proto.InternalMessageInfo
-
-type UpdateRequest struct {
- Info Info `protobuf:"bytes,1,opt,name=info,proto3" json:"info"`
- // UpdateMask specifies which fields to perform the update on. If empty,
- // the operation applies to all fields.
- //
- // In info, Digest, Size, and CreatedAt are immutable,
- // other field may be updated using this mask.
- // If no mask is provided, all mutable field are updated.
- UpdateMask *types.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *UpdateRequest) Reset() { *m = UpdateRequest{} }
-func (*UpdateRequest) ProtoMessage() {}
-func (*UpdateRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_468430ba3e400391, []int{3}
-}
-func (m *UpdateRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *UpdateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_UpdateRequest.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 *UpdateRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_UpdateRequest.Merge(m, src)
-}
-func (m *UpdateRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *UpdateRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_UpdateRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_UpdateRequest proto.InternalMessageInfo
-
-type UpdateResponse struct {
- Info Info `protobuf:"bytes,1,opt,name=info,proto3" json:"info"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *UpdateResponse) Reset() { *m = UpdateResponse{} }
-func (*UpdateResponse) ProtoMessage() {}
-func (*UpdateResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_468430ba3e400391, []int{4}
-}
-func (m *UpdateResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *UpdateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_UpdateResponse.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 *UpdateResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_UpdateResponse.Merge(m, src)
-}
-func (m *UpdateResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *UpdateResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_UpdateResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_UpdateResponse proto.InternalMessageInfo
-
-type ListContentRequest struct {
- // Filters contains one or more filters using the syntax defined in the
- // containerd filter package.
- //
- // The returned result will be those that match any of the provided
- // filters. Expanded, containers that match the following will be
- // returned:
- //
- // filters[0] or filters[1] or ... or filters[n-1] or filters[n]
- //
- // If filters is zero-length or nil, all items will be returned.
- Filters []string `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ListContentRequest) Reset() { *m = ListContentRequest{} }
-func (*ListContentRequest) ProtoMessage() {}
-func (*ListContentRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_468430ba3e400391, []int{5}
-}
-func (m *ListContentRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ListContentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ListContentRequest.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 *ListContentRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ListContentRequest.Merge(m, src)
-}
-func (m *ListContentRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *ListContentRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_ListContentRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ListContentRequest proto.InternalMessageInfo
-
-type ListContentResponse struct {
- Info []Info `protobuf:"bytes,1,rep,name=info,proto3" json:"info"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ListContentResponse) Reset() { *m = ListContentResponse{} }
-func (*ListContentResponse) ProtoMessage() {}
-func (*ListContentResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_468430ba3e400391, []int{6}
-}
-func (m *ListContentResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ListContentResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ListContentResponse.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 *ListContentResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ListContentResponse.Merge(m, src)
-}
-func (m *ListContentResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *ListContentResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_ListContentResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ListContentResponse proto.InternalMessageInfo
-
-type DeleteContentRequest struct {
- // Digest specifies which content to delete.
- Digest github_com_opencontainers_go_digest.Digest `protobuf:"bytes,1,opt,name=digest,proto3,customtype=github.com/opencontainers/go-digest.Digest" json:"digest"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *DeleteContentRequest) Reset() { *m = DeleteContentRequest{} }
-func (*DeleteContentRequest) ProtoMessage() {}
-func (*DeleteContentRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_468430ba3e400391, []int{7}
-}
-func (m *DeleteContentRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *DeleteContentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_DeleteContentRequest.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 *DeleteContentRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_DeleteContentRequest.Merge(m, src)
-}
-func (m *DeleteContentRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *DeleteContentRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_DeleteContentRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_DeleteContentRequest proto.InternalMessageInfo
-
-// ReadContentRequest defines the fields that make up a request to read a portion of
-// data from a stored object.
-type ReadContentRequest struct {
- // Digest is the hash identity to read.
- Digest github_com_opencontainers_go_digest.Digest `protobuf:"bytes,1,opt,name=digest,proto3,customtype=github.com/opencontainers/go-digest.Digest" json:"digest"`
- // Offset specifies the number of bytes from the start at which to begin
- // the read. If zero or less, the read will be from the start. This uses
- // standard zero-indexed semantics.
- Offset int64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
- // size is the total size of the read. If zero, the entire blob will be
- // returned by the service.
- Size_ int64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ReadContentRequest) Reset() { *m = ReadContentRequest{} }
-func (*ReadContentRequest) ProtoMessage() {}
-func (*ReadContentRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_468430ba3e400391, []int{8}
-}
-func (m *ReadContentRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ReadContentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ReadContentRequest.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 *ReadContentRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ReadContentRequest.Merge(m, src)
-}
-func (m *ReadContentRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *ReadContentRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_ReadContentRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ReadContentRequest proto.InternalMessageInfo
-
-// ReadContentResponse carries byte data for a read request.
-type ReadContentResponse struct {
- Offset int64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"`
- Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ReadContentResponse) Reset() { *m = ReadContentResponse{} }
-func (*ReadContentResponse) ProtoMessage() {}
-func (*ReadContentResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_468430ba3e400391, []int{9}
-}
-func (m *ReadContentResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ReadContentResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ReadContentResponse.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 *ReadContentResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ReadContentResponse.Merge(m, src)
-}
-func (m *ReadContentResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *ReadContentResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_ReadContentResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ReadContentResponse proto.InternalMessageInfo
-
-type Status struct {
- StartedAt time.Time `protobuf:"bytes,1,opt,name=started_at,json=startedAt,proto3,stdtime" json:"started_at"`
- UpdatedAt time.Time `protobuf:"bytes,2,opt,name=updated_at,json=updatedAt,proto3,stdtime" json:"updated_at"`
- Ref string `protobuf:"bytes,3,opt,name=ref,proto3" json:"ref,omitempty"`
- Offset int64 `protobuf:"varint,4,opt,name=offset,proto3" json:"offset,omitempty"`
- Total int64 `protobuf:"varint,5,opt,name=total,proto3" json:"total,omitempty"`
- Expected github_com_opencontainers_go_digest.Digest `protobuf:"bytes,6,opt,name=expected,proto3,customtype=github.com/opencontainers/go-digest.Digest" json:"expected"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Status) Reset() { *m = Status{} }
-func (*Status) ProtoMessage() {}
-func (*Status) Descriptor() ([]byte, []int) {
- return fileDescriptor_468430ba3e400391, []int{10}
-}
-func (m *Status) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Status) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_Status.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 *Status) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Status.Merge(m, src)
-}
-func (m *Status) XXX_Size() int {
- return m.Size()
-}
-func (m *Status) XXX_DiscardUnknown() {
- xxx_messageInfo_Status.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Status proto.InternalMessageInfo
-
-type StatusRequest struct {
- Ref string `protobuf:"bytes,1,opt,name=ref,proto3" json:"ref,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *StatusRequest) Reset() { *m = StatusRequest{} }
-func (*StatusRequest) ProtoMessage() {}
-func (*StatusRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_468430ba3e400391, []int{11}
-}
-func (m *StatusRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *StatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_StatusRequest.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 *StatusRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_StatusRequest.Merge(m, src)
-}
-func (m *StatusRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *StatusRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_StatusRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_StatusRequest proto.InternalMessageInfo
-
-type StatusResponse struct {
- Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *StatusResponse) Reset() { *m = StatusResponse{} }
-func (*StatusResponse) ProtoMessage() {}
-func (*StatusResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_468430ba3e400391, []int{12}
-}
-func (m *StatusResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *StatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_StatusResponse.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 *StatusResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_StatusResponse.Merge(m, src)
-}
-func (m *StatusResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *StatusResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_StatusResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_StatusResponse proto.InternalMessageInfo
-
-type ListStatusesRequest struct {
- Filters []string `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ListStatusesRequest) Reset() { *m = ListStatusesRequest{} }
-func (*ListStatusesRequest) ProtoMessage() {}
-func (*ListStatusesRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_468430ba3e400391, []int{13}
-}
-func (m *ListStatusesRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ListStatusesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ListStatusesRequest.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 *ListStatusesRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ListStatusesRequest.Merge(m, src)
-}
-func (m *ListStatusesRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *ListStatusesRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_ListStatusesRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ListStatusesRequest proto.InternalMessageInfo
-
-type ListStatusesResponse struct {
- Statuses []Status `protobuf:"bytes,1,rep,name=statuses,proto3" json:"statuses"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ListStatusesResponse) Reset() { *m = ListStatusesResponse{} }
-func (*ListStatusesResponse) ProtoMessage() {}
-func (*ListStatusesResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_468430ba3e400391, []int{14}
-}
-func (m *ListStatusesResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ListStatusesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ListStatusesResponse.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 *ListStatusesResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ListStatusesResponse.Merge(m, src)
-}
-func (m *ListStatusesResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *ListStatusesResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_ListStatusesResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ListStatusesResponse proto.InternalMessageInfo
-
-// WriteContentRequest writes data to the request ref at offset.
-type WriteContentRequest struct {
- // Action sets the behavior of the write.
- //
- // When this is a write and the ref is not yet allocated, the ref will be
- // allocated and the data will be written at offset.
- //
- // If the action is write and the ref is allocated, it will accept data to
- // an offset that has not yet been written.
- //
- // If the action is write and there is no data, the current write status
- // will be returned. This works differently from status because the stream
- // holds a lock.
- Action WriteAction `protobuf:"varint,1,opt,name=action,proto3,enum=containerd.services.content.v1.WriteAction" json:"action,omitempty"`
- // Ref identifies the pre-commit object to write to.
- Ref string `protobuf:"bytes,2,opt,name=ref,proto3" json:"ref,omitempty"`
- // Total can be set to have the service validate the total size of the
- // committed content.
- //
- // The latest value before or with the commit action message will be use to
- // validate the content. If the offset overflows total, the service may
- // report an error. It is only required on one message for the write.
- //
- // If the value is zero or less, no validation of the final content will be
- // performed.
- Total int64 `protobuf:"varint,3,opt,name=total,proto3" json:"total,omitempty"`
- // Expected can be set to have the service validate the final content against
- // the provided digest.
- //
- // If the digest is already present in the object store, an AlreadyExists
- // error will be returned.
- //
- // Only the latest version will be used to check the content against the
- // digest. It is only required to include it on a single message, before or
- // with the commit action message.
- Expected github_com_opencontainers_go_digest.Digest `protobuf:"bytes,4,opt,name=expected,proto3,customtype=github.com/opencontainers/go-digest.Digest" json:"expected"`
- // Offset specifies the number of bytes from the start at which to begin
- // the write. For most implementations, this means from the start of the
- // file. This uses standard, zero-indexed semantics.
- //
- // If the action is write, the remote may remove all previously written
- // data after the offset. Implementations may support arbitrary offsets but
- // MUST support reseting this value to zero with a write. If an
- // implementation does not support a write at a particular offset, an
- // OutOfRange error must be returned.
- Offset int64 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"`
- // Data is the actual bytes to be written.
- //
- // If this is empty and the message is not a commit, a response will be
- // returned with the current write state.
- Data []byte `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"`
- // Labels are arbitrary data on snapshots.
- //
- // The combined size of a key/value pair cannot exceed 4096 bytes.
- Labels map[string]string `protobuf:"bytes,7,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *WriteContentRequest) Reset() { *m = WriteContentRequest{} }
-func (*WriteContentRequest) ProtoMessage() {}
-func (*WriteContentRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_468430ba3e400391, []int{15}
-}
-func (m *WriteContentRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *WriteContentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_WriteContentRequest.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 *WriteContentRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_WriteContentRequest.Merge(m, src)
-}
-func (m *WriteContentRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *WriteContentRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_WriteContentRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_WriteContentRequest proto.InternalMessageInfo
-
-// WriteContentResponse is returned on the culmination of a write call.
-type WriteContentResponse struct {
- // Action contains the action for the final message of the stream. A writer
- // should confirm that they match the intended result.
- Action WriteAction `protobuf:"varint,1,opt,name=action,proto3,enum=containerd.services.content.v1.WriteAction" json:"action,omitempty"`
- // StartedAt provides the time at which the write began.
- //
- // This must be set for stat and commit write actions. All other write
- // actions may omit this.
- StartedAt time.Time `protobuf:"bytes,2,opt,name=started_at,json=startedAt,proto3,stdtime" json:"started_at"`
- // UpdatedAt provides the last time of a successful write.
- //
- // This must be set for stat and commit write actions. All other write
- // actions may omit this.
- UpdatedAt time.Time `protobuf:"bytes,3,opt,name=updated_at,json=updatedAt,proto3,stdtime" json:"updated_at"`
- // Offset is the current committed size for the write.
- Offset int64 `protobuf:"varint,4,opt,name=offset,proto3" json:"offset,omitempty"`
- // Total provides the current, expected total size of the write.
- //
- // We include this to provide consistency with the Status structure on the
- // client writer.
- //
- // This is only valid on the Stat and Commit response.
- Total int64 `protobuf:"varint,5,opt,name=total,proto3" json:"total,omitempty"`
- // Digest, if present, includes the digest up to the currently committed
- // bytes. If action is commit, this field will be set. It is implementation
- // defined if this is set for other actions.
- Digest github_com_opencontainers_go_digest.Digest `protobuf:"bytes,6,opt,name=digest,proto3,customtype=github.com/opencontainers/go-digest.Digest" json:"digest"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *WriteContentResponse) Reset() { *m = WriteContentResponse{} }
-func (*WriteContentResponse) ProtoMessage() {}
-func (*WriteContentResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_468430ba3e400391, []int{16}
-}
-func (m *WriteContentResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *WriteContentResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_WriteContentResponse.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 *WriteContentResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_WriteContentResponse.Merge(m, src)
-}
-func (m *WriteContentResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *WriteContentResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_WriteContentResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_WriteContentResponse proto.InternalMessageInfo
-
-type AbortRequest struct {
- Ref string `protobuf:"bytes,1,opt,name=ref,proto3" json:"ref,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *AbortRequest) Reset() { *m = AbortRequest{} }
-func (*AbortRequest) ProtoMessage() {}
-func (*AbortRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_468430ba3e400391, []int{17}
-}
-func (m *AbortRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *AbortRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_AbortRequest.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 *AbortRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_AbortRequest.Merge(m, src)
-}
-func (m *AbortRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *AbortRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_AbortRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_AbortRequest proto.InternalMessageInfo
-
-func init() {
- proto.RegisterEnum("containerd.services.content.v1.WriteAction", WriteAction_name, WriteAction_value)
- proto.RegisterType((*Info)(nil), "containerd.services.content.v1.Info")
- proto.RegisterMapType((map[string]string)(nil), "containerd.services.content.v1.Info.LabelsEntry")
- proto.RegisterType((*InfoRequest)(nil), "containerd.services.content.v1.InfoRequest")
- proto.RegisterType((*InfoResponse)(nil), "containerd.services.content.v1.InfoResponse")
- proto.RegisterType((*UpdateRequest)(nil), "containerd.services.content.v1.UpdateRequest")
- proto.RegisterType((*UpdateResponse)(nil), "containerd.services.content.v1.UpdateResponse")
- proto.RegisterType((*ListContentRequest)(nil), "containerd.services.content.v1.ListContentRequest")
- proto.RegisterType((*ListContentResponse)(nil), "containerd.services.content.v1.ListContentResponse")
- proto.RegisterType((*DeleteContentRequest)(nil), "containerd.services.content.v1.DeleteContentRequest")
- proto.RegisterType((*ReadContentRequest)(nil), "containerd.services.content.v1.ReadContentRequest")
- proto.RegisterType((*ReadContentResponse)(nil), "containerd.services.content.v1.ReadContentResponse")
- proto.RegisterType((*Status)(nil), "containerd.services.content.v1.Status")
- proto.RegisterType((*StatusRequest)(nil), "containerd.services.content.v1.StatusRequest")
- proto.RegisterType((*StatusResponse)(nil), "containerd.services.content.v1.StatusResponse")
- proto.RegisterType((*ListStatusesRequest)(nil), "containerd.services.content.v1.ListStatusesRequest")
- proto.RegisterType((*ListStatusesResponse)(nil), "containerd.services.content.v1.ListStatusesResponse")
- proto.RegisterType((*WriteContentRequest)(nil), "containerd.services.content.v1.WriteContentRequest")
- proto.RegisterMapType((map[string]string)(nil), "containerd.services.content.v1.WriteContentRequest.LabelsEntry")
- proto.RegisterType((*WriteContentResponse)(nil), "containerd.services.content.v1.WriteContentResponse")
- proto.RegisterType((*AbortRequest)(nil), "containerd.services.content.v1.AbortRequest")
-}
-
-func init() {
- proto.RegisterFile("github.com/containerd/containerd/api/services/content/v1/content.proto", fileDescriptor_468430ba3e400391)
-}
-
-var fileDescriptor_468430ba3e400391 = []byte{
- // 1081 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xcd, 0x6f, 0x1b, 0x45,
- 0x14, 0xf7, 0x78, 0xed, 0x4d, 0xf2, 0x9c, 0x16, 0x33, 0x31, 0x95, 0xb5, 0x08, 0x67, 0xbb, 0x42,
- 0xc8, 0x6a, 0xc9, 0x3a, 0x75, 0x7a, 0x00, 0x2a, 0x01, 0x8e, 0x9b, 0xaa, 0x41, 0x4d, 0x41, 0x5b,
- 0x97, 0x40, 0x2f, 0x65, 0x6d, 0x8f, 0xcd, 0x2a, 0xb6, 0xd7, 0xdd, 0x19, 0x5b, 0x84, 0x13, 0x17,
- 0x24, 0x14, 0xf5, 0x80, 0xb8, 0xe7, 0x02, 0xfc, 0x15, 0x1c, 0x38, 0xe7, 0xc8, 0x11, 0x71, 0x68,
- 0x69, 0xfe, 0x07, 0xee, 0x68, 0x66, 0x67, 0xed, 0xf5, 0x47, 0x58, 0xdb, 0x31, 0x27, 0xbf, 0x99,
- 0x7d, 0xbf, 0xf7, 0xfd, 0x31, 0x86, 0x7b, 0x4d, 0x87, 0x7d, 0xdd, 0xab, 0x9a, 0x35, 0xb7, 0x5d,
- 0xa8, 0xb9, 0x1d, 0x66, 0x3b, 0x1d, 0xe2, 0xd5, 0xc3, 0xa4, 0xdd, 0x75, 0x0a, 0x94, 0x78, 0x7d,
- 0xa7, 0x46, 0xa8, 0xb8, 0x27, 0x1d, 0x56, 0xe8, 0xdf, 0x0a, 0x48, 0xb3, 0xeb, 0xb9, 0xcc, 0xc5,
- 0xb9, 0x21, 0xc2, 0x0c, 0xb8, 0xcd, 0x80, 0xa5, 0x7f, 0x4b, 0xcb, 0x34, 0xdd, 0xa6, 0x2b, 0x58,
- 0x0b, 0x9c, 0xf2, 0x51, 0x9a, 0xde, 0x74, 0xdd, 0x66, 0x8b, 0x14, 0xc4, 0xa9, 0xda, 0x6b, 0x14,
- 0x1a, 0x0e, 0x69, 0xd5, 0x9f, 0xb6, 0x6d, 0x7a, 0x24, 0x39, 0x36, 0xc7, 0x39, 0x98, 0xd3, 0x26,
- 0x94, 0xd9, 0xed, 0xae, 0x64, 0x78, 0x73, 0x9c, 0x81, 0xb4, 0xbb, 0xec, 0xd8, 0xff, 0x68, 0xfc,
- 0x13, 0x87, 0xc4, 0x7e, 0xa7, 0xe1, 0xe2, 0x4f, 0x40, 0xad, 0x3b, 0x4d, 0x42, 0x59, 0x16, 0xe9,
- 0x28, 0xbf, 0xb6, 0x5b, 0x3c, 0x7b, 0xb1, 0x19, 0xfb, 0xeb, 0xc5, 0xe6, 0x8d, 0x90, 0xfb, 0x6e,
- 0x97, 0x74, 0x06, 0x5e, 0xd0, 0x42, 0xd3, 0xdd, 0xf2, 0x21, 0xe6, 0x5d, 0xf1, 0x63, 0x49, 0x09,
- 0x18, 0x43, 0x82, 0x3a, 0xdf, 0x92, 0x6c, 0x5c, 0x47, 0x79, 0xc5, 0x12, 0x34, 0x2e, 0x03, 0xd4,
- 0x3c, 0x62, 0x33, 0x52, 0x7f, 0x6a, 0xb3, 0xac, 0xa2, 0xa3, 0x7c, 0xaa, 0xa8, 0x99, 0xbe, 0x69,
- 0x66, 0x60, 0x9a, 0x59, 0x09, 0x6c, 0xdf, 0x5d, 0xe5, 0xfa, 0x7f, 0x7c, 0xb9, 0x89, 0xac, 0x35,
- 0x89, 0x2b, 0x31, 0x2e, 0xa4, 0xd7, 0xad, 0x07, 0x42, 0x12, 0xf3, 0x08, 0x91, 0xb8, 0x12, 0xc3,
- 0xf7, 0x41, 0x6d, 0xd9, 0x55, 0xd2, 0xa2, 0xd9, 0xa4, 0xae, 0xe4, 0x53, 0xc5, 0x6d, 0xf3, 0xbf,
- 0x33, 0x63, 0xf2, 0xf8, 0x98, 0x0f, 0x04, 0x64, 0xaf, 0xc3, 0xbc, 0x63, 0x4b, 0xe2, 0xb5, 0xf7,
- 0x21, 0x15, 0xba, 0xc6, 0x69, 0x50, 0x8e, 0xc8, 0xb1, 0x1f, 0x3f, 0x8b, 0x93, 0x38, 0x03, 0xc9,
- 0xbe, 0xdd, 0xea, 0xf9, 0x91, 0x58, 0xb3, 0xfc, 0xc3, 0x07, 0xf1, 0xf7, 0x90, 0xf1, 0x25, 0xa4,
- 0xb8, 0x58, 0x8b, 0x3c, 0xeb, 0xf1, 0x88, 0x2d, 0x31, 0xfa, 0xc6, 0x43, 0x58, 0xf7, 0x45, 0xd3,
- 0xae, 0xdb, 0xa1, 0x04, 0x7f, 0x08, 0x09, 0xa7, 0xd3, 0x70, 0x85, 0xe4, 0x54, 0xf1, 0xed, 0x59,
- 0xbc, 0xdd, 0x4d, 0x70, 0xfd, 0x96, 0xc0, 0x19, 0xcf, 0x11, 0x5c, 0x79, 0x2c, 0xa2, 0x17, 0x58,
- 0x7b, 0x49, 0x89, 0xf8, 0x0e, 0xa4, 0xfc, 0x74, 0x88, 0x3a, 0x16, 0xc1, 0x99, 0x96, 0xc7, 0x7b,
- 0xbc, 0xd4, 0x0f, 0x6c, 0x7a, 0x64, 0xc9, 0xac, 0x73, 0xda, 0xf8, 0x0c, 0xae, 0x06, 0xd6, 0x2c,
- 0xc9, 0x41, 0x13, 0xf0, 0x03, 0x87, 0xb2, 0xb2, 0xcf, 0x12, 0x38, 0x99, 0x85, 0x95, 0x86, 0xd3,
- 0x62, 0xc4, 0xa3, 0x59, 0xa4, 0x2b, 0xf9, 0x35, 0x2b, 0x38, 0x1a, 0x8f, 0x61, 0x63, 0x84, 0x7f,
- 0xc2, 0x0c, 0x65, 0x21, 0x33, 0xaa, 0x90, 0xb9, 0x4b, 0x5a, 0x84, 0x91, 0x31, 0x43, 0x96, 0x59,
- 0x1b, 0xcf, 0x11, 0x60, 0x8b, 0xd8, 0xf5, 0xff, 0x4f, 0x05, 0xbe, 0x06, 0xaa, 0xdb, 0x68, 0x50,
- 0xc2, 0x64, 0xfb, 0xcb, 0xd3, 0x60, 0x28, 0x28, 0xc3, 0xa1, 0x60, 0x94, 0x60, 0x63, 0xc4, 0x1a,
- 0x19, 0xc9, 0xa1, 0x08, 0x34, 0x2e, 0xa2, 0x6e, 0x33, 0x5b, 0x08, 0x5e, 0xb7, 0x04, 0x6d, 0xfc,
- 0x1c, 0x07, 0xf5, 0x11, 0xb3, 0x59, 0x8f, 0xf2, 0xe9, 0x40, 0x99, 0xed, 0xc9, 0xe9, 0x80, 0xe6,
- 0x99, 0x0e, 0x12, 0x37, 0x31, 0x62, 0xe2, 0x8b, 0x8d, 0x98, 0x34, 0x28, 0x1e, 0x69, 0x08, 0x57,
- 0xd7, 0x2c, 0x4e, 0x86, 0x5c, 0x4a, 0x8c, 0xb8, 0x94, 0x81, 0x24, 0x73, 0x99, 0xdd, 0xca, 0x26,
- 0xc5, 0xb5, 0x7f, 0xc0, 0x0f, 0x61, 0x95, 0x7c, 0xd3, 0x25, 0x35, 0x46, 0xea, 0x59, 0x75, 0xe1,
- 0x8c, 0x0c, 0x64, 0x18, 0xd7, 0xe1, 0x8a, 0x1f, 0xa3, 0x20, 0xe1, 0xd2, 0x40, 0x34, 0x30, 0x90,
- 0xb7, 0x55, 0xc0, 0x32, 0xa8, 0x67, 0x95, 0x8a, 0x1b, 0x19, 0xca, 0x77, 0xa2, 0x2a, 0x5a, 0xe2,
- 0x25, 0xca, 0x28, 0xf8, 0x6d, 0xe2, 0xdf, 0x12, 0x1a, 0xdd, 0x57, 0x5f, 0x41, 0x66, 0x14, 0x20,
- 0x0d, 0xb9, 0x0f, 0xab, 0x54, 0xde, 0xc9, 0xe6, 0x9a, 0xd1, 0x14, 0xd9, 0x5e, 0x03, 0xb4, 0xf1,
- 0x93, 0x02, 0x1b, 0x87, 0x9e, 0x33, 0xd1, 0x62, 0x65, 0x50, 0xed, 0x1a, 0x73, 0xdc, 0x8e, 0x70,
- 0xf5, 0x6a, 0xf1, 0x66, 0x94, 0x7c, 0x21, 0xa4, 0x24, 0x20, 0x96, 0x84, 0x06, 0x31, 0x8d, 0x0f,
- 0x93, 0x3e, 0x48, 0xae, 0x72, 0x51, 0x72, 0x13, 0x97, 0x4f, 0x6e, 0xa8, 0xb4, 0x92, 0x53, 0xbb,
- 0x45, 0x1d, 0x76, 0x0b, 0x3e, 0x1c, 0xec, 0xbe, 0x15, 0x11, 0xc8, 0x8f, 0x66, 0x72, 0x74, 0x34,
- 0x5a, 0xcb, 0x5e, 0x85, 0x2f, 0xe3, 0x90, 0x19, 0x55, 0x23, 0xf3, 0xbe, 0x94, 0xac, 0x8c, 0x0e,
- 0x85, 0xf8, 0x32, 0x86, 0x82, 0xb2, 0xd8, 0x50, 0x98, 0x6f, 0x04, 0x0c, 0x47, 0xb2, 0x7a, 0xe9,
- 0xa9, 0xaf, 0xc3, 0x7a, 0xa9, 0xea, 0x7a, 0xec, 0xc2, 0xee, 0xbf, 0xf1, 0x3d, 0x82, 0x54, 0x28,
- 0x7a, 0xf8, 0x2d, 0x48, 0x3c, 0xaa, 0x94, 0x2a, 0xe9, 0x98, 0xb6, 0x71, 0x72, 0xaa, 0xbf, 0x16,
- 0xfa, 0xc4, 0x3b, 0x0b, 0x6f, 0x42, 0xf2, 0xd0, 0xda, 0xaf, 0xec, 0xa5, 0x91, 0x96, 0x39, 0x39,
- 0xd5, 0xd3, 0xa1, 0xef, 0x82, 0xc4, 0xd7, 0x41, 0x2d, 0x7f, 0x7a, 0x70, 0xb0, 0x5f, 0x49, 0xc7,
- 0xb5, 0x37, 0x4e, 0x4e, 0xf5, 0xd7, 0x43, 0x1c, 0x65, 0xb7, 0xdd, 0x76, 0x98, 0xb6, 0xf1, 0xc3,
- 0x2f, 0xb9, 0xd8, 0x6f, 0xbf, 0xe6, 0xc2, 0x7a, 0x8b, 0xbf, 0xaf, 0xc0, 0x8a, 0x2c, 0x03, 0x6c,
- 0xcb, 0x97, 0xe9, 0xcd, 0x59, 0x36, 0xa9, 0x74, 0x4d, 0x7b, 0x77, 0x36, 0x66, 0x59, 0x61, 0x4d,
- 0x50, 0xfd, 0xb7, 0x04, 0xde, 0x8a, 0xc2, 0x8d, 0xbc, 0x80, 0x34, 0x73, 0x56, 0x76, 0xa9, 0xe8,
- 0x19, 0x24, 0xf8, 0x68, 0xc3, 0xc5, 0x28, 0xdc, 0xe4, 0x43, 0x44, 0xdb, 0x99, 0x0b, 0xe3, 0x2b,
- 0xdc, 0x46, 0xf8, 0x73, 0x50, 0xfd, 0xe7, 0x04, 0xbe, 0x1d, 0x25, 0x60, 0xda, 0xb3, 0x43, 0xbb,
- 0x36, 0x51, 0xdf, 0x7b, 0xfc, 0x7f, 0x03, 0x77, 0x85, 0xef, 0xec, 0x68, 0x57, 0x26, 0xdf, 0x19,
- 0xd1, 0xae, 0x4c, 0x79, 0x0d, 0x6c, 0x23, 0x9e, 0x26, 0xb9, 0xe2, 0xb7, 0x66, 0xdc, 0x41, 0xb3,
- 0xa6, 0x69, 0x6c, 0xe5, 0x1d, 0xc3, 0x7a, 0x78, 0x03, 0xe1, 0x99, 0x42, 0x3f, 0xb6, 0xe0, 0xb4,
- 0xdb, 0xf3, 0x81, 0xa4, 0xea, 0x3e, 0x24, 0xfd, 0xd6, 0xd9, 0x59, 0x60, 0x24, 0x47, 0xeb, 0x9c,
- 0x36, 0x60, 0xf3, 0x68, 0x1b, 0xe1, 0x03, 0x48, 0x8a, 0xd9, 0x80, 0x23, 0x3b, 0x27, 0x3c, 0x42,
- 0x2e, 0xaa, 0x8e, 0xdd, 0x27, 0x67, 0xaf, 0x72, 0xb1, 0x3f, 0x5f, 0xe5, 0x62, 0xdf, 0x9d, 0xe7,
- 0xd0, 0xd9, 0x79, 0x0e, 0xfd, 0x71, 0x9e, 0x43, 0x7f, 0x9f, 0xe7, 0xd0, 0x93, 0x8f, 0x17, 0xfd,
- 0x1f, 0x7d, 0x47, 0x92, 0x5f, 0xc4, 0xaa, 0xaa, 0xd0, 0xb6, 0xf3, 0x6f, 0x00, 0x00, 0x00, 0xff,
- 0xff, 0xc0, 0xc2, 0x35, 0xb1, 0x94, 0x0f, 0x00, 0x00,
-}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ context.Context
-var _ grpc.ClientConn
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion4
-
-// ContentClient is the client API for Content service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type ContentClient interface {
- // Info returns information about a committed object.
- //
- // This call can be used for getting the size of content and checking for
- // existence.
- Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error)
- // Update updates content metadata.
- //
- // This call can be used to manage the mutable content labels. The
- // immutable metadata such as digest, size, and committed at cannot
- // be updated.
- Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error)
- // List streams the entire set of content as Info objects and closes the
- // stream.
- //
- // Typically, this will yield a large response, chunked into messages.
- // Clients should make provisions to ensure they can handle the entire data
- // set.
- List(ctx context.Context, in *ListContentRequest, opts ...grpc.CallOption) (Content_ListClient, error)
- // Delete will delete the referenced object.
- Delete(ctx context.Context, in *DeleteContentRequest, opts ...grpc.CallOption) (*types.Empty, error)
- // Read allows one to read an object based on the offset into the content.
- //
- // The requested data may be returned in one or more messages.
- Read(ctx context.Context, in *ReadContentRequest, opts ...grpc.CallOption) (Content_ReadClient, error)
- // Status returns the status for a single reference.
- Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error)
- // ListStatuses returns the status of ongoing object ingestions, started via
- // Write.
- //
- // Only those matching the regular expression will be provided in the
- // response. If the provided regular expression is empty, all ingestions
- // will be provided.
- ListStatuses(ctx context.Context, in *ListStatusesRequest, opts ...grpc.CallOption) (*ListStatusesResponse, error)
- // Write begins or resumes writes to a resource identified by a unique ref.
- // Only one active stream may exist at a time for each ref.
- //
- // Once a write stream has started, it may only write to a single ref, thus
- // once a stream is started, the ref may be omitted on subsequent writes.
- //
- // For any write transaction represented by a ref, only a single write may
- // be made to a given offset. If overlapping writes occur, it is an error.
- // Writes should be sequential and implementations may throw an error if
- // this is required.
- //
- // If expected_digest is set and already part of the content store, the
- // write will fail.
- //
- // When completed, the commit flag should be set to true. If expected size
- // or digest is set, the content will be validated against those values.
- Write(ctx context.Context, opts ...grpc.CallOption) (Content_WriteClient, error)
- // Abort cancels the ongoing write named in the request. Any resources
- // associated with the write will be collected.
- Abort(ctx context.Context, in *AbortRequest, opts ...grpc.CallOption) (*types.Empty, error)
-}
-
-type contentClient struct {
- cc *grpc.ClientConn
-}
-
-func NewContentClient(cc *grpc.ClientConn) ContentClient {
- return &contentClient{cc}
-}
-
-func (c *contentClient) Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) {
- out := new(InfoResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.content.v1.Content/Info", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *contentClient) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error) {
- out := new(UpdateResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.content.v1.Content/Update", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *contentClient) List(ctx context.Context, in *ListContentRequest, opts ...grpc.CallOption) (Content_ListClient, error) {
- stream, err := c.cc.NewStream(ctx, &_Content_serviceDesc.Streams[0], "/containerd.services.content.v1.Content/List", opts...)
- if err != nil {
- return nil, err
- }
- x := &contentListClient{stream}
- if err := x.ClientStream.SendMsg(in); err != nil {
- return nil, err
- }
- if err := x.ClientStream.CloseSend(); err != nil {
- return nil, err
- }
- return x, nil
-}
-
-type Content_ListClient interface {
- Recv() (*ListContentResponse, error)
- grpc.ClientStream
-}
-
-type contentListClient struct {
- grpc.ClientStream
-}
-
-func (x *contentListClient) Recv() (*ListContentResponse, error) {
- m := new(ListContentResponse)
- if err := x.ClientStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
-}
-
-func (c *contentClient) Delete(ctx context.Context, in *DeleteContentRequest, opts ...grpc.CallOption) (*types.Empty, error) {
- out := new(types.Empty)
- err := c.cc.Invoke(ctx, "/containerd.services.content.v1.Content/Delete", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *contentClient) Read(ctx context.Context, in *ReadContentRequest, opts ...grpc.CallOption) (Content_ReadClient, error) {
- stream, err := c.cc.NewStream(ctx, &_Content_serviceDesc.Streams[1], "/containerd.services.content.v1.Content/Read", opts...)
- if err != nil {
- return nil, err
- }
- x := &contentReadClient{stream}
- if err := x.ClientStream.SendMsg(in); err != nil {
- return nil, err
- }
- if err := x.ClientStream.CloseSend(); err != nil {
- return nil, err
- }
- return x, nil
-}
-
-type Content_ReadClient interface {
- Recv() (*ReadContentResponse, error)
- grpc.ClientStream
-}
-
-type contentReadClient struct {
- grpc.ClientStream
-}
-
-func (x *contentReadClient) Recv() (*ReadContentResponse, error) {
- m := new(ReadContentResponse)
- if err := x.ClientStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
-}
-
-func (c *contentClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) {
- out := new(StatusResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.content.v1.Content/Status", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *contentClient) ListStatuses(ctx context.Context, in *ListStatusesRequest, opts ...grpc.CallOption) (*ListStatusesResponse, error) {
- out := new(ListStatusesResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.content.v1.Content/ListStatuses", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *contentClient) Write(ctx context.Context, opts ...grpc.CallOption) (Content_WriteClient, error) {
- stream, err := c.cc.NewStream(ctx, &_Content_serviceDesc.Streams[2], "/containerd.services.content.v1.Content/Write", opts...)
- if err != nil {
- return nil, err
- }
- x := &contentWriteClient{stream}
- return x, nil
-}
-
-type Content_WriteClient interface {
- Send(*WriteContentRequest) error
- Recv() (*WriteContentResponse, error)
- grpc.ClientStream
-}
-
-type contentWriteClient struct {
- grpc.ClientStream
-}
-
-func (x *contentWriteClient) Send(m *WriteContentRequest) error {
- return x.ClientStream.SendMsg(m)
-}
-
-func (x *contentWriteClient) Recv() (*WriteContentResponse, error) {
- m := new(WriteContentResponse)
- if err := x.ClientStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
-}
-
-func (c *contentClient) Abort(ctx context.Context, in *AbortRequest, opts ...grpc.CallOption) (*types.Empty, error) {
- out := new(types.Empty)
- err := c.cc.Invoke(ctx, "/containerd.services.content.v1.Content/Abort", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// ContentServer is the server API for Content service.
-type ContentServer interface {
- // Info returns information about a committed object.
- //
- // This call can be used for getting the size of content and checking for
- // existence.
- Info(context.Context, *InfoRequest) (*InfoResponse, error)
- // Update updates content metadata.
- //
- // This call can be used to manage the mutable content labels. The
- // immutable metadata such as digest, size, and committed at cannot
- // be updated.
- Update(context.Context, *UpdateRequest) (*UpdateResponse, error)
- // List streams the entire set of content as Info objects and closes the
- // stream.
- //
- // Typically, this will yield a large response, chunked into messages.
- // Clients should make provisions to ensure they can handle the entire data
- // set.
- List(*ListContentRequest, Content_ListServer) error
- // Delete will delete the referenced object.
- Delete(context.Context, *DeleteContentRequest) (*types.Empty, error)
- // Read allows one to read an object based on the offset into the content.
- //
- // The requested data may be returned in one or more messages.
- Read(*ReadContentRequest, Content_ReadServer) error
- // Status returns the status for a single reference.
- Status(context.Context, *StatusRequest) (*StatusResponse, error)
- // ListStatuses returns the status of ongoing object ingestions, started via
- // Write.
- //
- // Only those matching the regular expression will be provided in the
- // response. If the provided regular expression is empty, all ingestions
- // will be provided.
- ListStatuses(context.Context, *ListStatusesRequest) (*ListStatusesResponse, error)
- // Write begins or resumes writes to a resource identified by a unique ref.
- // Only one active stream may exist at a time for each ref.
- //
- // Once a write stream has started, it may only write to a single ref, thus
- // once a stream is started, the ref may be omitted on subsequent writes.
- //
- // For any write transaction represented by a ref, only a single write may
- // be made to a given offset. If overlapping writes occur, it is an error.
- // Writes should be sequential and implementations may throw an error if
- // this is required.
- //
- // If expected_digest is set and already part of the content store, the
- // write will fail.
- //
- // When completed, the commit flag should be set to true. If expected size
- // or digest is set, the content will be validated against those values.
- Write(Content_WriteServer) error
- // Abort cancels the ongoing write named in the request. Any resources
- // associated with the write will be collected.
- Abort(context.Context, *AbortRequest) (*types.Empty, error)
-}
-
-// UnimplementedContentServer can be embedded to have forward compatible implementations.
-type UnimplementedContentServer struct {
-}
-
-func (*UnimplementedContentServer) Info(ctx context.Context, req *InfoRequest) (*InfoResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Info not implemented")
-}
-func (*UnimplementedContentServer) Update(ctx context.Context, req *UpdateRequest) (*UpdateResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
-}
-func (*UnimplementedContentServer) List(req *ListContentRequest, srv Content_ListServer) error {
- return status.Errorf(codes.Unimplemented, "method List not implemented")
-}
-func (*UnimplementedContentServer) Delete(ctx context.Context, req *DeleteContentRequest) (*types.Empty, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
-}
-func (*UnimplementedContentServer) Read(req *ReadContentRequest, srv Content_ReadServer) error {
- return status.Errorf(codes.Unimplemented, "method Read not implemented")
-}
-func (*UnimplementedContentServer) Status(ctx context.Context, req *StatusRequest) (*StatusResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Status not implemented")
-}
-func (*UnimplementedContentServer) ListStatuses(ctx context.Context, req *ListStatusesRequest) (*ListStatusesResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method ListStatuses not implemented")
-}
-func (*UnimplementedContentServer) Write(srv Content_WriteServer) error {
- return status.Errorf(codes.Unimplemented, "method Write not implemented")
-}
-func (*UnimplementedContentServer) Abort(ctx context.Context, req *AbortRequest) (*types.Empty, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Abort not implemented")
-}
-
-func RegisterContentServer(s *grpc.Server, srv ContentServer) {
- s.RegisterService(&_Content_serviceDesc, srv)
-}
-
-func _Content_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(InfoRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ContentServer).Info(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.content.v1.Content/Info",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ContentServer).Info(ctx, req.(*InfoRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Content_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(UpdateRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ContentServer).Update(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.content.v1.Content/Update",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ContentServer).Update(ctx, req.(*UpdateRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Content_List_Handler(srv interface{}, stream grpc.ServerStream) error {
- m := new(ListContentRequest)
- if err := stream.RecvMsg(m); err != nil {
- return err
- }
- return srv.(ContentServer).List(m, &contentListServer{stream})
-}
-
-type Content_ListServer interface {
- Send(*ListContentResponse) error
- grpc.ServerStream
-}
-
-type contentListServer struct {
- grpc.ServerStream
-}
-
-func (x *contentListServer) Send(m *ListContentResponse) error {
- return x.ServerStream.SendMsg(m)
-}
-
-func _Content_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(DeleteContentRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ContentServer).Delete(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.content.v1.Content/Delete",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ContentServer).Delete(ctx, req.(*DeleteContentRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Content_Read_Handler(srv interface{}, stream grpc.ServerStream) error {
- m := new(ReadContentRequest)
- if err := stream.RecvMsg(m); err != nil {
- return err
- }
- return srv.(ContentServer).Read(m, &contentReadServer{stream})
-}
-
-type Content_ReadServer interface {
- Send(*ReadContentResponse) error
- grpc.ServerStream
-}
-
-type contentReadServer struct {
- grpc.ServerStream
-}
-
-func (x *contentReadServer) Send(m *ReadContentResponse) error {
- return x.ServerStream.SendMsg(m)
-}
-
-func _Content_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(StatusRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ContentServer).Status(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.content.v1.Content/Status",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ContentServer).Status(ctx, req.(*StatusRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Content_ListStatuses_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(ListStatusesRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ContentServer).ListStatuses(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.content.v1.Content/ListStatuses",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ContentServer).ListStatuses(ctx, req.(*ListStatusesRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Content_Write_Handler(srv interface{}, stream grpc.ServerStream) error {
- return srv.(ContentServer).Write(&contentWriteServer{stream})
-}
-
-type Content_WriteServer interface {
- Send(*WriteContentResponse) error
- Recv() (*WriteContentRequest, error)
- grpc.ServerStream
-}
-
-type contentWriteServer struct {
- grpc.ServerStream
-}
-
-func (x *contentWriteServer) Send(m *WriteContentResponse) error {
- return x.ServerStream.SendMsg(m)
-}
-
-func (x *contentWriteServer) Recv() (*WriteContentRequest, error) {
- m := new(WriteContentRequest)
- if err := x.ServerStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
-}
-
-func _Content_Abort_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(AbortRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ContentServer).Abort(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.content.v1.Content/Abort",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ContentServer).Abort(ctx, req.(*AbortRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-var _Content_serviceDesc = grpc.ServiceDesc{
- ServiceName: "containerd.services.content.v1.Content",
- HandlerType: (*ContentServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "Info",
- Handler: _Content_Info_Handler,
- },
- {
- MethodName: "Update",
- Handler: _Content_Update_Handler,
- },
- {
- MethodName: "Delete",
- Handler: _Content_Delete_Handler,
- },
- {
- MethodName: "Status",
- Handler: _Content_Status_Handler,
- },
- {
- MethodName: "ListStatuses",
- Handler: _Content_ListStatuses_Handler,
- },
- {
- MethodName: "Abort",
- Handler: _Content_Abort_Handler,
- },
- },
- Streams: []grpc.StreamDesc{
- {
- StreamName: "List",
- Handler: _Content_List_Handler,
- ServerStreams: true,
- },
- {
- StreamName: "Read",
- Handler: _Content_Read_Handler,
- ServerStreams: true,
- },
- {
- StreamName: "Write",
- Handler: _Content_Write_Handler,
- ServerStreams: true,
- ClientStreams: true,
- },
- },
- Metadata: "github.com/containerd/containerd/api/services/content/v1/content.proto",
-}
-
-func (m *Info) 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 *Info) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *Info) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Labels) > 0 {
- for k := range m.Labels {
- v := m.Labels[k]
- baseI := i
- i -= len(v)
- copy(dAtA[i:], v)
- i = encodeVarintContent(dAtA, i, uint64(len(v)))
- i--
- dAtA[i] = 0x12
- i -= len(k)
- copy(dAtA[i:], k)
- i = encodeVarintContent(dAtA, i, uint64(len(k)))
- i--
- dAtA[i] = 0xa
- i = encodeVarintContent(dAtA, i, uint64(baseI-i))
- i--
- dAtA[i] = 0x2a
- }
- }
- n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.UpdatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.UpdatedAt):])
- if err1 != nil {
- return 0, err1
- }
- i -= n1
- i = encodeVarintContent(dAtA, i, uint64(n1))
- i--
- dAtA[i] = 0x22
- n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt):])
- if err2 != nil {
- return 0, err2
- }
- i -= n2
- i = encodeVarintContent(dAtA, i, uint64(n2))
- i--
- dAtA[i] = 0x1a
- if m.Size_ != 0 {
- i = encodeVarintContent(dAtA, i, uint64(m.Size_))
- i--
- dAtA[i] = 0x10
- }
- if len(m.Digest) > 0 {
- i -= len(m.Digest)
- copy(dAtA[i:], m.Digest)
- i = encodeVarintContent(dAtA, i, uint64(len(m.Digest)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *InfoRequest) 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 *InfoRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *InfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Digest) > 0 {
- i -= len(m.Digest)
- copy(dAtA[i:], m.Digest)
- i = encodeVarintContent(dAtA, i, uint64(len(m.Digest)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *InfoResponse) 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 *InfoResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *InfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- {
- size, err := m.Info.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintContent(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func (m *UpdateRequest) 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 *UpdateRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *UpdateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.UpdateMask != nil {
- {
- size, err := m.UpdateMask.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintContent(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x12
- }
- {
- size, err := m.Info.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintContent(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func (m *UpdateResponse) 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 *UpdateResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *UpdateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- {
- size, err := m.Info.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintContent(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func (m *ListContentRequest) 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 *ListContentRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ListContentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Filters) > 0 {
- for iNdEx := len(m.Filters) - 1; iNdEx >= 0; iNdEx-- {
- i -= len(m.Filters[iNdEx])
- copy(dAtA[i:], m.Filters[iNdEx])
- i = encodeVarintContent(dAtA, i, uint64(len(m.Filters[iNdEx])))
- i--
- dAtA[i] = 0xa
- }
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ListContentResponse) 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 *ListContentResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ListContentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Info) > 0 {
- for iNdEx := len(m.Info) - 1; iNdEx >= 0; iNdEx-- {
- {
- size, err := m.Info[iNdEx].MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintContent(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- }
- }
- return len(dAtA) - i, nil
-}
-
-func (m *DeleteContentRequest) 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 *DeleteContentRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *DeleteContentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Digest) > 0 {
- i -= len(m.Digest)
- copy(dAtA[i:], m.Digest)
- i = encodeVarintContent(dAtA, i, uint64(len(m.Digest)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ReadContentRequest) 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 *ReadContentRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ReadContentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Size_ != 0 {
- i = encodeVarintContent(dAtA, i, uint64(m.Size_))
- i--
- dAtA[i] = 0x18
- }
- if m.Offset != 0 {
- i = encodeVarintContent(dAtA, i, uint64(m.Offset))
- i--
- dAtA[i] = 0x10
- }
- if len(m.Digest) > 0 {
- i -= len(m.Digest)
- copy(dAtA[i:], m.Digest)
- i = encodeVarintContent(dAtA, i, uint64(len(m.Digest)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ReadContentResponse) 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 *ReadContentResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ReadContentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Data) > 0 {
- i -= len(m.Data)
- copy(dAtA[i:], m.Data)
- i = encodeVarintContent(dAtA, i, uint64(len(m.Data)))
- i--
- dAtA[i] = 0x12
- }
- if m.Offset != 0 {
- i = encodeVarintContent(dAtA, i, uint64(m.Offset))
- i--
- dAtA[i] = 0x8
- }
- return len(dAtA) - i, nil
-}
-
-func (m *Status) 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 *Status) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *Status) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Expected) > 0 {
- i -= len(m.Expected)
- copy(dAtA[i:], m.Expected)
- i = encodeVarintContent(dAtA, i, uint64(len(m.Expected)))
- i--
- dAtA[i] = 0x32
- }
- if m.Total != 0 {
- i = encodeVarintContent(dAtA, i, uint64(m.Total))
- i--
- dAtA[i] = 0x28
- }
- if m.Offset != 0 {
- i = encodeVarintContent(dAtA, i, uint64(m.Offset))
- i--
- dAtA[i] = 0x20
- }
- if len(m.Ref) > 0 {
- i -= len(m.Ref)
- copy(dAtA[i:], m.Ref)
- i = encodeVarintContent(dAtA, i, uint64(len(m.Ref)))
- i--
- dAtA[i] = 0x1a
- }
- n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.UpdatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.UpdatedAt):])
- if err7 != nil {
- return 0, err7
- }
- i -= n7
- i = encodeVarintContent(dAtA, i, uint64(n7))
- i--
- dAtA[i] = 0x12
- n8, err8 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartedAt):])
- if err8 != nil {
- return 0, err8
- }
- i -= n8
- i = encodeVarintContent(dAtA, i, uint64(n8))
- i--
- dAtA[i] = 0xa
- 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.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Ref) > 0 {
- i -= len(m.Ref)
- copy(dAtA[i:], m.Ref)
- i = encodeVarintContent(dAtA, i, uint64(len(m.Ref)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *StatusResponse) 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 *StatusResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *StatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Status != nil {
- {
- size, err := m.Status.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintContent(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ListStatusesRequest) 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 *ListStatusesRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ListStatusesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Filters) > 0 {
- for iNdEx := len(m.Filters) - 1; iNdEx >= 0; iNdEx-- {
- i -= len(m.Filters[iNdEx])
- copy(dAtA[i:], m.Filters[iNdEx])
- i = encodeVarintContent(dAtA, i, uint64(len(m.Filters[iNdEx])))
- i--
- dAtA[i] = 0xa
- }
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ListStatusesResponse) 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 *ListStatusesResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ListStatusesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Statuses) > 0 {
- for iNdEx := len(m.Statuses) - 1; iNdEx >= 0; iNdEx-- {
- {
- size, err := m.Statuses[iNdEx].MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintContent(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- }
- }
- return len(dAtA) - i, nil
-}
-
-func (m *WriteContentRequest) 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 *WriteContentRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *WriteContentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Labels) > 0 {
- for k := range m.Labels {
- v := m.Labels[k]
- baseI := i
- i -= len(v)
- copy(dAtA[i:], v)
- i = encodeVarintContent(dAtA, i, uint64(len(v)))
- i--
- dAtA[i] = 0x12
- i -= len(k)
- copy(dAtA[i:], k)
- i = encodeVarintContent(dAtA, i, uint64(len(k)))
- i--
- dAtA[i] = 0xa
- i = encodeVarintContent(dAtA, i, uint64(baseI-i))
- i--
- dAtA[i] = 0x3a
- }
- }
- if len(m.Data) > 0 {
- i -= len(m.Data)
- copy(dAtA[i:], m.Data)
- i = encodeVarintContent(dAtA, i, uint64(len(m.Data)))
- i--
- dAtA[i] = 0x32
- }
- if m.Offset != 0 {
- i = encodeVarintContent(dAtA, i, uint64(m.Offset))
- i--
- dAtA[i] = 0x28
- }
- if len(m.Expected) > 0 {
- i -= len(m.Expected)
- copy(dAtA[i:], m.Expected)
- i = encodeVarintContent(dAtA, i, uint64(len(m.Expected)))
- i--
- dAtA[i] = 0x22
- }
- if m.Total != 0 {
- i = encodeVarintContent(dAtA, i, uint64(m.Total))
- i--
- dAtA[i] = 0x18
- }
- if len(m.Ref) > 0 {
- i -= len(m.Ref)
- copy(dAtA[i:], m.Ref)
- i = encodeVarintContent(dAtA, i, uint64(len(m.Ref)))
- i--
- dAtA[i] = 0x12
- }
- if m.Action != 0 {
- i = encodeVarintContent(dAtA, i, uint64(m.Action))
- i--
- dAtA[i] = 0x8
- }
- return len(dAtA) - i, nil
-}
-
-func (m *WriteContentResponse) 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 *WriteContentResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *WriteContentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Digest) > 0 {
- i -= len(m.Digest)
- copy(dAtA[i:], m.Digest)
- i = encodeVarintContent(dAtA, i, uint64(len(m.Digest)))
- i--
- dAtA[i] = 0x32
- }
- if m.Total != 0 {
- i = encodeVarintContent(dAtA, i, uint64(m.Total))
- i--
- dAtA[i] = 0x28
- }
- if m.Offset != 0 {
- i = encodeVarintContent(dAtA, i, uint64(m.Offset))
- i--
- dAtA[i] = 0x20
- }
- n10, err10 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.UpdatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.UpdatedAt):])
- if err10 != nil {
- return 0, err10
- }
- i -= n10
- i = encodeVarintContent(dAtA, i, uint64(n10))
- i--
- dAtA[i] = 0x1a
- n11, err11 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartedAt):])
- if err11 != nil {
- return 0, err11
- }
- i -= n11
- i = encodeVarintContent(dAtA, i, uint64(n11))
- i--
- dAtA[i] = 0x12
- if m.Action != 0 {
- i = encodeVarintContent(dAtA, i, uint64(m.Action))
- i--
- dAtA[i] = 0x8
- }
- return len(dAtA) - i, nil
-}
-
-func (m *AbortRequest) 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 *AbortRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *AbortRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Ref) > 0 {
- i -= len(m.Ref)
- copy(dAtA[i:], m.Ref)
- i = encodeVarintContent(dAtA, i, uint64(len(m.Ref)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func encodeVarintContent(dAtA []byte, offset int, v uint64) int {
- offset -= sovContent(v)
- base := offset
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return base
-}
-func (m *Info) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Digest)
- if l > 0 {
- n += 1 + l + sovContent(uint64(l))
- }
- if m.Size_ != 0 {
- n += 1 + sovContent(uint64(m.Size_))
- }
- l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt)
- n += 1 + l + sovContent(uint64(l))
- l = github_com_gogo_protobuf_types.SizeOfStdTime(m.UpdatedAt)
- n += 1 + l + sovContent(uint64(l))
- if len(m.Labels) > 0 {
- for k, v := range m.Labels {
- _ = k
- _ = v
- mapEntrySize := 1 + len(k) + sovContent(uint64(len(k))) + 1 + len(v) + sovContent(uint64(len(v)))
- n += mapEntrySize + 1 + sovContent(uint64(mapEntrySize))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *InfoRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Digest)
- if l > 0 {
- n += 1 + l + sovContent(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *InfoResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = m.Info.Size()
- n += 1 + l + sovContent(uint64(l))
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *UpdateRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = m.Info.Size()
- n += 1 + l + sovContent(uint64(l))
- if m.UpdateMask != nil {
- l = m.UpdateMask.Size()
- n += 1 + l + sovContent(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *UpdateResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = m.Info.Size()
- n += 1 + l + sovContent(uint64(l))
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ListContentRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.Filters) > 0 {
- for _, s := range m.Filters {
- l = len(s)
- n += 1 + l + sovContent(uint64(l))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ListContentResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.Info) > 0 {
- for _, e := range m.Info {
- l = e.Size()
- n += 1 + l + sovContent(uint64(l))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *DeleteContentRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Digest)
- if l > 0 {
- n += 1 + l + sovContent(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ReadContentRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Digest)
- if l > 0 {
- n += 1 + l + sovContent(uint64(l))
- }
- if m.Offset != 0 {
- n += 1 + sovContent(uint64(m.Offset))
- }
- if m.Size_ != 0 {
- n += 1 + sovContent(uint64(m.Size_))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ReadContentResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Offset != 0 {
- n += 1 + sovContent(uint64(m.Offset))
- }
- l = len(m.Data)
- if l > 0 {
- n += 1 + l + sovContent(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *Status) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = github_com_gogo_protobuf_types.SizeOfStdTime(m.StartedAt)
- n += 1 + l + sovContent(uint64(l))
- l = github_com_gogo_protobuf_types.SizeOfStdTime(m.UpdatedAt)
- n += 1 + l + sovContent(uint64(l))
- l = len(m.Ref)
- if l > 0 {
- n += 1 + l + sovContent(uint64(l))
- }
- if m.Offset != 0 {
- n += 1 + sovContent(uint64(m.Offset))
- }
- if m.Total != 0 {
- n += 1 + sovContent(uint64(m.Total))
- }
- l = len(m.Expected)
- if l > 0 {
- n += 1 + l + sovContent(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *StatusRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Ref)
- if l > 0 {
- n += 1 + l + sovContent(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- 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 + sovContent(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ListStatusesRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.Filters) > 0 {
- for _, s := range m.Filters {
- l = len(s)
- n += 1 + l + sovContent(uint64(l))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ListStatusesResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.Statuses) > 0 {
- for _, e := range m.Statuses {
- l = e.Size()
- n += 1 + l + sovContent(uint64(l))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *WriteContentRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Action != 0 {
- n += 1 + sovContent(uint64(m.Action))
- }
- l = len(m.Ref)
- if l > 0 {
- n += 1 + l + sovContent(uint64(l))
- }
- if m.Total != 0 {
- n += 1 + sovContent(uint64(m.Total))
- }
- l = len(m.Expected)
- if l > 0 {
- n += 1 + l + sovContent(uint64(l))
- }
- if m.Offset != 0 {
- n += 1 + sovContent(uint64(m.Offset))
- }
- l = len(m.Data)
- if l > 0 {
- n += 1 + l + sovContent(uint64(l))
- }
- if len(m.Labels) > 0 {
- for k, v := range m.Labels {
- _ = k
- _ = v
- mapEntrySize := 1 + len(k) + sovContent(uint64(len(k))) + 1 + len(v) + sovContent(uint64(len(v)))
- n += mapEntrySize + 1 + sovContent(uint64(mapEntrySize))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *WriteContentResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Action != 0 {
- n += 1 + sovContent(uint64(m.Action))
- }
- l = github_com_gogo_protobuf_types.SizeOfStdTime(m.StartedAt)
- n += 1 + l + sovContent(uint64(l))
- l = github_com_gogo_protobuf_types.SizeOfStdTime(m.UpdatedAt)
- n += 1 + l + sovContent(uint64(l))
- if m.Offset != 0 {
- n += 1 + sovContent(uint64(m.Offset))
- }
- if m.Total != 0 {
- n += 1 + sovContent(uint64(m.Total))
- }
- l = len(m.Digest)
- if l > 0 {
- n += 1 + l + sovContent(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *AbortRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Ref)
- if l > 0 {
- n += 1 + l + sovContent(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func sovContent(x uint64) (n int) {
- return (math_bits.Len64(x|1) + 6) / 7
-}
-func sozContent(x uint64) (n int) {
- return sovContent(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-func (this *Info) 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 += "}"
- s := strings.Join([]string{`&Info{`,
- `Digest:` + fmt.Sprintf("%v", this.Digest) + `,`,
- `Size_:` + fmt.Sprintf("%v", this.Size_) + `,`,
- `CreatedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.CreatedAt), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`,
- `UpdatedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.UpdatedAt), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`,
- `Labels:` + mapStringForLabels + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *InfoRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&InfoRequest{`,
- `Digest:` + fmt.Sprintf("%v", this.Digest) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *InfoResponse) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&InfoResponse{`,
- `Info:` + strings.Replace(strings.Replace(this.Info.String(), "Info", "Info", 1), `&`, ``, 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *UpdateRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&UpdateRequest{`,
- `Info:` + strings.Replace(strings.Replace(this.Info.String(), "Info", "Info", 1), `&`, ``, 1) + `,`,
- `UpdateMask:` + strings.Replace(fmt.Sprintf("%v", this.UpdateMask), "FieldMask", "types.FieldMask", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *UpdateResponse) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&UpdateResponse{`,
- `Info:` + strings.Replace(strings.Replace(this.Info.String(), "Info", "Info", 1), `&`, ``, 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ListContentRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ListContentRequest{`,
- `Filters:` + fmt.Sprintf("%v", this.Filters) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ListContentResponse) String() string {
- if this == nil {
- return "nil"
- }
- repeatedStringForInfo := "[]Info{"
- for _, f := range this.Info {
- repeatedStringForInfo += strings.Replace(strings.Replace(f.String(), "Info", "Info", 1), `&`, ``, 1) + ","
- }
- repeatedStringForInfo += "}"
- s := strings.Join([]string{`&ListContentResponse{`,
- `Info:` + repeatedStringForInfo + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *DeleteContentRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&DeleteContentRequest{`,
- `Digest:` + fmt.Sprintf("%v", this.Digest) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ReadContentRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ReadContentRequest{`,
- `Digest:` + fmt.Sprintf("%v", this.Digest) + `,`,
- `Offset:` + fmt.Sprintf("%v", this.Offset) + `,`,
- `Size_:` + fmt.Sprintf("%v", this.Size_) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ReadContentResponse) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ReadContentResponse{`,
- `Offset:` + fmt.Sprintf("%v", this.Offset) + `,`,
- `Data:` + fmt.Sprintf("%v", this.Data) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *Status) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&Status{`,
- `StartedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.StartedAt), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`,
- `UpdatedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.UpdatedAt), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`,
- `Ref:` + fmt.Sprintf("%v", this.Ref) + `,`,
- `Offset:` + fmt.Sprintf("%v", this.Offset) + `,`,
- `Total:` + fmt.Sprintf("%v", this.Total) + `,`,
- `Expected:` + fmt.Sprintf("%v", this.Expected) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *StatusRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&StatusRequest{`,
- `Ref:` + fmt.Sprintf("%v", this.Ref) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *StatusResponse) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&StatusResponse{`,
- `Status:` + strings.Replace(this.Status.String(), "Status", "Status", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ListStatusesRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ListStatusesRequest{`,
- `Filters:` + fmt.Sprintf("%v", this.Filters) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ListStatusesResponse) String() string {
- if this == nil {
- return "nil"
- }
- repeatedStringForStatuses := "[]Status{"
- for _, f := range this.Statuses {
- repeatedStringForStatuses += strings.Replace(strings.Replace(f.String(), "Status", "Status", 1), `&`, ``, 1) + ","
- }
- repeatedStringForStatuses += "}"
- s := strings.Join([]string{`&ListStatusesResponse{`,
- `Statuses:` + repeatedStringForStatuses + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *WriteContentRequest) 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 += "}"
- s := strings.Join([]string{`&WriteContentRequest{`,
- `Action:` + fmt.Sprintf("%v", this.Action) + `,`,
- `Ref:` + fmt.Sprintf("%v", this.Ref) + `,`,
- `Total:` + fmt.Sprintf("%v", this.Total) + `,`,
- `Expected:` + fmt.Sprintf("%v", this.Expected) + `,`,
- `Offset:` + fmt.Sprintf("%v", this.Offset) + `,`,
- `Data:` + fmt.Sprintf("%v", this.Data) + `,`,
- `Labels:` + mapStringForLabels + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *WriteContentResponse) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&WriteContentResponse{`,
- `Action:` + fmt.Sprintf("%v", this.Action) + `,`,
- `StartedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.StartedAt), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`,
- `UpdatedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.UpdatedAt), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`,
- `Offset:` + fmt.Sprintf("%v", this.Offset) + `,`,
- `Total:` + fmt.Sprintf("%v", this.Total) + `,`,
- `Digest:` + fmt.Sprintf("%v", this.Digest) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *AbortRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&AbortRequest{`,
- `Ref:` + fmt.Sprintf("%v", this.Ref) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func valueToStringContent(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
-}
-func (m *Info) 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 ErrIntOverflowContent
- }
- 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: Info: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: Info: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Digest", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- 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 ErrInvalidLengthContent
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Digest = github_com_opencontainers_go_digest.Digest(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType)
- }
- m.Size_ = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Size_ |= int64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContent
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CreatedAt, dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 4:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field UpdatedAt", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContent
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.UpdatedAt, dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 5:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContent
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- 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 ErrIntOverflowContent
- }
- 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 ErrIntOverflowContent
- }
- 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 ErrInvalidLengthContent
- }
- postStringIndexmapkey := iNdEx + intStringLenmapkey
- if postStringIndexmapkey < 0 {
- return ErrInvalidLengthContent
- }
- 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 ErrIntOverflowContent
- }
- 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 ErrInvalidLengthContent
- }
- postStringIndexmapvalue := iNdEx + intStringLenmapvalue
- if postStringIndexmapvalue < 0 {
- return ErrInvalidLengthContent
- }
- if postStringIndexmapvalue > l {
- return io.ErrUnexpectedEOF
- }
- mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
- iNdEx = postStringIndexmapvalue
- } else {
- iNdEx = entryPreIndex
- skippy, err := skipContent(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) > postIndex {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- m.Labels[mapkey] = mapvalue
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContent(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *InfoRequest) 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 ErrIntOverflowContent
- }
- 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: InfoRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: InfoRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Digest", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- 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 ErrInvalidLengthContent
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Digest = github_com_opencontainers_go_digest.Digest(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContent(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *InfoResponse) 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 ErrIntOverflowContent
- }
- 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: InfoResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: InfoResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContent
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.Info.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContent(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *UpdateRequest) 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 ErrIntOverflowContent
- }
- 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: UpdateRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: UpdateRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContent
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.Info.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field UpdateMask", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContent
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.UpdateMask == nil {
- m.UpdateMask = &types.FieldMask{}
- }
- if err := m.UpdateMask.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContent(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *UpdateResponse) 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 ErrIntOverflowContent
- }
- 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: UpdateResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: UpdateResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContent
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.Info.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContent(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ListContentRequest) 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 ErrIntOverflowContent
- }
- 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: ListContentRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ListContentRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- 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 ErrInvalidLengthContent
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Filters = append(m.Filters, string(dAtA[iNdEx:postIndex]))
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContent(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ListContentResponse) 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 ErrIntOverflowContent
- }
- 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: ListContentResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ListContentResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContent
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Info = append(m.Info, Info{})
- if err := m.Info[len(m.Info)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContent(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *DeleteContentRequest) 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 ErrIntOverflowContent
- }
- 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: DeleteContentRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: DeleteContentRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Digest", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- 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 ErrInvalidLengthContent
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Digest = github_com_opencontainers_go_digest.Digest(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContent(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ReadContentRequest) 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 ErrIntOverflowContent
- }
- 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: ReadContentRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ReadContentRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Digest", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- 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 ErrInvalidLengthContent
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Digest = github_com_opencontainers_go_digest.Digest(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType)
- }
- m.Offset = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Offset |= int64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType)
- }
- m.Size_ = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Size_ |= int64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipContent(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ReadContentResponse) 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 ErrIntOverflowContent
- }
- 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: ReadContentResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ReadContentResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType)
- }
- m.Offset = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Offset |= int64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
- }
- var byteLen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- byteLen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if byteLen < 0 {
- return ErrInvalidLengthContent
- }
- postIndex := iNdEx + byteLen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...)
- if m.Data == nil {
- m.Data = []byte{}
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContent(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *Status) 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 ErrIntOverflowContent
- }
- 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: Status: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: Status: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field StartedAt", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContent
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.StartedAt, dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field UpdatedAt", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContent
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.UpdatedAt, dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Ref", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- 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 ErrInvalidLengthContent
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Ref = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 4:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType)
- }
- m.Offset = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Offset |= int64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 5:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType)
- }
- m.Total = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Total |= int64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 6:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Expected", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- 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 ErrInvalidLengthContent
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Expected = github_com_opencontainers_go_digest.Digest(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContent(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *StatusRequest) 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 ErrIntOverflowContent
- }
- 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: StatusRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: StatusRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Ref", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- 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 ErrInvalidLengthContent
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Ref = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContent(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *StatusResponse) 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 ErrIntOverflowContent
- }
- 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: StatusResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: StatusResponse: 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 ErrIntOverflowContent
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContent
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Status == nil {
- m.Status = &Status{}
- }
- if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContent(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ListStatusesRequest) 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 ErrIntOverflowContent
- }
- 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: ListStatusesRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ListStatusesRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- 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 ErrInvalidLengthContent
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Filters = append(m.Filters, string(dAtA[iNdEx:postIndex]))
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContent(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ListStatusesResponse) 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 ErrIntOverflowContent
- }
- 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: ListStatusesResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ListStatusesResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Statuses", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContent
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Statuses = append(m.Statuses, Status{})
- if err := m.Statuses[len(m.Statuses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContent(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *WriteContentRequest) 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 ErrIntOverflowContent
- }
- 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: WriteContentRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: WriteContentRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType)
- }
- m.Action = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Action |= WriteAction(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Ref", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- 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 ErrInvalidLengthContent
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Ref = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType)
- }
- m.Total = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Total |= int64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Expected", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- 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 ErrInvalidLengthContent
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Expected = github_com_opencontainers_go_digest.Digest(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 5:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType)
- }
- m.Offset = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Offset |= int64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 6:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
- }
- var byteLen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- byteLen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if byteLen < 0 {
- return ErrInvalidLengthContent
- }
- postIndex := iNdEx + byteLen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...)
- if m.Data == nil {
- m.Data = []byte{}
- }
- iNdEx = postIndex
- case 7:
- 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 ErrIntOverflowContent
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContent
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- 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 ErrIntOverflowContent
- }
- 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 ErrIntOverflowContent
- }
- 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 ErrInvalidLengthContent
- }
- postStringIndexmapkey := iNdEx + intStringLenmapkey
- if postStringIndexmapkey < 0 {
- return ErrInvalidLengthContent
- }
- 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 ErrIntOverflowContent
- }
- 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 ErrInvalidLengthContent
- }
- postStringIndexmapvalue := iNdEx + intStringLenmapvalue
- if postStringIndexmapvalue < 0 {
- return ErrInvalidLengthContent
- }
- if postStringIndexmapvalue > l {
- return io.ErrUnexpectedEOF
- }
- mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
- iNdEx = postStringIndexmapvalue
- } else {
- iNdEx = entryPreIndex
- skippy, err := skipContent(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) > postIndex {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- m.Labels[mapkey] = mapvalue
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContent(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *WriteContentResponse) 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 ErrIntOverflowContent
- }
- 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: WriteContentResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: WriteContentResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType)
- }
- m.Action = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Action |= WriteAction(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field StartedAt", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContent
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.StartedAt, dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field UpdatedAt", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthContent
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.UpdatedAt, dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 4:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType)
- }
- m.Offset = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Offset |= int64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 5:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType)
- }
- m.Total = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Total |= int64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 6:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Digest", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- 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 ErrInvalidLengthContent
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Digest = github_com_opencontainers_go_digest.Digest(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContent(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *AbortRequest) 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 ErrIntOverflowContent
- }
- 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: AbortRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: AbortRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Ref", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowContent
- }
- 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 ErrInvalidLengthContent
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthContent
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Ref = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipContent(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthContent
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func skipContent(dAtA []byte) (n int, err error) {
- l := len(dAtA)
- iNdEx := 0
- depth := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowContent
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowContent
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if dAtA[iNdEx-1] < 0x80 {
- break
- }
- }
- case 1:
- iNdEx += 8
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowContent
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if length < 0 {
- return 0, ErrInvalidLengthContent
- }
- iNdEx += length
- case 3:
- depth++
- case 4:
- if depth == 0 {
- return 0, ErrUnexpectedEndOfGroupContent
- }
- depth--
- case 5:
- iNdEx += 4
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- if iNdEx < 0 {
- return 0, ErrInvalidLengthContent
- }
- if depth == 0 {
- return iNdEx, nil
- }
- }
- return 0, io.ErrUnexpectedEOF
-}
-
-var (
- ErrInvalidLengthContent = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowContent = fmt.Errorf("proto: integer overflow")
- ErrUnexpectedEndOfGroupContent = fmt.Errorf("proto: unexpected end of group")
-)
diff --git a/vendor/github.com/containerd/containerd/api/services/content/v1/content.proto b/vendor/github.com/containerd/containerd/api/services/content/v1/content.proto
deleted file mode 100644
index 086b3e39b..000000000
--- a/vendor/github.com/containerd/containerd/api/services/content/v1/content.proto
+++ /dev/null
@@ -1,318 +0,0 @@
-syntax = "proto3";
-
-package containerd.services.content.v1;
-
-import weak "gogoproto/gogo.proto";
-import "google/protobuf/field_mask.proto";
-import "google/protobuf/timestamp.proto";
-import "google/protobuf/empty.proto";
-
-option go_package = "github.com/containerd/containerd/api/services/content/v1;content";
-
-// Content provides access to a content addressable storage system.
-service Content {
- // Info returns information about a committed object.
- //
- // This call can be used for getting the size of content and checking for
- // existence.
- rpc Info(InfoRequest) returns (InfoResponse);
-
- // Update updates content metadata.
- //
- // This call can be used to manage the mutable content labels. The
- // immutable metadata such as digest, size, and committed at cannot
- // be updated.
- rpc Update(UpdateRequest) returns (UpdateResponse);
-
- // List streams the entire set of content as Info objects and closes the
- // stream.
- //
- // Typically, this will yield a large response, chunked into messages.
- // Clients should make provisions to ensure they can handle the entire data
- // set.
- rpc List(ListContentRequest) returns (stream ListContentResponse);
-
- // Delete will delete the referenced object.
- rpc Delete(DeleteContentRequest) returns (google.protobuf.Empty);
-
- // Read allows one to read an object based on the offset into the content.
- //
- // The requested data may be returned in one or more messages.
- rpc Read(ReadContentRequest) returns (stream ReadContentResponse);
-
- // Status returns the status for a single reference.
- rpc Status(StatusRequest) returns (StatusResponse);
-
- // ListStatuses returns the status of ongoing object ingestions, started via
- // Write.
- //
- // Only those matching the regular expression will be provided in the
- // response. If the provided regular expression is empty, all ingestions
- // will be provided.
- rpc ListStatuses(ListStatusesRequest) returns (ListStatusesResponse);
-
- // Write begins or resumes writes to a resource identified by a unique ref.
- // Only one active stream may exist at a time for each ref.
- //
- // Once a write stream has started, it may only write to a single ref, thus
- // once a stream is started, the ref may be omitted on subsequent writes.
- //
- // For any write transaction represented by a ref, only a single write may
- // be made to a given offset. If overlapping writes occur, it is an error.
- // Writes should be sequential and implementations may throw an error if
- // this is required.
- //
- // If expected_digest is set and already part of the content store, the
- // write will fail.
- //
- // When completed, the commit flag should be set to true. If expected size
- // or digest is set, the content will be validated against those values.
- rpc Write(stream WriteContentRequest) returns (stream WriteContentResponse);
-
- // Abort cancels the ongoing write named in the request. Any resources
- // associated with the write will be collected.
- rpc Abort(AbortRequest) returns (google.protobuf.Empty);
-}
-
-message Info {
- // Digest is the hash identity of the blob.
- string digest = 1 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
-
- // Size is the total number of bytes in the blob.
- int64 size = 2;
-
- // CreatedAt provides the time at which the blob was committed.
- google.protobuf.Timestamp created_at = 3 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
-
- // UpdatedAt provides the time the info was last updated.
- google.protobuf.Timestamp updated_at = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
-
- // Labels are arbitrary data on snapshots.
- //
- // The combined size of a key/value pair cannot exceed 4096 bytes.
- map labels = 5;
-}
-
-message InfoRequest {
- string digest = 1 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
-}
-
-message InfoResponse {
- Info info = 1 [(gogoproto.nullable) = false];
-}
-
-message UpdateRequest {
- Info info = 1 [(gogoproto.nullable) = false];
-
- // UpdateMask specifies which fields to perform the update on. If empty,
- // the operation applies to all fields.
- //
- // In info, Digest, Size, and CreatedAt are immutable,
- // other field may be updated using this mask.
- // If no mask is provided, all mutable field are updated.
- google.protobuf.FieldMask update_mask = 2;
-}
-
-message UpdateResponse {
- Info info = 1 [(gogoproto.nullable) = false];
-}
-
-message ListContentRequest {
- // Filters contains one or more filters using the syntax defined in the
- // containerd filter package.
- //
- // The returned result will be those that match any of the provided
- // filters. Expanded, containers that match the following will be
- // returned:
- //
- // filters[0] or filters[1] or ... or filters[n-1] or filters[n]
- //
- // If filters is zero-length or nil, all items will be returned.
- repeated string filters = 1;
-}
-
-message ListContentResponse {
- repeated Info info = 1 [(gogoproto.nullable) = false];
-}
-
-message DeleteContentRequest {
- // Digest specifies which content to delete.
- string digest = 1 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
-}
-
-// ReadContentRequest defines the fields that make up a request to read a portion of
-// data from a stored object.
-message ReadContentRequest {
- // Digest is the hash identity to read.
- string digest = 1 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
-
- // Offset specifies the number of bytes from the start at which to begin
- // the read. If zero or less, the read will be from the start. This uses
- // standard zero-indexed semantics.
- int64 offset = 2;
-
- // size is the total size of the read. If zero, the entire blob will be
- // returned by the service.
- int64 size = 3;
-}
-
-// ReadContentResponse carries byte data for a read request.
-message ReadContentResponse {
- int64 offset = 1; // offset of the returned data
- bytes data = 2; // actual data
-}
-
-message Status {
- google.protobuf.Timestamp started_at = 1 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
- google.protobuf.Timestamp updated_at = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
- string ref = 3;
- int64 offset = 4;
- int64 total = 5;
- string expected = 6 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
-}
-
-
-message StatusRequest {
- string ref = 1;
-}
-
-message StatusResponse {
- Status status = 1;
-}
-
-message ListStatusesRequest {
- repeated string filters = 1;
-}
-
-message ListStatusesResponse {
- repeated Status statuses = 1 [(gogoproto.nullable) = false];
-}
-
-// WriteAction defines the behavior of a WriteRequest.
-enum WriteAction {
- option (gogoproto.goproto_enum_prefix) = false;
- option (gogoproto.enum_customname) = "WriteAction";
-
- // WriteActionStat instructs the writer to return the current status while
- // holding the lock on the write.
- STAT = 0 [(gogoproto.enumvalue_customname) = "WriteActionStat"];
-
- // WriteActionWrite sets the action for the write request to write data.
- //
- // Any data included will be written at the provided offset. The
- // transaction will be left open for further writes.
- //
- // This is the default.
- WRITE = 1 [(gogoproto.enumvalue_customname) = "WriteActionWrite"];
-
- // WriteActionCommit will write any outstanding data in the message and
- // commit the write, storing it under the digest.
- //
- // This can be used in a single message to send the data, verify it and
- // commit it.
- //
- // This action will always terminate the write.
- COMMIT = 2 [(gogoproto.enumvalue_customname) = "WriteActionCommit"];
-}
-
-// WriteContentRequest writes data to the request ref at offset.
-message WriteContentRequest {
- // Action sets the behavior of the write.
- //
- // When this is a write and the ref is not yet allocated, the ref will be
- // allocated and the data will be written at offset.
- //
- // If the action is write and the ref is allocated, it will accept data to
- // an offset that has not yet been written.
- //
- // If the action is write and there is no data, the current write status
- // will be returned. This works differently from status because the stream
- // holds a lock.
- WriteAction action = 1;
-
- // Ref identifies the pre-commit object to write to.
- string ref = 2;
-
- // Total can be set to have the service validate the total size of the
- // committed content.
- //
- // The latest value before or with the commit action message will be use to
- // validate the content. If the offset overflows total, the service may
- // report an error. It is only required on one message for the write.
- //
- // If the value is zero or less, no validation of the final content will be
- // performed.
- int64 total = 3;
-
- // Expected can be set to have the service validate the final content against
- // the provided digest.
- //
- // If the digest is already present in the object store, an AlreadyExists
- // error will be returned.
- //
- // Only the latest version will be used to check the content against the
- // digest. It is only required to include it on a single message, before or
- // with the commit action message.
- string expected = 4 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
-
- // Offset specifies the number of bytes from the start at which to begin
- // the write. For most implementations, this means from the start of the
- // file. This uses standard, zero-indexed semantics.
- //
- // If the action is write, the remote may remove all previously written
- // data after the offset. Implementations may support arbitrary offsets but
- // MUST support reseting this value to zero with a write. If an
- // implementation does not support a write at a particular offset, an
- // OutOfRange error must be returned.
- int64 offset = 5;
-
- // Data is the actual bytes to be written.
- //
- // If this is empty and the message is not a commit, a response will be
- // returned with the current write state.
- bytes data = 6;
-
- // Labels are arbitrary data on snapshots.
- //
- // The combined size of a key/value pair cannot exceed 4096 bytes.
- map labels = 7;
-}
-
-// WriteContentResponse is returned on the culmination of a write call.
-message WriteContentResponse {
- // Action contains the action for the final message of the stream. A writer
- // should confirm that they match the intended result.
- WriteAction action = 1;
-
- // StartedAt provides the time at which the write began.
- //
- // This must be set for stat and commit write actions. All other write
- // actions may omit this.
- google.protobuf.Timestamp started_at = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
-
- // UpdatedAt provides the last time of a successful write.
- //
- // This must be set for stat and commit write actions. All other write
- // actions may omit this.
- google.protobuf.Timestamp updated_at = 3 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
-
- // Offset is the current committed size for the write.
- int64 offset = 4;
-
- // Total provides the current, expected total size of the write.
- //
- // We include this to provide consistency with the Status structure on the
- // client writer.
- //
- // This is only valid on the Stat and Commit response.
- int64 total = 5;
-
- // Digest, if present, includes the digest up to the currently committed
- // bytes. If action is commit, this field will be set. It is implementation
- // defined if this is set for other actions.
- string digest = 6 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
-}
-
-message AbortRequest {
- string ref = 1;
-}
diff --git a/vendor/github.com/containerd/containerd/api/services/diff/v1/diff.pb.go b/vendor/github.com/containerd/containerd/api/services/diff/v1/diff.pb.go
deleted file mode 100644
index 48379234d..000000000
--- a/vendor/github.com/containerd/containerd/api/services/diff/v1/diff.pb.go
+++ /dev/null
@@ -1,1678 +0,0 @@
-// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: github.com/containerd/containerd/api/services/diff/v1/diff.proto
-
-package diff
-
-import (
- context "context"
- fmt "fmt"
- types "github.com/containerd/containerd/api/types"
- proto "github.com/gogo/protobuf/proto"
- github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
- types1 "github.com/gogo/protobuf/types"
- grpc "google.golang.org/grpc"
- codes "google.golang.org/grpc/codes"
- status "google.golang.org/grpc/status"
- io "io"
- math "math"
- math_bits "math/bits"
- reflect "reflect"
- strings "strings"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
-
-type ApplyRequest struct {
- // Diff is the descriptor of the diff to be extracted
- Diff *types.Descriptor `protobuf:"bytes,1,opt,name=diff,proto3" json:"diff,omitempty"`
- Mounts []*types.Mount `protobuf:"bytes,2,rep,name=mounts,proto3" json:"mounts,omitempty"`
- Payloads map[string]*types1.Any `protobuf:"bytes,3,rep,name=payloads,proto3" json:"payloads,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ApplyRequest) Reset() { *m = ApplyRequest{} }
-func (*ApplyRequest) ProtoMessage() {}
-func (*ApplyRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_3b36a99e6faaa935, []int{0}
-}
-func (m *ApplyRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ApplyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ApplyRequest.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 *ApplyRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ApplyRequest.Merge(m, src)
-}
-func (m *ApplyRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *ApplyRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_ApplyRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ApplyRequest proto.InternalMessageInfo
-
-type ApplyResponse struct {
- // Applied is the descriptor for the object which was applied.
- // If the input was a compressed blob then the result will be
- // the descriptor for the uncompressed blob.
- Applied *types.Descriptor `protobuf:"bytes,1,opt,name=applied,proto3" json:"applied,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ApplyResponse) Reset() { *m = ApplyResponse{} }
-func (*ApplyResponse) ProtoMessage() {}
-func (*ApplyResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_3b36a99e6faaa935, []int{1}
-}
-func (m *ApplyResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ApplyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ApplyResponse.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 *ApplyResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ApplyResponse.Merge(m, src)
-}
-func (m *ApplyResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *ApplyResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_ApplyResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ApplyResponse proto.InternalMessageInfo
-
-type DiffRequest struct {
- // Left are the mounts which represent the older copy
- // in which is the base of the computed changes.
- Left []*types.Mount `protobuf:"bytes,1,rep,name=left,proto3" json:"left,omitempty"`
- // Right are the mounts which represents the newer copy
- // in which changes from the left were made into.
- Right []*types.Mount `protobuf:"bytes,2,rep,name=right,proto3" json:"right,omitempty"`
- // MediaType is the media type descriptor for the created diff
- // object
- MediaType string `protobuf:"bytes,3,opt,name=media_type,json=mediaType,proto3" json:"media_type,omitempty"`
- // Ref identifies the pre-commit content store object. This
- // reference can be used to get the status from the content store.
- Ref string `protobuf:"bytes,4,opt,name=ref,proto3" json:"ref,omitempty"`
- // Labels are the labels to apply to the generated content
- // on content store commit.
- Labels map[string]string `protobuf:"bytes,5,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *DiffRequest) Reset() { *m = DiffRequest{} }
-func (*DiffRequest) ProtoMessage() {}
-func (*DiffRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_3b36a99e6faaa935, []int{2}
-}
-func (m *DiffRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *DiffRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_DiffRequest.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 *DiffRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_DiffRequest.Merge(m, src)
-}
-func (m *DiffRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *DiffRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_DiffRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_DiffRequest proto.InternalMessageInfo
-
-type DiffResponse struct {
- // Diff is the descriptor of the diff which can be applied
- Diff *types.Descriptor `protobuf:"bytes,3,opt,name=diff,proto3" json:"diff,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *DiffResponse) Reset() { *m = DiffResponse{} }
-func (*DiffResponse) ProtoMessage() {}
-func (*DiffResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_3b36a99e6faaa935, []int{3}
-}
-func (m *DiffResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *DiffResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_DiffResponse.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 *DiffResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_DiffResponse.Merge(m, src)
-}
-func (m *DiffResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *DiffResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_DiffResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_DiffResponse proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*ApplyRequest)(nil), "containerd.services.diff.v1.ApplyRequest")
- proto.RegisterMapType((map[string]*types1.Any)(nil), "containerd.services.diff.v1.ApplyRequest.PayloadsEntry")
- proto.RegisterType((*ApplyResponse)(nil), "containerd.services.diff.v1.ApplyResponse")
- proto.RegisterType((*DiffRequest)(nil), "containerd.services.diff.v1.DiffRequest")
- proto.RegisterMapType((map[string]string)(nil), "containerd.services.diff.v1.DiffRequest.LabelsEntry")
- proto.RegisterType((*DiffResponse)(nil), "containerd.services.diff.v1.DiffResponse")
-}
-
-func init() {
- proto.RegisterFile("github.com/containerd/containerd/api/services/diff/v1/diff.proto", fileDescriptor_3b36a99e6faaa935)
-}
-
-var fileDescriptor_3b36a99e6faaa935 = []byte{
- // 526 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x41, 0x6f, 0xd3, 0x4c,
- 0x10, 0x8d, 0xed, 0x24, 0xdf, 0x97, 0x49, 0x2b, 0xa1, 0x55, 0x24, 0x8c, 0x01, 0xab, 0xca, 0x29,
- 0x2d, 0x62, 0x4d, 0x03, 0x2a, 0xd0, 0x5e, 0x5a, 0x54, 0xc4, 0xa5, 0x48, 0x60, 0x7a, 0x40, 0x20,
- 0x81, 0x9c, 0x78, 0xed, 0xae, 0x70, 0xbc, 0x8b, 0x77, 0x1d, 0xc9, 0x37, 0xfe, 0x06, 0x67, 0x7e,
- 0x0a, 0x97, 0x1e, 0x39, 0x72, 0xa4, 0xf9, 0x25, 0xc8, 0xeb, 0x75, 0x31, 0x02, 0x05, 0xc3, 0xc9,
- 0x9b, 0x9d, 0xf7, 0xde, 0xce, 0xbc, 0x37, 0x0a, 0x1c, 0xc6, 0x54, 0x9e, 0xe5, 0x33, 0x3c, 0x67,
- 0x0b, 0x6f, 0xce, 0x52, 0x19, 0xd0, 0x94, 0x64, 0x61, 0xf3, 0x18, 0x70, 0xea, 0x09, 0x92, 0x2d,
- 0xe9, 0x9c, 0x08, 0x2f, 0xa4, 0x51, 0xe4, 0x2d, 0x77, 0xd5, 0x17, 0xf3, 0x8c, 0x49, 0x86, 0xae,
- 0xff, 0xc0, 0xe2, 0x1a, 0x87, 0x55, 0x7d, 0xb9, 0xeb, 0x8c, 0x62, 0x16, 0x33, 0x85, 0xf3, 0xca,
- 0x53, 0x45, 0x71, 0xae, 0xc5, 0x8c, 0xc5, 0x09, 0xf1, 0xd4, 0xaf, 0x59, 0x1e, 0x79, 0x41, 0x5a,
- 0xe8, 0xd2, 0x5e, 0xab, 0x7e, 0x64, 0xc1, 0x89, 0xf0, 0x16, 0x2c, 0x4f, 0xa5, 0xe6, 0x1d, 0xfc,
- 0x05, 0x2f, 0x24, 0x62, 0x9e, 0x51, 0x2e, 0x59, 0x56, 0x91, 0xc7, 0x1f, 0x4d, 0xd8, 0x38, 0xe2,
- 0x3c, 0x29, 0x7c, 0xf2, 0x3e, 0x27, 0x42, 0xa2, 0x3b, 0xd0, 0x2d, 0x27, 0xb0, 0x8d, 0x2d, 0x63,
- 0x32, 0x9c, 0xde, 0xc0, 0x8d, 0x11, 0x95, 0x04, 0x3e, 0xbe, 0x94, 0xf0, 0x15, 0x12, 0x79, 0xd0,
- 0x57, 0xed, 0x08, 0xdb, 0xdc, 0xb2, 0x26, 0xc3, 0xe9, 0xd5, 0x5f, 0x39, 0x4f, 0xcb, 0xba, 0xaf,
- 0x61, 0xe8, 0x05, 0xfc, 0xcf, 0x83, 0x22, 0x61, 0x41, 0x28, 0x6c, 0x4b, 0x51, 0xee, 0xe3, 0x35,
- 0x4e, 0xe2, 0x66, 0x7f, 0xf8, 0x99, 0x66, 0x3e, 0x4e, 0x65, 0x56, 0xf8, 0x97, 0x42, 0xce, 0x73,
- 0xd8, 0xfc, 0xa9, 0x84, 0xae, 0x80, 0xf5, 0x8e, 0x14, 0x6a, 0x8e, 0x81, 0x5f, 0x1e, 0xd1, 0x0e,
- 0xf4, 0x96, 0x41, 0x92, 0x13, 0xdb, 0x54, 0xb3, 0x8d, 0x70, 0x95, 0x05, 0xae, 0xb3, 0xc0, 0x47,
- 0x69, 0xe1, 0x57, 0x90, 0x7d, 0xf3, 0x81, 0x31, 0x7e, 0x02, 0x9b, 0xfa, 0x69, 0xc1, 0x59, 0x2a,
- 0x08, 0xda, 0x83, 0xff, 0x02, 0xce, 0x13, 0x4a, 0xc2, 0x56, 0xf6, 0xd4, 0xe0, 0xf1, 0x27, 0x13,
- 0x86, 0xc7, 0x34, 0x8a, 0x6a, 0x8f, 0x6f, 0x41, 0x37, 0x21, 0x91, 0xb4, 0x8d, 0xf5, 0x7e, 0x29,
- 0x10, 0xba, 0x0d, 0xbd, 0x8c, 0xc6, 0x67, 0xf2, 0x4f, 0xee, 0x56, 0x28, 0x74, 0x13, 0x60, 0x41,
- 0x42, 0x1a, 0xbc, 0x2d, 0x6b, 0xb6, 0xa5, 0xa6, 0x1f, 0xa8, 0x9b, 0xd3, 0x82, 0x93, 0xd2, 0x95,
- 0x8c, 0x44, 0x76, 0xb7, 0x72, 0x25, 0x23, 0x11, 0x3a, 0x81, 0x7e, 0x12, 0xcc, 0x48, 0x22, 0xec,
- 0x9e, 0x7a, 0xe0, 0xde, 0xda, 0x2c, 0x1a, 0x63, 0xe0, 0x13, 0x45, 0xab, 0x82, 0xd0, 0x1a, 0xce,
- 0x43, 0x18, 0x36, 0xae, 0x7f, 0x13, 0xc2, 0xa8, 0x19, 0xc2, 0xa0, 0x69, 0xf7, 0x21, 0x6c, 0x54,
- 0xea, 0xda, 0xed, 0x7a, 0x13, 0xad, 0xb6, 0x9b, 0x38, 0xfd, 0x6c, 0x40, 0xb7, 0x94, 0x40, 0x6f,
- 0xa0, 0xa7, 0x92, 0x43, 0xdb, 0xad, 0x17, 0xcb, 0xd9, 0x69, 0x03, 0xd5, 0xad, 0xbd, 0xd6, 0xef,
- 0x4c, 0xda, 0x7a, 0xe5, 0x6c, 0xb7, 0x40, 0x56, 0xe2, 0x8f, 0x4e, 0xcf, 0x2f, 0xdc, 0xce, 0xd7,
- 0x0b, 0xb7, 0xf3, 0x61, 0xe5, 0x1a, 0xe7, 0x2b, 0xd7, 0xf8, 0xb2, 0x72, 0x8d, 0x6f, 0x2b, 0xd7,
- 0x78, 0xb5, 0xff, 0x4f, 0xff, 0x58, 0x07, 0xe5, 0xf7, 0x65, 0x67, 0xd6, 0x57, 0x7b, 0x7e, 0xf7,
- 0x7b, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf7, 0x85, 0x25, 0xb8, 0xf8, 0x04, 0x00, 0x00,
-}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ context.Context
-var _ grpc.ClientConn
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion4
-
-// DiffClient is the client API for Diff service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type DiffClient interface {
- // Apply applies the content associated with the provided digests onto
- // the provided mounts. Archive content will be extracted and
- // decompressed if necessary.
- Apply(ctx context.Context, in *ApplyRequest, opts ...grpc.CallOption) (*ApplyResponse, error)
- // Diff creates a diff between the given mounts and uploads the result
- // to the content store.
- Diff(ctx context.Context, in *DiffRequest, opts ...grpc.CallOption) (*DiffResponse, error)
-}
-
-type diffClient struct {
- cc *grpc.ClientConn
-}
-
-func NewDiffClient(cc *grpc.ClientConn) DiffClient {
- return &diffClient{cc}
-}
-
-func (c *diffClient) Apply(ctx context.Context, in *ApplyRequest, opts ...grpc.CallOption) (*ApplyResponse, error) {
- out := new(ApplyResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.diff.v1.Diff/Apply", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *diffClient) Diff(ctx context.Context, in *DiffRequest, opts ...grpc.CallOption) (*DiffResponse, error) {
- out := new(DiffResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.diff.v1.Diff/Diff", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// DiffServer is the server API for Diff service.
-type DiffServer interface {
- // Apply applies the content associated with the provided digests onto
- // the provided mounts. Archive content will be extracted and
- // decompressed if necessary.
- Apply(context.Context, *ApplyRequest) (*ApplyResponse, error)
- // Diff creates a diff between the given mounts and uploads the result
- // to the content store.
- Diff(context.Context, *DiffRequest) (*DiffResponse, error)
-}
-
-// UnimplementedDiffServer can be embedded to have forward compatible implementations.
-type UnimplementedDiffServer struct {
-}
-
-func (*UnimplementedDiffServer) Apply(ctx context.Context, req *ApplyRequest) (*ApplyResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Apply not implemented")
-}
-func (*UnimplementedDiffServer) Diff(ctx context.Context, req *DiffRequest) (*DiffResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Diff not implemented")
-}
-
-func RegisterDiffServer(s *grpc.Server, srv DiffServer) {
- s.RegisterService(&_Diff_serviceDesc, srv)
-}
-
-func _Diff_Apply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(ApplyRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(DiffServer).Apply(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.diff.v1.Diff/Apply",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(DiffServer).Apply(ctx, req.(*ApplyRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Diff_Diff_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(DiffRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(DiffServer).Diff(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.diff.v1.Diff/Diff",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(DiffServer).Diff(ctx, req.(*DiffRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-var _Diff_serviceDesc = grpc.ServiceDesc{
- ServiceName: "containerd.services.diff.v1.Diff",
- HandlerType: (*DiffServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "Apply",
- Handler: _Diff_Apply_Handler,
- },
- {
- MethodName: "Diff",
- Handler: _Diff_Diff_Handler,
- },
- },
- Streams: []grpc.StreamDesc{},
- Metadata: "github.com/containerd/containerd/api/services/diff/v1/diff.proto",
-}
-
-func (m *ApplyRequest) 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 *ApplyRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ApplyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Payloads) > 0 {
- for k := range m.Payloads {
- v := m.Payloads[k]
- baseI := i
- if v != nil {
- {
- size, err := v.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintDiff(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x12
- }
- i -= len(k)
- copy(dAtA[i:], k)
- i = encodeVarintDiff(dAtA, i, uint64(len(k)))
- i--
- dAtA[i] = 0xa
- i = encodeVarintDiff(dAtA, i, uint64(baseI-i))
- i--
- dAtA[i] = 0x1a
- }
- }
- 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 = encodeVarintDiff(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x12
- }
- }
- if m.Diff != nil {
- {
- size, err := m.Diff.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintDiff(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ApplyResponse) 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 *ApplyResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ApplyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Applied != nil {
- {
- size, err := m.Applied.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintDiff(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *DiffRequest) 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 *DiffRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *DiffRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Labels) > 0 {
- for k := range m.Labels {
- v := m.Labels[k]
- baseI := i
- i -= len(v)
- copy(dAtA[i:], v)
- i = encodeVarintDiff(dAtA, i, uint64(len(v)))
- i--
- dAtA[i] = 0x12
- i -= len(k)
- copy(dAtA[i:], k)
- i = encodeVarintDiff(dAtA, i, uint64(len(k)))
- i--
- dAtA[i] = 0xa
- i = encodeVarintDiff(dAtA, i, uint64(baseI-i))
- i--
- dAtA[i] = 0x2a
- }
- }
- if len(m.Ref) > 0 {
- i -= len(m.Ref)
- copy(dAtA[i:], m.Ref)
- i = encodeVarintDiff(dAtA, i, uint64(len(m.Ref)))
- i--
- dAtA[i] = 0x22
- }
- if len(m.MediaType) > 0 {
- i -= len(m.MediaType)
- copy(dAtA[i:], m.MediaType)
- i = encodeVarintDiff(dAtA, i, uint64(len(m.MediaType)))
- i--
- dAtA[i] = 0x1a
- }
- if len(m.Right) > 0 {
- for iNdEx := len(m.Right) - 1; iNdEx >= 0; iNdEx-- {
- {
- size, err := m.Right[iNdEx].MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintDiff(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x12
- }
- }
- if len(m.Left) > 0 {
- for iNdEx := len(m.Left) - 1; iNdEx >= 0; iNdEx-- {
- {
- size, err := m.Left[iNdEx].MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintDiff(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- }
- }
- return len(dAtA) - i, nil
-}
-
-func (m *DiffResponse) 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 *DiffResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *DiffResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Diff != nil {
- {
- size, err := m.Diff.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintDiff(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x1a
- }
- return len(dAtA) - i, nil
-}
-
-func encodeVarintDiff(dAtA []byte, offset int, v uint64) int {
- offset -= sovDiff(v)
- base := offset
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return base
-}
-func (m *ApplyRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Diff != nil {
- l = m.Diff.Size()
- n += 1 + l + sovDiff(uint64(l))
- }
- if len(m.Mounts) > 0 {
- for _, e := range m.Mounts {
- l = e.Size()
- n += 1 + l + sovDiff(uint64(l))
- }
- }
- if len(m.Payloads) > 0 {
- for k, v := range m.Payloads {
- _ = k
- _ = v
- l = 0
- if v != nil {
- l = v.Size()
- l += 1 + sovDiff(uint64(l))
- }
- mapEntrySize := 1 + len(k) + sovDiff(uint64(len(k))) + l
- n += mapEntrySize + 1 + sovDiff(uint64(mapEntrySize))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ApplyResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Applied != nil {
- l = m.Applied.Size()
- n += 1 + l + sovDiff(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *DiffRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.Left) > 0 {
- for _, e := range m.Left {
- l = e.Size()
- n += 1 + l + sovDiff(uint64(l))
- }
- }
- if len(m.Right) > 0 {
- for _, e := range m.Right {
- l = e.Size()
- n += 1 + l + sovDiff(uint64(l))
- }
- }
- l = len(m.MediaType)
- if l > 0 {
- n += 1 + l + sovDiff(uint64(l))
- }
- l = len(m.Ref)
- if l > 0 {
- n += 1 + l + sovDiff(uint64(l))
- }
- if len(m.Labels) > 0 {
- for k, v := range m.Labels {
- _ = k
- _ = v
- mapEntrySize := 1 + len(k) + sovDiff(uint64(len(k))) + 1 + len(v) + sovDiff(uint64(len(v)))
- n += mapEntrySize + 1 + sovDiff(uint64(mapEntrySize))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *DiffResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Diff != nil {
- l = m.Diff.Size()
- n += 1 + l + sovDiff(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func sovDiff(x uint64) (n int) {
- return (math_bits.Len64(x|1) + 6) / 7
-}
-func sozDiff(x uint64) (n int) {
- return sovDiff(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-func (this *ApplyRequest) String() string {
- if this == nil {
- return "nil"
- }
- repeatedStringForMounts := "[]*Mount{"
- for _, f := range this.Mounts {
- repeatedStringForMounts += strings.Replace(fmt.Sprintf("%v", f), "Mount", "types.Mount", 1) + ","
- }
- repeatedStringForMounts += "}"
- keysForPayloads := make([]string, 0, len(this.Payloads))
- for k, _ := range this.Payloads {
- keysForPayloads = append(keysForPayloads, k)
- }
- github_com_gogo_protobuf_sortkeys.Strings(keysForPayloads)
- mapStringForPayloads := "map[string]*types1.Any{"
- for _, k := range keysForPayloads {
- mapStringForPayloads += fmt.Sprintf("%v: %v,", k, this.Payloads[k])
- }
- mapStringForPayloads += "}"
- s := strings.Join([]string{`&ApplyRequest{`,
- `Diff:` + strings.Replace(fmt.Sprintf("%v", this.Diff), "Descriptor", "types.Descriptor", 1) + `,`,
- `Mounts:` + repeatedStringForMounts + `,`,
- `Payloads:` + mapStringForPayloads + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ApplyResponse) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ApplyResponse{`,
- `Applied:` + strings.Replace(fmt.Sprintf("%v", this.Applied), "Descriptor", "types.Descriptor", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *DiffRequest) String() string {
- if this == nil {
- return "nil"
- }
- repeatedStringForLeft := "[]*Mount{"
- for _, f := range this.Left {
- repeatedStringForLeft += strings.Replace(fmt.Sprintf("%v", f), "Mount", "types.Mount", 1) + ","
- }
- repeatedStringForLeft += "}"
- repeatedStringForRight := "[]*Mount{"
- for _, f := range this.Right {
- repeatedStringForRight += strings.Replace(fmt.Sprintf("%v", f), "Mount", "types.Mount", 1) + ","
- }
- repeatedStringForRight += "}"
- 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 += "}"
- s := strings.Join([]string{`&DiffRequest{`,
- `Left:` + repeatedStringForLeft + `,`,
- `Right:` + repeatedStringForRight + `,`,
- `MediaType:` + fmt.Sprintf("%v", this.MediaType) + `,`,
- `Ref:` + fmt.Sprintf("%v", this.Ref) + `,`,
- `Labels:` + mapStringForLabels + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *DiffResponse) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&DiffResponse{`,
- `Diff:` + strings.Replace(fmt.Sprintf("%v", this.Diff), "Descriptor", "types.Descriptor", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func valueToStringDiff(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
-}
-func (m *ApplyRequest) 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 ErrIntOverflowDiff
- }
- 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: ApplyRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ApplyRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Diff", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowDiff
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthDiff
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthDiff
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Diff == nil {
- m.Diff = &types.Descriptor{}
- }
- if err := m.Diff.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Mounts", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowDiff
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthDiff
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthDiff
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Mounts = append(m.Mounts, &types.Mount{})
- if err := m.Mounts[len(m.Mounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Payloads", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowDiff
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthDiff
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthDiff
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Payloads == nil {
- m.Payloads = make(map[string]*types1.Any)
- }
- var mapkey string
- var mapvalue *types1.Any
- for iNdEx < postIndex {
- entryPreIndex := iNdEx
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowDiff
- }
- 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 ErrIntOverflowDiff
- }
- 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 ErrInvalidLengthDiff
- }
- postStringIndexmapkey := iNdEx + intStringLenmapkey
- if postStringIndexmapkey < 0 {
- return ErrInvalidLengthDiff
- }
- if postStringIndexmapkey > l {
- return io.ErrUnexpectedEOF
- }
- mapkey = string(dAtA[iNdEx:postStringIndexmapkey])
- iNdEx = postStringIndexmapkey
- } else if fieldNum == 2 {
- var mapmsglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowDiff
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- mapmsglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if mapmsglen < 0 {
- return ErrInvalidLengthDiff
- }
- postmsgIndex := iNdEx + mapmsglen
- if postmsgIndex < 0 {
- return ErrInvalidLengthDiff
- }
- if postmsgIndex > l {
- return io.ErrUnexpectedEOF
- }
- mapvalue = &types1.Any{}
- if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil {
- return err
- }
- iNdEx = postmsgIndex
- } else {
- iNdEx = entryPreIndex
- skippy, err := skipDiff(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthDiff
- }
- if (iNdEx + skippy) > postIndex {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- m.Payloads[mapkey] = mapvalue
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipDiff(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthDiff
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthDiff
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ApplyResponse) 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 ErrIntOverflowDiff
- }
- 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: ApplyResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ApplyResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Applied", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowDiff
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthDiff
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthDiff
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Applied == nil {
- m.Applied = &types.Descriptor{}
- }
- if err := m.Applied.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipDiff(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthDiff
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthDiff
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *DiffRequest) 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 ErrIntOverflowDiff
- }
- 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: DiffRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: DiffRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Left", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowDiff
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthDiff
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthDiff
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Left = append(m.Left, &types.Mount{})
- if err := m.Left[len(m.Left)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Right", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowDiff
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthDiff
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthDiff
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Right = append(m.Right, &types.Mount{})
- if err := m.Right[len(m.Right)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field MediaType", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowDiff
- }
- 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 ErrInvalidLengthDiff
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthDiff
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.MediaType = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 4:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Ref", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowDiff
- }
- 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 ErrInvalidLengthDiff
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthDiff
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Ref = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 5:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowDiff
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthDiff
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthDiff
- }
- 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 ErrIntOverflowDiff
- }
- 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 ErrIntOverflowDiff
- }
- 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 ErrInvalidLengthDiff
- }
- postStringIndexmapkey := iNdEx + intStringLenmapkey
- if postStringIndexmapkey < 0 {
- return ErrInvalidLengthDiff
- }
- 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 ErrIntOverflowDiff
- }
- 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 ErrInvalidLengthDiff
- }
- postStringIndexmapvalue := iNdEx + intStringLenmapvalue
- if postStringIndexmapvalue < 0 {
- return ErrInvalidLengthDiff
- }
- if postStringIndexmapvalue > l {
- return io.ErrUnexpectedEOF
- }
- mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
- iNdEx = postStringIndexmapvalue
- } else {
- iNdEx = entryPreIndex
- skippy, err := skipDiff(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthDiff
- }
- if (iNdEx + skippy) > postIndex {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- m.Labels[mapkey] = mapvalue
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipDiff(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthDiff
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthDiff
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *DiffResponse) 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 ErrIntOverflowDiff
- }
- 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: DiffResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: DiffResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Diff", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowDiff
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthDiff
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthDiff
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Diff == nil {
- m.Diff = &types.Descriptor{}
- }
- if err := m.Diff.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipDiff(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthDiff
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthDiff
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func skipDiff(dAtA []byte) (n int, err error) {
- l := len(dAtA)
- iNdEx := 0
- depth := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowDiff
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowDiff
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if dAtA[iNdEx-1] < 0x80 {
- break
- }
- }
- case 1:
- iNdEx += 8
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowDiff
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if length < 0 {
- return 0, ErrInvalidLengthDiff
- }
- iNdEx += length
- case 3:
- depth++
- case 4:
- if depth == 0 {
- return 0, ErrUnexpectedEndOfGroupDiff
- }
- depth--
- case 5:
- iNdEx += 4
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- if iNdEx < 0 {
- return 0, ErrInvalidLengthDiff
- }
- if depth == 0 {
- return iNdEx, nil
- }
- }
- return 0, io.ErrUnexpectedEOF
-}
-
-var (
- ErrInvalidLengthDiff = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowDiff = fmt.Errorf("proto: integer overflow")
- ErrUnexpectedEndOfGroupDiff = fmt.Errorf("proto: unexpected end of group")
-)
diff --git a/vendor/github.com/containerd/containerd/api/services/diff/v1/diff.proto b/vendor/github.com/containerd/containerd/api/services/diff/v1/diff.proto
deleted file mode 100644
index ae2707a25..000000000
--- a/vendor/github.com/containerd/containerd/api/services/diff/v1/diff.proto
+++ /dev/null
@@ -1,65 +0,0 @@
-syntax = "proto3";
-
-package containerd.services.diff.v1;
-
-import weak "gogoproto/gogo.proto";
-import "google/protobuf/any.proto";
-import "github.com/containerd/containerd/api/types/mount.proto";
-import "github.com/containerd/containerd/api/types/descriptor.proto";
-
-option go_package = "github.com/containerd/containerd/api/services/diff/v1;diff";
-
-// Diff service creates and applies diffs
-service Diff {
- // Apply applies the content associated with the provided digests onto
- // the provided mounts. Archive content will be extracted and
- // decompressed if necessary.
- rpc Apply(ApplyRequest) returns (ApplyResponse);
-
- // Diff creates a diff between the given mounts and uploads the result
- // to the content store.
- rpc Diff(DiffRequest) returns (DiffResponse);
-}
-
-message ApplyRequest {
- // Diff is the descriptor of the diff to be extracted
- containerd.types.Descriptor diff = 1;
-
- repeated containerd.types.Mount mounts = 2;
-
- map payloads = 3;
-}
-
-message ApplyResponse {
- // Applied is the descriptor for the object which was applied.
- // If the input was a compressed blob then the result will be
- // the descriptor for the uncompressed blob.
- containerd.types.Descriptor applied = 1;
-}
-
-message DiffRequest {
- // Left are the mounts which represent the older copy
- // in which is the base of the computed changes.
- repeated containerd.types.Mount left = 1;
-
- // Right are the mounts which represents the newer copy
- // in which changes from the left were made into.
- repeated containerd.types.Mount right = 2;
-
- // MediaType is the media type descriptor for the created diff
- // object
- string media_type = 3;
-
- // Ref identifies the pre-commit content store object. This
- // reference can be used to get the status from the content store.
- string ref = 4;
-
- // Labels are the labels to apply to the generated content
- // on content store commit.
- map labels = 5;
-}
-
-message DiffResponse {
- // Diff is the descriptor of the diff which can be applied
- containerd.types.Descriptor diff = 3;
-}
diff --git a/vendor/github.com/containerd/containerd/api/services/events/v1/doc.go b/vendor/github.com/containerd/containerd/api/services/events/v1/doc.go
deleted file mode 100644
index b7f86da86..000000000
--- a/vendor/github.com/containerd/containerd/api/services/events/v1/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-// Package events defines the event pushing and subscription service.
-package events
diff --git a/vendor/github.com/containerd/containerd/api/services/events/v1/events.pb.go b/vendor/github.com/containerd/containerd/api/services/events/v1/events.pb.go
deleted file mode 100644
index a1674f862..000000000
--- a/vendor/github.com/containerd/containerd/api/services/events/v1/events.pb.go
+++ /dev/null
@@ -1,1384 +0,0 @@
-// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: github.com/containerd/containerd/api/services/events/v1/events.proto
-
-package events
-
-import (
- context "context"
- fmt "fmt"
- github_com_containerd_typeurl "github.com/containerd/typeurl"
- proto "github.com/gogo/protobuf/proto"
- github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
- types "github.com/gogo/protobuf/types"
- grpc "google.golang.org/grpc"
- codes "google.golang.org/grpc/codes"
- status "google.golang.org/grpc/status"
- io "io"
- math "math"
- math_bits "math/bits"
- reflect "reflect"
- strings "strings"
- time "time"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-var _ = time.Kitchen
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
-
-type PublishRequest struct {
- Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"`
- Event *types.Any `protobuf:"bytes,2,opt,name=event,proto3" json:"event,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *PublishRequest) Reset() { *m = PublishRequest{} }
-func (*PublishRequest) ProtoMessage() {}
-func (*PublishRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_43fcd20dc1642376, []int{0}
-}
-func (m *PublishRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PublishRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_PublishRequest.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 *PublishRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PublishRequest.Merge(m, src)
-}
-func (m *PublishRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *PublishRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_PublishRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_PublishRequest proto.InternalMessageInfo
-
-type ForwardRequest struct {
- Envelope *Envelope `protobuf:"bytes,1,opt,name=envelope,proto3" json:"envelope,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ForwardRequest) Reset() { *m = ForwardRequest{} }
-func (*ForwardRequest) ProtoMessage() {}
-func (*ForwardRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_43fcd20dc1642376, []int{1}
-}
-func (m *ForwardRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ForwardRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ForwardRequest.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 *ForwardRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ForwardRequest.Merge(m, src)
-}
-func (m *ForwardRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *ForwardRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_ForwardRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ForwardRequest proto.InternalMessageInfo
-
-type SubscribeRequest struct {
- Filters []string `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *SubscribeRequest) Reset() { *m = SubscribeRequest{} }
-func (*SubscribeRequest) ProtoMessage() {}
-func (*SubscribeRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_43fcd20dc1642376, []int{2}
-}
-func (m *SubscribeRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *SubscribeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_SubscribeRequest.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 *SubscribeRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_SubscribeRequest.Merge(m, src)
-}
-func (m *SubscribeRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *SubscribeRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_SubscribeRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_SubscribeRequest proto.InternalMessageInfo
-
-type Envelope struct {
- Timestamp time.Time `protobuf:"bytes,1,opt,name=timestamp,proto3,stdtime" json:"timestamp"`
- Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
- Topic string `protobuf:"bytes,3,opt,name=topic,proto3" json:"topic,omitempty"`
- Event *types.Any `protobuf:"bytes,4,opt,name=event,proto3" json:"event,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Envelope) Reset() { *m = Envelope{} }
-func (*Envelope) ProtoMessage() {}
-func (*Envelope) Descriptor() ([]byte, []int) {
- return fileDescriptor_43fcd20dc1642376, []int{3}
-}
-func (m *Envelope) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Envelope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_Envelope.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 *Envelope) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Envelope.Merge(m, src)
-}
-func (m *Envelope) XXX_Size() int {
- return m.Size()
-}
-func (m *Envelope) XXX_DiscardUnknown() {
- xxx_messageInfo_Envelope.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Envelope proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*PublishRequest)(nil), "containerd.services.events.v1.PublishRequest")
- proto.RegisterType((*ForwardRequest)(nil), "containerd.services.events.v1.ForwardRequest")
- proto.RegisterType((*SubscribeRequest)(nil), "containerd.services.events.v1.SubscribeRequest")
- proto.RegisterType((*Envelope)(nil), "containerd.services.events.v1.Envelope")
-}
-
-func init() {
- proto.RegisterFile("github.com/containerd/containerd/api/services/events/v1/events.proto", fileDescriptor_43fcd20dc1642376)
-}
-
-var fileDescriptor_43fcd20dc1642376 = []byte{
- // 466 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x93, 0xcd, 0x8e, 0xd3, 0x30,
- 0x14, 0x85, 0xeb, 0xf9, 0x6d, 0x3c, 0xd2, 0x08, 0x45, 0x15, 0x2a, 0x01, 0xd2, 0xaa, 0x1b, 0x2a,
- 0x04, 0x0e, 0x53, 0x76, 0x20, 0x21, 0x28, 0x94, 0xf5, 0x28, 0x80, 0x54, 0xb1, 0x4b, 0xd2, 0xdb,
- 0xd4, 0x52, 0x62, 0x9b, 0xd8, 0x09, 0x9a, 0xdd, 0x3c, 0x02, 0x1b, 0xde, 0x84, 0x0d, 0x6f, 0xd0,
- 0x25, 0x4b, 0x56, 0xc0, 0xf4, 0x49, 0x50, 0x13, 0xbb, 0x61, 0x3a, 0x40, 0x10, 0xbb, 0x6b, 0xdf,
- 0xe3, 0xcf, 0xb9, 0xe7, 0x38, 0xf8, 0x45, 0x4c, 0xd5, 0x22, 0x0f, 0x49, 0xc4, 0x53, 0x2f, 0xe2,
- 0x4c, 0x05, 0x94, 0x41, 0x36, 0xfb, 0xb5, 0x0c, 0x04, 0xf5, 0x24, 0x64, 0x05, 0x8d, 0x40, 0x7a,
- 0x50, 0x00, 0x53, 0xd2, 0x2b, 0x4e, 0x74, 0x45, 0x44, 0xc6, 0x15, 0xb7, 0x6f, 0xd7, 0x7a, 0x62,
- 0xb4, 0x44, 0x2b, 0x8a, 0x13, 0xe7, 0x69, 0xe3, 0x25, 0x25, 0x26, 0xcc, 0xe7, 0x9e, 0x48, 0xf2,
- 0x98, 0x32, 0x6f, 0x4e, 0x21, 0x99, 0x89, 0x40, 0x2d, 0xaa, 0x0b, 0x9c, 0x4e, 0xcc, 0x63, 0x5e,
- 0x96, 0xde, 0xba, 0xd2, 0xbb, 0x37, 0x62, 0xce, 0xe3, 0x04, 0xea, 0xd3, 0x01, 0x3b, 0xd3, 0xad,
- 0x9b, 0xdb, 0x2d, 0x48, 0x85, 0x32, 0xcd, 0xde, 0x76, 0x53, 0xd1, 0x14, 0xa4, 0x0a, 0x52, 0x51,
- 0x09, 0x06, 0x3e, 0x3e, 0x3e, 0xcd, 0xc3, 0x84, 0xca, 0x85, 0x0f, 0xef, 0x72, 0x90, 0xca, 0xee,
- 0xe0, 0x7d, 0xc5, 0x05, 0x8d, 0xba, 0xa8, 0x8f, 0x86, 0x96, 0x5f, 0x2d, 0xec, 0xbb, 0x78, 0xbf,
- 0x9c, 0xb2, 0xbb, 0xd3, 0x47, 0xc3, 0xa3, 0x51, 0x87, 0x54, 0x60, 0x62, 0xc0, 0xe4, 0x19, 0x3b,
- 0xf3, 0x2b, 0xc9, 0xe0, 0x0d, 0x3e, 0x7e, 0xc9, 0xb3, 0xf7, 0x41, 0x36, 0x33, 0xcc, 0xe7, 0xb8,
- 0x0d, 0xac, 0x80, 0x84, 0x0b, 0x28, 0xb1, 0x47, 0xa3, 0x3b, 0xe4, 0xaf, 0x46, 0x92, 0x89, 0x96,
- 0xfb, 0x9b, 0x83, 0x83, 0x7b, 0xf8, 0xda, 0xab, 0x3c, 0x94, 0x51, 0x46, 0x43, 0x30, 0xe0, 0x2e,
- 0x3e, 0x9c, 0xd3, 0x44, 0x41, 0x26, 0xbb, 0xa8, 0xbf, 0x3b, 0xb4, 0x7c, 0xb3, 0x1c, 0x7c, 0x42,
- 0xb8, 0x6d, 0x20, 0xf6, 0x18, 0x5b, 0x9b, 0xc1, 0xf5, 0x07, 0x38, 0x57, 0x26, 0x78, 0x6d, 0x14,
- 0xe3, 0xf6, 0xf2, 0x5b, 0xaf, 0xf5, 0xe1, 0x7b, 0x0f, 0xf9, 0xf5, 0x31, 0xfb, 0x16, 0xb6, 0x58,
- 0x90, 0x82, 0x14, 0x41, 0x04, 0xa5, 0x0b, 0x96, 0x5f, 0x6f, 0xd4, 0xae, 0xed, 0xfe, 0xd6, 0xb5,
- 0xbd, 0x46, 0xd7, 0x1e, 0xed, 0x9d, 0x7f, 0xee, 0xa1, 0xd1, 0xc7, 0x1d, 0x7c, 0x30, 0x29, 0x5d,
- 0xb0, 0x4f, 0xf1, 0xa1, 0x8e, 0xc6, 0xbe, 0xdf, 0xe0, 0xd6, 0xe5, 0x08, 0x9d, 0xeb, 0x57, 0xee,
- 0x99, 0xac, 0xdf, 0xc4, 0x9a, 0xa8, 0x83, 0x69, 0x24, 0x5e, 0x0e, 0xf0, 0x8f, 0xc4, 0x18, 0x5b,
- 0x9b, 0x4c, 0x6c, 0xaf, 0x81, 0xb9, 0x9d, 0x9e, 0xf3, 0xaf, 0x8f, 0xe0, 0x01, 0x1a, 0x4f, 0x97,
- 0x17, 0x6e, 0xeb, 0xeb, 0x85, 0xdb, 0x3a, 0x5f, 0xb9, 0x68, 0xb9, 0x72, 0xd1, 0x97, 0x95, 0x8b,
- 0x7e, 0xac, 0x5c, 0xf4, 0xf6, 0xc9, 0x7f, 0xfe, 0xd7, 0x8f, 0xab, 0x6a, 0xda, 0x9a, 0xa2, 0xf0,
- 0xa0, 0x1c, 0xeb, 0xe1, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe6, 0xbf, 0x19, 0xa6, 0x24, 0x04,
- 0x00, 0x00,
-}
-
-// Field returns the value for the given fieldpath as a string, if defined.
-// If the value is not defined, the second value will be false.
-func (m *Envelope) Field(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- // unhandled: timestamp
- case "namespace":
- return string(m.Namespace), len(m.Namespace) > 0
- case "topic":
- return string(m.Topic), len(m.Topic) > 0
- case "event":
- decoded, err := github_com_containerd_typeurl.UnmarshalAny(m.Event)
- if err != nil {
- return "", false
- }
-
- adaptor, ok := decoded.(interface{ Field([]string) (string, bool) })
- if !ok {
- return "", false
- }
- return adaptor.Field(fieldpath[1:])
- }
- return "", false
-}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ context.Context
-var _ grpc.ClientConn
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion4
-
-// EventsClient is the client API for Events service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type EventsClient interface {
- // Publish an event to a topic.
- //
- // The event will be packed into a timestamp envelope with the namespace
- // introspected from the context. The envelope will then be dispatched.
- Publish(ctx context.Context, in *PublishRequest, opts ...grpc.CallOption) (*types.Empty, error)
- // Forward sends an event that has already been packaged into an envelope
- // with a timestamp and namespace.
- //
- // This is useful if earlier timestamping is required or when forwarding on
- // behalf of another component, namespace or publisher.
- Forward(ctx context.Context, in *ForwardRequest, opts ...grpc.CallOption) (*types.Empty, error)
- // Subscribe to a stream of events, possibly returning only that match any
- // of the provided filters.
- //
- // Unlike many other methods in containerd, subscribers will get messages
- // from all namespaces unless otherwise specified. If this is not desired,
- // a filter can be provided in the format 'namespace==' to
- // restrict the received events.
- Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (Events_SubscribeClient, error)
-}
-
-type eventsClient struct {
- cc *grpc.ClientConn
-}
-
-func NewEventsClient(cc *grpc.ClientConn) EventsClient {
- return &eventsClient{cc}
-}
-
-func (c *eventsClient) Publish(ctx context.Context, in *PublishRequest, opts ...grpc.CallOption) (*types.Empty, error) {
- out := new(types.Empty)
- err := c.cc.Invoke(ctx, "/containerd.services.events.v1.Events/Publish", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *eventsClient) Forward(ctx context.Context, in *ForwardRequest, opts ...grpc.CallOption) (*types.Empty, error) {
- out := new(types.Empty)
- err := c.cc.Invoke(ctx, "/containerd.services.events.v1.Events/Forward", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *eventsClient) Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (Events_SubscribeClient, error) {
- stream, err := c.cc.NewStream(ctx, &_Events_serviceDesc.Streams[0], "/containerd.services.events.v1.Events/Subscribe", opts...)
- if err != nil {
- return nil, err
- }
- x := &eventsSubscribeClient{stream}
- if err := x.ClientStream.SendMsg(in); err != nil {
- return nil, err
- }
- if err := x.ClientStream.CloseSend(); err != nil {
- return nil, err
- }
- return x, nil
-}
-
-type Events_SubscribeClient interface {
- Recv() (*Envelope, error)
- grpc.ClientStream
-}
-
-type eventsSubscribeClient struct {
- grpc.ClientStream
-}
-
-func (x *eventsSubscribeClient) Recv() (*Envelope, error) {
- m := new(Envelope)
- if err := x.ClientStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
-}
-
-// EventsServer is the server API for Events service.
-type EventsServer interface {
- // Publish an event to a topic.
- //
- // The event will be packed into a timestamp envelope with the namespace
- // introspected from the context. The envelope will then be dispatched.
- Publish(context.Context, *PublishRequest) (*types.Empty, error)
- // Forward sends an event that has already been packaged into an envelope
- // with a timestamp and namespace.
- //
- // This is useful if earlier timestamping is required or when forwarding on
- // behalf of another component, namespace or publisher.
- Forward(context.Context, *ForwardRequest) (*types.Empty, error)
- // Subscribe to a stream of events, possibly returning only that match any
- // of the provided filters.
- //
- // Unlike many other methods in containerd, subscribers will get messages
- // from all namespaces unless otherwise specified. If this is not desired,
- // a filter can be provided in the format 'namespace==' to
- // restrict the received events.
- Subscribe(*SubscribeRequest, Events_SubscribeServer) error
-}
-
-// UnimplementedEventsServer can be embedded to have forward compatible implementations.
-type UnimplementedEventsServer struct {
-}
-
-func (*UnimplementedEventsServer) Publish(ctx context.Context, req *PublishRequest) (*types.Empty, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Publish not implemented")
-}
-func (*UnimplementedEventsServer) Forward(ctx context.Context, req *ForwardRequest) (*types.Empty, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Forward not implemented")
-}
-func (*UnimplementedEventsServer) Subscribe(req *SubscribeRequest, srv Events_SubscribeServer) error {
- return status.Errorf(codes.Unimplemented, "method Subscribe not implemented")
-}
-
-func RegisterEventsServer(s *grpc.Server, srv EventsServer) {
- s.RegisterService(&_Events_serviceDesc, srv)
-}
-
-func _Events_Publish_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(PublishRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(EventsServer).Publish(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.events.v1.Events/Publish",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(EventsServer).Publish(ctx, req.(*PublishRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Events_Forward_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(ForwardRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(EventsServer).Forward(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.events.v1.Events/Forward",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(EventsServer).Forward(ctx, req.(*ForwardRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Events_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error {
- m := new(SubscribeRequest)
- if err := stream.RecvMsg(m); err != nil {
- return err
- }
- return srv.(EventsServer).Subscribe(m, &eventsSubscribeServer{stream})
-}
-
-type Events_SubscribeServer interface {
- Send(*Envelope) error
- grpc.ServerStream
-}
-
-type eventsSubscribeServer struct {
- grpc.ServerStream
-}
-
-func (x *eventsSubscribeServer) Send(m *Envelope) error {
- return x.ServerStream.SendMsg(m)
-}
-
-var _Events_serviceDesc = grpc.ServiceDesc{
- ServiceName: "containerd.services.events.v1.Events",
- HandlerType: (*EventsServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "Publish",
- Handler: _Events_Publish_Handler,
- },
- {
- MethodName: "Forward",
- Handler: _Events_Forward_Handler,
- },
- },
- Streams: []grpc.StreamDesc{
- {
- StreamName: "Subscribe",
- Handler: _Events_Subscribe_Handler,
- ServerStreams: true,
- },
- },
- Metadata: "github.com/containerd/containerd/api/services/events/v1/events.proto",
-}
-
-func (m *PublishRequest) 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 *PublishRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *PublishRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Event != nil {
- {
- size, err := m.Event.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintEvents(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x12
- }
- if len(m.Topic) > 0 {
- i -= len(m.Topic)
- copy(dAtA[i:], m.Topic)
- i = encodeVarintEvents(dAtA, i, uint64(len(m.Topic)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ForwardRequest) 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 *ForwardRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ForwardRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Envelope != nil {
- {
- size, err := m.Envelope.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintEvents(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *SubscribeRequest) 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 *SubscribeRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *SubscribeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Filters) > 0 {
- for iNdEx := len(m.Filters) - 1; iNdEx >= 0; iNdEx-- {
- i -= len(m.Filters[iNdEx])
- copy(dAtA[i:], m.Filters[iNdEx])
- i = encodeVarintEvents(dAtA, i, uint64(len(m.Filters[iNdEx])))
- i--
- dAtA[i] = 0xa
- }
- }
- return len(dAtA) - i, nil
-}
-
-func (m *Envelope) 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 *Envelope) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *Envelope) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Event != nil {
- {
- size, err := m.Event.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintEvents(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x22
- }
- if len(m.Topic) > 0 {
- i -= len(m.Topic)
- copy(dAtA[i:], m.Topic)
- i = encodeVarintEvents(dAtA, i, uint64(len(m.Topic)))
- i--
- dAtA[i] = 0x1a
- }
- if len(m.Namespace) > 0 {
- i -= len(m.Namespace)
- copy(dAtA[i:], m.Namespace)
- i = encodeVarintEvents(dAtA, i, uint64(len(m.Namespace)))
- i--
- dAtA[i] = 0x12
- }
- n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):])
- if err4 != nil {
- return 0, err4
- }
- i -= n4
- i = encodeVarintEvents(dAtA, i, uint64(n4))
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func encodeVarintEvents(dAtA []byte, offset int, v uint64) int {
- offset -= sovEvents(v)
- base := offset
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return base
-}
-func (m *PublishRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Topic)
- if l > 0 {
- n += 1 + l + sovEvents(uint64(l))
- }
- if m.Event != nil {
- l = m.Event.Size()
- n += 1 + l + sovEvents(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ForwardRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Envelope != nil {
- l = m.Envelope.Size()
- n += 1 + l + sovEvents(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *SubscribeRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.Filters) > 0 {
- for _, s := range m.Filters {
- l = len(s)
- n += 1 + l + sovEvents(uint64(l))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *Envelope) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp)
- n += 1 + l + sovEvents(uint64(l))
- l = len(m.Namespace)
- if l > 0 {
- n += 1 + l + sovEvents(uint64(l))
- }
- l = len(m.Topic)
- if l > 0 {
- n += 1 + l + sovEvents(uint64(l))
- }
- if m.Event != nil {
- l = m.Event.Size()
- n += 1 + l + sovEvents(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func sovEvents(x uint64) (n int) {
- return (math_bits.Len64(x|1) + 6) / 7
-}
-func sozEvents(x uint64) (n int) {
- return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-func (this *PublishRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&PublishRequest{`,
- `Topic:` + fmt.Sprintf("%v", this.Topic) + `,`,
- `Event:` + strings.Replace(fmt.Sprintf("%v", this.Event), "Any", "types.Any", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ForwardRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ForwardRequest{`,
- `Envelope:` + strings.Replace(this.Envelope.String(), "Envelope", "Envelope", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *SubscribeRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&SubscribeRequest{`,
- `Filters:` + fmt.Sprintf("%v", this.Filters) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *Envelope) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&Envelope{`,
- `Timestamp:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Timestamp), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`,
- `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`,
- `Topic:` + fmt.Sprintf("%v", this.Topic) + `,`,
- `Event:` + strings.Replace(fmt.Sprintf("%v", this.Event), "Any", "types.Any", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func valueToStringEvents(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
-}
-func (m *PublishRequest) 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 ErrIntOverflowEvents
- }
- 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: PublishRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: PublishRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Topic", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowEvents
- }
- 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 ErrInvalidLengthEvents
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthEvents
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Topic = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Event", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowEvents
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthEvents
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthEvents
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Event == nil {
- m.Event = &types.Any{}
- }
- if err := m.Event.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipEvents(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthEvents
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthEvents
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ForwardRequest) 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 ErrIntOverflowEvents
- }
- 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: ForwardRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ForwardRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Envelope", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowEvents
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthEvents
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthEvents
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Envelope == nil {
- m.Envelope = &Envelope{}
- }
- if err := m.Envelope.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipEvents(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthEvents
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthEvents
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *SubscribeRequest) 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 ErrIntOverflowEvents
- }
- 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: SubscribeRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: SubscribeRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowEvents
- }
- 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 ErrInvalidLengthEvents
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthEvents
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Filters = append(m.Filters, string(dAtA[iNdEx:postIndex]))
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipEvents(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthEvents
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthEvents
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *Envelope) 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 ErrIntOverflowEvents
- }
- 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: Envelope: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: Envelope: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowEvents
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthEvents
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthEvents
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- 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 ErrIntOverflowEvents
- }
- 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 ErrInvalidLengthEvents
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthEvents
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Namespace = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Topic", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowEvents
- }
- 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 ErrInvalidLengthEvents
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthEvents
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Topic = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 4:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Event", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowEvents
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthEvents
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthEvents
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Event == nil {
- m.Event = &types.Any{}
- }
- if err := m.Event.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipEvents(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthEvents
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthEvents
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func skipEvents(dAtA []byte) (n int, err error) {
- l := len(dAtA)
- iNdEx := 0
- depth := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowEvents
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowEvents
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if dAtA[iNdEx-1] < 0x80 {
- break
- }
- }
- case 1:
- iNdEx += 8
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowEvents
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if length < 0 {
- return 0, ErrInvalidLengthEvents
- }
- iNdEx += length
- case 3:
- depth++
- case 4:
- if depth == 0 {
- return 0, ErrUnexpectedEndOfGroupEvents
- }
- depth--
- case 5:
- iNdEx += 4
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- if iNdEx < 0 {
- return 0, ErrInvalidLengthEvents
- }
- if depth == 0 {
- return iNdEx, nil
- }
- }
- return 0, io.ErrUnexpectedEOF
-}
-
-var (
- ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow")
- ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group")
-)
diff --git a/vendor/github.com/containerd/containerd/api/services/events/v1/events.proto b/vendor/github.com/containerd/containerd/api/services/events/v1/events.proto
deleted file mode 100644
index 1959c8e39..000000000
--- a/vendor/github.com/containerd/containerd/api/services/events/v1/events.proto
+++ /dev/null
@@ -1,56 +0,0 @@
-syntax = "proto3";
-
-package containerd.services.events.v1;
-
-import weak "github.com/containerd/containerd/protobuf/plugin/fieldpath.proto";
-import weak "gogoproto/gogo.proto";
-import "google/protobuf/any.proto";
-import "google/protobuf/empty.proto";
-import "google/protobuf/timestamp.proto";
-
-option go_package = "github.com/containerd/containerd/api/services/events/v1;events";
-
-service Events {
- // Publish an event to a topic.
- //
- // The event will be packed into a timestamp envelope with the namespace
- // introspected from the context. The envelope will then be dispatched.
- rpc Publish(PublishRequest) returns (google.protobuf.Empty);
-
- // Forward sends an event that has already been packaged into an envelope
- // with a timestamp and namespace.
- //
- // This is useful if earlier timestamping is required or when forwarding on
- // behalf of another component, namespace or publisher.
- rpc Forward(ForwardRequest) returns (google.protobuf.Empty);
-
- // Subscribe to a stream of events, possibly returning only that match any
- // of the provided filters.
- //
- // Unlike many other methods in containerd, subscribers will get messages
- // from all namespaces unless otherwise specified. If this is not desired,
- // a filter can be provided in the format 'namespace==' to
- // restrict the received events.
- rpc Subscribe(SubscribeRequest) returns (stream Envelope);
-}
-
-message PublishRequest {
- string topic = 1;
- google.protobuf.Any event = 2;
-}
-
-message ForwardRequest {
- Envelope envelope = 1;
-}
-
-message SubscribeRequest {
- repeated string filters = 1;
-}
-
-message Envelope {
- option (containerd.plugin.fieldpath) = true;
- google.protobuf.Timestamp timestamp = 1 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
- string namespace = 2;
- string topic = 3;
- google.protobuf.Any event = 4;
-}
diff --git a/vendor/github.com/containerd/containerd/api/services/images/v1/docs.go b/vendor/github.com/containerd/containerd/api/services/images/v1/docs.go
deleted file mode 100644
index 4170f38af..000000000
--- a/vendor/github.com/containerd/containerd/api/services/images/v1/docs.go
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package images
diff --git a/vendor/github.com/containerd/containerd/api/services/images/v1/images.pb.go b/vendor/github.com/containerd/containerd/api/services/images/v1/images.pb.go
deleted file mode 100644
index db912b68b..000000000
--- a/vendor/github.com/containerd/containerd/api/services/images/v1/images.pb.go
+++ /dev/null
@@ -1,2768 +0,0 @@
-// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: github.com/containerd/containerd/api/services/images/v1/images.proto
-
-package images
-
-import (
- context "context"
- fmt "fmt"
- types "github.com/containerd/containerd/api/types"
- proto "github.com/gogo/protobuf/proto"
- github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
- github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
- types1 "github.com/gogo/protobuf/types"
- grpc "google.golang.org/grpc"
- codes "google.golang.org/grpc/codes"
- status "google.golang.org/grpc/status"
- io "io"
- math "math"
- math_bits "math/bits"
- reflect "reflect"
- strings "strings"
- time "time"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-var _ = time.Kitchen
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
-
-type Image struct {
- // Name provides a unique name for the image.
- //
- // Containerd treats this as the primary identifier.
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- // Labels provides free form labels for the image. These are runtime only
- // and do not get inherited into the package image in any way.
- //
- // Labels may be updated using the field mask.
- // The combined size of a key/value pair cannot exceed 4096 bytes.
- Labels map[string]string `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- // Target describes the content entry point of the image.
- Target types.Descriptor `protobuf:"bytes,3,opt,name=target,proto3" json:"target"`
- // CreatedAt is the time the image was first created.
- CreatedAt time.Time `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at"`
- // UpdatedAt is the last time the image was mutated.
- UpdatedAt time.Time `protobuf:"bytes,8,opt,name=updated_at,json=updatedAt,proto3,stdtime" json:"updated_at"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Image) Reset() { *m = Image{} }
-func (*Image) ProtoMessage() {}
-func (*Image) Descriptor() ([]byte, []int) {
- return fileDescriptor_8666fa071128ae5f, []int{0}
-}
-func (m *Image) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Image) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_Image.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 *Image) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Image.Merge(m, src)
-}
-func (m *Image) XXX_Size() int {
- return m.Size()
-}
-func (m *Image) XXX_DiscardUnknown() {
- xxx_messageInfo_Image.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Image proto.InternalMessageInfo
-
-type GetImageRequest struct {
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *GetImageRequest) Reset() { *m = GetImageRequest{} }
-func (*GetImageRequest) ProtoMessage() {}
-func (*GetImageRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_8666fa071128ae5f, []int{1}
-}
-func (m *GetImageRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *GetImageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_GetImageRequest.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 *GetImageRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GetImageRequest.Merge(m, src)
-}
-func (m *GetImageRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *GetImageRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_GetImageRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GetImageRequest proto.InternalMessageInfo
-
-type GetImageResponse struct {
- Image *Image `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *GetImageResponse) Reset() { *m = GetImageResponse{} }
-func (*GetImageResponse) ProtoMessage() {}
-func (*GetImageResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_8666fa071128ae5f, []int{2}
-}
-func (m *GetImageResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *GetImageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_GetImageResponse.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 *GetImageResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GetImageResponse.Merge(m, src)
-}
-func (m *GetImageResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *GetImageResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_GetImageResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GetImageResponse proto.InternalMessageInfo
-
-type CreateImageRequest struct {
- Image Image `protobuf:"bytes,1,opt,name=image,proto3" json:"image"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *CreateImageRequest) Reset() { *m = CreateImageRequest{} }
-func (*CreateImageRequest) ProtoMessage() {}
-func (*CreateImageRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_8666fa071128ae5f, []int{3}
-}
-func (m *CreateImageRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *CreateImageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_CreateImageRequest.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 *CreateImageRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_CreateImageRequest.Merge(m, src)
-}
-func (m *CreateImageRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *CreateImageRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_CreateImageRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CreateImageRequest proto.InternalMessageInfo
-
-type CreateImageResponse struct {
- Image Image `protobuf:"bytes,1,opt,name=image,proto3" json:"image"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *CreateImageResponse) Reset() { *m = CreateImageResponse{} }
-func (*CreateImageResponse) ProtoMessage() {}
-func (*CreateImageResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_8666fa071128ae5f, []int{4}
-}
-func (m *CreateImageResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *CreateImageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_CreateImageResponse.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 *CreateImageResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_CreateImageResponse.Merge(m, src)
-}
-func (m *CreateImageResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *CreateImageResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_CreateImageResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CreateImageResponse proto.InternalMessageInfo
-
-type UpdateImageRequest struct {
- // Image provides a full or partial image for update.
- //
- // The name field must be set or an error will be returned.
- Image Image `protobuf:"bytes,1,opt,name=image,proto3" json:"image"`
- // UpdateMask specifies which fields to perform the update on. If empty,
- // the operation applies to all fields.
- UpdateMask *types1.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *UpdateImageRequest) Reset() { *m = UpdateImageRequest{} }
-func (*UpdateImageRequest) ProtoMessage() {}
-func (*UpdateImageRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_8666fa071128ae5f, []int{5}
-}
-func (m *UpdateImageRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *UpdateImageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_UpdateImageRequest.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 *UpdateImageRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_UpdateImageRequest.Merge(m, src)
-}
-func (m *UpdateImageRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *UpdateImageRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_UpdateImageRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_UpdateImageRequest proto.InternalMessageInfo
-
-type UpdateImageResponse struct {
- Image Image `protobuf:"bytes,1,opt,name=image,proto3" json:"image"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *UpdateImageResponse) Reset() { *m = UpdateImageResponse{} }
-func (*UpdateImageResponse) ProtoMessage() {}
-func (*UpdateImageResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_8666fa071128ae5f, []int{6}
-}
-func (m *UpdateImageResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *UpdateImageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_UpdateImageResponse.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 *UpdateImageResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_UpdateImageResponse.Merge(m, src)
-}
-func (m *UpdateImageResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *UpdateImageResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_UpdateImageResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_UpdateImageResponse proto.InternalMessageInfo
-
-type ListImagesRequest struct {
- // Filters contains one or more filters using the syntax defined in the
- // containerd filter package.
- //
- // The returned result will be those that match any of the provided
- // filters. Expanded, images that match the following will be
- // returned:
- //
- // filters[0] or filters[1] or ... or filters[n-1] or filters[n]
- //
- // If filters is zero-length or nil, all items will be returned.
- Filters []string `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ListImagesRequest) Reset() { *m = ListImagesRequest{} }
-func (*ListImagesRequest) ProtoMessage() {}
-func (*ListImagesRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_8666fa071128ae5f, []int{7}
-}
-func (m *ListImagesRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ListImagesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ListImagesRequest.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 *ListImagesRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ListImagesRequest.Merge(m, src)
-}
-func (m *ListImagesRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *ListImagesRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_ListImagesRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ListImagesRequest proto.InternalMessageInfo
-
-type ListImagesResponse struct {
- Images []Image `protobuf:"bytes,1,rep,name=images,proto3" json:"images"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ListImagesResponse) Reset() { *m = ListImagesResponse{} }
-func (*ListImagesResponse) ProtoMessage() {}
-func (*ListImagesResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_8666fa071128ae5f, []int{8}
-}
-func (m *ListImagesResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ListImagesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ListImagesResponse.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 *ListImagesResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ListImagesResponse.Merge(m, src)
-}
-func (m *ListImagesResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *ListImagesResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_ListImagesResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ListImagesResponse proto.InternalMessageInfo
-
-type DeleteImageRequest struct {
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- // Sync indicates that the delete and cleanup should be done
- // synchronously before returning to the caller
- //
- // Default is false
- Sync bool `protobuf:"varint,2,opt,name=sync,proto3" json:"sync,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *DeleteImageRequest) Reset() { *m = DeleteImageRequest{} }
-func (*DeleteImageRequest) ProtoMessage() {}
-func (*DeleteImageRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_8666fa071128ae5f, []int{9}
-}
-func (m *DeleteImageRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *DeleteImageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_DeleteImageRequest.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 *DeleteImageRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_DeleteImageRequest.Merge(m, src)
-}
-func (m *DeleteImageRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *DeleteImageRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_DeleteImageRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_DeleteImageRequest proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*Image)(nil), "containerd.services.images.v1.Image")
- proto.RegisterMapType((map[string]string)(nil), "containerd.services.images.v1.Image.LabelsEntry")
- proto.RegisterType((*GetImageRequest)(nil), "containerd.services.images.v1.GetImageRequest")
- proto.RegisterType((*GetImageResponse)(nil), "containerd.services.images.v1.GetImageResponse")
- proto.RegisterType((*CreateImageRequest)(nil), "containerd.services.images.v1.CreateImageRequest")
- proto.RegisterType((*CreateImageResponse)(nil), "containerd.services.images.v1.CreateImageResponse")
- proto.RegisterType((*UpdateImageRequest)(nil), "containerd.services.images.v1.UpdateImageRequest")
- proto.RegisterType((*UpdateImageResponse)(nil), "containerd.services.images.v1.UpdateImageResponse")
- proto.RegisterType((*ListImagesRequest)(nil), "containerd.services.images.v1.ListImagesRequest")
- proto.RegisterType((*ListImagesResponse)(nil), "containerd.services.images.v1.ListImagesResponse")
- proto.RegisterType((*DeleteImageRequest)(nil), "containerd.services.images.v1.DeleteImageRequest")
-}
-
-func init() {
- proto.RegisterFile("github.com/containerd/containerd/api/services/images/v1/images.proto", fileDescriptor_8666fa071128ae5f)
-}
-
-var fileDescriptor_8666fa071128ae5f = []byte{
- // 659 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xcd, 0x6e, 0xd3, 0x40,
- 0x10, 0x8e, 0x93, 0xd4, 0x6d, 0x27, 0x07, 0xca, 0x52, 0x21, 0xcb, 0x40, 0x1a, 0x45, 0x20, 0xe5,
- 0xc2, 0x9a, 0x86, 0x0b, 0xb4, 0x08, 0xd1, 0xb4, 0xa5, 0x20, 0x15, 0x0e, 0xe6, 0xaf, 0xe2, 0x52,
- 0x6d, 0x92, 0x89, 0xb1, 0x62, 0xc7, 0xc6, 0xbb, 0x89, 0x94, 0x1b, 0x8f, 0x80, 0x04, 0x0f, 0xd5,
- 0x23, 0x47, 0x4e, 0x40, 0x73, 0xe0, 0x39, 0x90, 0x77, 0x37, 0x34, 0x4d, 0x22, 0x92, 0x94, 0xde,
- 0x66, 0xed, 0xef, 0x9b, 0x9f, 0x6f, 0x66, 0x76, 0x61, 0xcf, 0xf3, 0xc5, 0x87, 0x6e, 0x9d, 0x36,
- 0xa2, 0xd0, 0x69, 0x44, 0x1d, 0xc1, 0xfc, 0x0e, 0x26, 0xcd, 0x51, 0x93, 0xc5, 0xbe, 0xc3, 0x31,
- 0xe9, 0xf9, 0x0d, 0xe4, 0x8e, 0x1f, 0x32, 0x0f, 0xb9, 0xd3, 0xdb, 0xd4, 0x16, 0x8d, 0x93, 0x48,
- 0x44, 0xe4, 0xd6, 0x19, 0x9e, 0x0e, 0xb1, 0x54, 0x23, 0x7a, 0x9b, 0xf6, 0xba, 0x17, 0x79, 0x91,
- 0x44, 0x3a, 0xa9, 0xa5, 0x48, 0xf6, 0x0d, 0x2f, 0x8a, 0xbc, 0x00, 0x1d, 0x79, 0xaa, 0x77, 0x5b,
- 0x0e, 0x86, 0xb1, 0xe8, 0xeb, 0x9f, 0xa5, 0xf1, 0x9f, 0x2d, 0x1f, 0x83, 0xe6, 0x71, 0xc8, 0x78,
- 0x5b, 0x23, 0x36, 0xc6, 0x11, 0xc2, 0x0f, 0x91, 0x0b, 0x16, 0xc6, 0x1a, 0xb0, 0x3d, 0x57, 0x69,
- 0xa2, 0x1f, 0x23, 0x77, 0x9a, 0xc8, 0x1b, 0x89, 0x1f, 0x8b, 0x28, 0x51, 0xe4, 0xf2, 0xef, 0x2c,
- 0x2c, 0x3d, 0x4f, 0x0b, 0x20, 0x04, 0xf2, 0x1d, 0x16, 0xa2, 0x65, 0x94, 0x8c, 0xca, 0xaa, 0x2b,
- 0x6d, 0xf2, 0x0c, 0xcc, 0x80, 0xd5, 0x31, 0xe0, 0x56, 0xb6, 0x94, 0xab, 0x14, 0xaa, 0xf7, 0xe8,
- 0x3f, 0x05, 0xa0, 0xd2, 0x13, 0x3d, 0x94, 0x94, 0xfd, 0x8e, 0x48, 0xfa, 0xae, 0xe6, 0x93, 0x2d,
- 0x30, 0x05, 0x4b, 0x3c, 0x14, 0x56, 0xae, 0x64, 0x54, 0x0a, 0xd5, 0x9b, 0xa3, 0x9e, 0x64, 0x6e,
- 0x74, 0xef, 0x6f, 0x6e, 0xb5, 0xfc, 0xc9, 0x8f, 0x8d, 0x8c, 0xab, 0x19, 0x64, 0x17, 0xa0, 0x91,
- 0x20, 0x13, 0xd8, 0x3c, 0x66, 0xc2, 0x5a, 0x96, 0x7c, 0x9b, 0x2a, 0x59, 0xe8, 0x50, 0x16, 0xfa,
- 0x7a, 0x28, 0x4b, 0x6d, 0x25, 0x65, 0x7f, 0xfe, 0xb9, 0x61, 0xb8, 0xab, 0x9a, 0xb7, 0x23, 0x9d,
- 0x74, 0xe3, 0xe6, 0xd0, 0xc9, 0xca, 0x22, 0x4e, 0x34, 0x6f, 0x47, 0xd8, 0x0f, 0xa1, 0x30, 0x52,
- 0x1c, 0x59, 0x83, 0x5c, 0x1b, 0xfb, 0x5a, 0xb1, 0xd4, 0x24, 0xeb, 0xb0, 0xd4, 0x63, 0x41, 0x17,
- 0xad, 0xac, 0xfc, 0xa6, 0x0e, 0x5b, 0xd9, 0x07, 0x46, 0xf9, 0x0e, 0x5c, 0x39, 0x40, 0x21, 0x05,
- 0x72, 0xf1, 0x63, 0x17, 0xb9, 0x98, 0xa6, 0x78, 0xf9, 0x25, 0xac, 0x9d, 0xc1, 0x78, 0x1c, 0x75,
- 0x38, 0x92, 0x2d, 0x58, 0x92, 0x12, 0x4b, 0x60, 0xa1, 0x7a, 0x7b, 0x9e, 0x26, 0xb8, 0x8a, 0x52,
- 0x7e, 0x0b, 0x64, 0x57, 0x6a, 0x70, 0x2e, 0xf2, 0x93, 0x0b, 0x78, 0xd4, 0x4d, 0xd1, 0x7e, 0xdf,
- 0xc1, 0xb5, 0x73, 0x7e, 0x75, 0xaa, 0xff, 0xef, 0xf8, 0x8b, 0x01, 0xe4, 0x8d, 0x14, 0xfc, 0x72,
- 0x33, 0x26, 0xdb, 0x50, 0x50, 0x8d, 0x94, 0xcb, 0x25, 0x1b, 0x34, 0x6d, 0x02, 0x9e, 0xa6, 0xfb,
- 0xf7, 0x82, 0xf1, 0xb6, 0xab, 0xe7, 0x25, 0xb5, 0xd3, 0x72, 0xcf, 0x25, 0x75, 0x69, 0xe5, 0xde,
- 0x85, 0xab, 0x87, 0x3e, 0x57, 0x0d, 0xe7, 0xc3, 0x62, 0x2d, 0x58, 0x6e, 0xf9, 0x81, 0xc0, 0x84,
- 0x5b, 0x46, 0x29, 0x57, 0x59, 0x75, 0x87, 0xc7, 0xf2, 0x11, 0x90, 0x51, 0xb8, 0x4e, 0xa3, 0x06,
- 0xa6, 0x0a, 0x22, 0xe1, 0x8b, 0xe5, 0xa1, 0x99, 0xe5, 0x47, 0x40, 0xf6, 0x30, 0xc0, 0x31, 0xd9,
- 0xa7, 0x5d, 0x0a, 0x04, 0xf2, 0xbc, 0xdf, 0x69, 0x48, 0x05, 0x57, 0x5c, 0x69, 0x57, 0xbf, 0xe6,
- 0xc1, 0x54, 0x49, 0x91, 0x16, 0xe4, 0x0e, 0x50, 0x10, 0x3a, 0x23, 0x87, 0xb1, 0x65, 0xb0, 0x9d,
- 0xb9, 0xf1, 0xba, 0xe8, 0x36, 0xe4, 0x53, 0x29, 0xc8, 0xac, 0x3b, 0x69, 0x42, 0x5e, 0x7b, 0x73,
- 0x01, 0x86, 0x0e, 0x16, 0x81, 0xa9, 0xc6, 0x9d, 0xcc, 0x22, 0x4f, 0x6e, 0x9b, 0x5d, 0x5d, 0x84,
- 0x72, 0x16, 0x50, 0x0d, 0xdc, 0xcc, 0x80, 0x93, 0xcb, 0x32, 0x33, 0xe0, 0xb4, 0x51, 0x7e, 0x05,
- 0xa6, 0xea, 0xff, 0xcc, 0x80, 0x93, 0x63, 0x62, 0x5f, 0x9f, 0x58, 0xa3, 0xfd, 0xf4, 0x8d, 0xab,
- 0x1d, 0x9d, 0x9c, 0x16, 0x33, 0xdf, 0x4f, 0x8b, 0x99, 0x4f, 0x83, 0xa2, 0x71, 0x32, 0x28, 0x1a,
- 0xdf, 0x06, 0x45, 0xe3, 0xd7, 0xa0, 0x68, 0xbc, 0x7f, 0x7c, 0xc1, 0xf7, 0x78, 0x5b, 0x59, 0x47,
- 0x99, 0xba, 0x29, 0x63, 0xdd, 0xff, 0x13, 0x00, 0x00, 0xff, 0xff, 0x24, 0x4e, 0xca, 0x64, 0xda,
- 0x07, 0x00, 0x00,
-}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ context.Context
-var _ grpc.ClientConn
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion4
-
-// ImagesClient is the client API for Images service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type ImagesClient interface {
- // Get returns an image by name.
- Get(ctx context.Context, in *GetImageRequest, opts ...grpc.CallOption) (*GetImageResponse, error)
- // List returns a list of all images known to containerd.
- List(ctx context.Context, in *ListImagesRequest, opts ...grpc.CallOption) (*ListImagesResponse, error)
- // Create an image record in the metadata store.
- //
- // The name of the image must be unique.
- Create(ctx context.Context, in *CreateImageRequest, opts ...grpc.CallOption) (*CreateImageResponse, error)
- // Update assigns the name to a given target image based on the provided
- // image.
- Update(ctx context.Context, in *UpdateImageRequest, opts ...grpc.CallOption) (*UpdateImageResponse, error)
- // Delete deletes the image by name.
- Delete(ctx context.Context, in *DeleteImageRequest, opts ...grpc.CallOption) (*types1.Empty, error)
-}
-
-type imagesClient struct {
- cc *grpc.ClientConn
-}
-
-func NewImagesClient(cc *grpc.ClientConn) ImagesClient {
- return &imagesClient{cc}
-}
-
-func (c *imagesClient) Get(ctx context.Context, in *GetImageRequest, opts ...grpc.CallOption) (*GetImageResponse, error) {
- out := new(GetImageResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.images.v1.Images/Get", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *imagesClient) List(ctx context.Context, in *ListImagesRequest, opts ...grpc.CallOption) (*ListImagesResponse, error) {
- out := new(ListImagesResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.images.v1.Images/List", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *imagesClient) Create(ctx context.Context, in *CreateImageRequest, opts ...grpc.CallOption) (*CreateImageResponse, error) {
- out := new(CreateImageResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.images.v1.Images/Create", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *imagesClient) Update(ctx context.Context, in *UpdateImageRequest, opts ...grpc.CallOption) (*UpdateImageResponse, error) {
- out := new(UpdateImageResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.images.v1.Images/Update", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *imagesClient) Delete(ctx context.Context, in *DeleteImageRequest, opts ...grpc.CallOption) (*types1.Empty, error) {
- out := new(types1.Empty)
- err := c.cc.Invoke(ctx, "/containerd.services.images.v1.Images/Delete", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// ImagesServer is the server API for Images service.
-type ImagesServer interface {
- // Get returns an image by name.
- Get(context.Context, *GetImageRequest) (*GetImageResponse, error)
- // List returns a list of all images known to containerd.
- List(context.Context, *ListImagesRequest) (*ListImagesResponse, error)
- // Create an image record in the metadata store.
- //
- // The name of the image must be unique.
- Create(context.Context, *CreateImageRequest) (*CreateImageResponse, error)
- // Update assigns the name to a given target image based on the provided
- // image.
- Update(context.Context, *UpdateImageRequest) (*UpdateImageResponse, error)
- // Delete deletes the image by name.
- Delete(context.Context, *DeleteImageRequest) (*types1.Empty, error)
-}
-
-// UnimplementedImagesServer can be embedded to have forward compatible implementations.
-type UnimplementedImagesServer struct {
-}
-
-func (*UnimplementedImagesServer) Get(ctx context.Context, req *GetImageRequest) (*GetImageResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
-}
-func (*UnimplementedImagesServer) List(ctx context.Context, req *ListImagesRequest) (*ListImagesResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
-}
-func (*UnimplementedImagesServer) Create(ctx context.Context, req *CreateImageRequest) (*CreateImageResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
-}
-func (*UnimplementedImagesServer) Update(ctx context.Context, req *UpdateImageRequest) (*UpdateImageResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
-}
-func (*UnimplementedImagesServer) Delete(ctx context.Context, req *DeleteImageRequest) (*types1.Empty, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
-}
-
-func RegisterImagesServer(s *grpc.Server, srv ImagesServer) {
- s.RegisterService(&_Images_serviceDesc, srv)
-}
-
-func _Images_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(GetImageRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ImagesServer).Get(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.images.v1.Images/Get",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ImagesServer).Get(ctx, req.(*GetImageRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Images_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(ListImagesRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ImagesServer).List(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.images.v1.Images/List",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ImagesServer).List(ctx, req.(*ListImagesRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Images_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(CreateImageRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ImagesServer).Create(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.images.v1.Images/Create",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ImagesServer).Create(ctx, req.(*CreateImageRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Images_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(UpdateImageRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ImagesServer).Update(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.images.v1.Images/Update",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ImagesServer).Update(ctx, req.(*UpdateImageRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Images_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(DeleteImageRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(ImagesServer).Delete(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.images.v1.Images/Delete",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(ImagesServer).Delete(ctx, req.(*DeleteImageRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-var _Images_serviceDesc = grpc.ServiceDesc{
- ServiceName: "containerd.services.images.v1.Images",
- HandlerType: (*ImagesServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "Get",
- Handler: _Images_Get_Handler,
- },
- {
- MethodName: "List",
- Handler: _Images_List_Handler,
- },
- {
- MethodName: "Create",
- Handler: _Images_Create_Handler,
- },
- {
- MethodName: "Update",
- Handler: _Images_Update_Handler,
- },
- {
- MethodName: "Delete",
- Handler: _Images_Delete_Handler,
- },
- },
- Streams: []grpc.StreamDesc{},
- Metadata: "github.com/containerd/containerd/api/services/images/v1/images.proto",
-}
-
-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
- }
- 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.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.UpdatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.UpdatedAt):])
- if err1 != nil {
- return 0, err1
- }
- i -= n1
- i = encodeVarintImages(dAtA, i, uint64(n1))
- i--
- dAtA[i] = 0x42
- n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt):])
- if err2 != nil {
- return 0, err2
- }
- i -= n2
- i = encodeVarintImages(dAtA, i, uint64(n2))
- i--
- dAtA[i] = 0x3a
- {
- size, err := m.Target.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintImages(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x1a
- if len(m.Labels) > 0 {
- for k := range m.Labels {
- v := m.Labels[k]
- baseI := i
- i -= len(v)
- copy(dAtA[i:], v)
- i = encodeVarintImages(dAtA, i, uint64(len(v)))
- i--
- dAtA[i] = 0x12
- i -= len(k)
- copy(dAtA[i:], k)
- i = encodeVarintImages(dAtA, i, uint64(len(k)))
- i--
- dAtA[i] = 0xa
- i = encodeVarintImages(dAtA, i, uint64(baseI-i))
- i--
- dAtA[i] = 0x12
- }
- }
- if len(m.Name) > 0 {
- i -= len(m.Name)
- copy(dAtA[i:], m.Name)
- i = encodeVarintImages(dAtA, i, uint64(len(m.Name)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *GetImageRequest) 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 *GetImageRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *GetImageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Name) > 0 {
- i -= len(m.Name)
- copy(dAtA[i:], m.Name)
- i = encodeVarintImages(dAtA, i, uint64(len(m.Name)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *GetImageResponse) 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 *GetImageResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *GetImageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Image != nil {
- {
- size, err := m.Image.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintImages(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *CreateImageRequest) 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 *CreateImageRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *CreateImageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- {
- size, err := m.Image.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintImages(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func (m *CreateImageResponse) 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 *CreateImageResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *CreateImageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- {
- size, err := m.Image.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintImages(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func (m *UpdateImageRequest) 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 *UpdateImageRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *UpdateImageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.UpdateMask != nil {
- {
- size, err := m.UpdateMask.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintImages(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x12
- }
- {
- size, err := m.Image.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintImages(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func (m *UpdateImageResponse) 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 *UpdateImageResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *UpdateImageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- {
- size, err := m.Image.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintImages(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func (m *ListImagesRequest) 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 *ListImagesRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ListImagesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Filters) > 0 {
- for iNdEx := len(m.Filters) - 1; iNdEx >= 0; iNdEx-- {
- i -= len(m.Filters[iNdEx])
- copy(dAtA[i:], m.Filters[iNdEx])
- i = encodeVarintImages(dAtA, i, uint64(len(m.Filters[iNdEx])))
- i--
- dAtA[i] = 0xa
- }
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ListImagesResponse) 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 *ListImagesResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ListImagesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Images) > 0 {
- for iNdEx := len(m.Images) - 1; iNdEx >= 0; iNdEx-- {
- {
- size, err := m.Images[iNdEx].MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintImages(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- }
- }
- return len(dAtA) - i, nil
-}
-
-func (m *DeleteImageRequest) 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 *DeleteImageRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *DeleteImageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Sync {
- i--
- if m.Sync {
- dAtA[i] = 1
- } else {
- dAtA[i] = 0
- }
- i--
- dAtA[i] = 0x10
- }
- if len(m.Name) > 0 {
- i -= len(m.Name)
- copy(dAtA[i:], m.Name)
- i = encodeVarintImages(dAtA, i, uint64(len(m.Name)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func encodeVarintImages(dAtA []byte, offset int, v uint64) int {
- offset -= sovImages(v)
- base := offset
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return base
-}
-func (m *Image) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Name)
- if l > 0 {
- n += 1 + l + sovImages(uint64(l))
- }
- if len(m.Labels) > 0 {
- for k, v := range m.Labels {
- _ = k
- _ = v
- mapEntrySize := 1 + len(k) + sovImages(uint64(len(k))) + 1 + len(v) + sovImages(uint64(len(v)))
- n += mapEntrySize + 1 + sovImages(uint64(mapEntrySize))
- }
- }
- l = m.Target.Size()
- n += 1 + l + sovImages(uint64(l))
- l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt)
- n += 1 + l + sovImages(uint64(l))
- l = github_com_gogo_protobuf_types.SizeOfStdTime(m.UpdatedAt)
- n += 1 + l + sovImages(uint64(l))
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *GetImageRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Name)
- if l > 0 {
- n += 1 + l + sovImages(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *GetImageResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Image != nil {
- l = m.Image.Size()
- n += 1 + l + sovImages(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *CreateImageRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = m.Image.Size()
- n += 1 + l + sovImages(uint64(l))
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *CreateImageResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = m.Image.Size()
- n += 1 + l + sovImages(uint64(l))
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *UpdateImageRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = m.Image.Size()
- n += 1 + l + sovImages(uint64(l))
- if m.UpdateMask != nil {
- l = m.UpdateMask.Size()
- n += 1 + l + sovImages(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *UpdateImageResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = m.Image.Size()
- n += 1 + l + sovImages(uint64(l))
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ListImagesRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.Filters) > 0 {
- for _, s := range m.Filters {
- l = len(s)
- n += 1 + l + sovImages(uint64(l))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ListImagesResponse) 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 + sovImages(uint64(l))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *DeleteImageRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Name)
- if l > 0 {
- n += 1 + l + sovImages(uint64(l))
- }
- if m.Sync {
- n += 2
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func sovImages(x uint64) (n int) {
- return (math_bits.Len64(x|1) + 6) / 7
-}
-func sozImages(x uint64) (n int) {
- return sovImages(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-func (this *Image) 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 += "}"
- s := strings.Join([]string{`&Image{`,
- `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
- `Labels:` + mapStringForLabels + `,`,
- `Target:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Target), "Descriptor", "types.Descriptor", 1), `&`, ``, 1) + `,`,
- `CreatedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.CreatedAt), "Timestamp", "types1.Timestamp", 1), `&`, ``, 1) + `,`,
- `UpdatedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.UpdatedAt), "Timestamp", "types1.Timestamp", 1), `&`, ``, 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *GetImageRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&GetImageRequest{`,
- `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *GetImageResponse) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&GetImageResponse{`,
- `Image:` + strings.Replace(this.Image.String(), "Image", "Image", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *CreateImageRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&CreateImageRequest{`,
- `Image:` + strings.Replace(strings.Replace(this.Image.String(), "Image", "Image", 1), `&`, ``, 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *CreateImageResponse) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&CreateImageResponse{`,
- `Image:` + strings.Replace(strings.Replace(this.Image.String(), "Image", "Image", 1), `&`, ``, 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *UpdateImageRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&UpdateImageRequest{`,
- `Image:` + strings.Replace(strings.Replace(this.Image.String(), "Image", "Image", 1), `&`, ``, 1) + `,`,
- `UpdateMask:` + strings.Replace(fmt.Sprintf("%v", this.UpdateMask), "FieldMask", "types1.FieldMask", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *UpdateImageResponse) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&UpdateImageResponse{`,
- `Image:` + strings.Replace(strings.Replace(this.Image.String(), "Image", "Image", 1), `&`, ``, 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ListImagesRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ListImagesRequest{`,
- `Filters:` + fmt.Sprintf("%v", this.Filters) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ListImagesResponse) String() string {
- if this == nil {
- return "nil"
- }
- repeatedStringForImages := "[]Image{"
- for _, f := range this.Images {
- repeatedStringForImages += strings.Replace(strings.Replace(f.String(), "Image", "Image", 1), `&`, ``, 1) + ","
- }
- repeatedStringForImages += "}"
- s := strings.Join([]string{`&ListImagesResponse{`,
- `Images:` + repeatedStringForImages + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *DeleteImageRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&DeleteImageRequest{`,
- `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
- `Sync:` + fmt.Sprintf("%v", this.Sync) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func valueToStringImages(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
-}
-func (m *Image) 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 ErrIntOverflowImages
- }
- 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: Image: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: Image: 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 ErrIntOverflowImages
- }
- 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 ErrInvalidLengthImages
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthImages
- }
- 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 Labels", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowImages
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthImages
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthImages
- }
- 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 ErrIntOverflowImages
- }
- 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 ErrIntOverflowImages
- }
- 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 ErrInvalidLengthImages
- }
- postStringIndexmapkey := iNdEx + intStringLenmapkey
- if postStringIndexmapkey < 0 {
- return ErrInvalidLengthImages
- }
- 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 ErrIntOverflowImages
- }
- 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 ErrInvalidLengthImages
- }
- postStringIndexmapvalue := iNdEx + intStringLenmapvalue
- if postStringIndexmapvalue < 0 {
- return ErrInvalidLengthImages
- }
- if postStringIndexmapvalue > l {
- return io.ErrUnexpectedEOF
- }
- mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
- iNdEx = postStringIndexmapvalue
- } else {
- iNdEx = entryPreIndex
- skippy, err := skipImages(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthImages
- }
- if (iNdEx + skippy) > postIndex {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- m.Labels[mapkey] = mapvalue
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Target", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowImages
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthImages
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthImages
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.Target.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 7:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowImages
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthImages
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthImages
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CreatedAt, dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 8:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field UpdatedAt", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowImages
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthImages
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthImages
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.UpdatedAt, dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipImages(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthImages
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthImages
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *GetImageRequest) 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 ErrIntOverflowImages
- }
- 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: GetImageRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: GetImageRequest: 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 ErrIntOverflowImages
- }
- 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 ErrInvalidLengthImages
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthImages
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Name = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipImages(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthImages
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthImages
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *GetImageResponse) 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 ErrIntOverflowImages
- }
- 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: GetImageResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: GetImageResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowImages
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthImages
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthImages
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Image == nil {
- m.Image = &Image{}
- }
- if err := m.Image.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipImages(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthImages
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthImages
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *CreateImageRequest) 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 ErrIntOverflowImages
- }
- 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: CreateImageRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: CreateImageRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowImages
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthImages
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthImages
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.Image.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipImages(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthImages
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthImages
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *CreateImageResponse) 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 ErrIntOverflowImages
- }
- 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: CreateImageResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: CreateImageResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowImages
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthImages
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthImages
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.Image.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipImages(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthImages
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthImages
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *UpdateImageRequest) 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 ErrIntOverflowImages
- }
- 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: UpdateImageRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: UpdateImageRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowImages
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthImages
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthImages
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.Image.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field UpdateMask", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowImages
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthImages
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthImages
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.UpdateMask == nil {
- m.UpdateMask = &types1.FieldMask{}
- }
- if err := m.UpdateMask.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipImages(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthImages
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthImages
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *UpdateImageResponse) 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 ErrIntOverflowImages
- }
- 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: UpdateImageResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: UpdateImageResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowImages
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthImages
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthImages
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.Image.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipImages(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthImages
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthImages
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ListImagesRequest) 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 ErrIntOverflowImages
- }
- 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: ListImagesRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ListImagesRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowImages
- }
- 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 ErrInvalidLengthImages
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthImages
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Filters = append(m.Filters, string(dAtA[iNdEx:postIndex]))
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipImages(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthImages
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthImages
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ListImagesResponse) 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 ErrIntOverflowImages
- }
- 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: ListImagesResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ListImagesResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Images", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowImages
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthImages
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthImages
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Images = append(m.Images, Image{})
- if err := m.Images[len(m.Images)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipImages(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthImages
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthImages
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *DeleteImageRequest) 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 ErrIntOverflowImages
- }
- 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: DeleteImageRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: DeleteImageRequest: 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 ErrIntOverflowImages
- }
- 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 ErrInvalidLengthImages
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthImages
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Name = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Sync", wireType)
- }
- var v int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowImages
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.Sync = bool(v != 0)
- default:
- iNdEx = preIndex
- skippy, err := skipImages(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthImages
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthImages
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func skipImages(dAtA []byte) (n int, err error) {
- l := len(dAtA)
- iNdEx := 0
- depth := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowImages
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowImages
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if dAtA[iNdEx-1] < 0x80 {
- break
- }
- }
- case 1:
- iNdEx += 8
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowImages
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if length < 0 {
- return 0, ErrInvalidLengthImages
- }
- iNdEx += length
- case 3:
- depth++
- case 4:
- if depth == 0 {
- return 0, ErrUnexpectedEndOfGroupImages
- }
- depth--
- case 5:
- iNdEx += 4
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- if iNdEx < 0 {
- return 0, ErrInvalidLengthImages
- }
- if depth == 0 {
- return iNdEx, nil
- }
- }
- return 0, io.ErrUnexpectedEOF
-}
-
-var (
- ErrInvalidLengthImages = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowImages = fmt.Errorf("proto: integer overflow")
- ErrUnexpectedEndOfGroupImages = fmt.Errorf("proto: unexpected end of group")
-)
diff --git a/vendor/github.com/containerd/containerd/api/services/images/v1/images.proto b/vendor/github.com/containerd/containerd/api/services/images/v1/images.proto
deleted file mode 100644
index 152ade2a0..000000000
--- a/vendor/github.com/containerd/containerd/api/services/images/v1/images.proto
+++ /dev/null
@@ -1,124 +0,0 @@
-syntax = "proto3";
-
-package containerd.services.images.v1;
-
-import weak "gogoproto/gogo.proto";
-import "google/protobuf/empty.proto";
-import "google/protobuf/field_mask.proto";
-import "google/protobuf/timestamp.proto";
-import "github.com/containerd/containerd/api/types/descriptor.proto";
-
-option go_package = "github.com/containerd/containerd/api/services/images/v1;images";
-
-// Images is a service that allows one to register images with containerd.
-//
-// In containerd, an image is merely the mapping of a name to a content root,
-// described by a descriptor. The behavior and state of image is purely
-// dictated by the type of the descriptor.
-//
-// From the perspective of this service, these references are mostly shallow,
-// in that the existence of the required content won't be validated until
-// required by consuming services.
-//
-// As such, this can really be considered a "metadata service".
-service Images {
- // Get returns an image by name.
- rpc Get(GetImageRequest) returns (GetImageResponse);
-
- // List returns a list of all images known to containerd.
- rpc List(ListImagesRequest) returns (ListImagesResponse);
-
- // Create an image record in the metadata store.
- //
- // The name of the image must be unique.
- rpc Create(CreateImageRequest) returns (CreateImageResponse);
-
- // Update assigns the name to a given target image based on the provided
- // image.
- rpc Update(UpdateImageRequest) returns (UpdateImageResponse);
-
- // Delete deletes the image by name.
- rpc Delete(DeleteImageRequest) returns (google.protobuf.Empty);
-}
-
-message Image {
- // Name provides a unique name for the image.
- //
- // Containerd treats this as the primary identifier.
- string name = 1;
-
- // Labels provides free form labels for the image. These are runtime only
- // and do not get inherited into the package image in any way.
- //
- // Labels may be updated using the field mask.
- // The combined size of a key/value pair cannot exceed 4096 bytes.
- map labels = 2;
-
- // Target describes the content entry point of the image.
- containerd.types.Descriptor target = 3 [(gogoproto.nullable) = false];
-
- // CreatedAt is the time the image was first created.
- google.protobuf.Timestamp created_at = 7 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
-
- // UpdatedAt is the last time the image was mutated.
- google.protobuf.Timestamp updated_at = 8 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
-}
-
-message GetImageRequest {
- string name = 1;
-}
-
-message GetImageResponse {
- Image image = 1;
-}
-
-message CreateImageRequest {
- Image image = 1 [(gogoproto.nullable) = false];
-}
-
-message CreateImageResponse {
- Image image = 1 [(gogoproto.nullable) = false];
-}
-
-message UpdateImageRequest {
- // Image provides a full or partial image for update.
- //
- // The name field must be set or an error will be returned.
- Image image = 1 [(gogoproto.nullable) = false];
-
- // UpdateMask specifies which fields to perform the update on. If empty,
- // the operation applies to all fields.
- google.protobuf.FieldMask update_mask = 2;
-}
-
-message UpdateImageResponse {
- Image image = 1 [(gogoproto.nullable) = false];
-}
-
-message ListImagesRequest {
- // Filters contains one or more filters using the syntax defined in the
- // containerd filter package.
- //
- // The returned result will be those that match any of the provided
- // filters. Expanded, images that match the following will be
- // returned:
- //
- // filters[0] or filters[1] or ... or filters[n-1] or filters[n]
- //
- // If filters is zero-length or nil, all items will be returned.
- repeated string filters = 1;
-}
-
-message ListImagesResponse {
- repeated Image images = 1 [(gogoproto.nullable) = false];
-}
-
-message DeleteImageRequest {
- string name = 1;
-
- // Sync indicates that the delete and cleanup should be done
- // synchronously before returning to the caller
- //
- // Default is false
- bool sync = 2;
-}
diff --git a/vendor/github.com/containerd/containerd/api/services/introspection/v1/doc.go b/vendor/github.com/containerd/containerd/api/services/introspection/v1/doc.go
deleted file mode 100644
index f6f65eadf..000000000
--- a/vendor/github.com/containerd/containerd/api/services/introspection/v1/doc.go
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package introspection
diff --git a/vendor/github.com/containerd/containerd/api/services/introspection/v1/introspection.pb.go b/vendor/github.com/containerd/containerd/api/services/introspection/v1/introspection.pb.go
deleted file mode 100644
index b9f912b09..000000000
--- a/vendor/github.com/containerd/containerd/api/services/introspection/v1/introspection.pb.go
+++ /dev/null
@@ -1,1548 +0,0 @@
-// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: github.com/containerd/containerd/api/services/introspection/v1/introspection.proto
-
-package introspection
-
-import (
- context "context"
- fmt "fmt"
- types "github.com/containerd/containerd/api/types"
- rpc "github.com/gogo/googleapis/google/rpc"
- proto "github.com/gogo/protobuf/proto"
- github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
- types1 "github.com/gogo/protobuf/types"
- grpc "google.golang.org/grpc"
- codes "google.golang.org/grpc/codes"
- status "google.golang.org/grpc/status"
- io "io"
- math "math"
- math_bits "math/bits"
- reflect "reflect"
- strings "strings"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
-
-type Plugin struct {
- // Type defines the type of plugin.
- //
- // See package plugin for a list of possible values. Non core plugins may
- // define their own values during registration.
- Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
- // ID identifies the plugin uniquely in the system.
- ID string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
- // Requires lists the plugin types required by this plugin.
- Requires []string `protobuf:"bytes,3,rep,name=requires,proto3" json:"requires,omitempty"`
- // Platforms enumerates the platforms this plugin will support.
- //
- // If values are provided here, the plugin will only be operable under the
- // provided platforms.
- //
- // If this is empty, the plugin will work across all platforms.
- //
- // If the plugin prefers certain platforms over others, they should be
- // listed from most to least preferred.
- Platforms []types.Platform `protobuf:"bytes,4,rep,name=platforms,proto3" json:"platforms"`
- // Exports allows plugins to provide values about state or configuration to
- // interested parties.
- //
- // One example is exposing the configured path of a snapshotter plugin.
- Exports map[string]string `protobuf:"bytes,5,rep,name=exports,proto3" json:"exports,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- // Capabilities allows plugins to communicate feature switches to allow
- // clients to detect features that may not be on be default or may be
- // different from version to version.
- //
- // Use this sparingly.
- Capabilities []string `protobuf:"bytes,6,rep,name=capabilities,proto3" json:"capabilities,omitempty"`
- // InitErr will be set if the plugin fails initialization.
- //
- // This means the plugin may have been registered but a non-terminal error
- // was encountered during initialization.
- //
- // Plugins that have this value set cannot be used.
- InitErr *rpc.Status `protobuf:"bytes,7,opt,name=init_err,json=initErr,proto3" json:"init_err,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Plugin) Reset() { *m = Plugin{} }
-func (*Plugin) ProtoMessage() {}
-func (*Plugin) Descriptor() ([]byte, []int) {
- return fileDescriptor_1a14fda866f10715, []int{0}
-}
-func (m *Plugin) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Plugin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_Plugin.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 *Plugin) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Plugin.Merge(m, src)
-}
-func (m *Plugin) XXX_Size() int {
- return m.Size()
-}
-func (m *Plugin) XXX_DiscardUnknown() {
- xxx_messageInfo_Plugin.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Plugin proto.InternalMessageInfo
-
-type PluginsRequest struct {
- // Filters contains one or more filters using the syntax defined in the
- // containerd filter package.
- //
- // The returned result will be those that match any of the provided
- // filters. Expanded, plugins that match the following will be
- // returned:
- //
- // filters[0] or filters[1] or ... or filters[n-1] or filters[n]
- //
- // If filters is zero-length or nil, all items will be returned.
- Filters []string `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *PluginsRequest) Reset() { *m = PluginsRequest{} }
-func (*PluginsRequest) ProtoMessage() {}
-func (*PluginsRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_1a14fda866f10715, []int{1}
-}
-func (m *PluginsRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PluginsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_PluginsRequest.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 *PluginsRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PluginsRequest.Merge(m, src)
-}
-func (m *PluginsRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *PluginsRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_PluginsRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_PluginsRequest proto.InternalMessageInfo
-
-type PluginsResponse struct {
- Plugins []Plugin `protobuf:"bytes,1,rep,name=plugins,proto3" json:"plugins"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *PluginsResponse) Reset() { *m = PluginsResponse{} }
-func (*PluginsResponse) ProtoMessage() {}
-func (*PluginsResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_1a14fda866f10715, []int{2}
-}
-func (m *PluginsResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PluginsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_PluginsResponse.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 *PluginsResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PluginsResponse.Merge(m, src)
-}
-func (m *PluginsResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *PluginsResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_PluginsResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_PluginsResponse proto.InternalMessageInfo
-
-type ServerResponse struct {
- UUID string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ServerResponse) Reset() { *m = ServerResponse{} }
-func (*ServerResponse) ProtoMessage() {}
-func (*ServerResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_1a14fda866f10715, []int{3}
-}
-func (m *ServerResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ServerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ServerResponse.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 *ServerResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ServerResponse.Merge(m, src)
-}
-func (m *ServerResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *ServerResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_ServerResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ServerResponse proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*Plugin)(nil), "containerd.services.introspection.v1.Plugin")
- proto.RegisterMapType((map[string]string)(nil), "containerd.services.introspection.v1.Plugin.ExportsEntry")
- proto.RegisterType((*PluginsRequest)(nil), "containerd.services.introspection.v1.PluginsRequest")
- proto.RegisterType((*PluginsResponse)(nil), "containerd.services.introspection.v1.PluginsResponse")
- proto.RegisterType((*ServerResponse)(nil), "containerd.services.introspection.v1.ServerResponse")
-}
-
-func init() {
- proto.RegisterFile("github.com/containerd/containerd/api/services/introspection/v1/introspection.proto", fileDescriptor_1a14fda866f10715)
-}
-
-var fileDescriptor_1a14fda866f10715 = []byte{
- // 549 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xc1, 0x6e, 0xd3, 0x40,
- 0x10, 0xad, 0x9d, 0x34, 0x6e, 0x37, 0xa5, 0xa0, 0x55, 0x55, 0x2c, 0x83, 0x9c, 0x28, 0xe2, 0x10,
- 0x21, 0x58, 0xab, 0x01, 0x24, 0x5a, 0x24, 0x0e, 0x51, 0x73, 0x88, 0xd4, 0x43, 0xe5, 0xa8, 0x08,
- 0x71, 0xa9, 0x1c, 0x67, 0x63, 0x56, 0x38, 0xde, 0xed, 0xee, 0xda, 0x22, 0x37, 0x3e, 0x2f, 0x47,
- 0x8e, 0x9c, 0x02, 0xf5, 0x37, 0xf0, 0x01, 0xc8, 0xbb, 0x76, 0x9a, 0xdc, 0x12, 0x71, 0x9b, 0x79,
- 0x33, 0x6f, 0xe6, 0xcd, 0xf3, 0xca, 0xc0, 0x8f, 0x88, 0xfc, 0x9a, 0x8e, 0x51, 0x48, 0x67, 0x5e,
- 0x48, 0x13, 0x19, 0x90, 0x04, 0xf3, 0xc9, 0x7a, 0x18, 0x30, 0xe2, 0x09, 0xcc, 0x33, 0x12, 0x62,
- 0xe1, 0x91, 0x44, 0x72, 0x2a, 0x18, 0x0e, 0x25, 0xa1, 0x89, 0x97, 0x9d, 0x6d, 0x02, 0x88, 0x71,
- 0x2a, 0x29, 0x7c, 0xf1, 0xc0, 0x46, 0x15, 0x13, 0x6d, 0x36, 0x66, 0x67, 0xce, 0xf9, 0x56, 0x9b,
- 0xe5, 0x9c, 0x61, 0xe1, 0xb1, 0x38, 0x90, 0x53, 0xca, 0x67, 0x7a, 0x81, 0xf3, 0x34, 0xa2, 0x34,
- 0x8a, 0xb1, 0xc7, 0x59, 0xe8, 0x09, 0x19, 0xc8, 0x54, 0x94, 0x85, 0x67, 0x65, 0x41, 0x65, 0xe3,
- 0x74, 0xea, 0xe1, 0x19, 0x93, 0xf3, 0xb2, 0x78, 0x12, 0xd1, 0x88, 0xaa, 0xd0, 0x2b, 0x22, 0x8d,
- 0x76, 0xfe, 0x9a, 0xa0, 0x71, 0x1d, 0xa7, 0x11, 0x49, 0x20, 0x04, 0xf5, 0x62, 0x9d, 0x6d, 0xb4,
- 0x8d, 0xee, 0xa1, 0xaf, 0x62, 0x78, 0x0a, 0x4c, 0x32, 0xb1, 0xcd, 0x02, 0xe9, 0x37, 0xf2, 0x65,
- 0xcb, 0x1c, 0x5e, 0xfa, 0x26, 0x99, 0x40, 0x07, 0x1c, 0x70, 0x7c, 0x97, 0x12, 0x8e, 0x85, 0x5d,
- 0x6b, 0xd7, 0xba, 0x87, 0xfe, 0x2a, 0x87, 0x1f, 0xc1, 0x61, 0x25, 0x58, 0xd8, 0xf5, 0x76, 0xad,
- 0xdb, 0xec, 0x39, 0x68, 0xcd, 0x13, 0x75, 0x13, 0xba, 0x2e, 0x5b, 0xfa, 0xf5, 0xc5, 0xb2, 0xb5,
- 0xe7, 0x3f, 0x50, 0xe0, 0x08, 0x58, 0xf8, 0x3b, 0xa3, 0x5c, 0x0a, 0x7b, 0x5f, 0xb1, 0xcf, 0xd1,
- 0x36, 0x8e, 0x22, 0x7d, 0x06, 0x1a, 0x68, 0xee, 0x20, 0x91, 0x7c, 0xee, 0x57, 0x93, 0x60, 0x07,
- 0x1c, 0x85, 0x01, 0x0b, 0xc6, 0x24, 0x26, 0x92, 0x60, 0x61, 0x37, 0x94, 0xe8, 0x0d, 0x0c, 0xbe,
- 0x06, 0x07, 0x24, 0x21, 0xf2, 0x16, 0x73, 0x6e, 0x5b, 0x6d, 0xa3, 0xdb, 0xec, 0x41, 0xa4, 0x1d,
- 0x45, 0x9c, 0x85, 0x68, 0xa4, 0xac, 0xf6, 0xad, 0xa2, 0x67, 0xc0, 0xb9, 0x73, 0x01, 0x8e, 0xd6,
- 0x77, 0xc1, 0x27, 0xa0, 0xf6, 0x0d, 0xcf, 0x4b, 0xfb, 0x8a, 0x10, 0x9e, 0x80, 0xfd, 0x2c, 0x88,
- 0x53, 0xac, 0x0d, 0xf4, 0x75, 0x72, 0x61, 0xbe, 0x37, 0x3a, 0x2f, 0xc1, 0xb1, 0x96, 0x2b, 0x7c,
- 0x7c, 0x97, 0x62, 0x21, 0xa1, 0x0d, 0xac, 0x29, 0x89, 0x25, 0xe6, 0xc2, 0x36, 0x94, 0xb6, 0x2a,
- 0xed, 0xdc, 0x82, 0xc7, 0xab, 0x5e, 0xc1, 0x68, 0x22, 0x30, 0xbc, 0x02, 0x16, 0xd3, 0x90, 0x6a,
- 0x6e, 0xf6, 0x5e, 0xed, 0x62, 0x51, 0x69, 0x79, 0x35, 0xa2, 0x83, 0xc0, 0xf1, 0x08, 0xf3, 0x0c,
- 0xf3, 0xd5, 0xfc, 0xe7, 0xa0, 0x9e, 0xa6, 0x64, 0xa2, 0x6f, 0xe9, 0x1f, 0xe4, 0xcb, 0x56, 0xfd,
- 0xe6, 0x66, 0x78, 0xe9, 0x2b, 0xb4, 0xf7, 0xdb, 0x00, 0x8f, 0x86, 0xeb, 0xa3, 0x61, 0x06, 0xac,
- 0x52, 0x22, 0x7c, 0xbb, 0x8b, 0x92, 0xea, 0x7a, 0xe7, 0xdd, 0x8e, 0xac, 0x52, 0xe7, 0x27, 0xd0,
- 0xd0, 0xca, 0xe1, 0x69, 0xf5, 0xa5, 0xaa, 0xb7, 0x8f, 0x06, 0xc5, 0xdb, 0x77, 0xb6, 0x94, 0xb3,
- 0x79, 0x7f, 0x7f, 0xba, 0xb8, 0x77, 0xf7, 0x7e, 0xdd, 0xbb, 0x7b, 0x3f, 0x72, 0xd7, 0x58, 0xe4,
- 0xae, 0xf1, 0x33, 0x77, 0x8d, 0x3f, 0xb9, 0x6b, 0x7c, 0xb9, 0xfa, 0xbf, 0x1f, 0xc6, 0x87, 0x0d,
- 0xe0, 0x73, 0x6d, 0xdc, 0x50, 0x7a, 0xdf, 0xfc, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x0c, 0xb3, 0x50,
- 0xdc, 0x89, 0x04, 0x00, 0x00,
-}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ context.Context
-var _ grpc.ClientConn
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion4
-
-// IntrospectionClient is the client API for Introspection service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type IntrospectionClient interface {
- // Plugins returns a list of plugins in containerd.
- //
- // Clients can use this to detect features and capabilities when using
- // containerd.
- Plugins(ctx context.Context, in *PluginsRequest, opts ...grpc.CallOption) (*PluginsResponse, error)
- // Server returns information about the containerd server
- Server(ctx context.Context, in *types1.Empty, opts ...grpc.CallOption) (*ServerResponse, error)
-}
-
-type introspectionClient struct {
- cc *grpc.ClientConn
-}
-
-func NewIntrospectionClient(cc *grpc.ClientConn) IntrospectionClient {
- return &introspectionClient{cc}
-}
-
-func (c *introspectionClient) Plugins(ctx context.Context, in *PluginsRequest, opts ...grpc.CallOption) (*PluginsResponse, error) {
- out := new(PluginsResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.introspection.v1.Introspection/Plugins", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *introspectionClient) Server(ctx context.Context, in *types1.Empty, opts ...grpc.CallOption) (*ServerResponse, error) {
- out := new(ServerResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.introspection.v1.Introspection/Server", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// IntrospectionServer is the server API for Introspection service.
-type IntrospectionServer interface {
- // Plugins returns a list of plugins in containerd.
- //
- // Clients can use this to detect features and capabilities when using
- // containerd.
- Plugins(context.Context, *PluginsRequest) (*PluginsResponse, error)
- // Server returns information about the containerd server
- Server(context.Context, *types1.Empty) (*ServerResponse, error)
-}
-
-// UnimplementedIntrospectionServer can be embedded to have forward compatible implementations.
-type UnimplementedIntrospectionServer struct {
-}
-
-func (*UnimplementedIntrospectionServer) Plugins(ctx context.Context, req *PluginsRequest) (*PluginsResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Plugins not implemented")
-}
-func (*UnimplementedIntrospectionServer) Server(ctx context.Context, req *types1.Empty) (*ServerResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Server not implemented")
-}
-
-func RegisterIntrospectionServer(s *grpc.Server, srv IntrospectionServer) {
- s.RegisterService(&_Introspection_serviceDesc, srv)
-}
-
-func _Introspection_Plugins_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(PluginsRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(IntrospectionServer).Plugins(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.introspection.v1.Introspection/Plugins",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(IntrospectionServer).Plugins(ctx, req.(*PluginsRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Introspection_Server_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(types1.Empty)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(IntrospectionServer).Server(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.introspection.v1.Introspection/Server",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(IntrospectionServer).Server(ctx, req.(*types1.Empty))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-var _Introspection_serviceDesc = grpc.ServiceDesc{
- ServiceName: "containerd.services.introspection.v1.Introspection",
- HandlerType: (*IntrospectionServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "Plugins",
- Handler: _Introspection_Plugins_Handler,
- },
- {
- MethodName: "Server",
- Handler: _Introspection_Server_Handler,
- },
- },
- Streams: []grpc.StreamDesc{},
- Metadata: "github.com/containerd/containerd/api/services/introspection/v1/introspection.proto",
-}
-
-func (m *Plugin) 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 *Plugin) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *Plugin) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.InitErr != nil {
- {
- size, err := m.InitErr.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintIntrospection(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x3a
- }
- if len(m.Capabilities) > 0 {
- for iNdEx := len(m.Capabilities) - 1; iNdEx >= 0; iNdEx-- {
- i -= len(m.Capabilities[iNdEx])
- copy(dAtA[i:], m.Capabilities[iNdEx])
- i = encodeVarintIntrospection(dAtA, i, uint64(len(m.Capabilities[iNdEx])))
- i--
- dAtA[i] = 0x32
- }
- }
- if len(m.Exports) > 0 {
- for k := range m.Exports {
- v := m.Exports[k]
- baseI := i
- i -= len(v)
- copy(dAtA[i:], v)
- i = encodeVarintIntrospection(dAtA, i, uint64(len(v)))
- i--
- dAtA[i] = 0x12
- i -= len(k)
- copy(dAtA[i:], k)
- i = encodeVarintIntrospection(dAtA, i, uint64(len(k)))
- i--
- dAtA[i] = 0xa
- i = encodeVarintIntrospection(dAtA, i, uint64(baseI-i))
- i--
- dAtA[i] = 0x2a
- }
- }
- if len(m.Platforms) > 0 {
- for iNdEx := len(m.Platforms) - 1; iNdEx >= 0; iNdEx-- {
- {
- size, err := m.Platforms[iNdEx].MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintIntrospection(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x22
- }
- }
- if len(m.Requires) > 0 {
- for iNdEx := len(m.Requires) - 1; iNdEx >= 0; iNdEx-- {
- i -= len(m.Requires[iNdEx])
- copy(dAtA[i:], m.Requires[iNdEx])
- i = encodeVarintIntrospection(dAtA, i, uint64(len(m.Requires[iNdEx])))
- i--
- dAtA[i] = 0x1a
- }
- }
- if len(m.ID) > 0 {
- i -= len(m.ID)
- copy(dAtA[i:], m.ID)
- i = encodeVarintIntrospection(dAtA, i, uint64(len(m.ID)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.Type) > 0 {
- i -= len(m.Type)
- copy(dAtA[i:], m.Type)
- i = encodeVarintIntrospection(dAtA, i, uint64(len(m.Type)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *PluginsRequest) 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 *PluginsRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *PluginsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Filters) > 0 {
- for iNdEx := len(m.Filters) - 1; iNdEx >= 0; iNdEx-- {
- i -= len(m.Filters[iNdEx])
- copy(dAtA[i:], m.Filters[iNdEx])
- i = encodeVarintIntrospection(dAtA, i, uint64(len(m.Filters[iNdEx])))
- i--
- dAtA[i] = 0xa
- }
- }
- return len(dAtA) - i, nil
-}
-
-func (m *PluginsResponse) 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 *PluginsResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *PluginsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Plugins) > 0 {
- for iNdEx := len(m.Plugins) - 1; iNdEx >= 0; iNdEx-- {
- {
- size, err := m.Plugins[iNdEx].MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintIntrospection(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- }
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ServerResponse) 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 *ServerResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ServerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.UUID) > 0 {
- i -= len(m.UUID)
- copy(dAtA[i:], m.UUID)
- i = encodeVarintIntrospection(dAtA, i, uint64(len(m.UUID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func encodeVarintIntrospection(dAtA []byte, offset int, v uint64) int {
- offset -= sovIntrospection(v)
- base := offset
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return base
-}
-func (m *Plugin) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Type)
- if l > 0 {
- n += 1 + l + sovIntrospection(uint64(l))
- }
- l = len(m.ID)
- if l > 0 {
- n += 1 + l + sovIntrospection(uint64(l))
- }
- if len(m.Requires) > 0 {
- for _, s := range m.Requires {
- l = len(s)
- n += 1 + l + sovIntrospection(uint64(l))
- }
- }
- if len(m.Platforms) > 0 {
- for _, e := range m.Platforms {
- l = e.Size()
- n += 1 + l + sovIntrospection(uint64(l))
- }
- }
- if len(m.Exports) > 0 {
- for k, v := range m.Exports {
- _ = k
- _ = v
- mapEntrySize := 1 + len(k) + sovIntrospection(uint64(len(k))) + 1 + len(v) + sovIntrospection(uint64(len(v)))
- n += mapEntrySize + 1 + sovIntrospection(uint64(mapEntrySize))
- }
- }
- if len(m.Capabilities) > 0 {
- for _, s := range m.Capabilities {
- l = len(s)
- n += 1 + l + sovIntrospection(uint64(l))
- }
- }
- if m.InitErr != nil {
- l = m.InitErr.Size()
- n += 1 + l + sovIntrospection(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *PluginsRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.Filters) > 0 {
- for _, s := range m.Filters {
- l = len(s)
- n += 1 + l + sovIntrospection(uint64(l))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *PluginsResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.Plugins) > 0 {
- for _, e := range m.Plugins {
- l = e.Size()
- n += 1 + l + sovIntrospection(uint64(l))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ServerResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.UUID)
- if l > 0 {
- n += 1 + l + sovIntrospection(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func sovIntrospection(x uint64) (n int) {
- return (math_bits.Len64(x|1) + 6) / 7
-}
-func sozIntrospection(x uint64) (n int) {
- return sovIntrospection(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-func (this *Plugin) String() string {
- if this == nil {
- return "nil"
- }
- repeatedStringForPlatforms := "[]Platform{"
- for _, f := range this.Platforms {
- repeatedStringForPlatforms += fmt.Sprintf("%v", f) + ","
- }
- repeatedStringForPlatforms += "}"
- keysForExports := make([]string, 0, len(this.Exports))
- for k, _ := range this.Exports {
- keysForExports = append(keysForExports, k)
- }
- github_com_gogo_protobuf_sortkeys.Strings(keysForExports)
- mapStringForExports := "map[string]string{"
- for _, k := range keysForExports {
- mapStringForExports += fmt.Sprintf("%v: %v,", k, this.Exports[k])
- }
- mapStringForExports += "}"
- s := strings.Join([]string{`&Plugin{`,
- `Type:` + fmt.Sprintf("%v", this.Type) + `,`,
- `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
- `Requires:` + fmt.Sprintf("%v", this.Requires) + `,`,
- `Platforms:` + repeatedStringForPlatforms + `,`,
- `Exports:` + mapStringForExports + `,`,
- `Capabilities:` + fmt.Sprintf("%v", this.Capabilities) + `,`,
- `InitErr:` + strings.Replace(fmt.Sprintf("%v", this.InitErr), "Status", "rpc.Status", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *PluginsRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&PluginsRequest{`,
- `Filters:` + fmt.Sprintf("%v", this.Filters) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *PluginsResponse) String() string {
- if this == nil {
- return "nil"
- }
- repeatedStringForPlugins := "[]Plugin{"
- for _, f := range this.Plugins {
- repeatedStringForPlugins += strings.Replace(strings.Replace(f.String(), "Plugin", "Plugin", 1), `&`, ``, 1) + ","
- }
- repeatedStringForPlugins += "}"
- s := strings.Join([]string{`&PluginsResponse{`,
- `Plugins:` + repeatedStringForPlugins + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ServerResponse) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ServerResponse{`,
- `UUID:` + fmt.Sprintf("%v", this.UUID) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func valueToStringIntrospection(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
-}
-func (m *Plugin) 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 ErrIntOverflowIntrospection
- }
- 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: Plugin: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: Plugin: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowIntrospection
- }
- 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 ErrInvalidLengthIntrospection
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthIntrospection
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Type = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowIntrospection
- }
- 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 ErrInvalidLengthIntrospection
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthIntrospection
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Requires", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowIntrospection
- }
- 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 ErrInvalidLengthIntrospection
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthIntrospection
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Requires = append(m.Requires, string(dAtA[iNdEx:postIndex]))
- iNdEx = postIndex
- case 4:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Platforms", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowIntrospection
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthIntrospection
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthIntrospection
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Platforms = append(m.Platforms, types.Platform{})
- if err := m.Platforms[len(m.Platforms)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 5:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Exports", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowIntrospection
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthIntrospection
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthIntrospection
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Exports == nil {
- m.Exports = 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 ErrIntOverflowIntrospection
- }
- 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 ErrIntOverflowIntrospection
- }
- 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 ErrInvalidLengthIntrospection
- }
- postStringIndexmapkey := iNdEx + intStringLenmapkey
- if postStringIndexmapkey < 0 {
- return ErrInvalidLengthIntrospection
- }
- 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 ErrIntOverflowIntrospection
- }
- 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 ErrInvalidLengthIntrospection
- }
- postStringIndexmapvalue := iNdEx + intStringLenmapvalue
- if postStringIndexmapvalue < 0 {
- return ErrInvalidLengthIntrospection
- }
- if postStringIndexmapvalue > l {
- return io.ErrUnexpectedEOF
- }
- mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
- iNdEx = postStringIndexmapvalue
- } else {
- iNdEx = entryPreIndex
- skippy, err := skipIntrospection(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthIntrospection
- }
- if (iNdEx + skippy) > postIndex {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- m.Exports[mapkey] = mapvalue
- iNdEx = postIndex
- case 6:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Capabilities", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowIntrospection
- }
- 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 ErrInvalidLengthIntrospection
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthIntrospection
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Capabilities = append(m.Capabilities, string(dAtA[iNdEx:postIndex]))
- iNdEx = postIndex
- case 7:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field InitErr", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowIntrospection
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthIntrospection
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthIntrospection
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.InitErr == nil {
- m.InitErr = &rpc.Status{}
- }
- if err := m.InitErr.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipIntrospection(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthIntrospection
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthIntrospection
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *PluginsRequest) 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 ErrIntOverflowIntrospection
- }
- 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: PluginsRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: PluginsRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowIntrospection
- }
- 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 ErrInvalidLengthIntrospection
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthIntrospection
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Filters = append(m.Filters, string(dAtA[iNdEx:postIndex]))
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipIntrospection(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthIntrospection
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthIntrospection
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *PluginsResponse) 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 ErrIntOverflowIntrospection
- }
- 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: PluginsResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: PluginsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Plugins", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowIntrospection
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthIntrospection
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthIntrospection
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Plugins = append(m.Plugins, Plugin{})
- if err := m.Plugins[len(m.Plugins)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipIntrospection(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthIntrospection
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthIntrospection
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ServerResponse) 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 ErrIntOverflowIntrospection
- }
- 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: ServerResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ServerResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field UUID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowIntrospection
- }
- 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 ErrInvalidLengthIntrospection
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthIntrospection
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.UUID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipIntrospection(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthIntrospection
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthIntrospection
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func skipIntrospection(dAtA []byte) (n int, err error) {
- l := len(dAtA)
- iNdEx := 0
- depth := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowIntrospection
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowIntrospection
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if dAtA[iNdEx-1] < 0x80 {
- break
- }
- }
- case 1:
- iNdEx += 8
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowIntrospection
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if length < 0 {
- return 0, ErrInvalidLengthIntrospection
- }
- iNdEx += length
- case 3:
- depth++
- case 4:
- if depth == 0 {
- return 0, ErrUnexpectedEndOfGroupIntrospection
- }
- depth--
- case 5:
- iNdEx += 4
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- if iNdEx < 0 {
- return 0, ErrInvalidLengthIntrospection
- }
- if depth == 0 {
- return iNdEx, nil
- }
- }
- return 0, io.ErrUnexpectedEOF
-}
-
-var (
- ErrInvalidLengthIntrospection = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowIntrospection = fmt.Errorf("proto: integer overflow")
- ErrUnexpectedEndOfGroupIntrospection = fmt.Errorf("proto: unexpected end of group")
-)
diff --git a/vendor/github.com/containerd/containerd/api/services/introspection/v1/introspection.proto b/vendor/github.com/containerd/containerd/api/services/introspection/v1/introspection.proto
deleted file mode 100644
index 79cee9a57..000000000
--- a/vendor/github.com/containerd/containerd/api/services/introspection/v1/introspection.proto
+++ /dev/null
@@ -1,88 +0,0 @@
-syntax = "proto3";
-
-package containerd.services.introspection.v1;
-
-import "github.com/containerd/containerd/api/types/platform.proto";
-import "google/rpc/status.proto";
-import "google/protobuf/empty.proto";
-import weak "gogoproto/gogo.proto";
-
-option go_package = "github.com/containerd/containerd/api/services/introspection/v1;introspection";
-
-service Introspection {
- // Plugins returns a list of plugins in containerd.
- //
- // Clients can use this to detect features and capabilities when using
- // containerd.
- rpc Plugins(PluginsRequest) returns (PluginsResponse);
- // Server returns information about the containerd server
- rpc Server(google.protobuf.Empty) returns (ServerResponse);
-}
-
-message Plugin {
- // Type defines the type of plugin.
- //
- // See package plugin for a list of possible values. Non core plugins may
- // define their own values during registration.
- string type = 1;
-
- // ID identifies the plugin uniquely in the system.
- string id = 2;
-
- // Requires lists the plugin types required by this plugin.
- repeated string requires = 3;
-
- // Platforms enumerates the platforms this plugin will support.
- //
- // If values are provided here, the plugin will only be operable under the
- // provided platforms.
- //
- // If this is empty, the plugin will work across all platforms.
- //
- // If the plugin prefers certain platforms over others, they should be
- // listed from most to least preferred.
- repeated types.Platform platforms = 4 [(gogoproto.nullable) = false];
-
- // Exports allows plugins to provide values about state or configuration to
- // interested parties.
- //
- // One example is exposing the configured path of a snapshotter plugin.
- map exports = 5;
-
- // Capabilities allows plugins to communicate feature switches to allow
- // clients to detect features that may not be on be default or may be
- // different from version to version.
- //
- // Use this sparingly.
- repeated string capabilities = 6;
-
- // InitErr will be set if the plugin fails initialization.
- //
- // This means the plugin may have been registered but a non-terminal error
- // was encountered during initialization.
- //
- // Plugins that have this value set cannot be used.
- google.rpc.Status init_err = 7;
-}
-
-message PluginsRequest {
- // Filters contains one or more filters using the syntax defined in the
- // containerd filter package.
- //
- // The returned result will be those that match any of the provided
- // filters. Expanded, plugins that match the following will be
- // returned:
- //
- // filters[0] or filters[1] or ... or filters[n-1] or filters[n]
- //
- // If filters is zero-length or nil, all items will be returned.
- repeated string filters = 1;
-}
-
-message PluginsResponse {
- repeated Plugin plugins = 1 [(gogoproto.nullable) = false];
-}
-
-message ServerResponse {
- string uuid = 1 [(gogoproto.customname) = "UUID"];
-}
diff --git a/vendor/github.com/containerd/containerd/api/services/leases/v1/doc.go b/vendor/github.com/containerd/containerd/api/services/leases/v1/doc.go
deleted file mode 100644
index db2422a8b..000000000
--- a/vendor/github.com/containerd/containerd/api/services/leases/v1/doc.go
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package leases
diff --git a/vendor/github.com/containerd/containerd/api/services/leases/v1/leases.pb.go b/vendor/github.com/containerd/containerd/api/services/leases/v1/leases.pb.go
deleted file mode 100644
index 4dbac3e09..000000000
--- a/vendor/github.com/containerd/containerd/api/services/leases/v1/leases.pb.go
+++ /dev/null
@@ -1,3141 +0,0 @@
-// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: github.com/containerd/containerd/api/services/leases/v1/leases.proto
-
-package leases
-
-import (
- context "context"
- fmt "fmt"
- proto "github.com/gogo/protobuf/proto"
- github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
- github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
- types "github.com/gogo/protobuf/types"
- grpc "google.golang.org/grpc"
- codes "google.golang.org/grpc/codes"
- status "google.golang.org/grpc/status"
- io "io"
- math "math"
- math_bits "math/bits"
- reflect "reflect"
- strings "strings"
- time "time"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-var _ = time.Kitchen
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
-
-// Lease is an object which retains resources while it exists.
-type Lease struct {
- ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
- CreatedAt time.Time `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at"`
- 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"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Lease) Reset() { *m = Lease{} }
-func (*Lease) ProtoMessage() {}
-func (*Lease) Descriptor() ([]byte, []int) {
- return fileDescriptor_fefd70dfe8d93cbf, []int{0}
-}
-func (m *Lease) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Lease) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_Lease.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 *Lease) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Lease.Merge(m, src)
-}
-func (m *Lease) XXX_Size() int {
- return m.Size()
-}
-func (m *Lease) XXX_DiscardUnknown() {
- xxx_messageInfo_Lease.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Lease proto.InternalMessageInfo
-
-type CreateRequest struct {
- // ID is used to identity the lease, when the id is not set the service
- // generates a random identifier for the lease.
- ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
- 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"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *CreateRequest) Reset() { *m = CreateRequest{} }
-func (*CreateRequest) ProtoMessage() {}
-func (*CreateRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_fefd70dfe8d93cbf, []int{1}
-}
-func (m *CreateRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *CreateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_CreateRequest.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 *CreateRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_CreateRequest.Merge(m, src)
-}
-func (m *CreateRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *CreateRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_CreateRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CreateRequest proto.InternalMessageInfo
-
-type CreateResponse struct {
- Lease *Lease `protobuf:"bytes,1,opt,name=lease,proto3" json:"lease,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *CreateResponse) Reset() { *m = CreateResponse{} }
-func (*CreateResponse) ProtoMessage() {}
-func (*CreateResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_fefd70dfe8d93cbf, []int{2}
-}
-func (m *CreateResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *CreateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_CreateResponse.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 *CreateResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_CreateResponse.Merge(m, src)
-}
-func (m *CreateResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *CreateResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_CreateResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CreateResponse proto.InternalMessageInfo
-
-type DeleteRequest struct {
- ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
- // Sync indicates that the delete and cleanup should be done
- // synchronously before returning to the caller
- //
- // Default is false
- Sync bool `protobuf:"varint,2,opt,name=sync,proto3" json:"sync,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *DeleteRequest) Reset() { *m = DeleteRequest{} }
-func (*DeleteRequest) ProtoMessage() {}
-func (*DeleteRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_fefd70dfe8d93cbf, []int{3}
-}
-func (m *DeleteRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *DeleteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_DeleteRequest.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 *DeleteRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_DeleteRequest.Merge(m, src)
-}
-func (m *DeleteRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *DeleteRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_DeleteRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_DeleteRequest proto.InternalMessageInfo
-
-type ListRequest struct {
- Filters []string `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ListRequest) Reset() { *m = ListRequest{} }
-func (*ListRequest) ProtoMessage() {}
-func (*ListRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_fefd70dfe8d93cbf, []int{4}
-}
-func (m *ListRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ListRequest.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 *ListRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ListRequest.Merge(m, src)
-}
-func (m *ListRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *ListRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_ListRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ListRequest proto.InternalMessageInfo
-
-type ListResponse struct {
- Leases []*Lease `protobuf:"bytes,1,rep,name=leases,proto3" json:"leases,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ListResponse) Reset() { *m = ListResponse{} }
-func (*ListResponse) ProtoMessage() {}
-func (*ListResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_fefd70dfe8d93cbf, []int{5}
-}
-func (m *ListResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ListResponse.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 *ListResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ListResponse.Merge(m, src)
-}
-func (m *ListResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *ListResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_ListResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ListResponse proto.InternalMessageInfo
-
-type Resource struct {
- ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
- // For snapshotter resource, there are many snapshotter types here, like
- // overlayfs, devmapper etc. The type will be formatted with type,
- // like "snapshotter/overlayfs".
- Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Resource) Reset() { *m = Resource{} }
-func (*Resource) ProtoMessage() {}
-func (*Resource) Descriptor() ([]byte, []int) {
- return fileDescriptor_fefd70dfe8d93cbf, []int{6}
-}
-func (m *Resource) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Resource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_Resource.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 *Resource) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Resource.Merge(m, src)
-}
-func (m *Resource) XXX_Size() int {
- return m.Size()
-}
-func (m *Resource) XXX_DiscardUnknown() {
- xxx_messageInfo_Resource.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Resource proto.InternalMessageInfo
-
-type AddResourceRequest struct {
- ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
- Resource Resource `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *AddResourceRequest) Reset() { *m = AddResourceRequest{} }
-func (*AddResourceRequest) ProtoMessage() {}
-func (*AddResourceRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_fefd70dfe8d93cbf, []int{7}
-}
-func (m *AddResourceRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *AddResourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_AddResourceRequest.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 *AddResourceRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_AddResourceRequest.Merge(m, src)
-}
-func (m *AddResourceRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *AddResourceRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_AddResourceRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_AddResourceRequest proto.InternalMessageInfo
-
-type DeleteResourceRequest struct {
- ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
- Resource Resource `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *DeleteResourceRequest) Reset() { *m = DeleteResourceRequest{} }
-func (*DeleteResourceRequest) ProtoMessage() {}
-func (*DeleteResourceRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_fefd70dfe8d93cbf, []int{8}
-}
-func (m *DeleteResourceRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *DeleteResourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_DeleteResourceRequest.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 *DeleteResourceRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_DeleteResourceRequest.Merge(m, src)
-}
-func (m *DeleteResourceRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *DeleteResourceRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_DeleteResourceRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_DeleteResourceRequest proto.InternalMessageInfo
-
-type ListResourcesRequest struct {
- ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ListResourcesRequest) Reset() { *m = ListResourcesRequest{} }
-func (*ListResourcesRequest) ProtoMessage() {}
-func (*ListResourcesRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_fefd70dfe8d93cbf, []int{9}
-}
-func (m *ListResourcesRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ListResourcesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ListResourcesRequest.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 *ListResourcesRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ListResourcesRequest.Merge(m, src)
-}
-func (m *ListResourcesRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *ListResourcesRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_ListResourcesRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ListResourcesRequest proto.InternalMessageInfo
-
-type ListResourcesResponse struct {
- Resources []Resource `protobuf:"bytes,1,rep,name=resources,proto3" json:"resources"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ListResourcesResponse) Reset() { *m = ListResourcesResponse{} }
-func (*ListResourcesResponse) ProtoMessage() {}
-func (*ListResourcesResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_fefd70dfe8d93cbf, []int{10}
-}
-func (m *ListResourcesResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ListResourcesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ListResourcesResponse.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 *ListResourcesResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ListResourcesResponse.Merge(m, src)
-}
-func (m *ListResourcesResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *ListResourcesResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_ListResourcesResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ListResourcesResponse proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*Lease)(nil), "containerd.services.leases.v1.Lease")
- proto.RegisterMapType((map[string]string)(nil), "containerd.services.leases.v1.Lease.LabelsEntry")
- proto.RegisterType((*CreateRequest)(nil), "containerd.services.leases.v1.CreateRequest")
- proto.RegisterMapType((map[string]string)(nil), "containerd.services.leases.v1.CreateRequest.LabelsEntry")
- proto.RegisterType((*CreateResponse)(nil), "containerd.services.leases.v1.CreateResponse")
- proto.RegisterType((*DeleteRequest)(nil), "containerd.services.leases.v1.DeleteRequest")
- proto.RegisterType((*ListRequest)(nil), "containerd.services.leases.v1.ListRequest")
- proto.RegisterType((*ListResponse)(nil), "containerd.services.leases.v1.ListResponse")
- proto.RegisterType((*Resource)(nil), "containerd.services.leases.v1.Resource")
- proto.RegisterType((*AddResourceRequest)(nil), "containerd.services.leases.v1.AddResourceRequest")
- proto.RegisterType((*DeleteResourceRequest)(nil), "containerd.services.leases.v1.DeleteResourceRequest")
- proto.RegisterType((*ListResourcesRequest)(nil), "containerd.services.leases.v1.ListResourcesRequest")
- proto.RegisterType((*ListResourcesResponse)(nil), "containerd.services.leases.v1.ListResourcesResponse")
-}
-
-func init() {
- proto.RegisterFile("github.com/containerd/containerd/api/services/leases/v1/leases.proto", fileDescriptor_fefd70dfe8d93cbf)
-}
-
-var fileDescriptor_fefd70dfe8d93cbf = []byte{
- // 644 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xcd, 0x6e, 0xd3, 0x40,
- 0x10, 0xce, 0x26, 0xa9, 0x49, 0x26, 0xb4, 0x42, 0xab, 0xb6, 0x8a, 0x8c, 0x48, 0x22, 0x0b, 0xa9,
- 0x11, 0x3f, 0x36, 0x4d, 0x2b, 0x54, 0x5a, 0x84, 0xd4, 0xb4, 0x95, 0xa8, 0x88, 0x10, 0xb2, 0x38,
- 0x54, 0x1c, 0xa8, 0x1c, 0x7b, 0x1b, 0x2c, 0x9c, 0xd8, 0x78, 0x37, 0x41, 0xe9, 0x89, 0x47, 0xe0,
- 0x61, 0x78, 0x88, 0x1e, 0x39, 0x21, 0x4e, 0x85, 0xe6, 0xc6, 0x5b, 0x20, 0xef, 0x0f, 0x6d, 0x5a,
- 0xb5, 0x76, 0x11, 0xe2, 0x36, 0x1b, 0x7f, 0xdf, 0xcc, 0x37, 0x33, 0xdf, 0x6e, 0x60, 0xbb, 0xe7,
- 0xb3, 0x77, 0xc3, 0xae, 0xe9, 0x86, 0x7d, 0xcb, 0x0d, 0x07, 0xcc, 0xf1, 0x07, 0x24, 0xf6, 0xce,
- 0x86, 0x4e, 0xe4, 0x5b, 0x94, 0xc4, 0x23, 0xdf, 0x25, 0xd4, 0x0a, 0x88, 0x43, 0x09, 0xb5, 0x46,
- 0xcb, 0x32, 0x32, 0xa3, 0x38, 0x64, 0x21, 0xbe, 0x73, 0x8a, 0x37, 0x15, 0xd6, 0x94, 0x88, 0xd1,
- 0xb2, 0x3e, 0xdf, 0x0b, 0x7b, 0x21, 0x47, 0x5a, 0x49, 0x24, 0x48, 0xfa, 0xed, 0x5e, 0x18, 0xf6,
- 0x02, 0x62, 0xf1, 0x53, 0x77, 0x78, 0x60, 0x91, 0x7e, 0xc4, 0xc6, 0xf2, 0x63, 0xfd, 0xfc, 0x47,
- 0xe6, 0xf7, 0x09, 0x65, 0x4e, 0x3f, 0x12, 0x00, 0xe3, 0x17, 0x82, 0x99, 0x4e, 0x52, 0x01, 0x2f,
- 0x42, 0xde, 0xf7, 0xaa, 0xa8, 0x81, 0x9a, 0xe5, 0xb6, 0x36, 0x39, 0xae, 0xe7, 0x77, 0xb7, 0xed,
- 0xbc, 0xef, 0xe1, 0x2d, 0x00, 0x37, 0x26, 0x0e, 0x23, 0xde, 0xbe, 0xc3, 0xaa, 0xf9, 0x06, 0x6a,
- 0x56, 0x5a, 0xba, 0x29, 0xf2, 0x9a, 0x2a, 0xaf, 0xf9, 0x5a, 0xe5, 0x6d, 0x97, 0x8e, 0x8e, 0xeb,
- 0xb9, 0xcf, 0x3f, 0xea, 0xc8, 0x2e, 0x4b, 0xde, 0x26, 0xc3, 0xcf, 0x41, 0x0b, 0x9c, 0x2e, 0x09,
- 0x68, 0xb5, 0xd0, 0x28, 0x34, 0x2b, 0xad, 0x47, 0xe6, 0x95, 0xad, 0x9a, 0x5c, 0x92, 0xd9, 0xe1,
- 0x94, 0x9d, 0x01, 0x8b, 0xc7, 0xb6, 0xe4, 0xeb, 0x4f, 0xa0, 0x72, 0xe6, 0x67, 0x7c, 0x0b, 0x0a,
- 0xef, 0xc9, 0x58, 0xc8, 0xb6, 0x93, 0x10, 0xcf, 0xc3, 0xcc, 0xc8, 0x09, 0x86, 0x84, 0x4b, 0x2d,
- 0xdb, 0xe2, 0xb0, 0x9e, 0x5f, 0x43, 0xc6, 0x17, 0x04, 0xb3, 0x5b, 0x5c, 0x92, 0x4d, 0x3e, 0x0c,
- 0x09, 0x65, 0x97, 0xf6, 0xfc, 0xea, 0x9c, 0xdc, 0xb5, 0x14, 0xb9, 0x53, 0x59, 0xff, 0xb5, 0xec,
- 0x0e, 0xcc, 0xa9, 0xfc, 0x34, 0x0a, 0x07, 0x94, 0xe0, 0x75, 0x98, 0xe1, 0xb5, 0x39, 0xbf, 0xd2,
- 0xba, 0x9b, 0x65, 0x98, 0xb6, 0xa0, 0x18, 0x1b, 0x30, 0xbb, 0x4d, 0x02, 0x92, 0x3e, 0x03, 0x0c,
- 0x45, 0x3a, 0x1e, 0xb8, 0x5c, 0x4f, 0xc9, 0xe6, 0xb1, 0xb1, 0x04, 0x95, 0x8e, 0x4f, 0x99, 0xa2,
- 0x56, 0xe1, 0xc6, 0x81, 0x1f, 0x30, 0x12, 0xd3, 0x2a, 0x6a, 0x14, 0x9a, 0x65, 0x5b, 0x1d, 0x8d,
- 0x0e, 0xdc, 0x14, 0x40, 0xa9, 0xf8, 0x29, 0x68, 0x42, 0x0f, 0x07, 0x66, 0x95, 0x2c, 0x39, 0xc6,
- 0x63, 0x28, 0xd9, 0x84, 0x86, 0xc3, 0xd8, 0x25, 0x57, 0xc9, 0x65, 0xe3, 0x48, 0x8d, 0x8f, 0xc7,
- 0xc6, 0x47, 0xc0, 0x9b, 0x9e, 0xa7, 0xa8, 0x69, 0x0d, 0xef, 0x42, 0x29, 0x96, 0x50, 0x69, 0xf3,
- 0xa5, 0x14, 0x95, 0x2a, 0x73, 0xbb, 0x98, 0x78, 0xde, 0xfe, 0x43, 0x37, 0x0e, 0x61, 0x41, 0x0d,
- 0xf9, 0xbf, 0xd7, 0x36, 0x61, 0x5e, 0x8e, 0x9e, 0x9f, 0x69, 0x4a, 0x69, 0xc3, 0x83, 0x85, 0x73,
- 0x78, 0xb9, 0xb3, 0x17, 0x50, 0x56, 0x49, 0xd5, 0xda, 0xae, 0x29, 0xea, 0x94, 0xdf, 0xfa, 0x56,
- 0x04, 0x8d, 0x2f, 0x95, 0x62, 0x02, 0x9a, 0xf0, 0x33, 0x7e, 0x70, 0x9d, 0x6b, 0xa5, 0x3f, 0xcc,
- 0x88, 0x96, 0xf2, 0x5f, 0x82, 0x26, 0x76, 0x90, 0x5a, 0x66, 0xea, 0x3e, 0xe8, 0x8b, 0x17, 0xde,
- 0xb6, 0x9d, 0xe4, 0x41, 0xc5, 0xfb, 0x50, 0x4c, 0xe6, 0x84, 0xef, 0xa5, 0x59, 0xf7, 0xf4, 0x82,
- 0xe8, 0xf7, 0x33, 0x61, 0xa5, 0xe0, 0x3d, 0xa8, 0x9c, 0x71, 0x2b, 0x5e, 0x4e, 0xe1, 0x5e, 0x74,
- 0xf6, 0xa5, 0xd2, 0xdf, 0xc2, 0xdc, 0xb4, 0x1d, 0xf1, 0x6a, 0xc6, 0x91, 0x64, 0xcb, 0x7f, 0x08,
- 0xb3, 0x53, 0x16, 0xc2, 0x2b, 0xd9, 0xfa, 0x9e, 0x32, 0xa8, 0xbe, 0x7a, 0x3d, 0x92, 0x98, 0x5a,
- 0x7b, 0xef, 0xe8, 0xa4, 0x96, 0xfb, 0x7e, 0x52, 0xcb, 0x7d, 0x9a, 0xd4, 0xd0, 0xd1, 0xa4, 0x86,
- 0xbe, 0x4e, 0x6a, 0xe8, 0xe7, 0xa4, 0x86, 0xde, 0x3c, 0xfb, 0xcb, 0xff, 0xe4, 0x0d, 0x11, 0xed,
- 0xe5, 0xba, 0x1a, 0xef, 0x73, 0xe5, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0d, 0xfe, 0x39, 0x67,
- 0xde, 0x07, 0x00, 0x00,
-}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ context.Context
-var _ grpc.ClientConn
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion4
-
-// LeasesClient is the client API for Leases service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type LeasesClient interface {
- // Create creates a new lease for managing changes to metadata. A lease
- // can be used to protect objects from being removed.
- Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error)
- // Delete deletes the lease and makes any unreferenced objects created
- // during the lease eligible for garbage collection if not referenced
- // or retained by other resources during the lease.
- Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*types.Empty, error)
- // List lists all active leases, returning the full list of
- // leases and optionally including the referenced resources.
- List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
- // AddResource references the resource by the provided lease.
- AddResource(ctx context.Context, in *AddResourceRequest, opts ...grpc.CallOption) (*types.Empty, error)
- // DeleteResource dereferences the resource by the provided lease.
- DeleteResource(ctx context.Context, in *DeleteResourceRequest, opts ...grpc.CallOption) (*types.Empty, error)
- // ListResources lists all the resources referenced by the lease.
- ListResources(ctx context.Context, in *ListResourcesRequest, opts ...grpc.CallOption) (*ListResourcesResponse, error)
-}
-
-type leasesClient struct {
- cc *grpc.ClientConn
-}
-
-func NewLeasesClient(cc *grpc.ClientConn) LeasesClient {
- return &leasesClient{cc}
-}
-
-func (c *leasesClient) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) {
- out := new(CreateResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.leases.v1.Leases/Create", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *leasesClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*types.Empty, error) {
- out := new(types.Empty)
- err := c.cc.Invoke(ctx, "/containerd.services.leases.v1.Leases/Delete", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *leasesClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) {
- out := new(ListResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.leases.v1.Leases/List", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *leasesClient) AddResource(ctx context.Context, in *AddResourceRequest, opts ...grpc.CallOption) (*types.Empty, error) {
- out := new(types.Empty)
- err := c.cc.Invoke(ctx, "/containerd.services.leases.v1.Leases/AddResource", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *leasesClient) DeleteResource(ctx context.Context, in *DeleteResourceRequest, opts ...grpc.CallOption) (*types.Empty, error) {
- out := new(types.Empty)
- err := c.cc.Invoke(ctx, "/containerd.services.leases.v1.Leases/DeleteResource", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *leasesClient) ListResources(ctx context.Context, in *ListResourcesRequest, opts ...grpc.CallOption) (*ListResourcesResponse, error) {
- out := new(ListResourcesResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.leases.v1.Leases/ListResources", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// LeasesServer is the server API for Leases service.
-type LeasesServer interface {
- // Create creates a new lease for managing changes to metadata. A lease
- // can be used to protect objects from being removed.
- Create(context.Context, *CreateRequest) (*CreateResponse, error)
- // Delete deletes the lease and makes any unreferenced objects created
- // during the lease eligible for garbage collection if not referenced
- // or retained by other resources during the lease.
- Delete(context.Context, *DeleteRequest) (*types.Empty, error)
- // List lists all active leases, returning the full list of
- // leases and optionally including the referenced resources.
- List(context.Context, *ListRequest) (*ListResponse, error)
- // AddResource references the resource by the provided lease.
- AddResource(context.Context, *AddResourceRequest) (*types.Empty, error)
- // DeleteResource dereferences the resource by the provided lease.
- DeleteResource(context.Context, *DeleteResourceRequest) (*types.Empty, error)
- // ListResources lists all the resources referenced by the lease.
- ListResources(context.Context, *ListResourcesRequest) (*ListResourcesResponse, error)
-}
-
-// UnimplementedLeasesServer can be embedded to have forward compatible implementations.
-type UnimplementedLeasesServer struct {
-}
-
-func (*UnimplementedLeasesServer) Create(ctx context.Context, req *CreateRequest) (*CreateResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
-}
-func (*UnimplementedLeasesServer) Delete(ctx context.Context, req *DeleteRequest) (*types.Empty, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
-}
-func (*UnimplementedLeasesServer) List(ctx context.Context, req *ListRequest) (*ListResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
-}
-func (*UnimplementedLeasesServer) AddResource(ctx context.Context, req *AddResourceRequest) (*types.Empty, error) {
- return nil, status.Errorf(codes.Unimplemented, "method AddResource not implemented")
-}
-func (*UnimplementedLeasesServer) DeleteResource(ctx context.Context, req *DeleteResourceRequest) (*types.Empty, error) {
- return nil, status.Errorf(codes.Unimplemented, "method DeleteResource not implemented")
-}
-func (*UnimplementedLeasesServer) ListResources(ctx context.Context, req *ListResourcesRequest) (*ListResourcesResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method ListResources not implemented")
-}
-
-func RegisterLeasesServer(s *grpc.Server, srv LeasesServer) {
- s.RegisterService(&_Leases_serviceDesc, srv)
-}
-
-func _Leases_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(CreateRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(LeasesServer).Create(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.leases.v1.Leases/Create",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(LeasesServer).Create(ctx, req.(*CreateRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Leases_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(DeleteRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(LeasesServer).Delete(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.leases.v1.Leases/Delete",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(LeasesServer).Delete(ctx, req.(*DeleteRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Leases_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(ListRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(LeasesServer).List(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.leases.v1.Leases/List",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(LeasesServer).List(ctx, req.(*ListRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Leases_AddResource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(AddResourceRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(LeasesServer).AddResource(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.leases.v1.Leases/AddResource",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(LeasesServer).AddResource(ctx, req.(*AddResourceRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Leases_DeleteResource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(DeleteResourceRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(LeasesServer).DeleteResource(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.leases.v1.Leases/DeleteResource",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(LeasesServer).DeleteResource(ctx, req.(*DeleteResourceRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Leases_ListResources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(ListResourcesRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(LeasesServer).ListResources(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.leases.v1.Leases/ListResources",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(LeasesServer).ListResources(ctx, req.(*ListResourcesRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-var _Leases_serviceDesc = grpc.ServiceDesc{
- ServiceName: "containerd.services.leases.v1.Leases",
- HandlerType: (*LeasesServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "Create",
- Handler: _Leases_Create_Handler,
- },
- {
- MethodName: "Delete",
- Handler: _Leases_Delete_Handler,
- },
- {
- MethodName: "List",
- Handler: _Leases_List_Handler,
- },
- {
- MethodName: "AddResource",
- Handler: _Leases_AddResource_Handler,
- },
- {
- MethodName: "DeleteResource",
- Handler: _Leases_DeleteResource_Handler,
- },
- {
- MethodName: "ListResources",
- Handler: _Leases_ListResources_Handler,
- },
- },
- Streams: []grpc.StreamDesc{},
- Metadata: "github.com/containerd/containerd/api/services/leases/v1/leases.proto",
-}
-
-func (m *Lease) 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 *Lease) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *Lease) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Labels) > 0 {
- for k := range m.Labels {
- v := m.Labels[k]
- baseI := i
- i -= len(v)
- copy(dAtA[i:], v)
- i = encodeVarintLeases(dAtA, i, uint64(len(v)))
- i--
- dAtA[i] = 0x12
- i -= len(k)
- copy(dAtA[i:], k)
- i = encodeVarintLeases(dAtA, i, uint64(len(k)))
- i--
- dAtA[i] = 0xa
- i = encodeVarintLeases(dAtA, i, uint64(baseI-i))
- i--
- dAtA[i] = 0x1a
- }
- }
- n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt):])
- if err1 != nil {
- return 0, err1
- }
- i -= n1
- i = encodeVarintLeases(dAtA, i, uint64(n1))
- i--
- dAtA[i] = 0x12
- if len(m.ID) > 0 {
- i -= len(m.ID)
- copy(dAtA[i:], m.ID)
- i = encodeVarintLeases(dAtA, i, uint64(len(m.ID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *CreateRequest) 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 *CreateRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *CreateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Labels) > 0 {
- for k := range m.Labels {
- v := m.Labels[k]
- baseI := i
- i -= len(v)
- copy(dAtA[i:], v)
- i = encodeVarintLeases(dAtA, i, uint64(len(v)))
- i--
- dAtA[i] = 0x12
- i -= len(k)
- copy(dAtA[i:], k)
- i = encodeVarintLeases(dAtA, i, uint64(len(k)))
- i--
- dAtA[i] = 0xa
- i = encodeVarintLeases(dAtA, i, uint64(baseI-i))
- i--
- dAtA[i] = 0x1a
- }
- }
- if len(m.ID) > 0 {
- i -= len(m.ID)
- copy(dAtA[i:], m.ID)
- i = encodeVarintLeases(dAtA, i, uint64(len(m.ID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *CreateResponse) 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 *CreateResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *CreateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Lease != nil {
- {
- size, err := m.Lease.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintLeases(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *DeleteRequest) 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 *DeleteRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *DeleteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Sync {
- i--
- if m.Sync {
- dAtA[i] = 1
- } else {
- dAtA[i] = 0
- }
- i--
- dAtA[i] = 0x10
- }
- if len(m.ID) > 0 {
- i -= len(m.ID)
- copy(dAtA[i:], m.ID)
- i = encodeVarintLeases(dAtA, i, uint64(len(m.ID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ListRequest) 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 *ListRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ListRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Filters) > 0 {
- for iNdEx := len(m.Filters) - 1; iNdEx >= 0; iNdEx-- {
- i -= len(m.Filters[iNdEx])
- copy(dAtA[i:], m.Filters[iNdEx])
- i = encodeVarintLeases(dAtA, i, uint64(len(m.Filters[iNdEx])))
- i--
- dAtA[i] = 0xa
- }
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ListResponse) 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 *ListResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ListResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Leases) > 0 {
- for iNdEx := len(m.Leases) - 1; iNdEx >= 0; iNdEx-- {
- {
- size, err := m.Leases[iNdEx].MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintLeases(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- }
- }
- return len(dAtA) - i, nil
-}
-
-func (m *Resource) 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 *Resource) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *Resource) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Type) > 0 {
- i -= len(m.Type)
- copy(dAtA[i:], m.Type)
- i = encodeVarintLeases(dAtA, i, uint64(len(m.Type)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.ID) > 0 {
- i -= len(m.ID)
- copy(dAtA[i:], m.ID)
- i = encodeVarintLeases(dAtA, i, uint64(len(m.ID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *AddResourceRequest) 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 *AddResourceRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *AddResourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- {
- size, err := m.Resource.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintLeases(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x12
- if len(m.ID) > 0 {
- i -= len(m.ID)
- copy(dAtA[i:], m.ID)
- i = encodeVarintLeases(dAtA, i, uint64(len(m.ID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *DeleteResourceRequest) 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 *DeleteResourceRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *DeleteResourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- {
- size, err := m.Resource.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintLeases(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x12
- if len(m.ID) > 0 {
- i -= len(m.ID)
- copy(dAtA[i:], m.ID)
- i = encodeVarintLeases(dAtA, i, uint64(len(m.ID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ListResourcesRequest) 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 *ListResourcesRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ListResourcesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.ID) > 0 {
- i -= len(m.ID)
- copy(dAtA[i:], m.ID)
- i = encodeVarintLeases(dAtA, i, uint64(len(m.ID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ListResourcesResponse) 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 *ListResourcesResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ListResourcesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Resources) > 0 {
- for iNdEx := len(m.Resources) - 1; iNdEx >= 0; iNdEx-- {
- {
- size, err := m.Resources[iNdEx].MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintLeases(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- }
- }
- return len(dAtA) - i, nil
-}
-
-func encodeVarintLeases(dAtA []byte, offset int, v uint64) int {
- offset -= sovLeases(v)
- base := offset
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return base
-}
-func (m *Lease) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ID)
- if l > 0 {
- n += 1 + l + sovLeases(uint64(l))
- }
- l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt)
- n += 1 + l + sovLeases(uint64(l))
- if len(m.Labels) > 0 {
- for k, v := range m.Labels {
- _ = k
- _ = v
- mapEntrySize := 1 + len(k) + sovLeases(uint64(len(k))) + 1 + len(v) + sovLeases(uint64(len(v)))
- n += mapEntrySize + 1 + sovLeases(uint64(mapEntrySize))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *CreateRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ID)
- if l > 0 {
- n += 1 + l + sovLeases(uint64(l))
- }
- if len(m.Labels) > 0 {
- for k, v := range m.Labels {
- _ = k
- _ = v
- mapEntrySize := 1 + len(k) + sovLeases(uint64(len(k))) + 1 + len(v) + sovLeases(uint64(len(v)))
- n += mapEntrySize + 1 + sovLeases(uint64(mapEntrySize))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *CreateResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Lease != nil {
- l = m.Lease.Size()
- n += 1 + l + sovLeases(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *DeleteRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ID)
- if l > 0 {
- n += 1 + l + sovLeases(uint64(l))
- }
- if m.Sync {
- n += 2
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ListRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.Filters) > 0 {
- for _, s := range m.Filters {
- l = len(s)
- n += 1 + l + sovLeases(uint64(l))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ListResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.Leases) > 0 {
- for _, e := range m.Leases {
- l = e.Size()
- n += 1 + l + sovLeases(uint64(l))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *Resource) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ID)
- if l > 0 {
- n += 1 + l + sovLeases(uint64(l))
- }
- l = len(m.Type)
- if l > 0 {
- n += 1 + l + sovLeases(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *AddResourceRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ID)
- if l > 0 {
- n += 1 + l + sovLeases(uint64(l))
- }
- l = m.Resource.Size()
- n += 1 + l + sovLeases(uint64(l))
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *DeleteResourceRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ID)
- if l > 0 {
- n += 1 + l + sovLeases(uint64(l))
- }
- l = m.Resource.Size()
- n += 1 + l + sovLeases(uint64(l))
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ListResourcesRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ID)
- if l > 0 {
- n += 1 + l + sovLeases(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ListResourcesResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.Resources) > 0 {
- for _, e := range m.Resources {
- l = e.Size()
- n += 1 + l + sovLeases(uint64(l))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func sovLeases(x uint64) (n int) {
- return (math_bits.Len64(x|1) + 6) / 7
-}
-func sozLeases(x uint64) (n int) {
- return sovLeases(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-func (this *Lease) 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 += "}"
- s := strings.Join([]string{`&Lease{`,
- `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
- `CreatedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.CreatedAt), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`,
- `Labels:` + mapStringForLabels + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *CreateRequest) 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 += "}"
- s := strings.Join([]string{`&CreateRequest{`,
- `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
- `Labels:` + mapStringForLabels + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *CreateResponse) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&CreateResponse{`,
- `Lease:` + strings.Replace(this.Lease.String(), "Lease", "Lease", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *DeleteRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&DeleteRequest{`,
- `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
- `Sync:` + fmt.Sprintf("%v", this.Sync) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ListRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ListRequest{`,
- `Filters:` + fmt.Sprintf("%v", this.Filters) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ListResponse) String() string {
- if this == nil {
- return "nil"
- }
- repeatedStringForLeases := "[]*Lease{"
- for _, f := range this.Leases {
- repeatedStringForLeases += strings.Replace(f.String(), "Lease", "Lease", 1) + ","
- }
- repeatedStringForLeases += "}"
- s := strings.Join([]string{`&ListResponse{`,
- `Leases:` + repeatedStringForLeases + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *Resource) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&Resource{`,
- `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
- `Type:` + fmt.Sprintf("%v", this.Type) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *AddResourceRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&AddResourceRequest{`,
- `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
- `Resource:` + strings.Replace(strings.Replace(this.Resource.String(), "Resource", "Resource", 1), `&`, ``, 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *DeleteResourceRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&DeleteResourceRequest{`,
- `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
- `Resource:` + strings.Replace(strings.Replace(this.Resource.String(), "Resource", "Resource", 1), `&`, ``, 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ListResourcesRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ListResourcesRequest{`,
- `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ListResourcesResponse) String() string {
- if this == nil {
- return "nil"
- }
- repeatedStringForResources := "[]Resource{"
- for _, f := range this.Resources {
- repeatedStringForResources += strings.Replace(strings.Replace(f.String(), "Resource", "Resource", 1), `&`, ``, 1) + ","
- }
- repeatedStringForResources += "}"
- s := strings.Join([]string{`&ListResourcesResponse{`,
- `Resources:` + repeatedStringForResources + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func valueToStringLeases(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
-}
-func (m *Lease) 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 ErrIntOverflowLeases
- }
- 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: Lease: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: Lease: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowLeases
- }
- 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 ErrInvalidLengthLeases
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthLeases
- }
- 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 CreatedAt", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowLeases
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthLeases
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthLeases
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CreatedAt, dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 3:
- 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 ErrIntOverflowLeases
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthLeases
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthLeases
- }
- 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 ErrIntOverflowLeases
- }
- 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 ErrIntOverflowLeases
- }
- 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 ErrInvalidLengthLeases
- }
- postStringIndexmapkey := iNdEx + intStringLenmapkey
- if postStringIndexmapkey < 0 {
- return ErrInvalidLengthLeases
- }
- 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 ErrIntOverflowLeases
- }
- 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 ErrInvalidLengthLeases
- }
- postStringIndexmapvalue := iNdEx + intStringLenmapvalue
- if postStringIndexmapvalue < 0 {
- return ErrInvalidLengthLeases
- }
- if postStringIndexmapvalue > l {
- return io.ErrUnexpectedEOF
- }
- mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
- iNdEx = postStringIndexmapvalue
- } else {
- iNdEx = entryPreIndex
- skippy, err := skipLeases(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthLeases
- }
- if (iNdEx + skippy) > postIndex {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- m.Labels[mapkey] = mapvalue
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipLeases(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthLeases
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthLeases
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *CreateRequest) 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 ErrIntOverflowLeases
- }
- 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: CreateRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: CreateRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowLeases
- }
- 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 ErrInvalidLengthLeases
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthLeases
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- 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 ErrIntOverflowLeases
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthLeases
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthLeases
- }
- 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 ErrIntOverflowLeases
- }
- 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 ErrIntOverflowLeases
- }
- 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 ErrInvalidLengthLeases
- }
- postStringIndexmapkey := iNdEx + intStringLenmapkey
- if postStringIndexmapkey < 0 {
- return ErrInvalidLengthLeases
- }
- 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 ErrIntOverflowLeases
- }
- 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 ErrInvalidLengthLeases
- }
- postStringIndexmapvalue := iNdEx + intStringLenmapvalue
- if postStringIndexmapvalue < 0 {
- return ErrInvalidLengthLeases
- }
- if postStringIndexmapvalue > l {
- return io.ErrUnexpectedEOF
- }
- mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
- iNdEx = postStringIndexmapvalue
- } else {
- iNdEx = entryPreIndex
- skippy, err := skipLeases(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthLeases
- }
- if (iNdEx + skippy) > postIndex {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- m.Labels[mapkey] = mapvalue
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipLeases(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthLeases
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthLeases
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *CreateResponse) 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 ErrIntOverflowLeases
- }
- 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: CreateResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: CreateResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Lease", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowLeases
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthLeases
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthLeases
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Lease == nil {
- m.Lease = &Lease{}
- }
- if err := m.Lease.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipLeases(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthLeases
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthLeases
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *DeleteRequest) 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 ErrIntOverflowLeases
- }
- 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: DeleteRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: DeleteRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowLeases
- }
- 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 ErrInvalidLengthLeases
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthLeases
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Sync", wireType)
- }
- var v int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowLeases
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.Sync = bool(v != 0)
- default:
- iNdEx = preIndex
- skippy, err := skipLeases(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthLeases
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthLeases
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ListRequest) 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 ErrIntOverflowLeases
- }
- 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: ListRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ListRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowLeases
- }
- 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 ErrInvalidLengthLeases
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthLeases
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Filters = append(m.Filters, string(dAtA[iNdEx:postIndex]))
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipLeases(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthLeases
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthLeases
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ListResponse) 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 ErrIntOverflowLeases
- }
- 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: ListResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ListResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Leases", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowLeases
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthLeases
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthLeases
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Leases = append(m.Leases, &Lease{})
- if err := m.Leases[len(m.Leases)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipLeases(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthLeases
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthLeases
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *Resource) 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 ErrIntOverflowLeases
- }
- 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: Resource: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: Resource: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowLeases
- }
- 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 ErrInvalidLengthLeases
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthLeases
- }
- 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 Type", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowLeases
- }
- 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 ErrInvalidLengthLeases
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthLeases
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Type = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipLeases(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthLeases
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthLeases
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *AddResourceRequest) 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 ErrIntOverflowLeases
- }
- 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: AddResourceRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: AddResourceRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowLeases
- }
- 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 ErrInvalidLengthLeases
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthLeases
- }
- 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 Resource", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowLeases
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthLeases
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthLeases
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.Resource.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipLeases(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthLeases
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthLeases
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *DeleteResourceRequest) 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 ErrIntOverflowLeases
- }
- 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: DeleteResourceRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: DeleteResourceRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowLeases
- }
- 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 ErrInvalidLengthLeases
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthLeases
- }
- 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 Resource", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowLeases
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthLeases
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthLeases
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.Resource.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipLeases(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthLeases
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthLeases
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ListResourcesRequest) 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 ErrIntOverflowLeases
- }
- 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: ListResourcesRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ListResourcesRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowLeases
- }
- 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 ErrInvalidLengthLeases
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthLeases
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipLeases(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthLeases
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthLeases
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ListResourcesResponse) 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 ErrIntOverflowLeases
- }
- 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: ListResourcesResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ListResourcesResponse: 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 ErrIntOverflowLeases
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthLeases
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthLeases
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Resources = append(m.Resources, Resource{})
- if err := m.Resources[len(m.Resources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipLeases(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthLeases
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthLeases
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func skipLeases(dAtA []byte) (n int, err error) {
- l := len(dAtA)
- iNdEx := 0
- depth := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowLeases
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowLeases
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if dAtA[iNdEx-1] < 0x80 {
- break
- }
- }
- case 1:
- iNdEx += 8
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowLeases
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if length < 0 {
- return 0, ErrInvalidLengthLeases
- }
- iNdEx += length
- case 3:
- depth++
- case 4:
- if depth == 0 {
- return 0, ErrUnexpectedEndOfGroupLeases
- }
- depth--
- case 5:
- iNdEx += 4
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- if iNdEx < 0 {
- return 0, ErrInvalidLengthLeases
- }
- if depth == 0 {
- return iNdEx, nil
- }
- }
- return 0, io.ErrUnexpectedEOF
-}
-
-var (
- ErrInvalidLengthLeases = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowLeases = fmt.Errorf("proto: integer overflow")
- ErrUnexpectedEndOfGroupLeases = fmt.Errorf("proto: unexpected end of group")
-)
diff --git a/vendor/github.com/containerd/containerd/api/services/leases/v1/leases.proto b/vendor/github.com/containerd/containerd/api/services/leases/v1/leases.proto
deleted file mode 100644
index ac693e93d..000000000
--- a/vendor/github.com/containerd/containerd/api/services/leases/v1/leases.proto
+++ /dev/null
@@ -1,102 +0,0 @@
-syntax = "proto3";
-
-package containerd.services.leases.v1;
-
-import weak "gogoproto/gogo.proto";
-import "google/protobuf/empty.proto";
-import "google/protobuf/timestamp.proto";
-
-option go_package = "github.com/containerd/containerd/api/services/leases/v1;leases";
-
-// Leases service manages resources leases within the metadata store.
-service Leases {
- // Create creates a new lease for managing changes to metadata. A lease
- // can be used to protect objects from being removed.
- rpc Create(CreateRequest) returns (CreateResponse);
-
- // Delete deletes the lease and makes any unreferenced objects created
- // during the lease eligible for garbage collection if not referenced
- // or retained by other resources during the lease.
- rpc Delete(DeleteRequest) returns (google.protobuf.Empty);
-
- // List lists all active leases, returning the full list of
- // leases and optionally including the referenced resources.
- rpc List(ListRequest) returns (ListResponse);
-
- // AddResource references the resource by the provided lease.
- rpc AddResource(AddResourceRequest) returns (google.protobuf.Empty);
-
- // DeleteResource dereferences the resource by the provided lease.
- rpc DeleteResource(DeleteResourceRequest) returns (google.protobuf.Empty);
-
- // ListResources lists all the resources referenced by the lease.
- rpc ListResources(ListResourcesRequest) returns (ListResourcesResponse);
-}
-
-// Lease is an object which retains resources while it exists.
-message Lease {
- string id = 1;
-
- google.protobuf.Timestamp created_at = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
-
- map labels = 3;
-}
-
-message CreateRequest {
- // ID is used to identity the lease, when the id is not set the service
- // generates a random identifier for the lease.
- string id = 1;
-
- map labels = 3;
-}
-
-message CreateResponse {
- Lease lease = 1;
-}
-
-message DeleteRequest {
- string id = 1;
-
- // Sync indicates that the delete and cleanup should be done
- // synchronously before returning to the caller
- //
- // Default is false
- bool sync = 2;
-}
-
-message ListRequest {
- repeated string filters = 1;
-}
-
-message ListResponse {
- repeated Lease leases = 1;
-}
-
-message Resource {
- string id = 1;
-
- // For snapshotter resource, there are many snapshotter types here, like
- // overlayfs, devmapper etc. The type will be formatted with type,
- // like "snapshotter/overlayfs".
- string type = 2;
-}
-
-message AddResourceRequest {
- string id = 1;
-
- Resource resource = 2 [(gogoproto.nullable) = false];
-}
-
-message DeleteResourceRequest {
- string id = 1;
-
- Resource resource = 2 [(gogoproto.nullable) = false];
-}
-
-message ListResourcesRequest {
- string id = 1;
-}
-
-message ListResourcesResponse {
- repeated Resource resources = 1 [(gogoproto.nullable) = false];
-}
diff --git a/vendor/github.com/containerd/containerd/api/services/namespaces/v1/namespace.pb.go b/vendor/github.com/containerd/containerd/api/services/namespaces/v1/namespace.pb.go
deleted file mode 100644
index 0d1d650ba..000000000
--- a/vendor/github.com/containerd/containerd/api/services/namespaces/v1/namespace.pb.go
+++ /dev/null
@@ -1,2548 +0,0 @@
-// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: github.com/containerd/containerd/api/services/namespaces/v1/namespace.proto
-
-package namespaces
-
-import (
- context "context"
- fmt "fmt"
- proto "github.com/gogo/protobuf/proto"
- github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
- types "github.com/gogo/protobuf/types"
- grpc "google.golang.org/grpc"
- codes "google.golang.org/grpc/codes"
- status "google.golang.org/grpc/status"
- io "io"
- math "math"
- math_bits "math/bits"
- reflect "reflect"
- strings "strings"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
-
-type Namespace struct {
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- // Labels provides an area to include arbitrary data on namespaces.
- //
- // The combined size of a key/value pair cannot exceed 4096 bytes.
- //
- // Note that to add a new value to this field, read the existing set and
- // include the entire result in the update call.
- Labels map[string]string `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Namespace) Reset() { *m = Namespace{} }
-func (*Namespace) ProtoMessage() {}
-func (*Namespace) Descriptor() ([]byte, []int) {
- return fileDescriptor_8c41761eaeea4fd3, []int{0}
-}
-func (m *Namespace) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Namespace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_Namespace.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 *Namespace) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Namespace.Merge(m, src)
-}
-func (m *Namespace) XXX_Size() int {
- return m.Size()
-}
-func (m *Namespace) XXX_DiscardUnknown() {
- xxx_messageInfo_Namespace.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Namespace proto.InternalMessageInfo
-
-type GetNamespaceRequest struct {
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *GetNamespaceRequest) Reset() { *m = GetNamespaceRequest{} }
-func (*GetNamespaceRequest) ProtoMessage() {}
-func (*GetNamespaceRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_8c41761eaeea4fd3, []int{1}
-}
-func (m *GetNamespaceRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *GetNamespaceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_GetNamespaceRequest.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 *GetNamespaceRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GetNamespaceRequest.Merge(m, src)
-}
-func (m *GetNamespaceRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *GetNamespaceRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_GetNamespaceRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GetNamespaceRequest proto.InternalMessageInfo
-
-type GetNamespaceResponse struct {
- Namespace Namespace `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *GetNamespaceResponse) Reset() { *m = GetNamespaceResponse{} }
-func (*GetNamespaceResponse) ProtoMessage() {}
-func (*GetNamespaceResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_8c41761eaeea4fd3, []int{2}
-}
-func (m *GetNamespaceResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *GetNamespaceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_GetNamespaceResponse.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 *GetNamespaceResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GetNamespaceResponse.Merge(m, src)
-}
-func (m *GetNamespaceResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *GetNamespaceResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_GetNamespaceResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GetNamespaceResponse proto.InternalMessageInfo
-
-type ListNamespacesRequest struct {
- Filter string `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ListNamespacesRequest) Reset() { *m = ListNamespacesRequest{} }
-func (*ListNamespacesRequest) ProtoMessage() {}
-func (*ListNamespacesRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_8c41761eaeea4fd3, []int{3}
-}
-func (m *ListNamespacesRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ListNamespacesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ListNamespacesRequest.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 *ListNamespacesRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ListNamespacesRequest.Merge(m, src)
-}
-func (m *ListNamespacesRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *ListNamespacesRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_ListNamespacesRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ListNamespacesRequest proto.InternalMessageInfo
-
-type ListNamespacesResponse struct {
- Namespaces []Namespace `protobuf:"bytes,1,rep,name=namespaces,proto3" json:"namespaces"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ListNamespacesResponse) Reset() { *m = ListNamespacesResponse{} }
-func (*ListNamespacesResponse) ProtoMessage() {}
-func (*ListNamespacesResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_8c41761eaeea4fd3, []int{4}
-}
-func (m *ListNamespacesResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ListNamespacesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ListNamespacesResponse.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 *ListNamespacesResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ListNamespacesResponse.Merge(m, src)
-}
-func (m *ListNamespacesResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *ListNamespacesResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_ListNamespacesResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ListNamespacesResponse proto.InternalMessageInfo
-
-type CreateNamespaceRequest struct {
- Namespace Namespace `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *CreateNamespaceRequest) Reset() { *m = CreateNamespaceRequest{} }
-func (*CreateNamespaceRequest) ProtoMessage() {}
-func (*CreateNamespaceRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_8c41761eaeea4fd3, []int{5}
-}
-func (m *CreateNamespaceRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *CreateNamespaceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_CreateNamespaceRequest.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 *CreateNamespaceRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_CreateNamespaceRequest.Merge(m, src)
-}
-func (m *CreateNamespaceRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *CreateNamespaceRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_CreateNamespaceRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CreateNamespaceRequest proto.InternalMessageInfo
-
-type CreateNamespaceResponse struct {
- Namespace Namespace `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *CreateNamespaceResponse) Reset() { *m = CreateNamespaceResponse{} }
-func (*CreateNamespaceResponse) ProtoMessage() {}
-func (*CreateNamespaceResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_8c41761eaeea4fd3, []int{6}
-}
-func (m *CreateNamespaceResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *CreateNamespaceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_CreateNamespaceResponse.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 *CreateNamespaceResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_CreateNamespaceResponse.Merge(m, src)
-}
-func (m *CreateNamespaceResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *CreateNamespaceResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_CreateNamespaceResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CreateNamespaceResponse proto.InternalMessageInfo
-
-// UpdateNamespaceRequest updates the metadata for a namespace.
-//
-// The operation should follow semantics described in
-// https://developers.google.com/protocol-buffers/docs/reference/csharp/class/google/protobuf/well-known-types/field-mask,
-// unless otherwise qualified.
-type UpdateNamespaceRequest struct {
- // Namespace provides the target value, as declared by the mask, for the update.
- //
- // The namespace field must be set.
- Namespace Namespace `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace"`
- // UpdateMask specifies which fields to perform the update on. If empty,
- // the operation applies to all fields.
- //
- // For the most part, this applies only to selectively updating labels on
- // the namespace. While field masks are typically limited to ascii alphas
- // and digits, we just take everything after the "labels." as the map key.
- UpdateMask *types.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *UpdateNamespaceRequest) Reset() { *m = UpdateNamespaceRequest{} }
-func (*UpdateNamespaceRequest) ProtoMessage() {}
-func (*UpdateNamespaceRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_8c41761eaeea4fd3, []int{7}
-}
-func (m *UpdateNamespaceRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *UpdateNamespaceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_UpdateNamespaceRequest.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 *UpdateNamespaceRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_UpdateNamespaceRequest.Merge(m, src)
-}
-func (m *UpdateNamespaceRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *UpdateNamespaceRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_UpdateNamespaceRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_UpdateNamespaceRequest proto.InternalMessageInfo
-
-type UpdateNamespaceResponse struct {
- Namespace Namespace `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *UpdateNamespaceResponse) Reset() { *m = UpdateNamespaceResponse{} }
-func (*UpdateNamespaceResponse) ProtoMessage() {}
-func (*UpdateNamespaceResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_8c41761eaeea4fd3, []int{8}
-}
-func (m *UpdateNamespaceResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *UpdateNamespaceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_UpdateNamespaceResponse.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 *UpdateNamespaceResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_UpdateNamespaceResponse.Merge(m, src)
-}
-func (m *UpdateNamespaceResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *UpdateNamespaceResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_UpdateNamespaceResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_UpdateNamespaceResponse proto.InternalMessageInfo
-
-type DeleteNamespaceRequest struct {
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *DeleteNamespaceRequest) Reset() { *m = DeleteNamespaceRequest{} }
-func (*DeleteNamespaceRequest) ProtoMessage() {}
-func (*DeleteNamespaceRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_8c41761eaeea4fd3, []int{9}
-}
-func (m *DeleteNamespaceRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *DeleteNamespaceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_DeleteNamespaceRequest.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 *DeleteNamespaceRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_DeleteNamespaceRequest.Merge(m, src)
-}
-func (m *DeleteNamespaceRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *DeleteNamespaceRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_DeleteNamespaceRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_DeleteNamespaceRequest proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*Namespace)(nil), "containerd.services.namespaces.v1.Namespace")
- proto.RegisterMapType((map[string]string)(nil), "containerd.services.namespaces.v1.Namespace.LabelsEntry")
- proto.RegisterType((*GetNamespaceRequest)(nil), "containerd.services.namespaces.v1.GetNamespaceRequest")
- proto.RegisterType((*GetNamespaceResponse)(nil), "containerd.services.namespaces.v1.GetNamespaceResponse")
- proto.RegisterType((*ListNamespacesRequest)(nil), "containerd.services.namespaces.v1.ListNamespacesRequest")
- proto.RegisterType((*ListNamespacesResponse)(nil), "containerd.services.namespaces.v1.ListNamespacesResponse")
- proto.RegisterType((*CreateNamespaceRequest)(nil), "containerd.services.namespaces.v1.CreateNamespaceRequest")
- proto.RegisterType((*CreateNamespaceResponse)(nil), "containerd.services.namespaces.v1.CreateNamespaceResponse")
- proto.RegisterType((*UpdateNamespaceRequest)(nil), "containerd.services.namespaces.v1.UpdateNamespaceRequest")
- proto.RegisterType((*UpdateNamespaceResponse)(nil), "containerd.services.namespaces.v1.UpdateNamespaceResponse")
- proto.RegisterType((*DeleteNamespaceRequest)(nil), "containerd.services.namespaces.v1.DeleteNamespaceRequest")
-}
-
-func init() {
- proto.RegisterFile("github.com/containerd/containerd/api/services/namespaces/v1/namespace.proto", fileDescriptor_8c41761eaeea4fd3)
-}
-
-var fileDescriptor_8c41761eaeea4fd3 = []byte{
- // 551 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xcd, 0x6e, 0xd3, 0x4c,
- 0x14, 0xcd, 0x24, 0xf9, 0x2c, 0xe5, 0x7a, 0xf3, 0x69, 0x08, 0x26, 0x32, 0x92, 0x09, 0x5e, 0x15,
- 0xa9, 0x1a, 0xab, 0x41, 0x82, 0xfe, 0xec, 0x0a, 0x6d, 0x17, 0x14, 0x84, 0x2c, 0x21, 0x21, 0x58,
- 0x80, 0x93, 0x4c, 0x5c, 0x13, 0xc7, 0x36, 0x9e, 0xb1, 0xa5, 0x88, 0x05, 0xbc, 0x0d, 0x1b, 0x1e,
- 0x24, 0x4b, 0x96, 0xac, 0x50, 0x9b, 0x27, 0x41, 0x33, 0x76, 0xe2, 0xd0, 0x18, 0xe1, 0x06, 0xca,
- 0xee, 0x5e, 0x7b, 0xce, 0x3d, 0x67, 0xae, 0xce, 0xb1, 0xe1, 0x89, 0xeb, 0xf1, 0xb3, 0xa4, 0x4f,
- 0x06, 0xe1, 0xc4, 0x1a, 0x84, 0x01, 0x77, 0xbc, 0x80, 0xc6, 0xc3, 0xd5, 0xd2, 0x89, 0x3c, 0x8b,
- 0xd1, 0x38, 0xf5, 0x06, 0x94, 0x59, 0x81, 0x33, 0xa1, 0x2c, 0x72, 0x44, 0x99, 0xee, 0x14, 0x1d,
- 0x89, 0xe2, 0x90, 0x87, 0xf8, 0x6e, 0x01, 0x23, 0x0b, 0x08, 0x29, 0x20, 0x24, 0xdd, 0xd1, 0xdb,
- 0x6e, 0xe8, 0x86, 0xf2, 0xb4, 0x25, 0xaa, 0x0c, 0xa8, 0xdf, 0x76, 0xc3, 0xd0, 0xf5, 0xa9, 0x25,
- 0xbb, 0x7e, 0x32, 0xb2, 0xe8, 0x24, 0xe2, 0xd3, 0xfc, 0x65, 0xf7, 0xf2, 0xcb, 0x91, 0x47, 0xfd,
- 0xe1, 0x9b, 0x89, 0xc3, 0xc6, 0xd9, 0x09, 0xf3, 0x0b, 0x82, 0xd6, 0xb3, 0x05, 0x0d, 0xc6, 0xd0,
- 0x14, 0x9c, 0x1d, 0xd4, 0x45, 0x5b, 0x2d, 0x5b, 0xd6, 0xf8, 0x39, 0x28, 0xbe, 0xd3, 0xa7, 0x3e,
- 0xeb, 0xd4, 0xbb, 0x8d, 0x2d, 0xb5, 0xb7, 0x4b, 0x7e, 0x2b, 0x95, 0x2c, 0x27, 0x92, 0x53, 0x09,
- 0x3d, 0x0a, 0x78, 0x3c, 0xb5, 0xf3, 0x39, 0xfa, 0x1e, 0xa8, 0x2b, 0x8f, 0xf1, 0xff, 0xd0, 0x18,
- 0xd3, 0x69, 0xce, 0x29, 0x4a, 0xdc, 0x86, 0xff, 0x52, 0xc7, 0x4f, 0x68, 0xa7, 0x2e, 0x9f, 0x65,
- 0xcd, 0x7e, 0x7d, 0x17, 0x99, 0xf7, 0xe0, 0xc6, 0x09, 0xe5, 0xcb, 0xf1, 0x36, 0x7d, 0x9f, 0x50,
- 0xc6, 0xcb, 0x74, 0x9b, 0x67, 0xd0, 0xfe, 0xf9, 0x28, 0x8b, 0xc2, 0x80, 0x89, 0xfb, 0xb4, 0x96,
- 0x62, 0x25, 0x40, 0xed, 0x6d, 0x5f, 0xe5, 0x4a, 0x87, 0xcd, 0xd9, 0xf7, 0x3b, 0x35, 0xbb, 0x18,
- 0x62, 0x5a, 0x70, 0xf3, 0xd4, 0x63, 0x05, 0x15, 0x5b, 0xc8, 0xd2, 0x40, 0x19, 0x79, 0x3e, 0xa7,
- 0x71, 0x2e, 0x2c, 0xef, 0x4c, 0x1f, 0xb4, 0xcb, 0x80, 0x5c, 0x9c, 0x0d, 0x50, 0xd0, 0x76, 0x90,
- 0x5c, 0xf8, 0x26, 0xea, 0x56, 0xa6, 0x98, 0xef, 0x40, 0x7b, 0x14, 0x53, 0x87, 0xd3, 0xb5, 0xb5,
- 0xfd, 0xfd, 0x55, 0x8c, 0xe1, 0xd6, 0x1a, 0xd7, 0xb5, 0xed, 0xfd, 0x33, 0x02, 0xed, 0x45, 0x34,
- 0xfc, 0x27, 0x37, 0xc3, 0x07, 0xa0, 0x26, 0x92, 0x4b, 0xa6, 0x47, 0x3a, 0x53, 0xed, 0xe9, 0x24,
- 0x0b, 0x18, 0x59, 0x04, 0x8c, 0x1c, 0x8b, 0x80, 0x3d, 0x75, 0xd8, 0xd8, 0x86, 0xec, 0xb8, 0xa8,
- 0xc5, 0x5a, 0xd6, 0x84, 0x5e, 0xdb, 0x5a, 0xb6, 0x41, 0x7b, 0x4c, 0x7d, 0x5a, 0xb2, 0x95, 0x92,
- 0x98, 0xf4, 0xce, 0x9b, 0x00, 0x85, 0x11, 0x71, 0x0a, 0x8d, 0x13, 0xca, 0xf1, 0x83, 0x0a, 0x12,
- 0x4a, 0x82, 0xa8, 0x3f, 0xbc, 0x32, 0x2e, 0x5f, 0xc3, 0x07, 0x68, 0x8a, 0x48, 0xe0, 0x2a, 0x5f,
- 0x97, 0xd2, 0xb0, 0xe9, 0x7b, 0x1b, 0x20, 0x73, 0xf2, 0x8f, 0xa0, 0x64, 0xae, 0xc5, 0x55, 0x86,
- 0x94, 0x87, 0x49, 0xdf, 0xdf, 0x04, 0x5a, 0x08, 0xc8, 0xfc, 0x51, 0x49, 0x40, 0xb9, 0xe7, 0x2b,
- 0x09, 0xf8, 0x95, 0x0b, 0x5f, 0x83, 0x92, 0x79, 0xa6, 0x92, 0x80, 0x72, 0x7b, 0xe9, 0xda, 0x5a,
- 0x1a, 0x8e, 0xc4, 0xbf, 0xe8, 0xf0, 0xed, 0xec, 0xc2, 0xa8, 0x7d, 0xbb, 0x30, 0x6a, 0x9f, 0xe6,
- 0x06, 0x9a, 0xcd, 0x0d, 0xf4, 0x75, 0x6e, 0xa0, 0xf3, 0xb9, 0x81, 0x5e, 0x1d, 0xff, 0xc1, 0x2f,
- 0xf4, 0xa0, 0xe8, 0x5e, 0xd6, 0xfa, 0x8a, 0xe4, 0xbc, 0xff, 0x23, 0x00, 0x00, 0xff, 0xff, 0x4f,
- 0x4a, 0x87, 0xf3, 0x95, 0x07, 0x00, 0x00,
-}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ context.Context
-var _ grpc.ClientConn
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion4
-
-// NamespacesClient is the client API for Namespaces service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type NamespacesClient interface {
- Get(ctx context.Context, in *GetNamespaceRequest, opts ...grpc.CallOption) (*GetNamespaceResponse, error)
- List(ctx context.Context, in *ListNamespacesRequest, opts ...grpc.CallOption) (*ListNamespacesResponse, error)
- Create(ctx context.Context, in *CreateNamespaceRequest, opts ...grpc.CallOption) (*CreateNamespaceResponse, error)
- Update(ctx context.Context, in *UpdateNamespaceRequest, opts ...grpc.CallOption) (*UpdateNamespaceResponse, error)
- Delete(ctx context.Context, in *DeleteNamespaceRequest, opts ...grpc.CallOption) (*types.Empty, error)
-}
-
-type namespacesClient struct {
- cc *grpc.ClientConn
-}
-
-func NewNamespacesClient(cc *grpc.ClientConn) NamespacesClient {
- return &namespacesClient{cc}
-}
-
-func (c *namespacesClient) Get(ctx context.Context, in *GetNamespaceRequest, opts ...grpc.CallOption) (*GetNamespaceResponse, error) {
- out := new(GetNamespaceResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.namespaces.v1.Namespaces/Get", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *namespacesClient) List(ctx context.Context, in *ListNamespacesRequest, opts ...grpc.CallOption) (*ListNamespacesResponse, error) {
- out := new(ListNamespacesResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.namespaces.v1.Namespaces/List", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *namespacesClient) Create(ctx context.Context, in *CreateNamespaceRequest, opts ...grpc.CallOption) (*CreateNamespaceResponse, error) {
- out := new(CreateNamespaceResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.namespaces.v1.Namespaces/Create", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *namespacesClient) Update(ctx context.Context, in *UpdateNamespaceRequest, opts ...grpc.CallOption) (*UpdateNamespaceResponse, error) {
- out := new(UpdateNamespaceResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.namespaces.v1.Namespaces/Update", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *namespacesClient) Delete(ctx context.Context, in *DeleteNamespaceRequest, opts ...grpc.CallOption) (*types.Empty, error) {
- out := new(types.Empty)
- err := c.cc.Invoke(ctx, "/containerd.services.namespaces.v1.Namespaces/Delete", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// NamespacesServer is the server API for Namespaces service.
-type NamespacesServer interface {
- Get(context.Context, *GetNamespaceRequest) (*GetNamespaceResponse, error)
- List(context.Context, *ListNamespacesRequest) (*ListNamespacesResponse, error)
- Create(context.Context, *CreateNamespaceRequest) (*CreateNamespaceResponse, error)
- Update(context.Context, *UpdateNamespaceRequest) (*UpdateNamespaceResponse, error)
- Delete(context.Context, *DeleteNamespaceRequest) (*types.Empty, error)
-}
-
-// UnimplementedNamespacesServer can be embedded to have forward compatible implementations.
-type UnimplementedNamespacesServer struct {
-}
-
-func (*UnimplementedNamespacesServer) Get(ctx context.Context, req *GetNamespaceRequest) (*GetNamespaceResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
-}
-func (*UnimplementedNamespacesServer) List(ctx context.Context, req *ListNamespacesRequest) (*ListNamespacesResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
-}
-func (*UnimplementedNamespacesServer) Create(ctx context.Context, req *CreateNamespaceRequest) (*CreateNamespaceResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
-}
-func (*UnimplementedNamespacesServer) Update(ctx context.Context, req *UpdateNamespaceRequest) (*UpdateNamespaceResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
-}
-func (*UnimplementedNamespacesServer) Delete(ctx context.Context, req *DeleteNamespaceRequest) (*types.Empty, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
-}
-
-func RegisterNamespacesServer(s *grpc.Server, srv NamespacesServer) {
- s.RegisterService(&_Namespaces_serviceDesc, srv)
-}
-
-func _Namespaces_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(GetNamespaceRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(NamespacesServer).Get(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.namespaces.v1.Namespaces/Get",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(NamespacesServer).Get(ctx, req.(*GetNamespaceRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Namespaces_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(ListNamespacesRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(NamespacesServer).List(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.namespaces.v1.Namespaces/List",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(NamespacesServer).List(ctx, req.(*ListNamespacesRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Namespaces_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(CreateNamespaceRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(NamespacesServer).Create(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.namespaces.v1.Namespaces/Create",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(NamespacesServer).Create(ctx, req.(*CreateNamespaceRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Namespaces_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(UpdateNamespaceRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(NamespacesServer).Update(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.namespaces.v1.Namespaces/Update",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(NamespacesServer).Update(ctx, req.(*UpdateNamespaceRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Namespaces_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(DeleteNamespaceRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(NamespacesServer).Delete(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.namespaces.v1.Namespaces/Delete",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(NamespacesServer).Delete(ctx, req.(*DeleteNamespaceRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-var _Namespaces_serviceDesc = grpc.ServiceDesc{
- ServiceName: "containerd.services.namespaces.v1.Namespaces",
- HandlerType: (*NamespacesServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "Get",
- Handler: _Namespaces_Get_Handler,
- },
- {
- MethodName: "List",
- Handler: _Namespaces_List_Handler,
- },
- {
- MethodName: "Create",
- Handler: _Namespaces_Create_Handler,
- },
- {
- MethodName: "Update",
- Handler: _Namespaces_Update_Handler,
- },
- {
- MethodName: "Delete",
- Handler: _Namespaces_Delete_Handler,
- },
- },
- Streams: []grpc.StreamDesc{},
- Metadata: "github.com/containerd/containerd/api/services/namespaces/v1/namespace.proto",
-}
-
-func (m *Namespace) 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 *Namespace) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *Namespace) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Labels) > 0 {
- for k := range m.Labels {
- v := m.Labels[k]
- baseI := i
- i -= len(v)
- copy(dAtA[i:], v)
- i = encodeVarintNamespace(dAtA, i, uint64(len(v)))
- i--
- dAtA[i] = 0x12
- i -= len(k)
- copy(dAtA[i:], k)
- i = encodeVarintNamespace(dAtA, i, uint64(len(k)))
- i--
- dAtA[i] = 0xa
- i = encodeVarintNamespace(dAtA, i, uint64(baseI-i))
- i--
- dAtA[i] = 0x12
- }
- }
- if len(m.Name) > 0 {
- i -= len(m.Name)
- copy(dAtA[i:], m.Name)
- i = encodeVarintNamespace(dAtA, i, uint64(len(m.Name)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *GetNamespaceRequest) 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 *GetNamespaceRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *GetNamespaceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Name) > 0 {
- i -= len(m.Name)
- copy(dAtA[i:], m.Name)
- i = encodeVarintNamespace(dAtA, i, uint64(len(m.Name)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *GetNamespaceResponse) 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 *GetNamespaceResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *GetNamespaceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- {
- size, err := m.Namespace.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintNamespace(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func (m *ListNamespacesRequest) 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 *ListNamespacesRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ListNamespacesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Filter) > 0 {
- i -= len(m.Filter)
- copy(dAtA[i:], m.Filter)
- i = encodeVarintNamespace(dAtA, i, uint64(len(m.Filter)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ListNamespacesResponse) 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 *ListNamespacesResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ListNamespacesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Namespaces) > 0 {
- for iNdEx := len(m.Namespaces) - 1; iNdEx >= 0; iNdEx-- {
- {
- size, err := m.Namespaces[iNdEx].MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintNamespace(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- }
- }
- return len(dAtA) - i, nil
-}
-
-func (m *CreateNamespaceRequest) 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 *CreateNamespaceRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *CreateNamespaceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- {
- size, err := m.Namespace.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintNamespace(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func (m *CreateNamespaceResponse) 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 *CreateNamespaceResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *CreateNamespaceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- {
- size, err := m.Namespace.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintNamespace(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func (m *UpdateNamespaceRequest) 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 *UpdateNamespaceRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *UpdateNamespaceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.UpdateMask != nil {
- {
- size, err := m.UpdateMask.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintNamespace(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x12
- }
- {
- size, err := m.Namespace.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintNamespace(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func (m *UpdateNamespaceResponse) 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 *UpdateNamespaceResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *UpdateNamespaceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- {
- size, err := m.Namespace.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintNamespace(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func (m *DeleteNamespaceRequest) 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 *DeleteNamespaceRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *DeleteNamespaceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Name) > 0 {
- i -= len(m.Name)
- copy(dAtA[i:], m.Name)
- i = encodeVarintNamespace(dAtA, i, uint64(len(m.Name)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func encodeVarintNamespace(dAtA []byte, offset int, v uint64) int {
- offset -= sovNamespace(v)
- base := offset
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return base
-}
-func (m *Namespace) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Name)
- if l > 0 {
- n += 1 + l + sovNamespace(uint64(l))
- }
- if len(m.Labels) > 0 {
- for k, v := range m.Labels {
- _ = k
- _ = v
- mapEntrySize := 1 + len(k) + sovNamespace(uint64(len(k))) + 1 + len(v) + sovNamespace(uint64(len(v)))
- n += mapEntrySize + 1 + sovNamespace(uint64(mapEntrySize))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *GetNamespaceRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Name)
- if l > 0 {
- n += 1 + l + sovNamespace(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *GetNamespaceResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = m.Namespace.Size()
- n += 1 + l + sovNamespace(uint64(l))
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ListNamespacesRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Filter)
- if l > 0 {
- n += 1 + l + sovNamespace(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ListNamespacesResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.Namespaces) > 0 {
- for _, e := range m.Namespaces {
- l = e.Size()
- n += 1 + l + sovNamespace(uint64(l))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *CreateNamespaceRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = m.Namespace.Size()
- n += 1 + l + sovNamespace(uint64(l))
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *CreateNamespaceResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = m.Namespace.Size()
- n += 1 + l + sovNamespace(uint64(l))
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *UpdateNamespaceRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = m.Namespace.Size()
- n += 1 + l + sovNamespace(uint64(l))
- if m.UpdateMask != nil {
- l = m.UpdateMask.Size()
- n += 1 + l + sovNamespace(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *UpdateNamespaceResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = m.Namespace.Size()
- n += 1 + l + sovNamespace(uint64(l))
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *DeleteNamespaceRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Name)
- if l > 0 {
- n += 1 + l + sovNamespace(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func sovNamespace(x uint64) (n int) {
- return (math_bits.Len64(x|1) + 6) / 7
-}
-func sozNamespace(x uint64) (n int) {
- return sovNamespace(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-func (this *Namespace) 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 += "}"
- s := strings.Join([]string{`&Namespace{`,
- `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
- `Labels:` + mapStringForLabels + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *GetNamespaceRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&GetNamespaceRequest{`,
- `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *GetNamespaceResponse) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&GetNamespaceResponse{`,
- `Namespace:` + strings.Replace(strings.Replace(this.Namespace.String(), "Namespace", "Namespace", 1), `&`, ``, 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ListNamespacesRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ListNamespacesRequest{`,
- `Filter:` + fmt.Sprintf("%v", this.Filter) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ListNamespacesResponse) String() string {
- if this == nil {
- return "nil"
- }
- repeatedStringForNamespaces := "[]Namespace{"
- for _, f := range this.Namespaces {
- repeatedStringForNamespaces += strings.Replace(strings.Replace(f.String(), "Namespace", "Namespace", 1), `&`, ``, 1) + ","
- }
- repeatedStringForNamespaces += "}"
- s := strings.Join([]string{`&ListNamespacesResponse{`,
- `Namespaces:` + repeatedStringForNamespaces + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *CreateNamespaceRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&CreateNamespaceRequest{`,
- `Namespace:` + strings.Replace(strings.Replace(this.Namespace.String(), "Namespace", "Namespace", 1), `&`, ``, 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *CreateNamespaceResponse) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&CreateNamespaceResponse{`,
- `Namespace:` + strings.Replace(strings.Replace(this.Namespace.String(), "Namespace", "Namespace", 1), `&`, ``, 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *UpdateNamespaceRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&UpdateNamespaceRequest{`,
- `Namespace:` + strings.Replace(strings.Replace(this.Namespace.String(), "Namespace", "Namespace", 1), `&`, ``, 1) + `,`,
- `UpdateMask:` + strings.Replace(fmt.Sprintf("%v", this.UpdateMask), "FieldMask", "types.FieldMask", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *UpdateNamespaceResponse) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&UpdateNamespaceResponse{`,
- `Namespace:` + strings.Replace(strings.Replace(this.Namespace.String(), "Namespace", "Namespace", 1), `&`, ``, 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *DeleteNamespaceRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&DeleteNamespaceRequest{`,
- `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func valueToStringNamespace(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
-}
-func (m *Namespace) 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 ErrIntOverflowNamespace
- }
- 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: Namespace: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: Namespace: 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 ErrIntOverflowNamespace
- }
- 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 ErrInvalidLengthNamespace
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthNamespace
- }
- 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 Labels", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNamespace
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthNamespace
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthNamespace
- }
- 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 ErrIntOverflowNamespace
- }
- 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 ErrIntOverflowNamespace
- }
- 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 ErrInvalidLengthNamespace
- }
- postStringIndexmapkey := iNdEx + intStringLenmapkey
- if postStringIndexmapkey < 0 {
- return ErrInvalidLengthNamespace
- }
- 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 ErrIntOverflowNamespace
- }
- 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 ErrInvalidLengthNamespace
- }
- postStringIndexmapvalue := iNdEx + intStringLenmapvalue
- if postStringIndexmapvalue < 0 {
- return ErrInvalidLengthNamespace
- }
- if postStringIndexmapvalue > l {
- return io.ErrUnexpectedEOF
- }
- mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
- iNdEx = postStringIndexmapvalue
- } else {
- iNdEx = entryPreIndex
- skippy, err := skipNamespace(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthNamespace
- }
- if (iNdEx + skippy) > postIndex {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- m.Labels[mapkey] = mapvalue
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipNamespace(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthNamespace
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthNamespace
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *GetNamespaceRequest) 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 ErrIntOverflowNamespace
- }
- 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: GetNamespaceRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: GetNamespaceRequest: 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 ErrIntOverflowNamespace
- }
- 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 ErrInvalidLengthNamespace
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthNamespace
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Name = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipNamespace(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthNamespace
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthNamespace
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *GetNamespaceResponse) 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 ErrIntOverflowNamespace
- }
- 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: GetNamespaceResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: GetNamespaceResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNamespace
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthNamespace
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthNamespace
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.Namespace.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipNamespace(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthNamespace
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthNamespace
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ListNamespacesRequest) 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 ErrIntOverflowNamespace
- }
- 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: ListNamespacesRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ListNamespacesRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNamespace
- }
- 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 ErrInvalidLengthNamespace
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthNamespace
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Filter = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipNamespace(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthNamespace
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthNamespace
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ListNamespacesResponse) 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 ErrIntOverflowNamespace
- }
- 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: ListNamespacesResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ListNamespacesResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Namespaces", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNamespace
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthNamespace
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthNamespace
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Namespaces = append(m.Namespaces, Namespace{})
- if err := m.Namespaces[len(m.Namespaces)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipNamespace(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthNamespace
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthNamespace
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *CreateNamespaceRequest) 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 ErrIntOverflowNamespace
- }
- 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: CreateNamespaceRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: CreateNamespaceRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNamespace
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthNamespace
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthNamespace
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.Namespace.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipNamespace(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthNamespace
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthNamespace
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *CreateNamespaceResponse) 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 ErrIntOverflowNamespace
- }
- 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: CreateNamespaceResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: CreateNamespaceResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNamespace
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthNamespace
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthNamespace
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.Namespace.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipNamespace(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthNamespace
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthNamespace
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *UpdateNamespaceRequest) 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 ErrIntOverflowNamespace
- }
- 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: UpdateNamespaceRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: UpdateNamespaceRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNamespace
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthNamespace
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthNamespace
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.Namespace.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field UpdateMask", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNamespace
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthNamespace
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthNamespace
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.UpdateMask == nil {
- m.UpdateMask = &types.FieldMask{}
- }
- if err := m.UpdateMask.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipNamespace(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthNamespace
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthNamespace
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *UpdateNamespaceResponse) 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 ErrIntOverflowNamespace
- }
- 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: UpdateNamespaceResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: UpdateNamespaceResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowNamespace
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthNamespace
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthNamespace
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.Namespace.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipNamespace(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthNamespace
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthNamespace
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *DeleteNamespaceRequest) 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 ErrIntOverflowNamespace
- }
- 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: DeleteNamespaceRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: DeleteNamespaceRequest: 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 ErrIntOverflowNamespace
- }
- 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 ErrInvalidLengthNamespace
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthNamespace
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Name = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipNamespace(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthNamespace
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthNamespace
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func skipNamespace(dAtA []byte) (n int, err error) {
- l := len(dAtA)
- iNdEx := 0
- depth := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowNamespace
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowNamespace
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if dAtA[iNdEx-1] < 0x80 {
- break
- }
- }
- case 1:
- iNdEx += 8
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowNamespace
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if length < 0 {
- return 0, ErrInvalidLengthNamespace
- }
- iNdEx += length
- case 3:
- depth++
- case 4:
- if depth == 0 {
- return 0, ErrUnexpectedEndOfGroupNamespace
- }
- depth--
- case 5:
- iNdEx += 4
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- if iNdEx < 0 {
- return 0, ErrInvalidLengthNamespace
- }
- if depth == 0 {
- return iNdEx, nil
- }
- }
- return 0, io.ErrUnexpectedEOF
-}
-
-var (
- ErrInvalidLengthNamespace = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowNamespace = fmt.Errorf("proto: integer overflow")
- ErrUnexpectedEndOfGroupNamespace = fmt.Errorf("proto: unexpected end of group")
-)
diff --git a/vendor/github.com/containerd/containerd/api/services/namespaces/v1/namespace.proto b/vendor/github.com/containerd/containerd/api/services/namespaces/v1/namespace.proto
deleted file mode 100644
index c22eebaf1..000000000
--- a/vendor/github.com/containerd/containerd/api/services/namespaces/v1/namespace.proto
+++ /dev/null
@@ -1,92 +0,0 @@
-syntax = "proto3";
-
-package containerd.services.namespaces.v1;
-
-import weak "gogoproto/gogo.proto";
-import "google/protobuf/empty.proto";
-import "google/protobuf/field_mask.proto";
-
-option go_package = "github.com/containerd/containerd/api/services/namespaces/v1;namespaces";
-
-// Namespaces provides the ability to manipulate containerd namespaces.
-//
-// All objects in the system are required to be a member of a namespace. If a
-// namespace is deleted, all objects, including containers, images and
-// snapshots, will be deleted, as well.
-//
-// Unless otherwise noted, operations in containerd apply only to the namespace
-// supplied per request.
-//
-// I hope this goes without saying, but namespaces are themselves NOT
-// namespaced.
-service Namespaces {
- rpc Get(GetNamespaceRequest) returns (GetNamespaceResponse);
- rpc List(ListNamespacesRequest) returns (ListNamespacesResponse);
- rpc Create(CreateNamespaceRequest) returns (CreateNamespaceResponse);
- rpc Update(UpdateNamespaceRequest) returns (UpdateNamespaceResponse);
- rpc Delete(DeleteNamespaceRequest) returns (google.protobuf.Empty);
-}
-
-message Namespace {
- string name = 1;
-
- // Labels provides an area to include arbitrary data on namespaces.
- //
- // The combined size of a key/value pair cannot exceed 4096 bytes.
- //
- // Note that to add a new value to this field, read the existing set and
- // include the entire result in the update call.
- map labels = 2;
-}
-
-message GetNamespaceRequest {
- string name = 1;
-}
-
-message GetNamespaceResponse {
- Namespace namespace = 1 [(gogoproto.nullable) = false];
-}
-
-message ListNamespacesRequest {
- string filter = 1;
-}
-
-message ListNamespacesResponse {
- repeated Namespace namespaces = 1 [(gogoproto.nullable) = false];
-}
-
-message CreateNamespaceRequest {
- Namespace namespace = 1 [(gogoproto.nullable) = false];
-}
-
-message CreateNamespaceResponse {
- Namespace namespace = 1 [(gogoproto.nullable) = false];
-}
-
-// UpdateNamespaceRequest updates the metadata for a namespace.
-//
-// The operation should follow semantics described in
-// https://developers.google.com/protocol-buffers/docs/reference/csharp/class/google/protobuf/well-known-types/field-mask,
-// unless otherwise qualified.
-message UpdateNamespaceRequest {
- // Namespace provides the target value, as declared by the mask, for the update.
- //
- // The namespace field must be set.
- Namespace namespace = 1 [(gogoproto.nullable) = false];
-
- // UpdateMask specifies which fields to perform the update on. If empty,
- // the operation applies to all fields.
- //
- // For the most part, this applies only to selectively updating labels on
- // the namespace. While field masks are typically limited to ascii alphas
- // and digits, we just take everything after the "labels." as the map key.
- google.protobuf.FieldMask update_mask = 2;
-}
-
-message UpdateNamespaceResponse {
- Namespace namespace = 1 [(gogoproto.nullable) = false];
-}
-
-message DeleteNamespaceRequest {
- string name = 1;
-}
diff --git a/vendor/github.com/containerd/containerd/api/services/snapshots/v1/snapshots.pb.go b/vendor/github.com/containerd/containerd/api/services/snapshots/v1/snapshots.pb.go
deleted file mode 100644
index 1877afded..000000000
--- a/vendor/github.com/containerd/containerd/api/services/snapshots/v1/snapshots.pb.go
+++ /dev/null
@@ -1,5595 +0,0 @@
-// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: github.com/containerd/containerd/api/services/snapshots/v1/snapshots.proto
-
-package snapshots
-
-import (
- context "context"
- fmt "fmt"
- types "github.com/containerd/containerd/api/types"
- proto "github.com/gogo/protobuf/proto"
- github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
- github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
- types1 "github.com/gogo/protobuf/types"
- grpc "google.golang.org/grpc"
- codes "google.golang.org/grpc/codes"
- status "google.golang.org/grpc/status"
- io "io"
- math "math"
- math_bits "math/bits"
- reflect "reflect"
- strings "strings"
- time "time"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-var _ = time.Kitchen
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
-
-type Kind int32
-
-const (
- KindUnknown Kind = 0
- KindView Kind = 1
- KindActive Kind = 2
- KindCommitted Kind = 3
-)
-
-var Kind_name = map[int32]string{
- 0: "UNKNOWN",
- 1: "VIEW",
- 2: "ACTIVE",
- 3: "COMMITTED",
-}
-
-var Kind_value = map[string]int32{
- "UNKNOWN": 0,
- "VIEW": 1,
- "ACTIVE": 2,
- "COMMITTED": 3,
-}
-
-func (x Kind) String() string {
- return proto.EnumName(Kind_name, int32(x))
-}
-
-func (Kind) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_cfc0ddf12791f168, []int{0}
-}
-
-type PrepareSnapshotRequest struct {
- Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"`
- Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
- Parent string `protobuf:"bytes,3,opt,name=parent,proto3" json:"parent,omitempty"`
- // Labels are arbitrary data on snapshots.
- //
- // The combined size of a key/value pair cannot exceed 4096 bytes.
- Labels map[string]string `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *PrepareSnapshotRequest) Reset() { *m = PrepareSnapshotRequest{} }
-func (*PrepareSnapshotRequest) ProtoMessage() {}
-func (*PrepareSnapshotRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_cfc0ddf12791f168, []int{0}
-}
-func (m *PrepareSnapshotRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PrepareSnapshotRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_PrepareSnapshotRequest.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 *PrepareSnapshotRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PrepareSnapshotRequest.Merge(m, src)
-}
-func (m *PrepareSnapshotRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *PrepareSnapshotRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_PrepareSnapshotRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_PrepareSnapshotRequest proto.InternalMessageInfo
-
-type PrepareSnapshotResponse struct {
- Mounts []*types.Mount `protobuf:"bytes,1,rep,name=mounts,proto3" json:"mounts,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *PrepareSnapshotResponse) Reset() { *m = PrepareSnapshotResponse{} }
-func (*PrepareSnapshotResponse) ProtoMessage() {}
-func (*PrepareSnapshotResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_cfc0ddf12791f168, []int{1}
-}
-func (m *PrepareSnapshotResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PrepareSnapshotResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_PrepareSnapshotResponse.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 *PrepareSnapshotResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PrepareSnapshotResponse.Merge(m, src)
-}
-func (m *PrepareSnapshotResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *PrepareSnapshotResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_PrepareSnapshotResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_PrepareSnapshotResponse proto.InternalMessageInfo
-
-type ViewSnapshotRequest struct {
- Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"`
- Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
- Parent string `protobuf:"bytes,3,opt,name=parent,proto3" json:"parent,omitempty"`
- // Labels are arbitrary data on snapshots.
- //
- // The combined size of a key/value pair cannot exceed 4096 bytes.
- Labels map[string]string `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ViewSnapshotRequest) Reset() { *m = ViewSnapshotRequest{} }
-func (*ViewSnapshotRequest) ProtoMessage() {}
-func (*ViewSnapshotRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_cfc0ddf12791f168, []int{2}
-}
-func (m *ViewSnapshotRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ViewSnapshotRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ViewSnapshotRequest.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 *ViewSnapshotRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ViewSnapshotRequest.Merge(m, src)
-}
-func (m *ViewSnapshotRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *ViewSnapshotRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_ViewSnapshotRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ViewSnapshotRequest proto.InternalMessageInfo
-
-type ViewSnapshotResponse struct {
- Mounts []*types.Mount `protobuf:"bytes,1,rep,name=mounts,proto3" json:"mounts,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ViewSnapshotResponse) Reset() { *m = ViewSnapshotResponse{} }
-func (*ViewSnapshotResponse) ProtoMessage() {}
-func (*ViewSnapshotResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_cfc0ddf12791f168, []int{3}
-}
-func (m *ViewSnapshotResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ViewSnapshotResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ViewSnapshotResponse.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 *ViewSnapshotResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ViewSnapshotResponse.Merge(m, src)
-}
-func (m *ViewSnapshotResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *ViewSnapshotResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_ViewSnapshotResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ViewSnapshotResponse proto.InternalMessageInfo
-
-type MountsRequest struct {
- Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"`
- Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *MountsRequest) Reset() { *m = MountsRequest{} }
-func (*MountsRequest) ProtoMessage() {}
-func (*MountsRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_cfc0ddf12791f168, []int{4}
-}
-func (m *MountsRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *MountsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_MountsRequest.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 *MountsRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MountsRequest.Merge(m, src)
-}
-func (m *MountsRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *MountsRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_MountsRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_MountsRequest proto.InternalMessageInfo
-
-type MountsResponse struct {
- Mounts []*types.Mount `protobuf:"bytes,1,rep,name=mounts,proto3" json:"mounts,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *MountsResponse) Reset() { *m = MountsResponse{} }
-func (*MountsResponse) ProtoMessage() {}
-func (*MountsResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_cfc0ddf12791f168, []int{5}
-}
-func (m *MountsResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *MountsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_MountsResponse.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 *MountsResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MountsResponse.Merge(m, src)
-}
-func (m *MountsResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *MountsResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_MountsResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_MountsResponse proto.InternalMessageInfo
-
-type RemoveSnapshotRequest struct {
- Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"`
- Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *RemoveSnapshotRequest) Reset() { *m = RemoveSnapshotRequest{} }
-func (*RemoveSnapshotRequest) ProtoMessage() {}
-func (*RemoveSnapshotRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_cfc0ddf12791f168, []int{6}
-}
-func (m *RemoveSnapshotRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *RemoveSnapshotRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_RemoveSnapshotRequest.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 *RemoveSnapshotRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_RemoveSnapshotRequest.Merge(m, src)
-}
-func (m *RemoveSnapshotRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *RemoveSnapshotRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_RemoveSnapshotRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_RemoveSnapshotRequest proto.InternalMessageInfo
-
-type CommitSnapshotRequest struct {
- Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"`
- Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
- Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
- // Labels are arbitrary data on snapshots.
- //
- // The combined size of a key/value pair cannot exceed 4096 bytes.
- Labels map[string]string `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *CommitSnapshotRequest) Reset() { *m = CommitSnapshotRequest{} }
-func (*CommitSnapshotRequest) ProtoMessage() {}
-func (*CommitSnapshotRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_cfc0ddf12791f168, []int{7}
-}
-func (m *CommitSnapshotRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *CommitSnapshotRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_CommitSnapshotRequest.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 *CommitSnapshotRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_CommitSnapshotRequest.Merge(m, src)
-}
-func (m *CommitSnapshotRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *CommitSnapshotRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_CommitSnapshotRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CommitSnapshotRequest proto.InternalMessageInfo
-
-type StatSnapshotRequest struct {
- Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"`
- Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *StatSnapshotRequest) Reset() { *m = StatSnapshotRequest{} }
-func (*StatSnapshotRequest) ProtoMessage() {}
-func (*StatSnapshotRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_cfc0ddf12791f168, []int{8}
-}
-func (m *StatSnapshotRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *StatSnapshotRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_StatSnapshotRequest.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 *StatSnapshotRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_StatSnapshotRequest.Merge(m, src)
-}
-func (m *StatSnapshotRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *StatSnapshotRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_StatSnapshotRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_StatSnapshotRequest proto.InternalMessageInfo
-
-type Info struct {
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- Parent string `protobuf:"bytes,2,opt,name=parent,proto3" json:"parent,omitempty"`
- Kind Kind `protobuf:"varint,3,opt,name=kind,proto3,enum=containerd.services.snapshots.v1.Kind" json:"kind,omitempty"`
- // CreatedAt provides the time at which the snapshot was created.
- CreatedAt time.Time `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at"`
- // UpdatedAt provides the time the info was last updated.
- UpdatedAt time.Time `protobuf:"bytes,5,opt,name=updated_at,json=updatedAt,proto3,stdtime" json:"updated_at"`
- // Labels are arbitrary data on snapshots.
- //
- // The combined size of a key/value pair cannot exceed 4096 bytes.
- Labels map[string]string `protobuf:"bytes,6,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Info) Reset() { *m = Info{} }
-func (*Info) ProtoMessage() {}
-func (*Info) Descriptor() ([]byte, []int) {
- return fileDescriptor_cfc0ddf12791f168, []int{9}
-}
-func (m *Info) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Info) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_Info.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 *Info) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Info.Merge(m, src)
-}
-func (m *Info) XXX_Size() int {
- return m.Size()
-}
-func (m *Info) XXX_DiscardUnknown() {
- xxx_messageInfo_Info.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Info proto.InternalMessageInfo
-
-type StatSnapshotResponse struct {
- Info Info `protobuf:"bytes,1,opt,name=info,proto3" json:"info"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *StatSnapshotResponse) Reset() { *m = StatSnapshotResponse{} }
-func (*StatSnapshotResponse) ProtoMessage() {}
-func (*StatSnapshotResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_cfc0ddf12791f168, []int{10}
-}
-func (m *StatSnapshotResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *StatSnapshotResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_StatSnapshotResponse.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 *StatSnapshotResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_StatSnapshotResponse.Merge(m, src)
-}
-func (m *StatSnapshotResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *StatSnapshotResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_StatSnapshotResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_StatSnapshotResponse proto.InternalMessageInfo
-
-type UpdateSnapshotRequest struct {
- Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"`
- Info Info `protobuf:"bytes,2,opt,name=info,proto3" json:"info"`
- // UpdateMask specifies which fields to perform the update on. If empty,
- // the operation applies to all fields.
- //
- // In info, Name, Parent, Kind, Created are immutable,
- // other field may be updated using this mask.
- // If no mask is provided, all mutable field are updated.
- UpdateMask *types1.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *UpdateSnapshotRequest) Reset() { *m = UpdateSnapshotRequest{} }
-func (*UpdateSnapshotRequest) ProtoMessage() {}
-func (*UpdateSnapshotRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_cfc0ddf12791f168, []int{11}
-}
-func (m *UpdateSnapshotRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *UpdateSnapshotRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_UpdateSnapshotRequest.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 *UpdateSnapshotRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_UpdateSnapshotRequest.Merge(m, src)
-}
-func (m *UpdateSnapshotRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *UpdateSnapshotRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_UpdateSnapshotRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_UpdateSnapshotRequest proto.InternalMessageInfo
-
-type UpdateSnapshotResponse struct {
- Info Info `protobuf:"bytes,1,opt,name=info,proto3" json:"info"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *UpdateSnapshotResponse) Reset() { *m = UpdateSnapshotResponse{} }
-func (*UpdateSnapshotResponse) ProtoMessage() {}
-func (*UpdateSnapshotResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_cfc0ddf12791f168, []int{12}
-}
-func (m *UpdateSnapshotResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *UpdateSnapshotResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_UpdateSnapshotResponse.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 *UpdateSnapshotResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_UpdateSnapshotResponse.Merge(m, src)
-}
-func (m *UpdateSnapshotResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *UpdateSnapshotResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_UpdateSnapshotResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_UpdateSnapshotResponse proto.InternalMessageInfo
-
-type ListSnapshotsRequest struct {
- Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"`
- // Filters contains one or more filters using the syntax defined in the
- // containerd filter package.
- //
- // The returned result will be those that match any of the provided
- // filters. Expanded, images that match the following will be
- // returned:
- //
- // filters[0] or filters[1] or ... or filters[n-1] or filters[n]
- //
- // If filters is zero-length or nil, all items will be returned.
- Filters []string `protobuf:"bytes,2,rep,name=filters,proto3" json:"filters,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ListSnapshotsRequest) Reset() { *m = ListSnapshotsRequest{} }
-func (*ListSnapshotsRequest) ProtoMessage() {}
-func (*ListSnapshotsRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_cfc0ddf12791f168, []int{13}
-}
-func (m *ListSnapshotsRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ListSnapshotsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ListSnapshotsRequest.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 *ListSnapshotsRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ListSnapshotsRequest.Merge(m, src)
-}
-func (m *ListSnapshotsRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *ListSnapshotsRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_ListSnapshotsRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ListSnapshotsRequest proto.InternalMessageInfo
-
-type ListSnapshotsResponse struct {
- Info []Info `protobuf:"bytes,1,rep,name=info,proto3" json:"info"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ListSnapshotsResponse) Reset() { *m = ListSnapshotsResponse{} }
-func (*ListSnapshotsResponse) ProtoMessage() {}
-func (*ListSnapshotsResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_cfc0ddf12791f168, []int{14}
-}
-func (m *ListSnapshotsResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ListSnapshotsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ListSnapshotsResponse.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 *ListSnapshotsResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ListSnapshotsResponse.Merge(m, src)
-}
-func (m *ListSnapshotsResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *ListSnapshotsResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_ListSnapshotsResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ListSnapshotsResponse proto.InternalMessageInfo
-
-type UsageRequest struct {
- Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"`
- Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *UsageRequest) Reset() { *m = UsageRequest{} }
-func (*UsageRequest) ProtoMessage() {}
-func (*UsageRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_cfc0ddf12791f168, []int{15}
-}
-func (m *UsageRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *UsageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_UsageRequest.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 *UsageRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_UsageRequest.Merge(m, src)
-}
-func (m *UsageRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *UsageRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_UsageRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_UsageRequest proto.InternalMessageInfo
-
-type UsageResponse struct {
- Size_ int64 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"`
- Inodes int64 `protobuf:"varint,2,opt,name=inodes,proto3" json:"inodes,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *UsageResponse) Reset() { *m = UsageResponse{} }
-func (*UsageResponse) ProtoMessage() {}
-func (*UsageResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_cfc0ddf12791f168, []int{16}
-}
-func (m *UsageResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *UsageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_UsageResponse.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 *UsageResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_UsageResponse.Merge(m, src)
-}
-func (m *UsageResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *UsageResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_UsageResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_UsageResponse proto.InternalMessageInfo
-
-type CleanupRequest struct {
- Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *CleanupRequest) Reset() { *m = CleanupRequest{} }
-func (*CleanupRequest) ProtoMessage() {}
-func (*CleanupRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_cfc0ddf12791f168, []int{17}
-}
-func (m *CleanupRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *CleanupRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_CleanupRequest.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 *CleanupRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_CleanupRequest.Merge(m, src)
-}
-func (m *CleanupRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *CleanupRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_CleanupRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CleanupRequest proto.InternalMessageInfo
-
-func init() {
- proto.RegisterEnum("containerd.services.snapshots.v1.Kind", Kind_name, Kind_value)
- proto.RegisterType((*PrepareSnapshotRequest)(nil), "containerd.services.snapshots.v1.PrepareSnapshotRequest")
- proto.RegisterMapType((map[string]string)(nil), "containerd.services.snapshots.v1.PrepareSnapshotRequest.LabelsEntry")
- proto.RegisterType((*PrepareSnapshotResponse)(nil), "containerd.services.snapshots.v1.PrepareSnapshotResponse")
- proto.RegisterType((*ViewSnapshotRequest)(nil), "containerd.services.snapshots.v1.ViewSnapshotRequest")
- proto.RegisterMapType((map[string]string)(nil), "containerd.services.snapshots.v1.ViewSnapshotRequest.LabelsEntry")
- proto.RegisterType((*ViewSnapshotResponse)(nil), "containerd.services.snapshots.v1.ViewSnapshotResponse")
- proto.RegisterType((*MountsRequest)(nil), "containerd.services.snapshots.v1.MountsRequest")
- proto.RegisterType((*MountsResponse)(nil), "containerd.services.snapshots.v1.MountsResponse")
- proto.RegisterType((*RemoveSnapshotRequest)(nil), "containerd.services.snapshots.v1.RemoveSnapshotRequest")
- proto.RegisterType((*CommitSnapshotRequest)(nil), "containerd.services.snapshots.v1.CommitSnapshotRequest")
- proto.RegisterMapType((map[string]string)(nil), "containerd.services.snapshots.v1.CommitSnapshotRequest.LabelsEntry")
- proto.RegisterType((*StatSnapshotRequest)(nil), "containerd.services.snapshots.v1.StatSnapshotRequest")
- proto.RegisterType((*Info)(nil), "containerd.services.snapshots.v1.Info")
- proto.RegisterMapType((map[string]string)(nil), "containerd.services.snapshots.v1.Info.LabelsEntry")
- proto.RegisterType((*StatSnapshotResponse)(nil), "containerd.services.snapshots.v1.StatSnapshotResponse")
- proto.RegisterType((*UpdateSnapshotRequest)(nil), "containerd.services.snapshots.v1.UpdateSnapshotRequest")
- proto.RegisterType((*UpdateSnapshotResponse)(nil), "containerd.services.snapshots.v1.UpdateSnapshotResponse")
- proto.RegisterType((*ListSnapshotsRequest)(nil), "containerd.services.snapshots.v1.ListSnapshotsRequest")
- proto.RegisterType((*ListSnapshotsResponse)(nil), "containerd.services.snapshots.v1.ListSnapshotsResponse")
- proto.RegisterType((*UsageRequest)(nil), "containerd.services.snapshots.v1.UsageRequest")
- proto.RegisterType((*UsageResponse)(nil), "containerd.services.snapshots.v1.UsageResponse")
- proto.RegisterType((*CleanupRequest)(nil), "containerd.services.snapshots.v1.CleanupRequest")
-}
-
-func init() {
- proto.RegisterFile("github.com/containerd/containerd/api/services/snapshots/v1/snapshots.proto", fileDescriptor_cfc0ddf12791f168)
-}
-
-var fileDescriptor_cfc0ddf12791f168 = []byte{
- // 1047 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x4f, 0x6f, 0x1b, 0x45,
- 0x14, 0xf7, 0xda, 0x5b, 0x27, 0x79, 0x4e, 0x82, 0x99, 0x3a, 0xae, 0xb5, 0x20, 0x67, 0xe5, 0x03,
- 0x8a, 0x38, 0xec, 0xb6, 0x46, 0xb4, 0x69, 0x73, 0xc1, 0x71, 0x0c, 0x72, 0xd2, 0xa4, 0x68, 0xf3,
- 0xa7, 0x4d, 0x41, 0x54, 0x1b, 0x7b, 0xec, 0xac, 0xec, 0xfd, 0x83, 0x67, 0xec, 0xca, 0x20, 0x21,
- 0x8e, 0x55, 0x4e, 0x7c, 0x81, 0x9c, 0xe0, 0x43, 0x20, 0x3e, 0x41, 0x8e, 0x48, 0x5c, 0x38, 0x01,
- 0xcd, 0x97, 0xe0, 0x84, 0x40, 0x33, 0x3b, 0xeb, 0x7f, 0x71, 0xe5, 0xb5, 0x6b, 0x6e, 0x33, 0x3b,
- 0xf3, 0xde, 0xfb, 0xbd, 0xdf, 0x9b, 0xf7, 0x9b, 0x59, 0xd8, 0xad, 0x5b, 0xf4, 0xbc, 0x7d, 0xa6,
- 0x55, 0x5c, 0x5b, 0xaf, 0xb8, 0x0e, 0x35, 0x2d, 0x07, 0xb7, 0xaa, 0x83, 0x43, 0xd3, 0xb3, 0x74,
- 0x82, 0x5b, 0x1d, 0xab, 0x82, 0x89, 0x4e, 0x1c, 0xd3, 0x23, 0xe7, 0x2e, 0x25, 0x7a, 0xe7, 0x5e,
- 0x7f, 0xa2, 0x79, 0x2d, 0x97, 0xba, 0x48, 0xed, 0x5b, 0x69, 0x81, 0x85, 0xd6, 0xdf, 0xd4, 0xb9,
- 0xa7, 0xa4, 0xea, 0x6e, 0xdd, 0xe5, 0x9b, 0x75, 0x36, 0xf2, 0xed, 0x94, 0xf7, 0xea, 0xae, 0x5b,
- 0x6f, 0x62, 0x9d, 0xcf, 0xce, 0xda, 0x35, 0x1d, 0xdb, 0x1e, 0xed, 0x8a, 0x45, 0x75, 0x74, 0xb1,
- 0x66, 0xe1, 0x66, 0xf5, 0x85, 0x6d, 0x92, 0x86, 0xd8, 0xb1, 0x3e, 0xba, 0x83, 0x5a, 0x36, 0x26,
- 0xd4, 0xb4, 0x3d, 0xb1, 0xe1, 0x7e, 0xa8, 0x1c, 0x69, 0xd7, 0xc3, 0x44, 0xb7, 0xdd, 0xb6, 0x43,
- 0x7d, 0xbb, 0xdc, 0x3f, 0x12, 0xa4, 0x3f, 0x6f, 0x61, 0xcf, 0x6c, 0xe1, 0x43, 0x91, 0x85, 0x81,
- 0xbf, 0x6e, 0x63, 0x42, 0x91, 0x0a, 0x89, 0x20, 0x31, 0x8a, 0x5b, 0x19, 0x49, 0x95, 0x36, 0x96,
- 0x8c, 0xc1, 0x4f, 0x28, 0x09, 0xb1, 0x06, 0xee, 0x66, 0xa2, 0x7c, 0x85, 0x0d, 0x51, 0x1a, 0xe2,
- 0xcc, 0x95, 0x43, 0x33, 0x31, 0xfe, 0x51, 0xcc, 0xd0, 0x97, 0x10, 0x6f, 0x9a, 0x67, 0xb8, 0x49,
- 0x32, 0xb2, 0x1a, 0xdb, 0x48, 0xe4, 0x77, 0xb4, 0x49, 0x3c, 0x6a, 0xe3, 0x51, 0x69, 0x8f, 0xb9,
- 0x9b, 0x92, 0x43, 0x5b, 0x5d, 0x43, 0xf8, 0x54, 0x1e, 0x42, 0x62, 0xe0, 0x73, 0x00, 0x4b, 0xea,
- 0xc3, 0x4a, 0xc1, 0xad, 0x8e, 0xd9, 0x6c, 0x63, 0x01, 0xd5, 0x9f, 0x3c, 0x8a, 0x6e, 0x4a, 0xb9,
- 0x5d, 0xb8, 0x73, 0x23, 0x10, 0xf1, 0x5c, 0x87, 0x60, 0xa4, 0x43, 0x9c, 0x33, 0x45, 0x32, 0x12,
- 0xc7, 0x7c, 0x67, 0x10, 0x33, 0x67, 0x52, 0xdb, 0x67, 0xeb, 0x86, 0xd8, 0x96, 0xfb, 0x5b, 0x82,
- 0xdb, 0x27, 0x16, 0x7e, 0xf9, 0x7f, 0x12, 0x79, 0x3a, 0x42, 0x64, 0x61, 0x32, 0x91, 0x63, 0x20,
- 0xcd, 0x9b, 0xc5, 0xcf, 0x20, 0x35, 0x1c, 0x65, 0x56, 0x0a, 0x8b, 0xb0, 0xc2, 0x3f, 0x90, 0xb7,
- 0xe0, 0x2e, 0x57, 0x80, 0xd5, 0xc0, 0xc9, 0xac, 0x38, 0xf6, 0x60, 0xcd, 0xc0, 0xb6, 0xdb, 0x99,
- 0x47, 0x53, 0xb0, 0x73, 0xb1, 0x56, 0x74, 0x6d, 0xdb, 0xa2, 0xd3, 0x7b, 0x43, 0x20, 0x3b, 0xa6,
- 0x1d, 0x50, 0xce, 0xc7, 0x41, 0x84, 0x58, 0xbf, 0x32, 0x5f, 0x8c, 0x9c, 0x8a, 0xe2, 0xe4, 0x53,
- 0x31, 0x16, 0xd0, 0xbc, 0xcf, 0x45, 0x19, 0x6e, 0x1f, 0x52, 0x93, 0xce, 0x83, 0xc4, 0x7f, 0xa3,
- 0x20, 0x97, 0x9d, 0x9a, 0xdb, 0x63, 0x44, 0x1a, 0x60, 0xa4, 0xdf, 0x2d, 0xd1, 0xa1, 0x6e, 0x79,
- 0x04, 0x72, 0xc3, 0x72, 0xaa, 0x9c, 0xaa, 0xd5, 0xfc, 0x07, 0x93, 0x59, 0xd9, 0xb3, 0x9c, 0xaa,
- 0xc1, 0x6d, 0x50, 0x11, 0xa0, 0xd2, 0xc2, 0x26, 0xc5, 0xd5, 0x17, 0x26, 0xcd, 0xc8, 0xaa, 0xb4,
- 0x91, 0xc8, 0x2b, 0x9a, 0xaf, 0xc3, 0x5a, 0xa0, 0xc3, 0xda, 0x51, 0xa0, 0xc3, 0xdb, 0x8b, 0x57,
- 0x7f, 0xac, 0x47, 0x7e, 0xf8, 0x73, 0x5d, 0x32, 0x96, 0x84, 0x5d, 0x81, 0x32, 0x27, 0x6d, 0xaf,
- 0x1a, 0x38, 0xb9, 0x35, 0x8d, 0x13, 0x61, 0x57, 0xa0, 0x68, 0xb7, 0x57, 0xdd, 0x38, 0xaf, 0x6e,
- 0x7e, 0x72, 0x1e, 0x8c, 0xa9, 0x79, 0x17, 0xf3, 0x19, 0xa4, 0x86, 0x8b, 0x29, 0x9a, 0xeb, 0x13,
- 0x90, 0x2d, 0xa7, 0xe6, 0x72, 0x27, 0x89, 0x30, 0x24, 0x33, 0x70, 0xdb, 0x32, 0xcb, 0xd4, 0xe0,
- 0x96, 0xb9, 0x9f, 0x25, 0x58, 0x3b, 0xe6, 0xe9, 0x4e, 0x7f, 0x52, 0x82, 0xe8, 0xd1, 0x59, 0xa3,
- 0xa3, 0x2d, 0x48, 0xf8, 0x5c, 0xf3, 0x0b, 0x97, 0x9f, 0x95, 0x71, 0x45, 0xfa, 0x94, 0xdd, 0xc9,
- 0xfb, 0x26, 0x69, 0x18, 0xa2, 0xa4, 0x6c, 0x9c, 0x7b, 0x0e, 0xe9, 0x51, 0xe4, 0x73, 0xa3, 0xc5,
- 0x80, 0xd4, 0x63, 0x8b, 0xf4, 0x08, 0x9f, 0x42, 0x13, 0x33, 0xb0, 0x50, 0xb3, 0x9a, 0x14, 0xb7,
- 0x48, 0x26, 0xaa, 0xc6, 0x36, 0x96, 0x8c, 0x60, 0x9a, 0x3b, 0x85, 0xb5, 0x11, 0x9f, 0x37, 0xe0,
- 0xc6, 0x66, 0x84, 0xbb, 0x0d, 0xcb, 0xc7, 0xc4, 0xac, 0xe3, 0xb7, 0xe9, 0xf2, 0x2d, 0x58, 0x11,
- 0x3e, 0x04, 0x2c, 0x04, 0x32, 0xb1, 0xbe, 0xf1, 0xbb, 0x3d, 0x66, 0xf0, 0x31, 0xeb, 0x76, 0xcb,
- 0x71, 0xab, 0x98, 0x70, 0xcb, 0x98, 0x21, 0x66, 0xb9, 0x3c, 0xac, 0x16, 0x9b, 0xd8, 0x74, 0xda,
- 0x5e, 0x68, 0x08, 0x1f, 0xbe, 0x92, 0x40, 0x66, 0x4d, 0x8f, 0xde, 0x87, 0x85, 0xe3, 0x83, 0xbd,
- 0x83, 0x27, 0x4f, 0x0f, 0x92, 0x11, 0xe5, 0x9d, 0x8b, 0x4b, 0x35, 0xc1, 0x3e, 0x1f, 0x3b, 0x0d,
- 0xc7, 0x7d, 0xe9, 0xa0, 0x34, 0xc8, 0x27, 0xe5, 0xd2, 0xd3, 0xa4, 0xa4, 0x2c, 0x5f, 0x5c, 0xaa,
- 0x8b, 0x6c, 0x89, 0x5d, 0x78, 0x48, 0x81, 0x78, 0xa1, 0x78, 0x54, 0x3e, 0x29, 0x25, 0xa3, 0xca,
- 0xea, 0xc5, 0xa5, 0x0a, 0x6c, 0xa5, 0x50, 0xa1, 0x56, 0x07, 0x23, 0x15, 0x96, 0x8a, 0x4f, 0xf6,
- 0xf7, 0xcb, 0x47, 0x47, 0xa5, 0x9d, 0x64, 0x4c, 0x79, 0xf7, 0xe2, 0x52, 0x5d, 0x61, 0xcb, 0xbe,
- 0xf2, 0x52, 0x5c, 0x55, 0x96, 0x5f, 0xfd, 0x98, 0x8d, 0xfc, 0xf2, 0x53, 0x96, 0x23, 0xc8, 0xff,
- 0xb6, 0x08, 0x4b, 0xbd, 0xba, 0xa0, 0xef, 0x60, 0x41, 0x3c, 0x4c, 0xd0, 0xe6, 0xac, 0x8f, 0x25,
- 0xe5, 0xe1, 0x0c, 0x96, 0x82, 0xf8, 0x36, 0xc8, 0x3c, 0xc3, 0x8f, 0x67, 0x7a, 0x60, 0x28, 0xf7,
- 0xa7, 0x35, 0x13, 0x61, 0x1b, 0x10, 0xf7, 0xef, 0x6e, 0xa4, 0x4f, 0xf6, 0x30, 0xf4, 0x54, 0x50,
- 0xee, 0x86, 0x37, 0x10, 0xc1, 0x4e, 0x21, 0xee, 0x17, 0x03, 0x3d, 0x98, 0xf1, 0xc2, 0x54, 0xd2,
- 0x37, 0x74, 0xa2, 0xc4, 0x1e, 0xf6, 0xcc, 0xb5, 0xff, 0x80, 0x08, 0xe3, 0x7a, 0xec, 0x53, 0xe3,
- 0x8d, 0xae, 0xdb, 0x20, 0x33, 0x1d, 0x0e, 0x53, 0x99, 0x31, 0x97, 0x6f, 0x98, 0xca, 0x8c, 0x95,
- 0xf9, 0x6f, 0x21, 0xee, 0x2b, 0x5d, 0x98, 0x8c, 0xc6, 0xaa, 0xb9, 0xb2, 0x39, 0xbd, 0xa1, 0x08,
- 0xde, 0x05, 0x99, 0xc9, 0x16, 0x0a, 0x01, 0x7e, 0x9c, 0x64, 0x2a, 0x0f, 0xa6, 0xb6, 0xf3, 0x03,
- 0xdf, 0x95, 0xd0, 0x39, 0xdc, 0xe2, 0x92, 0x84, 0xb4, 0x10, 0xe8, 0x07, 0xf4, 0x4f, 0xd1, 0x43,
- 0xef, 0x17, 0x49, 0x1e, 0xc2, 0x82, 0xd0, 0x2f, 0x14, 0xe2, 0x2c, 0x0f, 0x4b, 0xdd, 0x9b, 0x4e,
- 0xcb, 0xf6, 0x57, 0x57, 0xaf, 0xb3, 0x91, 0xdf, 0x5f, 0x67, 0x23, 0xdf, 0x5f, 0x67, 0xa5, 0xab,
- 0xeb, 0xac, 0xf4, 0xeb, 0x75, 0x56, 0xfa, 0xeb, 0x3a, 0x2b, 0x3d, 0xdf, 0x99, 0xfd, 0xb7, 0x78,
- 0xab, 0x37, 0x79, 0x16, 0x39, 0x8b, 0xf3, 0x88, 0x1f, 0xfd, 0x17, 0x00, 0x00, 0xff, 0xff, 0x20,
- 0x9c, 0x85, 0x7f, 0x67, 0x0f, 0x00, 0x00,
-}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ context.Context
-var _ grpc.ClientConn
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion4
-
-// SnapshotsClient is the client API for Snapshots service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type SnapshotsClient interface {
- Prepare(ctx context.Context, in *PrepareSnapshotRequest, opts ...grpc.CallOption) (*PrepareSnapshotResponse, error)
- View(ctx context.Context, in *ViewSnapshotRequest, opts ...grpc.CallOption) (*ViewSnapshotResponse, error)
- Mounts(ctx context.Context, in *MountsRequest, opts ...grpc.CallOption) (*MountsResponse, error)
- Commit(ctx context.Context, in *CommitSnapshotRequest, opts ...grpc.CallOption) (*types1.Empty, error)
- Remove(ctx context.Context, in *RemoveSnapshotRequest, opts ...grpc.CallOption) (*types1.Empty, error)
- Stat(ctx context.Context, in *StatSnapshotRequest, opts ...grpc.CallOption) (*StatSnapshotResponse, error)
- Update(ctx context.Context, in *UpdateSnapshotRequest, opts ...grpc.CallOption) (*UpdateSnapshotResponse, error)
- List(ctx context.Context, in *ListSnapshotsRequest, opts ...grpc.CallOption) (Snapshots_ListClient, error)
- Usage(ctx context.Context, in *UsageRequest, opts ...grpc.CallOption) (*UsageResponse, error)
- Cleanup(ctx context.Context, in *CleanupRequest, opts ...grpc.CallOption) (*types1.Empty, error)
-}
-
-type snapshotsClient struct {
- cc *grpc.ClientConn
-}
-
-func NewSnapshotsClient(cc *grpc.ClientConn) SnapshotsClient {
- return &snapshotsClient{cc}
-}
-
-func (c *snapshotsClient) Prepare(ctx context.Context, in *PrepareSnapshotRequest, opts ...grpc.CallOption) (*PrepareSnapshotResponse, error) {
- out := new(PrepareSnapshotResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Prepare", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *snapshotsClient) View(ctx context.Context, in *ViewSnapshotRequest, opts ...grpc.CallOption) (*ViewSnapshotResponse, error) {
- out := new(ViewSnapshotResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/View", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *snapshotsClient) Mounts(ctx context.Context, in *MountsRequest, opts ...grpc.CallOption) (*MountsResponse, error) {
- out := new(MountsResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Mounts", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *snapshotsClient) Commit(ctx context.Context, in *CommitSnapshotRequest, opts ...grpc.CallOption) (*types1.Empty, error) {
- out := new(types1.Empty)
- err := c.cc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Commit", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *snapshotsClient) Remove(ctx context.Context, in *RemoveSnapshotRequest, opts ...grpc.CallOption) (*types1.Empty, error) {
- out := new(types1.Empty)
- err := c.cc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Remove", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *snapshotsClient) Stat(ctx context.Context, in *StatSnapshotRequest, opts ...grpc.CallOption) (*StatSnapshotResponse, error) {
- out := new(StatSnapshotResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Stat", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *snapshotsClient) Update(ctx context.Context, in *UpdateSnapshotRequest, opts ...grpc.CallOption) (*UpdateSnapshotResponse, error) {
- out := new(UpdateSnapshotResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Update", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *snapshotsClient) List(ctx context.Context, in *ListSnapshotsRequest, opts ...grpc.CallOption) (Snapshots_ListClient, error) {
- stream, err := c.cc.NewStream(ctx, &_Snapshots_serviceDesc.Streams[0], "/containerd.services.snapshots.v1.Snapshots/List", opts...)
- if err != nil {
- return nil, err
- }
- x := &snapshotsListClient{stream}
- if err := x.ClientStream.SendMsg(in); err != nil {
- return nil, err
- }
- if err := x.ClientStream.CloseSend(); err != nil {
- return nil, err
- }
- return x, nil
-}
-
-type Snapshots_ListClient interface {
- Recv() (*ListSnapshotsResponse, error)
- grpc.ClientStream
-}
-
-type snapshotsListClient struct {
- grpc.ClientStream
-}
-
-func (x *snapshotsListClient) Recv() (*ListSnapshotsResponse, error) {
- m := new(ListSnapshotsResponse)
- if err := x.ClientStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
-}
-
-func (c *snapshotsClient) Usage(ctx context.Context, in *UsageRequest, opts ...grpc.CallOption) (*UsageResponse, error) {
- out := new(UsageResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Usage", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *snapshotsClient) Cleanup(ctx context.Context, in *CleanupRequest, opts ...grpc.CallOption) (*types1.Empty, error) {
- out := new(types1.Empty)
- err := c.cc.Invoke(ctx, "/containerd.services.snapshots.v1.Snapshots/Cleanup", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// SnapshotsServer is the server API for Snapshots service.
-type SnapshotsServer interface {
- Prepare(context.Context, *PrepareSnapshotRequest) (*PrepareSnapshotResponse, error)
- View(context.Context, *ViewSnapshotRequest) (*ViewSnapshotResponse, error)
- Mounts(context.Context, *MountsRequest) (*MountsResponse, error)
- Commit(context.Context, *CommitSnapshotRequest) (*types1.Empty, error)
- Remove(context.Context, *RemoveSnapshotRequest) (*types1.Empty, error)
- Stat(context.Context, *StatSnapshotRequest) (*StatSnapshotResponse, error)
- Update(context.Context, *UpdateSnapshotRequest) (*UpdateSnapshotResponse, error)
- List(*ListSnapshotsRequest, Snapshots_ListServer) error
- Usage(context.Context, *UsageRequest) (*UsageResponse, error)
- Cleanup(context.Context, *CleanupRequest) (*types1.Empty, error)
-}
-
-// UnimplementedSnapshotsServer can be embedded to have forward compatible implementations.
-type UnimplementedSnapshotsServer struct {
-}
-
-func (*UnimplementedSnapshotsServer) Prepare(ctx context.Context, req *PrepareSnapshotRequest) (*PrepareSnapshotResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Prepare not implemented")
-}
-func (*UnimplementedSnapshotsServer) View(ctx context.Context, req *ViewSnapshotRequest) (*ViewSnapshotResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method View not implemented")
-}
-func (*UnimplementedSnapshotsServer) Mounts(ctx context.Context, req *MountsRequest) (*MountsResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Mounts not implemented")
-}
-func (*UnimplementedSnapshotsServer) Commit(ctx context.Context, req *CommitSnapshotRequest) (*types1.Empty, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Commit not implemented")
-}
-func (*UnimplementedSnapshotsServer) Remove(ctx context.Context, req *RemoveSnapshotRequest) (*types1.Empty, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Remove not implemented")
-}
-func (*UnimplementedSnapshotsServer) Stat(ctx context.Context, req *StatSnapshotRequest) (*StatSnapshotResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Stat not implemented")
-}
-func (*UnimplementedSnapshotsServer) Update(ctx context.Context, req *UpdateSnapshotRequest) (*UpdateSnapshotResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
-}
-func (*UnimplementedSnapshotsServer) List(req *ListSnapshotsRequest, srv Snapshots_ListServer) error {
- return status.Errorf(codes.Unimplemented, "method List not implemented")
-}
-func (*UnimplementedSnapshotsServer) Usage(ctx context.Context, req *UsageRequest) (*UsageResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Usage not implemented")
-}
-func (*UnimplementedSnapshotsServer) Cleanup(ctx context.Context, req *CleanupRequest) (*types1.Empty, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Cleanup not implemented")
-}
-
-func RegisterSnapshotsServer(s *grpc.Server, srv SnapshotsServer) {
- s.RegisterService(&_Snapshots_serviceDesc, srv)
-}
-
-func _Snapshots_Prepare_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(PrepareSnapshotRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(SnapshotsServer).Prepare(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.snapshots.v1.Snapshots/Prepare",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(SnapshotsServer).Prepare(ctx, req.(*PrepareSnapshotRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Snapshots_View_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(ViewSnapshotRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(SnapshotsServer).View(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.snapshots.v1.Snapshots/View",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(SnapshotsServer).View(ctx, req.(*ViewSnapshotRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Snapshots_Mounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(MountsRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(SnapshotsServer).Mounts(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.snapshots.v1.Snapshots/Mounts",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(SnapshotsServer).Mounts(ctx, req.(*MountsRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Snapshots_Commit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(CommitSnapshotRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(SnapshotsServer).Commit(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.snapshots.v1.Snapshots/Commit",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(SnapshotsServer).Commit(ctx, req.(*CommitSnapshotRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Snapshots_Remove_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(RemoveSnapshotRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(SnapshotsServer).Remove(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.snapshots.v1.Snapshots/Remove",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(SnapshotsServer).Remove(ctx, req.(*RemoveSnapshotRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Snapshots_Stat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(StatSnapshotRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(SnapshotsServer).Stat(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.snapshots.v1.Snapshots/Stat",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(SnapshotsServer).Stat(ctx, req.(*StatSnapshotRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Snapshots_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(UpdateSnapshotRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(SnapshotsServer).Update(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.snapshots.v1.Snapshots/Update",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(SnapshotsServer).Update(ctx, req.(*UpdateSnapshotRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Snapshots_List_Handler(srv interface{}, stream grpc.ServerStream) error {
- m := new(ListSnapshotsRequest)
- if err := stream.RecvMsg(m); err != nil {
- return err
- }
- return srv.(SnapshotsServer).List(m, &snapshotsListServer{stream})
-}
-
-type Snapshots_ListServer interface {
- Send(*ListSnapshotsResponse) error
- grpc.ServerStream
-}
-
-type snapshotsListServer struct {
- grpc.ServerStream
-}
-
-func (x *snapshotsListServer) Send(m *ListSnapshotsResponse) error {
- return x.ServerStream.SendMsg(m)
-}
-
-func _Snapshots_Usage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(UsageRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(SnapshotsServer).Usage(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.snapshots.v1.Snapshots/Usage",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(SnapshotsServer).Usage(ctx, req.(*UsageRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Snapshots_Cleanup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(CleanupRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(SnapshotsServer).Cleanup(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.snapshots.v1.Snapshots/Cleanup",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(SnapshotsServer).Cleanup(ctx, req.(*CleanupRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-var _Snapshots_serviceDesc = grpc.ServiceDesc{
- ServiceName: "containerd.services.snapshots.v1.Snapshots",
- HandlerType: (*SnapshotsServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "Prepare",
- Handler: _Snapshots_Prepare_Handler,
- },
- {
- MethodName: "View",
- Handler: _Snapshots_View_Handler,
- },
- {
- MethodName: "Mounts",
- Handler: _Snapshots_Mounts_Handler,
- },
- {
- MethodName: "Commit",
- Handler: _Snapshots_Commit_Handler,
- },
- {
- MethodName: "Remove",
- Handler: _Snapshots_Remove_Handler,
- },
- {
- MethodName: "Stat",
- Handler: _Snapshots_Stat_Handler,
- },
- {
- MethodName: "Update",
- Handler: _Snapshots_Update_Handler,
- },
- {
- MethodName: "Usage",
- Handler: _Snapshots_Usage_Handler,
- },
- {
- MethodName: "Cleanup",
- Handler: _Snapshots_Cleanup_Handler,
- },
- },
- Streams: []grpc.StreamDesc{
- {
- StreamName: "List",
- Handler: _Snapshots_List_Handler,
- ServerStreams: true,
- },
- },
- Metadata: "github.com/containerd/containerd/api/services/snapshots/v1/snapshots.proto",
-}
-
-func (m *PrepareSnapshotRequest) 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 *PrepareSnapshotRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *PrepareSnapshotRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Labels) > 0 {
- for k := range m.Labels {
- v := m.Labels[k]
- baseI := i
- i -= len(v)
- copy(dAtA[i:], v)
- i = encodeVarintSnapshots(dAtA, i, uint64(len(v)))
- i--
- dAtA[i] = 0x12
- i -= len(k)
- copy(dAtA[i:], k)
- i = encodeVarintSnapshots(dAtA, i, uint64(len(k)))
- i--
- dAtA[i] = 0xa
- i = encodeVarintSnapshots(dAtA, i, uint64(baseI-i))
- i--
- dAtA[i] = 0x22
- }
- }
- if len(m.Parent) > 0 {
- i -= len(m.Parent)
- copy(dAtA[i:], m.Parent)
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Parent)))
- i--
- dAtA[i] = 0x1a
- }
- if len(m.Key) > 0 {
- i -= len(m.Key)
- copy(dAtA[i:], m.Key)
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.Snapshotter) > 0 {
- i -= len(m.Snapshotter)
- copy(dAtA[i:], m.Snapshotter)
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *PrepareSnapshotResponse) 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 *PrepareSnapshotResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *PrepareSnapshotResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- 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 = encodeVarintSnapshots(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- }
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ViewSnapshotRequest) 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 *ViewSnapshotRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ViewSnapshotRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Labels) > 0 {
- for k := range m.Labels {
- v := m.Labels[k]
- baseI := i
- i -= len(v)
- copy(dAtA[i:], v)
- i = encodeVarintSnapshots(dAtA, i, uint64(len(v)))
- i--
- dAtA[i] = 0x12
- i -= len(k)
- copy(dAtA[i:], k)
- i = encodeVarintSnapshots(dAtA, i, uint64(len(k)))
- i--
- dAtA[i] = 0xa
- i = encodeVarintSnapshots(dAtA, i, uint64(baseI-i))
- i--
- dAtA[i] = 0x22
- }
- }
- if len(m.Parent) > 0 {
- i -= len(m.Parent)
- copy(dAtA[i:], m.Parent)
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Parent)))
- i--
- dAtA[i] = 0x1a
- }
- if len(m.Key) > 0 {
- i -= len(m.Key)
- copy(dAtA[i:], m.Key)
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.Snapshotter) > 0 {
- i -= len(m.Snapshotter)
- copy(dAtA[i:], m.Snapshotter)
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ViewSnapshotResponse) 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 *ViewSnapshotResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ViewSnapshotResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- 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 = encodeVarintSnapshots(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- }
- }
- return len(dAtA) - i, nil
-}
-
-func (m *MountsRequest) 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 *MountsRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *MountsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Key) > 0 {
- i -= len(m.Key)
- copy(dAtA[i:], m.Key)
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.Snapshotter) > 0 {
- i -= len(m.Snapshotter)
- copy(dAtA[i:], m.Snapshotter)
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *MountsResponse) 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 *MountsResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *MountsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- 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 = encodeVarintSnapshots(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- }
- }
- return len(dAtA) - i, nil
-}
-
-func (m *RemoveSnapshotRequest) 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 *RemoveSnapshotRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *RemoveSnapshotRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Key) > 0 {
- i -= len(m.Key)
- copy(dAtA[i:], m.Key)
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.Snapshotter) > 0 {
- i -= len(m.Snapshotter)
- copy(dAtA[i:], m.Snapshotter)
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *CommitSnapshotRequest) 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 *CommitSnapshotRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *CommitSnapshotRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Labels) > 0 {
- for k := range m.Labels {
- v := m.Labels[k]
- baseI := i
- i -= len(v)
- copy(dAtA[i:], v)
- i = encodeVarintSnapshots(dAtA, i, uint64(len(v)))
- i--
- dAtA[i] = 0x12
- i -= len(k)
- copy(dAtA[i:], k)
- i = encodeVarintSnapshots(dAtA, i, uint64(len(k)))
- i--
- dAtA[i] = 0xa
- i = encodeVarintSnapshots(dAtA, i, uint64(baseI-i))
- i--
- dAtA[i] = 0x22
- }
- }
- if len(m.Key) > 0 {
- i -= len(m.Key)
- copy(dAtA[i:], m.Key)
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key)))
- i--
- dAtA[i] = 0x1a
- }
- if len(m.Name) > 0 {
- i -= len(m.Name)
- copy(dAtA[i:], m.Name)
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Name)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.Snapshotter) > 0 {
- i -= len(m.Snapshotter)
- copy(dAtA[i:], m.Snapshotter)
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *StatSnapshotRequest) 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 *StatSnapshotRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *StatSnapshotRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Key) > 0 {
- i -= len(m.Key)
- copy(dAtA[i:], m.Key)
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.Snapshotter) > 0 {
- i -= len(m.Snapshotter)
- copy(dAtA[i:], m.Snapshotter)
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *Info) 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 *Info) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *Info) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Labels) > 0 {
- for k := range m.Labels {
- v := m.Labels[k]
- baseI := i
- i -= len(v)
- copy(dAtA[i:], v)
- i = encodeVarintSnapshots(dAtA, i, uint64(len(v)))
- i--
- dAtA[i] = 0x12
- i -= len(k)
- copy(dAtA[i:], k)
- i = encodeVarintSnapshots(dAtA, i, uint64(len(k)))
- i--
- dAtA[i] = 0xa
- i = encodeVarintSnapshots(dAtA, i, uint64(baseI-i))
- i--
- dAtA[i] = 0x32
- }
- }
- n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.UpdatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.UpdatedAt):])
- if err1 != nil {
- return 0, err1
- }
- i -= n1
- i = encodeVarintSnapshots(dAtA, i, uint64(n1))
- i--
- dAtA[i] = 0x2a
- n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt):])
- if err2 != nil {
- return 0, err2
- }
- i -= n2
- i = encodeVarintSnapshots(dAtA, i, uint64(n2))
- i--
- dAtA[i] = 0x22
- if m.Kind != 0 {
- i = encodeVarintSnapshots(dAtA, i, uint64(m.Kind))
- i--
- dAtA[i] = 0x18
- }
- if len(m.Parent) > 0 {
- i -= len(m.Parent)
- copy(dAtA[i:], m.Parent)
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Parent)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.Name) > 0 {
- i -= len(m.Name)
- copy(dAtA[i:], m.Name)
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Name)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *StatSnapshotResponse) 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 *StatSnapshotResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *StatSnapshotResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- {
- size, err := m.Info.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintSnapshots(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func (m *UpdateSnapshotRequest) 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 *UpdateSnapshotRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *UpdateSnapshotRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.UpdateMask != nil {
- {
- size, err := m.UpdateMask.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintSnapshots(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x1a
- }
- {
- size, err := m.Info.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintSnapshots(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x12
- if len(m.Snapshotter) > 0 {
- i -= len(m.Snapshotter)
- copy(dAtA[i:], m.Snapshotter)
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *UpdateSnapshotResponse) 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 *UpdateSnapshotResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *UpdateSnapshotResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- {
- size, err := m.Info.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintSnapshots(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func (m *ListSnapshotsRequest) 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 *ListSnapshotsRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ListSnapshotsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Filters) > 0 {
- for iNdEx := len(m.Filters) - 1; iNdEx >= 0; iNdEx-- {
- i -= len(m.Filters[iNdEx])
- copy(dAtA[i:], m.Filters[iNdEx])
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Filters[iNdEx])))
- i--
- dAtA[i] = 0x12
- }
- }
- if len(m.Snapshotter) > 0 {
- i -= len(m.Snapshotter)
- copy(dAtA[i:], m.Snapshotter)
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ListSnapshotsResponse) 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 *ListSnapshotsResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ListSnapshotsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Info) > 0 {
- for iNdEx := len(m.Info) - 1; iNdEx >= 0; iNdEx-- {
- {
- size, err := m.Info[iNdEx].MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintSnapshots(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- }
- }
- return len(dAtA) - i, nil
-}
-
-func (m *UsageRequest) 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 *UsageRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *UsageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Key) > 0 {
- i -= len(m.Key)
- copy(dAtA[i:], m.Key)
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.Snapshotter) > 0 {
- i -= len(m.Snapshotter)
- copy(dAtA[i:], m.Snapshotter)
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *UsageResponse) 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 *UsageResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *UsageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Inodes != 0 {
- i = encodeVarintSnapshots(dAtA, i, uint64(m.Inodes))
- i--
- dAtA[i] = 0x10
- }
- if m.Size_ != 0 {
- i = encodeVarintSnapshots(dAtA, i, uint64(m.Size_))
- i--
- dAtA[i] = 0x8
- }
- return len(dAtA) - i, nil
-}
-
-func (m *CleanupRequest) 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 *CleanupRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *CleanupRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Snapshotter) > 0 {
- i -= len(m.Snapshotter)
- copy(dAtA[i:], m.Snapshotter)
- i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func encodeVarintSnapshots(dAtA []byte, offset int, v uint64) int {
- offset -= sovSnapshots(v)
- base := offset
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return base
-}
-func (m *PrepareSnapshotRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Snapshotter)
- if l > 0 {
- n += 1 + l + sovSnapshots(uint64(l))
- }
- l = len(m.Key)
- if l > 0 {
- n += 1 + l + sovSnapshots(uint64(l))
- }
- l = len(m.Parent)
- if l > 0 {
- n += 1 + l + sovSnapshots(uint64(l))
- }
- if len(m.Labels) > 0 {
- for k, v := range m.Labels {
- _ = k
- _ = v
- mapEntrySize := 1 + len(k) + sovSnapshots(uint64(len(k))) + 1 + len(v) + sovSnapshots(uint64(len(v)))
- n += mapEntrySize + 1 + sovSnapshots(uint64(mapEntrySize))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *PrepareSnapshotResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.Mounts) > 0 {
- for _, e := range m.Mounts {
- l = e.Size()
- n += 1 + l + sovSnapshots(uint64(l))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ViewSnapshotRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Snapshotter)
- if l > 0 {
- n += 1 + l + sovSnapshots(uint64(l))
- }
- l = len(m.Key)
- if l > 0 {
- n += 1 + l + sovSnapshots(uint64(l))
- }
- l = len(m.Parent)
- if l > 0 {
- n += 1 + l + sovSnapshots(uint64(l))
- }
- if len(m.Labels) > 0 {
- for k, v := range m.Labels {
- _ = k
- _ = v
- mapEntrySize := 1 + len(k) + sovSnapshots(uint64(len(k))) + 1 + len(v) + sovSnapshots(uint64(len(v)))
- n += mapEntrySize + 1 + sovSnapshots(uint64(mapEntrySize))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ViewSnapshotResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.Mounts) > 0 {
- for _, e := range m.Mounts {
- l = e.Size()
- n += 1 + l + sovSnapshots(uint64(l))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *MountsRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Snapshotter)
- if l > 0 {
- n += 1 + l + sovSnapshots(uint64(l))
- }
- l = len(m.Key)
- if l > 0 {
- n += 1 + l + sovSnapshots(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *MountsResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.Mounts) > 0 {
- for _, e := range m.Mounts {
- l = e.Size()
- n += 1 + l + sovSnapshots(uint64(l))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *RemoveSnapshotRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Snapshotter)
- if l > 0 {
- n += 1 + l + sovSnapshots(uint64(l))
- }
- l = len(m.Key)
- if l > 0 {
- n += 1 + l + sovSnapshots(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *CommitSnapshotRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Snapshotter)
- if l > 0 {
- n += 1 + l + sovSnapshots(uint64(l))
- }
- l = len(m.Name)
- if l > 0 {
- n += 1 + l + sovSnapshots(uint64(l))
- }
- l = len(m.Key)
- if l > 0 {
- n += 1 + l + sovSnapshots(uint64(l))
- }
- if len(m.Labels) > 0 {
- for k, v := range m.Labels {
- _ = k
- _ = v
- mapEntrySize := 1 + len(k) + sovSnapshots(uint64(len(k))) + 1 + len(v) + sovSnapshots(uint64(len(v)))
- n += mapEntrySize + 1 + sovSnapshots(uint64(mapEntrySize))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *StatSnapshotRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Snapshotter)
- if l > 0 {
- n += 1 + l + sovSnapshots(uint64(l))
- }
- l = len(m.Key)
- if l > 0 {
- n += 1 + l + sovSnapshots(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *Info) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Name)
- if l > 0 {
- n += 1 + l + sovSnapshots(uint64(l))
- }
- l = len(m.Parent)
- if l > 0 {
- n += 1 + l + sovSnapshots(uint64(l))
- }
- if m.Kind != 0 {
- n += 1 + sovSnapshots(uint64(m.Kind))
- }
- l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt)
- n += 1 + l + sovSnapshots(uint64(l))
- l = github_com_gogo_protobuf_types.SizeOfStdTime(m.UpdatedAt)
- n += 1 + l + sovSnapshots(uint64(l))
- if len(m.Labels) > 0 {
- for k, v := range m.Labels {
- _ = k
- _ = v
- mapEntrySize := 1 + len(k) + sovSnapshots(uint64(len(k))) + 1 + len(v) + sovSnapshots(uint64(len(v)))
- n += mapEntrySize + 1 + sovSnapshots(uint64(mapEntrySize))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *StatSnapshotResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = m.Info.Size()
- n += 1 + l + sovSnapshots(uint64(l))
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *UpdateSnapshotRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Snapshotter)
- if l > 0 {
- n += 1 + l + sovSnapshots(uint64(l))
- }
- l = m.Info.Size()
- n += 1 + l + sovSnapshots(uint64(l))
- if m.UpdateMask != nil {
- l = m.UpdateMask.Size()
- n += 1 + l + sovSnapshots(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *UpdateSnapshotResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = m.Info.Size()
- n += 1 + l + sovSnapshots(uint64(l))
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ListSnapshotsRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Snapshotter)
- if l > 0 {
- n += 1 + l + sovSnapshots(uint64(l))
- }
- if len(m.Filters) > 0 {
- for _, s := range m.Filters {
- l = len(s)
- n += 1 + l + sovSnapshots(uint64(l))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ListSnapshotsResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.Info) > 0 {
- for _, e := range m.Info {
- l = e.Size()
- n += 1 + l + sovSnapshots(uint64(l))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *UsageRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Snapshotter)
- if l > 0 {
- n += 1 + l + sovSnapshots(uint64(l))
- }
- l = len(m.Key)
- if l > 0 {
- n += 1 + l + sovSnapshots(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *UsageResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Size_ != 0 {
- n += 1 + sovSnapshots(uint64(m.Size_))
- }
- if m.Inodes != 0 {
- n += 1 + sovSnapshots(uint64(m.Inodes))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *CleanupRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Snapshotter)
- if l > 0 {
- n += 1 + l + sovSnapshots(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func sovSnapshots(x uint64) (n int) {
- return (math_bits.Len64(x|1) + 6) / 7
-}
-func sozSnapshots(x uint64) (n int) {
- return sovSnapshots(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-func (this *PrepareSnapshotRequest) 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 += "}"
- s := strings.Join([]string{`&PrepareSnapshotRequest{`,
- `Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`,
- `Key:` + fmt.Sprintf("%v", this.Key) + `,`,
- `Parent:` + fmt.Sprintf("%v", this.Parent) + `,`,
- `Labels:` + mapStringForLabels + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *PrepareSnapshotResponse) String() string {
- if this == nil {
- return "nil"
- }
- repeatedStringForMounts := "[]*Mount{"
- for _, f := range this.Mounts {
- repeatedStringForMounts += strings.Replace(fmt.Sprintf("%v", f), "Mount", "types.Mount", 1) + ","
- }
- repeatedStringForMounts += "}"
- s := strings.Join([]string{`&PrepareSnapshotResponse{`,
- `Mounts:` + repeatedStringForMounts + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ViewSnapshotRequest) 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 += "}"
- s := strings.Join([]string{`&ViewSnapshotRequest{`,
- `Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`,
- `Key:` + fmt.Sprintf("%v", this.Key) + `,`,
- `Parent:` + fmt.Sprintf("%v", this.Parent) + `,`,
- `Labels:` + mapStringForLabels + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ViewSnapshotResponse) String() string {
- if this == nil {
- return "nil"
- }
- repeatedStringForMounts := "[]*Mount{"
- for _, f := range this.Mounts {
- repeatedStringForMounts += strings.Replace(fmt.Sprintf("%v", f), "Mount", "types.Mount", 1) + ","
- }
- repeatedStringForMounts += "}"
- s := strings.Join([]string{`&ViewSnapshotResponse{`,
- `Mounts:` + repeatedStringForMounts + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *MountsRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&MountsRequest{`,
- `Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`,
- `Key:` + fmt.Sprintf("%v", this.Key) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *MountsResponse) String() string {
- if this == nil {
- return "nil"
- }
- repeatedStringForMounts := "[]*Mount{"
- for _, f := range this.Mounts {
- repeatedStringForMounts += strings.Replace(fmt.Sprintf("%v", f), "Mount", "types.Mount", 1) + ","
- }
- repeatedStringForMounts += "}"
- s := strings.Join([]string{`&MountsResponse{`,
- `Mounts:` + repeatedStringForMounts + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *RemoveSnapshotRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&RemoveSnapshotRequest{`,
- `Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`,
- `Key:` + fmt.Sprintf("%v", this.Key) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *CommitSnapshotRequest) 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 += "}"
- s := strings.Join([]string{`&CommitSnapshotRequest{`,
- `Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`,
- `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
- `Key:` + fmt.Sprintf("%v", this.Key) + `,`,
- `Labels:` + mapStringForLabels + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *StatSnapshotRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&StatSnapshotRequest{`,
- `Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`,
- `Key:` + fmt.Sprintf("%v", this.Key) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *Info) 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 += "}"
- s := strings.Join([]string{`&Info{`,
- `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
- `Parent:` + fmt.Sprintf("%v", this.Parent) + `,`,
- `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`,
- `CreatedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.CreatedAt), "Timestamp", "types1.Timestamp", 1), `&`, ``, 1) + `,`,
- `UpdatedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.UpdatedAt), "Timestamp", "types1.Timestamp", 1), `&`, ``, 1) + `,`,
- `Labels:` + mapStringForLabels + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *StatSnapshotResponse) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&StatSnapshotResponse{`,
- `Info:` + strings.Replace(strings.Replace(this.Info.String(), "Info", "Info", 1), `&`, ``, 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *UpdateSnapshotRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&UpdateSnapshotRequest{`,
- `Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`,
- `Info:` + strings.Replace(strings.Replace(this.Info.String(), "Info", "Info", 1), `&`, ``, 1) + `,`,
- `UpdateMask:` + strings.Replace(fmt.Sprintf("%v", this.UpdateMask), "FieldMask", "types1.FieldMask", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *UpdateSnapshotResponse) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&UpdateSnapshotResponse{`,
- `Info:` + strings.Replace(strings.Replace(this.Info.String(), "Info", "Info", 1), `&`, ``, 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ListSnapshotsRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ListSnapshotsRequest{`,
- `Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`,
- `Filters:` + fmt.Sprintf("%v", this.Filters) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ListSnapshotsResponse) String() string {
- if this == nil {
- return "nil"
- }
- repeatedStringForInfo := "[]Info{"
- for _, f := range this.Info {
- repeatedStringForInfo += strings.Replace(strings.Replace(f.String(), "Info", "Info", 1), `&`, ``, 1) + ","
- }
- repeatedStringForInfo += "}"
- s := strings.Join([]string{`&ListSnapshotsResponse{`,
- `Info:` + repeatedStringForInfo + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *UsageRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&UsageRequest{`,
- `Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`,
- `Key:` + fmt.Sprintf("%v", this.Key) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *UsageResponse) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&UsageResponse{`,
- `Size_:` + fmt.Sprintf("%v", this.Size_) + `,`,
- `Inodes:` + fmt.Sprintf("%v", this.Inodes) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *CleanupRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&CleanupRequest{`,
- `Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func valueToStringSnapshots(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
-}
-func (m *PrepareSnapshotRequest) 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 ErrIntOverflowSnapshots
- }
- 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: PrepareSnapshotRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: PrepareSnapshotRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Snapshotter = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Key = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Parent", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Parent = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 4:
- 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 ErrIntOverflowSnapshots
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- 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 ErrIntOverflowSnapshots
- }
- 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 ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postStringIndexmapkey := iNdEx + intStringLenmapkey
- if postStringIndexmapkey < 0 {
- return ErrInvalidLengthSnapshots
- }
- 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 ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postStringIndexmapvalue := iNdEx + intStringLenmapvalue
- if postStringIndexmapvalue < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postStringIndexmapvalue > l {
- return io.ErrUnexpectedEOF
- }
- mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
- iNdEx = postStringIndexmapvalue
- } else {
- iNdEx = entryPreIndex
- skippy, err := skipSnapshots(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) > postIndex {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- m.Labels[mapkey] = mapvalue
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipSnapshots(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *PrepareSnapshotResponse) 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 ErrIntOverflowSnapshots
- }
- 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: PrepareSnapshotResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: PrepareSnapshotResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Mounts", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Mounts = append(m.Mounts, &types.Mount{})
- if err := m.Mounts[len(m.Mounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipSnapshots(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ViewSnapshotRequest) 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 ErrIntOverflowSnapshots
- }
- 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: ViewSnapshotRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ViewSnapshotRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Snapshotter = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Key = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Parent", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Parent = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 4:
- 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 ErrIntOverflowSnapshots
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- 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 ErrIntOverflowSnapshots
- }
- 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 ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postStringIndexmapkey := iNdEx + intStringLenmapkey
- if postStringIndexmapkey < 0 {
- return ErrInvalidLengthSnapshots
- }
- 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 ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postStringIndexmapvalue := iNdEx + intStringLenmapvalue
- if postStringIndexmapvalue < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postStringIndexmapvalue > l {
- return io.ErrUnexpectedEOF
- }
- mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
- iNdEx = postStringIndexmapvalue
- } else {
- iNdEx = entryPreIndex
- skippy, err := skipSnapshots(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) > postIndex {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- m.Labels[mapkey] = mapvalue
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipSnapshots(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ViewSnapshotResponse) 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 ErrIntOverflowSnapshots
- }
- 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: ViewSnapshotResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ViewSnapshotResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Mounts", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Mounts = append(m.Mounts, &types.Mount{})
- if err := m.Mounts[len(m.Mounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipSnapshots(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *MountsRequest) 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 ErrIntOverflowSnapshots
- }
- 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: MountsRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: MountsRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Snapshotter = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Key = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipSnapshots(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *MountsResponse) 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 ErrIntOverflowSnapshots
- }
- 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: MountsResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: MountsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Mounts", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Mounts = append(m.Mounts, &types.Mount{})
- if err := m.Mounts[len(m.Mounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipSnapshots(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *RemoveSnapshotRequest) 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 ErrIntOverflowSnapshots
- }
- 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: RemoveSnapshotRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: RemoveSnapshotRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Snapshotter = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Key = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipSnapshots(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *CommitSnapshotRequest) 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 ErrIntOverflowSnapshots
- }
- 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: CommitSnapshotRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: CommitSnapshotRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Snapshotter = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Name = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Key = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 4:
- 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 ErrIntOverflowSnapshots
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- 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 ErrIntOverflowSnapshots
- }
- 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 ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postStringIndexmapkey := iNdEx + intStringLenmapkey
- if postStringIndexmapkey < 0 {
- return ErrInvalidLengthSnapshots
- }
- 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 ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postStringIndexmapvalue := iNdEx + intStringLenmapvalue
- if postStringIndexmapvalue < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postStringIndexmapvalue > l {
- return io.ErrUnexpectedEOF
- }
- mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
- iNdEx = postStringIndexmapvalue
- } else {
- iNdEx = entryPreIndex
- skippy, err := skipSnapshots(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) > postIndex {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- m.Labels[mapkey] = mapvalue
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipSnapshots(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *StatSnapshotRequest) 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 ErrIntOverflowSnapshots
- }
- 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: StatSnapshotRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: StatSnapshotRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Snapshotter = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Key = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipSnapshots(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *Info) 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 ErrIntOverflowSnapshots
- }
- 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: Info: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: Info: 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 ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- 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 Parent", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Parent = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType)
- }
- m.Kind = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Kind |= Kind(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CreatedAt, dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 5:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field UpdatedAt", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.UpdatedAt, 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 ErrIntOverflowSnapshots
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- 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 ErrIntOverflowSnapshots
- }
- 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 ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postStringIndexmapkey := iNdEx + intStringLenmapkey
- if postStringIndexmapkey < 0 {
- return ErrInvalidLengthSnapshots
- }
- 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 ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postStringIndexmapvalue := iNdEx + intStringLenmapvalue
- if postStringIndexmapvalue < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postStringIndexmapvalue > l {
- return io.ErrUnexpectedEOF
- }
- mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
- iNdEx = postStringIndexmapvalue
- } else {
- iNdEx = entryPreIndex
- skippy, err := skipSnapshots(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) > postIndex {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- m.Labels[mapkey] = mapvalue
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipSnapshots(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *StatSnapshotResponse) 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 ErrIntOverflowSnapshots
- }
- 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: StatSnapshotResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: StatSnapshotResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.Info.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipSnapshots(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *UpdateSnapshotRequest) 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 ErrIntOverflowSnapshots
- }
- 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: UpdateSnapshotRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: UpdateSnapshotRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Snapshotter = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.Info.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field UpdateMask", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.UpdateMask == nil {
- m.UpdateMask = &types1.FieldMask{}
- }
- if err := m.UpdateMask.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipSnapshots(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *UpdateSnapshotResponse) 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 ErrIntOverflowSnapshots
- }
- 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: UpdateSnapshotResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: UpdateSnapshotResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := m.Info.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipSnapshots(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ListSnapshotsRequest) 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 ErrIntOverflowSnapshots
- }
- 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: ListSnapshotsRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ListSnapshotsRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Snapshotter = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Filters = append(m.Filters, string(dAtA[iNdEx:postIndex]))
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipSnapshots(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ListSnapshotsResponse) 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 ErrIntOverflowSnapshots
- }
- 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: ListSnapshotsResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ListSnapshotsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Info = append(m.Info, Info{})
- if err := m.Info[len(m.Info)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipSnapshots(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *UsageRequest) 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 ErrIntOverflowSnapshots
- }
- 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: UsageRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: UsageRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Snapshotter = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Key = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipSnapshots(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *UsageResponse) 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 ErrIntOverflowSnapshots
- }
- 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: UsageResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: UsageResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType)
- }
- m.Size_ = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Size_ |= int64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Inodes", wireType)
- }
- m.Inodes = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Inodes |= int64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipSnapshots(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *CleanupRequest) 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 ErrIntOverflowSnapshots
- }
- 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: CleanupRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: CleanupRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowSnapshots
- }
- 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 ErrInvalidLengthSnapshots
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthSnapshots
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Snapshotter = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipSnapshots(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthSnapshots
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func skipSnapshots(dAtA []byte) (n int, err error) {
- l := len(dAtA)
- iNdEx := 0
- depth := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowSnapshots
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowSnapshots
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if dAtA[iNdEx-1] < 0x80 {
- break
- }
- }
- case 1:
- iNdEx += 8
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowSnapshots
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if length < 0 {
- return 0, ErrInvalidLengthSnapshots
- }
- iNdEx += length
- case 3:
- depth++
- case 4:
- if depth == 0 {
- return 0, ErrUnexpectedEndOfGroupSnapshots
- }
- depth--
- case 5:
- iNdEx += 4
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- if iNdEx < 0 {
- return 0, ErrInvalidLengthSnapshots
- }
- if depth == 0 {
- return iNdEx, nil
- }
- }
- return 0, io.ErrUnexpectedEOF
-}
-
-var (
- ErrInvalidLengthSnapshots = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowSnapshots = fmt.Errorf("proto: integer overflow")
- ErrUnexpectedEndOfGroupSnapshots = fmt.Errorf("proto: unexpected end of group")
-)
diff --git a/vendor/github.com/containerd/containerd/api/services/snapshots/v1/snapshots.proto b/vendor/github.com/containerd/containerd/api/services/snapshots/v1/snapshots.proto
deleted file mode 100644
index 981d8a6ba..000000000
--- a/vendor/github.com/containerd/containerd/api/services/snapshots/v1/snapshots.proto
+++ /dev/null
@@ -1,167 +0,0 @@
-syntax = "proto3";
-
-package containerd.services.snapshots.v1;
-
-import weak "gogoproto/gogo.proto";
-import "google/protobuf/empty.proto";
-import "google/protobuf/field_mask.proto";
-import "google/protobuf/timestamp.proto";
-import "github.com/containerd/containerd/api/types/mount.proto";
-
-option go_package = "github.com/containerd/containerd/api/services/snapshots/v1;snapshots";
-
-// Snapshot service manages snapshots
-service Snapshots {
- rpc Prepare(PrepareSnapshotRequest) returns (PrepareSnapshotResponse);
- rpc View(ViewSnapshotRequest) returns (ViewSnapshotResponse);
- rpc Mounts(MountsRequest) returns (MountsResponse);
- rpc Commit(CommitSnapshotRequest) returns (google.protobuf.Empty);
- rpc Remove(RemoveSnapshotRequest) returns (google.protobuf.Empty);
- rpc Stat(StatSnapshotRequest) returns (StatSnapshotResponse);
- rpc Update(UpdateSnapshotRequest) returns (UpdateSnapshotResponse);
- rpc List(ListSnapshotsRequest) returns (stream ListSnapshotsResponse);
- rpc Usage(UsageRequest) returns (UsageResponse);
- rpc Cleanup(CleanupRequest) returns (google.protobuf.Empty);
-}
-
-message PrepareSnapshotRequest {
- string snapshotter = 1;
- string key = 2;
- string parent = 3;
-
- // Labels are arbitrary data on snapshots.
- //
- // The combined size of a key/value pair cannot exceed 4096 bytes.
- map labels = 4;
-}
-
-message PrepareSnapshotResponse {
- repeated containerd.types.Mount mounts = 1;
-}
-
-message ViewSnapshotRequest {
- string snapshotter = 1;
- string key = 2;
- string parent = 3;
-
- // Labels are arbitrary data on snapshots.
- //
- // The combined size of a key/value pair cannot exceed 4096 bytes.
- map labels = 4;
-}
-
-message ViewSnapshotResponse {
- repeated containerd.types.Mount mounts = 1;
-}
-
-message MountsRequest {
- string snapshotter = 1;
- string key = 2;
-}
-
-message MountsResponse {
- repeated containerd.types.Mount mounts = 1;
-}
-
-message RemoveSnapshotRequest {
- string snapshotter = 1;
- string key = 2;
-}
-
-message CommitSnapshotRequest {
- string snapshotter = 1;
- string name = 2;
- string key = 3;
-
- // Labels are arbitrary data on snapshots.
- //
- // The combined size of a key/value pair cannot exceed 4096 bytes.
- map labels = 4;
-}
-
-message StatSnapshotRequest {
- string snapshotter = 1;
- string key = 2;
-}
-
-enum Kind {
- option (gogoproto.goproto_enum_prefix) = false;
- option (gogoproto.enum_customname) = "Kind";
-
- UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "KindUnknown"];
- VIEW = 1 [(gogoproto.enumvalue_customname) = "KindView"];
- ACTIVE = 2 [(gogoproto.enumvalue_customname) = "KindActive"];
- COMMITTED = 3 [(gogoproto.enumvalue_customname) = "KindCommitted"];
-}
-
-message Info {
- string name = 1;
- string parent = 2;
- Kind kind = 3;
-
- // CreatedAt provides the time at which the snapshot was created.
- google.protobuf.Timestamp created_at = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
-
- // UpdatedAt provides the time the info was last updated.
- google.protobuf.Timestamp updated_at = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
-
- // Labels are arbitrary data on snapshots.
- //
- // The combined size of a key/value pair cannot exceed 4096 bytes.
- map labels = 6;
-}
-
-message StatSnapshotResponse {
- Info info = 1 [(gogoproto.nullable) = false];
-}
-
-message UpdateSnapshotRequest {
- string snapshotter = 1;
- Info info = 2 [(gogoproto.nullable) = false];
-
- // UpdateMask specifies which fields to perform the update on. If empty,
- // the operation applies to all fields.
- //
- // In info, Name, Parent, Kind, Created are immutable,
- // other field may be updated using this mask.
- // If no mask is provided, all mutable field are updated.
- google.protobuf.FieldMask update_mask = 3;
-}
-
-message UpdateSnapshotResponse {
- Info info = 1 [(gogoproto.nullable) = false];
-}
-
-message ListSnapshotsRequest{
- string snapshotter = 1;
-
- // Filters contains one or more filters using the syntax defined in the
- // containerd filter package.
- //
- // The returned result will be those that match any of the provided
- // filters. Expanded, images that match the following will be
- // returned:
- //
- // filters[0] or filters[1] or ... or filters[n-1] or filters[n]
- //
- // If filters is zero-length or nil, all items will be returned.
- repeated string filters = 2;
-}
-
-message ListSnapshotsResponse {
- repeated Info info = 1 [(gogoproto.nullable) = false];
-}
-
-message UsageRequest {
- string snapshotter = 1;
- string key = 2;
-}
-
-message UsageResponse {
- int64 size = 1;
- int64 inodes = 2;
-}
-
-message CleanupRequest {
- string snapshotter = 1;
-}
diff --git a/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks.pb.go b/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks.pb.go
deleted file mode 100644
index 5ac5af11b..000000000
--- a/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks.pb.go
+++ /dev/null
@@ -1,7374 +0,0 @@
-// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: github.com/containerd/containerd/api/services/tasks/v1/tasks.proto
-
-package tasks
-
-import (
- context "context"
- fmt "fmt"
- types "github.com/containerd/containerd/api/types"
- task "github.com/containerd/containerd/api/types/task"
- proto "github.com/gogo/protobuf/proto"
- github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
- types1 "github.com/gogo/protobuf/types"
- github_com_opencontainers_go_digest "github.com/opencontainers/go-digest"
- grpc "google.golang.org/grpc"
- codes "google.golang.org/grpc/codes"
- status "google.golang.org/grpc/status"
- io "io"
- math "math"
- math_bits "math/bits"
- reflect "reflect"
- strings "strings"
- time "time"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-var _ = time.Kitchen
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
-
-type CreateTaskRequest struct {
- ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
- // RootFS provides the pre-chroot mounts to perform in the shim before
- // executing the container task.
- //
- // These are for mounts that cannot be performed in the user namespace.
- // Typically, these mounts should be resolved from snapshots specified on
- // the container object.
- Rootfs []*types.Mount `protobuf:"bytes,3,rep,name=rootfs,proto3" json:"rootfs,omitempty"`
- Stdin string `protobuf:"bytes,4,opt,name=stdin,proto3" json:"stdin,omitempty"`
- Stdout string `protobuf:"bytes,5,opt,name=stdout,proto3" json:"stdout,omitempty"`
- Stderr string `protobuf:"bytes,6,opt,name=stderr,proto3" json:"stderr,omitempty"`
- Terminal bool `protobuf:"varint,7,opt,name=terminal,proto3" json:"terminal,omitempty"`
- Checkpoint *types.Descriptor `protobuf:"bytes,8,opt,name=checkpoint,proto3" json:"checkpoint,omitempty"`
- Options *types1.Any `protobuf:"bytes,9,opt,name=options,proto3" json:"options,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *CreateTaskRequest) Reset() { *m = CreateTaskRequest{} }
-func (*CreateTaskRequest) ProtoMessage() {}
-func (*CreateTaskRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_310e7127b8a26f14, []int{0}
-}
-func (m *CreateTaskRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *CreateTaskRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_CreateTaskRequest.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 *CreateTaskRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_CreateTaskRequest.Merge(m, src)
-}
-func (m *CreateTaskRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *CreateTaskRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_CreateTaskRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CreateTaskRequest proto.InternalMessageInfo
-
-type CreateTaskResponse struct {
- ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
- Pid uint32 `protobuf:"varint,2,opt,name=pid,proto3" json:"pid,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *CreateTaskResponse) Reset() { *m = CreateTaskResponse{} }
-func (*CreateTaskResponse) ProtoMessage() {}
-func (*CreateTaskResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_310e7127b8a26f14, []int{1}
-}
-func (m *CreateTaskResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *CreateTaskResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_CreateTaskResponse.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 *CreateTaskResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_CreateTaskResponse.Merge(m, src)
-}
-func (m *CreateTaskResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *CreateTaskResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_CreateTaskResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CreateTaskResponse proto.InternalMessageInfo
-
-type StartRequest struct {
- ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
- ExecID string `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *StartRequest) Reset() { *m = StartRequest{} }
-func (*StartRequest) ProtoMessage() {}
-func (*StartRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_310e7127b8a26f14, []int{2}
-}
-func (m *StartRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *StartRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_StartRequest.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 *StartRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_StartRequest.Merge(m, src)
-}
-func (m *StartRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *StartRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_StartRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_StartRequest proto.InternalMessageInfo
-
-type StartResponse struct {
- Pid uint32 `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *StartResponse) Reset() { *m = StartResponse{} }
-func (*StartResponse) ProtoMessage() {}
-func (*StartResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_310e7127b8a26f14, []int{3}
-}
-func (m *StartResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *StartResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_StartResponse.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 *StartResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_StartResponse.Merge(m, src)
-}
-func (m *StartResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *StartResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_StartResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_StartResponse proto.InternalMessageInfo
-
-type DeleteTaskRequest struct {
- ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *DeleteTaskRequest) Reset() { *m = DeleteTaskRequest{} }
-func (*DeleteTaskRequest) ProtoMessage() {}
-func (*DeleteTaskRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_310e7127b8a26f14, []int{4}
-}
-func (m *DeleteTaskRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *DeleteTaskRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_DeleteTaskRequest.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 *DeleteTaskRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_DeleteTaskRequest.Merge(m, src)
-}
-func (m *DeleteTaskRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *DeleteTaskRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_DeleteTaskRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_DeleteTaskRequest proto.InternalMessageInfo
-
-type DeleteResponse struct {
- ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
- Pid uint32 `protobuf:"varint,2,opt,name=pid,proto3" json:"pid,omitempty"`
- ExitStatus uint32 `protobuf:"varint,3,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"`
- ExitedAt time.Time `protobuf:"bytes,4,opt,name=exited_at,json=exitedAt,proto3,stdtime" json:"exited_at"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *DeleteResponse) Reset() { *m = DeleteResponse{} }
-func (*DeleteResponse) ProtoMessage() {}
-func (*DeleteResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_310e7127b8a26f14, []int{5}
-}
-func (m *DeleteResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *DeleteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_DeleteResponse.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 *DeleteResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_DeleteResponse.Merge(m, src)
-}
-func (m *DeleteResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *DeleteResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_DeleteResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_DeleteResponse proto.InternalMessageInfo
-
-type DeleteProcessRequest struct {
- ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
- ExecID string `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *DeleteProcessRequest) Reset() { *m = DeleteProcessRequest{} }
-func (*DeleteProcessRequest) ProtoMessage() {}
-func (*DeleteProcessRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_310e7127b8a26f14, []int{6}
-}
-func (m *DeleteProcessRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *DeleteProcessRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_DeleteProcessRequest.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 *DeleteProcessRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_DeleteProcessRequest.Merge(m, src)
-}
-func (m *DeleteProcessRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *DeleteProcessRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_DeleteProcessRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_DeleteProcessRequest proto.InternalMessageInfo
-
-type GetRequest struct {
- ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
- ExecID string `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *GetRequest) Reset() { *m = GetRequest{} }
-func (*GetRequest) ProtoMessage() {}
-func (*GetRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_310e7127b8a26f14, []int{7}
-}
-func (m *GetRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *GetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_GetRequest.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 *GetRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GetRequest.Merge(m, src)
-}
-func (m *GetRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *GetRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_GetRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GetRequest proto.InternalMessageInfo
-
-type GetResponse struct {
- Process *task.Process `protobuf:"bytes,1,opt,name=process,proto3" json:"process,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *GetResponse) Reset() { *m = GetResponse{} }
-func (*GetResponse) ProtoMessage() {}
-func (*GetResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_310e7127b8a26f14, []int{8}
-}
-func (m *GetResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *GetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_GetResponse.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 *GetResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_GetResponse.Merge(m, src)
-}
-func (m *GetResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *GetResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_GetResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_GetResponse proto.InternalMessageInfo
-
-type ListTasksRequest struct {
- Filter string `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ListTasksRequest) Reset() { *m = ListTasksRequest{} }
-func (*ListTasksRequest) ProtoMessage() {}
-func (*ListTasksRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_310e7127b8a26f14, []int{9}
-}
-func (m *ListTasksRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ListTasksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ListTasksRequest.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 *ListTasksRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ListTasksRequest.Merge(m, src)
-}
-func (m *ListTasksRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *ListTasksRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_ListTasksRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ListTasksRequest proto.InternalMessageInfo
-
-type ListTasksResponse struct {
- Tasks []*task.Process `protobuf:"bytes,1,rep,name=tasks,proto3" json:"tasks,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ListTasksResponse) Reset() { *m = ListTasksResponse{} }
-func (*ListTasksResponse) ProtoMessage() {}
-func (*ListTasksResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_310e7127b8a26f14, []int{10}
-}
-func (m *ListTasksResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ListTasksResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ListTasksResponse.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 *ListTasksResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ListTasksResponse.Merge(m, src)
-}
-func (m *ListTasksResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *ListTasksResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_ListTasksResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ListTasksResponse proto.InternalMessageInfo
-
-type KillRequest struct {
- ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
- ExecID string `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"`
- Signal uint32 `protobuf:"varint,3,opt,name=signal,proto3" json:"signal,omitempty"`
- All bool `protobuf:"varint,4,opt,name=all,proto3" json:"all,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *KillRequest) Reset() { *m = KillRequest{} }
-func (*KillRequest) ProtoMessage() {}
-func (*KillRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_310e7127b8a26f14, []int{11}
-}
-func (m *KillRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *KillRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_KillRequest.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 *KillRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_KillRequest.Merge(m, src)
-}
-func (m *KillRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *KillRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_KillRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_KillRequest proto.InternalMessageInfo
-
-type ExecProcessRequest struct {
- ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
- Stdin string `protobuf:"bytes,2,opt,name=stdin,proto3" json:"stdin,omitempty"`
- Stdout string `protobuf:"bytes,3,opt,name=stdout,proto3" json:"stdout,omitempty"`
- Stderr string `protobuf:"bytes,4,opt,name=stderr,proto3" json:"stderr,omitempty"`
- Terminal bool `protobuf:"varint,5,opt,name=terminal,proto3" json:"terminal,omitempty"`
- // Spec for starting a process in the target container.
- //
- // For runc, this is a process spec, for example.
- Spec *types1.Any `protobuf:"bytes,6,opt,name=spec,proto3" json:"spec,omitempty"`
- // id of the exec process
- ExecID string `protobuf:"bytes,7,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ExecProcessRequest) Reset() { *m = ExecProcessRequest{} }
-func (*ExecProcessRequest) ProtoMessage() {}
-func (*ExecProcessRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_310e7127b8a26f14, []int{12}
-}
-func (m *ExecProcessRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ExecProcessRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ExecProcessRequest.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 *ExecProcessRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ExecProcessRequest.Merge(m, src)
-}
-func (m *ExecProcessRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *ExecProcessRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_ExecProcessRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ExecProcessRequest proto.InternalMessageInfo
-
-type ExecProcessResponse struct {
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ExecProcessResponse) Reset() { *m = ExecProcessResponse{} }
-func (*ExecProcessResponse) ProtoMessage() {}
-func (*ExecProcessResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_310e7127b8a26f14, []int{13}
-}
-func (m *ExecProcessResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ExecProcessResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ExecProcessResponse.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 *ExecProcessResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ExecProcessResponse.Merge(m, src)
-}
-func (m *ExecProcessResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *ExecProcessResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_ExecProcessResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ExecProcessResponse proto.InternalMessageInfo
-
-type ResizePtyRequest struct {
- ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
- ExecID string `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"`
- Width uint32 `protobuf:"varint,3,opt,name=width,proto3" json:"width,omitempty"`
- Height uint32 `protobuf:"varint,4,opt,name=height,proto3" json:"height,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ResizePtyRequest) Reset() { *m = ResizePtyRequest{} }
-func (*ResizePtyRequest) ProtoMessage() {}
-func (*ResizePtyRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_310e7127b8a26f14, []int{14}
-}
-func (m *ResizePtyRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ResizePtyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ResizePtyRequest.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 *ResizePtyRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ResizePtyRequest.Merge(m, src)
-}
-func (m *ResizePtyRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *ResizePtyRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_ResizePtyRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ResizePtyRequest proto.InternalMessageInfo
-
-type CloseIORequest struct {
- ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
- ExecID string `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"`
- Stdin bool `protobuf:"varint,3,opt,name=stdin,proto3" json:"stdin,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *CloseIORequest) Reset() { *m = CloseIORequest{} }
-func (*CloseIORequest) ProtoMessage() {}
-func (*CloseIORequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_310e7127b8a26f14, []int{15}
-}
-func (m *CloseIORequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *CloseIORequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_CloseIORequest.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 *CloseIORequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_CloseIORequest.Merge(m, src)
-}
-func (m *CloseIORequest) XXX_Size() int {
- return m.Size()
-}
-func (m *CloseIORequest) XXX_DiscardUnknown() {
- xxx_messageInfo_CloseIORequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CloseIORequest proto.InternalMessageInfo
-
-type PauseTaskRequest struct {
- ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *PauseTaskRequest) Reset() { *m = PauseTaskRequest{} }
-func (*PauseTaskRequest) ProtoMessage() {}
-func (*PauseTaskRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_310e7127b8a26f14, []int{16}
-}
-func (m *PauseTaskRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *PauseTaskRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_PauseTaskRequest.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 *PauseTaskRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_PauseTaskRequest.Merge(m, src)
-}
-func (m *PauseTaskRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *PauseTaskRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_PauseTaskRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_PauseTaskRequest proto.InternalMessageInfo
-
-type ResumeTaskRequest struct {
- ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ResumeTaskRequest) Reset() { *m = ResumeTaskRequest{} }
-func (*ResumeTaskRequest) ProtoMessage() {}
-func (*ResumeTaskRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_310e7127b8a26f14, []int{17}
-}
-func (m *ResumeTaskRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ResumeTaskRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ResumeTaskRequest.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 *ResumeTaskRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ResumeTaskRequest.Merge(m, src)
-}
-func (m *ResumeTaskRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *ResumeTaskRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_ResumeTaskRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ResumeTaskRequest proto.InternalMessageInfo
-
-type ListPidsRequest struct {
- ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ListPidsRequest) Reset() { *m = ListPidsRequest{} }
-func (*ListPidsRequest) ProtoMessage() {}
-func (*ListPidsRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_310e7127b8a26f14, []int{18}
-}
-func (m *ListPidsRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ListPidsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ListPidsRequest.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 *ListPidsRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ListPidsRequest.Merge(m, src)
-}
-func (m *ListPidsRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *ListPidsRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_ListPidsRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ListPidsRequest proto.InternalMessageInfo
-
-type ListPidsResponse struct {
- // Processes includes the process ID and additional process information
- Processes []*task.ProcessInfo `protobuf:"bytes,1,rep,name=processes,proto3" json:"processes,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ListPidsResponse) Reset() { *m = ListPidsResponse{} }
-func (*ListPidsResponse) ProtoMessage() {}
-func (*ListPidsResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_310e7127b8a26f14, []int{19}
-}
-func (m *ListPidsResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ListPidsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ListPidsResponse.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 *ListPidsResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ListPidsResponse.Merge(m, src)
-}
-func (m *ListPidsResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *ListPidsResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_ListPidsResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ListPidsResponse proto.InternalMessageInfo
-
-type CheckpointTaskRequest struct {
- ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
- ParentCheckpoint github_com_opencontainers_go_digest.Digest `protobuf:"bytes,2,opt,name=parent_checkpoint,json=parentCheckpoint,proto3,customtype=github.com/opencontainers/go-digest.Digest" json:"parent_checkpoint"`
- Options *types1.Any `protobuf:"bytes,3,opt,name=options,proto3" json:"options,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *CheckpointTaskRequest) Reset() { *m = CheckpointTaskRequest{} }
-func (*CheckpointTaskRequest) ProtoMessage() {}
-func (*CheckpointTaskRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_310e7127b8a26f14, []int{20}
-}
-func (m *CheckpointTaskRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *CheckpointTaskRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_CheckpointTaskRequest.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 *CheckpointTaskRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_CheckpointTaskRequest.Merge(m, src)
-}
-func (m *CheckpointTaskRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *CheckpointTaskRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_CheckpointTaskRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CheckpointTaskRequest proto.InternalMessageInfo
-
-type CheckpointTaskResponse struct {
- Descriptors []*types.Descriptor `protobuf:"bytes,1,rep,name=descriptors,proto3" json:"descriptors,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *CheckpointTaskResponse) Reset() { *m = CheckpointTaskResponse{} }
-func (*CheckpointTaskResponse) ProtoMessage() {}
-func (*CheckpointTaskResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_310e7127b8a26f14, []int{21}
-}
-func (m *CheckpointTaskResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *CheckpointTaskResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_CheckpointTaskResponse.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 *CheckpointTaskResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_CheckpointTaskResponse.Merge(m, src)
-}
-func (m *CheckpointTaskResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *CheckpointTaskResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_CheckpointTaskResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CheckpointTaskResponse proto.InternalMessageInfo
-
-type UpdateTaskRequest struct {
- ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
- Resources *types1.Any `protobuf:"bytes,2,opt,name=resources,proto3" json:"resources,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *UpdateTaskRequest) Reset() { *m = UpdateTaskRequest{} }
-func (*UpdateTaskRequest) ProtoMessage() {}
-func (*UpdateTaskRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_310e7127b8a26f14, []int{22}
-}
-func (m *UpdateTaskRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *UpdateTaskRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_UpdateTaskRequest.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 *UpdateTaskRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_UpdateTaskRequest.Merge(m, src)
-}
-func (m *UpdateTaskRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *UpdateTaskRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_UpdateTaskRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_UpdateTaskRequest proto.InternalMessageInfo
-
-type MetricsRequest struct {
- Filters []string `protobuf:"bytes,1,rep,name=filters,proto3" json:"filters,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *MetricsRequest) Reset() { *m = MetricsRequest{} }
-func (*MetricsRequest) ProtoMessage() {}
-func (*MetricsRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_310e7127b8a26f14, []int{23}
-}
-func (m *MetricsRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *MetricsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_MetricsRequest.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 *MetricsRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MetricsRequest.Merge(m, src)
-}
-func (m *MetricsRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *MetricsRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_MetricsRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_MetricsRequest proto.InternalMessageInfo
-
-type MetricsResponse struct {
- Metrics []*types.Metric `protobuf:"bytes,1,rep,name=metrics,proto3" json:"metrics,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *MetricsResponse) Reset() { *m = MetricsResponse{} }
-func (*MetricsResponse) ProtoMessage() {}
-func (*MetricsResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_310e7127b8a26f14, []int{24}
-}
-func (m *MetricsResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *MetricsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_MetricsResponse.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 *MetricsResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_MetricsResponse.Merge(m, src)
-}
-func (m *MetricsResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *MetricsResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_MetricsResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_MetricsResponse proto.InternalMessageInfo
-
-type WaitRequest struct {
- ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
- ExecID string `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *WaitRequest) Reset() { *m = WaitRequest{} }
-func (*WaitRequest) ProtoMessage() {}
-func (*WaitRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_310e7127b8a26f14, []int{25}
-}
-func (m *WaitRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *WaitRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_WaitRequest.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 *WaitRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_WaitRequest.Merge(m, src)
-}
-func (m *WaitRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *WaitRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_WaitRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_WaitRequest proto.InternalMessageInfo
-
-type WaitResponse struct {
- ExitStatus uint32 `protobuf:"varint,1,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"`
- ExitedAt time.Time `protobuf:"bytes,2,opt,name=exited_at,json=exitedAt,proto3,stdtime" json:"exited_at"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *WaitResponse) Reset() { *m = WaitResponse{} }
-func (*WaitResponse) ProtoMessage() {}
-func (*WaitResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_310e7127b8a26f14, []int{26}
-}
-func (m *WaitResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *WaitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_WaitResponse.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 *WaitResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_WaitResponse.Merge(m, src)
-}
-func (m *WaitResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *WaitResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_WaitResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_WaitResponse proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*CreateTaskRequest)(nil), "containerd.services.tasks.v1.CreateTaskRequest")
- proto.RegisterType((*CreateTaskResponse)(nil), "containerd.services.tasks.v1.CreateTaskResponse")
- proto.RegisterType((*StartRequest)(nil), "containerd.services.tasks.v1.StartRequest")
- proto.RegisterType((*StartResponse)(nil), "containerd.services.tasks.v1.StartResponse")
- proto.RegisterType((*DeleteTaskRequest)(nil), "containerd.services.tasks.v1.DeleteTaskRequest")
- proto.RegisterType((*DeleteResponse)(nil), "containerd.services.tasks.v1.DeleteResponse")
- proto.RegisterType((*DeleteProcessRequest)(nil), "containerd.services.tasks.v1.DeleteProcessRequest")
- proto.RegisterType((*GetRequest)(nil), "containerd.services.tasks.v1.GetRequest")
- proto.RegisterType((*GetResponse)(nil), "containerd.services.tasks.v1.GetResponse")
- proto.RegisterType((*ListTasksRequest)(nil), "containerd.services.tasks.v1.ListTasksRequest")
- proto.RegisterType((*ListTasksResponse)(nil), "containerd.services.tasks.v1.ListTasksResponse")
- proto.RegisterType((*KillRequest)(nil), "containerd.services.tasks.v1.KillRequest")
- proto.RegisterType((*ExecProcessRequest)(nil), "containerd.services.tasks.v1.ExecProcessRequest")
- proto.RegisterType((*ExecProcessResponse)(nil), "containerd.services.tasks.v1.ExecProcessResponse")
- proto.RegisterType((*ResizePtyRequest)(nil), "containerd.services.tasks.v1.ResizePtyRequest")
- proto.RegisterType((*CloseIORequest)(nil), "containerd.services.tasks.v1.CloseIORequest")
- proto.RegisterType((*PauseTaskRequest)(nil), "containerd.services.tasks.v1.PauseTaskRequest")
- proto.RegisterType((*ResumeTaskRequest)(nil), "containerd.services.tasks.v1.ResumeTaskRequest")
- proto.RegisterType((*ListPidsRequest)(nil), "containerd.services.tasks.v1.ListPidsRequest")
- proto.RegisterType((*ListPidsResponse)(nil), "containerd.services.tasks.v1.ListPidsResponse")
- proto.RegisterType((*CheckpointTaskRequest)(nil), "containerd.services.tasks.v1.CheckpointTaskRequest")
- proto.RegisterType((*CheckpointTaskResponse)(nil), "containerd.services.tasks.v1.CheckpointTaskResponse")
- proto.RegisterType((*UpdateTaskRequest)(nil), "containerd.services.tasks.v1.UpdateTaskRequest")
- proto.RegisterType((*MetricsRequest)(nil), "containerd.services.tasks.v1.MetricsRequest")
- proto.RegisterType((*MetricsResponse)(nil), "containerd.services.tasks.v1.MetricsResponse")
- proto.RegisterType((*WaitRequest)(nil), "containerd.services.tasks.v1.WaitRequest")
- proto.RegisterType((*WaitResponse)(nil), "containerd.services.tasks.v1.WaitResponse")
-}
-
-func init() {
- proto.RegisterFile("github.com/containerd/containerd/api/services/tasks/v1/tasks.proto", fileDescriptor_310e7127b8a26f14)
-}
-
-var fileDescriptor_310e7127b8a26f14 = []byte{
- // 1318 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x4b, 0x6f, 0x1b, 0x45,
- 0x1c, 0xef, 0xfa, 0xed, 0xbf, 0x93, 0x36, 0x59, 0xd2, 0x60, 0x96, 0x2a, 0x0e, 0xcb, 0xc5, 0x04,
- 0xba, 0x4b, 0x5d, 0x54, 0x21, 0x5a, 0x21, 0x35, 0x0f, 0x22, 0x0b, 0xaa, 0xa6, 0xdb, 0x02, 0x55,
- 0x25, 0x14, 0xb6, 0xbb, 0x13, 0x67, 0x14, 0x7b, 0x67, 0xbb, 0x33, 0x4e, 0x1b, 0x38, 0xc0, 0x47,
- 0xe8, 0x95, 0x0b, 0x9f, 0x27, 0x47, 0x8e, 0x08, 0x55, 0x81, 0xfa, 0x5b, 0x70, 0x43, 0xf3, 0xd8,
- 0xcd, 0xc6, 0x8e, 0xbd, 0x4e, 0xd3, 0x70, 0x69, 0x67, 0x66, 0xff, 0xaf, 0xf9, 0xcd, 0xff, 0xf1,
- 0x73, 0x60, 0xb5, 0x83, 0xd9, 0x6e, 0xff, 0xa9, 0xe5, 0x91, 0x9e, 0xed, 0x91, 0x80, 0xb9, 0x38,
- 0x40, 0x91, 0x9f, 0x5e, 0xba, 0x21, 0xb6, 0x29, 0x8a, 0xf6, 0xb1, 0x87, 0xa8, 0xcd, 0x5c, 0xba,
- 0x47, 0xed, 0xfd, 0x1b, 0x72, 0x61, 0x85, 0x11, 0x61, 0x44, 0xbf, 0x76, 0x2c, 0x6d, 0xc5, 0x92,
- 0x96, 0x14, 0xd8, 0xbf, 0x61, 0xbc, 0xdf, 0x21, 0xa4, 0xd3, 0x45, 0xb6, 0x90, 0x7d, 0xda, 0xdf,
- 0xb1, 0x51, 0x2f, 0x64, 0x07, 0x52, 0xd5, 0x78, 0x6f, 0xf8, 0xa3, 0x1b, 0xc4, 0x9f, 0x16, 0x3a,
- 0xa4, 0x43, 0xc4, 0xd2, 0xe6, 0x2b, 0x75, 0x7a, 0x6b, 0xaa, 0x78, 0xd9, 0x41, 0x88, 0xa8, 0xdd,
- 0x23, 0xfd, 0x80, 0x29, 0xbd, 0xcf, 0xcf, 0xa2, 0x87, 0x58, 0x84, 0x3d, 0x75, 0x3b, 0xe3, 0xf6,
- 0x19, 0x34, 0x7d, 0x44, 0xbd, 0x08, 0x87, 0x8c, 0x44, 0x4a, 0xf9, 0x8b, 0x33, 0x28, 0x73, 0xc4,
- 0xc4, 0x3f, 0x4a, 0xb7, 0x31, 0x8c, 0x0d, 0xc3, 0x3d, 0x44, 0x99, 0xdb, 0x0b, 0xa5, 0x80, 0x79,
- 0x98, 0x83, 0xf9, 0xb5, 0x08, 0xb9, 0x0c, 0x3d, 0x72, 0xe9, 0x9e, 0x83, 0x9e, 0xf5, 0x11, 0x65,
- 0x7a, 0x0b, 0x66, 0x12, 0xf3, 0xdb, 0xd8, 0xaf, 0x6b, 0xcb, 0x5a, 0xb3, 0xba, 0x7a, 0x65, 0x70,
- 0xd4, 0xa8, 0xad, 0xc5, 0xe7, 0xed, 0x75, 0xa7, 0x96, 0x08, 0xb5, 0x7d, 0xdd, 0x86, 0x52, 0x44,
- 0x08, 0xdb, 0xa1, 0xf5, 0xfc, 0x72, 0xbe, 0x59, 0x6b, 0xbd, 0x6b, 0xa5, 0x9e, 0x54, 0x44, 0x67,
- 0xdd, 0xe3, 0x60, 0x3a, 0x4a, 0x4c, 0x5f, 0x80, 0x22, 0x65, 0x3e, 0x0e, 0xea, 0x05, 0x6e, 0xdd,
- 0x91, 0x1b, 0x7d, 0x11, 0x4a, 0x94, 0xf9, 0xa4, 0xcf, 0xea, 0x45, 0x71, 0xac, 0x76, 0xea, 0x1c,
- 0x45, 0x51, 0xbd, 0x94, 0x9c, 0xa3, 0x28, 0xd2, 0x0d, 0xa8, 0x30, 0x14, 0xf5, 0x70, 0xe0, 0x76,
- 0xeb, 0xe5, 0x65, 0xad, 0x59, 0x71, 0x92, 0xbd, 0x7e, 0x07, 0xc0, 0xdb, 0x45, 0xde, 0x5e, 0x48,
- 0x70, 0xc0, 0xea, 0x95, 0x65, 0xad, 0x59, 0x6b, 0x5d, 0x1b, 0x0d, 0x6b, 0x3d, 0x41, 0xdc, 0x49,
- 0xc9, 0xeb, 0x16, 0x94, 0x49, 0xc8, 0x30, 0x09, 0x68, 0xbd, 0x2a, 0x54, 0x17, 0x2c, 0x89, 0xa6,
- 0x15, 0xa3, 0x69, 0xdd, 0x0d, 0x0e, 0x9c, 0x58, 0xc8, 0x7c, 0x02, 0x7a, 0x1a, 0x49, 0x1a, 0x92,
- 0x80, 0xa2, 0x37, 0x82, 0x72, 0x0e, 0xf2, 0x21, 0xf6, 0xeb, 0xb9, 0x65, 0xad, 0x39, 0xeb, 0xf0,
- 0xa5, 0xd9, 0x81, 0x99, 0x87, 0xcc, 0x8d, 0xd8, 0x79, 0x1e, 0xe8, 0x43, 0x28, 0xa3, 0x17, 0xc8,
- 0xdb, 0x56, 0x96, 0xab, 0xab, 0x30, 0x38, 0x6a, 0x94, 0x36, 0x5e, 0x20, 0xaf, 0xbd, 0xee, 0x94,
- 0xf8, 0xa7, 0xb6, 0x6f, 0x7e, 0x00, 0xb3, 0xca, 0x91, 0x8a, 0x5f, 0xc5, 0xa2, 0x1d, 0xc7, 0xb2,
- 0x09, 0xf3, 0xeb, 0xa8, 0x8b, 0xce, 0x9d, 0x31, 0xe6, 0xef, 0x1a, 0x5c, 0x96, 0x96, 0x12, 0x6f,
- 0x8b, 0x90, 0x4b, 0x94, 0x4b, 0x83, 0xa3, 0x46, 0xae, 0xbd, 0xee, 0xe4, 0xf0, 0x29, 0x88, 0xe8,
- 0x0d, 0xa8, 0xa1, 0x17, 0x98, 0x6d, 0x53, 0xe6, 0xb2, 0x3e, 0xcf, 0x39, 0xfe, 0x05, 0xf8, 0xd1,
- 0x43, 0x71, 0xa2, 0xdf, 0x85, 0x2a, 0xdf, 0x21, 0x7f, 0xdb, 0x65, 0x22, 0xc5, 0x6a, 0x2d, 0x63,
- 0xe4, 0x01, 0x1f, 0xc5, 0xe5, 0xb0, 0x5a, 0x39, 0x3c, 0x6a, 0x5c, 0x7a, 0xf9, 0x77, 0x43, 0x73,
- 0x2a, 0x52, 0xed, 0x2e, 0x33, 0x09, 0x2c, 0xc8, 0xf8, 0xb6, 0x22, 0xe2, 0x21, 0x4a, 0x2f, 0x1c,
- 0x7d, 0x04, 0xb0, 0x89, 0x2e, 0xfe, 0x91, 0x37, 0xa0, 0x26, 0xdc, 0x28, 0xd0, 0x6f, 0x41, 0x39,
- 0x94, 0x17, 0x14, 0x2e, 0x86, 0x6a, 0x64, 0xff, 0x86, 0x2a, 0x93, 0x18, 0x84, 0x58, 0xd8, 0x5c,
- 0x81, 0xb9, 0x6f, 0x30, 0x65, 0x3c, 0x0d, 0x12, 0x68, 0x16, 0xa1, 0xb4, 0x83, 0xbb, 0x0c, 0x45,
- 0x32, 0x5a, 0x47, 0xed, 0x78, 0xd2, 0xa4, 0x64, 0x93, 0xda, 0x28, 0x8a, 0x16, 0x5f, 0xd7, 0x44,
- 0xc7, 0x98, 0xec, 0x56, 0x8a, 0x9a, 0x2f, 0x35, 0xa8, 0x7d, 0x8d, 0xbb, 0xdd, 0x8b, 0x06, 0x49,
- 0x34, 0x1c, 0xdc, 0xe1, 0x6d, 0x45, 0xe6, 0x96, 0xda, 0xf1, 0x54, 0x74, 0xbb, 0x5d, 0x91, 0x51,
- 0x15, 0x87, 0x2f, 0xcd, 0x7f, 0x35, 0xd0, 0xb9, 0xf2, 0x5b, 0xc8, 0x92, 0xa4, 0x27, 0xe6, 0x4e,
- 0xef, 0x89, 0xf9, 0x31, 0x3d, 0xb1, 0x30, 0xb6, 0x27, 0x16, 0x87, 0x7a, 0x62, 0x13, 0x0a, 0x34,
- 0x44, 0x9e, 0xe8, 0xa2, 0xe3, 0x5a, 0x9a, 0x90, 0x48, 0xa3, 0x54, 0x1e, 0x9b, 0x4a, 0x57, 0xe1,
- 0x9d, 0x13, 0x57, 0x97, 0x2f, 0x6b, 0xfe, 0xa6, 0xc1, 0x9c, 0x83, 0x28, 0xfe, 0x09, 0x6d, 0xb1,
- 0x83, 0x0b, 0x7f, 0xaa, 0x05, 0x28, 0x3e, 0xc7, 0x3e, 0xdb, 0x55, 0x2f, 0x25, 0x37, 0x1c, 0x9d,
- 0x5d, 0x84, 0x3b, 0xbb, 0xb2, 0xfa, 0x67, 0x1d, 0xb5, 0x33, 0x7f, 0x81, 0xcb, 0x6b, 0x5d, 0x42,
- 0x51, 0xfb, 0xfe, 0xff, 0x11, 0x98, 0x7c, 0xce, 0xbc, 0x78, 0x05, 0xb9, 0x31, 0xbf, 0x82, 0xb9,
- 0x2d, 0xb7, 0x4f, 0xcf, 0xdd, 0x3f, 0x37, 0x61, 0xde, 0x41, 0xb4, 0xdf, 0x3b, 0xb7, 0xa1, 0x0d,
- 0xb8, 0xc2, 0x8b, 0x73, 0x0b, 0xfb, 0xe7, 0x49, 0x5e, 0xd3, 0x91, 0xfd, 0x40, 0x9a, 0x51, 0x25,
- 0xfe, 0x25, 0x54, 0x55, 0xbb, 0x40, 0x71, 0x99, 0x2f, 0x4f, 0x2a, 0xf3, 0x76, 0xb0, 0x43, 0x9c,
- 0x63, 0x15, 0xf3, 0x95, 0x06, 0x57, 0xd7, 0x92, 0x99, 0x7c, 0x5e, 0x8e, 0xb2, 0x0d, 0xf3, 0xa1,
- 0x1b, 0xa1, 0x80, 0x6d, 0xa7, 0x78, 0x81, 0x7c, 0xbe, 0x16, 0xef, 0xff, 0x7f, 0x1d, 0x35, 0x56,
- 0x52, 0x6c, 0x8b, 0x84, 0x28, 0x48, 0xd4, 0xa9, 0xdd, 0x21, 0xd7, 0x7d, 0xdc, 0x41, 0x94, 0x59,
- 0xeb, 0xe2, 0x3f, 0x67, 0x4e, 0x1a, 0x5b, 0x3b, 0x95, 0x33, 0xe4, 0xa7, 0xe1, 0x0c, 0x8f, 0x61,
- 0x71, 0xf8, 0x76, 0x09, 0x70, 0xb5, 0x63, 0x26, 0x78, 0x6a, 0x87, 0x1c, 0x21, 0x2f, 0x69, 0x05,
- 0xf3, 0x67, 0x98, 0xff, 0x36, 0xf4, 0xdf, 0x02, 0xaf, 0x6b, 0x41, 0x35, 0x42, 0x94, 0xf4, 0x23,
- 0x0f, 0x51, 0x81, 0xd5, 0xb8, 0x4b, 0x1d, 0x8b, 0x99, 0x2b, 0x70, 0xf9, 0x9e, 0x24, 0xc0, 0xb1,
- 0xe7, 0x3a, 0x94, 0xe5, 0x24, 0x90, 0x57, 0xa9, 0x3a, 0xf1, 0x96, 0x27, 0x5f, 0x22, 0x9b, 0xcc,
- 0x85, 0xb2, 0xe2, 0xcf, 0xea, 0xde, 0xf5, 0x53, 0xb8, 0xa4, 0x10, 0x70, 0x62, 0x41, 0x73, 0x07,
- 0x6a, 0xdf, 0xbb, 0xf8, 0xe2, 0x67, 0x67, 0x04, 0x33, 0xd2, 0x8f, 0x8a, 0x75, 0x88, 0x87, 0x68,
- 0x93, 0x79, 0x48, 0xee, 0x4d, 0x78, 0x48, 0xeb, 0xd5, 0x0c, 0x14, 0xc5, 0xe4, 0xd4, 0xf7, 0xa0,
- 0x24, 0x39, 0xa6, 0x6e, 0x5b, 0x93, 0x7e, 0x31, 0x59, 0x23, 0x9c, 0xde, 0xf8, 0x74, 0x7a, 0x05,
- 0x75, 0xb5, 0x1f, 0xa1, 0x28, 0xb8, 0xa0, 0xbe, 0x32, 0x59, 0x35, 0xcd, 0x4c, 0x8d, 0x8f, 0xa7,
- 0x92, 0x55, 0x1e, 0x3a, 0x50, 0x92, 0x04, 0x2b, 0xeb, 0x3a, 0x23, 0x84, 0xd3, 0xf8, 0x64, 0x1a,
- 0x85, 0xc4, 0xd1, 0x33, 0x98, 0x3d, 0xc1, 0xe4, 0xf4, 0xd6, 0x34, 0xea, 0x27, 0x07, 0xfa, 0x19,
- 0x5d, 0x3e, 0x81, 0xfc, 0x26, 0x62, 0x7a, 0x73, 0xb2, 0xd2, 0x31, 0xdd, 0x33, 0x3e, 0x9a, 0x42,
- 0x32, 0xc1, 0xad, 0xc0, 0x3b, 0xad, 0x6e, 0x4d, 0x56, 0x19, 0x66, 0x67, 0x86, 0x3d, 0xb5, 0xbc,
- 0x72, 0xd4, 0x86, 0x02, 0x27, 0x5b, 0x7a, 0x46, 0x6c, 0x29, 0x42, 0x66, 0x2c, 0x8e, 0x24, 0xf7,
- 0x06, 0xff, 0xb1, 0xae, 0x6f, 0x41, 0x81, 0x97, 0x92, 0x9e, 0x91, 0x87, 0xa3, 0x44, 0x6a, 0xac,
- 0xc5, 0x87, 0x50, 0x4d, 0x38, 0x46, 0x16, 0x14, 0xc3, 0x64, 0x64, 0xac, 0xd1, 0xfb, 0x50, 0x56,
- 0xec, 0x40, 0xcf, 0x78, 0xef, 0x93, 0x24, 0x62, 0x82, 0xc1, 0xa2, 0x98, 0xf6, 0x59, 0x11, 0x0e,
- 0x53, 0x82, 0xb1, 0x06, 0x1f, 0x40, 0x49, 0x8e, 0xfd, 0xac, 0xa2, 0x19, 0x21, 0x07, 0x63, 0x4d,
- 0x62, 0xa8, 0xc4, 0x93, 0x5b, 0xbf, 0x9e, 0x9d, 0x23, 0x29, 0xa2, 0x60, 0x58, 0xd3, 0x8a, 0xab,
- 0x8c, 0x7a, 0x0e, 0x90, 0x9a, 0x97, 0x37, 0x33, 0x20, 0x3e, 0x6d, 0xf2, 0x1b, 0x9f, 0x9d, 0x4d,
- 0x49, 0x39, 0x7e, 0x00, 0x25, 0x39, 0x10, 0xb3, 0x60, 0x1b, 0x19, 0x9b, 0x63, 0x61, 0xdb, 0x81,
- 0xb2, 0x1a, 0x5d, 0x59, 0xb9, 0x72, 0x72, 0x1a, 0x1a, 0xd7, 0xa7, 0x94, 0x56, 0xa1, 0xff, 0x00,
- 0x05, 0x3e, 0x73, 0xb2, 0xaa, 0x30, 0x35, 0xff, 0x8c, 0x95, 0x69, 0x44, 0xa5, 0xf9, 0xd5, 0xef,
- 0x0e, 0x5f, 0x2f, 0x5d, 0xfa, 0xf3, 0xf5, 0xd2, 0xa5, 0x5f, 0x07, 0x4b, 0xda, 0xe1, 0x60, 0x49,
- 0xfb, 0x63, 0xb0, 0xa4, 0xfd, 0x33, 0x58, 0xd2, 0x9e, 0xdc, 0x79, 0xb3, 0xbf, 0xec, 0xdd, 0x16,
- 0x8b, 0xc7, 0xb9, 0xa7, 0x25, 0x01, 0xd8, 0xcd, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x85, 0xa2,
- 0x4f, 0xd1, 0x22, 0x14, 0x00, 0x00,
-}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ context.Context
-var _ grpc.ClientConn
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion4
-
-// TasksClient is the client API for Tasks service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type TasksClient interface {
- // Create a task.
- Create(ctx context.Context, in *CreateTaskRequest, opts ...grpc.CallOption) (*CreateTaskResponse, error)
- // Start a process.
- Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*StartResponse, error)
- // Delete a task and on disk state.
- Delete(ctx context.Context, in *DeleteTaskRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
- DeleteProcess(ctx context.Context, in *DeleteProcessRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
- Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
- List(ctx context.Context, in *ListTasksRequest, opts ...grpc.CallOption) (*ListTasksResponse, error)
- // Kill a task or process.
- Kill(ctx context.Context, in *KillRequest, opts ...grpc.CallOption) (*types1.Empty, error)
- Exec(ctx context.Context, in *ExecProcessRequest, opts ...grpc.CallOption) (*types1.Empty, error)
- ResizePty(ctx context.Context, in *ResizePtyRequest, opts ...grpc.CallOption) (*types1.Empty, error)
- CloseIO(ctx context.Context, in *CloseIORequest, opts ...grpc.CallOption) (*types1.Empty, error)
- Pause(ctx context.Context, in *PauseTaskRequest, opts ...grpc.CallOption) (*types1.Empty, error)
- Resume(ctx context.Context, in *ResumeTaskRequest, opts ...grpc.CallOption) (*types1.Empty, error)
- ListPids(ctx context.Context, in *ListPidsRequest, opts ...grpc.CallOption) (*ListPidsResponse, error)
- Checkpoint(ctx context.Context, in *CheckpointTaskRequest, opts ...grpc.CallOption) (*CheckpointTaskResponse, error)
- Update(ctx context.Context, in *UpdateTaskRequest, opts ...grpc.CallOption) (*types1.Empty, error)
- Metrics(ctx context.Context, in *MetricsRequest, opts ...grpc.CallOption) (*MetricsResponse, error)
- Wait(ctx context.Context, in *WaitRequest, opts ...grpc.CallOption) (*WaitResponse, error)
-}
-
-type tasksClient struct {
- cc *grpc.ClientConn
-}
-
-func NewTasksClient(cc *grpc.ClientConn) TasksClient {
- return &tasksClient{cc}
-}
-
-func (c *tasksClient) Create(ctx context.Context, in *CreateTaskRequest, opts ...grpc.CallOption) (*CreateTaskResponse, error) {
- out := new(CreateTaskResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Create", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *tasksClient) Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*StartResponse, error) {
- out := new(StartResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Start", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *tasksClient) Delete(ctx context.Context, in *DeleteTaskRequest, opts ...grpc.CallOption) (*DeleteResponse, error) {
- out := new(DeleteResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Delete", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *tasksClient) DeleteProcess(ctx context.Context, in *DeleteProcessRequest, opts ...grpc.CallOption) (*DeleteResponse, error) {
- out := new(DeleteResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/DeleteProcess", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *tasksClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) {
- out := new(GetResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Get", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *tasksClient) List(ctx context.Context, in *ListTasksRequest, opts ...grpc.CallOption) (*ListTasksResponse, error) {
- out := new(ListTasksResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/List", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *tasksClient) Kill(ctx context.Context, in *KillRequest, opts ...grpc.CallOption) (*types1.Empty, error) {
- out := new(types1.Empty)
- err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Kill", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *tasksClient) Exec(ctx context.Context, in *ExecProcessRequest, opts ...grpc.CallOption) (*types1.Empty, error) {
- out := new(types1.Empty)
- err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Exec", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *tasksClient) ResizePty(ctx context.Context, in *ResizePtyRequest, opts ...grpc.CallOption) (*types1.Empty, error) {
- out := new(types1.Empty)
- err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/ResizePty", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *tasksClient) CloseIO(ctx context.Context, in *CloseIORequest, opts ...grpc.CallOption) (*types1.Empty, error) {
- out := new(types1.Empty)
- err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/CloseIO", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *tasksClient) Pause(ctx context.Context, in *PauseTaskRequest, opts ...grpc.CallOption) (*types1.Empty, error) {
- out := new(types1.Empty)
- err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Pause", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *tasksClient) Resume(ctx context.Context, in *ResumeTaskRequest, opts ...grpc.CallOption) (*types1.Empty, error) {
- out := new(types1.Empty)
- err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Resume", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *tasksClient) ListPids(ctx context.Context, in *ListPidsRequest, opts ...grpc.CallOption) (*ListPidsResponse, error) {
- out := new(ListPidsResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/ListPids", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *tasksClient) Checkpoint(ctx context.Context, in *CheckpointTaskRequest, opts ...grpc.CallOption) (*CheckpointTaskResponse, error) {
- out := new(CheckpointTaskResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Checkpoint", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *tasksClient) Update(ctx context.Context, in *UpdateTaskRequest, opts ...grpc.CallOption) (*types1.Empty, error) {
- out := new(types1.Empty)
- err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Update", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *tasksClient) Metrics(ctx context.Context, in *MetricsRequest, opts ...grpc.CallOption) (*MetricsResponse, error) {
- out := new(MetricsResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Metrics", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *tasksClient) Wait(ctx context.Context, in *WaitRequest, opts ...grpc.CallOption) (*WaitResponse, error) {
- out := new(WaitResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.tasks.v1.Tasks/Wait", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// TasksServer is the server API for Tasks service.
-type TasksServer interface {
- // Create a task.
- Create(context.Context, *CreateTaskRequest) (*CreateTaskResponse, error)
- // Start a process.
- Start(context.Context, *StartRequest) (*StartResponse, error)
- // Delete a task and on disk state.
- Delete(context.Context, *DeleteTaskRequest) (*DeleteResponse, error)
- DeleteProcess(context.Context, *DeleteProcessRequest) (*DeleteResponse, error)
- Get(context.Context, *GetRequest) (*GetResponse, error)
- List(context.Context, *ListTasksRequest) (*ListTasksResponse, error)
- // Kill a task or process.
- Kill(context.Context, *KillRequest) (*types1.Empty, error)
- Exec(context.Context, *ExecProcessRequest) (*types1.Empty, error)
- ResizePty(context.Context, *ResizePtyRequest) (*types1.Empty, error)
- CloseIO(context.Context, *CloseIORequest) (*types1.Empty, error)
- Pause(context.Context, *PauseTaskRequest) (*types1.Empty, error)
- Resume(context.Context, *ResumeTaskRequest) (*types1.Empty, error)
- ListPids(context.Context, *ListPidsRequest) (*ListPidsResponse, error)
- Checkpoint(context.Context, *CheckpointTaskRequest) (*CheckpointTaskResponse, error)
- Update(context.Context, *UpdateTaskRequest) (*types1.Empty, error)
- Metrics(context.Context, *MetricsRequest) (*MetricsResponse, error)
- Wait(context.Context, *WaitRequest) (*WaitResponse, error)
-}
-
-// UnimplementedTasksServer can be embedded to have forward compatible implementations.
-type UnimplementedTasksServer struct {
-}
-
-func (*UnimplementedTasksServer) Create(ctx context.Context, req *CreateTaskRequest) (*CreateTaskResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
-}
-func (*UnimplementedTasksServer) Start(ctx context.Context, req *StartRequest) (*StartResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Start not implemented")
-}
-func (*UnimplementedTasksServer) Delete(ctx context.Context, req *DeleteTaskRequest) (*DeleteResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
-}
-func (*UnimplementedTasksServer) DeleteProcess(ctx context.Context, req *DeleteProcessRequest) (*DeleteResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method DeleteProcess not implemented")
-}
-func (*UnimplementedTasksServer) Get(ctx context.Context, req *GetRequest) (*GetResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
-}
-func (*UnimplementedTasksServer) List(ctx context.Context, req *ListTasksRequest) (*ListTasksResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
-}
-func (*UnimplementedTasksServer) Kill(ctx context.Context, req *KillRequest) (*types1.Empty, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Kill not implemented")
-}
-func (*UnimplementedTasksServer) Exec(ctx context.Context, req *ExecProcessRequest) (*types1.Empty, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Exec not implemented")
-}
-func (*UnimplementedTasksServer) ResizePty(ctx context.Context, req *ResizePtyRequest) (*types1.Empty, error) {
- return nil, status.Errorf(codes.Unimplemented, "method ResizePty not implemented")
-}
-func (*UnimplementedTasksServer) CloseIO(ctx context.Context, req *CloseIORequest) (*types1.Empty, error) {
- return nil, status.Errorf(codes.Unimplemented, "method CloseIO not implemented")
-}
-func (*UnimplementedTasksServer) Pause(ctx context.Context, req *PauseTaskRequest) (*types1.Empty, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Pause not implemented")
-}
-func (*UnimplementedTasksServer) Resume(ctx context.Context, req *ResumeTaskRequest) (*types1.Empty, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Resume not implemented")
-}
-func (*UnimplementedTasksServer) ListPids(ctx context.Context, req *ListPidsRequest) (*ListPidsResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method ListPids not implemented")
-}
-func (*UnimplementedTasksServer) Checkpoint(ctx context.Context, req *CheckpointTaskRequest) (*CheckpointTaskResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Checkpoint not implemented")
-}
-func (*UnimplementedTasksServer) Update(ctx context.Context, req *UpdateTaskRequest) (*types1.Empty, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
-}
-func (*UnimplementedTasksServer) Metrics(ctx context.Context, req *MetricsRequest) (*MetricsResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Metrics not implemented")
-}
-func (*UnimplementedTasksServer) Wait(ctx context.Context, req *WaitRequest) (*WaitResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Wait not implemented")
-}
-
-func RegisterTasksServer(s *grpc.Server, srv TasksServer) {
- s.RegisterService(&_Tasks_serviceDesc, srv)
-}
-
-func _Tasks_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(CreateTaskRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(TasksServer).Create(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.tasks.v1.Tasks/Create",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(TasksServer).Create(ctx, req.(*CreateTaskRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Tasks_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(StartRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(TasksServer).Start(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.tasks.v1.Tasks/Start",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(TasksServer).Start(ctx, req.(*StartRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Tasks_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(DeleteTaskRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(TasksServer).Delete(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.tasks.v1.Tasks/Delete",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(TasksServer).Delete(ctx, req.(*DeleteTaskRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Tasks_DeleteProcess_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(DeleteProcessRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(TasksServer).DeleteProcess(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.tasks.v1.Tasks/DeleteProcess",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(TasksServer).DeleteProcess(ctx, req.(*DeleteProcessRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Tasks_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(GetRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(TasksServer).Get(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.tasks.v1.Tasks/Get",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(TasksServer).Get(ctx, req.(*GetRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Tasks_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(ListTasksRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(TasksServer).List(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.tasks.v1.Tasks/List",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(TasksServer).List(ctx, req.(*ListTasksRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Tasks_Kill_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(KillRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(TasksServer).Kill(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.tasks.v1.Tasks/Kill",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(TasksServer).Kill(ctx, req.(*KillRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Tasks_Exec_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(ExecProcessRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(TasksServer).Exec(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.tasks.v1.Tasks/Exec",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(TasksServer).Exec(ctx, req.(*ExecProcessRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Tasks_ResizePty_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(ResizePtyRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(TasksServer).ResizePty(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.tasks.v1.Tasks/ResizePty",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(TasksServer).ResizePty(ctx, req.(*ResizePtyRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Tasks_CloseIO_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(CloseIORequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(TasksServer).CloseIO(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.tasks.v1.Tasks/CloseIO",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(TasksServer).CloseIO(ctx, req.(*CloseIORequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Tasks_Pause_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(PauseTaskRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(TasksServer).Pause(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.tasks.v1.Tasks/Pause",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(TasksServer).Pause(ctx, req.(*PauseTaskRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Tasks_Resume_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(ResumeTaskRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(TasksServer).Resume(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.tasks.v1.Tasks/Resume",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(TasksServer).Resume(ctx, req.(*ResumeTaskRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Tasks_ListPids_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(ListPidsRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(TasksServer).ListPids(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.tasks.v1.Tasks/ListPids",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(TasksServer).ListPids(ctx, req.(*ListPidsRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Tasks_Checkpoint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(CheckpointTaskRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(TasksServer).Checkpoint(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.tasks.v1.Tasks/Checkpoint",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(TasksServer).Checkpoint(ctx, req.(*CheckpointTaskRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Tasks_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(UpdateTaskRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(TasksServer).Update(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.tasks.v1.Tasks/Update",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(TasksServer).Update(ctx, req.(*UpdateTaskRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Tasks_Metrics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(MetricsRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(TasksServer).Metrics(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.tasks.v1.Tasks/Metrics",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(TasksServer).Metrics(ctx, req.(*MetricsRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-func _Tasks_Wait_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(WaitRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(TasksServer).Wait(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.tasks.v1.Tasks/Wait",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(TasksServer).Wait(ctx, req.(*WaitRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-var _Tasks_serviceDesc = grpc.ServiceDesc{
- ServiceName: "containerd.services.tasks.v1.Tasks",
- HandlerType: (*TasksServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "Create",
- Handler: _Tasks_Create_Handler,
- },
- {
- MethodName: "Start",
- Handler: _Tasks_Start_Handler,
- },
- {
- MethodName: "Delete",
- Handler: _Tasks_Delete_Handler,
- },
- {
- MethodName: "DeleteProcess",
- Handler: _Tasks_DeleteProcess_Handler,
- },
- {
- MethodName: "Get",
- Handler: _Tasks_Get_Handler,
- },
- {
- MethodName: "List",
- Handler: _Tasks_List_Handler,
- },
- {
- MethodName: "Kill",
- Handler: _Tasks_Kill_Handler,
- },
- {
- MethodName: "Exec",
- Handler: _Tasks_Exec_Handler,
- },
- {
- MethodName: "ResizePty",
- Handler: _Tasks_ResizePty_Handler,
- },
- {
- MethodName: "CloseIO",
- Handler: _Tasks_CloseIO_Handler,
- },
- {
- MethodName: "Pause",
- Handler: _Tasks_Pause_Handler,
- },
- {
- MethodName: "Resume",
- Handler: _Tasks_Resume_Handler,
- },
- {
- MethodName: "ListPids",
- Handler: _Tasks_ListPids_Handler,
- },
- {
- MethodName: "Checkpoint",
- Handler: _Tasks_Checkpoint_Handler,
- },
- {
- MethodName: "Update",
- Handler: _Tasks_Update_Handler,
- },
- {
- MethodName: "Metrics",
- Handler: _Tasks_Metrics_Handler,
- },
- {
- MethodName: "Wait",
- Handler: _Tasks_Wait_Handler,
- },
- },
- Streams: []grpc.StreamDesc{},
- Metadata: "github.com/containerd/containerd/api/services/tasks/v1/tasks.proto",
-}
-
-func (m *CreateTaskRequest) 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 *CreateTaskRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *CreateTaskRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Options != nil {
- {
- size, err := m.Options.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintTasks(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x4a
- }
- if m.Checkpoint != nil {
- {
- size, err := m.Checkpoint.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintTasks(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x42
- }
- if m.Terminal {
- i--
- if m.Terminal {
- dAtA[i] = 1
- } else {
- dAtA[i] = 0
- }
- i--
- dAtA[i] = 0x38
- }
- if len(m.Stderr) > 0 {
- i -= len(m.Stderr)
- copy(dAtA[i:], m.Stderr)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.Stderr)))
- i--
- dAtA[i] = 0x32
- }
- if len(m.Stdout) > 0 {
- i -= len(m.Stdout)
- copy(dAtA[i:], m.Stdout)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.Stdout)))
- i--
- dAtA[i] = 0x2a
- }
- if len(m.Stdin) > 0 {
- i -= len(m.Stdin)
- copy(dAtA[i:], m.Stdin)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.Stdin)))
- i--
- dAtA[i] = 0x22
- }
- if len(m.Rootfs) > 0 {
- for iNdEx := len(m.Rootfs) - 1; iNdEx >= 0; iNdEx-- {
- {
- size, err := m.Rootfs[iNdEx].MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintTasks(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x1a
- }
- }
- if len(m.ContainerID) > 0 {
- i -= len(m.ContainerID)
- copy(dAtA[i:], m.ContainerID)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.ContainerID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *CreateTaskResponse) 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 *CreateTaskResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *CreateTaskResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Pid != 0 {
- i = encodeVarintTasks(dAtA, i, uint64(m.Pid))
- i--
- dAtA[i] = 0x10
- }
- if len(m.ContainerID) > 0 {
- i -= len(m.ContainerID)
- copy(dAtA[i:], m.ContainerID)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.ContainerID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *StartRequest) 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 *StartRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *StartRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.ExecID) > 0 {
- i -= len(m.ExecID)
- copy(dAtA[i:], m.ExecID)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.ExecID)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.ContainerID) > 0 {
- i -= len(m.ContainerID)
- copy(dAtA[i:], m.ContainerID)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.ContainerID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *StartResponse) 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 *StartResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *StartResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Pid != 0 {
- i = encodeVarintTasks(dAtA, i, uint64(m.Pid))
- i--
- dAtA[i] = 0x8
- }
- return len(dAtA) - i, nil
-}
-
-func (m *DeleteTaskRequest) 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 *DeleteTaskRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *DeleteTaskRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.ContainerID) > 0 {
- i -= len(m.ContainerID)
- copy(dAtA[i:], m.ContainerID)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.ContainerID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *DeleteResponse) 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 *DeleteResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *DeleteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt):])
- if err3 != nil {
- return 0, err3
- }
- i -= n3
- i = encodeVarintTasks(dAtA, i, uint64(n3))
- i--
- dAtA[i] = 0x22
- if m.ExitStatus != 0 {
- i = encodeVarintTasks(dAtA, i, uint64(m.ExitStatus))
- i--
- dAtA[i] = 0x18
- }
- if m.Pid != 0 {
- i = encodeVarintTasks(dAtA, i, uint64(m.Pid))
- i--
- dAtA[i] = 0x10
- }
- if len(m.ID) > 0 {
- i -= len(m.ID)
- copy(dAtA[i:], m.ID)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.ID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *DeleteProcessRequest) 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 *DeleteProcessRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *DeleteProcessRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.ExecID) > 0 {
- i -= len(m.ExecID)
- copy(dAtA[i:], m.ExecID)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.ExecID)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.ContainerID) > 0 {
- i -= len(m.ContainerID)
- copy(dAtA[i:], m.ContainerID)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.ContainerID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *GetRequest) 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 *GetRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *GetRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.ExecID) > 0 {
- i -= len(m.ExecID)
- copy(dAtA[i:], m.ExecID)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.ExecID)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.ContainerID) > 0 {
- i -= len(m.ContainerID)
- copy(dAtA[i:], m.ContainerID)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.ContainerID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *GetResponse) 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 *GetResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *GetResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Process != nil {
- {
- size, err := m.Process.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintTasks(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ListTasksRequest) 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 *ListTasksRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ListTasksRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Filter) > 0 {
- i -= len(m.Filter)
- copy(dAtA[i:], m.Filter)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.Filter)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ListTasksResponse) 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 *ListTasksResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ListTasksResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Tasks) > 0 {
- for iNdEx := len(m.Tasks) - 1; iNdEx >= 0; iNdEx-- {
- {
- size, err := m.Tasks[iNdEx].MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintTasks(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- }
- }
- return len(dAtA) - i, nil
-}
-
-func (m *KillRequest) 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 *KillRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *KillRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.All {
- i--
- if m.All {
- dAtA[i] = 1
- } else {
- dAtA[i] = 0
- }
- i--
- dAtA[i] = 0x20
- }
- if m.Signal != 0 {
- i = encodeVarintTasks(dAtA, i, uint64(m.Signal))
- i--
- dAtA[i] = 0x18
- }
- if len(m.ExecID) > 0 {
- i -= len(m.ExecID)
- copy(dAtA[i:], m.ExecID)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.ExecID)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.ContainerID) > 0 {
- i -= len(m.ContainerID)
- copy(dAtA[i:], m.ContainerID)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.ContainerID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ExecProcessRequest) 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 *ExecProcessRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ExecProcessRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.ExecID) > 0 {
- i -= len(m.ExecID)
- copy(dAtA[i:], m.ExecID)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.ExecID)))
- i--
- dAtA[i] = 0x3a
- }
- if m.Spec != nil {
- {
- size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintTasks(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x32
- }
- if m.Terminal {
- i--
- if m.Terminal {
- dAtA[i] = 1
- } else {
- dAtA[i] = 0
- }
- i--
- dAtA[i] = 0x28
- }
- if len(m.Stderr) > 0 {
- i -= len(m.Stderr)
- copy(dAtA[i:], m.Stderr)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.Stderr)))
- i--
- dAtA[i] = 0x22
- }
- if len(m.Stdout) > 0 {
- i -= len(m.Stdout)
- copy(dAtA[i:], m.Stdout)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.Stdout)))
- i--
- dAtA[i] = 0x1a
- }
- if len(m.Stdin) > 0 {
- i -= len(m.Stdin)
- copy(dAtA[i:], m.Stdin)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.Stdin)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.ContainerID) > 0 {
- i -= len(m.ContainerID)
- copy(dAtA[i:], m.ContainerID)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.ContainerID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ExecProcessResponse) 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 *ExecProcessResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ExecProcessResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ResizePtyRequest) 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 *ResizePtyRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ResizePtyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Height != 0 {
- i = encodeVarintTasks(dAtA, i, uint64(m.Height))
- i--
- dAtA[i] = 0x20
- }
- if m.Width != 0 {
- i = encodeVarintTasks(dAtA, i, uint64(m.Width))
- i--
- dAtA[i] = 0x18
- }
- if len(m.ExecID) > 0 {
- i -= len(m.ExecID)
- copy(dAtA[i:], m.ExecID)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.ExecID)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.ContainerID) > 0 {
- i -= len(m.ContainerID)
- copy(dAtA[i:], m.ContainerID)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.ContainerID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *CloseIORequest) 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 *CloseIORequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *CloseIORequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Stdin {
- i--
- if m.Stdin {
- dAtA[i] = 1
- } else {
- dAtA[i] = 0
- }
- i--
- dAtA[i] = 0x18
- }
- if len(m.ExecID) > 0 {
- i -= len(m.ExecID)
- copy(dAtA[i:], m.ExecID)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.ExecID)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.ContainerID) > 0 {
- i -= len(m.ContainerID)
- copy(dAtA[i:], m.ContainerID)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.ContainerID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *PauseTaskRequest) 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 *PauseTaskRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *PauseTaskRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.ContainerID) > 0 {
- i -= len(m.ContainerID)
- copy(dAtA[i:], m.ContainerID)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.ContainerID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ResumeTaskRequest) 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 *ResumeTaskRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ResumeTaskRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.ContainerID) > 0 {
- i -= len(m.ContainerID)
- copy(dAtA[i:], m.ContainerID)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.ContainerID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ListPidsRequest) 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 *ListPidsRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ListPidsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.ContainerID) > 0 {
- i -= len(m.ContainerID)
- copy(dAtA[i:], m.ContainerID)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.ContainerID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ListPidsResponse) 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 *ListPidsResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ListPidsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Processes) > 0 {
- for iNdEx := len(m.Processes) - 1; iNdEx >= 0; iNdEx-- {
- {
- size, err := m.Processes[iNdEx].MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintTasks(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- }
- }
- return len(dAtA) - i, nil
-}
-
-func (m *CheckpointTaskRequest) 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 *CheckpointTaskRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *CheckpointTaskRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Options != nil {
- {
- size, err := m.Options.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintTasks(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x1a
- }
- if len(m.ParentCheckpoint) > 0 {
- i -= len(m.ParentCheckpoint)
- copy(dAtA[i:], m.ParentCheckpoint)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.ParentCheckpoint)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.ContainerID) > 0 {
- i -= len(m.ContainerID)
- copy(dAtA[i:], m.ContainerID)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.ContainerID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *CheckpointTaskResponse) 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 *CheckpointTaskResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *CheckpointTaskResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Descriptors) > 0 {
- for iNdEx := len(m.Descriptors) - 1; iNdEx >= 0; iNdEx-- {
- {
- size, err := m.Descriptors[iNdEx].MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintTasks(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- }
- }
- return len(dAtA) - i, nil
-}
-
-func (m *UpdateTaskRequest) 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 *UpdateTaskRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *UpdateTaskRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Resources != nil {
- {
- size, err := m.Resources.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintTasks(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x12
- }
- if len(m.ContainerID) > 0 {
- i -= len(m.ContainerID)
- copy(dAtA[i:], m.ContainerID)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.ContainerID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *MetricsRequest) 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 *MetricsRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *MetricsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Filters) > 0 {
- for iNdEx := len(m.Filters) - 1; iNdEx >= 0; iNdEx-- {
- i -= len(m.Filters[iNdEx])
- copy(dAtA[i:], m.Filters[iNdEx])
- i = encodeVarintTasks(dAtA, i, uint64(len(m.Filters[iNdEx])))
- i--
- dAtA[i] = 0xa
- }
- }
- return len(dAtA) - i, nil
-}
-
-func (m *MetricsResponse) 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 *MetricsResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *MetricsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Metrics) > 0 {
- for iNdEx := len(m.Metrics) - 1; iNdEx >= 0; iNdEx-- {
- {
- size, err := m.Metrics[iNdEx].MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintTasks(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- }
- }
- return len(dAtA) - i, nil
-}
-
-func (m *WaitRequest) 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 *WaitRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *WaitRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.ExecID) > 0 {
- i -= len(m.ExecID)
- copy(dAtA[i:], m.ExecID)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.ExecID)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.ContainerID) > 0 {
- i -= len(m.ContainerID)
- copy(dAtA[i:], m.ContainerID)
- i = encodeVarintTasks(dAtA, i, uint64(len(m.ContainerID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *WaitResponse) 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 *WaitResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *WaitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- n8, err8 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt):])
- if err8 != nil {
- return 0, err8
- }
- i -= n8
- i = encodeVarintTasks(dAtA, i, uint64(n8))
- i--
- dAtA[i] = 0x12
- if m.ExitStatus != 0 {
- i = encodeVarintTasks(dAtA, i, uint64(m.ExitStatus))
- i--
- dAtA[i] = 0x8
- }
- return len(dAtA) - i, nil
-}
-
-func encodeVarintTasks(dAtA []byte, offset int, v uint64) int {
- offset -= sovTasks(v)
- base := offset
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return base
-}
-func (m *CreateTaskRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ContainerID)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- if len(m.Rootfs) > 0 {
- for _, e := range m.Rootfs {
- l = e.Size()
- n += 1 + l + sovTasks(uint64(l))
- }
- }
- l = len(m.Stdin)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- l = len(m.Stdout)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- l = len(m.Stderr)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- if m.Terminal {
- n += 2
- }
- if m.Checkpoint != nil {
- l = m.Checkpoint.Size()
- n += 1 + l + sovTasks(uint64(l))
- }
- if m.Options != nil {
- l = m.Options.Size()
- n += 1 + l + sovTasks(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *CreateTaskResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ContainerID)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- if m.Pid != 0 {
- n += 1 + sovTasks(uint64(m.Pid))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *StartRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ContainerID)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- l = len(m.ExecID)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *StartResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Pid != 0 {
- n += 1 + sovTasks(uint64(m.Pid))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *DeleteTaskRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ContainerID)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *DeleteResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ID)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- if m.Pid != 0 {
- n += 1 + sovTasks(uint64(m.Pid))
- }
- if m.ExitStatus != 0 {
- n += 1 + sovTasks(uint64(m.ExitStatus))
- }
- l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt)
- n += 1 + l + sovTasks(uint64(l))
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *DeleteProcessRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ContainerID)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- l = len(m.ExecID)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *GetRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ContainerID)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- l = len(m.ExecID)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *GetResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Process != nil {
- l = m.Process.Size()
- n += 1 + l + sovTasks(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ListTasksRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Filter)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ListTasksResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.Tasks) > 0 {
- for _, e := range m.Tasks {
- l = e.Size()
- n += 1 + l + sovTasks(uint64(l))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *KillRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ContainerID)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- l = len(m.ExecID)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- if m.Signal != 0 {
- n += 1 + sovTasks(uint64(m.Signal))
- }
- if m.All {
- n += 2
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ExecProcessRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ContainerID)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- l = len(m.Stdin)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- l = len(m.Stdout)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- l = len(m.Stderr)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- if m.Terminal {
- n += 2
- }
- if m.Spec != nil {
- l = m.Spec.Size()
- n += 1 + l + sovTasks(uint64(l))
- }
- l = len(m.ExecID)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ExecProcessResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ResizePtyRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ContainerID)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- l = len(m.ExecID)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- if m.Width != 0 {
- n += 1 + sovTasks(uint64(m.Width))
- }
- if m.Height != 0 {
- n += 1 + sovTasks(uint64(m.Height))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *CloseIORequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ContainerID)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- l = len(m.ExecID)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- if m.Stdin {
- n += 2
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *PauseTaskRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ContainerID)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ResumeTaskRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ContainerID)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ListPidsRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ContainerID)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ListPidsResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.Processes) > 0 {
- for _, e := range m.Processes {
- l = e.Size()
- n += 1 + l + sovTasks(uint64(l))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *CheckpointTaskRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ContainerID)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- l = len(m.ParentCheckpoint)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- if m.Options != nil {
- l = m.Options.Size()
- n += 1 + l + sovTasks(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *CheckpointTaskResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.Descriptors) > 0 {
- for _, e := range m.Descriptors {
- l = e.Size()
- n += 1 + l + sovTasks(uint64(l))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *UpdateTaskRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ContainerID)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- if m.Resources != nil {
- l = m.Resources.Size()
- n += 1 + l + sovTasks(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *MetricsRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.Filters) > 0 {
- for _, s := range m.Filters {
- l = len(s)
- n += 1 + l + sovTasks(uint64(l))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *MetricsResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if len(m.Metrics) > 0 {
- for _, e := range m.Metrics {
- l = e.Size()
- n += 1 + l + sovTasks(uint64(l))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *WaitRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ContainerID)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- l = len(m.ExecID)
- if l > 0 {
- n += 1 + l + sovTasks(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *WaitResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.ExitStatus != 0 {
- n += 1 + sovTasks(uint64(m.ExitStatus))
- }
- l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt)
- n += 1 + l + sovTasks(uint64(l))
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func sovTasks(x uint64) (n int) {
- return (math_bits.Len64(x|1) + 6) / 7
-}
-func sozTasks(x uint64) (n int) {
- return sovTasks(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-func (this *CreateTaskRequest) String() string {
- if this == nil {
- return "nil"
- }
- repeatedStringForRootfs := "[]*Mount{"
- for _, f := range this.Rootfs {
- repeatedStringForRootfs += strings.Replace(fmt.Sprintf("%v", f), "Mount", "types.Mount", 1) + ","
- }
- repeatedStringForRootfs += "}"
- s := strings.Join([]string{`&CreateTaskRequest{`,
- `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
- `Rootfs:` + repeatedStringForRootfs + `,`,
- `Stdin:` + fmt.Sprintf("%v", this.Stdin) + `,`,
- `Stdout:` + fmt.Sprintf("%v", this.Stdout) + `,`,
- `Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`,
- `Terminal:` + fmt.Sprintf("%v", this.Terminal) + `,`,
- `Checkpoint:` + strings.Replace(fmt.Sprintf("%v", this.Checkpoint), "Descriptor", "types.Descriptor", 1) + `,`,
- `Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "Any", "types1.Any", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *CreateTaskResponse) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&CreateTaskResponse{`,
- `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
- `Pid:` + fmt.Sprintf("%v", this.Pid) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *StartRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&StartRequest{`,
- `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
- `ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *StartResponse) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&StartResponse{`,
- `Pid:` + fmt.Sprintf("%v", this.Pid) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *DeleteTaskRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&DeleteTaskRequest{`,
- `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *DeleteResponse) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&DeleteResponse{`,
- `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
- `Pid:` + fmt.Sprintf("%v", this.Pid) + `,`,
- `ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`,
- `ExitedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ExitedAt), "Timestamp", "types1.Timestamp", 1), `&`, ``, 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *DeleteProcessRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&DeleteProcessRequest{`,
- `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
- `ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *GetRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&GetRequest{`,
- `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
- `ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *GetResponse) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&GetResponse{`,
- `Process:` + strings.Replace(fmt.Sprintf("%v", this.Process), "Process", "task.Process", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ListTasksRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ListTasksRequest{`,
- `Filter:` + fmt.Sprintf("%v", this.Filter) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ListTasksResponse) String() string {
- if this == nil {
- return "nil"
- }
- repeatedStringForTasks := "[]*Process{"
- for _, f := range this.Tasks {
- repeatedStringForTasks += strings.Replace(fmt.Sprintf("%v", f), "Process", "task.Process", 1) + ","
- }
- repeatedStringForTasks += "}"
- s := strings.Join([]string{`&ListTasksResponse{`,
- `Tasks:` + repeatedStringForTasks + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *KillRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&KillRequest{`,
- `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
- `ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`,
- `Signal:` + fmt.Sprintf("%v", this.Signal) + `,`,
- `All:` + fmt.Sprintf("%v", this.All) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ExecProcessRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ExecProcessRequest{`,
- `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
- `Stdin:` + fmt.Sprintf("%v", this.Stdin) + `,`,
- `Stdout:` + fmt.Sprintf("%v", this.Stdout) + `,`,
- `Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`,
- `Terminal:` + fmt.Sprintf("%v", this.Terminal) + `,`,
- `Spec:` + strings.Replace(fmt.Sprintf("%v", this.Spec), "Any", "types1.Any", 1) + `,`,
- `ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ExecProcessResponse) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ExecProcessResponse{`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ResizePtyRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ResizePtyRequest{`,
- `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
- `ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`,
- `Width:` + fmt.Sprintf("%v", this.Width) + `,`,
- `Height:` + fmt.Sprintf("%v", this.Height) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *CloseIORequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&CloseIORequest{`,
- `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
- `ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`,
- `Stdin:` + fmt.Sprintf("%v", this.Stdin) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *PauseTaskRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&PauseTaskRequest{`,
- `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ResumeTaskRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ResumeTaskRequest{`,
- `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ListPidsRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ListPidsRequest{`,
- `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ListPidsResponse) String() string {
- if this == nil {
- return "nil"
- }
- repeatedStringForProcesses := "[]*ProcessInfo{"
- for _, f := range this.Processes {
- repeatedStringForProcesses += strings.Replace(fmt.Sprintf("%v", f), "ProcessInfo", "task.ProcessInfo", 1) + ","
- }
- repeatedStringForProcesses += "}"
- s := strings.Join([]string{`&ListPidsResponse{`,
- `Processes:` + repeatedStringForProcesses + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *CheckpointTaskRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&CheckpointTaskRequest{`,
- `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
- `ParentCheckpoint:` + fmt.Sprintf("%v", this.ParentCheckpoint) + `,`,
- `Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "Any", "types1.Any", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *CheckpointTaskResponse) String() string {
- if this == nil {
- return "nil"
- }
- repeatedStringForDescriptors := "[]*Descriptor{"
- for _, f := range this.Descriptors {
- repeatedStringForDescriptors += strings.Replace(fmt.Sprintf("%v", f), "Descriptor", "types.Descriptor", 1) + ","
- }
- repeatedStringForDescriptors += "}"
- s := strings.Join([]string{`&CheckpointTaskResponse{`,
- `Descriptors:` + repeatedStringForDescriptors + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *UpdateTaskRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&UpdateTaskRequest{`,
- `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
- `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "Any", "types1.Any", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *MetricsRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&MetricsRequest{`,
- `Filters:` + fmt.Sprintf("%v", this.Filters) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *MetricsResponse) String() string {
- if this == nil {
- return "nil"
- }
- repeatedStringForMetrics := "[]*Metric{"
- for _, f := range this.Metrics {
- repeatedStringForMetrics += strings.Replace(fmt.Sprintf("%v", f), "Metric", "types.Metric", 1) + ","
- }
- repeatedStringForMetrics += "}"
- s := strings.Join([]string{`&MetricsResponse{`,
- `Metrics:` + repeatedStringForMetrics + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *WaitRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&WaitRequest{`,
- `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
- `ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *WaitResponse) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&WaitResponse{`,
- `ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`,
- `ExitedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ExitedAt), "Timestamp", "types1.Timestamp", 1), `&`, ``, 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func valueToStringTasks(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
-}
-func (m *CreateTaskRequest) 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 ErrIntOverflowTasks
- }
- 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: CreateTaskRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: CreateTaskRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ContainerID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Rootfs", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthTasks
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Rootfs = append(m.Rootfs, &types.Mount{})
- if err := m.Rootfs[len(m.Rootfs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 4:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Stdin", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Stdin = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 5:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Stdout", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Stdout = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 6:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Stderr", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Stderr = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 7:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Terminal", wireType)
- }
- var v int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.Terminal = bool(v != 0)
- case 8:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Checkpoint", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthTasks
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Checkpoint == nil {
- m.Checkpoint = &types.Descriptor{}
- }
- if err := m.Checkpoint.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 9:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthTasks
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Options == nil {
- m.Options = &types1.Any{}
- }
- if err := m.Options.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTasks(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *CreateTaskResponse) 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 ErrIntOverflowTasks
- }
- 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: CreateTaskResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: CreateTaskResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ContainerID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- 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 ErrIntOverflowTasks
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Pid |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipTasks(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *StartRequest) 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 ErrIntOverflowTasks
- }
- 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: StartRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: StartRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ContainerID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ExecID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ExecID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTasks(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *StartResponse) 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 ErrIntOverflowTasks
- }
- 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: StartResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: StartResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- 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 ErrIntOverflowTasks
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Pid |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipTasks(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *DeleteTaskRequest) 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 ErrIntOverflowTasks
- }
- 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: DeleteTaskRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: DeleteTaskRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ContainerID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTasks(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *DeleteResponse) 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 ErrIntOverflowTasks
- }
- 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: DeleteResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: DeleteResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- 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 ErrIntOverflowTasks
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Pid |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field ExitStatus", wireType)
- }
- m.ExitStatus = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.ExitStatus |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ExitedAt", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthTasks
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ExitedAt, dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTasks(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *DeleteProcessRequest) 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 ErrIntOverflowTasks
- }
- 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: DeleteProcessRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: DeleteProcessRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ContainerID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ExecID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ExecID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTasks(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *GetRequest) 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 ErrIntOverflowTasks
- }
- 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: GetRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: GetRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ContainerID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ExecID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ExecID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTasks(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *GetResponse) 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 ErrIntOverflowTasks
- }
- 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: GetResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: GetResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- 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 ErrIntOverflowTasks
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthTasks
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Process == nil {
- m.Process = &task.Process{}
- }
- if err := m.Process.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTasks(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ListTasksRequest) 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 ErrIntOverflowTasks
- }
- 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: ListTasksRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ListTasksRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Filter = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTasks(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ListTasksResponse) 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 ErrIntOverflowTasks
- }
- 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: ListTasksResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ListTasksResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Tasks", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthTasks
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Tasks = append(m.Tasks, &task.Process{})
- if err := m.Tasks[len(m.Tasks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTasks(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *KillRequest) 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 ErrIntOverflowTasks
- }
- 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: KillRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: KillRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ContainerID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ExecID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ExecID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Signal", wireType)
- }
- m.Signal = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Signal |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field All", wireType)
- }
- var v int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.All = bool(v != 0)
- default:
- iNdEx = preIndex
- skippy, err := skipTasks(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ExecProcessRequest) 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 ErrIntOverflowTasks
- }
- 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: ExecProcessRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ExecProcessRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ContainerID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Stdin", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Stdin = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Stdout", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Stdout = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 4:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Stderr", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Stderr = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 5:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Terminal", wireType)
- }
- var v int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.Terminal = bool(v != 0)
- case 6:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthTasks
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Spec == nil {
- m.Spec = &types1.Any{}
- }
- if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 7:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ExecID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ExecID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTasks(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ExecProcessResponse) 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 ErrIntOverflowTasks
- }
- 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: ExecProcessResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ExecProcessResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- default:
- iNdEx = preIndex
- skippy, err := skipTasks(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ResizePtyRequest) 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 ErrIntOverflowTasks
- }
- 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: ResizePtyRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ResizePtyRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ContainerID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ExecID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ExecID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Width", wireType)
- }
- m.Width = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Width |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType)
- }
- m.Height = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Height |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- default:
- iNdEx = preIndex
- skippy, err := skipTasks(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *CloseIORequest) 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 ErrIntOverflowTasks
- }
- 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: CloseIORequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: CloseIORequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ContainerID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ExecID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ExecID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Stdin", wireType)
- }
- var v int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.Stdin = bool(v != 0)
- default:
- iNdEx = preIndex
- skippy, err := skipTasks(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *PauseTaskRequest) 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 ErrIntOverflowTasks
- }
- 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: PauseTaskRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: PauseTaskRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ContainerID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTasks(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ResumeTaskRequest) 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 ErrIntOverflowTasks
- }
- 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: ResumeTaskRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ResumeTaskRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ContainerID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTasks(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ListPidsRequest) 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 ErrIntOverflowTasks
- }
- 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: ListPidsRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ListPidsRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ContainerID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTasks(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ListPidsResponse) 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 ErrIntOverflowTasks
- }
- 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: ListPidsResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ListPidsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Processes", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthTasks
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Processes = append(m.Processes, &task.ProcessInfo{})
- if err := m.Processes[len(m.Processes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTasks(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *CheckpointTaskRequest) 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 ErrIntOverflowTasks
- }
- 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: CheckpointTaskRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: CheckpointTaskRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ContainerID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ParentCheckpoint", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ParentCheckpoint = github_com_opencontainers_go_digest.Digest(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthTasks
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Options == nil {
- m.Options = &types1.Any{}
- }
- if err := m.Options.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTasks(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *CheckpointTaskResponse) 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 ErrIntOverflowTasks
- }
- 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: CheckpointTaskResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: CheckpointTaskResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Descriptors", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthTasks
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Descriptors = append(m.Descriptors, &types.Descriptor{})
- if err := m.Descriptors[len(m.Descriptors)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTasks(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *UpdateTaskRequest) 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 ErrIntOverflowTasks
- }
- 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: UpdateTaskRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: UpdateTaskRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ContainerID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthTasks
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Resources == nil {
- m.Resources = &types1.Any{}
- }
- if err := m.Resources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTasks(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *MetricsRequest) 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 ErrIntOverflowTasks
- }
- 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: MetricsRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: MetricsRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Filters = append(m.Filters, string(dAtA[iNdEx:postIndex]))
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTasks(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *MetricsResponse) 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 ErrIntOverflowTasks
- }
- 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: MetricsResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: MetricsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Metrics", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthTasks
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Metrics = append(m.Metrics, &types.Metric{})
- if err := m.Metrics[len(m.Metrics)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTasks(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *WaitRequest) 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 ErrIntOverflowTasks
- }
- 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: WaitRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: WaitRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ContainerID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ExecID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- 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 ErrInvalidLengthTasks
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ExecID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTasks(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *WaitResponse) 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 ErrIntOverflowTasks
- }
- 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: WaitResponse: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: WaitResponse: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field ExitStatus", wireType)
- }
- m.ExitStatus = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.ExitStatus |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ExitedAt", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTasks
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthTasks
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthTasks
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ExitedAt, dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTasks(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTasks
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func skipTasks(dAtA []byte) (n int, err error) {
- l := len(dAtA)
- iNdEx := 0
- depth := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowTasks
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowTasks
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if dAtA[iNdEx-1] < 0x80 {
- break
- }
- }
- case 1:
- iNdEx += 8
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowTasks
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if length < 0 {
- return 0, ErrInvalidLengthTasks
- }
- iNdEx += length
- case 3:
- depth++
- case 4:
- if depth == 0 {
- return 0, ErrUnexpectedEndOfGroupTasks
- }
- depth--
- case 5:
- iNdEx += 4
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- if iNdEx < 0 {
- return 0, ErrInvalidLengthTasks
- }
- if depth == 0 {
- return iNdEx, nil
- }
- }
- return 0, io.ErrUnexpectedEOF
-}
-
-var (
- ErrInvalidLengthTasks = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowTasks = fmt.Errorf("proto: integer overflow")
- ErrUnexpectedEndOfGroupTasks = fmt.Errorf("proto: unexpected end of group")
-)
diff --git a/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks.proto b/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks.proto
deleted file mode 100644
index 90793cbab..000000000
--- a/vendor/github.com/containerd/containerd/api/services/tasks/v1/tasks.proto
+++ /dev/null
@@ -1,209 +0,0 @@
-syntax = "proto3";
-
-package containerd.services.tasks.v1;
-
-import "google/protobuf/empty.proto";
-import "google/protobuf/any.proto";
-import weak "gogoproto/gogo.proto";
-import "github.com/containerd/containerd/api/types/mount.proto";
-import "github.com/containerd/containerd/api/types/metrics.proto";
-import "github.com/containerd/containerd/api/types/descriptor.proto";
-import "github.com/containerd/containerd/api/types/task/task.proto";
-import "google/protobuf/timestamp.proto";
-
-option go_package = "github.com/containerd/containerd/api/services/tasks/v1;tasks";
-
-service Tasks {
- // Create a task.
- rpc Create(CreateTaskRequest) returns (CreateTaskResponse);
-
- // Start a process.
- rpc Start(StartRequest) returns (StartResponse);
-
- // Delete a task and on disk state.
- rpc Delete(DeleteTaskRequest) returns (DeleteResponse);
-
- rpc DeleteProcess(DeleteProcessRequest) returns (DeleteResponse);
-
- rpc Get(GetRequest) returns (GetResponse);
-
- rpc List(ListTasksRequest) returns (ListTasksResponse);
-
- // Kill a task or process.
- rpc Kill(KillRequest) returns (google.protobuf.Empty);
-
- rpc Exec(ExecProcessRequest) returns (google.protobuf.Empty);
-
- rpc ResizePty(ResizePtyRequest) returns (google.protobuf.Empty);
-
- rpc CloseIO(CloseIORequest) returns (google.protobuf.Empty);
-
- rpc Pause(PauseTaskRequest) returns (google.protobuf.Empty);
-
- rpc Resume(ResumeTaskRequest) returns (google.protobuf.Empty);
-
- rpc ListPids(ListPidsRequest) returns (ListPidsResponse);
-
- rpc Checkpoint(CheckpointTaskRequest) returns (CheckpointTaskResponse);
-
- rpc Update(UpdateTaskRequest) returns (google.protobuf.Empty);
-
- rpc Metrics(MetricsRequest) returns (MetricsResponse);
-
- rpc Wait(WaitRequest) returns (WaitResponse);
-}
-
-message CreateTaskRequest {
- string container_id = 1;
-
- // RootFS provides the pre-chroot mounts to perform in the shim before
- // executing the container task.
- //
- // These are for mounts that cannot be performed in the user namespace.
- // Typically, these mounts should be resolved from snapshots specified on
- // the container object.
- repeated containerd.types.Mount rootfs = 3;
-
- string stdin = 4;
- string stdout = 5;
- string stderr = 6;
- bool terminal = 7;
-
- containerd.types.Descriptor checkpoint = 8;
-
- google.protobuf.Any options = 9;
-}
-
-message CreateTaskResponse {
- string container_id = 1;
- uint32 pid = 2;
-}
-
-message StartRequest {
- string container_id = 1;
- string exec_id = 2;
-}
-
-message StartResponse {
- uint32 pid = 1;
-}
-
-message DeleteTaskRequest {
- string container_id = 1;
-}
-
-message DeleteResponse {
- string id = 1;
- uint32 pid = 2;
- uint32 exit_status = 3;
- google.protobuf.Timestamp exited_at = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
-}
-
-message DeleteProcessRequest {
- string container_id = 1;
- string exec_id = 2;
-}
-
-message GetRequest {
- string container_id = 1;
- string exec_id = 2;
-}
-
-message GetResponse {
- containerd.v1.types.Process process = 1;
-}
-
-message ListTasksRequest {
- string filter = 1;
-}
-
-message ListTasksResponse {
- repeated containerd.v1.types.Process tasks = 1;
-}
-
-message KillRequest {
- string container_id = 1;
- string exec_id = 2;
- uint32 signal = 3;
- bool all = 4;
-}
-
-message ExecProcessRequest {
- string container_id = 1;
- string stdin = 2;
- string stdout = 3;
- string stderr = 4;
- bool terminal = 5;
- // Spec for starting a process in the target container.
- //
- // For runc, this is a process spec, for example.
- google.protobuf.Any spec = 6;
- // id of the exec process
- string exec_id = 7;
-}
-
-message ExecProcessResponse {
-}
-
-message ResizePtyRequest {
- string container_id = 1;
- string exec_id = 2;
- uint32 width = 3;
- uint32 height = 4;
-}
-
-message CloseIORequest {
- string container_id = 1;
- string exec_id = 2;
- bool stdin = 3;
-}
-
-message PauseTaskRequest {
- string container_id = 1;
-}
-
-message ResumeTaskRequest {
- string container_id = 1;
-}
-
-message ListPidsRequest {
- string container_id = 1;
-}
-
-message ListPidsResponse {
- // Processes includes the process ID and additional process information
- repeated containerd.v1.types.ProcessInfo processes = 1;
-}
-
-message CheckpointTaskRequest {
- string container_id = 1;
- string parent_checkpoint = 2 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
- google.protobuf.Any options = 3;
-}
-
-message CheckpointTaskResponse {
- repeated containerd.types.Descriptor descriptors = 1;
-}
-
-message UpdateTaskRequest {
- string container_id = 1;
- google.protobuf.Any resources = 2;
-}
-
-message MetricsRequest {
- repeated string filters = 1;
-}
-
-message MetricsResponse {
- repeated types.Metric metrics = 1;
-}
-
-message WaitRequest {
- string container_id = 1;
- string exec_id = 2;
-}
-
-message WaitResponse {
- uint32 exit_status = 1;
- google.protobuf.Timestamp exited_at = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
-}
diff --git a/vendor/github.com/containerd/containerd/api/services/ttrpc/events/v1/doc.go b/vendor/github.com/containerd/containerd/api/services/ttrpc/events/v1/doc.go
deleted file mode 100644
index b7f86da86..000000000
--- a/vendor/github.com/containerd/containerd/api/services/ttrpc/events/v1/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-// Package events defines the event pushing and subscription service.
-package events
diff --git a/vendor/github.com/containerd/containerd/api/services/ttrpc/events/v1/events.pb.go b/vendor/github.com/containerd/containerd/api/services/ttrpc/events/v1/events.pb.go
deleted file mode 100644
index 0e61351d5..000000000
--- a/vendor/github.com/containerd/containerd/api/services/ttrpc/events/v1/events.pb.go
+++ /dev/null
@@ -1,766 +0,0 @@
-// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: github.com/containerd/containerd/api/services/ttrpc/events/v1/events.proto
-
-package events
-
-import (
- context "context"
- fmt "fmt"
- github_com_containerd_ttrpc "github.com/containerd/ttrpc"
- github_com_containerd_typeurl "github.com/containerd/typeurl"
- proto "github.com/gogo/protobuf/proto"
- github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
- types "github.com/gogo/protobuf/types"
- io "io"
- math "math"
- math_bits "math/bits"
- reflect "reflect"
- strings "strings"
- time "time"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-var _ = time.Kitchen
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
-
-type ForwardRequest struct {
- Envelope *Envelope `protobuf:"bytes,1,opt,name=envelope,proto3" json:"envelope,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ForwardRequest) Reset() { *m = ForwardRequest{} }
-func (*ForwardRequest) ProtoMessage() {}
-func (*ForwardRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_19f98672016720b5, []int{0}
-}
-func (m *ForwardRequest) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ForwardRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ForwardRequest.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 *ForwardRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ForwardRequest.Merge(m, src)
-}
-func (m *ForwardRequest) XXX_Size() int {
- return m.Size()
-}
-func (m *ForwardRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_ForwardRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ForwardRequest proto.InternalMessageInfo
-
-type Envelope struct {
- Timestamp time.Time `protobuf:"bytes,1,opt,name=timestamp,proto3,stdtime" json:"timestamp"`
- Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
- Topic string `protobuf:"bytes,3,opt,name=topic,proto3" json:"topic,omitempty"`
- Event *types.Any `protobuf:"bytes,4,opt,name=event,proto3" json:"event,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Envelope) Reset() { *m = Envelope{} }
-func (*Envelope) ProtoMessage() {}
-func (*Envelope) Descriptor() ([]byte, []int) {
- return fileDescriptor_19f98672016720b5, []int{1}
-}
-func (m *Envelope) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Envelope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_Envelope.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 *Envelope) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Envelope.Merge(m, src)
-}
-func (m *Envelope) XXX_Size() int {
- return m.Size()
-}
-func (m *Envelope) XXX_DiscardUnknown() {
- xxx_messageInfo_Envelope.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Envelope proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*ForwardRequest)(nil), "containerd.services.events.ttrpc.v1.ForwardRequest")
- proto.RegisterType((*Envelope)(nil), "containerd.services.events.ttrpc.v1.Envelope")
-}
-
-func init() {
- proto.RegisterFile("github.com/containerd/containerd/api/services/ttrpc/events/v1/events.proto", fileDescriptor_19f98672016720b5)
-}
-
-var fileDescriptor_19f98672016720b5 = []byte{
- // 396 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x52, 0xc1, 0x8e, 0xd3, 0x30,
- 0x10, 0x8d, 0x61, 0x77, 0x69, 0x8d, 0xc4, 0xc1, 0xaa, 0x50, 0x08, 0x28, 0x59, 0x2d, 0x97, 0x15,
- 0x12, 0xb6, 0x76, 0xf7, 0x06, 0x17, 0xa8, 0x28, 0x12, 0x1c, 0x23, 0x84, 0x2a, 0x90, 0x10, 0x6e,
- 0x3a, 0x4d, 0x2d, 0x25, 0xb6, 0x49, 0x9c, 0xa0, 0xde, 0xfa, 0x09, 0x7c, 0x0c, 0x17, 0xfe, 0xa0,
- 0x47, 0x8e, 0x9c, 0x80, 0xe6, 0x4b, 0x50, 0x9d, 0xa4, 0x81, 0xf6, 0x40, 0xa5, 0xbd, 0xbd, 0xcc,
- 0x7b, 0x6f, 0xde, 0xcc, 0xc4, 0xf8, 0x75, 0x2c, 0xcc, 0xbc, 0x98, 0xd0, 0x48, 0xa5, 0x2c, 0x52,
- 0xd2, 0x70, 0x21, 0x21, 0x9b, 0xfe, 0x0d, 0xb9, 0x16, 0x2c, 0x87, 0xac, 0x14, 0x11, 0xe4, 0xcc,
- 0x98, 0x4c, 0x47, 0x0c, 0x4a, 0x90, 0x26, 0x67, 0xe5, 0x45, 0x83, 0xa8, 0xce, 0x94, 0x51, 0xe4,
- 0x61, 0xe7, 0xa2, 0xad, 0x83, 0x36, 0x0a, 0x6b, 0xa4, 0xe5, 0x85, 0xf7, 0xec, 0xbf, 0x81, 0xb6,
- 0xd9, 0xa4, 0x98, 0x31, 0x9d, 0x14, 0xb1, 0x90, 0x6c, 0x26, 0x20, 0x99, 0x6a, 0x6e, 0xe6, 0x75,
- 0x8c, 0x37, 0x88, 0x55, 0xac, 0x2c, 0x64, 0x1b, 0xd4, 0x54, 0xef, 0xc5, 0x4a, 0xc5, 0x09, 0x74,
- 0x6e, 0x2e, 0x17, 0x0d, 0x75, 0x7f, 0x97, 0x82, 0x54, 0x9b, 0x96, 0x0c, 0x76, 0x49, 0x23, 0x52,
- 0xc8, 0x0d, 0x4f, 0x75, 0x2d, 0x38, 0x7b, 0x8f, 0xef, 0xbc, 0x54, 0xd9, 0x67, 0x9e, 0x4d, 0x43,
- 0xf8, 0x54, 0x40, 0x6e, 0xc8, 0x2b, 0xdc, 0x03, 0x59, 0x42, 0xa2, 0x34, 0xb8, 0xe8, 0x14, 0x9d,
- 0xdf, 0xbe, 0x7c, 0x4c, 0x0f, 0x58, 0x9d, 0x8e, 0x1a, 0x53, 0xb8, 0xb5, 0x9f, 0x7d, 0x45, 0xb8,
- 0xd7, 0x96, 0xc9, 0x10, 0xf7, 0xb7, 0xe1, 0x4d, 0x63, 0x8f, 0xd6, 0xe3, 0xd1, 0x76, 0x3c, 0xfa,
- 0xa6, 0x55, 0x0c, 0x7b, 0xab, 0x9f, 0x81, 0xf3, 0xe5, 0x57, 0x80, 0xc2, 0xce, 0x46, 0x1e, 0xe0,
- 0xbe, 0xe4, 0x29, 0xe4, 0x9a, 0x47, 0xe0, 0xde, 0x38, 0x45, 0xe7, 0xfd, 0xb0, 0x2b, 0x90, 0x01,
- 0x3e, 0x36, 0x4a, 0x8b, 0xc8, 0xbd, 0x69, 0x99, 0xfa, 0x83, 0x3c, 0xc2, 0xc7, 0x76, 0x54, 0xf7,
- 0xc8, 0x66, 0x0e, 0xf6, 0x32, 0x9f, 0xcb, 0x45, 0x58, 0x4b, 0x9e, 0x1c, 0x2d, 0xbf, 0x05, 0xe8,
- 0xf2, 0x23, 0x3e, 0x19, 0xd9, 0xe5, 0xc8, 0x5b, 0x7c, 0xab, 0xb9, 0x0e, 0xb9, 0x3a, 0xe8, 0x08,
- 0xff, 0xde, 0xd2, 0xbb, 0xbb, 0x17, 0x36, 0xda, 0xfc, 0x9c, 0xe1, 0x87, 0xd5, 0xda, 0x77, 0x7e,
- 0xac, 0x7d, 0x67, 0x59, 0xf9, 0x68, 0x55, 0xf9, 0xe8, 0x7b, 0xe5, 0xa3, 0xdf, 0x95, 0x8f, 0xde,
- 0xbd, 0xb8, 0xd6, 0x8b, 0x7d, 0x5a, 0xa3, 0xb1, 0x33, 0x46, 0x93, 0x13, 0x9b, 0x79, 0xf5, 0x27,
- 0x00, 0x00, 0xff, 0xff, 0xd4, 0x90, 0xbd, 0x09, 0x04, 0x03, 0x00, 0x00,
-}
-
-// Field returns the value for the given fieldpath as a string, if defined.
-// If the value is not defined, the second value will be false.
-func (m *Envelope) Field(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- // unhandled: timestamp
- case "namespace":
- return string(m.Namespace), len(m.Namespace) > 0
- case "topic":
- return string(m.Topic), len(m.Topic) > 0
- case "event":
- decoded, err := github_com_containerd_typeurl.UnmarshalAny(m.Event)
- if err != nil {
- return "", false
- }
-
- adaptor, ok := decoded.(interface{ Field([]string) (string, bool) })
- if !ok {
- return "", false
- }
- return adaptor.Field(fieldpath[1:])
- }
- return "", false
-}
-func (m *ForwardRequest) 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 *ForwardRequest) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ForwardRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Envelope != nil {
- {
- size, err := m.Envelope.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintEvents(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *Envelope) 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 *Envelope) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *Envelope) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Event != nil {
- {
- size, err := m.Event.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintEvents(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x22
- }
- if len(m.Topic) > 0 {
- i -= len(m.Topic)
- copy(dAtA[i:], m.Topic)
- i = encodeVarintEvents(dAtA, i, uint64(len(m.Topic)))
- i--
- dAtA[i] = 0x1a
- }
- if len(m.Namespace) > 0 {
- i -= len(m.Namespace)
- copy(dAtA[i:], m.Namespace)
- i = encodeVarintEvents(dAtA, i, uint64(len(m.Namespace)))
- i--
- dAtA[i] = 0x12
- }
- n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):])
- if err3 != nil {
- return 0, err3
- }
- i -= n3
- i = encodeVarintEvents(dAtA, i, uint64(n3))
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func encodeVarintEvents(dAtA []byte, offset int, v uint64) int {
- offset -= sovEvents(v)
- base := offset
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return base
-}
-func (m *ForwardRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Envelope != nil {
- l = m.Envelope.Size()
- n += 1 + l + sovEvents(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *Envelope) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp)
- n += 1 + l + sovEvents(uint64(l))
- l = len(m.Namespace)
- if l > 0 {
- n += 1 + l + sovEvents(uint64(l))
- }
- l = len(m.Topic)
- if l > 0 {
- n += 1 + l + sovEvents(uint64(l))
- }
- if m.Event != nil {
- l = m.Event.Size()
- n += 1 + l + sovEvents(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func sovEvents(x uint64) (n int) {
- return (math_bits.Len64(x|1) + 6) / 7
-}
-func sozEvents(x uint64) (n int) {
- return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-func (this *ForwardRequest) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ForwardRequest{`,
- `Envelope:` + strings.Replace(this.Envelope.String(), "Envelope", "Envelope", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *Envelope) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&Envelope{`,
- `Timestamp:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Timestamp), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`,
- `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`,
- `Topic:` + fmt.Sprintf("%v", this.Topic) + `,`,
- `Event:` + strings.Replace(fmt.Sprintf("%v", this.Event), "Any", "types.Any", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func valueToStringEvents(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
-}
-
-type EventsService interface {
- Forward(ctx context.Context, req *ForwardRequest) (*types.Empty, error)
-}
-
-func RegisterEventsService(srv *github_com_containerd_ttrpc.Server, svc EventsService) {
- srv.Register("containerd.services.events.ttrpc.v1.Events", map[string]github_com_containerd_ttrpc.Method{
- "Forward": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) {
- var req ForwardRequest
- if err := unmarshal(&req); err != nil {
- return nil, err
- }
- return svc.Forward(ctx, &req)
- },
- })
-}
-
-type eventsClient struct {
- client *github_com_containerd_ttrpc.Client
-}
-
-func NewEventsClient(client *github_com_containerd_ttrpc.Client) EventsService {
- return &eventsClient{
- client: client,
- }
-}
-
-func (c *eventsClient) Forward(ctx context.Context, req *ForwardRequest) (*types.Empty, error) {
- var resp types.Empty
- if err := c.client.Call(ctx, "containerd.services.events.ttrpc.v1.Events", "Forward", req, &resp); err != nil {
- return nil, err
- }
- return &resp, nil
-}
-func (m *ForwardRequest) 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 ErrIntOverflowEvents
- }
- 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: ForwardRequest: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ForwardRequest: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Envelope", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowEvents
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthEvents
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthEvents
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Envelope == nil {
- m.Envelope = &Envelope{}
- }
- if err := m.Envelope.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipEvents(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthEvents
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthEvents
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *Envelope) 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 ErrIntOverflowEvents
- }
- 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: Envelope: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: Envelope: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowEvents
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthEvents
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthEvents
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- 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 ErrIntOverflowEvents
- }
- 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 ErrInvalidLengthEvents
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthEvents
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Namespace = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Topic", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowEvents
- }
- 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 ErrInvalidLengthEvents
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthEvents
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Topic = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 4:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Event", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowEvents
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthEvents
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthEvents
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Event == nil {
- m.Event = &types.Any{}
- }
- if err := m.Event.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipEvents(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthEvents
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthEvents
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func skipEvents(dAtA []byte) (n int, err error) {
- l := len(dAtA)
- iNdEx := 0
- depth := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowEvents
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowEvents
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if dAtA[iNdEx-1] < 0x80 {
- break
- }
- }
- case 1:
- iNdEx += 8
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowEvents
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if length < 0 {
- return 0, ErrInvalidLengthEvents
- }
- iNdEx += length
- case 3:
- depth++
- case 4:
- if depth == 0 {
- return 0, ErrUnexpectedEndOfGroupEvents
- }
- depth--
- case 5:
- iNdEx += 4
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- if iNdEx < 0 {
- return 0, ErrInvalidLengthEvents
- }
- if depth == 0 {
- return iNdEx, nil
- }
- }
- return 0, io.ErrUnexpectedEOF
-}
-
-var (
- ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow")
- ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group")
-)
diff --git a/vendor/github.com/containerd/containerd/api/services/ttrpc/events/v1/events.proto b/vendor/github.com/containerd/containerd/api/services/ttrpc/events/v1/events.proto
deleted file mode 100644
index e140c3439..000000000
--- a/vendor/github.com/containerd/containerd/api/services/ttrpc/events/v1/events.proto
+++ /dev/null
@@ -1,32 +0,0 @@
-syntax = "proto3";
-
-package containerd.services.events.ttrpc.v1;
-
-import weak "github.com/containerd/containerd/protobuf/plugin/fieldpath.proto";
-import weak "gogoproto/gogo.proto";
-import "google/protobuf/any.proto";
-import "google/protobuf/empty.proto";
-import "google/protobuf/timestamp.proto";
-
-option go_package = "github.com/containerd/containerd/api/services/ttrpc/events/v1;events";
-
-service Events {
- // Forward sends an event that has already been packaged into an envelope
- // with a timestamp and namespace.
- //
- // This is useful if earlier timestamping is required or when forwarding on
- // behalf of another component, namespace or publisher.
- rpc Forward(ForwardRequest) returns (google.protobuf.Empty);
-}
-
-message ForwardRequest {
- Envelope envelope = 1;
-}
-
-message Envelope {
- option (containerd.plugin.fieldpath) = true;
- google.protobuf.Timestamp timestamp = 1 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
- string namespace = 2;
- string topic = 3;
- google.protobuf.Any event = 4;
-}
diff --git a/vendor/github.com/containerd/containerd/api/services/version/v1/version.pb.go b/vendor/github.com/containerd/containerd/api/services/version/v1/version.pb.go
deleted file mode 100644
index 81b8c3395..000000000
--- a/vendor/github.com/containerd/containerd/api/services/version/v1/version.pb.go
+++ /dev/null
@@ -1,479 +0,0 @@
-// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: github.com/containerd/containerd/api/services/version/v1/version.proto
-
-package version
-
-import (
- context "context"
- fmt "fmt"
- proto "github.com/gogo/protobuf/proto"
- types "github.com/gogo/protobuf/types"
- grpc "google.golang.org/grpc"
- codes "google.golang.org/grpc/codes"
- status "google.golang.org/grpc/status"
- io "io"
- math "math"
- math_bits "math/bits"
- reflect "reflect"
- strings "strings"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
-
-type VersionResponse struct {
- Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
- Revision string `protobuf:"bytes,2,opt,name=revision,proto3" json:"revision,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *VersionResponse) Reset() { *m = VersionResponse{} }
-func (*VersionResponse) ProtoMessage() {}
-func (*VersionResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_128109001e578ffe, []int{0}
-}
-func (m *VersionResponse) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *VersionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_VersionResponse.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 *VersionResponse) XXX_Merge(src proto.Message) {
- xxx_messageInfo_VersionResponse.Merge(m, src)
-}
-func (m *VersionResponse) XXX_Size() int {
- return m.Size()
-}
-func (m *VersionResponse) XXX_DiscardUnknown() {
- xxx_messageInfo_VersionResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_VersionResponse proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*VersionResponse)(nil), "containerd.services.version.v1.VersionResponse")
-}
-
-func init() {
- proto.RegisterFile("github.com/containerd/containerd/api/services/version/v1/version.proto", fileDescriptor_128109001e578ffe)
-}
-
-var fileDescriptor_128109001e578ffe = []byte{
- // 243 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x72, 0x4b, 0xcf, 0x2c, 0xc9,
- 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d,
- 0x4a, 0x41, 0x66, 0x26, 0x16, 0x64, 0xea, 0x17, 0xa7, 0x16, 0x95, 0x65, 0x26, 0xa7, 0x16, 0xeb,
- 0x97, 0xa5, 0x16, 0x15, 0x67, 0xe6, 0xe7, 0xe9, 0x97, 0x19, 0xc2, 0x98, 0x7a, 0x05, 0x45, 0xf9,
- 0x25, 0xf9, 0x42, 0x72, 0x08, 0x1d, 0x7a, 0x30, 0xd5, 0x7a, 0x30, 0x25, 0x65, 0x86, 0x52, 0xd2,
- 0xe9, 0xf9, 0xf9, 0xe9, 0x39, 0xa9, 0xfa, 0x60, 0xd5, 0x49, 0xa5, 0x69, 0xfa, 0xa9, 0xb9, 0x05,
- 0x25, 0x95, 0x10, 0xcd, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0xa6, 0x3e, 0x88, 0x05, 0x11,
- 0x55, 0x72, 0xe7, 0xe2, 0x0f, 0x83, 0x18, 0x10, 0x94, 0x5a, 0x5c, 0x90, 0x9f, 0x57, 0x9c, 0x2a,
- 0x24, 0xc1, 0xc5, 0x0e, 0x35, 0x53, 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, 0x08, 0xc6, 0x15, 0x92,
- 0xe2, 0xe2, 0x28, 0x4a, 0x2d, 0xcb, 0x04, 0x4b, 0x31, 0x81, 0xa5, 0xe0, 0x7c, 0xa3, 0x58, 0x2e,
- 0x76, 0xa8, 0x41, 0x42, 0x41, 0x08, 0xa6, 0x98, 0x1e, 0xc4, 0x49, 0x7a, 0x30, 0x27, 0xe9, 0xb9,
- 0x82, 0x9c, 0x24, 0xa5, 0xaf, 0x87, 0xdf, 0x2b, 0x7a, 0x68, 0x8e, 0x72, 0x8a, 0x3a, 0xf1, 0x50,
- 0x8e, 0xe1, 0xc6, 0x43, 0x39, 0x86, 0x86, 0x47, 0x72, 0x8c, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78,
- 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0x63, 0x94, 0x03, 0xb9, 0x81, 0x6b, 0x0d, 0x65, 0x46, 0x30,
- 0x26, 0xb1, 0x81, 0x9d, 0x67, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x95, 0x0d, 0x52, 0x23, 0xa9,
- 0x01, 0x00, 0x00,
-}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ context.Context
-var _ grpc.ClientConn
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion4
-
-// VersionClient is the client API for Version service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type VersionClient interface {
- Version(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*VersionResponse, error)
-}
-
-type versionClient struct {
- cc *grpc.ClientConn
-}
-
-func NewVersionClient(cc *grpc.ClientConn) VersionClient {
- return &versionClient{cc}
-}
-
-func (c *versionClient) Version(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*VersionResponse, error) {
- out := new(VersionResponse)
- err := c.cc.Invoke(ctx, "/containerd.services.version.v1.Version/Version", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// VersionServer is the server API for Version service.
-type VersionServer interface {
- Version(context.Context, *types.Empty) (*VersionResponse, error)
-}
-
-// UnimplementedVersionServer can be embedded to have forward compatible implementations.
-type UnimplementedVersionServer struct {
-}
-
-func (*UnimplementedVersionServer) Version(ctx context.Context, req *types.Empty) (*VersionResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Version not implemented")
-}
-
-func RegisterVersionServer(s *grpc.Server, srv VersionServer) {
- s.RegisterService(&_Version_serviceDesc, srv)
-}
-
-func _Version_Version_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(types.Empty)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(VersionServer).Version(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/containerd.services.version.v1.Version/Version",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(VersionServer).Version(ctx, req.(*types.Empty))
- }
- return interceptor(ctx, in, info, handler)
-}
-
-var _Version_serviceDesc = grpc.ServiceDesc{
- ServiceName: "containerd.services.version.v1.Version",
- HandlerType: (*VersionServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "Version",
- Handler: _Version_Version_Handler,
- },
- },
- Streams: []grpc.StreamDesc{},
- Metadata: "github.com/containerd/containerd/api/services/version/v1/version.proto",
-}
-
-func (m *VersionResponse) 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 *VersionResponse) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *VersionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Revision) > 0 {
- i -= len(m.Revision)
- copy(dAtA[i:], m.Revision)
- i = encodeVarintVersion(dAtA, i, uint64(len(m.Revision)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.Version) > 0 {
- i -= len(m.Version)
- copy(dAtA[i:], m.Version)
- i = encodeVarintVersion(dAtA, i, uint64(len(m.Version)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func encodeVarintVersion(dAtA []byte, offset int, v uint64) int {
- offset -= sovVersion(v)
- base := offset
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return base
-}
-func (m *VersionResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Version)
- if l > 0 {
- n += 1 + l + sovVersion(uint64(l))
- }
- l = len(m.Revision)
- if l > 0 {
- n += 1 + l + sovVersion(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func sovVersion(x uint64) (n int) {
- return (math_bits.Len64(x|1) + 6) / 7
-}
-func sozVersion(x uint64) (n int) {
- return sovVersion(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-func (this *VersionResponse) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&VersionResponse{`,
- `Version:` + fmt.Sprintf("%v", this.Version) + `,`,
- `Revision:` + fmt.Sprintf("%v", this.Revision) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func valueToStringVersion(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
-}
-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 ErrIntOverflowVersion
- }
- 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 ErrIntOverflowVersion
- }
- 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 ErrInvalidLengthVersion
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthVersion
- }
- 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 Revision", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowVersion
- }
- 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 ErrInvalidLengthVersion
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthVersion
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Revision = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipVersion(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthVersion
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthVersion
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func skipVersion(dAtA []byte) (n int, err error) {
- l := len(dAtA)
- iNdEx := 0
- depth := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowVersion
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowVersion
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if dAtA[iNdEx-1] < 0x80 {
- break
- }
- }
- case 1:
- iNdEx += 8
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowVersion
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if length < 0 {
- return 0, ErrInvalidLengthVersion
- }
- iNdEx += length
- case 3:
- depth++
- case 4:
- if depth == 0 {
- return 0, ErrUnexpectedEndOfGroupVersion
- }
- depth--
- case 5:
- iNdEx += 4
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- if iNdEx < 0 {
- return 0, ErrInvalidLengthVersion
- }
- if depth == 0 {
- return iNdEx, nil
- }
- }
- return 0, io.ErrUnexpectedEOF
-}
-
-var (
- ErrInvalidLengthVersion = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowVersion = fmt.Errorf("proto: integer overflow")
- ErrUnexpectedEndOfGroupVersion = fmt.Errorf("proto: unexpected end of group")
-)
diff --git a/vendor/github.com/containerd/containerd/api/services/version/v1/version.proto b/vendor/github.com/containerd/containerd/api/services/version/v1/version.proto
deleted file mode 100644
index 0e4c3d1e0..000000000
--- a/vendor/github.com/containerd/containerd/api/services/version/v1/version.proto
+++ /dev/null
@@ -1,18 +0,0 @@
-syntax = "proto3";
-
-package containerd.services.version.v1;
-
-import "google/protobuf/empty.proto";
-import weak "gogoproto/gogo.proto";
-
-// TODO(stevvooe): Should version service actually be versioned?
-option go_package = "github.com/containerd/containerd/api/services/version/v1;version";
-
-service Version {
- rpc Version(google.protobuf.Empty) returns (VersionResponse);
-}
-
-message VersionResponse {
- string version = 1;
- string revision = 2;
-}
diff --git a/vendor/github.com/containerd/containerd/api/types/descriptor.pb.go b/vendor/github.com/containerd/containerd/api/types/descriptor.pb.go
deleted file mode 100644
index 437d41f23..000000000
--- a/vendor/github.com/containerd/containerd/api/types/descriptor.pb.go
+++ /dev/null
@@ -1,601 +0,0 @@
-// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: github.com/containerd/containerd/api/types/descriptor.proto
-
-package types
-
-import (
- fmt "fmt"
- proto "github.com/gogo/protobuf/proto"
- github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
- github_com_opencontainers_go_digest "github.com/opencontainers/go-digest"
- io "io"
- math "math"
- math_bits "math/bits"
- reflect "reflect"
- strings "strings"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
-
-// Descriptor describes a blob in a content store.
-//
-// This descriptor can be used to reference content from an
-// oci descriptor found in a manifest.
-// See https://godoc.org/github.com/opencontainers/image-spec/specs-go/v1#Descriptor
-type Descriptor struct {
- MediaType string `protobuf:"bytes,1,opt,name=media_type,json=mediaType,proto3" json:"media_type,omitempty"`
- Digest github_com_opencontainers_go_digest.Digest `protobuf:"bytes,2,opt,name=digest,proto3,customtype=github.com/opencontainers/go-digest.Digest" json:"digest"`
- Size_ int64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"`
- Annotations map[string]string `protobuf:"bytes,5,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_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Descriptor) Reset() { *m = Descriptor{} }
-func (*Descriptor) ProtoMessage() {}
-func (*Descriptor) Descriptor() ([]byte, []int) {
- return fileDescriptor_37f958df3707db9e, []int{0}
-}
-func (m *Descriptor) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Descriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_Descriptor.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 *Descriptor) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Descriptor.Merge(m, src)
-}
-func (m *Descriptor) XXX_Size() int {
- return m.Size()
-}
-func (m *Descriptor) XXX_DiscardUnknown() {
- xxx_messageInfo_Descriptor.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Descriptor proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*Descriptor)(nil), "containerd.types.Descriptor")
- proto.RegisterMapType((map[string]string)(nil), "containerd.types.Descriptor.AnnotationsEntry")
-}
-
-func init() {
- proto.RegisterFile("github.com/containerd/containerd/api/types/descriptor.proto", fileDescriptor_37f958df3707db9e)
-}
-
-var fileDescriptor_37f958df3707db9e = []byte{
- // 311 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x4e, 0xcf, 0x2c, 0xc9,
- 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d,
- 0x4a, 0x41, 0x66, 0x26, 0x16, 0x64, 0xea, 0x97, 0x54, 0x16, 0xa4, 0x16, 0xeb, 0xa7, 0xa4, 0x16,
- 0x27, 0x17, 0x65, 0x16, 0x94, 0xe4, 0x17, 0xe9, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x09, 0x20,
- 0x94, 0xe9, 0x81, 0x95, 0x48, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0x25, 0xf5, 0x41, 0x2c, 0x88,
- 0x3a, 0xa5, 0x39, 0x4c, 0x5c, 0x5c, 0x2e, 0x70, 0xcd, 0x42, 0xb2, 0x5c, 0x5c, 0xb9, 0xa9, 0x29,
- 0x99, 0x89, 0xf1, 0x20, 0x3d, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x9c, 0x60, 0x91, 0x90,
- 0xca, 0x82, 0x54, 0x21, 0x2f, 0x2e, 0xb6, 0x94, 0xcc, 0xf4, 0xd4, 0xe2, 0x12, 0x09, 0x26, 0x90,
- 0x94, 0x93, 0xd1, 0x89, 0x7b, 0xf2, 0x0c, 0xb7, 0xee, 0xc9, 0x6b, 0x21, 0x39, 0x35, 0xbf, 0x20,
- 0x35, 0x0f, 0x6e, 0x79, 0xb1, 0x7e, 0x7a, 0xbe, 0x2e, 0x44, 0x8b, 0x9e, 0x0b, 0x98, 0x0a, 0x82,
- 0x9a, 0x20, 0x24, 0xc4, 0xc5, 0x52, 0x9c, 0x59, 0x95, 0x2a, 0xc1, 0xac, 0xc0, 0xa8, 0xc1, 0x1c,
- 0x04, 0x66, 0x0b, 0xf9, 0x73, 0x71, 0x27, 0xe6, 0xe5, 0xe5, 0x97, 0x24, 0x96, 0x64, 0xe6, 0xe7,
- 0x15, 0x4b, 0xb0, 0x2a, 0x30, 0x6b, 0x70, 0x1b, 0xe9, 0xea, 0xa1, 0xfb, 0x45, 0x0f, 0xe1, 0x62,
- 0x3d, 0x47, 0x84, 0x7a, 0xd7, 0xbc, 0x92, 0xa2, 0xca, 0x20, 0x64, 0x13, 0xa4, 0xec, 0xb8, 0x04,
- 0xd0, 0x15, 0x08, 0x09, 0x70, 0x31, 0x67, 0xa7, 0x56, 0x42, 0x3d, 0x07, 0x62, 0x0a, 0x89, 0x70,
- 0xb1, 0x96, 0x25, 0xe6, 0x94, 0xa6, 0x42, 0x7c, 0x15, 0x04, 0xe1, 0x58, 0x31, 0x59, 0x30, 0x3a,
- 0x79, 0x9d, 0x78, 0x28, 0xc7, 0x70, 0xe3, 0xa1, 0x1c, 0x43, 0xc3, 0x23, 0x39, 0xc6, 0x13, 0x8f,
- 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x31, 0xca, 0x80, 0xf8, 0xd8, 0xb1,
- 0x06, 0x93, 0x11, 0x0c, 0x49, 0x6c, 0xe0, 0x30, 0x37, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x22,
- 0x8a, 0x20, 0x4a, 0xda, 0x01, 0x00, 0x00,
-}
-
-func (m *Descriptor) 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 *Descriptor) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *Descriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Annotations) > 0 {
- for k := range m.Annotations {
- v := m.Annotations[k]
- baseI := i
- i -= len(v)
- copy(dAtA[i:], v)
- i = encodeVarintDescriptor(dAtA, i, uint64(len(v)))
- i--
- dAtA[i] = 0x12
- i -= len(k)
- copy(dAtA[i:], k)
- i = encodeVarintDescriptor(dAtA, i, uint64(len(k)))
- i--
- dAtA[i] = 0xa
- i = encodeVarintDescriptor(dAtA, i, uint64(baseI-i))
- i--
- dAtA[i] = 0x2a
- }
- }
- if m.Size_ != 0 {
- i = encodeVarintDescriptor(dAtA, i, uint64(m.Size_))
- i--
- dAtA[i] = 0x18
- }
- if len(m.Digest) > 0 {
- i -= len(m.Digest)
- copy(dAtA[i:], m.Digest)
- i = encodeVarintDescriptor(dAtA, i, uint64(len(m.Digest)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.MediaType) > 0 {
- i -= len(m.MediaType)
- copy(dAtA[i:], m.MediaType)
- i = encodeVarintDescriptor(dAtA, i, uint64(len(m.MediaType)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func encodeVarintDescriptor(dAtA []byte, offset int, v uint64) int {
- offset -= sovDescriptor(v)
- base := offset
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return base
-}
-func (m *Descriptor) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.MediaType)
- if l > 0 {
- n += 1 + l + sovDescriptor(uint64(l))
- }
- l = len(m.Digest)
- if l > 0 {
- n += 1 + l + sovDescriptor(uint64(l))
- }
- if m.Size_ != 0 {
- n += 1 + sovDescriptor(uint64(m.Size_))
- }
- if len(m.Annotations) > 0 {
- for k, v := range m.Annotations {
- _ = k
- _ = v
- mapEntrySize := 1 + len(k) + sovDescriptor(uint64(len(k))) + 1 + len(v) + sovDescriptor(uint64(len(v)))
- n += mapEntrySize + 1 + sovDescriptor(uint64(mapEntrySize))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func sovDescriptor(x uint64) (n int) {
- return (math_bits.Len64(x|1) + 6) / 7
-}
-func sozDescriptor(x uint64) (n int) {
- return sovDescriptor(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-func (this *Descriptor) 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{`&Descriptor{`,
- `MediaType:` + fmt.Sprintf("%v", this.MediaType) + `,`,
- `Digest:` + fmt.Sprintf("%v", this.Digest) + `,`,
- `Size_:` + fmt.Sprintf("%v", this.Size_) + `,`,
- `Annotations:` + mapStringForAnnotations + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func valueToStringDescriptor(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
-}
-func (m *Descriptor) 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 ErrIntOverflowDescriptor
- }
- 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: Descriptor: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: Descriptor: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field MediaType", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowDescriptor
- }
- 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 ErrInvalidLengthDescriptor
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthDescriptor
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.MediaType = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Digest", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowDescriptor
- }
- 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 ErrInvalidLengthDescriptor
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthDescriptor
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Digest = github_com_opencontainers_go_digest.Digest(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType)
- }
- m.Size_ = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowDescriptor
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Size_ |= int64(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 5:
- 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 ErrIntOverflowDescriptor
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthDescriptor
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthDescriptor
- }
- 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 ErrIntOverflowDescriptor
- }
- 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 ErrIntOverflowDescriptor
- }
- 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 ErrInvalidLengthDescriptor
- }
- postStringIndexmapkey := iNdEx + intStringLenmapkey
- if postStringIndexmapkey < 0 {
- return ErrInvalidLengthDescriptor
- }
- 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 ErrIntOverflowDescriptor
- }
- 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 ErrInvalidLengthDescriptor
- }
- postStringIndexmapvalue := iNdEx + intStringLenmapvalue
- if postStringIndexmapvalue < 0 {
- return ErrInvalidLengthDescriptor
- }
- if postStringIndexmapvalue > l {
- return io.ErrUnexpectedEOF
- }
- mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
- iNdEx = postStringIndexmapvalue
- } else {
- iNdEx = entryPreIndex
- skippy, err := skipDescriptor(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthDescriptor
- }
- if (iNdEx + skippy) > postIndex {
- return io.ErrUnexpectedEOF
- }
- iNdEx += skippy
- }
- }
- m.Annotations[mapkey] = mapvalue
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipDescriptor(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthDescriptor
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthDescriptor
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func skipDescriptor(dAtA []byte) (n int, err error) {
- l := len(dAtA)
- iNdEx := 0
- depth := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowDescriptor
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowDescriptor
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if dAtA[iNdEx-1] < 0x80 {
- break
- }
- }
- case 1:
- iNdEx += 8
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowDescriptor
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if length < 0 {
- return 0, ErrInvalidLengthDescriptor
- }
- iNdEx += length
- case 3:
- depth++
- case 4:
- if depth == 0 {
- return 0, ErrUnexpectedEndOfGroupDescriptor
- }
- depth--
- case 5:
- iNdEx += 4
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- if iNdEx < 0 {
- return 0, ErrInvalidLengthDescriptor
- }
- if depth == 0 {
- return iNdEx, nil
- }
- }
- return 0, io.ErrUnexpectedEOF
-}
-
-var (
- ErrInvalidLengthDescriptor = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowDescriptor = fmt.Errorf("proto: integer overflow")
- ErrUnexpectedEndOfGroupDescriptor = fmt.Errorf("proto: unexpected end of group")
-)
diff --git a/vendor/github.com/containerd/containerd/api/types/descriptor.proto b/vendor/github.com/containerd/containerd/api/types/descriptor.proto
deleted file mode 100644
index 6d90a1626..000000000
--- a/vendor/github.com/containerd/containerd/api/types/descriptor.proto
+++ /dev/null
@@ -1,19 +0,0 @@
-syntax = "proto3";
-
-package containerd.types;
-
-import weak "gogoproto/gogo.proto";
-
-option go_package = "github.com/containerd/containerd/api/types;types";
-
-// Descriptor describes a blob in a content store.
-//
-// This descriptor can be used to reference content from an
-// oci descriptor found in a manifest.
-// See https://godoc.org/github.com/opencontainers/image-spec/specs-go/v1#Descriptor
-message Descriptor {
- string media_type = 1;
- string digest = 2 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
- int64 size = 3;
- map annotations = 5;
-}
diff --git a/vendor/github.com/containerd/containerd/api/types/doc.go b/vendor/github.com/containerd/containerd/api/types/doc.go
deleted file mode 100644
index 475b465ed..000000000
--- a/vendor/github.com/containerd/containerd/api/types/doc.go
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package types
diff --git a/vendor/github.com/containerd/containerd/api/types/metrics.pb.go b/vendor/github.com/containerd/containerd/api/types/metrics.pb.go
deleted file mode 100644
index 89a8d9cd6..000000000
--- a/vendor/github.com/containerd/containerd/api/types/metrics.pb.go
+++ /dev/null
@@ -1,453 +0,0 @@
-// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: github.com/containerd/containerd/api/types/metrics.proto
-
-package types
-
-import (
- fmt "fmt"
- proto "github.com/gogo/protobuf/proto"
- github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
- types "github.com/gogo/protobuf/types"
- io "io"
- math "math"
- math_bits "math/bits"
- reflect "reflect"
- strings "strings"
- time "time"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-var _ = time.Kitchen
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
-
-type Metric struct {
- Timestamp time.Time `protobuf:"bytes,1,opt,name=timestamp,proto3,stdtime" json:"timestamp"`
- ID string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
- Data *types.Any `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Metric) Reset() { *m = Metric{} }
-func (*Metric) ProtoMessage() {}
-func (*Metric) Descriptor() ([]byte, []int) {
- return fileDescriptor_8d594d87edf6e6bc, []int{0}
-}
-func (m *Metric) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Metric) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_Metric.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 *Metric) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Metric.Merge(m, src)
-}
-func (m *Metric) XXX_Size() int {
- return m.Size()
-}
-func (m *Metric) XXX_DiscardUnknown() {
- xxx_messageInfo_Metric.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Metric proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*Metric)(nil), "containerd.types.Metric")
-}
-
-func init() {
- proto.RegisterFile("github.com/containerd/containerd/api/types/metrics.proto", fileDescriptor_8d594d87edf6e6bc)
-}
-
-var fileDescriptor_8d594d87edf6e6bc = []byte{
- // 258 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x48, 0xcf, 0x2c, 0xc9,
- 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d,
- 0x4a, 0x41, 0x66, 0x26, 0x16, 0x64, 0xea, 0x97, 0x54, 0x16, 0xa4, 0x16, 0xeb, 0xe7, 0xa6, 0x96,
- 0x14, 0x65, 0x26, 0x17, 0xeb, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x09, 0x20, 0xd4, 0xe8, 0x81,
- 0xe5, 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x92, 0xfa, 0x20, 0x16, 0x44, 0x9d, 0x94, 0x64,
- 0x7a, 0x7e, 0x7e, 0x7a, 0x4e, 0xaa, 0x3e, 0x98, 0x97, 0x54, 0x9a, 0xa6, 0x9f, 0x98, 0x57, 0x09,
- 0x95, 0x92, 0x47, 0x97, 0x2a, 0xc9, 0xcc, 0x4d, 0x2d, 0x2e, 0x49, 0xcc, 0x2d, 0x80, 0x28, 0x50,
- 0xea, 0x63, 0xe4, 0x62, 0xf3, 0x05, 0xdb, 0x2a, 0xe4, 0xc4, 0xc5, 0x09, 0x97, 0x95, 0x60, 0x54,
- 0x60, 0xd4, 0xe0, 0x36, 0x92, 0xd2, 0x83, 0xe8, 0xd7, 0x83, 0xe9, 0xd7, 0x0b, 0x81, 0xa9, 0x70,
- 0xe2, 0x38, 0x71, 0x4f, 0x9e, 0x61, 0xc2, 0x7d, 0x79, 0xc6, 0x20, 0x84, 0x36, 0x21, 0x31, 0x2e,
- 0xa6, 0xcc, 0x14, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x4e, 0x27, 0xb6, 0x47, 0xf7, 0xe4, 0x99, 0x3c,
- 0x5d, 0x82, 0x98, 0x32, 0x53, 0x84, 0x34, 0xb8, 0x58, 0x52, 0x12, 0x4b, 0x12, 0x25, 0x98, 0xc1,
- 0xc6, 0x8a, 0x60, 0x18, 0xeb, 0x98, 0x57, 0x19, 0x04, 0x56, 0xe1, 0xe4, 0x75, 0xe2, 0xa1, 0x1c,
- 0xc3, 0x8d, 0x87, 0x72, 0x0c, 0x0d, 0x8f, 0xe4, 0x18, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48,
- 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x28, 0x03, 0xe2, 0x03, 0xd2, 0x1a, 0x4c, 0x46, 0x30, 0x24,
- 0xb1, 0x81, 0x6d, 0x30, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xde, 0x0d, 0x02, 0xfe, 0x85, 0x01,
- 0x00, 0x00,
-}
-
-func (m *Metric) 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 *Metric) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *Metric) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Data != nil {
- {
- size, err := m.Data.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintMetrics(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x1a
- }
- if len(m.ID) > 0 {
- i -= len(m.ID)
- copy(dAtA[i:], m.ID)
- i = encodeVarintMetrics(dAtA, i, uint64(len(m.ID)))
- i--
- dAtA[i] = 0x12
- }
- n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):])
- if err2 != nil {
- return 0, err2
- }
- i -= n2
- i = encodeVarintMetrics(dAtA, i, uint64(n2))
- i--
- dAtA[i] = 0xa
- return len(dAtA) - i, nil
-}
-
-func encodeVarintMetrics(dAtA []byte, offset int, v uint64) int {
- offset -= sovMetrics(v)
- base := offset
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return base
-}
-func (m *Metric) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp)
- n += 1 + l + sovMetrics(uint64(l))
- l = len(m.ID)
- if l > 0 {
- n += 1 + l + sovMetrics(uint64(l))
- }
- if m.Data != nil {
- l = m.Data.Size()
- n += 1 + l + sovMetrics(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func sovMetrics(x uint64) (n int) {
- return (math_bits.Len64(x|1) + 6) / 7
-}
-func sozMetrics(x uint64) (n int) {
- return sovMetrics(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-func (this *Metric) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&Metric{`,
- `Timestamp:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Timestamp), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`,
- `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
- `Data:` + strings.Replace(fmt.Sprintf("%v", this.Data), "Any", "types.Any", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func valueToStringMetrics(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
-}
-func (m *Metric) 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 ErrIntOverflowMetrics
- }
- 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: Metric: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: Metric: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- 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 ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthMetrics
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthMetrics
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Data == nil {
- m.Data = &types.Any{}
- }
- if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipMetrics(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthMetrics
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func skipMetrics(dAtA []byte) (n int, err error) {
- l := len(dAtA)
- iNdEx := 0
- depth := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if dAtA[iNdEx-1] < 0x80 {
- break
- }
- }
- case 1:
- iNdEx += 8
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowMetrics
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if length < 0 {
- return 0, ErrInvalidLengthMetrics
- }
- iNdEx += length
- case 3:
- depth++
- case 4:
- if depth == 0 {
- return 0, ErrUnexpectedEndOfGroupMetrics
- }
- depth--
- case 5:
- iNdEx += 4
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- if iNdEx < 0 {
- return 0, ErrInvalidLengthMetrics
- }
- if depth == 0 {
- return iNdEx, nil
- }
- }
- return 0, io.ErrUnexpectedEOF
-}
-
-var (
- ErrInvalidLengthMetrics = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowMetrics = fmt.Errorf("proto: integer overflow")
- ErrUnexpectedEndOfGroupMetrics = fmt.Errorf("proto: unexpected end of group")
-)
diff --git a/vendor/github.com/containerd/containerd/api/types/metrics.proto b/vendor/github.com/containerd/containerd/api/types/metrics.proto
deleted file mode 100644
index 0e631d2ac..000000000
--- a/vendor/github.com/containerd/containerd/api/types/metrics.proto
+++ /dev/null
@@ -1,15 +0,0 @@
-syntax = "proto3";
-
-package containerd.types;
-
-import weak "gogoproto/gogo.proto";
-import "google/protobuf/any.proto";
-import "google/protobuf/timestamp.proto";
-
-option go_package = "github.com/containerd/containerd/api/types;types";
-
-message Metric {
- google.protobuf.Timestamp timestamp = 1 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
- string id = 2;
- google.protobuf.Any data = 3;
-}
diff --git a/vendor/github.com/containerd/containerd/api/types/mount.pb.go b/vendor/github.com/containerd/containerd/api/types/mount.pb.go
deleted file mode 100644
index 6872e4120..000000000
--- a/vendor/github.com/containerd/containerd/api/types/mount.pb.go
+++ /dev/null
@@ -1,497 +0,0 @@
-// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: github.com/containerd/containerd/api/types/mount.proto
-
-package types
-
-import (
- fmt "fmt"
- proto "github.com/gogo/protobuf/proto"
- io "io"
- math "math"
- math_bits "math/bits"
- reflect "reflect"
- strings "strings"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
-
-// Mount describes mounts for a container.
-//
-// This type is the lingua franca of ContainerD. All services provide mounts
-// to be used with the container at creation time.
-//
-// The Mount type follows the structure of the mount syscall, including a type,
-// source, target and options.
-type Mount struct {
- // Type defines the nature of the mount.
- Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
- // Source specifies the name of the mount. Depending on mount type, this
- // may be a volume name or a host path, or even ignored.
- Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"`
- // Target path in container
- Target string `protobuf:"bytes,3,opt,name=target,proto3" json:"target,omitempty"`
- // Options specifies zero or more fstab style mount options.
- Options []string `protobuf:"bytes,4,rep,name=options,proto3" json:"options,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Mount) Reset() { *m = Mount{} }
-func (*Mount) ProtoMessage() {}
-func (*Mount) Descriptor() ([]byte, []int) {
- return fileDescriptor_920196890d4a7b9f, []int{0}
-}
-func (m *Mount) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Mount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_Mount.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 *Mount) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Mount.Merge(m, src)
-}
-func (m *Mount) XXX_Size() int {
- return m.Size()
-}
-func (m *Mount) XXX_DiscardUnknown() {
- xxx_messageInfo_Mount.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Mount proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*Mount)(nil), "containerd.types.Mount")
-}
-
-func init() {
- proto.RegisterFile("github.com/containerd/containerd/api/types/mount.proto", fileDescriptor_920196890d4a7b9f)
-}
-
-var fileDescriptor_920196890d4a7b9f = []byte{
- // 202 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0x4b, 0xcf, 0x2c, 0xc9,
- 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d,
- 0x4a, 0x41, 0x66, 0x26, 0x16, 0x64, 0xea, 0x97, 0x54, 0x16, 0xa4, 0x16, 0xeb, 0xe7, 0xe6, 0x97,
- 0xe6, 0x95, 0xe8, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x09, 0x20, 0x54, 0xe8, 0x81, 0x65, 0xa5,
- 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x92, 0xfa, 0x20, 0x16, 0x44, 0x9d, 0x52, 0x2a, 0x17, 0xab,
- 0x2f, 0x48, 0x9b, 0x90, 0x10, 0x17, 0x0b, 0x48, 0x9d, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x67, 0x10,
- 0x98, 0x2d, 0x24, 0xc6, 0xc5, 0x56, 0x9c, 0x5f, 0x5a, 0x94, 0x9c, 0x2a, 0xc1, 0x04, 0x16, 0x85,
- 0xf2, 0x40, 0xe2, 0x25, 0x89, 0x45, 0xe9, 0xa9, 0x25, 0x12, 0xcc, 0x10, 0x71, 0x08, 0x4f, 0x48,
- 0x82, 0x8b, 0x3d, 0xbf, 0xa0, 0x24, 0x33, 0x3f, 0xaf, 0x58, 0x82, 0x45, 0x81, 0x59, 0x83, 0x33,
- 0x08, 0xc6, 0x75, 0xf2, 0x3a, 0xf1, 0x50, 0x8e, 0xe1, 0xc6, 0x43, 0x39, 0x86, 0x86, 0x47, 0x72,
- 0x8c, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0x63, 0x94, 0x01,
- 0xf1, 0x1e, 0xb4, 0x06, 0x93, 0x11, 0x0c, 0x49, 0x6c, 0x60, 0xb7, 0x1b, 0x03, 0x02, 0x00, 0x00,
- 0xff, 0xff, 0x82, 0x1c, 0x02, 0x18, 0x1d, 0x01, 0x00, 0x00,
-}
-
-func (m *Mount) 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 *Mount) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *Mount) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Options) > 0 {
- for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- {
- i -= len(m.Options[iNdEx])
- copy(dAtA[i:], m.Options[iNdEx])
- i = encodeVarintMount(dAtA, i, uint64(len(m.Options[iNdEx])))
- i--
- dAtA[i] = 0x22
- }
- }
- if len(m.Target) > 0 {
- i -= len(m.Target)
- copy(dAtA[i:], m.Target)
- i = encodeVarintMount(dAtA, i, uint64(len(m.Target)))
- i--
- dAtA[i] = 0x1a
- }
- if len(m.Source) > 0 {
- i -= len(m.Source)
- copy(dAtA[i:], m.Source)
- i = encodeVarintMount(dAtA, i, uint64(len(m.Source)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.Type) > 0 {
- i -= len(m.Type)
- copy(dAtA[i:], m.Type)
- i = encodeVarintMount(dAtA, i, uint64(len(m.Type)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func encodeVarintMount(dAtA []byte, offset int, v uint64) int {
- offset -= sovMount(v)
- base := offset
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return base
-}
-func (m *Mount) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Type)
- if l > 0 {
- n += 1 + l + sovMount(uint64(l))
- }
- l = len(m.Source)
- if l > 0 {
- n += 1 + l + sovMount(uint64(l))
- }
- l = len(m.Target)
- if l > 0 {
- n += 1 + l + sovMount(uint64(l))
- }
- if len(m.Options) > 0 {
- for _, s := range m.Options {
- l = len(s)
- n += 1 + l + sovMount(uint64(l))
- }
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func sovMount(x uint64) (n int) {
- return (math_bits.Len64(x|1) + 6) / 7
-}
-func sozMount(x uint64) (n int) {
- return sovMount(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-func (this *Mount) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&Mount{`,
- `Type:` + fmt.Sprintf("%v", this.Type) + `,`,
- `Source:` + fmt.Sprintf("%v", this.Source) + `,`,
- `Target:` + fmt.Sprintf("%v", this.Target) + `,`,
- `Options:` + fmt.Sprintf("%v", this.Options) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func valueToStringMount(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
-}
-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 ErrIntOverflowMount
- }
- 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 Type", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMount
- }
- 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 ErrInvalidLengthMount
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthMount
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Type = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMount
- }
- 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 ErrInvalidLengthMount
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthMount
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Source = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Target", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMount
- }
- 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 ErrInvalidLengthMount
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthMount
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Target = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 4:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowMount
- }
- 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 ErrInvalidLengthMount
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthMount
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Options = append(m.Options, string(dAtA[iNdEx:postIndex]))
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipMount(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthMount
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthMount
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func skipMount(dAtA []byte) (n int, err error) {
- l := len(dAtA)
- iNdEx := 0
- depth := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowMount
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowMount
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if dAtA[iNdEx-1] < 0x80 {
- break
- }
- }
- case 1:
- iNdEx += 8
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowMount
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if length < 0 {
- return 0, ErrInvalidLengthMount
- }
- iNdEx += length
- case 3:
- depth++
- case 4:
- if depth == 0 {
- return 0, ErrUnexpectedEndOfGroupMount
- }
- depth--
- case 5:
- iNdEx += 4
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- if iNdEx < 0 {
- return 0, ErrInvalidLengthMount
- }
- if depth == 0 {
- return iNdEx, nil
- }
- }
- return 0, io.ErrUnexpectedEOF
-}
-
-var (
- ErrInvalidLengthMount = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowMount = fmt.Errorf("proto: integer overflow")
- ErrUnexpectedEndOfGroupMount = fmt.Errorf("proto: unexpected end of group")
-)
diff --git a/vendor/github.com/containerd/containerd/api/types/mount.proto b/vendor/github.com/containerd/containerd/api/types/mount.proto
deleted file mode 100644
index cd80e44a2..000000000
--- a/vendor/github.com/containerd/containerd/api/types/mount.proto
+++ /dev/null
@@ -1,29 +0,0 @@
-syntax = "proto3";
-
-package containerd.types;
-
-import weak "gogoproto/gogo.proto";
-
-option go_package = "github.com/containerd/containerd/api/types;types";
-
-// Mount describes mounts for a container.
-//
-// This type is the lingua franca of ContainerD. All services provide mounts
-// to be used with the container at creation time.
-//
-// The Mount type follows the structure of the mount syscall, including a type,
-// source, target and options.
-message Mount {
- // Type defines the nature of the mount.
- string type = 1;
-
- // Source specifies the name of the mount. Depending on mount type, this
- // may be a volume name or a host path, or even ignored.
- string source = 2;
-
- // Target path in container
- string target = 3;
-
- // Options specifies zero or more fstab style mount options.
- repeated string options = 4;
-}
diff --git a/vendor/github.com/containerd/containerd/api/types/platform.pb.go b/vendor/github.com/containerd/containerd/api/types/platform.pb.go
deleted file mode 100644
index c03d8b077..000000000
--- a/vendor/github.com/containerd/containerd/api/types/platform.pb.go
+++ /dev/null
@@ -1,438 +0,0 @@
-// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: github.com/containerd/containerd/api/types/platform.proto
-
-package types
-
-import (
- fmt "fmt"
- proto "github.com/gogo/protobuf/proto"
- io "io"
- math "math"
- math_bits "math/bits"
- reflect "reflect"
- strings "strings"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
-
-// Platform follows the structure of the OCI platform specification, from
-// descriptors.
-type Platform struct {
- OS string `protobuf:"bytes,1,opt,name=os,proto3" json:"os,omitempty"`
- Architecture string `protobuf:"bytes,2,opt,name=architecture,proto3" json:"architecture,omitempty"`
- Variant string `protobuf:"bytes,3,opt,name=variant,proto3" json:"variant,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Platform) Reset() { *m = Platform{} }
-func (*Platform) ProtoMessage() {}
-func (*Platform) Descriptor() ([]byte, []int) {
- return fileDescriptor_24ba7a4b83e2367e, []int{0}
-}
-func (m *Platform) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Platform) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_Platform.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 *Platform) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Platform.Merge(m, src)
-}
-func (m *Platform) XXX_Size() int {
- return m.Size()
-}
-func (m *Platform) XXX_DiscardUnknown() {
- xxx_messageInfo_Platform.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Platform proto.InternalMessageInfo
-
-func init() {
- proto.RegisterType((*Platform)(nil), "containerd.types.Platform")
-}
-
-func init() {
- proto.RegisterFile("github.com/containerd/containerd/api/types/platform.proto", fileDescriptor_24ba7a4b83e2367e)
-}
-
-var fileDescriptor_24ba7a4b83e2367e = []byte{
- // 205 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x4c, 0xcf, 0x2c, 0xc9,
- 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d,
- 0x4a, 0x41, 0x66, 0x26, 0x16, 0x64, 0xea, 0x97, 0x54, 0x16, 0xa4, 0x16, 0xeb, 0x17, 0xe4, 0x24,
- 0x96, 0xa4, 0xe5, 0x17, 0xe5, 0xea, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x09, 0x20, 0x14, 0xe9,
- 0x81, 0x15, 0x48, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0x25, 0xf5, 0x41, 0x2c, 0x88, 0x3a, 0xa5,
- 0x04, 0x2e, 0x8e, 0x00, 0xa8, 0x4e, 0x21, 0x31, 0x2e, 0xa6, 0xfc, 0x62, 0x09, 0x46, 0x05, 0x46,
- 0x0d, 0x4e, 0x27, 0xb6, 0x47, 0xf7, 0xe4, 0x99, 0xfc, 0x83, 0x83, 0x98, 0xf2, 0x8b, 0x85, 0x94,
- 0xb8, 0x78, 0x12, 0x8b, 0x92, 0x33, 0x32, 0x4b, 0x52, 0x93, 0x4b, 0x4a, 0x8b, 0x52, 0x25, 0x98,
- 0x40, 0x2a, 0x82, 0x50, 0xc4, 0x84, 0x24, 0xb8, 0xd8, 0xcb, 0x12, 0x8b, 0x32, 0x13, 0xf3, 0x4a,
- 0x24, 0x98, 0xc1, 0xd2, 0x30, 0xae, 0x93, 0xd7, 0x89, 0x87, 0x72, 0x0c, 0x37, 0x1e, 0xca, 0x31,
- 0x34, 0x3c, 0x92, 0x63, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4,
- 0x18, 0xa3, 0x0c, 0x88, 0xf7, 0x9e, 0x35, 0x98, 0x8c, 0x60, 0x48, 0x62, 0x03, 0x3b, 0xdb, 0x18,
- 0x10, 0x00, 0x00, 0xff, 0xff, 0x05, 0xaa, 0xda, 0xa1, 0x1b, 0x01, 0x00, 0x00,
-}
-
-func (m *Platform) 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 *Platform) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *Platform) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if len(m.Variant) > 0 {
- i -= len(m.Variant)
- copy(dAtA[i:], m.Variant)
- i = encodeVarintPlatform(dAtA, i, uint64(len(m.Variant)))
- i--
- dAtA[i] = 0x1a
- }
- if len(m.Architecture) > 0 {
- i -= len(m.Architecture)
- copy(dAtA[i:], m.Architecture)
- i = encodeVarintPlatform(dAtA, i, uint64(len(m.Architecture)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.OS) > 0 {
- i -= len(m.OS)
- copy(dAtA[i:], m.OS)
- i = encodeVarintPlatform(dAtA, i, uint64(len(m.OS)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func encodeVarintPlatform(dAtA []byte, offset int, v uint64) int {
- offset -= sovPlatform(v)
- base := offset
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return base
-}
-func (m *Platform) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.OS)
- if l > 0 {
- n += 1 + l + sovPlatform(uint64(l))
- }
- l = len(m.Architecture)
- if l > 0 {
- n += 1 + l + sovPlatform(uint64(l))
- }
- l = len(m.Variant)
- if l > 0 {
- n += 1 + l + sovPlatform(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func sovPlatform(x uint64) (n int) {
- return (math_bits.Len64(x|1) + 6) / 7
-}
-func sozPlatform(x uint64) (n int) {
- return sovPlatform(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-func (this *Platform) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&Platform{`,
- `OS:` + fmt.Sprintf("%v", this.OS) + `,`,
- `Architecture:` + fmt.Sprintf("%v", this.Architecture) + `,`,
- `Variant:` + fmt.Sprintf("%v", this.Variant) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func valueToStringPlatform(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
-}
-func (m *Platform) 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 ErrIntOverflowPlatform
- }
- 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: Platform: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: Platform: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field OS", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowPlatform
- }
- 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 ErrInvalidLengthPlatform
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthPlatform
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.OS = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Architecture", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowPlatform
- }
- 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 ErrInvalidLengthPlatform
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthPlatform
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Architecture = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Variant", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowPlatform
- }
- 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 ErrInvalidLengthPlatform
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthPlatform
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Variant = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipPlatform(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthPlatform
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthPlatform
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func skipPlatform(dAtA []byte) (n int, err error) {
- l := len(dAtA)
- iNdEx := 0
- depth := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowPlatform
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowPlatform
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if dAtA[iNdEx-1] < 0x80 {
- break
- }
- }
- case 1:
- iNdEx += 8
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowPlatform
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if length < 0 {
- return 0, ErrInvalidLengthPlatform
- }
- iNdEx += length
- case 3:
- depth++
- case 4:
- if depth == 0 {
- return 0, ErrUnexpectedEndOfGroupPlatform
- }
- depth--
- case 5:
- iNdEx += 4
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- if iNdEx < 0 {
- return 0, ErrInvalidLengthPlatform
- }
- if depth == 0 {
- return iNdEx, nil
- }
- }
- return 0, io.ErrUnexpectedEOF
-}
-
-var (
- ErrInvalidLengthPlatform = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowPlatform = fmt.Errorf("proto: integer overflow")
- ErrUnexpectedEndOfGroupPlatform = fmt.Errorf("proto: unexpected end of group")
-)
diff --git a/vendor/github.com/containerd/containerd/api/types/platform.proto b/vendor/github.com/containerd/containerd/api/types/platform.proto
deleted file mode 100644
index 4cf9834bd..000000000
--- a/vendor/github.com/containerd/containerd/api/types/platform.proto
+++ /dev/null
@@ -1,15 +0,0 @@
-syntax = "proto3";
-
-package containerd.types;
-
-import weak "gogoproto/gogo.proto";
-
-option go_package = "github.com/containerd/containerd/api/types;types";
-
-// Platform follows the structure of the OCI platform specification, from
-// descriptors.
-message Platform {
- string os = 1 [(gogoproto.customname) = "OS"];
- string architecture = 2;
- string variant = 3;
-}
diff --git a/vendor/github.com/containerd/containerd/api/types/task/task.pb.go b/vendor/github.com/containerd/containerd/api/types/task/task.pb.go
deleted file mode 100644
index ae824ff45..000000000
--- a/vendor/github.com/containerd/containerd/api/types/task/task.pb.go
+++ /dev/null
@@ -1,986 +0,0 @@
-// Code generated by protoc-gen-gogo. DO NOT EDIT.
-// source: github.com/containerd/containerd/api/types/task/task.proto
-
-package task
-
-import (
- fmt "fmt"
- proto "github.com/gogo/protobuf/proto"
- github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
- types "github.com/gogo/protobuf/types"
- io "io"
- math "math"
- math_bits "math/bits"
- reflect "reflect"
- strings "strings"
- time "time"
-)
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-var _ = time.Kitchen
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
-
-type Status int32
-
-const (
- StatusUnknown Status = 0
- StatusCreated Status = 1
- StatusRunning Status = 2
- StatusStopped Status = 3
- StatusPaused Status = 4
- StatusPausing Status = 5
-)
-
-var Status_name = map[int32]string{
- 0: "UNKNOWN",
- 1: "CREATED",
- 2: "RUNNING",
- 3: "STOPPED",
- 4: "PAUSED",
- 5: "PAUSING",
-}
-
-var Status_value = map[string]int32{
- "UNKNOWN": 0,
- "CREATED": 1,
- "RUNNING": 2,
- "STOPPED": 3,
- "PAUSED": 4,
- "PAUSING": 5,
-}
-
-func (x Status) String() string {
- return proto.EnumName(Status_name, int32(x))
-}
-
-func (Status) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_391ef18c8ab0dc16, []int{0}
-}
-
-type Process struct {
- ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
- ID string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
- Pid uint32 `protobuf:"varint,3,opt,name=pid,proto3" json:"pid,omitempty"`
- Status Status `protobuf:"varint,4,opt,name=status,proto3,enum=containerd.v1.types.Status" json:"status,omitempty"`
- Stdin string `protobuf:"bytes,5,opt,name=stdin,proto3" json:"stdin,omitempty"`
- Stdout string `protobuf:"bytes,6,opt,name=stdout,proto3" json:"stdout,omitempty"`
- Stderr string `protobuf:"bytes,7,opt,name=stderr,proto3" json:"stderr,omitempty"`
- Terminal bool `protobuf:"varint,8,opt,name=terminal,proto3" json:"terminal,omitempty"`
- ExitStatus uint32 `protobuf:"varint,9,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"`
- ExitedAt time.Time `protobuf:"bytes,10,opt,name=exited_at,json=exitedAt,proto3,stdtime" json:"exited_at"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *Process) Reset() { *m = Process{} }
-func (*Process) ProtoMessage() {}
-func (*Process) Descriptor() ([]byte, []int) {
- return fileDescriptor_391ef18c8ab0dc16, []int{0}
-}
-func (m *Process) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *Process) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_Process.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 *Process) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Process.Merge(m, src)
-}
-func (m *Process) XXX_Size() int {
- return m.Size()
-}
-func (m *Process) XXX_DiscardUnknown() {
- xxx_messageInfo_Process.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Process proto.InternalMessageInfo
-
-type ProcessInfo struct {
- // PID is the process ID.
- Pid uint32 `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"`
- // Info contains additional process information.
- //
- // Info varies by platform.
- Info *types.Any `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *ProcessInfo) Reset() { *m = ProcessInfo{} }
-func (*ProcessInfo) ProtoMessage() {}
-func (*ProcessInfo) Descriptor() ([]byte, []int) {
- return fileDescriptor_391ef18c8ab0dc16, []int{1}
-}
-func (m *ProcessInfo) XXX_Unmarshal(b []byte) error {
- return m.Unmarshal(b)
-}
-func (m *ProcessInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- if deterministic {
- return xxx_messageInfo_ProcessInfo.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 *ProcessInfo) XXX_Merge(src proto.Message) {
- xxx_messageInfo_ProcessInfo.Merge(m, src)
-}
-func (m *ProcessInfo) XXX_Size() int {
- return m.Size()
-}
-func (m *ProcessInfo) XXX_DiscardUnknown() {
- xxx_messageInfo_ProcessInfo.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ProcessInfo proto.InternalMessageInfo
-
-func init() {
- proto.RegisterEnum("containerd.v1.types.Status", Status_name, Status_value)
- proto.RegisterType((*Process)(nil), "containerd.v1.types.Process")
- proto.RegisterType((*ProcessInfo)(nil), "containerd.v1.types.ProcessInfo")
-}
-
-func init() {
- proto.RegisterFile("github.com/containerd/containerd/api/types/task/task.proto", fileDescriptor_391ef18c8ab0dc16)
-}
-
-var fileDescriptor_391ef18c8ab0dc16 = []byte{
- // 545 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0x3f, 0x6f, 0xd3, 0x40,
- 0x18, 0xc6, 0x7d, 0x6e, 0xeb, 0xa6, 0xe7, 0xb6, 0x18, 0x13, 0x55, 0xc6, 0x20, 0xdb, 0xea, 0x64,
- 0x31, 0xd8, 0x22, 0xdd, 0xd8, 0xf2, 0x4f, 0xc8, 0x42, 0x72, 0x23, 0x27, 0x11, 0x6c, 0x91, 0x13,
- 0x5f, 0xcc, 0xa9, 0xcd, 0x9d, 0x65, 0x9f, 0x81, 0x6c, 0x8c, 0xa8, 0x13, 0x5f, 0xa0, 0x13, 0x7c,
- 0x0a, 0x3e, 0x41, 0x46, 0x26, 0xc4, 0x14, 0xa8, 0x3f, 0x09, 0x3a, 0xdb, 0x49, 0x23, 0x60, 0x39,
- 0xbd, 0xef, 0xf3, 0x7b, 0xee, 0xbd, 0xf7, 0x1e, 0xf8, 0x22, 0xc6, 0xec, 0x6d, 0x3e, 0x75, 0x66,
- 0x74, 0xe1, 0xce, 0x28, 0x61, 0x21, 0x26, 0x28, 0x8d, 0x76, 0xcb, 0x30, 0xc1, 0x2e, 0x5b, 0x26,
- 0x28, 0x73, 0x59, 0x98, 0x5d, 0x95, 0x87, 0x93, 0xa4, 0x94, 0x51, 0xf5, 0xd1, 0xbd, 0xcb, 0x79,
- 0xf7, 0xdc, 0x29, 0x4d, 0x7a, 0x33, 0xa6, 0x31, 0x2d, 0xb9, 0xcb, 0xab, 0xca, 0xaa, 0x9b, 0x31,
- 0xa5, 0xf1, 0x35, 0x72, 0xcb, 0x6e, 0x9a, 0xcf, 0x5d, 0x86, 0x17, 0x28, 0x63, 0xe1, 0x22, 0xa9,
- 0x0d, 0x8f, 0xff, 0x36, 0x84, 0x64, 0x59, 0xa1, 0xf3, 0x42, 0x84, 0x87, 0x83, 0x94, 0xce, 0x50,
- 0x96, 0xa9, 0x2d, 0x78, 0xbc, 0x7d, 0x74, 0x82, 0x23, 0x0d, 0x58, 0xc0, 0x3e, 0xea, 0x3c, 0x28,
- 0xd6, 0xa6, 0xdc, 0xdd, 0xe8, 0x5e, 0x2f, 0x90, 0xb7, 0x26, 0x2f, 0x52, 0xcf, 0xa0, 0x88, 0x23,
- 0x4d, 0x2c, 0x9d, 0x52, 0xb1, 0x36, 0x45, 0xaf, 0x17, 0x88, 0x38, 0x52, 0x15, 0xb8, 0x97, 0xe0,
- 0x48, 0xdb, 0xb3, 0x80, 0x7d, 0x12, 0xf0, 0x52, 0xbd, 0x80, 0x52, 0xc6, 0x42, 0x96, 0x67, 0xda,
- 0xbe, 0x05, 0xec, 0xd3, 0xd6, 0x13, 0xe7, 0x3f, 0x3f, 0x74, 0x86, 0xa5, 0x25, 0xa8, 0xad, 0x6a,
- 0x13, 0x1e, 0x64, 0x2c, 0xc2, 0x44, 0x3b, 0xe0, 0x2f, 0x04, 0x55, 0xa3, 0x9e, 0xf1, 0x51, 0x11,
- 0xcd, 0x99, 0x26, 0x95, 0x72, 0xdd, 0xd5, 0x3a, 0x4a, 0x53, 0xed, 0x70, 0xab, 0xa3, 0x34, 0x55,
- 0x75, 0xd8, 0x60, 0x28, 0x5d, 0x60, 0x12, 0x5e, 0x6b, 0x0d, 0x0b, 0xd8, 0x8d, 0x60, 0xdb, 0xab,
- 0x26, 0x94, 0xd1, 0x07, 0xcc, 0x26, 0xf5, 0x6e, 0x47, 0xe5, 0xc2, 0x90, 0x4b, 0xd5, 0x2a, 0x6a,
- 0x1b, 0x1e, 0xf1, 0x0e, 0x45, 0x93, 0x90, 0x69, 0xd0, 0x02, 0xb6, 0xdc, 0xd2, 0x9d, 0x2a, 0x50,
- 0x67, 0x13, 0xa8, 0x33, 0xda, 0x24, 0xde, 0x69, 0xac, 0xd6, 0xa6, 0xf0, 0xf9, 0x97, 0x09, 0x82,
- 0x46, 0x75, 0xad, 0xcd, 0xce, 0x3d, 0x28, 0xd7, 0x19, 0x7b, 0x64, 0x4e, 0x37, 0xd9, 0x80, 0xfb,
- 0x6c, 0x6c, 0xb8, 0x8f, 0xc9, 0x9c, 0x96, 0x39, 0xca, 0xad, 0xe6, 0x3f, 0xe3, 0xdb, 0x64, 0x19,
- 0x94, 0x8e, 0x67, 0x3f, 0x00, 0x94, 0xea, 0xc5, 0x0c, 0x78, 0x38, 0xf6, 0x5f, 0xf9, 0x97, 0xaf,
- 0x7d, 0x45, 0xd0, 0x1f, 0xde, 0xdc, 0x5a, 0x27, 0x15, 0x18, 0x93, 0x2b, 0x42, 0xdf, 0x13, 0xce,
- 0xbb, 0x41, 0xbf, 0x3d, 0xea, 0xf7, 0x14, 0xb0, 0xcb, 0xbb, 0x29, 0x0a, 0x19, 0x8a, 0x38, 0x0f,
- 0xc6, 0xbe, 0xef, 0xf9, 0x2f, 0x15, 0x71, 0x97, 0x07, 0x39, 0x21, 0x98, 0xc4, 0x9c, 0x0f, 0x47,
- 0x97, 0x83, 0x41, 0xbf, 0xa7, 0xec, 0xed, 0xf2, 0x21, 0xa3, 0x49, 0x82, 0x22, 0xf5, 0x29, 0x94,
- 0x06, 0xed, 0xf1, 0xb0, 0xdf, 0x53, 0xf6, 0x75, 0xe5, 0xe6, 0xd6, 0x3a, 0xae, 0xf0, 0x20, 0xcc,
- 0xb3, 0x6a, 0x3a, 0xa7, 0x7c, 0xfa, 0xc1, 0xee, 0x6d, 0x8e, 0x31, 0x89, 0xf5, 0xd3, 0x4f, 0x5f,
- 0x0c, 0xe1, 0xdb, 0x57, 0xa3, 0xfe, 0x4d, 0x47, 0x5b, 0xdd, 0x19, 0xc2, 0xcf, 0x3b, 0x43, 0xf8,
- 0x58, 0x18, 0x60, 0x55, 0x18, 0xe0, 0x7b, 0x61, 0x80, 0xdf, 0x85, 0x01, 0xde, 0x08, 0x53, 0xa9,
- 0x0c, 0xe2, 0xe2, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc3, 0x32, 0xd2, 0x86, 0x50, 0x03, 0x00,
- 0x00,
-}
-
-func (m *Process) 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 *Process) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *Process) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt):])
- if err1 != nil {
- return 0, err1
- }
- i -= n1
- i = encodeVarintTask(dAtA, i, uint64(n1))
- i--
- dAtA[i] = 0x52
- if m.ExitStatus != 0 {
- i = encodeVarintTask(dAtA, i, uint64(m.ExitStatus))
- i--
- dAtA[i] = 0x48
- }
- if m.Terminal {
- i--
- if m.Terminal {
- dAtA[i] = 1
- } else {
- dAtA[i] = 0
- }
- i--
- dAtA[i] = 0x40
- }
- if len(m.Stderr) > 0 {
- i -= len(m.Stderr)
- copy(dAtA[i:], m.Stderr)
- i = encodeVarintTask(dAtA, i, uint64(len(m.Stderr)))
- i--
- dAtA[i] = 0x3a
- }
- if len(m.Stdout) > 0 {
- i -= len(m.Stdout)
- copy(dAtA[i:], m.Stdout)
- i = encodeVarintTask(dAtA, i, uint64(len(m.Stdout)))
- i--
- dAtA[i] = 0x32
- }
- if len(m.Stdin) > 0 {
- i -= len(m.Stdin)
- copy(dAtA[i:], m.Stdin)
- i = encodeVarintTask(dAtA, i, uint64(len(m.Stdin)))
- i--
- dAtA[i] = 0x2a
- }
- if m.Status != 0 {
- i = encodeVarintTask(dAtA, i, uint64(m.Status))
- i--
- dAtA[i] = 0x20
- }
- if m.Pid != 0 {
- i = encodeVarintTask(dAtA, i, uint64(m.Pid))
- i--
- dAtA[i] = 0x18
- }
- if len(m.ID) > 0 {
- i -= len(m.ID)
- copy(dAtA[i:], m.ID)
- i = encodeVarintTask(dAtA, i, uint64(len(m.ID)))
- i--
- dAtA[i] = 0x12
- }
- if len(m.ContainerID) > 0 {
- i -= len(m.ContainerID)
- copy(dAtA[i:], m.ContainerID)
- i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID)))
- i--
- dAtA[i] = 0xa
- }
- return len(dAtA) - i, nil
-}
-
-func (m *ProcessInfo) 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 *ProcessInfo) MarshalTo(dAtA []byte) (int, error) {
- size := m.Size()
- return m.MarshalToSizedBuffer(dAtA[:size])
-}
-
-func (m *ProcessInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) {
- i := len(dAtA)
- _ = i
- var l int
- _ = l
- if m.XXX_unrecognized != nil {
- i -= len(m.XXX_unrecognized)
- copy(dAtA[i:], m.XXX_unrecognized)
- }
- if m.Info != nil {
- {
- size, err := m.Info.MarshalToSizedBuffer(dAtA[:i])
- if err != nil {
- return 0, err
- }
- i -= size
- i = encodeVarintTask(dAtA, i, uint64(size))
- }
- i--
- dAtA[i] = 0x12
- }
- if m.Pid != 0 {
- i = encodeVarintTask(dAtA, i, uint64(m.Pid))
- i--
- dAtA[i] = 0x8
- }
- return len(dAtA) - i, nil
-}
-
-func encodeVarintTask(dAtA []byte, offset int, v uint64) int {
- offset -= sovTask(v)
- base := offset
- for v >= 1<<7 {
- dAtA[offset] = uint8(v&0x7f | 0x80)
- v >>= 7
- offset++
- }
- dAtA[offset] = uint8(v)
- return base
-}
-func (m *Process) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.ContainerID)
- if l > 0 {
- n += 1 + l + sovTask(uint64(l))
- }
- l = len(m.ID)
- if l > 0 {
- n += 1 + l + sovTask(uint64(l))
- }
- if m.Pid != 0 {
- n += 1 + sovTask(uint64(m.Pid))
- }
- if m.Status != 0 {
- n += 1 + sovTask(uint64(m.Status))
- }
- l = len(m.Stdin)
- if l > 0 {
- n += 1 + l + sovTask(uint64(l))
- }
- l = len(m.Stdout)
- if l > 0 {
- n += 1 + l + sovTask(uint64(l))
- }
- l = len(m.Stderr)
- if l > 0 {
- n += 1 + l + sovTask(uint64(l))
- }
- if m.Terminal {
- n += 2
- }
- if m.ExitStatus != 0 {
- n += 1 + sovTask(uint64(m.ExitStatus))
- }
- l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt)
- n += 1 + l + sovTask(uint64(l))
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func (m *ProcessInfo) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Pid != 0 {
- n += 1 + sovTask(uint64(m.Pid))
- }
- if m.Info != nil {
- l = m.Info.Size()
- n += 1 + l + sovTask(uint64(l))
- }
- if m.XXX_unrecognized != nil {
- n += len(m.XXX_unrecognized)
- }
- return n
-}
-
-func sovTask(x uint64) (n int) {
- return (math_bits.Len64(x|1) + 6) / 7
-}
-func sozTask(x uint64) (n int) {
- return sovTask(uint64((x << 1) ^ uint64((int64(x) >> 63))))
-}
-func (this *Process) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&Process{`,
- `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`,
- `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
- `Pid:` + fmt.Sprintf("%v", this.Pid) + `,`,
- `Status:` + fmt.Sprintf("%v", this.Status) + `,`,
- `Stdin:` + fmt.Sprintf("%v", this.Stdin) + `,`,
- `Stdout:` + fmt.Sprintf("%v", this.Stdout) + `,`,
- `Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`,
- `Terminal:` + fmt.Sprintf("%v", this.Terminal) + `,`,
- `ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`,
- `ExitedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ExitedAt), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func (this *ProcessInfo) String() string {
- if this == nil {
- return "nil"
- }
- s := strings.Join([]string{`&ProcessInfo{`,
- `Pid:` + fmt.Sprintf("%v", this.Pid) + `,`,
- `Info:` + strings.Replace(fmt.Sprintf("%v", this.Info), "Any", "types.Any", 1) + `,`,
- `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
- `}`,
- }, "")
- return s
-}
-func valueToStringTask(v interface{}) string {
- rv := reflect.ValueOf(v)
- if rv.IsNil() {
- return "nil"
- }
- pv := reflect.Indirect(rv).Interface()
- return fmt.Sprintf("*%v", pv)
-}
-func (m *Process) 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 ErrIntOverflowTask
- }
- 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: Process: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: Process: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- 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 ErrInvalidLengthTask
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ContainerID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- 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 ErrInvalidLengthTask
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.ID = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 3:
- 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 ErrIntOverflowTask
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Pid |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 4:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType)
- }
- m.Status = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Status |= Status(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 5:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Stdin", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- 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 ErrInvalidLengthTask
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Stdin = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 6:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Stdout", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- 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 ErrInvalidLengthTask
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Stdout = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 7:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Stderr", wireType)
- }
- var stringLen uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- 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 ErrInvalidLengthTask
- }
- postIndex := iNdEx + intStringLen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Stderr = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 8:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field Terminal", wireType)
- }
- var v int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- v |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- m.Terminal = bool(v != 0)
- case 9:
- if wireType != 0 {
- return fmt.Errorf("proto: wrong wireType = %d for field ExitStatus", wireType)
- }
- m.ExitStatus = 0
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.ExitStatus |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 10:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field ExitedAt", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthTask
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ExitedAt, dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTask(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTask
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTask
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func (m *ProcessInfo) 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 ErrIntOverflowTask
- }
- 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: ProcessInfo: wiretype end group for non-group")
- }
- if fieldNum <= 0 {
- return fmt.Errorf("proto: ProcessInfo: illegal tag %d (wire type %d)", fieldNum, wire)
- }
- switch fieldNum {
- case 1:
- 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 ErrIntOverflowTask
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- m.Pid |= uint32(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowTask
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthTask
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthTask
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Info == nil {
- m.Info = &types.Any{}
- }
- if err := m.Info.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- default:
- iNdEx = preIndex
- skippy, err := skipTask(dAtA[iNdEx:])
- if err != nil {
- return err
- }
- if skippy < 0 {
- return ErrInvalidLengthTask
- }
- if (iNdEx + skippy) < 0 {
- return ErrInvalidLengthTask
- }
- if (iNdEx + skippy) > l {
- return io.ErrUnexpectedEOF
- }
- m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
- iNdEx += skippy
- }
- }
-
- if iNdEx > l {
- return io.ErrUnexpectedEOF
- }
- return nil
-}
-func skipTask(dAtA []byte) (n int, err error) {
- l := len(dAtA)
- iNdEx := 0
- depth := 0
- for iNdEx < l {
- var wire uint64
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowTask
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- wire |= (uint64(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- wireType := int(wire & 0x7)
- switch wireType {
- case 0:
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowTask
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- iNdEx++
- if dAtA[iNdEx-1] < 0x80 {
- break
- }
- }
- case 1:
- iNdEx += 8
- case 2:
- var length int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return 0, ErrIntOverflowTask
- }
- if iNdEx >= l {
- return 0, io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- length |= (int(b) & 0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if length < 0 {
- return 0, ErrInvalidLengthTask
- }
- iNdEx += length
- case 3:
- depth++
- case 4:
- if depth == 0 {
- return 0, ErrUnexpectedEndOfGroupTask
- }
- depth--
- case 5:
- iNdEx += 4
- default:
- return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
- }
- if iNdEx < 0 {
- return 0, ErrInvalidLengthTask
- }
- if depth == 0 {
- return iNdEx, nil
- }
- }
- return 0, io.ErrUnexpectedEOF
-}
-
-var (
- ErrInvalidLengthTask = fmt.Errorf("proto: negative length found during unmarshaling")
- ErrIntOverflowTask = fmt.Errorf("proto: integer overflow")
- ErrUnexpectedEndOfGroupTask = fmt.Errorf("proto: unexpected end of group")
-)
diff --git a/vendor/github.com/containerd/containerd/api/types/task/task.proto b/vendor/github.com/containerd/containerd/api/types/task/task.proto
deleted file mode 100644
index da91cb033..000000000
--- a/vendor/github.com/containerd/containerd/api/types/task/task.proto
+++ /dev/null
@@ -1,41 +0,0 @@
-syntax = "proto3";
-
-package containerd.v1.types;
-
-import weak "gogoproto/gogo.proto";
-import "google/protobuf/timestamp.proto";
-import "google/protobuf/any.proto";
-
-enum Status {
- option (gogoproto.goproto_enum_prefix) = false;
- option (gogoproto.enum_customname) = "Status";
-
- UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "StatusUnknown"];
- CREATED = 1 [(gogoproto.enumvalue_customname) = "StatusCreated"];
- RUNNING = 2 [(gogoproto.enumvalue_customname) = "StatusRunning"];
- STOPPED = 3 [(gogoproto.enumvalue_customname) = "StatusStopped"];
- PAUSED = 4 [(gogoproto.enumvalue_customname) = "StatusPaused"];
- PAUSING = 5 [(gogoproto.enumvalue_customname) = "StatusPausing"];
-}
-
-message Process {
- string container_id = 1;
- string id = 2;
- uint32 pid = 3;
- Status status = 4;
- string stdin = 5;
- string stdout = 6;
- string stderr = 7;
- bool terminal = 8;
- uint32 exit_status = 9;
- google.protobuf.Timestamp exited_at = 10 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
-}
-
-message ProcessInfo {
- // PID is the process ID.
- uint32 pid = 1;
- // Info contains additional process information.
- //
- // Info varies by platform.
- google.protobuf.Any info = 2;
-}
diff --git a/vendor/github.com/containerd/containerd/archive/compression/compression.go b/vendor/github.com/containerd/containerd/archive/compression/compression.go
deleted file mode 100644
index 2338de6b9..000000000
--- a/vendor/github.com/containerd/containerd/archive/compression/compression.go
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package compression
-
-import (
- "bufio"
- "bytes"
- "compress/gzip"
- "context"
- "fmt"
- "io"
- "os"
- "os/exec"
- "strconv"
- "sync"
-
- "github.com/containerd/containerd/log"
-)
-
-type (
- // Compression is the state represents if compressed or not.
- Compression int
-)
-
-const (
- // Uncompressed represents the uncompressed.
- Uncompressed Compression = iota
- // Gzip is gzip compression algorithm.
- Gzip
-)
-
-const disablePigzEnv = "CONTAINERD_DISABLE_PIGZ"
-
-var (
- initPigz sync.Once
- unpigzPath string
-)
-
-var (
- bufioReader32KPool = &sync.Pool{
- New: func() interface{} { return bufio.NewReaderSize(nil, 32*1024) },
- }
-)
-
-// DecompressReadCloser include the stream after decompress and the compress method detected.
-type DecompressReadCloser interface {
- io.ReadCloser
- // GetCompression returns the compress method which is used before decompressing
- GetCompression() Compression
-}
-
-type readCloserWrapper struct {
- io.Reader
- compression Compression
- closer func() error
-}
-
-func (r *readCloserWrapper) Close() error {
- if r.closer != nil {
- return r.closer()
- }
- return nil
-}
-
-func (r *readCloserWrapper) GetCompression() Compression {
- return r.compression
-}
-
-type writeCloserWrapper struct {
- io.Writer
- closer func() error
-}
-
-func (w *writeCloserWrapper) Close() error {
- if w.closer != nil {
- w.closer()
- }
- return nil
-}
-
-type bufferedReader struct {
- buf *bufio.Reader
-}
-
-func newBufferedReader(r io.Reader) *bufferedReader {
- buf := bufioReader32KPool.Get().(*bufio.Reader)
- buf.Reset(r)
- return &bufferedReader{buf}
-}
-
-func (r *bufferedReader) Read(p []byte) (n int, err error) {
- if r.buf == nil {
- return 0, io.EOF
- }
- n, err = r.buf.Read(p)
- if err == io.EOF {
- r.buf.Reset(nil)
- bufioReader32KPool.Put(r.buf)
- r.buf = nil
- }
- return
-}
-
-func (r *bufferedReader) Peek(n int) ([]byte, error) {
- if r.buf == nil {
- return nil, io.EOF
- }
- return r.buf.Peek(n)
-}
-
-// DetectCompression detects the compression algorithm of the source.
-func DetectCompression(source []byte) Compression {
- for compression, m := range map[Compression][]byte{
- Gzip: {0x1F, 0x8B, 0x08},
- } {
- if len(source) < len(m) {
- // Len too short
- continue
- }
- if bytes.Equal(m, source[:len(m)]) {
- return compression
- }
- }
- return Uncompressed
-}
-
-// DecompressStream decompresses the archive and returns a ReaderCloser with the decompressed archive.
-func DecompressStream(archive io.Reader) (DecompressReadCloser, error) {
- buf := newBufferedReader(archive)
- bs, err := buf.Peek(10)
- if err != nil && err != io.EOF {
- // Note: we'll ignore any io.EOF error because there are some odd
- // cases where the layer.tar file will be empty (zero bytes) and
- // that results in an io.EOF from the Peek() call. So, in those
- // cases we'll just treat it as a non-compressed stream and
- // that means just create an empty layer.
- // See Issue docker/docker#18170
- return nil, err
- }
-
- switch compression := DetectCompression(bs); compression {
- case Uncompressed:
- return &readCloserWrapper{
- Reader: buf,
- compression: compression,
- }, nil
- case Gzip:
- ctx, cancel := context.WithCancel(context.Background())
- gzReader, err := gzipDecompress(ctx, buf)
- if err != nil {
- cancel()
- return nil, err
- }
-
- return &readCloserWrapper{
- Reader: gzReader,
- compression: compression,
- closer: func() error {
- cancel()
- return gzReader.Close()
- },
- }, nil
-
- default:
- return nil, fmt.Errorf("unsupported compression format %s", (&compression).Extension())
- }
-}
-
-// CompressStream compresses the dest with specified compression algorithm.
-func CompressStream(dest io.Writer, compression Compression) (io.WriteCloser, error) {
- switch compression {
- case Uncompressed:
- return &writeCloserWrapper{dest, nil}, nil
- case Gzip:
- return gzip.NewWriter(dest), nil
- default:
- return nil, fmt.Errorf("unsupported compression format %s", (&compression).Extension())
- }
-}
-
-// Extension returns the extension of a file that uses the specified compression algorithm.
-func (compression *Compression) Extension() string {
- switch *compression {
- case Gzip:
- return "gz"
- }
- return ""
-}
-
-func gzipDecompress(ctx context.Context, buf io.Reader) (io.ReadCloser, error) {
- initPigz.Do(func() {
- if unpigzPath = detectPigz(); unpigzPath != "" {
- log.L.Debug("using pigz for decompression")
- }
- })
-
- if unpigzPath == "" {
- return gzip.NewReader(buf)
- }
-
- return cmdStream(exec.CommandContext(ctx, unpigzPath, "-d", "-c"), buf)
-}
-
-func cmdStream(cmd *exec.Cmd, in io.Reader) (io.ReadCloser, error) {
- reader, writer := io.Pipe()
-
- cmd.Stdin = in
- cmd.Stdout = writer
-
- var errBuf bytes.Buffer
- cmd.Stderr = &errBuf
-
- if err := cmd.Start(); err != nil {
- return nil, err
- }
-
- go func() {
- if err := cmd.Wait(); err != nil {
- writer.CloseWithError(fmt.Errorf("%s: %s", err, errBuf.String()))
- } else {
- writer.Close()
- }
- }()
-
- return reader, nil
-}
-
-func detectPigz() string {
- path, err := exec.LookPath("unpigz")
- if err != nil {
- log.L.WithError(err).Debug("unpigz not found, falling back to go gzip")
- return ""
- }
-
- // Check if pigz disabled via CONTAINERD_DISABLE_PIGZ env variable
- value := os.Getenv(disablePigzEnv)
- if value == "" {
- return path
- }
-
- disable, err := strconv.ParseBool(value)
- if err != nil {
- log.L.WithError(err).Warnf("could not parse %s: %s", disablePigzEnv, value)
- return path
- }
-
- if disable {
- return ""
- }
-
- return path
-}
diff --git a/vendor/github.com/containerd/containerd/archive/strconv.go b/vendor/github.com/containerd/containerd/archive/strconv.go
deleted file mode 100644
index 13746e4b6..000000000
--- a/vendor/github.com/containerd/containerd/archive/strconv.go
+++ /dev/null
@@ -1,68 +0,0 @@
-// +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 archive
-
-import (
- "strconv"
- "strings"
- "time"
-
- "archive/tar"
-)
-
-// Forked from https://github.com/golang/go/blob/master/src/archive/tar/strconv.go
-// as archive/tar doesn't support CreationTime, but does handle PAX time parsing,
-// and there's no need to re-invent the wheel.
-
-// parsePAXTime takes a string of the form %d.%d as described in the PAX
-// specification. Note that this implementation allows for negative timestamps,
-// which is allowed for by the PAX specification, but not always portable.
-func parsePAXTime(s string) (time.Time, error) {
- const maxNanoSecondDigits = 9
-
- // Split string into seconds and sub-seconds parts.
- ss, sn := s, ""
- if pos := strings.IndexByte(s, '.'); pos >= 0 {
- ss, sn = s[:pos], s[pos+1:]
- }
-
- // Parse the seconds.
- secs, err := strconv.ParseInt(ss, 10, 64)
- if err != nil {
- return time.Time{}, tar.ErrHeader
- }
- if len(sn) == 0 {
- return time.Unix(secs, 0), nil // No sub-second values
- }
-
- // Parse the nanoseconds.
- if strings.Trim(sn, "0123456789") != "" {
- return time.Time{}, tar.ErrHeader
- }
- if len(sn) < maxNanoSecondDigits {
- sn += strings.Repeat("0", maxNanoSecondDigits-len(sn)) // Right pad
- } else {
- sn = sn[:maxNanoSecondDigits] // Right truncate
- }
- nsecs, _ := strconv.ParseInt(sn, 10, 64) // Must succeed
- if len(ss) > 0 && ss[0] == '-' {
- return time.Unix(secs, -nsecs), nil // Negative correction
- }
- return time.Unix(secs, nsecs), nil
-}
diff --git a/vendor/github.com/containerd/containerd/archive/tar.go b/vendor/github.com/containerd/containerd/archive/tar.go
deleted file mode 100644
index 580e6e76f..000000000
--- a/vendor/github.com/containerd/containerd/archive/tar.go
+++ /dev/null
@@ -1,729 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package archive
-
-import (
- "archive/tar"
- "context"
- "io"
- "os"
- "path/filepath"
- "runtime"
- "strings"
- "sync"
- "syscall"
- "time"
-
- "github.com/containerd/containerd/log"
- "github.com/containerd/continuity/fs"
- "github.com/pkg/errors"
-)
-
-var bufPool = &sync.Pool{
- New: func() interface{} {
- buffer := make([]byte, 32*1024)
- return &buffer
- },
-}
-
-var errInvalidArchive = errors.New("invalid archive")
-
-// Diff returns a tar stream of the computed filesystem
-// difference between the provided directories.
-//
-// Produces a tar using OCI style file markers for deletions. Deleted
-// files will be prepended with the prefix ".wh.". This style is
-// based off AUFS whiteouts.
-// See https://github.com/opencontainers/image-spec/blob/master/layer.md
-func Diff(ctx context.Context, a, b string) io.ReadCloser {
- r, w := io.Pipe()
-
- go func() {
- err := WriteDiff(ctx, w, a, b)
- if err = w.CloseWithError(err); err != nil {
- log.G(ctx).WithError(err).Debugf("closing tar pipe failed")
- }
- }()
-
- return r
-}
-
-// WriteDiff writes a tar stream of the computed difference between the
-// provided directories.
-//
-// Produces a tar using OCI style file markers for deletions. Deleted
-// files will be prepended with the prefix ".wh.". This style is
-// based off AUFS whiteouts.
-// See https://github.com/opencontainers/image-spec/blob/master/layer.md
-func WriteDiff(ctx context.Context, w io.Writer, a, b string) error {
- cw := newChangeWriter(w, b)
- err := fs.Changes(ctx, a, b, cw.HandleChange)
- if err != nil {
- return errors.Wrap(err, "failed to create diff tar stream")
- }
- return cw.Close()
-}
-
-const (
- // whiteoutPrefix prefix means file is a whiteout. If this is followed by a
- // filename this means that file has been removed from the base layer.
- // See https://github.com/opencontainers/image-spec/blob/master/layer.md#whiteouts
- whiteoutPrefix = ".wh."
-
- // whiteoutMetaPrefix prefix means whiteout has a special meaning and is not
- // for removing an actual file. Normally these files are excluded from exported
- // archives.
- whiteoutMetaPrefix = whiteoutPrefix + whiteoutPrefix
-
- // whiteoutOpaqueDir file means directory has been made opaque - meaning
- // readdir calls to this directory do not follow to lower layers.
- whiteoutOpaqueDir = whiteoutMetaPrefix + ".opq"
-
- paxSchilyXattr = "SCHILY.xattr."
-)
-
-// Apply applies a tar stream of an OCI style diff tar.
-// See https://github.com/opencontainers/image-spec/blob/master/layer.md#applying-changesets
-func Apply(ctx context.Context, root string, r io.Reader, opts ...ApplyOpt) (int64, error) {
- root = filepath.Clean(root)
-
- var options ApplyOptions
- for _, opt := range opts {
- if err := opt(&options); err != nil {
- return 0, errors.Wrap(err, "failed to apply option")
- }
- }
- if options.Filter == nil {
- options.Filter = all
- }
- if options.applyFunc == nil {
- options.applyFunc = applyNaive
- }
-
- return options.applyFunc(ctx, root, tar.NewReader(r), options)
-}
-
-// applyNaive applies a tar stream of an OCI style diff tar to a directory
-// applying each file as either a whole file or whiteout.
-// See https://github.com/opencontainers/image-spec/blob/master/layer.md#applying-changesets
-func applyNaive(ctx context.Context, root string, tr *tar.Reader, options ApplyOptions) (size int64, err error) {
- var (
- dirs []*tar.Header
-
- // Used for handling opaque directory markers which
- // may occur out of order
- unpackedPaths = make(map[string]struct{})
-
- convertWhiteout = options.ConvertWhiteout
- )
-
- if convertWhiteout == nil {
- // handle whiteouts by removing the target files
- convertWhiteout = func(hdr *tar.Header, path string) (bool, error) {
- base := filepath.Base(path)
- dir := filepath.Dir(path)
- if base == whiteoutOpaqueDir {
- _, err := os.Lstat(dir)
- if err != nil {
- return false, err
- }
- err = filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
- if err != nil {
- if os.IsNotExist(err) {
- err = nil // parent was deleted
- }
- return err
- }
- if path == dir {
- return nil
- }
- if _, exists := unpackedPaths[path]; !exists {
- err := os.RemoveAll(path)
- return err
- }
- return nil
- })
- return false, err
- }
-
- if strings.HasPrefix(base, whiteoutPrefix) {
- originalBase := base[len(whiteoutPrefix):]
- originalPath := filepath.Join(dir, originalBase)
-
- return false, os.RemoveAll(originalPath)
- }
-
- return true, nil
- }
- }
-
- // Iterate through the files in the archive.
- for {
- select {
- case <-ctx.Done():
- return 0, ctx.Err()
- default:
- }
-
- hdr, err := tr.Next()
- if err == io.EOF {
- // end of tar archive
- break
- }
- if err != nil {
- return 0, err
- }
-
- size += hdr.Size
-
- // Normalize name, for safety and for a simple is-root check
- hdr.Name = filepath.Clean(hdr.Name)
-
- accept, err := options.Filter(hdr)
- if err != nil {
- return 0, err
- }
- if !accept {
- continue
- }
-
- if skipFile(hdr) {
- log.G(ctx).Warnf("file %q ignored: archive may not be supported on system", hdr.Name)
- continue
- }
-
- // Split name and resolve symlinks for root directory.
- ppath, base := filepath.Split(hdr.Name)
- ppath, err = fs.RootPath(root, ppath)
- if err != nil {
- return 0, errors.Wrap(err, "failed to get root path")
- }
-
- // Join to root before joining to parent path to ensure relative links are
- // already resolved based on the root before adding to parent.
- path := filepath.Join(ppath, filepath.Join("/", base))
- if path == root {
- log.G(ctx).Debugf("file %q ignored: resolved to root", hdr.Name)
- continue
- }
-
- // If file is not directly under root, ensure parent directory
- // exists or is created.
- if ppath != root {
- parentPath := ppath
- if base == "" {
- parentPath = filepath.Dir(path)
- }
- if err := mkparent(ctx, parentPath, root, options.Parents); err != nil {
- return 0, err
- }
- }
-
- // Naive whiteout convert function which handles whiteout files by
- // removing the target files.
- if err := validateWhiteout(path); err != nil {
- return 0, err
- }
- writeFile, err := convertWhiteout(hdr, path)
- if err != nil {
- return 0, errors.Wrapf(err, "failed to convert whiteout file %q", hdr.Name)
- }
- if !writeFile {
- continue
- }
- // If path exits we almost always just want to remove and replace it.
- // The only exception is when it is a directory *and* the file from
- // the layer is also a directory. Then we want to merge them (i.e.
- // just apply the metadata from the layer).
- if fi, err := os.Lstat(path); err == nil {
- if !(fi.IsDir() && hdr.Typeflag == tar.TypeDir) {
- if err := os.RemoveAll(path); err != nil {
- return 0, err
- }
- }
- }
-
- srcData := io.Reader(tr)
- srcHdr := hdr
-
- if err := createTarFile(ctx, path, root, srcHdr, srcData); err != nil {
- return 0, err
- }
-
- // Directory mtimes must be handled at the end to avoid further
- // file creation in them to modify the directory mtime
- if hdr.Typeflag == tar.TypeDir {
- dirs = append(dirs, hdr)
- }
- unpackedPaths[path] = struct{}{}
- }
-
- for _, hdr := range dirs {
- path, err := fs.RootPath(root, hdr.Name)
- if err != nil {
- return 0, err
- }
- if err := chtimes(path, boundTime(latestTime(hdr.AccessTime, hdr.ModTime)), boundTime(hdr.ModTime)); err != nil {
- return 0, err
- }
- }
-
- return size, nil
-}
-
-func createTarFile(ctx context.Context, path, extractDir string, hdr *tar.Header, reader io.Reader) error {
- // hdr.Mode is in linux format, which we can use for syscalls,
- // but for os.Foo() calls we need the mode converted to os.FileMode,
- // so use hdrInfo.Mode() (they differ for e.g. setuid bits)
- hdrInfo := hdr.FileInfo()
-
- switch hdr.Typeflag {
- case tar.TypeDir:
- // Create directory unless it exists as a directory already.
- // In that case we just want to merge the two
- if fi, err := os.Lstat(path); !(err == nil && fi.IsDir()) {
- if err := mkdir(path, hdrInfo.Mode()); err != nil {
- return err
- }
- }
-
- case tar.TypeReg, tar.TypeRegA:
- file, err := openFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, hdrInfo.Mode())
- if err != nil {
- return err
- }
-
- _, err = copyBuffered(ctx, file, reader)
- if err1 := file.Close(); err == nil {
- err = err1
- }
- if err != nil {
- return err
- }
-
- case tar.TypeBlock, tar.TypeChar:
- // Handle this is an OS-specific way
- if err := handleTarTypeBlockCharFifo(hdr, path); err != nil {
- return err
- }
-
- case tar.TypeFifo:
- // Handle this is an OS-specific way
- if err := handleTarTypeBlockCharFifo(hdr, path); err != nil {
- return err
- }
-
- case tar.TypeLink:
- targetPath, err := hardlinkRootPath(extractDir, hdr.Linkname)
- if err != nil {
- return err
- }
-
- if err := os.Link(targetPath, path); err != nil {
- return err
- }
-
- case tar.TypeSymlink:
- if err := os.Symlink(hdr.Linkname, path); err != nil {
- return err
- }
-
- case tar.TypeXGlobalHeader:
- log.G(ctx).Debug("PAX Global Extended Headers found and ignored")
- return nil
-
- default:
- return errors.Errorf("unhandled tar header type %d\n", hdr.Typeflag)
- }
-
- // Lchown is not supported on Windows.
- if runtime.GOOS != "windows" {
- if err := os.Lchown(path, hdr.Uid, hdr.Gid); err != nil {
- return err
- }
- }
-
- for key, value := range hdr.PAXRecords {
- if strings.HasPrefix(key, paxSchilyXattr) {
- key = key[len(paxSchilyXattr):]
- if err := setxattr(path, key, value); err != nil {
- if errors.Is(err, syscall.ENOTSUP) {
- log.G(ctx).WithError(err).Warnf("ignored xattr %s in archive", key)
- continue
- }
- return err
- }
- }
- }
-
- // There is no LChmod, so ignore mode for symlink. Also, this
- // must happen after chown, as that can modify the file mode
- if err := handleLChmod(hdr, path, hdrInfo); err != nil {
- return err
- }
-
- return chtimes(path, boundTime(latestTime(hdr.AccessTime, hdr.ModTime)), boundTime(hdr.ModTime))
-}
-
-func mkparent(ctx context.Context, path, root string, parents []string) error {
- if dir, err := os.Lstat(path); err == nil {
- if dir.IsDir() {
- return nil
- }
- return &os.PathError{
- Op: "mkparent",
- Path: path,
- Err: syscall.ENOTDIR,
- }
- } else if !os.IsNotExist(err) {
- return err
- }
-
- i := len(path)
- for i > len(root) && !os.IsPathSeparator(path[i-1]) {
- i--
- }
-
- if i > len(root)+1 {
- if err := mkparent(ctx, path[:i-1], root, parents); err != nil {
- return err
- }
- }
-
- if err := mkdir(path, 0755); err != nil {
- // Check that still doesn't exist
- dir, err1 := os.Lstat(path)
- if err1 == nil && dir.IsDir() {
- return nil
- }
- return err
- }
-
- for _, p := range parents {
- ppath, err := fs.RootPath(p, path[len(root):])
- if err != nil {
- return err
- }
-
- dir, err := os.Lstat(ppath)
- if err == nil {
- if !dir.IsDir() {
- // Replaced, do not copy attributes
- break
- }
- if err := copyDirInfo(dir, path); err != nil {
- return err
- }
- return copyUpXAttrs(path, ppath)
- } else if !os.IsNotExist(err) {
- return err
- }
- }
-
- log.G(ctx).Debugf("parent directory %q not found: default permissions(0755) used", path)
-
- return nil
-}
-
-type changeWriter struct {
- tw *tar.Writer
- source string
- whiteoutT time.Time
- inodeSrc map[uint64]string
- inodeRefs map[uint64][]string
- addedDirs map[string]struct{}
-}
-
-func newChangeWriter(w io.Writer, source string) *changeWriter {
- return &changeWriter{
- tw: tar.NewWriter(w),
- source: source,
- whiteoutT: time.Now(),
- inodeSrc: map[uint64]string{},
- inodeRefs: map[uint64][]string{},
- addedDirs: map[string]struct{}{},
- }
-}
-
-func (cw *changeWriter) HandleChange(k fs.ChangeKind, p string, f os.FileInfo, err error) error {
- if err != nil {
- return err
- }
- if k == fs.ChangeKindDelete {
- whiteOutDir := filepath.Dir(p)
- whiteOutBase := filepath.Base(p)
- whiteOut := filepath.Join(whiteOutDir, whiteoutPrefix+whiteOutBase)
- hdr := &tar.Header{
- Typeflag: tar.TypeReg,
- Name: whiteOut[1:],
- Size: 0,
- ModTime: cw.whiteoutT,
- AccessTime: cw.whiteoutT,
- ChangeTime: cw.whiteoutT,
- }
- if err := cw.includeParents(hdr); err != nil {
- return err
- }
- if err := cw.tw.WriteHeader(hdr); err != nil {
- return errors.Wrap(err, "failed to write whiteout header")
- }
- } else {
- var (
- link string
- err error
- source = filepath.Join(cw.source, p)
- )
-
- switch {
- case f.Mode()&os.ModeSocket != 0:
- return nil // ignore sockets
- case f.Mode()&os.ModeSymlink != 0:
- if link, err = os.Readlink(source); err != nil {
- return err
- }
- }
-
- hdr, err := tar.FileInfoHeader(f, link)
- if err != nil {
- return err
- }
-
- hdr.Mode = int64(chmodTarEntry(os.FileMode(hdr.Mode)))
-
- // truncate timestamp for compatibility. without PAX stdlib rounds timestamps instead
- hdr.Format = tar.FormatPAX
- hdr.ModTime = hdr.ModTime.Truncate(time.Second)
- hdr.AccessTime = time.Time{}
- hdr.ChangeTime = time.Time{}
-
- name := p
- if strings.HasPrefix(name, string(filepath.Separator)) {
- name, err = filepath.Rel(string(filepath.Separator), name)
- if err != nil {
- return errors.Wrap(err, "failed to make path relative")
- }
- }
- name, err = tarName(name)
- if err != nil {
- return errors.Wrap(err, "cannot canonicalize path")
- }
- // suffix with '/' for directories
- if f.IsDir() && !strings.HasSuffix(name, "/") {
- name += "/"
- }
- hdr.Name = name
-
- if err := setHeaderForSpecialDevice(hdr, name, f); err != nil {
- return errors.Wrap(err, "failed to set device headers")
- }
-
- // additionalLinks stores file names which must be linked to
- // this file when this file is added
- var additionalLinks []string
- inode, isHardlink := fs.GetLinkInfo(f)
- if isHardlink {
- // If the inode has a source, always link to it
- if source, ok := cw.inodeSrc[inode]; ok {
- hdr.Typeflag = tar.TypeLink
- hdr.Linkname = source
- hdr.Size = 0
- } else {
- if k == fs.ChangeKindUnmodified {
- cw.inodeRefs[inode] = append(cw.inodeRefs[inode], name)
- return nil
- }
- cw.inodeSrc[inode] = name
- additionalLinks = cw.inodeRefs[inode]
- delete(cw.inodeRefs, inode)
- }
- } else if k == fs.ChangeKindUnmodified {
- // Nothing to write to diff
- return nil
- }
-
- if capability, err := getxattr(source, "security.capability"); err != nil {
- return errors.Wrap(err, "failed to get capabilities xattr")
- } else if capability != nil {
- if hdr.PAXRecords == nil {
- hdr.PAXRecords = map[string]string{}
- }
- hdr.PAXRecords[paxSchilyXattr+"security.capability"] = string(capability)
- }
-
- if err := cw.includeParents(hdr); err != nil {
- return err
- }
- if err := cw.tw.WriteHeader(hdr); err != nil {
- return errors.Wrap(err, "failed to write file header")
- }
-
- if hdr.Typeflag == tar.TypeReg && hdr.Size > 0 {
- file, err := open(source)
- if err != nil {
- return errors.Wrapf(err, "failed to open path: %v", source)
- }
- defer file.Close()
-
- n, err := copyBuffered(context.TODO(), cw.tw, file)
- if err != nil {
- return errors.Wrap(err, "failed to copy")
- }
- if n != hdr.Size {
- return errors.New("short write copying file")
- }
- }
-
- if additionalLinks != nil {
- source = hdr.Name
- for _, extra := range additionalLinks {
- hdr.Name = extra
- hdr.Typeflag = tar.TypeLink
- hdr.Linkname = source
- hdr.Size = 0
-
- if err := cw.includeParents(hdr); err != nil {
- return err
- }
- if err := cw.tw.WriteHeader(hdr); err != nil {
- return errors.Wrap(err, "failed to write file header")
- }
- }
- }
- }
- return nil
-}
-
-func (cw *changeWriter) Close() error {
- if err := cw.tw.Close(); err != nil {
- return errors.Wrap(err, "failed to close tar writer")
- }
- return nil
-}
-
-func (cw *changeWriter) includeParents(hdr *tar.Header) error {
- if cw.addedDirs == nil {
- return nil
- }
- name := strings.TrimRight(hdr.Name, "/")
- fname := filepath.Join(cw.source, name)
- parent := filepath.Dir(name)
- pname := filepath.Join(cw.source, parent)
-
- // Do not include root directory as parent
- if fname != cw.source && pname != cw.source {
- _, ok := cw.addedDirs[parent]
- if !ok {
- cw.addedDirs[parent] = struct{}{}
- fi, err := os.Stat(pname)
- if err != nil {
- return err
- }
- if err := cw.HandleChange(fs.ChangeKindModify, parent, fi, nil); err != nil {
- return err
- }
- }
- }
- if hdr.Typeflag == tar.TypeDir {
- cw.addedDirs[name] = struct{}{}
- }
- return nil
-}
-
-func copyBuffered(ctx context.Context, dst io.Writer, src io.Reader) (written int64, err error) {
- buf := bufPool.Get().(*[]byte)
- defer bufPool.Put(buf)
-
- for {
- select {
- case <-ctx.Done():
- err = ctx.Err()
- return
- default:
- }
-
- nr, er := src.Read(*buf)
- if nr > 0 {
- nw, ew := dst.Write((*buf)[0:nr])
- if nw > 0 {
- written += int64(nw)
- }
- if ew != nil {
- err = ew
- break
- }
- if nr != nw {
- err = io.ErrShortWrite
- break
- }
- }
- if er != nil {
- if er != io.EOF {
- err = er
- }
- break
- }
- }
- return written, err
-
-}
-
-// hardlinkRootPath returns target linkname, evaluating and bounding any
-// symlink to the parent directory.
-//
-// NOTE: Allow hardlink to the softlink, not the real one. For example,
-//
-// touch /tmp/zzz
-// ln -s /tmp/zzz /tmp/xxx
-// ln /tmp/xxx /tmp/yyy
-//
-// /tmp/yyy should be softlink which be same of /tmp/xxx, not /tmp/zzz.
-func hardlinkRootPath(root, linkname string) (string, error) {
- ppath, base := filepath.Split(linkname)
- ppath, err := fs.RootPath(root, ppath)
- if err != nil {
- return "", err
- }
-
- targetPath := filepath.Join(ppath, base)
- if !strings.HasPrefix(targetPath, root) {
- targetPath = root
- }
- return targetPath, nil
-}
-
-func validateWhiteout(path string) error {
- base := filepath.Base(path)
- dir := filepath.Dir(path)
-
- if base == whiteoutOpaqueDir {
- return nil
- }
-
- if strings.HasPrefix(base, whiteoutPrefix) {
- originalBase := base[len(whiteoutPrefix):]
- originalPath := filepath.Join(dir, originalBase)
-
- // Ensure originalPath is under dir
- if dir[len(dir)-1] != filepath.Separator {
- dir += string(filepath.Separator)
- }
- if !strings.HasPrefix(originalPath, dir) {
- return errors.Wrapf(errInvalidArchive, "invalid whiteout name: %v", base)
- }
- }
- return nil
-}
diff --git a/vendor/github.com/containerd/containerd/archive/tar_opts.go b/vendor/github.com/containerd/containerd/archive/tar_opts.go
deleted file mode 100644
index ca419e112..000000000
--- a/vendor/github.com/containerd/containerd/archive/tar_opts.go
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package archive
-
-import (
- "archive/tar"
- "context"
-)
-
-// ApplyOptions provides additional options for an Apply operation
-type ApplyOptions struct {
- Filter Filter // Filter tar headers
- ConvertWhiteout ConvertWhiteout // Convert whiteout files
- Parents []string // Parent directories to handle inherited attributes without CoW
-
- applyFunc func(context.Context, string, *tar.Reader, ApplyOptions) (int64, error)
-}
-
-// ApplyOpt allows setting mutable archive apply properties on creation
-type ApplyOpt func(options *ApplyOptions) error
-
-// Filter specific files from the archive
-type Filter func(*tar.Header) (bool, error)
-
-// ConvertWhiteout converts whiteout files from the archive
-type ConvertWhiteout func(*tar.Header, string) (bool, error)
-
-// all allows all files
-func all(_ *tar.Header) (bool, error) {
- return true, nil
-}
-
-// WithFilter uses the filter to select which files are to be extracted.
-func WithFilter(f Filter) ApplyOpt {
- return func(options *ApplyOptions) error {
- options.Filter = f
- return nil
- }
-}
-
-// WithConvertWhiteout uses the convert function to convert the whiteout files.
-func WithConvertWhiteout(c ConvertWhiteout) ApplyOpt {
- return func(options *ApplyOptions) error {
- options.ConvertWhiteout = c
- return nil
- }
-}
-
-// WithParents provides parent directories for resolving inherited attributes
-// directory from the filesystem.
-// Inherited attributes are searched from first to last, making the first
-// element in the list the most immediate parent directory.
-// NOTE: When applying to a filesystem which supports CoW, file attributes
-// should be inherited by the filesystem.
-func WithParents(p []string) ApplyOpt {
- return func(options *ApplyOptions) error {
- options.Parents = p
- return nil
- }
-}
diff --git a/vendor/github.com/containerd/containerd/archive/tar_opts_linux.go b/vendor/github.com/containerd/containerd/archive/tar_opts_linux.go
deleted file mode 100644
index 38ef9e9bc..000000000
--- a/vendor/github.com/containerd/containerd/archive/tar_opts_linux.go
+++ /dev/null
@@ -1,59 +0,0 @@
-// +build linux
-
-/*
- 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 archive
-
-import (
- "archive/tar"
- "os"
- "path/filepath"
- "strings"
-
- "golang.org/x/sys/unix"
-)
-
-// AufsConvertWhiteout converts whiteout files for aufs.
-func AufsConvertWhiteout(_ *tar.Header, _ string) (bool, error) {
- return true, nil
-}
-
-// OverlayConvertWhiteout converts whiteout files for overlay.
-func OverlayConvertWhiteout(hdr *tar.Header, path string) (bool, error) {
- base := filepath.Base(path)
- dir := filepath.Dir(path)
-
- // if a directory is marked as opaque, we need to translate that to overlay
- if base == whiteoutOpaqueDir {
- // don't write the file itself
- return false, unix.Setxattr(dir, "trusted.overlay.opaque", []byte{'y'}, 0)
- }
-
- // if a file was deleted and we are using overlay, we need to create a character device
- if strings.HasPrefix(base, whiteoutPrefix) {
- originalBase := base[len(whiteoutPrefix):]
- originalPath := filepath.Join(dir, originalBase)
-
- if err := unix.Mknod(originalPath, unix.S_IFCHR, 0); err != nil {
- return false, err
- }
- // don't write the file itself
- return false, os.Chown(originalPath, hdr.Uid, hdr.Gid)
- }
-
- return true, nil
-}
diff --git a/vendor/github.com/containerd/containerd/archive/tar_opts_windows.go b/vendor/github.com/containerd/containerd/archive/tar_opts_windows.go
deleted file mode 100644
index f472013bc..000000000
--- a/vendor/github.com/containerd/containerd/archive/tar_opts_windows.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// +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 archive
-
-// AsWindowsContainerLayer indicates that the tar stream to apply is that of
-// a Windows Container Layer. The caller must be holding SeBackupPrivilege and
-// SeRestorePrivilege.
-func AsWindowsContainerLayer() ApplyOpt {
- return func(options *ApplyOptions) error {
- options.applyFunc = applyWindowsLayer
- return nil
- }
-}
diff --git a/vendor/github.com/containerd/containerd/archive/tar_unix.go b/vendor/github.com/containerd/containerd/archive/tar_unix.go
deleted file mode 100644
index 6e89d2fdb..000000000
--- a/vendor/github.com/containerd/containerd/archive/tar_unix.go
+++ /dev/null
@@ -1,208 +0,0 @@
-// +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 archive
-
-import (
- "archive/tar"
- "os"
- "strings"
- "syscall"
-
- "github.com/containerd/containerd/sys"
- "github.com/containerd/continuity/fs"
- "github.com/containerd/continuity/sysx"
- "github.com/pkg/errors"
- "golang.org/x/sys/unix"
-)
-
-func tarName(p string) (string, error) {
- return p, nil
-}
-
-func chmodTarEntry(perm os.FileMode) os.FileMode {
- return perm
-}
-
-func setHeaderForSpecialDevice(hdr *tar.Header, name string, fi os.FileInfo) error {
- s, ok := fi.Sys().(*syscall.Stat_t)
- if !ok {
- return errors.New("unsupported stat type")
- }
-
- // Rdev is int32 on darwin/bsd, int64 on linux/solaris
- rdev := uint64(s.Rdev) // nolint: unconvert
-
- // Currently go does not fill in the major/minors
- if s.Mode&syscall.S_IFBLK != 0 ||
- s.Mode&syscall.S_IFCHR != 0 {
- hdr.Devmajor = int64(unix.Major(rdev))
- hdr.Devminor = int64(unix.Minor(rdev))
- }
-
- return nil
-}
-
-func open(p string) (*os.File, error) {
- return os.Open(p)
-}
-
-func openFile(name string, flag int, perm os.FileMode) (*os.File, error) {
- f, err := os.OpenFile(name, flag, perm)
- if err != nil {
- return nil, err
- }
- // Call chmod to avoid permission mask
- if err := os.Chmod(name, perm); err != nil {
- return nil, err
- }
- return f, err
-}
-
-func mkdir(path string, perm os.FileMode) error {
- if err := os.Mkdir(path, perm); err != nil {
- return err
- }
- // Only final created directory gets explicit permission
- // call to avoid permission mask
- return os.Chmod(path, perm)
-}
-
-func skipFile(hdr *tar.Header) bool {
- switch hdr.Typeflag {
- case tar.TypeBlock, tar.TypeChar:
- // cannot create a device if running in user namespace
- return sys.RunningInUserNS()
- default:
- return false
- }
-}
-
-// handleTarTypeBlockCharFifo is an OS-specific helper function used by
-// createTarFile to handle the following types of header: Block; Char; Fifo.
-// This function must not be called for Block and Char when running in userns.
-// (skipFile() should return true for them.)
-func handleTarTypeBlockCharFifo(hdr *tar.Header, path string) error {
- mode := uint32(hdr.Mode & 07777)
- switch hdr.Typeflag {
- case tar.TypeBlock:
- mode |= unix.S_IFBLK
- case tar.TypeChar:
- mode |= unix.S_IFCHR
- case tar.TypeFifo:
- mode |= unix.S_IFIFO
- }
-
- return unix.Mknod(path, mode, int(unix.Mkdev(uint32(hdr.Devmajor), uint32(hdr.Devminor))))
-}
-
-func handleLChmod(hdr *tar.Header, path string, hdrInfo os.FileInfo) error {
- if hdr.Typeflag == tar.TypeLink {
- if fi, err := os.Lstat(hdr.Linkname); err == nil && (fi.Mode()&os.ModeSymlink == 0) {
- if err := os.Chmod(path, hdrInfo.Mode()); err != nil && !os.IsNotExist(err) {
- return err
- }
- }
- } else if hdr.Typeflag != tar.TypeSymlink {
- if err := os.Chmod(path, hdrInfo.Mode()); err != nil {
- return err
- }
- }
- return nil
-}
-
-func getxattr(path, attr string) ([]byte, error) {
- b, err := sysx.LGetxattr(path, attr)
- if err == unix.ENOTSUP || err == sysx.ENODATA {
- return nil, nil
- }
- return b, err
-}
-
-func setxattr(path, key, value string) error {
- // Do not set trusted attributes
- if strings.HasPrefix(key, "trusted.") {
- return errors.Wrap(unix.ENOTSUP, "admin attributes from archive not supported")
- }
- return unix.Lsetxattr(path, key, []byte(value), 0)
-}
-
-func copyDirInfo(fi os.FileInfo, path string) error {
- st := fi.Sys().(*syscall.Stat_t)
- if err := os.Lchown(path, int(st.Uid), int(st.Gid)); err != nil {
- if os.IsPermission(err) {
- // Normally if uid/gid are the same this would be a no-op, but some
- // filesystems may still return EPERM... for instance NFS does this.
- // In such a case, this is not an error.
- if dstStat, err2 := os.Lstat(path); err2 == nil {
- st2 := dstStat.Sys().(*syscall.Stat_t)
- if st.Uid == st2.Uid && st.Gid == st2.Gid {
- err = nil
- }
- }
- }
- if err != nil {
- return errors.Wrapf(err, "failed to chown %s", path)
- }
- }
-
- if err := os.Chmod(path, fi.Mode()); err != nil {
- return errors.Wrapf(err, "failed to chmod %s", path)
- }
-
- timespec := []unix.Timespec{
- unix.NsecToTimespec(syscall.TimespecToNsec(fs.StatAtime(st))),
- unix.NsecToTimespec(syscall.TimespecToNsec(fs.StatMtime(st))),
- }
- if err := unix.UtimesNanoAt(unix.AT_FDCWD, path, timespec, unix.AT_SYMLINK_NOFOLLOW); err != nil {
- return errors.Wrapf(err, "failed to utime %s", path)
- }
-
- return nil
-}
-
-func copyUpXAttrs(dst, src string) error {
- xattrKeys, err := sysx.LListxattr(src)
- if err != nil {
- if err == unix.ENOTSUP || err == sysx.ENODATA {
- return nil
- }
- return errors.Wrapf(err, "failed to list xattrs on %s", src)
- }
- for _, xattr := range xattrKeys {
- // Do not copy up trusted attributes
- if strings.HasPrefix(xattr, "trusted.") {
- continue
- }
- data, err := sysx.LGetxattr(src, xattr)
- if err != nil {
- if err == unix.ENOTSUP || err == sysx.ENODATA {
- continue
- }
- return errors.Wrapf(err, "failed to get xattr %q on %s", xattr, src)
- }
- if err := unix.Lsetxattr(dst, xattr, data, unix.XATTR_CREATE); err != nil {
- if err == unix.ENOTSUP || err == unix.ENODATA || err == unix.EEXIST {
- continue
- }
- return errors.Wrapf(err, "failed to set xattr %q on %s", xattr, dst)
- }
- }
-
- return nil
-}
diff --git a/vendor/github.com/containerd/containerd/archive/tar_windows.go b/vendor/github.com/containerd/containerd/archive/tar_windows.go
deleted file mode 100644
index a5c6da694..000000000
--- a/vendor/github.com/containerd/containerd/archive/tar_windows.go
+++ /dev/null
@@ -1,444 +0,0 @@
-// +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 archive
-
-import (
- "archive/tar"
- "bufio"
- "context"
- "encoding/base64"
- "fmt"
- "io"
- "os"
- "path"
- "path/filepath"
- "strconv"
- "strings"
- "syscall"
-
- "github.com/Microsoft/go-winio"
- "github.com/Microsoft/hcsshim"
- "github.com/containerd/containerd/sys"
- "github.com/pkg/errors"
-)
-
-const (
- // MSWINDOWS pax vendor extensions
- hdrMSWindowsPrefix = "MSWINDOWS."
-
- hdrFileAttributes = hdrMSWindowsPrefix + "fileattr"
- hdrSecurityDescriptor = hdrMSWindowsPrefix + "sd"
- hdrRawSecurityDescriptor = hdrMSWindowsPrefix + "rawsd"
- hdrMountPoint = hdrMSWindowsPrefix + "mountpoint"
- hdrEaPrefix = hdrMSWindowsPrefix + "xattr."
-
- // LIBARCHIVE pax vendor extensions
- hdrLibArchivePrefix = "LIBARCHIVE."
-
- hdrCreateTime = hdrLibArchivePrefix + "creationtime"
-)
-
-var (
- // mutatedFiles is a list of files that are mutated by the import process
- // and must be backed up and restored.
- mutatedFiles = map[string]string{
- "UtilityVM/Files/EFI/Microsoft/Boot/BCD": "bcd.bak",
- "UtilityVM/Files/EFI/Microsoft/Boot/BCD.LOG": "bcd.log.bak",
- "UtilityVM/Files/EFI/Microsoft/Boot/BCD.LOG1": "bcd.log1.bak",
- "UtilityVM/Files/EFI/Microsoft/Boot/BCD.LOG2": "bcd.log2.bak",
- }
-)
-
-// tarName returns platform-specific filepath
-// to canonical posix-style path for tar archival. p is relative
-// path.
-func tarName(p string) (string, error) {
- // windows: convert windows style relative path with backslashes
- // into forward slashes. Since windows does not allow '/' or '\'
- // in file names, it is mostly safe to replace however we must
- // check just in case
- if strings.Contains(p, "/") {
- return "", fmt.Errorf("windows path contains forward slash: %s", p)
- }
-
- return strings.Replace(p, string(os.PathSeparator), "/", -1), nil
-}
-
-// chmodTarEntry is used to adjust the file permissions used in tar header based
-// on the platform the archival is done.
-func chmodTarEntry(perm os.FileMode) os.FileMode {
- perm &= 0755
- // Add the x bit: make everything +x from windows
- perm |= 0111
-
- return perm
-}
-
-func setHeaderForSpecialDevice(*tar.Header, string, os.FileInfo) error {
- // do nothing. no notion of Rdev, Inode, Nlink in stat on Windows
- return nil
-}
-
-func open(p string) (*os.File, error) {
- // We use sys.OpenSequential to ensure we use sequential file
- // access on Windows to avoid depleting the standby list.
- return sys.OpenSequential(p)
-}
-
-func openFile(name string, flag int, perm os.FileMode) (*os.File, error) {
- // Source is regular file. We use sys.OpenFileSequential to use sequential
- // file access to avoid depleting the standby list on Windows.
- return sys.OpenFileSequential(name, flag, perm)
-}
-
-func mkdir(path string, perm os.FileMode) error {
- return os.Mkdir(path, perm)
-}
-
-func skipFile(hdr *tar.Header) bool {
- // Windows does not support filenames with colons in them. Ignore
- // these files. This is not a problem though (although it might
- // appear that it is). Let's suppose a client is running docker pull.
- // The daemon it points to is Windows. Would it make sense for the
- // client to be doing a docker pull Ubuntu for example (which has files
- // with colons in the name under /usr/share/man/man3)? No, absolutely
- // not as it would really only make sense that they were pulling a
- // Windows image. However, for development, it is necessary to be able
- // to pull Linux images which are in the repository.
- //
- // TODO Windows. Once the registry is aware of what images are Windows-
- // specific or Linux-specific, this warning should be changed to an error
- // to cater for the situation where someone does manage to upload a Linux
- // image but have it tagged as Windows inadvertently.
- return strings.Contains(hdr.Name, ":")
-}
-
-// handleTarTypeBlockCharFifo is an OS-specific helper function used by
-// createTarFile to handle the following types of header: Block; Char; Fifo
-func handleTarTypeBlockCharFifo(hdr *tar.Header, path string) error {
- return nil
-}
-
-func handleLChmod(hdr *tar.Header, path string, hdrInfo os.FileInfo) error {
- return nil
-}
-
-func getxattr(path, attr string) ([]byte, error) {
- return nil, nil
-}
-
-func setxattr(path, key, value string) error {
- // Return not support error, do not wrap underlying not supported
- // since xattrs should not exist in windows diff archives
- return errors.New("xattrs not supported on Windows")
-}
-
-// applyWindowsLayer applies a tar stream of an OCI style diff tar of a Windows
-// layer using the hcsshim layer writer and backup streams.
-// See https://github.com/opencontainers/image-spec/blob/master/layer.md#applying-changesets
-func applyWindowsLayer(ctx context.Context, root string, tr *tar.Reader, options ApplyOptions) (size int64, err error) {
- home, id := filepath.Split(root)
- info := hcsshim.DriverInfo{
- HomeDir: home,
- }
-
- w, err := hcsshim.NewLayerWriter(info, id, options.Parents)
- if err != nil {
- return 0, err
- }
- defer func() {
- if err2 := w.Close(); err2 != nil {
- // This error should not be discarded as a failure here
- // could result in an invalid layer on disk
- if err == nil {
- err = err2
- }
- }
- }()
-
- buf := bufio.NewWriter(nil)
- hdr, nextErr := tr.Next()
- // Iterate through the files in the archive.
- for {
- select {
- case <-ctx.Done():
- return 0, ctx.Err()
- default:
- }
-
- if nextErr == io.EOF {
- // end of tar archive
- break
- }
- if nextErr != nil {
- return 0, nextErr
- }
-
- // Note: path is used instead of filepath to prevent OS specific handling
- // of the tar path
- base := path.Base(hdr.Name)
- if strings.HasPrefix(base, whiteoutPrefix) {
- dir := path.Dir(hdr.Name)
- originalBase := base[len(whiteoutPrefix):]
- originalPath := path.Join(dir, originalBase)
- if err := w.Remove(filepath.FromSlash(originalPath)); err != nil {
- return 0, err
- }
- hdr, nextErr = tr.Next()
- } else if hdr.Typeflag == tar.TypeLink {
- err := w.AddLink(filepath.FromSlash(hdr.Name), filepath.FromSlash(hdr.Linkname))
- if err != nil {
- return 0, err
- }
- hdr, nextErr = tr.Next()
- } else {
- name, fileSize, fileInfo, err := fileInfoFromHeader(hdr)
- if err != nil {
- return 0, err
- }
- if err := w.Add(filepath.FromSlash(name), fileInfo); err != nil {
- return 0, err
- }
- size += fileSize
- hdr, nextErr = tarToBackupStreamWithMutatedFiles(buf, w, tr, hdr, root)
- }
- }
-
- return
-}
-
-// fileInfoFromHeader retrieves basic Win32 file information from a tar header, using the additional metadata written by
-// WriteTarFileFromBackupStream.
-func fileInfoFromHeader(hdr *tar.Header) (name string, size int64, fileInfo *winio.FileBasicInfo, err error) {
- name = hdr.Name
- if hdr.Typeflag == tar.TypeReg || hdr.Typeflag == tar.TypeRegA {
- size = hdr.Size
- }
- fileInfo = &winio.FileBasicInfo{
- LastAccessTime: syscall.NsecToFiletime(hdr.AccessTime.UnixNano()),
- LastWriteTime: syscall.NsecToFiletime(hdr.ModTime.UnixNano()),
- ChangeTime: syscall.NsecToFiletime(hdr.ChangeTime.UnixNano()),
-
- // Default CreationTime to ModTime, updated below if MSWINDOWS.createtime exists
- CreationTime: syscall.NsecToFiletime(hdr.ModTime.UnixNano()),
- }
- if attrStr, ok := hdr.PAXRecords[hdrFileAttributes]; ok {
- attr, err := strconv.ParseUint(attrStr, 10, 32)
- if err != nil {
- return "", 0, nil, err
- }
- fileInfo.FileAttributes = uint32(attr)
- } else {
- if hdr.Typeflag == tar.TypeDir {
- fileInfo.FileAttributes |= syscall.FILE_ATTRIBUTE_DIRECTORY
- }
- }
- if createStr, ok := hdr.PAXRecords[hdrCreateTime]; ok {
- createTime, err := parsePAXTime(createStr)
- if err != nil {
- return "", 0, nil, err
- }
- fileInfo.CreationTime = syscall.NsecToFiletime(createTime.UnixNano())
- }
- return
-}
-
-// tarToBackupStreamWithMutatedFiles reads data from a tar stream and
-// writes it to a backup stream, and also saves any files that will be mutated
-// by the import layer process to a backup location.
-func tarToBackupStreamWithMutatedFiles(buf *bufio.Writer, w io.Writer, t *tar.Reader, hdr *tar.Header, root string) (nextHdr *tar.Header, err error) {
- var (
- bcdBackup *os.File
- bcdBackupWriter *winio.BackupFileWriter
- )
- if backupPath, ok := mutatedFiles[hdr.Name]; ok {
- bcdBackup, err = os.Create(filepath.Join(root, backupPath))
- if err != nil {
- return nil, err
- }
- defer func() {
- cerr := bcdBackup.Close()
- if err == nil {
- err = cerr
- }
- }()
-
- bcdBackupWriter = winio.NewBackupFileWriter(bcdBackup, false)
- defer func() {
- cerr := bcdBackupWriter.Close()
- if err == nil {
- err = cerr
- }
- }()
-
- buf.Reset(io.MultiWriter(w, bcdBackupWriter))
- } else {
- buf.Reset(w)
- }
-
- defer func() {
- ferr := buf.Flush()
- if err == nil {
- err = ferr
- }
- }()
-
- return writeBackupStreamFromTarFile(buf, t, hdr)
-}
-
-// writeBackupStreamFromTarFile writes a Win32 backup stream from the current tar file. Since this function may process multiple
-// tar file entries in order to collect all the alternate data streams for the file, it returns the next
-// tar file that was not processed, or io.EOF is there are no more.
-func writeBackupStreamFromTarFile(w io.Writer, t *tar.Reader, hdr *tar.Header) (*tar.Header, error) {
- bw := winio.NewBackupStreamWriter(w)
- var sd []byte
- var err error
- // Maintaining old SDDL-based behavior for backward compatibility. All new tar headers written
- // by this library will have raw binary for the security descriptor.
- if sddl, ok := hdr.PAXRecords[hdrSecurityDescriptor]; ok {
- sd, err = winio.SddlToSecurityDescriptor(sddl)
- if err != nil {
- return nil, err
- }
- }
- if sdraw, ok := hdr.PAXRecords[hdrRawSecurityDescriptor]; ok {
- sd, err = base64.StdEncoding.DecodeString(sdraw)
- if err != nil {
- return nil, err
- }
- }
- if len(sd) != 0 {
- bhdr := winio.BackupHeader{
- Id: winio.BackupSecurity,
- Size: int64(len(sd)),
- }
- err := bw.WriteHeader(&bhdr)
- if err != nil {
- return nil, err
- }
- _, err = bw.Write(sd)
- if err != nil {
- return nil, err
- }
- }
- var eas []winio.ExtendedAttribute
- for k, v := range hdr.PAXRecords {
- if !strings.HasPrefix(k, hdrEaPrefix) {
- continue
- }
- data, err := base64.StdEncoding.DecodeString(v)
- if err != nil {
- return nil, err
- }
- eas = append(eas, winio.ExtendedAttribute{
- Name: k[len(hdrEaPrefix):],
- Value: data,
- })
- }
- if len(eas) != 0 {
- eadata, err := winio.EncodeExtendedAttributes(eas)
- if err != nil {
- return nil, err
- }
- bhdr := winio.BackupHeader{
- Id: winio.BackupEaData,
- Size: int64(len(eadata)),
- }
- err = bw.WriteHeader(&bhdr)
- if err != nil {
- return nil, err
- }
- _, err = bw.Write(eadata)
- if err != nil {
- return nil, err
- }
- }
- if hdr.Typeflag == tar.TypeSymlink {
- _, isMountPoint := hdr.PAXRecords[hdrMountPoint]
- rp := winio.ReparsePoint{
- Target: filepath.FromSlash(hdr.Linkname),
- IsMountPoint: isMountPoint,
- }
- reparse := winio.EncodeReparsePoint(&rp)
- bhdr := winio.BackupHeader{
- Id: winio.BackupReparseData,
- Size: int64(len(reparse)),
- }
- err := bw.WriteHeader(&bhdr)
- if err != nil {
- return nil, err
- }
- _, err = bw.Write(reparse)
- if err != nil {
- return nil, err
- }
- }
-
- buf := bufPool.Get().(*[]byte)
- defer bufPool.Put(buf)
-
- if hdr.Typeflag == tar.TypeReg || hdr.Typeflag == tar.TypeRegA {
- bhdr := winio.BackupHeader{
- Id: winio.BackupData,
- Size: hdr.Size,
- }
- err := bw.WriteHeader(&bhdr)
- if err != nil {
- return nil, err
- }
- _, err = io.CopyBuffer(bw, t, *buf)
- if err != nil {
- return nil, err
- }
- }
- // Copy all the alternate data streams and return the next non-ADS header.
- for {
- ahdr, err := t.Next()
- if err != nil {
- return nil, err
- }
- if ahdr.Typeflag != tar.TypeReg || !strings.HasPrefix(ahdr.Name, hdr.Name+":") {
- return ahdr, nil
- }
- bhdr := winio.BackupHeader{
- Id: winio.BackupAlternateData,
- Size: ahdr.Size,
- Name: ahdr.Name[len(hdr.Name):] + ":$DATA",
- }
- err = bw.WriteHeader(&bhdr)
- if err != nil {
- return nil, err
- }
- _, err = io.CopyBuffer(bw, t, *buf)
- if err != nil {
- return nil, err
- }
- }
-}
-
-func copyDirInfo(fi os.FileInfo, path string) error {
- if err := os.Chmod(path, fi.Mode()); err != nil {
- return errors.Wrapf(err, "failed to chmod %s", path)
- }
- return nil
-}
-
-func copyUpXAttrs(dst, src string) error {
- return nil
-}
diff --git a/vendor/github.com/containerd/containerd/archive/time.go b/vendor/github.com/containerd/containerd/archive/time.go
deleted file mode 100644
index 16651a4d0..000000000
--- a/vendor/github.com/containerd/containerd/archive/time.go
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package archive
-
-import (
- "syscall"
- "time"
- "unsafe"
-)
-
-var (
- minTime = time.Unix(0, 0)
- maxTime time.Time
-)
-
-func init() {
- if unsafe.Sizeof(syscall.Timespec{}.Nsec) == 8 {
- // This is a 64 bit timespec
- // os.Chtimes limits time to the following
- maxTime = time.Unix(0, 1<<63-1)
- } else {
- // This is a 32 bit timespec
- maxTime = time.Unix(1<<31-1, 0)
- }
-}
-
-func boundTime(t time.Time) time.Time {
- if t.Before(minTime) || t.After(maxTime) {
- return minTime
- }
-
- return t
-}
-
-func latestTime(t1, t2 time.Time) time.Time {
- if t1.Before(t2) {
- return t2
- }
- return t1
-}
diff --git a/vendor/github.com/containerd/containerd/archive/time_unix.go b/vendor/github.com/containerd/containerd/archive/time_unix.go
deleted file mode 100644
index e05ca719c..000000000
--- a/vendor/github.com/containerd/containerd/archive/time_unix.go
+++ /dev/null
@@ -1,39 +0,0 @@
-// +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 archive
-
-import (
- "time"
-
- "golang.org/x/sys/unix"
-
- "github.com/pkg/errors"
-)
-
-func chtimes(path string, atime, mtime time.Time) error {
- var utimes [2]unix.Timespec
- utimes[0] = unix.NsecToTimespec(atime.UnixNano())
- utimes[1] = unix.NsecToTimespec(mtime.UnixNano())
-
- if err := unix.UtimesNanoAt(unix.AT_FDCWD, path, utimes[0:], unix.AT_SYMLINK_NOFOLLOW); err != nil {
- return errors.Wrapf(err, "failed call to UtimesNanoAt for %s", path)
- }
-
- return nil
-}
diff --git a/vendor/github.com/containerd/containerd/archive/time_windows.go b/vendor/github.com/containerd/containerd/archive/time_windows.go
deleted file mode 100644
index 71f397821..000000000
--- a/vendor/github.com/containerd/containerd/archive/time_windows.go
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package archive
-
-import (
- "time"
-
- "golang.org/x/sys/windows"
-)
-
-// chtimes will set the create time on a file using the given modtime.
-// This requires calling SetFileTime and explicitly including the create time.
-func chtimes(path string, atime, mtime time.Time) error {
- ctimespec := windows.NsecToTimespec(mtime.UnixNano())
- pathp, e := windows.UTF16PtrFromString(path)
- if e != nil {
- return e
- }
- h, e := windows.CreateFile(pathp,
- windows.FILE_WRITE_ATTRIBUTES, windows.FILE_SHARE_WRITE, nil,
- windows.OPEN_EXISTING, windows.FILE_FLAG_BACKUP_SEMANTICS, 0)
- if e != nil {
- return e
- }
- defer windows.Close(h)
- c := windows.NsecToFiletime(windows.TimespecToNsec(ctimespec))
- return windows.SetFileTime(h, &c, nil, nil)
-}
diff --git a/vendor/github.com/containerd/containerd/cio/io.go b/vendor/github.com/containerd/containerd/cio/io.go
deleted file mode 100644
index 663799941..000000000
--- a/vendor/github.com/containerd/containerd/cio/io.go
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cio
-
-import (
- "context"
- "errors"
- "fmt"
- "io"
- "net/url"
- "os"
- "path/filepath"
- "strings"
- "sync"
-
- "github.com/containerd/containerd/defaults"
-)
-
-var bufPool = sync.Pool{
- New: func() interface{} {
- buffer := make([]byte, 32<<10)
- return &buffer
- },
-}
-
-// Config holds the IO configurations.
-type Config struct {
- // Terminal is true if one has been allocated
- Terminal bool
- // Stdin path
- Stdin string
- // Stdout path
- Stdout string
- // Stderr path
- Stderr string
-}
-
-// IO holds the io information for a task or process
-type IO interface {
- // Config returns the IO configuration.
- Config() Config
- // Cancel aborts all current io operations.
- Cancel()
- // Wait blocks until all io copy operations have completed.
- Wait()
- // Close cleans up all open io resources. Cancel() is always called before
- // Close()
- Close() error
-}
-
-// Creator creates new IO sets for a task
-type Creator func(id string) (IO, error)
-
-// Attach allows callers to reattach to running tasks
-//
-// There should only be one reader for a task's IO set
-// because fifo's can only be read from one reader or the output
-// will be sent only to the first reads
-type Attach func(*FIFOSet) (IO, error)
-
-// FIFOSet is a set of file paths to FIFOs for a task's standard IO streams
-type FIFOSet struct {
- Config
- close func() error
-}
-
-// Close the FIFOSet
-func (f *FIFOSet) Close() error {
- if f.close != nil {
- return f.close()
- }
- return nil
-}
-
-// NewFIFOSet returns a new FIFOSet from a Config and a close function
-func NewFIFOSet(config Config, close func() error) *FIFOSet {
- return &FIFOSet{Config: config, close: close}
-}
-
-// Streams used to configure a Creator or Attach
-type Streams struct {
- Stdin io.Reader
- Stdout io.Writer
- Stderr io.Writer
- Terminal bool
- FIFODir string
-}
-
-// Opt customize options for creating a Creator or Attach
-type Opt func(*Streams)
-
-// WithStdio sets stream options to the standard input/output streams
-func WithStdio(opt *Streams) {
- WithStreams(os.Stdin, os.Stdout, os.Stderr)(opt)
-}
-
-// WithTerminal sets the terminal option
-func WithTerminal(opt *Streams) {
- opt.Terminal = true
-}
-
-// WithStreams sets the stream options to the specified Reader and Writers
-func WithStreams(stdin io.Reader, stdout, stderr io.Writer) Opt {
- return func(opt *Streams) {
- opt.Stdin = stdin
- opt.Stdout = stdout
- opt.Stderr = stderr
- }
-}
-
-// WithFIFODir sets the fifo directory.
-// e.g. "/run/containerd/fifo", "/run/users/1001/containerd/fifo"
-func WithFIFODir(dir string) Opt {
- return func(opt *Streams) {
- opt.FIFODir = dir
- }
-}
-
-// NewCreator returns an IO creator from the options
-func NewCreator(opts ...Opt) Creator {
- streams := &Streams{}
- for _, opt := range opts {
- opt(streams)
- }
- if streams.FIFODir == "" {
- streams.FIFODir = defaults.DefaultFIFODir
- }
- return func(id string) (IO, error) {
- fifos, err := NewFIFOSetInDir(streams.FIFODir, id, streams.Terminal)
- if err != nil {
- return nil, err
- }
- if streams.Stdin == nil {
- fifos.Stdin = ""
- }
- if streams.Stdout == nil {
- fifos.Stdout = ""
- }
- if streams.Stderr == nil {
- fifos.Stderr = ""
- }
- return copyIO(fifos, streams)
- }
-}
-
-// NewAttach attaches the existing io for a task to the provided io.Reader/Writers
-func NewAttach(opts ...Opt) Attach {
- streams := &Streams{}
- for _, opt := range opts {
- opt(streams)
- }
- return func(fifos *FIFOSet) (IO, error) {
- if fifos == nil {
- return nil, fmt.Errorf("cannot attach, missing fifos")
- }
- return copyIO(fifos, streams)
- }
-}
-
-// NullIO redirects the container's IO into /dev/null
-func NullIO(_ string) (IO, error) {
- return &cio{}, nil
-}
-
-// cio is a basic container IO implementation.
-type cio struct {
- config Config
- wg *sync.WaitGroup
- closers []io.Closer
- cancel context.CancelFunc
-}
-
-func (c *cio) Config() Config {
- return c.config
-}
-
-func (c *cio) Wait() {
- if c.wg != nil {
- c.wg.Wait()
- }
-}
-
-func (c *cio) Close() error {
- var lastErr error
- for _, closer := range c.closers {
- if closer == nil {
- continue
- }
- if err := closer.Close(); err != nil {
- lastErr = err
- }
- }
- return lastErr
-}
-
-func (c *cio) Cancel() {
- if c.cancel != nil {
- c.cancel()
- }
-}
-
-type pipes struct {
- Stdin io.WriteCloser
- Stdout io.ReadCloser
- Stderr io.ReadCloser
-}
-
-// DirectIO allows task IO to be handled externally by the caller
-type DirectIO struct {
- pipes
- cio
-}
-
-var (
- _ IO = &DirectIO{}
- _ IO = &logURI{}
-)
-
-// LogURI provides the raw logging URI
-func LogURI(uri *url.URL) Creator {
- return func(_ string) (IO, error) {
- return &logURI{
- config: Config{
- Stdout: uri.String(),
- Stderr: uri.String(),
- },
- }, nil
- }
-}
-
-// BinaryIO forwards container STDOUT|STDERR directly to a logging binary
-func BinaryIO(binary string, args map[string]string) Creator {
- return func(_ string) (IO, error) {
- uri, err := LogURIGenerator("binary", binary, args)
- if err != nil {
- return nil, err
- }
-
- res := uri.String()
- return &logURI{
- config: Config{
- Stdout: res,
- Stderr: res,
- },
- }, nil
- }
-}
-
-// LogFile creates a file on disk that logs the task's STDOUT,STDERR.
-// If the log file already exists, the logs will be appended to the file.
-func LogFile(path string) Creator {
- return func(_ string) (IO, error) {
- uri, err := LogURIGenerator("file", path, nil)
- if err != nil {
- return nil, err
- }
-
- res := uri.String()
- return &logURI{
- config: Config{
- Stdout: res,
- Stderr: res,
- },
- }, nil
- }
-}
-
-// LogURIGenerator is the helper to generate log uri with specific scheme.
-func LogURIGenerator(scheme string, path string, args map[string]string) (*url.URL, error) {
- path = filepath.Clean(path)
- if !strings.HasPrefix(path, "/") {
- return nil, errors.New("absolute path needed")
- }
-
- uri := &url.URL{
- Scheme: scheme,
- Path: path,
- }
-
- if len(args) == 0 {
- return uri, nil
- }
-
- q := uri.Query()
- for k, v := range args {
- q.Set(k, v)
- }
- uri.RawQuery = q.Encode()
- return uri, nil
-}
-
-type logURI struct {
- config Config
-}
-
-func (l *logURI) Config() Config {
- return l.config
-}
-
-func (l *logURI) Cancel() {
-
-}
-
-func (l *logURI) Wait() {
-
-}
-
-func (l *logURI) Close() error {
- return nil
-}
-
-// Load the io for a container but do not attach
-//
-// Allows io to be loaded on the task for deletion without
-// starting copy routines
-func Load(set *FIFOSet) (IO, error) {
- return &cio{
- config: set.Config,
- closers: []io.Closer{set},
- }, nil
-}
-
-func (p *pipes) closers() []io.Closer {
- return []io.Closer{p.Stdin, p.Stdout, p.Stderr}
-}
diff --git a/vendor/github.com/containerd/containerd/cio/io_unix.go b/vendor/github.com/containerd/containerd/cio/io_unix.go
deleted file mode 100644
index a92d92978..000000000
--- a/vendor/github.com/containerd/containerd/cio/io_unix.go
+++ /dev/null
@@ -1,156 +0,0 @@
-// +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 cio
-
-import (
- "context"
- "io"
- "io/ioutil"
- "os"
- "path/filepath"
- "sync"
- "syscall"
-
- "github.com/containerd/fifo"
- "github.com/pkg/errors"
-)
-
-// NewFIFOSetInDir returns a new FIFOSet with paths in a temporary directory under root
-func NewFIFOSetInDir(root, id string, terminal bool) (*FIFOSet, error) {
- if root != "" {
- if err := os.MkdirAll(root, 0700); err != nil {
- return nil, err
- }
- }
- dir, err := ioutil.TempDir(root, "")
- if err != nil {
- return nil, err
- }
- closer := func() error {
- return os.RemoveAll(dir)
- }
- return NewFIFOSet(Config{
- Stdin: filepath.Join(dir, id+"-stdin"),
- Stdout: filepath.Join(dir, id+"-stdout"),
- Stderr: filepath.Join(dir, id+"-stderr"),
- Terminal: terminal,
- }, closer), nil
-}
-
-func copyIO(fifos *FIFOSet, ioset *Streams) (*cio, error) {
- var ctx, cancel = context.WithCancel(context.Background())
- pipes, err := openFifos(ctx, fifos)
- if err != nil {
- cancel()
- return nil, err
- }
-
- if fifos.Stdin != "" {
- go func() {
- p := bufPool.Get().(*[]byte)
- defer bufPool.Put(p)
-
- io.CopyBuffer(pipes.Stdin, ioset.Stdin, *p)
- pipes.Stdin.Close()
- }()
- }
-
- var wg = &sync.WaitGroup{}
- if fifos.Stdout != "" {
- wg.Add(1)
- go func() {
- p := bufPool.Get().(*[]byte)
- defer bufPool.Put(p)
-
- io.CopyBuffer(ioset.Stdout, pipes.Stdout, *p)
- pipes.Stdout.Close()
- wg.Done()
- }()
- }
-
- if !fifos.Terminal && fifos.Stderr != "" {
- wg.Add(1)
- go func() {
- p := bufPool.Get().(*[]byte)
- defer bufPool.Put(p)
-
- io.CopyBuffer(ioset.Stderr, pipes.Stderr, *p)
- pipes.Stderr.Close()
- wg.Done()
- }()
- }
- return &cio{
- config: fifos.Config,
- wg: wg,
- closers: append(pipes.closers(), fifos),
- cancel: cancel,
- }, nil
-}
-
-func openFifos(ctx context.Context, fifos *FIFOSet) (pipes, error) {
- var err error
- defer func() {
- if err != nil {
- fifos.Close()
- }
- }()
-
- var f pipes
- if fifos.Stdin != "" {
- if f.Stdin, err = fifo.OpenFifo(ctx, fifos.Stdin, syscall.O_WRONLY|syscall.O_CREAT|syscall.O_NONBLOCK, 0700); err != nil {
- return f, errors.Wrapf(err, "failed to open stdin fifo")
- }
- defer func() {
- if err != nil && f.Stdin != nil {
- f.Stdin.Close()
- }
- }()
- }
- if fifos.Stdout != "" {
- if f.Stdout, err = fifo.OpenFifo(ctx, fifos.Stdout, syscall.O_RDONLY|syscall.O_CREAT|syscall.O_NONBLOCK, 0700); err != nil {
- return f, errors.Wrapf(err, "failed to open stdout fifo")
- }
- defer func() {
- if err != nil && f.Stdout != nil {
- f.Stdout.Close()
- }
- }()
- }
- if !fifos.Terminal && fifos.Stderr != "" {
- if f.Stderr, err = fifo.OpenFifo(ctx, fifos.Stderr, syscall.O_RDONLY|syscall.O_CREAT|syscall.O_NONBLOCK, 0700); err != nil {
- return f, errors.Wrapf(err, "failed to open stderr fifo")
- }
- }
- return f, nil
-}
-
-// NewDirectIO returns an IO implementation that exposes the IO streams as io.ReadCloser
-// and io.WriteCloser.
-func NewDirectIO(ctx context.Context, fifos *FIFOSet) (*DirectIO, error) {
- ctx, cancel := context.WithCancel(ctx)
- pipes, err := openFifos(ctx, fifos)
- return &DirectIO{
- pipes: pipes,
- cio: cio{
- config: fifos.Config,
- closers: append(pipes.closers(), fifos),
- cancel: cancel,
- },
- }, err
-}
diff --git a/vendor/github.com/containerd/containerd/cio/io_windows.go b/vendor/github.com/containerd/containerd/cio/io_windows.go
deleted file mode 100644
index ca6cd54a4..000000000
--- a/vendor/github.com/containerd/containerd/cio/io_windows.go
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package cio
-
-import (
- "context"
- "fmt"
- "io"
- "net"
-
- winio "github.com/Microsoft/go-winio"
- "github.com/containerd/containerd/log"
- "github.com/pkg/errors"
-)
-
-const pipeRoot = `\\.\pipe`
-
-// NewFIFOSetInDir returns a new set of fifos for the task
-func NewFIFOSetInDir(_, id string, terminal bool) (*FIFOSet, error) {
- stderrPipe := ""
- if !terminal {
- stderrPipe = fmt.Sprintf(`%s\ctr-%s-stderr`, pipeRoot, id)
- }
- return NewFIFOSet(Config{
- Terminal: terminal,
- Stdin: fmt.Sprintf(`%s\ctr-%s-stdin`, pipeRoot, id),
- Stdout: fmt.Sprintf(`%s\ctr-%s-stdout`, pipeRoot, id),
- Stderr: stderrPipe,
- }, nil), nil
-}
-
-func copyIO(fifos *FIFOSet, ioset *Streams) (*cio, error) {
- var (
- set []io.Closer
- )
-
- if fifos.Stdin != "" {
- l, err := winio.ListenPipe(fifos.Stdin, nil)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to create stdin pipe %s", fifos.Stdin)
- }
- defer func(l net.Listener) {
- if err != nil {
- l.Close()
- }
- }(l)
- set = append(set, l)
-
- go func() {
- c, err := l.Accept()
- if err != nil {
- log.L.WithError(err).Errorf("failed to accept stdin connection on %s", fifos.Stdin)
- return
- }
-
- p := bufPool.Get().(*[]byte)
- defer bufPool.Put(p)
-
- io.CopyBuffer(c, ioset.Stdin, *p)
- c.Close()
- l.Close()
- }()
- }
-
- if fifos.Stdout != "" {
- l, err := winio.ListenPipe(fifos.Stdout, nil)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to create stdout pipe %s", fifos.Stdout)
- }
- defer func(l net.Listener) {
- if err != nil {
- l.Close()
- }
- }(l)
- set = append(set, l)
-
- go func() {
- c, err := l.Accept()
- if err != nil {
- log.L.WithError(err).Errorf("failed to accept stdout connection on %s", fifos.Stdout)
- return
- }
-
- p := bufPool.Get().(*[]byte)
- defer bufPool.Put(p)
-
- io.CopyBuffer(ioset.Stdout, c, *p)
- c.Close()
- l.Close()
- }()
- }
-
- if fifos.Stderr != "" {
- l, err := winio.ListenPipe(fifos.Stderr, nil)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to create stderr pipe %s", fifos.Stderr)
- }
- defer func(l net.Listener) {
- if err != nil {
- l.Close()
- }
- }(l)
- set = append(set, l)
-
- go func() {
- c, err := l.Accept()
- if err != nil {
- log.L.WithError(err).Errorf("failed to accept stderr connection on %s", fifos.Stderr)
- return
- }
-
- p := bufPool.Get().(*[]byte)
- defer bufPool.Put(p)
-
- io.CopyBuffer(ioset.Stderr, c, *p)
- c.Close()
- l.Close()
- }()
- }
-
- return &cio{config: fifos.Config, closers: set}, nil
-}
-
-// NewDirectIO returns an IO implementation that exposes the IO streams as io.ReadCloser
-// and io.WriteCloser.
-func NewDirectIO(stdin io.WriteCloser, stdout, stderr io.ReadCloser, terminal bool) *DirectIO {
- return &DirectIO{
- pipes: pipes{
- Stdin: stdin,
- Stdout: stdout,
- Stderr: stderr,
- },
- cio: cio{
- config: Config{Terminal: terminal},
- },
- }
-}
-
-// NewDirectIOFromFIFOSet returns an IO implementation that exposes the IO streams as io.ReadCloser
-// and io.WriteCloser.
-func NewDirectIOFromFIFOSet(ctx context.Context, stdin io.WriteCloser, stdout, stderr io.ReadCloser, fifos *FIFOSet) *DirectIO {
- _, cancel := context.WithCancel(ctx)
- pipes := pipes{
- Stdin: stdin,
- Stdout: stdout,
- Stderr: stderr,
- }
- return &DirectIO{
- pipes: pipes,
- cio: cio{
- config: fifos.Config,
- closers: append(pipes.closers(), fifos),
- cancel: cancel,
- },
- }
-}
diff --git a/vendor/github.com/containerd/containerd/client.go b/vendor/github.com/containerd/containerd/client.go
deleted file mode 100644
index e72433c9b..000000000
--- a/vendor/github.com/containerd/containerd/client.go
+++ /dev/null
@@ -1,784 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package containerd
-
-import (
- "bytes"
- "context"
- "encoding/json"
- "fmt"
- "net/http"
- "runtime"
- "strconv"
- "strings"
- "sync"
- "time"
-
- containersapi "github.com/containerd/containerd/api/services/containers/v1"
- contentapi "github.com/containerd/containerd/api/services/content/v1"
- diffapi "github.com/containerd/containerd/api/services/diff/v1"
- eventsapi "github.com/containerd/containerd/api/services/events/v1"
- imagesapi "github.com/containerd/containerd/api/services/images/v1"
- introspectionapi "github.com/containerd/containerd/api/services/introspection/v1"
- leasesapi "github.com/containerd/containerd/api/services/leases/v1"
- namespacesapi "github.com/containerd/containerd/api/services/namespaces/v1"
- snapshotsapi "github.com/containerd/containerd/api/services/snapshots/v1"
- "github.com/containerd/containerd/api/services/tasks/v1"
- versionservice "github.com/containerd/containerd/api/services/version/v1"
- "github.com/containerd/containerd/containers"
- "github.com/containerd/containerd/content"
- contentproxy "github.com/containerd/containerd/content/proxy"
- "github.com/containerd/containerd/defaults"
- "github.com/containerd/containerd/errdefs"
- "github.com/containerd/containerd/events"
- "github.com/containerd/containerd/images"
- "github.com/containerd/containerd/leases"
- leasesproxy "github.com/containerd/containerd/leases/proxy"
- "github.com/containerd/containerd/namespaces"
- "github.com/containerd/containerd/pkg/dialer"
- "github.com/containerd/containerd/platforms"
- "github.com/containerd/containerd/plugin"
- "github.com/containerd/containerd/remotes"
- "github.com/containerd/containerd/remotes/docker"
- "github.com/containerd/containerd/services/introspection"
- "github.com/containerd/containerd/snapshots"
- snproxy "github.com/containerd/containerd/snapshots/proxy"
- "github.com/containerd/typeurl"
- ptypes "github.com/gogo/protobuf/types"
- ocispec "github.com/opencontainers/image-spec/specs-go/v1"
- specs "github.com/opencontainers/runtime-spec/specs-go"
- "github.com/pkg/errors"
- "google.golang.org/grpc"
- "google.golang.org/grpc/backoff"
- "google.golang.org/grpc/health/grpc_health_v1"
-)
-
-func init() {
- const prefix = "types.containerd.io"
- // register TypeUrls for commonly marshaled external types
- major := strconv.Itoa(specs.VersionMajor)
- typeurl.Register(&specs.Spec{}, prefix, "opencontainers/runtime-spec", major, "Spec")
- typeurl.Register(&specs.Process{}, prefix, "opencontainers/runtime-spec", major, "Process")
- typeurl.Register(&specs.LinuxResources{}, prefix, "opencontainers/runtime-spec", major, "LinuxResources")
- typeurl.Register(&specs.WindowsResources{}, prefix, "opencontainers/runtime-spec", major, "WindowsResources")
-}
-
-// New returns a new containerd client that is connected to the containerd
-// instance provided by address
-func New(address string, opts ...ClientOpt) (*Client, error) {
- var copts clientOpts
- for _, o := range opts {
- if err := o(&copts); err != nil {
- return nil, err
- }
- }
- if copts.timeout == 0 {
- copts.timeout = 10 * time.Second
- }
-
- c := &Client{
- defaultns: copts.defaultns,
- }
-
- if copts.defaultRuntime != "" {
- c.runtime = copts.defaultRuntime
- } else {
- c.runtime = defaults.DefaultRuntime
- }
-
- if copts.defaultPlatform != nil {
- c.platform = copts.defaultPlatform
- } else {
- c.platform = platforms.Default()
- }
-
- if copts.services != nil {
- c.services = *copts.services
- }
- if address != "" {
- backoffConfig := backoff.DefaultConfig
- backoffConfig.MaxDelay = 3 * time.Second
- connParams := grpc.ConnectParams{
- Backoff: backoffConfig,
- }
- gopts := []grpc.DialOption{
- grpc.WithBlock(),
- grpc.WithInsecure(),
- grpc.FailOnNonTempDialError(true),
- grpc.WithConnectParams(connParams),
- grpc.WithContextDialer(dialer.ContextDialer),
-
- // TODO(stevvooe): We may need to allow configuration of this on the client.
- grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(defaults.DefaultMaxRecvMsgSize)),
- grpc.WithDefaultCallOptions(grpc.MaxCallSendMsgSize(defaults.DefaultMaxSendMsgSize)),
- }
- if len(copts.dialOptions) > 0 {
- gopts = copts.dialOptions
- }
- if copts.defaultns != "" {
- unary, stream := newNSInterceptors(copts.defaultns)
- gopts = append(gopts,
- grpc.WithUnaryInterceptor(unary),
- grpc.WithStreamInterceptor(stream),
- )
- }
- connector := func() (*grpc.ClientConn, error) {
- ctx, cancel := context.WithTimeout(context.Background(), copts.timeout)
- defer cancel()
- conn, err := grpc.DialContext(ctx, dialer.DialAddress(address), gopts...)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to dial %q", address)
- }
- return conn, nil
- }
- conn, err := connector()
- if err != nil {
- return nil, err
- }
- c.conn, c.connector = conn, connector
- }
- if copts.services == nil && c.conn == nil {
- return nil, errors.Wrap(errdefs.ErrUnavailable, "no grpc connection or services is available")
- }
-
- // check namespace labels for default runtime
- if copts.defaultRuntime == "" && c.defaultns != "" {
- if label, err := c.GetLabel(context.Background(), defaults.DefaultRuntimeNSLabel); err != nil {
- return nil, err
- } else if label != "" {
- c.runtime = label
- }
- }
-
- return c, nil
-}
-
-// NewWithConn returns a new containerd client that is connected to the containerd
-// instance provided by the connection
-func NewWithConn(conn *grpc.ClientConn, opts ...ClientOpt) (*Client, error) {
- var copts clientOpts
- for _, o := range opts {
- if err := o(&copts); err != nil {
- return nil, err
- }
- }
- c := &Client{
- defaultns: copts.defaultns,
- conn: conn,
- runtime: fmt.Sprintf("%s.%s", plugin.RuntimePlugin, runtime.GOOS),
- }
-
- // check namespace labels for default runtime
- if copts.defaultRuntime == "" && c.defaultns != "" {
- if label, err := c.GetLabel(context.Background(), defaults.DefaultRuntimeNSLabel); err != nil {
- return nil, err
- } else if label != "" {
- c.runtime = label
- }
- }
-
- if copts.services != nil {
- c.services = *copts.services
- }
- return c, nil
-}
-
-// Client is the client to interact with containerd and its various services
-// using a uniform interface
-type Client struct {
- services
- connMu sync.Mutex
- conn *grpc.ClientConn
- runtime string
- defaultns string
- platform platforms.MatchComparer
- connector func() (*grpc.ClientConn, error)
-}
-
-// Reconnect re-establishes the GRPC connection to the containerd daemon
-func (c *Client) Reconnect() error {
- if c.connector == nil {
- return errors.Wrap(errdefs.ErrUnavailable, "unable to reconnect to containerd, no connector available")
- }
- c.connMu.Lock()
- defer c.connMu.Unlock()
- c.conn.Close()
- conn, err := c.connector()
- if err != nil {
- return err
- }
- c.conn = conn
- return nil
-}
-
-// IsServing returns true if the client can successfully connect to the
-// containerd daemon and the healthcheck service returns the SERVING
-// response.
-// This call will block if a transient error is encountered during
-// connection. A timeout can be set in the context to ensure it returns
-// early.
-func (c *Client) IsServing(ctx context.Context) (bool, error) {
- c.connMu.Lock()
- if c.conn == nil {
- c.connMu.Unlock()
- return false, errors.Wrap(errdefs.ErrUnavailable, "no grpc connection available")
- }
- c.connMu.Unlock()
- r, err := c.HealthService().Check(ctx, &grpc_health_v1.HealthCheckRequest{}, grpc.WaitForReady(true))
- if err != nil {
- return false, err
- }
- return r.Status == grpc_health_v1.HealthCheckResponse_SERVING, nil
-}
-
-// Containers returns all containers created in containerd
-func (c *Client) Containers(ctx context.Context, filters ...string) ([]Container, error) {
- r, err := c.ContainerService().List(ctx, filters...)
- if err != nil {
- return nil, err
- }
- var out []Container
- for _, container := range r {
- out = append(out, containerFromRecord(c, container))
- }
- return out, nil
-}
-
-// NewContainer will create a new container in container with the provided id
-// the id must be unique within the namespace
-func (c *Client) NewContainer(ctx context.Context, id string, opts ...NewContainerOpts) (Container, error) {
- ctx, done, err := c.WithLease(ctx)
- if err != nil {
- return nil, err
- }
- defer done(ctx)
-
- container := containers.Container{
- ID: id,
- Runtime: containers.RuntimeInfo{
- Name: c.runtime,
- },
- }
- for _, o := range opts {
- if err := o(ctx, c, &container); err != nil {
- return nil, err
- }
- }
- r, err := c.ContainerService().Create(ctx, container)
- if err != nil {
- return nil, err
- }
- return containerFromRecord(c, r), nil
-}
-
-// LoadContainer loads an existing container from metadata
-func (c *Client) LoadContainer(ctx context.Context, id string) (Container, error) {
- r, err := c.ContainerService().Get(ctx, id)
- if err != nil {
- return nil, err
- }
- return containerFromRecord(c, r), nil
-}
-
-// RemoteContext is used to configure object resolutions and transfers with
-// remote content stores and image providers.
-type RemoteContext struct {
- // Resolver is used to resolve names to objects, fetchers, and pushers.
- // If no resolver is provided, defaults to Docker registry resolver.
- Resolver remotes.Resolver
-
- // PlatformMatcher is used to match the platforms for an image
- // operation and define the preference when a single match is required
- // from multiple platforms.
- PlatformMatcher platforms.MatchComparer
-
- // Unpack is done after an image is pulled to extract into a snapshotter.
- // It is done simultaneously for schema 2 images when they are pulled.
- // If an image is not unpacked on pull, it can be unpacked any time
- // afterwards. Unpacking is required to run an image.
- Unpack bool
-
- // UnpackOpts handles options to the unpack call.
- UnpackOpts []UnpackOpt
-
- // Snapshotter used for unpacking
- Snapshotter string
-
- // SnapshotterOpts are additional options to be passed to a snapshotter during pull
- SnapshotterOpts []snapshots.Opt
-
- // Labels to be applied to the created image
- Labels map[string]string
-
- // BaseHandlers are a set of handlers which get are called on dispatch.
- // These handlers always get called before any operation specific
- // handlers.
- BaseHandlers []images.Handler
-
- // HandlerWrapper wraps the handler which gets sent to dispatch.
- // Unlike BaseHandlers, this can run before and after the built
- // in handlers, allowing operations to run on the descriptor
- // after it has completed transferring.
- HandlerWrapper func(images.Handler) images.Handler
-
- // ConvertSchema1 is whether to convert Docker registry schema 1
- // manifests. If this option is false then any image which resolves
- // to schema 1 will return an error since schema 1 is not supported.
- ConvertSchema1 bool
-
- // Platforms defines which platforms to handle when doing the image operation.
- // Platforms is ignored when a PlatformMatcher is set, otherwise the
- // platforms will be used to create a PlatformMatcher with no ordering
- // preference.
- Platforms []string
-
- // MaxConcurrentDownloads is the max concurrent content downloads for each pull.
- MaxConcurrentDownloads int
-
- // AllMetadata downloads all manifests and known-configuration files
- AllMetadata bool
-
- // ChildLabelMap sets the labels used to reference child objects in the content
- // store. By default, all GC reference labels will be set for all fetched content.
- ChildLabelMap func(ocispec.Descriptor) []string
-}
-
-func defaultRemoteContext() *RemoteContext {
- return &RemoteContext{
- Resolver: docker.NewResolver(docker.ResolverOptions{
- Client: http.DefaultClient,
- }),
- }
-}
-
-// Fetch downloads the provided content into containerd's content store
-// and returns a non-platform specific image reference
-func (c *Client) Fetch(ctx context.Context, ref string, opts ...RemoteOpt) (images.Image, error) {
- fetchCtx := defaultRemoteContext()
- for _, o := range opts {
- if err := o(c, fetchCtx); err != nil {
- return images.Image{}, err
- }
- }
-
- if fetchCtx.Unpack {
- return images.Image{}, errors.Wrap(errdefs.ErrNotImplemented, "unpack on fetch not supported, try pull")
- }
-
- if fetchCtx.PlatformMatcher == nil {
- if len(fetchCtx.Platforms) == 0 {
- fetchCtx.PlatformMatcher = platforms.All
- } else {
- var ps []ocispec.Platform
- for _, s := range fetchCtx.Platforms {
- p, err := platforms.Parse(s)
- if err != nil {
- return images.Image{}, errors.Wrapf(err, "invalid platform %s", s)
- }
- ps = append(ps, p)
- }
-
- fetchCtx.PlatformMatcher = platforms.Any(ps...)
- }
- }
-
- ctx, done, err := c.WithLease(ctx)
- if err != nil {
- return images.Image{}, err
- }
- defer done(ctx)
-
- img, err := c.fetch(ctx, fetchCtx, ref, 0)
- if err != nil {
- return images.Image{}, err
- }
- return c.createNewImage(ctx, img)
-}
-
-// Push uploads the provided content to a remote resource
-func (c *Client) Push(ctx context.Context, ref string, desc ocispec.Descriptor, opts ...RemoteOpt) error {
- pushCtx := defaultRemoteContext()
- for _, o := range opts {
- if err := o(c, pushCtx); err != nil {
- return err
- }
- }
- if pushCtx.PlatformMatcher == nil {
- if len(pushCtx.Platforms) > 0 {
- var ps []ocispec.Platform
- for _, platform := range pushCtx.Platforms {
- p, err := platforms.Parse(platform)
- if err != nil {
- return errors.Wrapf(err, "invalid platform %s", platform)
- }
- ps = append(ps, p)
- }
- pushCtx.PlatformMatcher = platforms.Any(ps...)
- } else {
- pushCtx.PlatformMatcher = platforms.All
- }
- }
-
- // Annotate ref with digest to push only push tag for single digest
- if !strings.Contains(ref, "@") {
- ref = ref + "@" + desc.Digest.String()
- }
-
- pusher, err := pushCtx.Resolver.Pusher(ctx, ref)
- if err != nil {
- return err
- }
-
- var wrapper func(images.Handler) images.Handler
-
- if len(pushCtx.BaseHandlers) > 0 {
- wrapper = func(h images.Handler) images.Handler {
- h = images.Handlers(append(pushCtx.BaseHandlers, h)...)
- if pushCtx.HandlerWrapper != nil {
- h = pushCtx.HandlerWrapper(h)
- }
- return h
- }
- } else if pushCtx.HandlerWrapper != nil {
- wrapper = pushCtx.HandlerWrapper
- }
-
- return remotes.PushContent(ctx, pusher, desc, c.ContentStore(), pushCtx.PlatformMatcher, wrapper)
-}
-
-// GetImage returns an existing image
-func (c *Client) GetImage(ctx context.Context, ref string) (Image, error) {
- i, err := c.ImageService().Get(ctx, ref)
- if err != nil {
- return nil, err
- }
- return NewImage(c, i), nil
-}
-
-// ListImages returns all existing images
-func (c *Client) ListImages(ctx context.Context, filters ...string) ([]Image, error) {
- imgs, err := c.ImageService().List(ctx, filters...)
- if err != nil {
- return nil, err
- }
- images := make([]Image, len(imgs))
- for i, img := range imgs {
- images[i] = NewImage(c, img)
- }
- return images, nil
-}
-
-// Restore restores a container from a checkpoint
-func (c *Client) Restore(ctx context.Context, id string, checkpoint Image, opts ...RestoreOpts) (Container, error) {
- store := c.ContentStore()
- index, err := decodeIndex(ctx, store, checkpoint.Target())
- if err != nil {
- return nil, err
- }
-
- ctx, done, err := c.WithLease(ctx)
- if err != nil {
- return nil, err
- }
- defer done(ctx)
-
- copts := []NewContainerOpts{}
- for _, o := range opts {
- copts = append(copts, o(ctx, id, c, checkpoint, index))
- }
-
- ctr, err := c.NewContainer(ctx, id, copts...)
- if err != nil {
- return nil, err
- }
-
- return ctr, nil
-}
-
-func writeIndex(ctx context.Context, index *ocispec.Index, client *Client, ref string) (d ocispec.Descriptor, err error) {
- labels := map[string]string{}
- for i, m := range index.Manifests {
- labels[fmt.Sprintf("containerd.io/gc.ref.content.%d", i)] = m.Digest.String()
- }
- data, err := json.Marshal(index)
- if err != nil {
- return ocispec.Descriptor{}, err
- }
- return writeContent(ctx, client.ContentStore(), ocispec.MediaTypeImageIndex, ref, bytes.NewReader(data), content.WithLabels(labels))
-}
-
-// GetLabel gets a label value from namespace store
-// If there is no default label, an empty string returned with nil error
-func (c *Client) GetLabel(ctx context.Context, label string) (string, error) {
- ns, err := namespaces.NamespaceRequired(ctx)
- if err != nil {
- if c.defaultns == "" {
- return "", err
- }
- ns = c.defaultns
- }
-
- srv := c.NamespaceService()
- labels, err := srv.Labels(ctx, ns)
- if err != nil {
- return "", err
- }
-
- value := labels[label]
- return value, nil
-}
-
-// Subscribe to events that match one or more of the provided filters.
-//
-// Callers should listen on both the envelope and errs channels. If the errs
-// channel returns nil or an error, the subscriber should terminate.
-//
-// The subscriber can stop receiving events by canceling the provided context.
-// The errs channel will be closed and return a nil error.
-func (c *Client) Subscribe(ctx context.Context, filters ...string) (ch <-chan *events.Envelope, errs <-chan error) {
- return c.EventService().Subscribe(ctx, filters...)
-}
-
-// Close closes the clients connection to containerd
-func (c *Client) Close() error {
- c.connMu.Lock()
- defer c.connMu.Unlock()
- if c.conn != nil {
- return c.conn.Close()
- }
- return nil
-}
-
-// NamespaceService returns the underlying Namespaces Store
-func (c *Client) NamespaceService() namespaces.Store {
- if c.namespaceStore != nil {
- return c.namespaceStore
- }
- c.connMu.Lock()
- defer c.connMu.Unlock()
- return NewNamespaceStoreFromClient(namespacesapi.NewNamespacesClient(c.conn))
-}
-
-// ContainerService returns the underlying container Store
-func (c *Client) ContainerService() containers.Store {
- if c.containerStore != nil {
- return c.containerStore
- }
- c.connMu.Lock()
- defer c.connMu.Unlock()
- return NewRemoteContainerStore(containersapi.NewContainersClient(c.conn))
-}
-
-// ContentStore returns the underlying content Store
-func (c *Client) ContentStore() content.Store {
- if c.contentStore != nil {
- return c.contentStore
- }
- c.connMu.Lock()
- defer c.connMu.Unlock()
- return contentproxy.NewContentStore(contentapi.NewContentClient(c.conn))
-}
-
-// SnapshotService returns the underlying snapshotter for the provided snapshotter name
-func (c *Client) SnapshotService(snapshotterName string) snapshots.Snapshotter {
- snapshotterName, err := c.resolveSnapshotterName(context.Background(), snapshotterName)
- if err != nil {
- snapshotterName = DefaultSnapshotter
- }
- if c.snapshotters != nil {
- return c.snapshotters[snapshotterName]
- }
- c.connMu.Lock()
- defer c.connMu.Unlock()
- return snproxy.NewSnapshotter(snapshotsapi.NewSnapshotsClient(c.conn), snapshotterName)
-}
-
-// TaskService returns the underlying TasksClient
-func (c *Client) TaskService() tasks.TasksClient {
- if c.taskService != nil {
- return c.taskService
- }
- c.connMu.Lock()
- defer c.connMu.Unlock()
- return tasks.NewTasksClient(c.conn)
-}
-
-// ImageService returns the underlying image Store
-func (c *Client) ImageService() images.Store {
- if c.imageStore != nil {
- return c.imageStore
- }
- c.connMu.Lock()
- defer c.connMu.Unlock()
- return NewImageStoreFromClient(imagesapi.NewImagesClient(c.conn))
-}
-
-// DiffService returns the underlying Differ
-func (c *Client) DiffService() DiffService {
- if c.diffService != nil {
- return c.diffService
- }
- c.connMu.Lock()
- defer c.connMu.Unlock()
- return NewDiffServiceFromClient(diffapi.NewDiffClient(c.conn))
-}
-
-// IntrospectionService returns the underlying Introspection Client
-func (c *Client) IntrospectionService() introspection.Service {
- if c.introspectionService != nil {
- return c.introspectionService
- }
- c.connMu.Lock()
- defer c.connMu.Unlock()
- return introspection.NewIntrospectionServiceFromClient(introspectionapi.NewIntrospectionClient(c.conn))
-}
-
-// LeasesService returns the underlying Leases Client
-func (c *Client) LeasesService() leases.Manager {
- if c.leasesService != nil {
- return c.leasesService
- }
- c.connMu.Lock()
- defer c.connMu.Unlock()
- return leasesproxy.NewLeaseManager(leasesapi.NewLeasesClient(c.conn))
-}
-
-// HealthService returns the underlying GRPC HealthClient
-func (c *Client) HealthService() grpc_health_v1.HealthClient {
- c.connMu.Lock()
- defer c.connMu.Unlock()
- return grpc_health_v1.NewHealthClient(c.conn)
-}
-
-// EventService returns the underlying event service
-func (c *Client) EventService() EventService {
- if c.eventService != nil {
- return c.eventService
- }
- c.connMu.Lock()
- defer c.connMu.Unlock()
- return NewEventServiceFromClient(eventsapi.NewEventsClient(c.conn))
-}
-
-// VersionService returns the underlying VersionClient
-func (c *Client) VersionService() versionservice.VersionClient {
- c.connMu.Lock()
- defer c.connMu.Unlock()
- return versionservice.NewVersionClient(c.conn)
-}
-
-// Conn returns the underlying GRPC connection object
-func (c *Client) Conn() *grpc.ClientConn {
- c.connMu.Lock()
- defer c.connMu.Unlock()
- return c.conn
-}
-
-// Version of containerd
-type Version struct {
- // Version number
- Version string
- // Revision from git that was built
- Revision string
-}
-
-// Version returns the version of containerd that the client is connected to
-func (c *Client) Version(ctx context.Context) (Version, error) {
- c.connMu.Lock()
- if c.conn == nil {
- c.connMu.Unlock()
- return Version{}, errors.Wrap(errdefs.ErrUnavailable, "no grpc connection available")
- }
- c.connMu.Unlock()
- response, err := c.VersionService().Version(ctx, &ptypes.Empty{})
- if err != nil {
- return Version{}, err
- }
- return Version{
- Version: response.Version,
- Revision: response.Revision,
- }, nil
-}
-
-type ServerInfo struct {
- UUID string
-}
-
-func (c *Client) Server(ctx context.Context) (ServerInfo, error) {
- c.connMu.Lock()
- if c.conn == nil {
- c.connMu.Unlock()
- return ServerInfo{}, errors.Wrap(errdefs.ErrUnavailable, "no grpc connection available")
- }
- c.connMu.Unlock()
-
- response, err := c.IntrospectionService().Server(ctx, &ptypes.Empty{})
- if err != nil {
- return ServerInfo{}, err
- }
- return ServerInfo{
- UUID: response.UUID,
- }, nil
-}
-
-func (c *Client) resolveSnapshotterName(ctx context.Context, name string) (string, error) {
- if name == "" {
- label, err := c.GetLabel(ctx, defaults.DefaultSnapshotterNSLabel)
- if err != nil {
- return "", err
- }
-
- if label != "" {
- name = label
- } else {
- name = DefaultSnapshotter
- }
- }
-
- return name, nil
-}
-
-func (c *Client) getSnapshotter(ctx context.Context, name string) (snapshots.Snapshotter, error) {
- name, err := c.resolveSnapshotterName(ctx, name)
- if err != nil {
- return nil, err
- }
-
- s := c.SnapshotService(name)
- if s == nil {
- return nil, errors.Wrapf(errdefs.ErrNotFound, "snapshotter %s was not found", name)
- }
-
- return s, nil
-}
-
-// CheckRuntime returns true if the current runtime matches the expected
-// runtime. Providing various parts of the runtime schema will match those
-// parts of the expected runtime
-func CheckRuntime(current, expected string) bool {
- cp := strings.Split(current, ".")
- l := len(cp)
- for i, p := range strings.Split(expected, ".") {
- if i > l {
- return false
- }
- if p != cp[i] {
- return false
- }
- }
- return true
-}
diff --git a/vendor/github.com/containerd/containerd/client_opts.go b/vendor/github.com/containerd/containerd/client_opts.go
deleted file mode 100644
index 5271b94ee..000000000
--- a/vendor/github.com/containerd/containerd/client_opts.go
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package containerd
-
-import (
- "time"
-
- "github.com/containerd/containerd/images"
- "github.com/containerd/containerd/platforms"
- "github.com/containerd/containerd/remotes"
- "github.com/containerd/containerd/snapshots"
- ocispec "github.com/opencontainers/image-spec/specs-go/v1"
-
- "google.golang.org/grpc"
-)
-
-type clientOpts struct {
- defaultns string
- defaultRuntime string
- defaultPlatform platforms.MatchComparer
- services *services
- dialOptions []grpc.DialOption
- timeout time.Duration
-}
-
-// ClientOpt allows callers to set options on the containerd client
-type ClientOpt func(c *clientOpts) error
-
-// WithDefaultNamespace sets the default namespace on the client
-//
-// Any operation that does not have a namespace set on the context will
-// be provided the default namespace
-func WithDefaultNamespace(ns string) ClientOpt {
- return func(c *clientOpts) error {
- c.defaultns = ns
- return nil
- }
-}
-
-// WithDefaultRuntime sets the default runtime on the client
-func WithDefaultRuntime(rt string) ClientOpt {
- return func(c *clientOpts) error {
- c.defaultRuntime = rt
- return nil
- }
-}
-
-// WithDefaultPlatform sets the default platform matcher on the client
-func WithDefaultPlatform(platform platforms.MatchComparer) ClientOpt {
- return func(c *clientOpts) error {
- c.defaultPlatform = platform
- return nil
- }
-}
-
-// WithDialOpts allows grpc.DialOptions to be set on the connection
-func WithDialOpts(opts []grpc.DialOption) ClientOpt {
- return func(c *clientOpts) error {
- c.dialOptions = opts
- return nil
- }
-}
-
-// WithServices sets services used by the client.
-func WithServices(opts ...ServicesOpt) ClientOpt {
- return func(c *clientOpts) error {
- c.services = &services{}
- for _, o := range opts {
- o(c.services)
- }
- return nil
- }
-}
-
-// WithTimeout sets the connection timeout for the client
-func WithTimeout(d time.Duration) ClientOpt {
- return func(c *clientOpts) error {
- c.timeout = d
- return nil
- }
-}
-
-// RemoteOpt allows the caller to set distribution options for a remote
-type RemoteOpt func(*Client, *RemoteContext) error
-
-// WithPlatform allows the caller to specify a platform to retrieve
-// content for
-func WithPlatform(platform string) RemoteOpt {
- if platform == "" {
- platform = platforms.DefaultString()
- }
- return func(_ *Client, c *RemoteContext) error {
- for _, p := range c.Platforms {
- if p == platform {
- return nil
- }
- }
-
- c.Platforms = append(c.Platforms, platform)
- return nil
- }
-}
-
-// WithPlatformMatcher specifies the matcher to use for
-// determining which platforms to pull content for.
-// This value supersedes anything set with `WithPlatform`.
-func WithPlatformMatcher(m platforms.MatchComparer) RemoteOpt {
- return func(_ *Client, c *RemoteContext) error {
- c.PlatformMatcher = m
- return nil
- }
-}
-
-// WithPullUnpack is used to unpack an image after pull. This
-// uses the snapshotter, content store, and diff service
-// configured for the client.
-func WithPullUnpack(_ *Client, c *RemoteContext) error {
- c.Unpack = true
- return nil
-}
-
-// WithUnpackOpts is used to add unpack options to the unpacker.
-func WithUnpackOpts(opts []UnpackOpt) RemoteOpt {
- return func(_ *Client, c *RemoteContext) error {
- c.UnpackOpts = append(c.UnpackOpts, opts...)
- return nil
- }
-}
-
-// WithPullSnapshotter specifies snapshotter name used for unpacking.
-func WithPullSnapshotter(snapshotterName string, opts ...snapshots.Opt) RemoteOpt {
- return func(_ *Client, c *RemoteContext) error {
- c.Snapshotter = snapshotterName
- c.SnapshotterOpts = opts
- return nil
- }
-}
-
-// WithPullLabel sets a label to be associated with a pulled reference
-func WithPullLabel(key, value string) RemoteOpt {
- return func(_ *Client, rc *RemoteContext) error {
- if rc.Labels == nil {
- rc.Labels = make(map[string]string)
- }
-
- rc.Labels[key] = value
- return nil
- }
-}
-
-// WithPullLabels associates a set of labels to a pulled reference
-func WithPullLabels(labels map[string]string) RemoteOpt {
- return func(_ *Client, rc *RemoteContext) error {
- if rc.Labels == nil {
- rc.Labels = make(map[string]string)
- }
-
- for k, v := range labels {
- rc.Labels[k] = v
- }
- return nil
- }
-}
-
-// WithChildLabelMap sets the map function used to define the labels set
-// on referenced child content in the content store. This can be used
-// to overwrite the default GC labels or filter which labels get set
-// for content.
-// The default is `images.ChildGCLabels`.
-func WithChildLabelMap(fn func(ocispec.Descriptor) []string) RemoteOpt {
- return func(_ *Client, c *RemoteContext) error {
- c.ChildLabelMap = fn
- return nil
- }
-}
-
-// WithSchema1Conversion is used to convert Docker registry schema 1
-// manifests to oci manifests on pull. Without this option schema 1
-// manifests will return a not supported error.
-func WithSchema1Conversion(client *Client, c *RemoteContext) error {
- c.ConvertSchema1 = true
- return nil
-}
-
-// WithResolver specifies the resolver to use.
-func WithResolver(resolver remotes.Resolver) RemoteOpt {
- return func(client *Client, c *RemoteContext) error {
- c.Resolver = resolver
- return nil
- }
-}
-
-// WithImageHandler adds a base handler to be called on dispatch.
-func WithImageHandler(h images.Handler) RemoteOpt {
- return func(client *Client, c *RemoteContext) error {
- c.BaseHandlers = append(c.BaseHandlers, h)
- return nil
- }
-}
-
-// WithImageHandlerWrapper wraps the handlers to be called on dispatch.
-func WithImageHandlerWrapper(w func(images.Handler) images.Handler) RemoteOpt {
- return func(client *Client, c *RemoteContext) error {
- c.HandlerWrapper = w
- return nil
- }
-}
-
-// WithMaxConcurrentDownloads sets max concurrent download limit.
-func WithMaxConcurrentDownloads(max int) RemoteOpt {
- return func(client *Client, c *RemoteContext) error {
- c.MaxConcurrentDownloads = max
- return nil
- }
-}
-
-// WithAllMetadata downloads all manifests and known-configuration files
-func WithAllMetadata() RemoteOpt {
- return func(_ *Client, c *RemoteContext) error {
- c.AllMetadata = true
- return nil
- }
-}
diff --git a/vendor/github.com/containerd/containerd/cmd/containerd/command/config.go b/vendor/github.com/containerd/containerd/cmd/containerd/command/config.go
deleted file mode 100644
index f1d590d9f..000000000
--- a/vendor/github.com/containerd/containerd/cmd/containerd/command/config.go
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package command
-
-import (
- gocontext "context"
- "io"
- "os"
-
- "github.com/BurntSushi/toml"
- "github.com/containerd/containerd/pkg/timeout"
- "github.com/containerd/containerd/services/server"
- srvconfig "github.com/containerd/containerd/services/server/config"
- "github.com/urfave/cli"
-)
-
-// Config is a wrapper of server config for printing out.
-type Config struct {
- *srvconfig.Config
- // Plugins overrides `Plugins map[string]toml.Primitive` in server config.
- Plugins map[string]interface{} `toml:"plugins"`
-}
-
-// WriteTo marshals the config to the provided writer
-func (c *Config) WriteTo(w io.Writer) (int64, error) {
- return 0, toml.NewEncoder(w).Encode(c)
-}
-
-func outputConfig(cfg *srvconfig.Config) error {
- config := &Config{
- Config: cfg,
- }
-
- plugins, err := server.LoadPlugins(gocontext.Background(), config.Config)
- if err != nil {
- return err
- }
- if len(plugins) != 0 {
- config.Plugins = make(map[string]interface{})
- for _, p := range plugins {
- if p.Config == nil {
- continue
- }
-
- pc, err := config.Decode(p)
- if err != nil {
- return err
- }
-
- config.Plugins[p.URI()] = pc
- }
- }
-
- if config.Timeouts == nil {
- config.Timeouts = make(map[string]string)
- }
- timeouts := timeout.All()
- for k, v := range timeouts {
- if config.Timeouts[k] == "" {
- config.Timeouts[k] = v.String()
- }
- }
-
- // for the time being, keep the defaultConfig's version set at 1 so that
- // when a config without a version is loaded from disk and has no version
- // set, we assume it's a v1 config. But when generating new configs via
- // this command, generate the v2 config
- config.Config.Version = 2
-
- // remove overridden Plugins type to avoid duplication in output
- config.Config.Plugins = nil
-
- _, err = config.WriteTo(os.Stdout)
- return err
-}
-
-var configCommand = cli.Command{
- Name: "config",
- Usage: "information on the containerd config",
- Subcommands: []cli.Command{
- {
- Name: "default",
- Usage: "see the output of the default config",
- Action: func(context *cli.Context) error {
- return outputConfig(defaultConfig())
- },
- },
- {
- Name: "dump",
- Usage: "see the output of the final main config with imported in subconfig files",
- Action: func(context *cli.Context) error {
- config := defaultConfig()
- if err := srvconfig.LoadConfig(context.GlobalString("config"), config); err != nil && !os.IsNotExist(err) {
- return err
- }
-
- return outputConfig(config)
- },
- },
- },
-}
diff --git a/vendor/github.com/containerd/containerd/cmd/containerd/command/config_linux.go b/vendor/github.com/containerd/containerd/cmd/containerd/command/config_linux.go
deleted file mode 100644
index 9ed7368d7..000000000
--- a/vendor/github.com/containerd/containerd/cmd/containerd/command/config_linux.go
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package command
-
-import (
- "github.com/containerd/containerd/defaults"
- srvconfig "github.com/containerd/containerd/services/server/config"
-)
-
-func defaultConfig() *srvconfig.Config {
- return &srvconfig.Config{
- Version: 1,
- Root: defaults.DefaultRootDir,
- State: defaults.DefaultStateDir,
- GRPC: srvconfig.GRPCConfig{
- Address: defaults.DefaultAddress,
- MaxRecvMsgSize: defaults.DefaultMaxRecvMsgSize,
- MaxSendMsgSize: defaults.DefaultMaxSendMsgSize,
- },
- DisabledPlugins: []string{},
- RequiredPlugins: []string{},
- }
-}
diff --git a/vendor/github.com/containerd/containerd/cmd/containerd/command/config_unsupported.go b/vendor/github.com/containerd/containerd/cmd/containerd/command/config_unsupported.go
deleted file mode 100644
index 695a7b466..000000000
--- a/vendor/github.com/containerd/containerd/cmd/containerd/command/config_unsupported.go
+++ /dev/null
@@ -1,41 +0,0 @@
-// +build !linux,!windows,!solaris
-
-/*
- 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 command
-
-import (
- "github.com/containerd/containerd/defaults"
- srvconfig "github.com/containerd/containerd/services/server/config"
-)
-
-func defaultConfig() *srvconfig.Config {
- return &srvconfig.Config{
- Version: 1,
- Root: defaults.DefaultRootDir,
- State: defaults.DefaultStateDir,
- GRPC: srvconfig.GRPCConfig{
- Address: defaults.DefaultAddress,
- },
- Debug: srvconfig.Debug{
- Level: "info",
- Address: defaults.DefaultDebugAddress,
- },
- DisabledPlugins: []string{},
- RequiredPlugins: []string{},
- }
-}
diff --git a/vendor/github.com/containerd/containerd/cmd/containerd/command/config_windows.go b/vendor/github.com/containerd/containerd/cmd/containerd/command/config_windows.go
deleted file mode 100644
index 9ed7368d7..000000000
--- a/vendor/github.com/containerd/containerd/cmd/containerd/command/config_windows.go
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package command
-
-import (
- "github.com/containerd/containerd/defaults"
- srvconfig "github.com/containerd/containerd/services/server/config"
-)
-
-func defaultConfig() *srvconfig.Config {
- return &srvconfig.Config{
- Version: 1,
- Root: defaults.DefaultRootDir,
- State: defaults.DefaultStateDir,
- GRPC: srvconfig.GRPCConfig{
- Address: defaults.DefaultAddress,
- MaxRecvMsgSize: defaults.DefaultMaxRecvMsgSize,
- MaxSendMsgSize: defaults.DefaultMaxSendMsgSize,
- },
- DisabledPlugins: []string{},
- RequiredPlugins: []string{},
- }
-}
diff --git a/vendor/github.com/containerd/containerd/cmd/containerd/command/main.go b/vendor/github.com/containerd/containerd/cmd/containerd/command/main.go
deleted file mode 100644
index de5070423..000000000
--- a/vendor/github.com/containerd/containerd/cmd/containerd/command/main.go
+++ /dev/null
@@ -1,325 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package command
-
-import (
- gocontext "context"
- "fmt"
- "io/ioutil"
- "net"
- "os"
- "os/signal"
- "path/filepath"
- "runtime"
- "time"
-
- "github.com/containerd/containerd/errdefs"
- "github.com/containerd/containerd/log"
- "github.com/containerd/containerd/mount"
- "github.com/containerd/containerd/services/server"
- srvconfig "github.com/containerd/containerd/services/server/config"
- "github.com/containerd/containerd/sys"
- "github.com/containerd/containerd/version"
- "github.com/pkg/errors"
- "github.com/sirupsen/logrus"
- "github.com/urfave/cli"
- "google.golang.org/grpc/grpclog"
-)
-
-const usage = `
- __ _ __
- _________ ____ / /_____ _(_)___ ___ _________/ /
- / ___/ __ \/ __ \/ __/ __ ` + "`" + `/ / __ \/ _ \/ ___/ __ /
-/ /__/ /_/ / / / / /_/ /_/ / / / / / __/ / / /_/ /
-\___/\____/_/ /_/\__/\__,_/_/_/ /_/\___/_/ \__,_/
-
-high performance container runtime
-`
-
-func init() {
- logrus.SetFormatter(&logrus.TextFormatter{
- TimestampFormat: log.RFC3339NanoFixed,
- FullTimestamp: true,
- })
-
- // Discard grpc logs so that they don't mess with our stdio
- grpclog.SetLoggerV2(grpclog.NewLoggerV2(ioutil.Discard, ioutil.Discard, ioutil.Discard))
-
- cli.VersionPrinter = func(c *cli.Context) {
- fmt.Println(c.App.Name, version.Package, c.App.Version, version.Revision)
- }
-}
-
-// App returns a *cli.App instance.
-func App() *cli.App {
- app := cli.NewApp()
- app.Name = "containerd"
- app.Version = version.Version
- app.Usage = usage
- app.Description = `
-containerd is a high performance container runtime whose daemon can be started
-by using this command. If none of the *config*, *publish*, or *help* commands
-are specified, the default action of the **containerd** command is to start the
-containerd daemon in the foreground.
-
-
-A default configuration is used if no TOML configuration is specified or located
-at the default file location. The *containerd config* command can be used to
-generate the default configuration for containerd. The output of that command
-can be used and modified as necessary as a custom configuration.`
- app.Flags = []cli.Flag{
- cli.StringFlag{
- Name: "config,c",
- Usage: "path to the configuration file",
- Value: defaultConfigPath,
- },
- cli.StringFlag{
- Name: "log-level,l",
- Usage: "set the logging level [trace, debug, info, warn, error, fatal, panic]",
- },
- cli.StringFlag{
- Name: "address,a",
- Usage: "address for containerd's GRPC server",
- },
- cli.StringFlag{
- Name: "root",
- Usage: "containerd root directory",
- },
- cli.StringFlag{
- Name: "state",
- Usage: "containerd state directory",
- },
- }
- app.Flags = append(app.Flags, serviceFlags()...)
- app.Commands = []cli.Command{
- configCommand,
- publishCommand,
- ociHook,
- }
- app.Action = func(context *cli.Context) error {
- var (
- start = time.Now()
- signals = make(chan os.Signal, 2048)
- serverC = make(chan *server.Server, 1)
- ctx = gocontext.Background()
- config = defaultConfig()
- )
-
- if err := srvconfig.LoadConfig(context.GlobalString("config"), config); err != nil && !os.IsNotExist(err) {
- return err
- }
-
- // Apply flags to the config
- if err := applyFlags(context, config); err != nil {
- return err
- }
-
- // Make sure top-level directories are created early.
- if err := server.CreateTopLevelDirectories(config); err != nil {
- return err
- }
-
- // Stop if we are registering or unregistering against Windows SCM.
- stop, err := registerUnregisterService(config.Root)
- if err != nil {
- logrus.Fatal(err)
- }
- if stop {
- return nil
- }
-
- done := handleSignals(ctx, signals, serverC)
- // start the signal handler as soon as we can to make sure that
- // we don't miss any signals during boot
- signal.Notify(signals, handledSignals...)
-
- // cleanup temp mounts
- if err := mount.SetTempMountLocation(filepath.Join(config.Root, "tmpmounts")); err != nil {
- return errors.Wrap(err, "creating temp mount location")
- }
- // unmount all temp mounts on boot for the server
- warnings, err := mount.CleanupTempMounts(0)
- if err != nil {
- log.G(ctx).WithError(err).Error("unmounting temp mounts")
- }
- for _, w := range warnings {
- log.G(ctx).WithError(w).Warn("cleanup temp mount")
- }
-
- if config.GRPC.Address == "" {
- return errors.Wrap(errdefs.ErrInvalidArgument, "grpc address cannot be empty")
- }
- if config.TTRPC.Address == "" {
- // If TTRPC was not explicitly configured, use defaults based on GRPC.
- config.TTRPC.Address = fmt.Sprintf("%s.ttrpc", config.GRPC.Address)
- config.TTRPC.UID = config.GRPC.UID
- config.TTRPC.GID = config.GRPC.GID
- }
- log.G(ctx).WithFields(logrus.Fields{
- "version": version.Version,
- "revision": version.Revision,
- }).Info("starting containerd")
-
- server, err := server.New(ctx, config)
- if err != nil {
- return err
- }
-
- // Launch as a Windows Service if necessary
- if err := launchService(server, done); err != nil {
- logrus.Fatal(err)
- }
-
- serverC <- server
-
- if config.Debug.Address != "" {
- var l net.Listener
- if filepath.IsAbs(config.Debug.Address) {
- if l, err = sys.GetLocalListener(config.Debug.Address, config.Debug.UID, config.Debug.GID); err != nil {
- return errors.Wrapf(err, "failed to get listener for debug endpoint")
- }
- } else {
- if l, err = net.Listen("tcp", config.Debug.Address); err != nil {
- return errors.Wrapf(err, "failed to get listener for debug endpoint")
- }
- }
- serve(ctx, l, server.ServeDebug)
- }
- if config.Metrics.Address != "" {
- l, err := net.Listen("tcp", config.Metrics.Address)
- if err != nil {
- return errors.Wrapf(err, "failed to get listener for metrics endpoint")
- }
- serve(ctx, l, server.ServeMetrics)
- }
- // setup the ttrpc endpoint
- tl, err := sys.GetLocalListener(config.TTRPC.Address, config.TTRPC.UID, config.TTRPC.GID)
- if err != nil {
- return errors.Wrapf(err, "failed to get listener for main ttrpc endpoint")
- }
- serve(ctx, tl, server.ServeTTRPC)
-
- if config.GRPC.TCPAddress != "" {
- l, err := net.Listen("tcp", config.GRPC.TCPAddress)
- if err != nil {
- return errors.Wrapf(err, "failed to get listener for TCP grpc endpoint")
- }
- serve(ctx, l, server.ServeTCP)
- }
- // setup the main grpc endpoint
- l, err := sys.GetLocalListener(config.GRPC.Address, config.GRPC.UID, config.GRPC.GID)
- if err != nil {
- return errors.Wrapf(err, "failed to get listener for main endpoint")
- }
- serve(ctx, l, server.ServeGRPC)
-
- if err := notifyReady(ctx); err != nil {
- log.G(ctx).WithError(err).Warn("notify ready failed")
- }
-
- log.G(ctx).Infof("containerd successfully booted in %fs", time.Since(start).Seconds())
- <-done
- return nil
- }
- return app
-}
-
-func serve(ctx gocontext.Context, l net.Listener, serveFunc func(net.Listener) error) {
- path := l.Addr().String()
- log.G(ctx).WithField("address", path).Info("serving...")
- go func() {
- defer l.Close()
- if err := serveFunc(l); err != nil {
- log.G(ctx).WithError(err).WithField("address", path).Fatal("serve failure")
- }
- }()
-}
-
-func applyFlags(context *cli.Context, config *srvconfig.Config) error {
- // the order for config vs flag values is that flags will always override
- // the config values if they are set
- if err := setLevel(context, config); err != nil {
- return err
- }
- for _, v := range []struct {
- name string
- d *string
- }{
- {
- name: "root",
- d: &config.Root,
- },
- {
- name: "state",
- d: &config.State,
- },
- {
- name: "address",
- d: &config.GRPC.Address,
- },
- } {
- if s := context.GlobalString(v.name); s != "" {
- *v.d = s
- }
- }
-
- applyPlatformFlags(context)
-
- return nil
-}
-
-func setLevel(context *cli.Context, config *srvconfig.Config) error {
- l := context.GlobalString("log-level")
- if l == "" {
- l = config.Debug.Level
- }
- if l != "" {
- lvl, err := logrus.ParseLevel(l)
- if err != nil {
- return err
- }
- logrus.SetLevel(lvl)
- }
- return nil
-}
-
-func dumpStacks(writeToFile bool) {
- var (
- buf []byte
- stackSize int
- )
- bufferLen := 16384
- for stackSize == len(buf) {
- buf = make([]byte, bufferLen)
- stackSize = runtime.Stack(buf, true)
- bufferLen *= 2
- }
- buf = buf[:stackSize]
- logrus.Infof("=== BEGIN goroutine stack dump ===\n%s\n=== END goroutine stack dump ===", buf)
-
- if writeToFile {
- // Also write to file to aid gathering diagnostics
- name := filepath.Join(os.TempDir(), fmt.Sprintf("containerd.%d.stacks.log", os.Getpid()))
- f, err := os.Create(name)
- if err != nil {
- return
- }
- defer f.Close()
- f.WriteString(string(buf))
- logrus.Infof("goroutine stack dump written to %s", name)
- }
-}
diff --git a/vendor/github.com/containerd/containerd/cmd/containerd/command/main_unix.go b/vendor/github.com/containerd/containerd/cmd/containerd/command/main_unix.go
deleted file mode 100644
index 7bc9b1cf9..000000000
--- a/vendor/github.com/containerd/containerd/cmd/containerd/command/main_unix.go
+++ /dev/null
@@ -1,71 +0,0 @@
-// +build linux darwin freebsd solaris
-
-/*
- 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 command
-
-import (
- "context"
- "os"
-
- "github.com/containerd/containerd/log"
- "github.com/containerd/containerd/services/server"
- "golang.org/x/sys/unix"
-)
-
-const defaultConfigPath = "/etc/containerd/config.toml"
-
-var handledSignals = []os.Signal{
- unix.SIGTERM,
- unix.SIGINT,
- unix.SIGUSR1,
- unix.SIGPIPE,
-}
-
-func handleSignals(ctx context.Context, signals chan os.Signal, serverC chan *server.Server) chan struct{} {
- done := make(chan struct{}, 1)
- go func() {
- var server *server.Server
- for {
- select {
- case s := <-serverC:
- server = s
- case s := <-signals:
- log.G(ctx).WithField("signal", s).Debug("received signal")
- switch s {
- case unix.SIGUSR1:
- dumpStacks(true)
- case unix.SIGPIPE:
- continue
- default:
- if err := notifyStopping(ctx); err != nil {
- log.G(ctx).WithError(err).Error("notify stopping failed")
- }
-
- if server == nil {
- close(done)
- return
- }
- server.Stop()
- close(done)
- return
- }
- }
- }
- }()
- return done
-}
diff --git a/vendor/github.com/containerd/containerd/cmd/containerd/command/main_windows.go b/vendor/github.com/containerd/containerd/cmd/containerd/command/main_windows.go
deleted file mode 100644
index 7e3430bb6..000000000
--- a/vendor/github.com/containerd/containerd/cmd/containerd/command/main_windows.go
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package command
-
-import (
- "context"
- "fmt"
- "os"
- "path/filepath"
- "unsafe"
-
- "github.com/Microsoft/go-winio/pkg/etw"
- "github.com/Microsoft/go-winio/pkg/etwlogrus"
- "github.com/Microsoft/go-winio/pkg/guid"
- "github.com/containerd/containerd/log"
- "github.com/containerd/containerd/services/server"
- "github.com/sirupsen/logrus"
- "golang.org/x/sys/windows"
-)
-
-var (
- defaultConfigPath = filepath.Join(os.Getenv("programfiles"), "containerd", "config.toml")
- handledSignals = []os.Signal{
- windows.SIGTERM,
- windows.SIGINT,
- }
-)
-
-func handleSignals(ctx context.Context, signals chan os.Signal, serverC chan *server.Server) chan struct{} {
- done := make(chan struct{})
- go func() {
- var server *server.Server
- for {
- select {
- case s := <-serverC:
- server = s
- case s := <-signals:
- log.G(ctx).WithField("signal", s).Debug("received signal")
-
- if err := notifyStopping(ctx); err != nil {
- log.G(ctx).WithError(err).Error("notify stopping failed")
- }
-
- if server == nil {
- close(done)
- return
- }
- server.Stop()
- close(done)
- }
- }
- }()
- setupDumpStacks()
- return done
-}
-
-func setupDumpStacks() {
- // Windows does not support signals like *nix systems. So instead of
- // trapping on SIGUSR1 to dump stacks, we wait on a Win32 event to be
- // signaled. ACL'd to builtin administrators and local system
- event := "Global\\stackdump-" + fmt.Sprint(os.Getpid())
- ev, _ := windows.UTF16PtrFromString(event)
- sd, err := windows.SecurityDescriptorFromString("D:P(A;;GA;;;BA)(A;;GA;;;SY)")
- if err != nil {
- logrus.Errorf("failed to get security descriptor for debug stackdump event %s: %s", event, err.Error())
- return
- }
- var sa windows.SecurityAttributes
- sa.Length = uint32(unsafe.Sizeof(sa))
- sa.InheritHandle = 1
- sa.SecurityDescriptor = sd
- h, err := windows.CreateEvent(&sa, 0, 0, ev)
- if h == 0 || err != nil {
- logrus.Errorf("failed to create debug stackdump event %s: %s", event, err.Error())
- return
- }
- go func() {
- logrus.Debugf("Stackdump - waiting signal at %s", event)
- for {
- windows.WaitForSingleObject(h, windows.INFINITE)
- dumpStacks(true)
- }
- }()
-}
-
-func etwCallback(sourceID guid.GUID, state etw.ProviderState, level etw.Level, matchAnyKeyword uint64, matchAllKeyword uint64, filterData uintptr) {
- if state == etw.ProviderStateCaptureState {
- dumpStacks(false)
- }
-}
-
-func init() {
- // Provider ID: 2acb92c0-eb9b-571a-69cf-8f3410f383ad
- // Provider and hook aren't closed explicitly, as they will exist until
- // process exit. GUID is generated based on name - see
- // Microsoft/go-winio/tools/etw-provider-gen.
- provider, err := etw.NewProvider("ContainerD", etwCallback)
- if err != nil {
- logrus.Error(err)
- } else {
- if hook, err := etwlogrus.NewHookFromProvider(provider); err == nil {
- logrus.AddHook(hook)
- } else {
- logrus.Error(err)
- }
- }
-}
diff --git a/vendor/github.com/containerd/containerd/cmd/containerd/command/notify_linux.go b/vendor/github.com/containerd/containerd/cmd/containerd/command/notify_linux.go
deleted file mode 100644
index be3d580f2..000000000
--- a/vendor/github.com/containerd/containerd/cmd/containerd/command/notify_linux.go
+++ /dev/null
@@ -1,47 +0,0 @@
-// +build linux
-
-/*
- 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 command
-
-import (
- "context"
-
- sd "github.com/coreos/go-systemd/v22/daemon"
-
- "github.com/containerd/containerd/log"
-)
-
-// notifyReady notifies systemd that the daemon is ready to serve requests
-func notifyReady(ctx context.Context) error {
- return sdNotify(ctx, sd.SdNotifyReady)
-}
-
-// notifyStopping notifies systemd that the daemon is about to be stopped
-func notifyStopping(ctx context.Context) error {
- return sdNotify(ctx, sd.SdNotifyStopping)
-}
-
-func sdNotify(ctx context.Context, state string) error {
- notified, err := sd.SdNotify(false, state)
- log.G(ctx).
- WithError(err).
- WithField("notified", notified).
- WithField("state", state).
- Debug("sd notification")
- return err
-}
diff --git a/vendor/github.com/containerd/containerd/cmd/containerd/command/notify_unsupported.go b/vendor/github.com/containerd/containerd/cmd/containerd/command/notify_unsupported.go
deleted file mode 100644
index 3a0513739..000000000
--- a/vendor/github.com/containerd/containerd/cmd/containerd/command/notify_unsupported.go
+++ /dev/null
@@ -1,31 +0,0 @@
-// +build !linux
-
-/*
- 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 command
-
-import (
- "context"
-)
-
-func notifyReady(ctx context.Context) error {
- return nil
-}
-
-func notifyStopping(ctx context.Context) error {
- return nil
-}
diff --git a/vendor/github.com/containerd/containerd/cmd/containerd/command/oci-hook.go b/vendor/github.com/containerd/containerd/cmd/containerd/command/oci-hook.go
deleted file mode 100644
index df626abbf..000000000
--- a/vendor/github.com/containerd/containerd/cmd/containerd/command/oci-hook.go
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package command
-
-import (
- "bytes"
- "encoding/json"
- "io"
- "os"
- "path/filepath"
- "syscall"
- "text/template"
-
- specs "github.com/opencontainers/runtime-spec/specs-go"
- "github.com/urfave/cli"
-)
-
-var ociHook = cli.Command{
- Name: "oci-hook",
- Usage: "provides a base for OCI runtime hooks to allow arguments to be injected.",
- Action: func(context *cli.Context) error {
- state, err := loadHookState(os.Stdin)
- if err != nil {
- return err
- }
- spec, err := loadSpec(state.Bundle)
- if err != nil {
- return err
- }
- var (
- ctx = newTemplateContext(state, spec)
- args = []string(context.Args())
- env = os.Environ()
- )
- if err := newList(&args).render(ctx); err != nil {
- return err
- }
- if err := newList(&env).render(ctx); err != nil {
- return err
- }
- return syscall.Exec(args[0], args, env)
- },
-}
-
-type hookSpec struct {
- Root struct {
- Path string `json:"path"`
- } `json:"root"`
-}
-
-func loadSpec(bundle string) (*hookSpec, error) {
- f, err := os.Open(filepath.Join(bundle, "config.json"))
- if err != nil {
- return nil, err
- }
- defer f.Close()
- var s hookSpec
- if err := json.NewDecoder(f).Decode(&s); err != nil {
- return nil, err
- }
- return &s, nil
-}
-
-func loadHookState(r io.Reader) (*specs.State, error) {
- var s specs.State
- if err := json.NewDecoder(r).Decode(&s); err != nil {
- return nil, err
- }
- return &s, nil
-}
-
-func newTemplateContext(state *specs.State, spec *hookSpec) *templateContext {
- t := &templateContext{
- state: state,
- root: spec.Root.Path,
- }
- t.funcs = template.FuncMap{
- "id": t.id,
- "bundle": t.bundle,
- "rootfs": t.rootfs,
- "pid": t.pid,
- "annotation": t.annotation,
- "status": t.status,
- }
- return t
-}
-
-type templateContext struct {
- state *specs.State
- root string
- funcs template.FuncMap
-}
-
-func (t *templateContext) id() string {
- return t.state.ID
-}
-
-func (t *templateContext) bundle() string {
- return t.state.Bundle
-}
-
-func (t *templateContext) rootfs() string {
- if filepath.IsAbs(t.root) {
- return t.root
- }
- return filepath.Join(t.state.Bundle, t.root)
-}
-
-func (t *templateContext) pid() int {
- return t.state.Pid
-}
-
-func (t *templateContext) annotation(k string) string {
- return t.state.Annotations[k]
-}
-
-func (t *templateContext) status() string {
- return string(t.state.Status)
-}
-
-func render(ctx *templateContext, source string, out io.Writer) error {
- t, err := template.New("oci-hook").Funcs(ctx.funcs).Parse(source)
- if err != nil {
- return err
- }
- return t.Execute(out, ctx)
-}
-
-func newList(l *[]string) *templateList {
- return &templateList{
- l: l,
- }
-}
-
-type templateList struct {
- l *[]string
-}
-
-func (l *templateList) render(ctx *templateContext) error {
- buf := bytes.NewBuffer(nil)
- for i, s := range *l.l {
- buf.Reset()
- if err := render(ctx, s, buf); err != nil {
- return err
- }
- (*l.l)[i] = buf.String()
- }
- buf.Reset()
- return nil
-}
diff --git a/vendor/github.com/containerd/containerd/cmd/containerd/command/publish.go b/vendor/github.com/containerd/containerd/cmd/containerd/command/publish.go
deleted file mode 100644
index 82e75f35e..000000000
--- a/vendor/github.com/containerd/containerd/cmd/containerd/command/publish.go
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package command
-
-import (
- gocontext "context"
- "io"
- "io/ioutil"
- "net"
- "os"
- "time"
-
- eventsapi "github.com/containerd/containerd/api/services/events/v1"
- "github.com/containerd/containerd/errdefs"
- "github.com/containerd/containerd/namespaces"
- "github.com/containerd/containerd/pkg/dialer"
- "github.com/gogo/protobuf/types"
- "github.com/pkg/errors"
- "github.com/urfave/cli"
- "google.golang.org/grpc"
- "google.golang.org/grpc/backoff"
-)
-
-var publishCommand = cli.Command{
- Name: "publish",
- Usage: "binary to publish events to containerd",
- Flags: []cli.Flag{
- cli.StringFlag{
- Name: "namespace",
- Usage: "namespace to publish to",
- },
- cli.StringFlag{
- Name: "topic",
- Usage: "topic of the event",
- },
- },
- Action: func(context *cli.Context) error {
- ctx := namespaces.WithNamespace(gocontext.Background(), context.String("namespace"))
- topic := context.String("topic")
- if topic == "" {
- return errors.Wrap(errdefs.ErrInvalidArgument, "topic required to publish event")
- }
- payload, err := getEventPayload(os.Stdin)
- if err != nil {
- return err
- }
- client, err := connectEvents(context.GlobalString("address"))
- if err != nil {
- return err
- }
- if _, err := client.Publish(ctx, &eventsapi.PublishRequest{
- Topic: topic,
- Event: payload,
- }); err != nil {
- return errdefs.FromGRPC(err)
- }
- return nil
- },
-}
-
-func getEventPayload(r io.Reader) (*types.Any, error) {
- data, err := ioutil.ReadAll(r)
- if err != nil {
- return nil, err
- }
- var any types.Any
- if err := any.Unmarshal(data); err != nil {
- return nil, err
- }
- return &any, nil
-}
-
-func connectEvents(address string) (eventsapi.EventsClient, error) {
- conn, err := connect(address, dialer.ContextDialer)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to dial %q", address)
- }
- return eventsapi.NewEventsClient(conn), nil
-}
-
-func connect(address string, d func(gocontext.Context, string) (net.Conn, error)) (*grpc.ClientConn, error) {
- backoffConfig := backoff.DefaultConfig
- backoffConfig.MaxDelay = 3 * time.Second
- connParams := grpc.ConnectParams{
- Backoff: backoffConfig,
- }
- gopts := []grpc.DialOption{
- grpc.WithBlock(),
- grpc.WithInsecure(),
- grpc.WithContextDialer(d),
- grpc.FailOnNonTempDialError(true),
- grpc.WithConnectParams(connParams),
- }
- ctx, cancel := gocontext.WithTimeout(gocontext.Background(), 2*time.Second)
- defer cancel()
- conn, err := grpc.DialContext(ctx, dialer.DialAddress(address), gopts...)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to dial %q", address)
- }
- return conn, nil
-}
diff --git a/vendor/github.com/containerd/containerd/cmd/containerd/command/service_unsupported.go b/vendor/github.com/containerd/containerd/cmd/containerd/command/service_unsupported.go
deleted file mode 100644
index b28205255..000000000
--- a/vendor/github.com/containerd/containerd/cmd/containerd/command/service_unsupported.go
+++ /dev/null
@@ -1,44 +0,0 @@
-// +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 command
-
-import (
- "github.com/containerd/containerd/services/server"
- "github.com/urfave/cli"
-)
-
-// serviceFlags returns an array of flags for configuring containerd to run
-// as a service. Only relevant on Windows.
-func serviceFlags() []cli.Flag {
- return nil
-}
-
-// applyPlatformFlags applies platform-specific flags.
-func applyPlatformFlags(context *cli.Context) {
-}
-
-// registerUnregisterService is only relevant on Windows.
-func registerUnregisterService(root string) (bool, error) {
- return false, nil
-}
-
-// launchService is only relevant on Windows.
-func launchService(s *server.Server, done chan struct{}) error {
- return nil
-}
diff --git a/vendor/github.com/containerd/containerd/cmd/containerd/command/service_windows.go b/vendor/github.com/containerd/containerd/cmd/containerd/command/service_windows.go
deleted file mode 100644
index 655295fc8..000000000
--- a/vendor/github.com/containerd/containerd/cmd/containerd/command/service_windows.go
+++ /dev/null
@@ -1,381 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package command
-
-import (
- "fmt"
- "io/ioutil"
- "log"
- "os"
- "os/exec"
- "path/filepath"
- "time"
- "unsafe"
-
- "github.com/containerd/containerd/errdefs"
- "github.com/containerd/containerd/services/server"
- "github.com/pkg/errors"
- "github.com/sirupsen/logrus"
- "github.com/urfave/cli"
- "golang.org/x/sys/windows"
- "golang.org/x/sys/windows/svc"
- "golang.org/x/sys/windows/svc/debug"
- "golang.org/x/sys/windows/svc/mgr"
-)
-
-var (
- serviceNameFlag string
- registerServiceFlag bool
- unregisterServiceFlag bool
- runServiceFlag bool
- logFileFlag string
-
- kernel32 = windows.NewLazySystemDLL("kernel32.dll")
- setStdHandle = kernel32.NewProc("SetStdHandle")
- allocConsole = kernel32.NewProc("AllocConsole")
- oldStderr windows.Handle
- panicFile *os.File
-)
-
-const defaultServiceName = "containerd"
-
-// serviceFlags returns an array of flags for configuring containerd to run
-// as a Windows service under control of SCM.
-func serviceFlags() []cli.Flag {
- return []cli.Flag{
- cli.StringFlag{
- Name: "service-name",
- Usage: "Set the Windows service name",
- Value: defaultServiceName,
- },
- cli.BoolFlag{
- Name: "register-service",
- Usage: "Register the service and exit",
- },
- cli.BoolFlag{
- Name: "unregister-service",
- Usage: "Unregister the service and exit",
- },
- cli.BoolFlag{
- Name: "run-service",
- Usage: "",
- Hidden: true,
- },
- cli.StringFlag{
- Name: "log-file",
- Usage: "Path to the containerd log file",
- },
- }
-}
-
-// applyPlatformFlags applies platform-specific flags.
-func applyPlatformFlags(context *cli.Context) {
- serviceNameFlag = context.GlobalString("service-name")
- if serviceNameFlag == "" {
- serviceNameFlag = defaultServiceName
- }
- for _, v := range []struct {
- name string
- d *bool
- }{
- {
- name: "register-service",
- d: ®isterServiceFlag,
- },
- {
- name: "unregister-service",
- d: &unregisterServiceFlag,
- },
- {
- name: "run-service",
- d: &runServiceFlag,
- },
- } {
- *v.d = context.GlobalBool(v.name)
- }
- logFileFlag = context.GlobalString("log-file")
-}
-
-type handler struct {
- fromsvc chan error
- s *server.Server
- done chan struct{} // Indicates back to app main to quit
-}
-
-func getServicePath() (string, error) {
- p, err := exec.LookPath(os.Args[0])
- if err != nil {
- return "", err
- }
- return filepath.Abs(p)
-}
-
-func registerService() error {
- p, err := getServicePath()
- if err != nil {
- return err
- }
- m, err := mgr.Connect()
- if err != nil {
- return err
- }
- defer m.Disconnect()
-
- c := mgr.Config{
- ServiceType: windows.SERVICE_WIN32_OWN_PROCESS,
- StartType: mgr.StartAutomatic,
- ErrorControl: mgr.ErrorNormal,
- DisplayName: "Containerd",
- Description: "Container runtime",
- }
-
- // Configure the service to launch with the arguments that were just passed.
- args := []string{"--run-service"}
- for _, a := range os.Args[1:] {
- if a != "--register-service" && a != "--unregister-service" {
- args = append(args, a)
- }
- }
-
- s, err := m.CreateService(serviceNameFlag, p, c, args...)
- if err != nil {
- return err
- }
- defer s.Close()
-
- // See http://stackoverflow.com/questions/35151052/how-do-i-configure-failure-actions-of-a-windows-service-written-in-go
- const (
- scActionNone = 0
- scActionRestart = 1
-
- serviceConfigFailureActions = 2
- )
-
- type serviceFailureActions struct {
- ResetPeriod uint32
- RebootMsg *uint16
- Command *uint16
- ActionsCount uint32
- Actions uintptr
- }
-
- type scAction struct {
- Type uint32
- Delay uint32
- }
- t := []scAction{
- {Type: scActionRestart, Delay: uint32(15 * time.Second / time.Millisecond)},
- {Type: scActionRestart, Delay: uint32(15 * time.Second / time.Millisecond)},
- {Type: scActionNone},
- }
- lpInfo := serviceFailureActions{ResetPeriod: uint32(24 * time.Hour / time.Second), ActionsCount: uint32(3), Actions: uintptr(unsafe.Pointer(&t[0]))}
- err = windows.ChangeServiceConfig2(s.Handle, serviceConfigFailureActions, (*byte)(unsafe.Pointer(&lpInfo)))
- if err != nil {
- return err
- }
-
- return nil
-}
-
-func unregisterService() error {
- m, err := mgr.Connect()
- if err != nil {
- return err
- }
- defer m.Disconnect()
-
- s, err := m.OpenService(serviceNameFlag)
- if err != nil {
- return err
- }
- defer s.Close()
-
- err = s.Delete()
- if err != nil {
- return err
- }
- return nil
-}
-
-// registerUnregisterService is an entrypoint early in the daemon startup
-// to handle (un-)registering against Windows Service Control Manager (SCM).
-// It returns an indication to stop on successful SCM operation, and an error.
-func registerUnregisterService(root string) (bool, error) {
-
- if unregisterServiceFlag {
- if registerServiceFlag {
- return true, errors.Wrap(errdefs.ErrInvalidArgument, "--register-service and --unregister-service cannot be used together")
- }
- return true, unregisterService()
- }
-
- if registerServiceFlag {
- return true, registerService()
- }
-
- if runServiceFlag {
- // Allocate a conhost for containerd here. We don't actually use this
- // at all in containerd, but it will be inherited by any processes
- // containerd executes, so they won't need to allocate their own
- // conhosts. This is important for two reasons:
- // - Creating a conhost slows down process launch.
- // - We have seen reliability issues when launching many processes.
- // Sometimes the process invocation will fail due to an error when
- // creating the conhost.
- //
- // This needs to be done before initializing the panic file, as
- // AllocConsole sets the stdio handles to point to the new conhost,
- // and we want to make sure stderr goes to the panic file.
- r, _, err := allocConsole.Call()
- if r == 0 && err != nil {
- return true, fmt.Errorf("error allocating conhost: %s", err)
- }
-
- if err := initPanicFile(filepath.Join(root, "panic.log")); err != nil {
- return true, err
- }
-
- logOutput := ioutil.Discard
- if logFileFlag != "" {
- f, err := os.OpenFile(logFileFlag, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
- if err != nil {
- return true, errors.Wrapf(err, "open log file %q", logFileFlag)
- }
- logOutput = f
- }
- logrus.SetOutput(logOutput)
- }
- return false, nil
-}
-
-// launchService is the entry point for running the daemon under SCM.
-func launchService(s *server.Server, done chan struct{}) error {
-
- if !runServiceFlag {
- return nil
- }
-
- h := &handler{
- fromsvc: make(chan error),
- s: s,
- done: done,
- }
-
- interactive, err := svc.IsAnInteractiveSession()
- if err != nil {
- return err
- }
-
- go func() {
- if interactive {
- err = debug.Run(serviceNameFlag, h)
- } else {
- err = svc.Run(serviceNameFlag, h)
- }
- h.fromsvc <- err
- }()
-
- // Wait for the first signal from the service handler.
- err = <-h.fromsvc
- if err != nil {
- return err
- }
- return nil
-}
-
-func (h *handler) Execute(_ []string, r <-chan svc.ChangeRequest, s chan<- svc.Status) (bool, uint32) {
- s <- svc.Status{State: svc.StartPending, Accepts: 0}
- // Unblock launchService()
- h.fromsvc <- nil
-
- s <- svc.Status{State: svc.Running, Accepts: svc.AcceptStop | svc.AcceptShutdown | svc.Accepted(windows.SERVICE_ACCEPT_PARAMCHANGE)}
-
-Loop:
- for c := range r {
- switch c.Cmd {
- case svc.Interrogate:
- s <- c.CurrentStatus
- case svc.Stop, svc.Shutdown:
- s <- svc.Status{State: svc.StopPending, Accepts: 0}
- h.s.Stop()
- break Loop
- }
- }
-
- removePanicFile()
- close(h.done)
- return false, 0
-}
-
-func initPanicFile(path string) error {
- var err error
- panicFile, err = os.OpenFile(path, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0)
- if err != nil {
- return err
- }
-
- st, err := panicFile.Stat()
- if err != nil {
- return err
- }
-
- // If there are contents in the file already, move the file out of the way
- // and replace it.
- if st.Size() > 0 {
- panicFile.Close()
- os.Rename(path, path+".old")
- panicFile, err = os.Create(path)
- if err != nil {
- return err
- }
- }
-
- // Update STD_ERROR_HANDLE to point to the panic file so that Go writes to
- // it when it panics. Remember the old stderr to restore it before removing
- // the panic file.
- sh := windows.STD_ERROR_HANDLE
- h, err := windows.GetStdHandle(uint32(sh))
- if err != nil {
- return err
- }
-
- oldStderr = h
-
- r, _, err := setStdHandle.Call(uintptr(sh), panicFile.Fd())
- if r == 0 && err != nil {
- return err
- }
-
- // Reset os.Stderr to the panic file (so fmt.Fprintf(os.Stderr,...) actually gets redirected)
- os.Stderr = os.NewFile(panicFile.Fd(), "/dev/stderr")
-
- // Force threads that panic to write to stderr (the panicFile handle now), otherwise it will go into the ether
- log.SetOutput(os.Stderr)
-
- return nil
-}
-
-func removePanicFile() {
- if st, err := panicFile.Stat(); err == nil {
- if st.Size() == 0 {
- sh := windows.STD_ERROR_HANDLE
- setStdHandle.Call(uintptr(sh), uintptr(oldStderr))
- panicFile.Close()
- os.Remove(panicFile.Name())
- }
- }
-}
diff --git a/vendor/github.com/containerd/containerd/container.go b/vendor/github.com/containerd/containerd/container.go
deleted file mode 100644
index 8384a481f..000000000
--- a/vendor/github.com/containerd/containerd/container.go
+++ /dev/null
@@ -1,461 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package containerd
-
-import (
- "context"
- "encoding/json"
- "os"
- "path/filepath"
- "strings"
-
- "github.com/containerd/containerd/api/services/tasks/v1"
- "github.com/containerd/containerd/api/types"
- tasktypes "github.com/containerd/containerd/api/types/task"
- "github.com/containerd/containerd/cio"
- "github.com/containerd/containerd/containers"
- "github.com/containerd/containerd/errdefs"
- "github.com/containerd/containerd/images"
- "github.com/containerd/containerd/oci"
- "github.com/containerd/containerd/runtime/v2/runc/options"
- "github.com/containerd/containerd/sys"
- "github.com/containerd/typeurl"
- prototypes "github.com/gogo/protobuf/types"
- ver "github.com/opencontainers/image-spec/specs-go"
- ocispec "github.com/opencontainers/image-spec/specs-go/v1"
- "github.com/opencontainers/selinux/go-selinux/label"
- "github.com/pkg/errors"
-)
-
-const (
- checkpointImageNameLabel = "org.opencontainers.image.ref.name"
- checkpointRuntimeNameLabel = "io.containerd.checkpoint.runtime"
- checkpointSnapshotterNameLabel = "io.containerd.checkpoint.snapshotter"
-)
-
-// Container is a metadata object for container resources and task creation
-type Container interface {
- // ID identifies the container
- ID() string
- // Info returns the underlying container record type
- Info(context.Context, ...InfoOpts) (containers.Container, error)
- // Delete removes the container
- Delete(context.Context, ...DeleteOpts) error
- // NewTask creates a new task based on the container metadata
- NewTask(context.Context, cio.Creator, ...NewTaskOpts) (Task, error)
- // Spec returns the OCI runtime specification
- Spec(context.Context) (*oci.Spec, error)
- // Task returns the current task for the container
- //
- // If cio.Attach options are passed the client will reattach to the IO for the running
- // task. If no task exists for the container a NotFound error is returned
- //
- // Clients must make sure that only one reader is attached to the task and consuming
- // the output from the task's fifos
- Task(context.Context, cio.Attach) (Task, error)
- // Image returns the image that the container is based on
- Image(context.Context) (Image, error)
- // Labels returns the labels set on the container
- Labels(context.Context) (map[string]string, error)
- // SetLabels sets the provided labels for the container and returns the final label set
- SetLabels(context.Context, map[string]string) (map[string]string, error)
- // Extensions returns the extensions set on the container
- Extensions(context.Context) (map[string]prototypes.Any, error)
- // Update a container
- Update(context.Context, ...UpdateContainerOpts) error
- // Checkpoint creates a checkpoint image of the current container
- Checkpoint(context.Context, string, ...CheckpointOpts) (Image, error)
-}
-
-func containerFromRecord(client *Client, c containers.Container) *container {
- return &container{
- client: client,
- id: c.ID,
- metadata: c,
- }
-}
-
-var _ = (Container)(&container{})
-
-type container struct {
- client *Client
- id string
- metadata containers.Container
-}
-
-// ID returns the container's unique id
-func (c *container) ID() string {
- return c.id
-}
-
-func (c *container) Info(ctx context.Context, opts ...InfoOpts) (containers.Container, error) {
- i := &InfoConfig{
- // default to refreshing the container's local metadata
- Refresh: true,
- }
- for _, o := range opts {
- o(i)
- }
- if i.Refresh {
- metadata, err := c.get(ctx)
- if err != nil {
- return c.metadata, err
- }
- c.metadata = metadata
- }
- return c.metadata, nil
-}
-
-func (c *container) Extensions(ctx context.Context) (map[string]prototypes.Any, error) {
- r, err := c.get(ctx)
- if err != nil {
- return nil, err
- }
- return r.Extensions, nil
-}
-
-func (c *container) Labels(ctx context.Context) (map[string]string, error) {
- r, err := c.get(ctx)
- if err != nil {
- return nil, err
- }
- return r.Labels, nil
-}
-
-func (c *container) SetLabels(ctx context.Context, labels map[string]string) (map[string]string, error) {
- container := containers.Container{
- ID: c.id,
- Labels: labels,
- }
-
- var paths []string
- // mask off paths so we only muck with the labels encountered in labels.
- // Labels not in the passed in argument will be left alone.
- for k := range labels {
- paths = append(paths, strings.Join([]string{"labels", k}, "."))
- }
-
- r, err := c.client.ContainerService().Update(ctx, container, paths...)
- if err != nil {
- return nil, err
- }
- return r.Labels, nil
-}
-
-// Spec returns the current OCI specification for the container
-func (c *container) Spec(ctx context.Context) (*oci.Spec, error) {
- r, err := c.get(ctx)
- if err != nil {
- return nil, err
- }
- var s oci.Spec
- if err := json.Unmarshal(r.Spec.Value, &s); err != nil {
- return nil, err
- }
- return &s, nil
-}
-
-// Delete deletes an existing container
-// an error is returned if the container has running tasks
-func (c *container) Delete(ctx context.Context, opts ...DeleteOpts) error {
- if _, err := c.loadTask(ctx, nil); err == nil {
- return errors.Wrapf(errdefs.ErrFailedPrecondition, "cannot delete running task %v", c.id)
- }
- r, err := c.get(ctx)
- if err != nil {
- return err
- }
- for _, o := range opts {
- if err := o(ctx, c.client, r); err != nil {
- return err
- }
- }
- return c.client.ContainerService().Delete(ctx, c.id)
-}
-
-func (c *container) Task(ctx context.Context, attach cio.Attach) (Task, error) {
- return c.loadTask(ctx, attach)
-}
-
-// Image returns the image that the container is based on
-func (c *container) Image(ctx context.Context) (Image, error) {
- r, err := c.get(ctx)
- if err != nil {
- return nil, err
- }
- if r.Image == "" {
- return nil, errors.Wrap(errdefs.ErrNotFound, "container not created from an image")
- }
- i, err := c.client.ImageService().Get(ctx, r.Image)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to get image %s for container", r.Image)
- }
- return NewImage(c.client, i), nil
-}
-
-func (c *container) NewTask(ctx context.Context, ioCreate cio.Creator, opts ...NewTaskOpts) (_ Task, err error) {
- i, err := ioCreate(c.id)
- if err != nil {
- return nil, err
- }
- defer func() {
- if err != nil && i != nil {
- i.Cancel()
- i.Close()
- }
- }()
- cfg := i.Config()
- request := &tasks.CreateTaskRequest{
- ContainerID: c.id,
- Terminal: cfg.Terminal,
- Stdin: cfg.Stdin,
- Stdout: cfg.Stdout,
- Stderr: cfg.Stderr,
- }
- r, err := c.get(ctx)
- if err != nil {
- return nil, err
- }
- if r.SnapshotKey != "" {
- if r.Snapshotter == "" {
- return nil, errors.Wrapf(errdefs.ErrInvalidArgument, "unable to resolve rootfs mounts without snapshotter on container")
- }
-
- // get the rootfs from the snapshotter and add it to the request
- s, err := c.client.getSnapshotter(ctx, r.Snapshotter)
- if err != nil {
- return nil, err
- }
- mounts, err := s.Mounts(ctx, r.SnapshotKey)
- if err != nil {
- return nil, err
- }
- spec, err := c.Spec(ctx)
- if err != nil {
- return nil, err
- }
- for _, m := range mounts {
- if spec.Linux != nil && spec.Linux.MountLabel != "" {
- context := label.FormatMountLabel("", spec.Linux.MountLabel)
- if context != "" {
- m.Options = append(m.Options, context)
- }
- }
- request.Rootfs = append(request.Rootfs, &types.Mount{
- Type: m.Type,
- Source: m.Source,
- Options: m.Options,
- })
- }
- }
- info := TaskInfo{
- runtime: r.Runtime.Name,
- }
- for _, o := range opts {
- if err := o(ctx, c.client, &info); err != nil {
- return nil, err
- }
- }
- if info.RootFS != nil {
- for _, m := range info.RootFS {
- request.Rootfs = append(request.Rootfs, &types.Mount{
- Type: m.Type,
- Source: m.Source,
- Options: m.Options,
- })
- }
- }
- if info.Options != nil {
- any, err := typeurl.MarshalAny(info.Options)
- if err != nil {
- return nil, err
- }
- request.Options = any
- }
- t := &task{
- client: c.client,
- io: i,
- id: c.id,
- c: c,
- }
- if info.Checkpoint != nil {
- request.Checkpoint = info.Checkpoint
- }
- response, err := c.client.TaskService().Create(ctx, request)
- if err != nil {
- return nil, errdefs.FromGRPC(err)
- }
- t.pid = response.Pid
- return t, nil
-}
-
-func (c *container) Update(ctx context.Context, opts ...UpdateContainerOpts) error {
- // fetch the current container config before updating it
- r, err := c.get(ctx)
- if err != nil {
- return err
- }
- for _, o := range opts {
- if err := o(ctx, c.client, &r); err != nil {
- return err
- }
- }
- if _, err := c.client.ContainerService().Update(ctx, r); err != nil {
- return errdefs.FromGRPC(err)
- }
- return nil
-}
-
-func (c *container) Checkpoint(ctx context.Context, ref string, opts ...CheckpointOpts) (Image, error) {
- index := &ocispec.Index{
- Versioned: ver.Versioned{
- SchemaVersion: 2,
- },
- Annotations: make(map[string]string),
- }
- copts := &options.CheckpointOptions{
- Exit: false,
- OpenTcp: false,
- ExternalUnixSockets: false,
- Terminal: false,
- FileLocks: true,
- EmptyNamespaces: nil,
- }
- info, err := c.Info(ctx)
- if err != nil {
- return nil, err
- }
-
- img, err := c.Image(ctx)
- if err != nil {
- return nil, err
- }
-
- ctx, done, err := c.client.WithLease(ctx)
- if err != nil {
- return nil, err
- }
- defer done(ctx)
-
- // add image name to manifest
- index.Annotations[checkpointImageNameLabel] = img.Name()
- // add runtime info to index
- index.Annotations[checkpointRuntimeNameLabel] = info.Runtime.Name
- // add snapshotter info to index
- index.Annotations[checkpointSnapshotterNameLabel] = info.Snapshotter
-
- // process remaining opts
- for _, o := range opts {
- if err := o(ctx, c.client, &info, index, copts); err != nil {
- err = errdefs.FromGRPC(err)
- if !errdefs.IsAlreadyExists(err) {
- return nil, err
- }
- }
- }
-
- desc, err := writeIndex(ctx, index, c.client, c.ID()+"index")
- if err != nil {
- return nil, err
- }
- i := images.Image{
- Name: ref,
- Target: desc,
- }
- checkpoint, err := c.client.ImageService().Create(ctx, i)
- if err != nil {
- return nil, err
- }
-
- return NewImage(c.client, checkpoint), nil
-}
-
-func (c *container) loadTask(ctx context.Context, ioAttach cio.Attach) (Task, error) {
- response, err := c.client.TaskService().Get(ctx, &tasks.GetRequest{
- ContainerID: c.id,
- })
- if err != nil {
- err = errdefs.FromGRPC(err)
- if errdefs.IsNotFound(err) {
- return nil, errors.Wrapf(err, "no running task found")
- }
- return nil, err
- }
- var i cio.IO
- if ioAttach != nil && response.Process.Status != tasktypes.StatusUnknown {
- // Do not attach IO for task in unknown state, because there
- // are no fifo paths anyway.
- if i, err = attachExistingIO(response, ioAttach); err != nil {
- return nil, err
- }
- }
- t := &task{
- client: c.client,
- io: i,
- id: response.Process.ID,
- pid: response.Process.Pid,
- c: c,
- }
- return t, nil
-}
-
-func (c *container) get(ctx context.Context) (containers.Container, error) {
- return c.client.ContainerService().Get(ctx, c.id)
-}
-
-// get the existing fifo paths from the task information stored by the daemon
-func attachExistingIO(response *tasks.GetResponse, ioAttach cio.Attach) (cio.IO, error) {
- fifoSet := loadFifos(response)
- return ioAttach(fifoSet)
-}
-
-// loadFifos loads the containers fifos
-func loadFifos(response *tasks.GetResponse) *cio.FIFOSet {
- fifos := []string{
- response.Process.Stdin,
- response.Process.Stdout,
- response.Process.Stderr,
- }
- closer := func() error {
- var (
- err error
- dirs = map[string]struct{}{}
- )
- for _, fifo := range fifos {
- if isFifo, _ := sys.IsFifo(fifo); isFifo {
- if rerr := os.Remove(fifo); err == nil {
- err = rerr
- }
- dirs[filepath.Dir(fifo)] = struct{}{}
- }
- }
- for dir := range dirs {
- // we ignore errors here because we don't
- // want to remove the directory if it isn't
- // empty
- os.Remove(dir)
- }
- return err
- }
-
- return cio.NewFIFOSet(cio.Config{
- Stdin: response.Process.Stdin,
- Stdout: response.Process.Stdout,
- Stderr: response.Process.Stderr,
- Terminal: response.Process.Terminal,
- }, closer)
-}
diff --git a/vendor/github.com/containerd/containerd/container_checkpoint_opts.go b/vendor/github.com/containerd/containerd/container_checkpoint_opts.go
deleted file mode 100644
index 510863681..000000000
--- a/vendor/github.com/containerd/containerd/container_checkpoint_opts.go
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package containerd
-
-import (
- "bytes"
- "context"
- "fmt"
- "runtime"
-
- tasks "github.com/containerd/containerd/api/services/tasks/v1"
- "github.com/containerd/containerd/containers"
- "github.com/containerd/containerd/diff"
- "github.com/containerd/containerd/images"
- "github.com/containerd/containerd/platforms"
- "github.com/containerd/containerd/rootfs"
- "github.com/containerd/containerd/runtime/v2/runc/options"
- "github.com/containerd/typeurl"
- imagespec "github.com/opencontainers/image-spec/specs-go/v1"
- "github.com/pkg/errors"
-)
-
-var (
- // ErrCheckpointRWUnsupported is returned if the container runtime does not support checkpoint
- ErrCheckpointRWUnsupported = errors.New("rw checkpoint is only supported on v2 runtimes")
- // ErrMediaTypeNotFound returns an error when a media type in the manifest is unknown
- ErrMediaTypeNotFound = errors.New("media type not found")
-)
-
-// CheckpointOpts are options to manage the checkpoint operation
-type CheckpointOpts func(context.Context, *Client, *containers.Container, *imagespec.Index, *options.CheckpointOptions) error
-
-// WithCheckpointImage includes the container image in the checkpoint
-func WithCheckpointImage(ctx context.Context, client *Client, c *containers.Container, index *imagespec.Index, copts *options.CheckpointOptions) error {
- ir, err := client.ImageService().Get(ctx, c.Image)
- if err != nil {
- return err
- }
- index.Manifests = append(index.Manifests, ir.Target)
- return nil
-}
-
-// WithCheckpointTask includes the running task
-func WithCheckpointTask(ctx context.Context, client *Client, c *containers.Container, index *imagespec.Index, copts *options.CheckpointOptions) error {
- any, err := typeurl.MarshalAny(copts)
- if err != nil {
- return nil
- }
- task, err := client.TaskService().Checkpoint(ctx, &tasks.CheckpointTaskRequest{
- ContainerID: c.ID,
- Options: any,
- })
- if err != nil {
- return err
- }
- for _, d := range task.Descriptors {
- platformSpec := platforms.DefaultSpec()
- index.Manifests = append(index.Manifests, imagespec.Descriptor{
- MediaType: d.MediaType,
- Size: d.Size_,
- Digest: d.Digest,
- Platform: &platformSpec,
- Annotations: d.Annotations,
- })
- }
- // save copts
- data, err := any.Marshal()
- if err != nil {
- return err
- }
- r := bytes.NewReader(data)
- desc, err := writeContent(ctx, client.ContentStore(), images.MediaTypeContainerd1CheckpointOptions, c.ID+"-checkpoint-options", r)
- if err != nil {
- return err
- }
- desc.Platform = &imagespec.Platform{
- OS: runtime.GOOS,
- Architecture: runtime.GOARCH,
- }
- index.Manifests = append(index.Manifests, desc)
- return nil
-}
-
-// WithCheckpointRuntime includes the container runtime info
-func WithCheckpointRuntime(ctx context.Context, client *Client, c *containers.Container, index *imagespec.Index, copts *options.CheckpointOptions) error {
- if c.Runtime.Options != nil {
- data, err := c.Runtime.Options.Marshal()
- if err != nil {
- return err
- }
- r := bytes.NewReader(data)
- desc, err := writeContent(ctx, client.ContentStore(), images.MediaTypeContainerd1CheckpointRuntimeOptions, c.ID+"-runtime-options", r)
- if err != nil {
- return err
- }
- desc.Platform = &imagespec.Platform{
- OS: runtime.GOOS,
- Architecture: runtime.GOARCH,
- }
- index.Manifests = append(index.Manifests, desc)
- }
- return nil
-}
-
-// WithCheckpointRW includes the rw in the checkpoint
-func WithCheckpointRW(ctx context.Context, client *Client, c *containers.Container, index *imagespec.Index, copts *options.CheckpointOptions) error {
- diffOpts := []diff.Opt{
- diff.WithReference(fmt.Sprintf("checkpoint-rw-%s", c.SnapshotKey)),
- }
- rw, err := rootfs.CreateDiff(ctx,
- c.SnapshotKey,
- client.SnapshotService(c.Snapshotter),
- client.DiffService(),
- diffOpts...,
- )
- if err != nil {
- return err
-
- }
- rw.Platform = &imagespec.Platform{
- OS: runtime.GOOS,
- Architecture: runtime.GOARCH,
- }
- index.Manifests = append(index.Manifests, rw)
- return nil
-}
-
-// WithCheckpointTaskExit causes the task to exit after checkpoint
-func WithCheckpointTaskExit(ctx context.Context, client *Client, c *containers.Container, index *imagespec.Index, copts *options.CheckpointOptions) error {
- copts.Exit = true
- return nil
-}
-
-// GetIndexByMediaType returns the index in a manifest for the specified media type
-func GetIndexByMediaType(index *imagespec.Index, mt string) (*imagespec.Descriptor, error) {
- for _, d := range index.Manifests {
- if d.MediaType == mt {
- return &d, nil
- }
- }
- return nil, ErrMediaTypeNotFound
-}
diff --git a/vendor/github.com/containerd/containerd/container_opts.go b/vendor/github.com/containerd/containerd/container_opts.go
deleted file mode 100644
index 5ffd5282e..000000000
--- a/vendor/github.com/containerd/containerd/container_opts.go
+++ /dev/null
@@ -1,271 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package containerd
-
-import (
- "context"
-
- "github.com/containerd/containerd/containers"
- "github.com/containerd/containerd/errdefs"
- "github.com/containerd/containerd/oci"
- "github.com/containerd/containerd/snapshots"
- "github.com/containerd/typeurl"
- "github.com/gogo/protobuf/types"
- "github.com/opencontainers/image-spec/identity"
- "github.com/pkg/errors"
-)
-
-// DeleteOpts allows the caller to set options for the deletion of a container
-type DeleteOpts func(ctx context.Context, client *Client, c containers.Container) error
-
-// NewContainerOpts allows the caller to set additional options when creating a container
-type NewContainerOpts func(ctx context.Context, client *Client, c *containers.Container) error
-
-// UpdateContainerOpts allows the caller to set additional options when updating a container
-type UpdateContainerOpts func(ctx context.Context, client *Client, c *containers.Container) error
-
-// InfoOpts controls how container metadata is fetched and returned
-type InfoOpts func(*InfoConfig)
-
-// InfoConfig specifies how container metadata is fetched
-type InfoConfig struct {
- // Refresh will to a fetch of the latest container metadata
- Refresh bool
-}
-
-// WithRuntime allows a user to specify the runtime name and additional options that should
-// be used to create tasks for the container
-func WithRuntime(name string, options interface{}) NewContainerOpts {
- return func(ctx context.Context, client *Client, c *containers.Container) error {
- var (
- any *types.Any
- err error
- )
- if options != nil {
- any, err = typeurl.MarshalAny(options)
- if err != nil {
- return err
- }
- }
- c.Runtime = containers.RuntimeInfo{
- Name: name,
- Options: any,
- }
- return nil
- }
-}
-
-// WithImage sets the provided image as the base for the container
-func WithImage(i Image) NewContainerOpts {
- return func(ctx context.Context, client *Client, c *containers.Container) error {
- c.Image = i.Name()
- return nil
- }
-}
-
-// WithImageName allows setting the image name as the base for the container
-func WithImageName(n string) NewContainerOpts {
- return func(ctx context.Context, _ *Client, c *containers.Container) error {
- c.Image = n
- return nil
- }
-}
-
-// WithContainerLabels adds the provided labels to the container
-func WithContainerLabels(labels map[string]string) NewContainerOpts {
- return func(_ context.Context, _ *Client, c *containers.Container) error {
- c.Labels = labels
- return nil
- }
-}
-
-// WithImageStopSignal sets a well-known containerd label (StopSignalLabel)
-// on the container for storing the stop signal specified in the OCI image
-// config
-func WithImageStopSignal(image Image, defaultSignal string) NewContainerOpts {
- return func(ctx context.Context, _ *Client, c *containers.Container) error {
- if c.Labels == nil {
- c.Labels = make(map[string]string)
- }
- stopSignal, err := GetOCIStopSignal(ctx, image, defaultSignal)
- if err != nil {
- return err
- }
- c.Labels[StopSignalLabel] = stopSignal
- return nil
- }
-}
-
-// WithSnapshotter sets the provided snapshotter for use by the container
-//
-// This option must appear before other snapshotter options to have an effect.
-func WithSnapshotter(name string) NewContainerOpts {
- return func(ctx context.Context, client *Client, c *containers.Container) error {
- c.Snapshotter = name
- return nil
- }
-}
-
-// WithSnapshot uses an existing root filesystem for the container
-func WithSnapshot(id string) NewContainerOpts {
- return func(ctx context.Context, client *Client, c *containers.Container) error {
- // check that the snapshot exists, if not, fail on creation
- var err error
- c.Snapshotter, err = client.resolveSnapshotterName(ctx, c.Snapshotter)
- if err != nil {
- return err
- }
- s, err := client.getSnapshotter(ctx, c.Snapshotter)
- if err != nil {
- return err
- }
- if _, err := s.Mounts(ctx, id); err != nil {
- return err
- }
- c.SnapshotKey = id
- return nil
- }
-}
-
-// WithNewSnapshot allocates a new snapshot to be used by the container as the
-// root filesystem in read-write mode
-func WithNewSnapshot(id string, i Image, opts ...snapshots.Opt) NewContainerOpts {
- return func(ctx context.Context, client *Client, c *containers.Container) error {
- diffIDs, err := i.RootFS(ctx)
- if err != nil {
- return err
- }
-
- parent := identity.ChainID(diffIDs).String()
- c.Snapshotter, err = client.resolveSnapshotterName(ctx, c.Snapshotter)
- if err != nil {
- return err
- }
- s, err := client.getSnapshotter(ctx, c.Snapshotter)
- if err != nil {
- return err
- }
- if _, err := s.Prepare(ctx, id, parent, opts...); err != nil {
- return err
- }
- c.SnapshotKey = id
- c.Image = i.Name()
- return nil
- }
-}
-
-// WithSnapshotCleanup deletes the rootfs snapshot allocated for the container
-func WithSnapshotCleanup(ctx context.Context, client *Client, c containers.Container) error {
- if c.SnapshotKey != "" {
- if c.Snapshotter == "" {
- return errors.Wrapf(errdefs.ErrInvalidArgument, "container.Snapshotter must be set to cleanup rootfs snapshot")
- }
- s, err := client.getSnapshotter(ctx, c.Snapshotter)
- if err != nil {
- return err
- }
- if err := s.Remove(ctx, c.SnapshotKey); err != nil && !errdefs.IsNotFound(err) {
- return err
- }
- }
- return nil
-}
-
-// WithNewSnapshotView allocates a new snapshot to be used by the container as the
-// root filesystem in read-only mode
-func WithNewSnapshotView(id string, i Image, opts ...snapshots.Opt) NewContainerOpts {
- return func(ctx context.Context, client *Client, c *containers.Container) error {
- diffIDs, err := i.(*image).i.RootFS(ctx, client.ContentStore(), client.platform)
- if err != nil {
- return err
- }
-
- parent := identity.ChainID(diffIDs).String()
- c.Snapshotter, err = client.resolveSnapshotterName(ctx, c.Snapshotter)
- if err != nil {
- return err
- }
- s, err := client.getSnapshotter(ctx, c.Snapshotter)
- if err != nil {
- return err
- }
- if _, err := s.View(ctx, id, parent, opts...); err != nil {
- return err
- }
- c.SnapshotKey = id
- c.Image = i.Name()
- return nil
- }
-}
-
-// WithContainerExtension appends extension data to the container object.
-// Use this to decorate the container object with additional data for the client
-// integration.
-//
-// Make sure to register the type of `extension` in the typeurl package via
-// `typeurl.Register` or container creation may fail.
-func WithContainerExtension(name string, extension interface{}) NewContainerOpts {
- return func(ctx context.Context, client *Client, c *containers.Container) error {
- if name == "" {
- return errors.Wrapf(errdefs.ErrInvalidArgument, "extension key must not be zero-length")
- }
-
- any, err := typeurl.MarshalAny(extension)
- if err != nil {
- if errors.Is(err, typeurl.ErrNotFound) {
- return errors.Wrapf(err, "extension %q is not registered with the typeurl package, see `typeurl.Register`", name)
- }
- return errors.Wrap(err, "error marshalling extension")
- }
-
- if c.Extensions == nil {
- c.Extensions = make(map[string]types.Any)
- }
- c.Extensions[name] = *any
- return nil
- }
-}
-
-// WithNewSpec generates a new spec for a new container
-func WithNewSpec(opts ...oci.SpecOpts) NewContainerOpts {
- return func(ctx context.Context, client *Client, c *containers.Container) error {
- s, err := oci.GenerateSpec(ctx, client, c, opts...)
- if err != nil {
- return err
- }
- c.Spec, err = typeurl.MarshalAny(s)
- return err
- }
-}
-
-// WithSpec sets the provided spec on the container
-func WithSpec(s *oci.Spec, opts ...oci.SpecOpts) NewContainerOpts {
- return func(ctx context.Context, client *Client, c *containers.Container) error {
- if err := oci.ApplyOpts(ctx, client, c, s, opts...); err != nil {
- return err
- }
-
- var err error
- c.Spec, err = typeurl.MarshalAny(s)
- return err
- }
-}
-
-// WithoutRefreshedMetadata will use the current metadata attached to the container object
-func WithoutRefreshedMetadata(i *InfoConfig) {
- i.Refresh = false
-}
diff --git a/vendor/github.com/containerd/containerd/container_opts_unix.go b/vendor/github.com/containerd/containerd/container_opts_unix.go
deleted file mode 100644
index b109a10ec..000000000
--- a/vendor/github.com/containerd/containerd/container_opts_unix.go
+++ /dev/null
@@ -1,116 +0,0 @@
-// +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 containerd
-
-import (
- "context"
- "fmt"
- "os"
- "path/filepath"
- "syscall"
-
- "github.com/containerd/containerd/containers"
- "github.com/containerd/containerd/errdefs"
- "github.com/containerd/containerd/mount"
- "github.com/opencontainers/image-spec/identity"
-)
-
-// WithRemappedSnapshot creates a new snapshot and remaps the uid/gid for the
-// filesystem to be used by a container with user namespaces
-func WithRemappedSnapshot(id string, i Image, uid, gid uint32) NewContainerOpts {
- return withRemappedSnapshotBase(id, i, uid, gid, false)
-}
-
-// WithRemappedSnapshotView is similar to WithRemappedSnapshot but rootfs is mounted as read-only.
-func WithRemappedSnapshotView(id string, i Image, uid, gid uint32) NewContainerOpts {
- return withRemappedSnapshotBase(id, i, uid, gid, true)
-}
-
-func withRemappedSnapshotBase(id string, i Image, uid, gid uint32, readonly bool) NewContainerOpts {
- return func(ctx context.Context, client *Client, c *containers.Container) error {
- diffIDs, err := i.(*image).i.RootFS(ctx, client.ContentStore(), client.platform)
- if err != nil {
- return err
- }
-
- var (
- parent = identity.ChainID(diffIDs).String()
- usernsID = fmt.Sprintf("%s-%d-%d", parent, uid, gid)
- )
- c.Snapshotter, err = client.resolveSnapshotterName(ctx, c.Snapshotter)
- if err != nil {
- return err
- }
- snapshotter, err := client.getSnapshotter(ctx, c.Snapshotter)
- if err != nil {
- return err
- }
- if _, err := snapshotter.Stat(ctx, usernsID); err == nil {
- if _, err := snapshotter.Prepare(ctx, id, usernsID); err == nil {
- c.SnapshotKey = id
- c.Image = i.Name()
- return nil
- } else if !errdefs.IsNotFound(err) {
- return err
- }
- }
- mounts, err := snapshotter.Prepare(ctx, usernsID+"-remap", parent)
- if err != nil {
- return err
- }
- if err := remapRootFS(ctx, mounts, uid, gid); err != nil {
- snapshotter.Remove(ctx, usernsID)
- return err
- }
- if err := snapshotter.Commit(ctx, usernsID, usernsID+"-remap"); err != nil {
- return err
- }
- if readonly {
- _, err = snapshotter.View(ctx, id, usernsID)
- } else {
- _, err = snapshotter.Prepare(ctx, id, usernsID)
- }
- if err != nil {
- return err
- }
- c.SnapshotKey = id
- c.Image = i.Name()
- return nil
- }
-}
-
-func remapRootFS(ctx context.Context, mounts []mount.Mount, uid, gid uint32) error {
- return mount.WithTempMount(ctx, mounts, func(root string) error {
- return filepath.Walk(root, incrementFS(root, uid, gid))
- })
-}
-
-func incrementFS(root string, uidInc, gidInc uint32) filepath.WalkFunc {
- return func(path string, info os.FileInfo, err error) error {
- if err != nil {
- return err
- }
- var (
- stat = info.Sys().(*syscall.Stat_t)
- u, g = int(stat.Uid + uidInc), int(stat.Gid + gidInc)
- )
- // be sure the lchown the path as to not de-reference the symlink to a host file
- return os.Lchown(path, u, g)
- }
-}
diff --git a/vendor/github.com/containerd/containerd/container_restore_opts.go b/vendor/github.com/containerd/containerd/container_restore_opts.go
deleted file mode 100644
index 03722dba1..000000000
--- a/vendor/github.com/containerd/containerd/container_restore_opts.go
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package containerd
-
-import (
- "context"
-
- "github.com/containerd/containerd/containers"
- "github.com/containerd/containerd/content"
- "github.com/containerd/containerd/images"
- "github.com/gogo/protobuf/proto"
- ptypes "github.com/gogo/protobuf/types"
- "github.com/opencontainers/image-spec/identity"
- imagespec "github.com/opencontainers/image-spec/specs-go/v1"
- "github.com/pkg/errors"
-)
-
-var (
- // ErrImageNameNotFoundInIndex is returned when the image name is not found in the index
- ErrImageNameNotFoundInIndex = errors.New("image name not found in index")
- // ErrRuntimeNameNotFoundInIndex is returned when the runtime is not found in the index
- ErrRuntimeNameNotFoundInIndex = errors.New("runtime not found in index")
- // ErrSnapshotterNameNotFoundInIndex is returned when the snapshotter is not found in the index
- ErrSnapshotterNameNotFoundInIndex = errors.New("snapshotter not found in index")
-)
-
-// RestoreOpts are options to manage the restore operation
-type RestoreOpts func(context.Context, string, *Client, Image, *imagespec.Index) NewContainerOpts
-
-// WithRestoreImage restores the image for the container
-func WithRestoreImage(ctx context.Context, id string, client *Client, checkpoint Image, index *imagespec.Index) NewContainerOpts {
- return func(ctx context.Context, client *Client, c *containers.Container) error {
- name, ok := index.Annotations[checkpointImageNameLabel]
- if !ok || name == "" {
- return ErrRuntimeNameNotFoundInIndex
- }
- snapshotter, ok := index.Annotations[checkpointSnapshotterNameLabel]
- if !ok || name == "" {
- return ErrSnapshotterNameNotFoundInIndex
- }
- i, err := client.GetImage(ctx, name)
- if err != nil {
- return err
- }
-
- diffIDs, err := i.(*image).i.RootFS(ctx, client.ContentStore(), client.platform)
- if err != nil {
- return err
- }
- parent := identity.ChainID(diffIDs).String()
- if _, err := client.SnapshotService(snapshotter).Prepare(ctx, id, parent); err != nil {
- return err
- }
- c.Image = i.Name()
- c.SnapshotKey = id
- c.Snapshotter = snapshotter
- return nil
- }
-}
-
-// WithRestoreRuntime restores the runtime for the container
-func WithRestoreRuntime(ctx context.Context, id string, client *Client, checkpoint Image, index *imagespec.Index) NewContainerOpts {
- return func(ctx context.Context, client *Client, c *containers.Container) error {
- name, ok := index.Annotations[checkpointRuntimeNameLabel]
- if !ok {
- return ErrRuntimeNameNotFoundInIndex
- }
-
- // restore options if present
- m, err := GetIndexByMediaType(index, images.MediaTypeContainerd1CheckpointRuntimeOptions)
- if err != nil {
- if err != ErrMediaTypeNotFound {
- return err
- }
- }
- var options *ptypes.Any
- if m != nil {
- store := client.ContentStore()
- data, err := content.ReadBlob(ctx, store, *m)
- if err != nil {
- return errors.Wrap(err, "unable to read checkpoint runtime")
- }
- if err := proto.Unmarshal(data, options); err != nil {
- return err
- }
- }
-
- c.Runtime = containers.RuntimeInfo{
- Name: name,
- Options: options,
- }
- return nil
- }
-}
-
-// WithRestoreSpec restores the spec from the checkpoint for the container
-func WithRestoreSpec(ctx context.Context, id string, client *Client, checkpoint Image, index *imagespec.Index) NewContainerOpts {
- return func(ctx context.Context, client *Client, c *containers.Container) error {
- m, err := GetIndexByMediaType(index, images.MediaTypeContainerd1CheckpointConfig)
- if err != nil {
- return err
- }
- store := client.ContentStore()
- data, err := content.ReadBlob(ctx, store, *m)
- if err != nil {
- return errors.Wrap(err, "unable to read checkpoint config")
- }
- var any ptypes.Any
- if err := proto.Unmarshal(data, &any); err != nil {
- return err
- }
- c.Spec = &any
- return nil
- }
-}
-
-// WithRestoreRW restores the rw layer from the checkpoint for the container
-func WithRestoreRW(ctx context.Context, id string, client *Client, checkpoint Image, index *imagespec.Index) NewContainerOpts {
- return func(ctx context.Context, client *Client, c *containers.Container) error {
- // apply rw layer
- rw, err := GetIndexByMediaType(index, imagespec.MediaTypeImageLayerGzip)
- if err != nil {
- return err
- }
- mounts, err := client.SnapshotService(c.Snapshotter).Mounts(ctx, c.SnapshotKey)
- if err != nil {
- return err
- }
-
- if _, err := client.DiffService().Apply(ctx, *rw, mounts); err != nil {
- return err
- }
- return nil
- }
-}
diff --git a/vendor/github.com/containerd/containerd/containers/containers.go b/vendor/github.com/containerd/containerd/containers/containers.go
deleted file mode 100644
index 7174bbd6a..000000000
--- a/vendor/github.com/containerd/containerd/containers/containers.go
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package containers
-
-import (
- "context"
- "time"
-
- "github.com/gogo/protobuf/types"
-)
-
-// Container represents the set of data pinned by a container. Unless otherwise
-// noted, the resources here are considered in use by the container.
-//
-// The resources specified in this object are used to create tasks from the container.
-type Container struct {
- // ID uniquely identifies the container in a namespace.
- //
- // This property is required and cannot be changed after creation.
- ID string
-
- // Labels provide metadata extension for a container.
- //
- // These are optional and fully mutable.
- Labels map[string]string
-
- // Image specifies the image reference used for a container.
- //
- // This property is optional and mutable.
- Image string
-
- // Runtime specifies which runtime should be used when launching container
- // tasks.
- //
- // This property is required and immutable.
- Runtime RuntimeInfo
-
- // Spec should carry the runtime specification used to implement the
- // container.
- //
- // This field is required but mutable.
- Spec *types.Any
-
- // SnapshotKey specifies the snapshot key to use for the container's root
- // filesystem. When starting a task from this container, a caller should
- // look up the mounts from the snapshot service and include those on the
- // task create request.
- //
- // This field is not required but mutable.
- SnapshotKey string
-
- // Snapshotter specifies the snapshotter name used for rootfs
- //
- // This field is not required but immutable.
- Snapshotter string
-
- // CreatedAt is the time at which the container was created.
- CreatedAt time.Time
-
- // UpdatedAt is the time at which the container was updated.
- UpdatedAt time.Time
-
- // Extensions stores client-specified metadata
- Extensions map[string]types.Any
-}
-
-// RuntimeInfo holds runtime specific information
-type RuntimeInfo struct {
- Name string
- Options *types.Any
-}
-
-// Store interacts with the underlying container storage
-type Store interface {
- // Get a container using the id.
- //
- // Container object is returned on success. If the id is not known to the
- // store, an error will be returned.
- Get(ctx context.Context, id string) (Container, error)
-
- // List returns containers that match one or more of the provided filters.
- List(ctx context.Context, filters ...string) ([]Container, error)
-
- // Create a container in the store from the provided container.
- Create(ctx context.Context, container Container) (Container, error)
-
- // Update the container with the provided container object. ID must be set.
- //
- // If one or more fieldpaths are provided, only the field corresponding to
- // the fieldpaths will be mutated.
- Update(ctx context.Context, container Container, fieldpaths ...string) (Container, error)
-
- // Delete a container using the id.
- //
- // nil will be returned on success. If the container is not known to the
- // store, ErrNotFound will be returned.
- Delete(ctx context.Context, id string) error
-}
diff --git a/vendor/github.com/containerd/containerd/containerstore.go b/vendor/github.com/containerd/containerd/containerstore.go
deleted file mode 100644
index 2756e2a68..000000000
--- a/vendor/github.com/containerd/containerd/containerstore.go
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package containerd
-
-import (
- "context"
- "errors"
- "io"
-
- containersapi "github.com/containerd/containerd/api/services/containers/v1"
- "github.com/containerd/containerd/containers"
- "github.com/containerd/containerd/errdefs"
- ptypes "github.com/gogo/protobuf/types"
- "google.golang.org/grpc/codes"
- "google.golang.org/grpc/status"
-)
-
-type remoteContainers struct {
- client containersapi.ContainersClient
-}
-
-var _ containers.Store = &remoteContainers{}
-
-// NewRemoteContainerStore returns the container Store connected with the provided client
-func NewRemoteContainerStore(client containersapi.ContainersClient) containers.Store {
- return &remoteContainers{
- client: client,
- }
-}
-
-func (r *remoteContainers) Get(ctx context.Context, id string) (containers.Container, error) {
- resp, err := r.client.Get(ctx, &containersapi.GetContainerRequest{
- ID: id,
- })
- if err != nil {
- return containers.Container{}, errdefs.FromGRPC(err)
- }
-
- return containerFromProto(&resp.Container), nil
-}
-
-func (r *remoteContainers) List(ctx context.Context, filters ...string) ([]containers.Container, error) {
- containers, err := r.stream(ctx, filters...)
- if err != nil {
- if err == errStreamNotAvailable {
- return r.list(ctx, filters...)
- }
- return nil, err
- }
- return containers, nil
-}
-
-func (r *remoteContainers) list(ctx context.Context, filters ...string) ([]containers.Container, error) {
- resp, err := r.client.List(ctx, &containersapi.ListContainersRequest{
- Filters: filters,
- })
- if err != nil {
- return nil, errdefs.FromGRPC(err)
- }
- return containersFromProto(resp.Containers), nil
-}
-
-var errStreamNotAvailable = errors.New("streaming api not available")
-
-func (r *remoteContainers) stream(ctx context.Context, filters ...string) ([]containers.Container, error) {
- session, err := r.client.ListStream(ctx, &containersapi.ListContainersRequest{
- Filters: filters,
- })
- if err != nil {
- return nil, errdefs.FromGRPC(err)
- }
- var containers []containers.Container
- for {
- c, err := session.Recv()
- if err != nil {
- if err == io.EOF {
- return containers, nil
- }
- if s, ok := status.FromError(err); ok {
- if s.Code() == codes.Unimplemented {
- return nil, errStreamNotAvailable
- }
- }
- return nil, errdefs.FromGRPC(err)
- }
- select {
- case <-ctx.Done():
- return containers, ctx.Err()
- default:
- containers = append(containers, containerFromProto(c.Container))
- }
- }
-}
-
-func (r *remoteContainers) Create(ctx context.Context, container containers.Container) (containers.Container, error) {
- created, err := r.client.Create(ctx, &containersapi.CreateContainerRequest{
- Container: containerToProto(&container),
- })
- if err != nil {
- return containers.Container{}, errdefs.FromGRPC(err)
- }
-
- return containerFromProto(&created.Container), nil
-
-}
-
-func (r *remoteContainers) Update(ctx context.Context, container containers.Container, fieldpaths ...string) (containers.Container, error) {
- var updateMask *ptypes.FieldMask
- if len(fieldpaths) > 0 {
- updateMask = &ptypes.FieldMask{
- Paths: fieldpaths,
- }
- }
-
- updated, err := r.client.Update(ctx, &containersapi.UpdateContainerRequest{
- Container: containerToProto(&container),
- UpdateMask: updateMask,
- })
- if err != nil {
- return containers.Container{}, errdefs.FromGRPC(err)
- }
-
- return containerFromProto(&updated.Container), nil
-
-}
-
-func (r *remoteContainers) Delete(ctx context.Context, id string) error {
- _, err := r.client.Delete(ctx, &containersapi.DeleteContainerRequest{
- ID: id,
- })
-
- return errdefs.FromGRPC(err)
-
-}
-
-func containerToProto(container *containers.Container) containersapi.Container {
- return containersapi.Container{
- ID: container.ID,
- Labels: container.Labels,
- Image: container.Image,
- Runtime: &containersapi.Container_Runtime{
- Name: container.Runtime.Name,
- Options: container.Runtime.Options,
- },
- Spec: container.Spec,
- Snapshotter: container.Snapshotter,
- SnapshotKey: container.SnapshotKey,
- Extensions: container.Extensions,
- }
-}
-
-func containerFromProto(containerpb *containersapi.Container) containers.Container {
- var runtime containers.RuntimeInfo
- if containerpb.Runtime != nil {
- runtime = containers.RuntimeInfo{
- Name: containerpb.Runtime.Name,
- Options: containerpb.Runtime.Options,
- }
- }
- return containers.Container{
- ID: containerpb.ID,
- Labels: containerpb.Labels,
- Image: containerpb.Image,
- Runtime: runtime,
- Spec: containerpb.Spec,
- Snapshotter: containerpb.Snapshotter,
- SnapshotKey: containerpb.SnapshotKey,
- CreatedAt: containerpb.CreatedAt,
- UpdatedAt: containerpb.UpdatedAt,
- Extensions: containerpb.Extensions,
- }
-}
-
-func containersFromProto(containerspb []containersapi.Container) []containers.Container {
- var containers []containers.Container
-
- for _, container := range containerspb {
- containers = append(containers, containerFromProto(&container))
- }
-
- return containers
-}
diff --git a/vendor/github.com/containerd/containerd/content/content.go b/vendor/github.com/containerd/containerd/content/content.go
deleted file mode 100644
index d8141a68b..000000000
--- a/vendor/github.com/containerd/containerd/content/content.go
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package content
-
-import (
- "context"
- "io"
- "time"
-
- "github.com/opencontainers/go-digest"
- ocispec "github.com/opencontainers/image-spec/specs-go/v1"
-)
-
-// ReaderAt extends the standard io.ReaderAt interface with reporting of Size and io.Closer
-type ReaderAt interface {
- io.ReaderAt
- io.Closer
- Size() int64
-}
-
-// Provider provides a reader interface for specific content
-type Provider interface {
- // ReaderAt only requires desc.Digest to be set.
- // Other fields in the descriptor may be used internally for resolving
- // the location of the actual data.
- ReaderAt(ctx context.Context, dec ocispec.Descriptor) (ReaderAt, error)
-}
-
-// Ingester writes content
-type Ingester interface {
- // Some implementations require WithRef to be included in opts.
- Writer(ctx context.Context, opts ...WriterOpt) (Writer, error)
-}
-
-// Info holds content specific information
-//
-// TODO(stevvooe): Consider a very different name for this struct. Info is way
-// to general. It also reads very weird in certain context, like pluralization.
-type Info struct {
- Digest digest.Digest
- Size int64
- CreatedAt time.Time
- UpdatedAt time.Time
- Labels map[string]string
-}
-
-// Status of a content operation
-type Status struct {
- Ref string
- Offset int64
- Total int64
- Expected digest.Digest
- StartedAt time.Time
- UpdatedAt time.Time
-}
-
-// WalkFunc defines the callback for a blob walk.
-type WalkFunc func(Info) error
-
-// Manager provides methods for inspecting, listing and removing content.
-type Manager interface {
- // Info will return metadata about content available in the content store.
- //
- // If the content is not present, ErrNotFound will be returned.
- Info(ctx context.Context, dgst digest.Digest) (Info, error)
-
- // Update updates mutable information related to content.
- // If one or more fieldpaths are provided, only those
- // fields will be updated.
- // Mutable fields:
- // labels.*
- Update(ctx context.Context, info Info, fieldpaths ...string) (Info, error)
-
- // Walk will call fn for each item in the content store which
- // match the provided filters. If no filters are given all
- // items will be walked.
- Walk(ctx context.Context, fn WalkFunc, filters ...string) error
-
- // Delete removes the content from the store.
- Delete(ctx context.Context, dgst digest.Digest) error
-}
-
-// IngestManager provides methods for managing ingests.
-type IngestManager interface {
- // Status returns the status of the provided ref.
- Status(ctx context.Context, ref string) (Status, error)
-
- // ListStatuses returns the status of any active ingestions whose ref match the
- // provided regular expression. If empty, all active ingestions will be
- // returned.
- ListStatuses(ctx context.Context, filters ...string) ([]Status, error)
-
- // Abort completely cancels the ingest operation targeted by ref.
- Abort(ctx context.Context, ref string) error
-}
-
-// Writer handles the write of content into a content store
-type Writer interface {
- // Close closes the writer, if the writer has not been
- // committed this allows resuming or aborting.
- // Calling Close on a closed writer will not error.
- io.WriteCloser
-
- // Digest may return empty digest or panics until committed.
- Digest() digest.Digest
-
- // Commit commits the blob (but no roll-back is guaranteed on an error).
- // size and expected can be zero-value when unknown.
- // Commit always closes the writer, even on error.
- // ErrAlreadyExists aborts the writer.
- Commit(ctx context.Context, size int64, expected digest.Digest, opts ...Opt) error
-
- // Status returns the current state of write
- Status() (Status, error)
-
- // Truncate updates the size of the target blob
- Truncate(size int64) error
-}
-
-// Store combines the methods of content-oriented interfaces into a set that
-// are commonly provided by complete implementations.
-type Store interface {
- Manager
- Provider
- IngestManager
- Ingester
-}
-
-// Opt is used to alter the mutable properties of content
-type Opt func(*Info) error
-
-// WithLabels allows labels to be set on content
-func WithLabels(labels map[string]string) Opt {
- return func(info *Info) error {
- info.Labels = labels
- return nil
- }
-}
-
-// WriterOpts is internally used by WriterOpt.
-type WriterOpts struct {
- Ref string
- Desc ocispec.Descriptor
-}
-
-// WriterOpt is used for passing options to Ingester.Writer.
-type WriterOpt func(*WriterOpts) error
-
-// WithDescriptor specifies an OCI descriptor.
-// Writer may optionally use the descriptor internally for resolving
-// the location of the actual data.
-// Write does not require any field of desc to be set.
-// If the data size is unknown, desc.Size should be set to 0.
-// Some implementations may also accept negative values as "unknown".
-func WithDescriptor(desc ocispec.Descriptor) WriterOpt {
- return func(opts *WriterOpts) error {
- opts.Desc = desc
- return nil
- }
-}
-
-// WithRef specifies a ref string.
-func WithRef(ref string) WriterOpt {
- return func(opts *WriterOpts) error {
- opts.Ref = ref
- return nil
- }
-}
diff --git a/vendor/github.com/containerd/containerd/content/helpers.go b/vendor/github.com/containerd/containerd/content/helpers.go
deleted file mode 100644
index c1c204618..000000000
--- a/vendor/github.com/containerd/containerd/content/helpers.go
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package content
-
-import (
- "context"
- "io"
- "io/ioutil"
- "math/rand"
- "sync"
- "time"
-
- "github.com/containerd/containerd/errdefs"
- "github.com/opencontainers/go-digest"
- ocispec "github.com/opencontainers/image-spec/specs-go/v1"
- "github.com/pkg/errors"
-)
-
-var bufPool = sync.Pool{
- New: func() interface{} {
- buffer := make([]byte, 1<<20)
- return &buffer
- },
-}
-
-// NewReader returns a io.Reader from a ReaderAt
-func NewReader(ra ReaderAt) io.Reader {
- rd := io.NewSectionReader(ra, 0, ra.Size())
- return rd
-}
-
-// ReadBlob retrieves the entire contents of the blob from the provider.
-//
-// Avoid using this for large blobs, such as layers.
-func ReadBlob(ctx context.Context, provider Provider, desc ocispec.Descriptor) ([]byte, error) {
- ra, err := provider.ReaderAt(ctx, desc)
- if err != nil {
- return nil, err
- }
- defer ra.Close()
-
- p := make([]byte, ra.Size())
-
- n, err := ra.ReadAt(p, 0)
- if err == io.EOF {
- if int64(n) != ra.Size() {
- err = io.ErrUnexpectedEOF
- } else {
- err = nil
- }
- }
- return p, err
-}
-
-// WriteBlob writes data with the expected digest into the content store. If
-// expected already exists, the method returns immediately and the reader will
-// not be consumed.
-//
-// This is useful when the digest and size are known beforehand.
-//
-// Copy is buffered, so no need to wrap reader in buffered io.
-func WriteBlob(ctx context.Context, cs Ingester, ref string, r io.Reader, desc ocispec.Descriptor, opts ...Opt) error {
- cw, err := OpenWriter(ctx, cs, WithRef(ref), WithDescriptor(desc))
- if err != nil {
- if !errdefs.IsAlreadyExists(err) {
- return errors.Wrap(err, "failed to open writer")
- }
-
- return nil // all ready present
- }
- defer cw.Close()
-
- return Copy(ctx, cw, r, desc.Size, desc.Digest, opts...)
-}
-
-// OpenWriter opens a new writer for the given reference, retrying if the writer
-// is locked until the reference is available or returns an error.
-func OpenWriter(ctx context.Context, cs Ingester, opts ...WriterOpt) (Writer, error) {
- var (
- cw Writer
- err error
- retry = 16
- )
- for {
- cw, err = cs.Writer(ctx, opts...)
- if err != nil {
- if !errdefs.IsUnavailable(err) {
- return nil, err
- }
-
- // TODO: Check status to determine if the writer is active,
- // continue waiting while active, otherwise return lock
- // error or abort. Requires asserting for an ingest manager
-
- select {
- case <-time.After(time.Millisecond * time.Duration(rand.Intn(retry))):
- if retry < 2048 {
- retry = retry << 1
- }
- continue
- case <-ctx.Done():
- // Propagate lock error
- return nil, err
- }
-
- }
- break
- }
-
- return cw, err
-}
-
-// Copy copies data with the expected digest from the reader into the
-// provided content store writer. This copy commits the writer.
-//
-// This is useful when the digest and size are known beforehand. When
-// the size or digest is unknown, these values may be empty.
-//
-// Copy is buffered, so no need to wrap reader in buffered io.
-func Copy(ctx context.Context, cw Writer, r io.Reader, size int64, expected digest.Digest, opts ...Opt) error {
- ws, err := cw.Status()
- if err != nil {
- return errors.Wrap(err, "failed to get status")
- }
-
- if ws.Offset > 0 {
- r, err = seekReader(r, ws.Offset, size)
- if err != nil {
- return errors.Wrapf(err, "unable to resume write to %v", ws.Ref)
- }
- }
-
- if _, err := copyWithBuffer(cw, r); err != nil {
- return errors.Wrap(err, "failed to copy")
- }
-
- if err := cw.Commit(ctx, size, expected, opts...); err != nil {
- if !errdefs.IsAlreadyExists(err) {
- return errors.Wrapf(err, "failed commit on ref %q", ws.Ref)
- }
- }
-
- return nil
-}
-
-// CopyReaderAt copies to a writer from a given reader at for the given
-// number of bytes. This copy does not commit the writer.
-func CopyReaderAt(cw Writer, ra ReaderAt, n int64) error {
- ws, err := cw.Status()
- if err != nil {
- return err
- }
-
- _, err = copyWithBuffer(cw, io.NewSectionReader(ra, ws.Offset, n))
- return err
-}
-
-// CopyReader copies to a writer from a given reader, returning
-// the number of bytes copied.
-// Note: if the writer has a non-zero offset, the total number
-// of bytes read may be greater than those copied if the reader
-// is not an io.Seeker.
-// This copy does not commit the writer.
-func CopyReader(cw Writer, r io.Reader) (int64, error) {
- ws, err := cw.Status()
- if err != nil {
- return 0, errors.Wrap(err, "failed to get status")
- }
-
- if ws.Offset > 0 {
- r, err = seekReader(r, ws.Offset, 0)
- if err != nil {
- return 0, errors.Wrapf(err, "unable to resume write to %v", ws.Ref)
- }
- }
-
- return copyWithBuffer(cw, r)
-}
-
-// seekReader attempts to seek the reader to the given offset, either by
-// resolving `io.Seeker`, by detecting `io.ReaderAt`, or discarding
-// up to the given offset.
-func seekReader(r io.Reader, offset, size int64) (io.Reader, error) {
- // attempt to resolve r as a seeker and setup the offset.
- seeker, ok := r.(io.Seeker)
- if ok {
- nn, err := seeker.Seek(offset, io.SeekStart)
- if nn != offset {
- return nil, errors.Wrapf(err, "failed to seek to offset %v", offset)
- }
-
- if err != nil {
- return nil, err
- }
-
- return r, nil
- }
-
- // ok, let's try io.ReaderAt!
- readerAt, ok := r.(io.ReaderAt)
- if ok && size > offset {
- sr := io.NewSectionReader(readerAt, offset, size)
- return sr, nil
- }
-
- // well then, let's just discard up to the offset
- n, err := copyWithBuffer(ioutil.Discard, io.LimitReader(r, offset))
- if err != nil {
- return nil, errors.Wrap(err, "failed to discard to offset")
- }
- if n != offset {
- return nil, errors.Errorf("unable to discard to offset")
- }
-
- return r, nil
-}
-
-func copyWithBuffer(dst io.Writer, src io.Reader) (written int64, err error) {
- buf := bufPool.Get().(*[]byte)
- written, err = io.CopyBuffer(dst, src, *buf)
- bufPool.Put(buf)
- return
-}
diff --git a/vendor/github.com/containerd/containerd/content/local/locks.go b/vendor/github.com/containerd/containerd/content/local/locks.go
deleted file mode 100644
index bc3bd18e0..000000000
--- a/vendor/github.com/containerd/containerd/content/local/locks.go
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package local
-
-import (
- "sync"
-
- "github.com/containerd/containerd/errdefs"
- "github.com/pkg/errors"
-)
-
-// Handles locking references
-
-var (
- // locks lets us lock in process
- locks = map[string]struct{}{}
- locksMu sync.Mutex
-)
-
-func tryLock(ref string) error {
- locksMu.Lock()
- defer locksMu.Unlock()
-
- if _, ok := locks[ref]; ok {
- return errors.Wrapf(errdefs.ErrUnavailable, "ref %s locked", ref)
- }
-
- locks[ref] = struct{}{}
- return nil
-}
-
-func unlock(ref string) {
- locksMu.Lock()
- defer locksMu.Unlock()
-
- delete(locks, ref)
-}
diff --git a/vendor/github.com/containerd/containerd/content/local/readerat.go b/vendor/github.com/containerd/containerd/content/local/readerat.go
deleted file mode 100644
index 42b99dc42..000000000
--- a/vendor/github.com/containerd/containerd/content/local/readerat.go
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package local
-
-import (
- "os"
-)
-
-// readerat implements io.ReaderAt in a completely stateless manner by opening
-// the referenced file for each call to ReadAt.
-type sizeReaderAt struct {
- size int64
- fp *os.File
-}
-
-func (ra sizeReaderAt) ReadAt(p []byte, offset int64) (int, error) {
- return ra.fp.ReadAt(p, offset)
-}
-
-func (ra sizeReaderAt) Size() int64 {
- return ra.size
-}
-
-func (ra sizeReaderAt) Close() error {
- return ra.fp.Close()
-}
diff --git a/vendor/github.com/containerd/containerd/content/local/store.go b/vendor/github.com/containerd/containerd/content/local/store.go
deleted file mode 100644
index 87056814a..000000000
--- a/vendor/github.com/containerd/containerd/content/local/store.go
+++ /dev/null
@@ -1,703 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package local
-
-import (
- "context"
- "fmt"
- "io"
- "io/ioutil"
- "math/rand"
- "os"
- "path/filepath"
- "strconv"
- "strings"
- "sync"
- "time"
-
- "github.com/containerd/containerd/content"
- "github.com/containerd/containerd/errdefs"
- "github.com/containerd/containerd/filters"
- "github.com/containerd/containerd/log"
- "github.com/sirupsen/logrus"
-
- digest "github.com/opencontainers/go-digest"
- ocispec "github.com/opencontainers/image-spec/specs-go/v1"
- "github.com/pkg/errors"
-)
-
-var bufPool = sync.Pool{
- New: func() interface{} {
- buffer := make([]byte, 1<<20)
- return &buffer
- },
-}
-
-// LabelStore is used to store mutable labels for digests
-type LabelStore interface {
- // Get returns all the labels for the given digest
- Get(digest.Digest) (map[string]string, error)
-
- // Set sets all the labels for a given digest
- Set(digest.Digest, map[string]string) error
-
- // Update replaces the given labels for a digest,
- // a key with an empty value removes a label.
- Update(digest.Digest, map[string]string) (map[string]string, error)
-}
-
-// Store is digest-keyed store for content. All data written into the store is
-// stored under a verifiable digest.
-//
-// Store can generally support multi-reader, single-writer ingest of data,
-// including resumable ingest.
-type store struct {
- root string
- ls LabelStore
-}
-
-// NewStore returns a local content store
-func NewStore(root string) (content.Store, error) {
- return NewLabeledStore(root, nil)
-}
-
-// NewLabeledStore returns a new content store using the provided label store
-//
-// Note: content stores which are used underneath a metadata store may not
-// require labels and should use `NewStore`. `NewLabeledStore` is primarily
-// useful for tests or standalone implementations.
-func NewLabeledStore(root string, ls LabelStore) (content.Store, error) {
- if err := os.MkdirAll(filepath.Join(root, "ingest"), 0777); err != nil {
- return nil, err
- }
-
- return &store{
- root: root,
- ls: ls,
- }, nil
-}
-
-func (s *store) Info(ctx context.Context, dgst digest.Digest) (content.Info, error) {
- p, err := s.blobPath(dgst)
- if err != nil {
- return content.Info{}, errors.Wrapf(err, "calculating blob info path")
- }
-
- fi, err := os.Stat(p)
- if err != nil {
- if os.IsNotExist(err) {
- err = errors.Wrapf(errdefs.ErrNotFound, "content %v", dgst)
- }
-
- return content.Info{}, err
- }
- var labels map[string]string
- if s.ls != nil {
- labels, err = s.ls.Get(dgst)
- if err != nil {
- return content.Info{}, err
- }
- }
- return s.info(dgst, fi, labels), nil
-}
-
-func (s *store) info(dgst digest.Digest, fi os.FileInfo, labels map[string]string) content.Info {
- return content.Info{
- Digest: dgst,
- Size: fi.Size(),
- CreatedAt: fi.ModTime(),
- UpdatedAt: getATime(fi),
- Labels: labels,
- }
-}
-
-// ReaderAt returns an io.ReaderAt for the blob.
-func (s *store) ReaderAt(ctx context.Context, desc ocispec.Descriptor) (content.ReaderAt, error) {
- p, err := s.blobPath(desc.Digest)
- if err != nil {
- return nil, errors.Wrapf(err, "calculating blob path for ReaderAt")
- }
- fi, err := os.Stat(p)
- if err != nil {
- if !os.IsNotExist(err) {
- return nil, err
- }
-
- return nil, errors.Wrapf(errdefs.ErrNotFound, "blob %s expected at %s", desc.Digest, p)
- }
-
- fp, err := os.Open(p)
- if err != nil {
- if !os.IsNotExist(err) {
- return nil, err
- }
-
- return nil, errors.Wrapf(errdefs.ErrNotFound, "blob %s expected at %s", desc.Digest, p)
- }
-
- return sizeReaderAt{size: fi.Size(), fp: fp}, nil
-}
-
-// Delete removes a blob by its digest.
-//
-// While this is safe to do concurrently, safe exist-removal logic must hold
-// some global lock on the store.
-func (s *store) Delete(ctx context.Context, dgst digest.Digest) error {
- bp, err := s.blobPath(dgst)
- if err != nil {
- return errors.Wrapf(err, "calculating blob path for delete")
- }
-
- if err := os.RemoveAll(bp); err != nil {
- if !os.IsNotExist(err) {
- return err
- }
-
- return errors.Wrapf(errdefs.ErrNotFound, "content %v", dgst)
- }
-
- return nil
-}
-
-func (s *store) Update(ctx context.Context, info content.Info, fieldpaths ...string) (content.Info, error) {
- if s.ls == nil {
- return content.Info{}, errors.Wrapf(errdefs.ErrFailedPrecondition, "update not supported on immutable content store")
- }
-
- p, err := s.blobPath(info.Digest)
- if err != nil {
- return content.Info{}, errors.Wrapf(err, "calculating blob path for update")
- }
-
- fi, err := os.Stat(p)
- if err != nil {
- if os.IsNotExist(err) {
- err = errors.Wrapf(errdefs.ErrNotFound, "content %v", info.Digest)
- }
-
- return content.Info{}, err
- }
-
- var (
- all bool
- labels map[string]string
- )
- if len(fieldpaths) > 0 {
- for _, path := range fieldpaths {
- if strings.HasPrefix(path, "labels.") {
- if labels == nil {
- labels = map[string]string{}
- }
-
- key := strings.TrimPrefix(path, "labels.")
- labels[key] = info.Labels[key]
- continue
- }
-
- switch path {
- case "labels":
- all = true
- labels = info.Labels
- default:
- return content.Info{}, errors.Wrapf(errdefs.ErrInvalidArgument, "cannot update %q field on content info %q", path, info.Digest)
- }
- }
- } else {
- all = true
- labels = info.Labels
- }
-
- if all {
- err = s.ls.Set(info.Digest, labels)
- } else {
- labels, err = s.ls.Update(info.Digest, labels)
- }
- if err != nil {
- return content.Info{}, err
- }
-
- info = s.info(info.Digest, fi, labels)
- info.UpdatedAt = time.Now()
-
- if err := os.Chtimes(p, info.UpdatedAt, info.CreatedAt); err != nil {
- log.G(ctx).WithError(err).Warnf("could not change access time for %s", info.Digest)
- }
-
- return info, nil
-}
-
-func (s *store) Walk(ctx context.Context, fn content.WalkFunc, filters ...string) error {
- // TODO: Support filters
- root := filepath.Join(s.root, "blobs")
- var alg digest.Algorithm
- return filepath.Walk(root, func(path string, fi os.FileInfo, err error) error {
- if err != nil {
- return err
- }
- if !fi.IsDir() && !alg.Available() {
- return nil
- }
-
- // TODO(stevvooe): There are few more cases with subdirs that should be
- // handled in case the layout gets corrupted. This isn't strict enough
- // and may spew bad data.
-
- if path == root {
- return nil
- }
- if filepath.Dir(path) == root {
- alg = digest.Algorithm(filepath.Base(path))
-
- if !alg.Available() {
- alg = ""
- return filepath.SkipDir
- }
-
- // descending into a hash directory
- return nil
- }
-
- dgst := digest.NewDigestFromHex(alg.String(), filepath.Base(path))
- if err := dgst.Validate(); err != nil {
- // log error but don't report
- log.L.WithError(err).WithField("path", path).Error("invalid digest for blob path")
- // if we see this, it could mean some sort of corruption of the
- // store or extra paths not expected previously.
- }
-
- var labels map[string]string
- if s.ls != nil {
- labels, err = s.ls.Get(dgst)
- if err != nil {
- return err
- }
- }
- return fn(s.info(dgst, fi, labels))
- })
-}
-
-func (s *store) Status(ctx context.Context, ref string) (content.Status, error) {
- return s.status(s.ingestRoot(ref))
-}
-
-func (s *store) ListStatuses(ctx context.Context, fs ...string) ([]content.Status, error) {
- fp, err := os.Open(filepath.Join(s.root, "ingest"))
- if err != nil {
- return nil, err
- }
-
- defer fp.Close()
-
- fis, err := fp.Readdir(-1)
- if err != nil {
- return nil, err
- }
-
- filter, err := filters.ParseAll(fs...)
- if err != nil {
- return nil, err
- }
-
- var active []content.Status
- for _, fi := range fis {
- p := filepath.Join(s.root, "ingest", fi.Name())
- stat, err := s.status(p)
- if err != nil {
- if !os.IsNotExist(err) {
- return nil, err
- }
-
- // TODO(stevvooe): This is a common error if uploads are being
- // completed while making this listing. Need to consider taking a
- // lock on the whole store to coordinate this aspect.
- //
- // Another option is to cleanup downloads asynchronously and
- // coordinate this method with the cleanup process.
- //
- // For now, we just skip them, as they really don't exist.
- continue
- }
-
- if filter.Match(adaptStatus(stat)) {
- active = append(active, stat)
- }
- }
-
- return active, nil
-}
-
-// WalkStatusRefs is used to walk all status references
-// Failed status reads will be logged and ignored, if
-// this function is called while references are being altered,
-// these error messages may be produced.
-func (s *store) WalkStatusRefs(ctx context.Context, fn func(string) error) error {
- fp, err := os.Open(filepath.Join(s.root, "ingest"))
- if err != nil {
- return err
- }
-
- defer fp.Close()
-
- fis, err := fp.Readdir(-1)
- if err != nil {
- return err
- }
-
- for _, fi := range fis {
- rf := filepath.Join(s.root, "ingest", fi.Name(), "ref")
-
- ref, err := readFileString(rf)
- if err != nil {
- log.G(ctx).WithError(err).WithField("path", rf).Error("failed to read ingest ref")
- continue
- }
-
- if err := fn(ref); err != nil {
- return err
- }
- }
-
- return nil
-}
-
-// status works like stat above except uses the path to the ingest.
-func (s *store) status(ingestPath string) (content.Status, error) {
- dp := filepath.Join(ingestPath, "data")
- fi, err := os.Stat(dp)
- if err != nil {
- if os.IsNotExist(err) {
- err = errors.Wrap(errdefs.ErrNotFound, err.Error())
- }
- return content.Status{}, err
- }
-
- ref, err := readFileString(filepath.Join(ingestPath, "ref"))
- if err != nil {
- if os.IsNotExist(err) {
- err = errors.Wrap(errdefs.ErrNotFound, err.Error())
- }
- return content.Status{}, err
- }
-
- startedAt, err := readFileTimestamp(filepath.Join(ingestPath, "startedat"))
- if err != nil {
- return content.Status{}, errors.Wrapf(err, "could not read startedat")
- }
-
- updatedAt, err := readFileTimestamp(filepath.Join(ingestPath, "updatedat"))
- if err != nil {
- return content.Status{}, errors.Wrapf(err, "could not read updatedat")
- }
-
- // because we don't write updatedat on every write, the mod time may
- // actually be more up to date.
- if fi.ModTime().After(updatedAt) {
- updatedAt = fi.ModTime()
- }
-
- return content.Status{
- Ref: ref,
- Offset: fi.Size(),
- Total: s.total(ingestPath),
- UpdatedAt: updatedAt,
- StartedAt: startedAt,
- }, nil
-}
-
-func adaptStatus(status content.Status) filters.Adaptor {
- return filters.AdapterFunc(func(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
- switch fieldpath[0] {
- case "ref":
- return status.Ref, true
- }
-
- return "", false
- })
-}
-
-// total attempts to resolve the total expected size for the write.
-func (s *store) total(ingestPath string) int64 {
- totalS, err := readFileString(filepath.Join(ingestPath, "total"))
- if err != nil {
- return 0
- }
-
- total, err := strconv.ParseInt(totalS, 10, 64)
- if err != nil {
- // represents a corrupted file, should probably remove.
- return 0
- }
-
- return total
-}
-
-// Writer begins or resumes the active writer identified by ref. If the writer
-// is already in use, an error is returned. Only one writer may be in use per
-// ref at a time.
-//
-// The argument `ref` is used to uniquely identify a long-lived writer transaction.
-func (s *store) Writer(ctx context.Context, opts ...content.WriterOpt) (content.Writer, error) {
- var wOpts content.WriterOpts
- for _, opt := range opts {
- if err := opt(&wOpts); err != nil {
- return nil, err
- }
- }
- // TODO(AkihiroSuda): we could create a random string or one calculated based on the context
- // https://github.com/containerd/containerd/issues/2129#issuecomment-380255019
- if wOpts.Ref == "" {
- return nil, errors.Wrap(errdefs.ErrInvalidArgument, "ref must not be empty")
- }
- var lockErr error
- for count := uint64(0); count < 10; count++ {
- time.Sleep(time.Millisecond * time.Duration(rand.Intn(1< 0 && status.Total > 0 && total != status.Total {
- return status, errors.Errorf("provided total differs from status: %v != %v", total, status.Total)
- }
-
- // TODO(stevvooe): slow slow slow!!, send to goroutine or use resumable hashes
- fp, err := os.Open(data)
- if err != nil {
- return status, err
- }
-
- p := bufPool.Get().(*[]byte)
- status.Offset, err = io.CopyBuffer(digester.Hash(), fp, *p)
- bufPool.Put(p)
- fp.Close()
- return status, err
-}
-
-// writer provides the main implementation of the Writer method. The caller
-// must hold the lock correctly and release on error if there is a problem.
-func (s *store) writer(ctx context.Context, ref string, total int64, expected digest.Digest) (content.Writer, error) {
- // TODO(stevvooe): Need to actually store expected here. We have
- // code in the service that shouldn't be dealing with this.
- if expected != "" {
- p, err := s.blobPath(expected)
- if err != nil {
- return nil, errors.Wrap(err, "calculating expected blob path for writer")
- }
- if _, err := os.Stat(p); err == nil {
- return nil, errors.Wrapf(errdefs.ErrAlreadyExists, "content %v", expected)
- }
- }
-
- path, refp, data := s.ingestPaths(ref)
-
- var (
- digester = digest.Canonical.Digester()
- offset int64
- startedAt time.Time
- updatedAt time.Time
- )
-
- foundValidIngest := false
- // ensure that the ingest path has been created.
- if err := os.Mkdir(path, 0755); err != nil {
- if !os.IsExist(err) {
- return nil, err
- }
- status, err := s.resumeStatus(ref, total, digester)
- if err == nil {
- foundValidIngest = true
- updatedAt = status.UpdatedAt
- startedAt = status.StartedAt
- total = status.Total
- offset = status.Offset
- } else {
- logrus.Infof("failed to resume the status from path %s: %s. will recreate them", path, err.Error())
- }
- }
-
- if !foundValidIngest {
- startedAt = time.Now()
- updatedAt = startedAt
-
- // the ingest is new, we need to setup the target location.
- // write the ref to a file for later use
- if err := ioutil.WriteFile(refp, []byte(ref), 0666); err != nil {
- return nil, err
- }
-
- if err := writeTimestampFile(filepath.Join(path, "startedat"), startedAt); err != nil {
- return nil, err
- }
-
- if err := writeTimestampFile(filepath.Join(path, "updatedat"), startedAt); err != nil {
- return nil, err
- }
-
- if total > 0 {
- if err := ioutil.WriteFile(filepath.Join(path, "total"), []byte(fmt.Sprint(total)), 0666); err != nil {
- return nil, err
- }
- }
- }
-
- fp, err := os.OpenFile(data, os.O_WRONLY|os.O_CREATE, 0666)
- if err != nil {
- return nil, errors.Wrap(err, "failed to open data file")
- }
-
- if _, err := fp.Seek(offset, io.SeekStart); err != nil {
- return nil, errors.Wrap(err, "could not seek to current write offset")
- }
-
- return &writer{
- s: s,
- fp: fp,
- ref: ref,
- path: path,
- offset: offset,
- total: total,
- digester: digester,
- startedAt: startedAt,
- updatedAt: updatedAt,
- }, nil
-}
-
-// Abort an active transaction keyed by ref. If the ingest is active, it will
-// be cancelled. Any resources associated with the ingest will be cleaned.
-func (s *store) Abort(ctx context.Context, ref string) error {
- root := s.ingestRoot(ref)
- if err := os.RemoveAll(root); err != nil {
- if os.IsNotExist(err) {
- return errors.Wrapf(errdefs.ErrNotFound, "ingest ref %q", ref)
- }
-
- return err
- }
-
- return nil
-}
-
-func (s *store) blobPath(dgst digest.Digest) (string, error) {
- if err := dgst.Validate(); err != nil {
- return "", errors.Wrapf(errdefs.ErrInvalidArgument, "cannot calculate blob path from invalid digest: %v", err)
- }
-
- return filepath.Join(s.root, "blobs", dgst.Algorithm().String(), dgst.Hex()), nil
-}
-
-func (s *store) ingestRoot(ref string) string {
- // we take a digest of the ref to keep the ingest paths constant length.
- // Note that this is not the current or potential digest of incoming content.
- dgst := digest.FromString(ref)
- return filepath.Join(s.root, "ingest", dgst.Hex())
-}
-
-// ingestPaths are returned. The paths are the following:
-//
-// - root: entire ingest directory
-// - ref: name of the starting ref, must be unique
-// - data: file where data is written
-//
-func (s *store) ingestPaths(ref string) (string, string, string) {
- var (
- fp = s.ingestRoot(ref)
- rp = filepath.Join(fp, "ref")
- dp = filepath.Join(fp, "data")
- )
-
- return fp, rp, dp
-}
-
-func readFileString(path string) (string, error) {
- p, err := ioutil.ReadFile(path)
- return string(p), err
-}
-
-// readFileTimestamp reads a file with just a timestamp present.
-func readFileTimestamp(p string) (time.Time, error) {
- b, err := ioutil.ReadFile(p)
- if err != nil {
- if os.IsNotExist(err) {
- err = errors.Wrap(errdefs.ErrNotFound, err.Error())
- }
- return time.Time{}, err
- }
-
- var t time.Time
- if err := t.UnmarshalText(b); err != nil {
- return time.Time{}, errors.Wrapf(err, "could not parse timestamp file %v", p)
- }
-
- return t, nil
-}
-
-func writeTimestampFile(p string, t time.Time) error {
- b, err := t.MarshalText()
- if err != nil {
- return err
- }
- return atomicWrite(p, b, 0666)
-}
-
-func atomicWrite(path string, data []byte, mode os.FileMode) error {
- tmp := fmt.Sprintf("%s.tmp", path)
- f, err := os.OpenFile(tmp, os.O_RDWR|os.O_CREATE|os.O_TRUNC|os.O_SYNC, mode)
- if err != nil {
- return errors.Wrap(err, "create tmp file")
- }
- _, err = f.Write(data)
- f.Close()
- if err != nil {
- return errors.Wrap(err, "write atomic data")
- }
- return os.Rename(tmp, path)
-}
diff --git a/vendor/github.com/containerd/containerd/content/local/store_unix.go b/vendor/github.com/containerd/containerd/content/local/store_unix.go
deleted file mode 100644
index f5f34fd0c..000000000
--- a/vendor/github.com/containerd/containerd/content/local/store_unix.go
+++ /dev/null
@@ -1,35 +0,0 @@
-// +build linux solaris darwin freebsd
-
-/*
- 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 local
-
-import (
- "os"
- "syscall"
- "time"
-
- "github.com/containerd/containerd/sys"
-)
-
-func getATime(fi os.FileInfo) time.Time {
- if st, ok := fi.Sys().(*syscall.Stat_t); ok {
- return sys.StatATimeAsTime(st)
- }
-
- return fi.ModTime()
-}
diff --git a/vendor/github.com/containerd/containerd/content/local/store_windows.go b/vendor/github.com/containerd/containerd/content/local/store_windows.go
deleted file mode 100644
index bce849979..000000000
--- a/vendor/github.com/containerd/containerd/content/local/store_windows.go
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package local
-
-import (
- "os"
- "time"
-)
-
-func getATime(fi os.FileInfo) time.Time {
- return fi.ModTime()
-}
diff --git a/vendor/github.com/containerd/containerd/content/local/writer.go b/vendor/github.com/containerd/containerd/content/local/writer.go
deleted file mode 100644
index 0a11f4d91..000000000
--- a/vendor/github.com/containerd/containerd/content/local/writer.go
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package local
-
-import (
- "context"
- "io"
- "os"
- "path/filepath"
- "runtime"
- "time"
-
- "github.com/containerd/containerd/content"
- "github.com/containerd/containerd/errdefs"
- "github.com/containerd/containerd/log"
- "github.com/opencontainers/go-digest"
- "github.com/pkg/errors"
-)
-
-// writer represents a write transaction against the blob store.
-type writer struct {
- s *store
- fp *os.File // opened data file
- path string // path to writer dir
- ref string // ref key
- offset int64
- total int64
- digester digest.Digester
- startedAt time.Time
- updatedAt time.Time
-}
-
-func (w *writer) Status() (content.Status, error) {
- return content.Status{
- Ref: w.ref,
- Offset: w.offset,
- Total: w.total,
- StartedAt: w.startedAt,
- UpdatedAt: w.updatedAt,
- }, nil
-}
-
-// Digest returns the current digest of the content, up to the current write.
-//
-// Cannot be called concurrently with `Write`.
-func (w *writer) Digest() digest.Digest {
- return w.digester.Digest()
-}
-
-// Write p to the transaction.
-//
-// Note that writes are unbuffered to the backing file. When writing, it is
-// recommended to wrap in a bufio.Writer or, preferably, use io.CopyBuffer.
-func (w *writer) Write(p []byte) (n int, err error) {
- n, err = w.fp.Write(p)
- w.digester.Hash().Write(p[:n])
- w.offset += int64(len(p))
- w.updatedAt = time.Now()
- return n, err
-}
-
-func (w *writer) Commit(ctx context.Context, size int64, expected digest.Digest, opts ...content.Opt) error {
- // Ensure even on error the writer is fully closed
- defer unlock(w.ref)
-
- var base content.Info
- for _, opt := range opts {
- if err := opt(&base); err != nil {
- return err
- }
- }
-
- fp := w.fp
- w.fp = nil
-
- if fp == nil {
- return errors.Wrap(errdefs.ErrFailedPrecondition, "cannot commit on closed writer")
- }
-
- if err := fp.Sync(); err != nil {
- fp.Close()
- return errors.Wrap(err, "sync failed")
- }
-
- fi, err := fp.Stat()
- closeErr := fp.Close()
- if err != nil {
- return errors.Wrap(err, "stat on ingest file failed")
- }
- if closeErr != nil {
- return errors.Wrap(err, "failed to close ingest file")
- }
-
- if size > 0 && size != fi.Size() {
- return errors.Wrapf(errdefs.ErrFailedPrecondition, "unexpected commit size %d, expected %d", fi.Size(), size)
- }
-
- dgst := w.digester.Digest()
- if expected != "" && expected != dgst {
- return errors.Wrapf(errdefs.ErrFailedPrecondition, "unexpected commit digest %s, expected %s", dgst, expected)
- }
-
- var (
- ingest = filepath.Join(w.path, "data")
- target, _ = w.s.blobPath(dgst) // ignore error because we calculated this dgst
- )
-
- // make sure parent directories of blob exist
- if err := os.MkdirAll(filepath.Dir(target), 0755); err != nil {
- return err
- }
-
- if _, err := os.Stat(target); err == nil {
- // collision with the target file!
- if err := os.RemoveAll(w.path); err != nil {
- log.G(ctx).WithField("ref", w.ref).WithField("path", w.path).Errorf("failed to remove ingest directory")
- }
- return errors.Wrapf(errdefs.ErrAlreadyExists, "content %v", dgst)
- }
-
- if err := os.Rename(ingest, target); err != nil {
- return err
- }
-
- // Ingest has now been made available in the content store, attempt to complete
- // setting metadata but errors should only be logged and not returned since
- // the content store cannot be cleanly rolled back.
-
- commitTime := time.Now()
- if err := os.Chtimes(target, commitTime, commitTime); err != nil {
- log.G(ctx).WithField("digest", dgst).Errorf("failed to change file time to commit time")
- }
-
- // clean up!!
- if err := os.RemoveAll(w.path); err != nil {
- log.G(ctx).WithField("ref", w.ref).WithField("path", w.path).Errorf("failed to remove ingest directory")
- }
-
- if w.s.ls != nil && base.Labels != nil {
- if err := w.s.ls.Set(dgst, base.Labels); err != nil {
- log.G(ctx).WithField("digest", dgst).Errorf("failed to set labels")
- }
- }
-
- // change to readonly, more important for read, but provides _some_
- // protection from this point on. We use the existing perms with a mask
- // only allowing reads honoring the umask on creation.
- //
- // This removes write and exec, only allowing read per the creation umask.
- //
- // NOTE: Windows does not support this operation
- if runtime.GOOS != "windows" {
- if err := os.Chmod(target, (fi.Mode()&os.ModePerm)&^0333); err != nil {
- log.G(ctx).WithField("ref", w.ref).Errorf("failed to make readonly")
- }
- }
-
- return nil
-}
-
-// Close the writer, flushing any unwritten data and leaving the progress in
-// tact.
-//
-// If one needs to resume the transaction, a new writer can be obtained from
-// `Ingester.Writer` using the same key. The write can then be continued
-// from it was left off.
-//
-// To abandon a transaction completely, first call close then `IngestManager.Abort` to
-// clean up the associated resources.
-func (w *writer) Close() (err error) {
- if w.fp != nil {
- w.fp.Sync()
- err = w.fp.Close()
- writeTimestampFile(filepath.Join(w.path, "updatedat"), w.updatedAt)
- w.fp = nil
- unlock(w.ref)
- return
- }
-
- return nil
-}
-
-func (w *writer) Truncate(size int64) error {
- if size != 0 {
- return errors.New("Truncate: unsupported size")
- }
- w.offset = 0
- w.digester.Hash().Reset()
- if _, err := w.fp.Seek(0, io.SeekStart); err != nil {
- return err
- }
- return w.fp.Truncate(0)
-}
diff --git a/vendor/github.com/containerd/containerd/content/proxy/content_reader.go b/vendor/github.com/containerd/containerd/content/proxy/content_reader.go
deleted file mode 100644
index b06e48fa9..000000000
--- a/vendor/github.com/containerd/containerd/content/proxy/content_reader.go
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package proxy
-
-import (
- "context"
-
- contentapi "github.com/containerd/containerd/api/services/content/v1"
- digest "github.com/opencontainers/go-digest"
-)
-
-type remoteReaderAt struct {
- ctx context.Context
- digest digest.Digest
- size int64
- client contentapi.ContentClient
-}
-
-func (ra *remoteReaderAt) Size() int64 {
- return ra.size
-}
-
-func (ra *remoteReaderAt) ReadAt(p []byte, off int64) (n int, err error) {
- rr := &contentapi.ReadContentRequest{
- Digest: ra.digest,
- Offset: off,
- Size_: int64(len(p)),
- }
- rc, err := ra.client.Read(ra.ctx, rr)
- if err != nil {
- return 0, err
- }
-
- for len(p) > 0 {
- var resp *contentapi.ReadContentResponse
- // fill our buffer up until we can fill p.
- resp, err = rc.Recv()
- if err != nil {
- return n, err
- }
-
- copied := copy(p, resp.Data)
- n += copied
- p = p[copied:]
- }
- return n, nil
-}
-
-func (ra *remoteReaderAt) Close() error {
- return nil
-}
diff --git a/vendor/github.com/containerd/containerd/content/proxy/content_store.go b/vendor/github.com/containerd/containerd/content/proxy/content_store.go
deleted file mode 100644
index 217b74651..000000000
--- a/vendor/github.com/containerd/containerd/content/proxy/content_store.go
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package proxy
-
-import (
- "context"
- "io"
-
- contentapi "github.com/containerd/containerd/api/services/content/v1"
- "github.com/containerd/containerd/content"
- "github.com/containerd/containerd/errdefs"
- protobuftypes "github.com/gogo/protobuf/types"
- digest "github.com/opencontainers/go-digest"
- ocispec "github.com/opencontainers/image-spec/specs-go/v1"
-)
-
-type proxyContentStore struct {
- client contentapi.ContentClient
-}
-
-// NewContentStore returns a new content store which communicates over a GRPC
-// connection using the containerd content GRPC API.
-func NewContentStore(client contentapi.ContentClient) content.Store {
- return &proxyContentStore{
- client: client,
- }
-}
-
-func (pcs *proxyContentStore) Info(ctx context.Context, dgst digest.Digest) (content.Info, error) {
- resp, err := pcs.client.Info(ctx, &contentapi.InfoRequest{
- Digest: dgst,
- })
- if err != nil {
- return content.Info{}, errdefs.FromGRPC(err)
- }
-
- return infoFromGRPC(resp.Info), nil
-}
-
-func (pcs *proxyContentStore) Walk(ctx context.Context, fn content.WalkFunc, filters ...string) error {
- session, err := pcs.client.List(ctx, &contentapi.ListContentRequest{
- Filters: filters,
- })
- if err != nil {
- return errdefs.FromGRPC(err)
- }
-
- for {
- msg, err := session.Recv()
- if err != nil {
- if err != io.EOF {
- return errdefs.FromGRPC(err)
- }
-
- break
- }
-
- for _, info := range msg.Info {
- if err := fn(infoFromGRPC(info)); err != nil {
- return err
- }
- }
- }
-
- return nil
-}
-
-func (pcs *proxyContentStore) Delete(ctx context.Context, dgst digest.Digest) error {
- if _, err := pcs.client.Delete(ctx, &contentapi.DeleteContentRequest{
- Digest: dgst,
- }); err != nil {
- return errdefs.FromGRPC(err)
- }
-
- return nil
-}
-
-// ReaderAt ignores MediaType.
-func (pcs *proxyContentStore) ReaderAt(ctx context.Context, desc ocispec.Descriptor) (content.ReaderAt, error) {
- i, err := pcs.Info(ctx, desc.Digest)
- if err != nil {
- return nil, err
- }
-
- return &remoteReaderAt{
- ctx: ctx,
- digest: desc.Digest,
- size: i.Size,
- client: pcs.client,
- }, nil
-}
-
-func (pcs *proxyContentStore) Status(ctx context.Context, ref string) (content.Status, error) {
- resp, err := pcs.client.Status(ctx, &contentapi.StatusRequest{
- Ref: ref,
- })
- if err != nil {
- return content.Status{}, errdefs.FromGRPC(err)
- }
-
- status := resp.Status
- return content.Status{
- Ref: status.Ref,
- StartedAt: status.StartedAt,
- UpdatedAt: status.UpdatedAt,
- Offset: status.Offset,
- Total: status.Total,
- Expected: status.Expected,
- }, nil
-}
-
-func (pcs *proxyContentStore) Update(ctx context.Context, info content.Info, fieldpaths ...string) (content.Info, error) {
- resp, err := pcs.client.Update(ctx, &contentapi.UpdateRequest{
- Info: infoToGRPC(info),
- UpdateMask: &protobuftypes.FieldMask{
- Paths: fieldpaths,
- },
- })
- if err != nil {
- return content.Info{}, errdefs.FromGRPC(err)
- }
- return infoFromGRPC(resp.Info), nil
-}
-
-func (pcs *proxyContentStore) ListStatuses(ctx context.Context, filters ...string) ([]content.Status, error) {
- resp, err := pcs.client.ListStatuses(ctx, &contentapi.ListStatusesRequest{
- Filters: filters,
- })
- if err != nil {
- return nil, errdefs.FromGRPC(err)
- }
-
- var statuses []content.Status
- for _, status := range resp.Statuses {
- statuses = append(statuses, content.Status{
- Ref: status.Ref,
- StartedAt: status.StartedAt,
- UpdatedAt: status.UpdatedAt,
- Offset: status.Offset,
- Total: status.Total,
- Expected: status.Expected,
- })
- }
-
- return statuses, nil
-}
-
-// Writer ignores MediaType.
-func (pcs *proxyContentStore) Writer(ctx context.Context, opts ...content.WriterOpt) (content.Writer, error) {
- var wOpts content.WriterOpts
- for _, opt := range opts {
- if err := opt(&wOpts); err != nil {
- return nil, err
- }
- }
- wrclient, offset, err := pcs.negotiate(ctx, wOpts.Ref, wOpts.Desc.Size, wOpts.Desc.Digest)
- if err != nil {
- return nil, errdefs.FromGRPC(err)
- }
-
- return &remoteWriter{
- ref: wOpts.Ref,
- client: wrclient,
- offset: offset,
- }, nil
-}
-
-// Abort implements asynchronous abort. It starts a new write session on the ref l
-func (pcs *proxyContentStore) Abort(ctx context.Context, ref string) error {
- if _, err := pcs.client.Abort(ctx, &contentapi.AbortRequest{
- Ref: ref,
- }); err != nil {
- return errdefs.FromGRPC(err)
- }
-
- return nil
-}
-
-func (pcs *proxyContentStore) negotiate(ctx context.Context, ref string, size int64, expected digest.Digest) (contentapi.Content_WriteClient, int64, error) {
- wrclient, err := pcs.client.Write(ctx)
- if err != nil {
- return nil, 0, err
- }
-
- if err := wrclient.Send(&contentapi.WriteContentRequest{
- Action: contentapi.WriteActionStat,
- Ref: ref,
- Total: size,
- Expected: expected,
- }); err != nil {
- return nil, 0, err
- }
-
- resp, err := wrclient.Recv()
- if err != nil {
- return nil, 0, err
- }
-
- return wrclient, resp.Offset, nil
-}
-
-func infoToGRPC(info content.Info) contentapi.Info {
- return contentapi.Info{
- Digest: info.Digest,
- Size_: info.Size,
- CreatedAt: info.CreatedAt,
- UpdatedAt: info.UpdatedAt,
- Labels: info.Labels,
- }
-}
-
-func infoFromGRPC(info contentapi.Info) content.Info {
- return content.Info{
- Digest: info.Digest,
- Size: info.Size_,
- CreatedAt: info.CreatedAt,
- UpdatedAt: info.UpdatedAt,
- Labels: info.Labels,
- }
-}
diff --git a/vendor/github.com/containerd/containerd/content/proxy/content_writer.go b/vendor/github.com/containerd/containerd/content/proxy/content_writer.go
deleted file mode 100644
index 5434a1568..000000000
--- a/vendor/github.com/containerd/containerd/content/proxy/content_writer.go
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package proxy
-
-import (
- "context"
- "io"
-
- contentapi "github.com/containerd/containerd/api/services/content/v1"
- "github.com/containerd/containerd/content"
- "github.com/containerd/containerd/errdefs"
- digest "github.com/opencontainers/go-digest"
- "github.com/pkg/errors"
-)
-
-type remoteWriter struct {
- ref string
- client contentapi.Content_WriteClient
- offset int64
- digest digest.Digest
-}
-
-// send performs a synchronous req-resp cycle on the client.
-func (rw *remoteWriter) send(req *contentapi.WriteContentRequest) (*contentapi.WriteContentResponse, error) {
- if err := rw.client.Send(req); err != nil {
- return nil, err
- }
-
- resp, err := rw.client.Recv()
-
- if err == nil {
- // try to keep these in sync
- if resp.Digest != "" {
- rw.digest = resp.Digest
- }
- }
-
- return resp, err
-}
-
-func (rw *remoteWriter) Status() (content.Status, error) {
- resp, err := rw.send(&contentapi.WriteContentRequest{
- Action: contentapi.WriteActionStat,
- })
- if err != nil {
- return content.Status{}, errors.Wrap(errdefs.FromGRPC(err), "error getting writer status")
- }
-
- return content.Status{
- Ref: rw.ref,
- Offset: resp.Offset,
- Total: resp.Total,
- StartedAt: resp.StartedAt,
- UpdatedAt: resp.UpdatedAt,
- }, nil
-}
-
-func (rw *remoteWriter) Digest() digest.Digest {
- return rw.digest
-}
-
-func (rw *remoteWriter) Write(p []byte) (n int, err error) {
- offset := rw.offset
-
- resp, err := rw.send(&contentapi.WriteContentRequest{
- Action: contentapi.WriteActionWrite,
- Offset: offset,
- Data: p,
- })
- if err != nil {
- return 0, errors.Wrap(errdefs.FromGRPC(err), "failed to send write")
- }
-
- n = int(resp.Offset - offset)
- if n < len(p) {
- err = io.ErrShortWrite
- }
-
- rw.offset += int64(n)
- if resp.Digest != "" {
- rw.digest = resp.Digest
- }
- return
-}
-
-func (rw *remoteWriter) Commit(ctx context.Context, size int64, expected digest.Digest, opts ...content.Opt) error {
- var base content.Info
- for _, opt := range opts {
- if err := opt(&base); err != nil {
- return err
- }
- }
- resp, err := rw.send(&contentapi.WriteContentRequest{
- Action: contentapi.WriteActionCommit,
- Total: size,
- Offset: rw.offset,
- Expected: expected,
- Labels: base.Labels,
- })
- if err != nil {
- return errors.Wrap(errdefs.FromGRPC(err), "commit failed")
- }
-
- if size != 0 && resp.Offset != size {
- return errors.Errorf("unexpected size: %v != %v", resp.Offset, size)
- }
-
- if expected != "" && resp.Digest != expected {
- return errors.Errorf("unexpected digest: %v != %v", resp.Digest, expected)
- }
-
- rw.digest = resp.Digest
- rw.offset = resp.Offset
- return nil
-}
-
-func (rw *remoteWriter) Truncate(size int64) error {
- // This truncation won't actually be validated until a write is issued.
- rw.offset = size
- return nil
-}
-
-func (rw *remoteWriter) Close() error {
- return rw.client.CloseSend()
-}
diff --git a/vendor/github.com/containerd/containerd/contrib/README.md b/vendor/github.com/containerd/containerd/contrib/README.md
deleted file mode 100644
index f19f03a60..000000000
--- a/vendor/github.com/containerd/containerd/contrib/README.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# contrib
-
-The `contrib` directory contains packages that do not belong in the core containerd packages but still contribute to overall containerd usability.
-
-Package such as Apparmor or Selinux are placed in `contrib` because they are platform dependent and often require higher level tools and profiles to work.
-
-Packaging and other built tools can be added to `contrib` to aid in packaging containerd for various distributions.
-
-## Testing
-
-Code in the `contrib` directory may or may not have been tested in the normal test pipeline for core components.
diff --git a/vendor/github.com/containerd/containerd/contrib/apparmor/apparmor.go b/vendor/github.com/containerd/containerd/contrib/apparmor/apparmor.go
deleted file mode 100644
index 5ebfee2af..000000000
--- a/vendor/github.com/containerd/containerd/contrib/apparmor/apparmor.go
+++ /dev/null
@@ -1,73 +0,0 @@
-// +build linux
-
-/*
- 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 apparmor
-
-import (
- "context"
- "io/ioutil"
- "os"
-
- "github.com/containerd/containerd/containers"
- "github.com/containerd/containerd/oci"
- specs "github.com/opencontainers/runtime-spec/specs-go"
- "github.com/pkg/errors"
-)
-
-// WithProfile sets the provided apparmor profile to the spec
-func WithProfile(profile string) oci.SpecOpts {
- return func(_ context.Context, _ oci.Client, _ *containers.Container, s *specs.Spec) error {
- s.Process.ApparmorProfile = profile
- return nil
- }
-}
-
-// WithDefaultProfile will generate a default apparmor profile under the provided name
-// for the container. It is only generated if a profile under that name does not exist.
-func WithDefaultProfile(name string) oci.SpecOpts {
- return func(_ context.Context, _ oci.Client, _ *containers.Container, s *specs.Spec) error {
- yes, err := isLoaded(name)
- if err != nil {
- return err
- }
- if yes {
- s.Process.ApparmorProfile = name
- return nil
- }
- p, err := loadData(name)
- if err != nil {
- return err
- }
- f, err := ioutil.TempFile(os.Getenv("XDG_RUNTIME_DIR"), p.Name)
- if err != nil {
- return err
- }
- defer f.Close()
- path := f.Name()
- defer os.Remove(path)
-
- if err := generate(p, f); err != nil {
- return err
- }
- if err := load(path); err != nil {
- return errors.Wrapf(err, "load apparmor profile %s", path)
- }
- s.Process.ApparmorProfile = name
- return nil
- }
-}
diff --git a/vendor/github.com/containerd/containerd/contrib/apparmor/apparmor_unsupported.go b/vendor/github.com/containerd/containerd/contrib/apparmor/apparmor_unsupported.go
deleted file mode 100644
index 0429954ea..000000000
--- a/vendor/github.com/containerd/containerd/contrib/apparmor/apparmor_unsupported.go
+++ /dev/null
@@ -1,43 +0,0 @@
-// +build !linux
-
-/*
- 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 apparmor
-
-import (
- "context"
-
- "github.com/containerd/containerd/containers"
- "github.com/containerd/containerd/oci"
- specs "github.com/opencontainers/runtime-spec/specs-go"
- "github.com/pkg/errors"
-)
-
-// WithProfile sets the provided apparmor profile to the spec
-func WithProfile(profile string) oci.SpecOpts {
- return func(_ context.Context, _ oci.Client, _ *containers.Container, s *specs.Spec) error {
- return errors.New("apparmor is not supported")
- }
-}
-
-// WithDefaultProfile will generate a default apparmor profile under the provided name
-// for the container. It is only generated if a profile under that name does not exist.
-func WithDefaultProfile(name string) oci.SpecOpts {
- return func(_ context.Context, _ oci.Client, _ *containers.Container, s *specs.Spec) error {
- return errors.New("apparmor is not supported")
- }
-}
diff --git a/vendor/github.com/containerd/containerd/contrib/apparmor/template.go b/vendor/github.com/containerd/containerd/contrib/apparmor/template.go
deleted file mode 100644
index 34ff99246..000000000
--- a/vendor/github.com/containerd/containerd/contrib/apparmor/template.go
+++ /dev/null
@@ -1,209 +0,0 @@
-// +build linux
-
-/*
- 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 apparmor
-
-import (
- "bufio"
- "fmt"
- "io"
- "os"
- "os/exec"
- "path"
- "strconv"
- "strings"
- "text/template"
-
- "github.com/pkg/errors"
-)
-
-const dir = "/etc/apparmor.d"
-
-const defaultTemplate = `
-{{range $value := .Imports}}
-{{$value}}
-{{end}}
-
-profile {{.Name}} flags=(attach_disconnected,mediate_deleted) {
-{{range $value := .InnerImports}}
- {{$value}}
-{{end}}
-
- network,
- capability,
- file,
- umount,
-
- deny @{PROC}/* w, # deny write for all files directly in /proc (not in a subdir)
- # deny write to files not in /proc//** or /proc/sys/**
- deny @{PROC}/{[^1-9],[^1-9][^0-9],[^1-9s][^0-9y][^0-9s],[^1-9][^0-9][^0-9][^0-9]*}/** w,
- deny @{PROC}/sys/[^k]** w, # deny /proc/sys except /proc/sys/k* (effectively /proc/sys/kernel)
- deny @{PROC}/sys/kernel/{?,??,[^s][^h][^m]**} w, # deny everything except shm* in /proc/sys/kernel/
- deny @{PROC}/sysrq-trigger rwklx,
- deny @{PROC}/mem rwklx,
- deny @{PROC}/kmem rwklx,
- deny @{PROC}/kcore rwklx,
-
- deny mount,
-
- deny /sys/[^f]*/** wklx,
- deny /sys/f[^s]*/** wklx,
- deny /sys/fs/[^c]*/** wklx,
- deny /sys/fs/c[^g]*/** wklx,
- deny /sys/fs/cg[^r]*/** wklx,
- deny /sys/firmware/** rwklx,
- deny /sys/kernel/security/** rwklx,
-
-{{if ge .Version 208095}}
- ptrace (trace,read) peer={{.Name}},
-{{end}}
-}
-`
-
-type data struct {
- Name string
- Imports []string
- InnerImports []string
- Version int
-}
-
-func loadData(name string) (*data, error) {
- p := data{
- Name: name,
- }
-
- if macroExists("tunables/global") {
- p.Imports = append(p.Imports, "#include ")
- } else {
- p.Imports = append(p.Imports, "@{PROC}=/proc/")
- }
- if macroExists("abstractions/base") {
- p.InnerImports = append(p.InnerImports, "#include ")
- }
- ver, err := getVersion()
- if err != nil {
- return nil, errors.Wrap(err, "get apparmor_parser version")
- }
- p.Version = ver
- return &p, nil
-}
-
-func generate(p *data, o io.Writer) error {
- t, err := template.New("apparmor_profile").Parse(defaultTemplate)
- if err != nil {
- return err
- }
- return t.Execute(o, p)
-}
-
-func load(path string) error {
- out, err := aaParser("-Kr", path)
- if err != nil {
- return errors.Errorf("%s: %s", err, out)
- }
- return nil
-}
-
-// macrosExists checks if the passed macro exists.
-func macroExists(m string) bool {
- _, err := os.Stat(path.Join(dir, m))
- return err == nil
-}
-
-func aaParser(args ...string) (string, error) {
- out, err := exec.Command("apparmor_parser", args...).CombinedOutput()
- if err != nil {
- return "", err
- }
- return string(out), nil
-}
-
-func getVersion() (int, error) {
- out, err := aaParser("--version")
- if err != nil {
- return -1, err
- }
- return parseVersion(out)
-}
-
-// parseVersion takes the output from `apparmor_parser --version` and returns
-// a representation of the {major, minor, patch} version as a single number of
-// the form MMmmPPP {major, minor, patch}.
-func parseVersion(output string) (int, error) {
- // output is in the form of the following:
- // AppArmor parser version 2.9.1
- // Copyright (C) 1999-2008 Novell Inc.
- // Copyright 2009-2012 Canonical Ltd.
-
- lines := strings.SplitN(output, "\n", 2)
- words := strings.Split(lines[0], " ")
- version := words[len(words)-1]
-
- // split by major minor version
- v := strings.Split(version, ".")
- if len(v) == 0 || len(v) > 3 {
- return -1, fmt.Errorf("parsing version failed for output: `%s`", output)
- }
-
- // Default the versions to 0.
- var majorVersion, minorVersion, patchLevel int
-
- majorVersion, err := strconv.Atoi(v[0])
- if err != nil {
- return -1, err
- }
-
- if len(v) > 1 {
- minorVersion, err = strconv.Atoi(v[1])
- if err != nil {
- return -1, err
- }
- }
- if len(v) > 2 {
- patchLevel, err = strconv.Atoi(v[2])
- if err != nil {
- return -1, err
- }
- }
-
- // major*10^5 + minor*10^3 + patch*10^0
- numericVersion := majorVersion*1e5 + minorVersion*1e3 + patchLevel
- return numericVersion, nil
-}
-
-func isLoaded(name string) (bool, error) {
- f, err := os.Open("/sys/kernel/security/apparmor/profiles")
- if err != nil {
- return false, err
- }
- defer f.Close()
- r := bufio.NewReader(f)
- for {
- p, err := r.ReadString('\n')
- if err == io.EOF {
- break
- }
- if err != nil {
- return false, err
- }
- if strings.HasPrefix(p, name+" ") {
- return true, nil
- }
- }
- return false, nil
-}
diff --git a/vendor/github.com/containerd/containerd/contrib/seccomp/seccomp.go b/vendor/github.com/containerd/containerd/contrib/seccomp/seccomp.go
deleted file mode 100644
index b7cf1765d..000000000
--- a/vendor/github.com/containerd/containerd/contrib/seccomp/seccomp.go
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package seccomp
-
-import (
- "context"
- "encoding/json"
- "fmt"
- "io/ioutil"
-
- "github.com/containerd/containerd/containers"
- "github.com/containerd/containerd/oci"
- "github.com/opencontainers/runtime-spec/specs-go"
-)
-
-// WithProfile receives the name of a file stored on disk comprising a json
-// formatted seccomp profile, as specified by the opencontainers/runtime-spec.
-// The profile is read from the file, unmarshaled, and set to the spec.
-func WithProfile(profile string) oci.SpecOpts {
- return func(_ context.Context, _ oci.Client, _ *containers.Container, s *specs.Spec) error {
- s.Linux.Seccomp = &specs.LinuxSeccomp{}
- f, err := ioutil.ReadFile(profile)
- if err != nil {
- return fmt.Errorf("cannot load seccomp profile %q: %v", profile, err)
- }
- if err := json.Unmarshal(f, s.Linux.Seccomp); err != nil {
- return fmt.Errorf("decoding seccomp profile failed %q: %v", profile, err)
- }
- return nil
- }
-}
-
-// WithDefaultProfile sets the default seccomp profile to the spec.
-// Note: must follow the setting of process capabilities
-func WithDefaultProfile() oci.SpecOpts {
- return func(_ context.Context, _ oci.Client, _ *containers.Container, s *specs.Spec) error {
- s.Linux.Seccomp = DefaultProfile(s)
- return nil
- }
-}
diff --git a/vendor/github.com/containerd/containerd/contrib/seccomp/seccomp_default.go b/vendor/github.com/containerd/containerd/contrib/seccomp/seccomp_default.go
deleted file mode 100644
index f1337e6db..000000000
--- a/vendor/github.com/containerd/containerd/contrib/seccomp/seccomp_default.go
+++ /dev/null
@@ -1,651 +0,0 @@
-// +build linux
-
-/*
- 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 seccomp
-
-import (
- "runtime"
-
- "golang.org/x/sys/unix"
-
- "github.com/opencontainers/runtime-spec/specs-go"
-)
-
-func arches() []specs.Arch {
- switch runtime.GOARCH {
- case "amd64":
- return []specs.Arch{specs.ArchX86_64, specs.ArchX86, specs.ArchX32}
- case "arm64":
- return []specs.Arch{specs.ArchARM, specs.ArchAARCH64}
- case "mips64":
- return []specs.Arch{specs.ArchMIPS, specs.ArchMIPS64, specs.ArchMIPS64N32}
- case "mips64n32":
- return []specs.Arch{specs.ArchMIPS, specs.ArchMIPS64, specs.ArchMIPS64N32}
- case "mipsel64":
- return []specs.Arch{specs.ArchMIPSEL, specs.ArchMIPSEL64, specs.ArchMIPSEL64N32}
- case "mipsel64n32":
- return []specs.Arch{specs.ArchMIPSEL, specs.ArchMIPSEL64, specs.ArchMIPSEL64N32}
- case "s390x":
- return []specs.Arch{specs.ArchS390, specs.ArchS390X}
- default:
- return []specs.Arch{}
- }
-}
-
-// DefaultProfile defines the allowed syscalls for the default seccomp profile.
-func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
- syscalls := []specs.LinuxSyscall{
- {
- Names: []string{
- "accept",
- "accept4",
- "access",
- "adjtimex",
- "alarm",
- "bind",
- "brk",
- "capget",
- "capset",
- "chdir",
- "chmod",
- "chown",
- "chown32",
- "clock_adjtime",
- "clock_adjtime64",
- "clock_getres",
- "clock_getres_time64",
- "clock_gettime",
- "clock_gettime64",
- "clock_nanosleep",
- "clock_nanosleep_time64",
- "close",
- "connect",
- "copy_file_range",
- "creat",
- "dup",
- "dup2",
- "dup3",
- "epoll_create",
- "epoll_create1",
- "epoll_ctl",
- "epoll_ctl_old",
- "epoll_pwait",
- "epoll_wait",
- "epoll_wait_old",
- "eventfd",
- "eventfd2",
- "execve",
- "execveat",
- "exit",
- "exit_group",
- "faccessat",
- "faccessat2",
- "fadvise64",
- "fadvise64_64",
- "fallocate",
- "fanotify_mark",
- "fchdir",
- "fchmod",
- "fchmodat",
- "fchown",
- "fchown32",
- "fchownat",
- "fcntl",
- "fcntl64",
- "fdatasync",
- "fgetxattr",
- "flistxattr",
- "flock",
- "fork",
- "fremovexattr",
- "fsetxattr",
- "fstat",
- "fstat64",
- "fstatat64",
- "fstatfs",
- "fstatfs64",
- "fsync",
- "ftruncate",
- "ftruncate64",
- "futex",
- "futex_time64",
- "futimesat",
- "getcpu",
- "getcwd",
- "getdents",
- "getdents64",
- "getegid",
- "getegid32",
- "geteuid",
- "geteuid32",
- "getgid",
- "getgid32",
- "getgroups",
- "getgroups32",
- "getitimer",
- "getpeername",
- "getpgid",
- "getpgrp",
- "getpid",
- "getppid",
- "getpriority",
- "getrandom",
- "getresgid",
- "getresgid32",
- "getresuid",
- "getresuid32",
- "getrlimit",
- "get_robust_list",
- "getrusage",
- "getsid",
- "getsockname",
- "getsockopt",
- "get_thread_area",
- "gettid",
- "gettimeofday",
- "getuid",
- "getuid32",
- "getxattr",
- "inotify_add_watch",
- "inotify_init",
- "inotify_init1",
- "inotify_rm_watch",
- "io_cancel",
- "ioctl",
- "io_destroy",
- "io_getevents",
- "io_pgetevents",
- "io_pgetevents_time64",
- "ioprio_get",
- "ioprio_set",
- "io_setup",
- "io_submit",
- "io_uring_enter",
- "io_uring_register",
- "io_uring_setup",
- "ipc",
- "kill",
- "lchown",
- "lchown32",
- "lgetxattr",
- "link",
- "linkat",
- "listen",
- "listxattr",
- "llistxattr",
- "_llseek",
- "lremovexattr",
- "lseek",
- "lsetxattr",
- "lstat",
- "lstat64",
- "madvise",
- "membarrier",
- "memfd_create",
- "mincore",
- "mkdir",
- "mkdirat",
- "mknod",
- "mknodat",
- "mlock",
- "mlock2",
- "mlockall",
- "mmap",
- "mmap2",
- "mprotect",
- "mq_getsetattr",
- "mq_notify",
- "mq_open",
- "mq_timedreceive",
- "mq_timedreceive_time64",
- "mq_timedsend",
- "mq_timedsend_time64",
- "mq_unlink",
- "mremap",
- "msgctl",
- "msgget",
- "msgrcv",
- "msgsnd",
- "msync",
- "munlock",
- "munlockall",
- "munmap",
- "nanosleep",
- "newfstatat",
- "_newselect",
- "open",
- "openat",
- "openat2",
- "pause",
- "pipe",
- "pipe2",
- "poll",
- "ppoll",
- "ppoll_time64",
- "prctl",
- "pread64",
- "preadv",
- "preadv2",
- "prlimit64",
- "pselect6",
- "pselect6_time64",
- "pwrite64",
- "pwritev",
- "pwritev2",
- "read",
- "readahead",
- "readlink",
- "readlinkat",
- "readv",
- "recv",
- "recvfrom",
- "recvmmsg",
- "recvmmsg_time64",
- "recvmsg",
- "remap_file_pages",
- "removexattr",
- "rename",
- "renameat",
- "renameat2",
- "restart_syscall",
- "rmdir",
- "rseq",
- "rt_sigaction",
- "rt_sigpending",
- "rt_sigprocmask",
- "rt_sigqueueinfo",
- "rt_sigreturn",
- "rt_sigsuspend",
- "rt_sigtimedwait",
- "rt_sigtimedwait_time64",
- "rt_tgsigqueueinfo",
- "sched_getaffinity",
- "sched_getattr",
- "sched_getparam",
- "sched_get_priority_max",
- "sched_get_priority_min",
- "sched_getscheduler",
- "sched_rr_get_interval",
- "sched_rr_get_interval_time64",
- "sched_setaffinity",
- "sched_setattr",
- "sched_setparam",
- "sched_setscheduler",
- "sched_yield",
- "seccomp",
- "select",
- "semctl",
- "semget",
- "semop",
- "semtimedop",
- "semtimedop_time64",
- "send",
- "sendfile",
- "sendfile64",
- "sendmmsg",
- "sendmsg",
- "sendto",
- "setfsgid",
- "setfsgid32",
- "setfsuid",
- "setfsuid32",
- "setgid",
- "setgid32",
- "setgroups",
- "setgroups32",
- "setitimer",
- "setpgid",
- "setpriority",
- "setregid",
- "setregid32",
- "setresgid",
- "setresgid32",
- "setresuid",
- "setresuid32",
- "setreuid",
- "setreuid32",
- "setrlimit",
- "set_robust_list",
- "setsid",
- "setsockopt",
- "set_thread_area",
- "set_tid_address",
- "setuid",
- "setuid32",
- "setxattr",
- "shmat",
- "shmctl",
- "shmdt",
- "shmget",
- "shutdown",
- "sigaltstack",
- "signalfd",
- "signalfd4",
- "sigprocmask",
- "sigreturn",
- "socket",
- "socketcall",
- "socketpair",
- "splice",
- "stat",
- "stat64",
- "statfs",
- "statfs64",
- "statx",
- "symlink",
- "symlinkat",
- "sync",
- "sync_file_range",
- "syncfs",
- "sysinfo",
- "tee",
- "tgkill",
- "time",
- "timer_create",
- "timer_delete",
- "timer_getoverrun",
- "timer_gettime",
- "timer_gettime64",
- "timer_settime",
- "timer_settime64",
- "timerfd_create",
- "timerfd_gettime",
- "timerfd_gettime64",
- "timerfd_settime",
- "timerfd_settime64",
- "times",
- "tkill",
- "truncate",
- "truncate64",
- "ugetrlimit",
- "umask",
- "uname",
- "unlink",
- "unlinkat",
- "utime",
- "utimensat",
- "utimensat_time64",
- "utimes",
- "vfork",
- "vmsplice",
- "wait4",
- "waitid",
- "waitpid",
- "write",
- "writev",
- },
- Action: specs.ActAllow,
- Args: []specs.LinuxSeccompArg{},
- },
- {
- Names: []string{"personality"},
- Action: specs.ActAllow,
- Args: []specs.LinuxSeccompArg{
- {
- Index: 0,
- Value: 0x0,
- Op: specs.OpEqualTo,
- },
- },
- },
- {
- Names: []string{"personality"},
- Action: specs.ActAllow,
- Args: []specs.LinuxSeccompArg{
- {
- Index: 0,
- Value: 0x0008,
- Op: specs.OpEqualTo,
- },
- },
- },
- {
- Names: []string{"personality"},
- Action: specs.ActAllow,
- Args: []specs.LinuxSeccompArg{
- {
- Index: 0,
- Value: 0x20000,
- Op: specs.OpEqualTo,
- },
- },
- },
- {
- Names: []string{"personality"},
- Action: specs.ActAllow,
- Args: []specs.LinuxSeccompArg{
- {
- Index: 0,
- Value: 0x20008,
- Op: specs.OpEqualTo,
- },
- },
- },
- {
- Names: []string{"personality"},
- Action: specs.ActAllow,
- Args: []specs.LinuxSeccompArg{
- {
- Index: 0,
- Value: 0xffffffff,
- Op: specs.OpEqualTo,
- },
- },
- },
- }
-
- s := &specs.LinuxSeccomp{
- DefaultAction: specs.ActErrno,
- Architectures: arches(),
- Syscalls: syscalls,
- }
-
- // include by arch
- switch runtime.GOARCH {
- case "ppc64le":
- s.Syscalls = append(s.Syscalls, specs.LinuxSyscall{
- Names: []string{
- "sync_file_range2",
- },
- Action: specs.ActAllow,
- Args: []specs.LinuxSeccompArg{},
- })
- case "arm", "arm64":
- s.Syscalls = append(s.Syscalls, specs.LinuxSyscall{
- Names: []string{
- "arm_fadvise64_64",
- "arm_sync_file_range",
- "sync_file_range2",
- "breakpoint",
- "cacheflush",
- "set_tls",
- },
- Action: specs.ActAllow,
- Args: []specs.LinuxSeccompArg{},
- })
- case "amd64":
- s.Syscalls = append(s.Syscalls, specs.LinuxSyscall{
- Names: []string{
- "arch_prctl",
- "modify_ldt",
- },
- Action: specs.ActAllow,
- Args: []specs.LinuxSeccompArg{},
- })
- case "386":
- s.Syscalls = append(s.Syscalls, specs.LinuxSyscall{
- Names: []string{
- "modify_ldt",
- },
- Action: specs.ActAllow,
- Args: []specs.LinuxSeccompArg{},
- })
- case "s390", "s390x":
- s.Syscalls = append(s.Syscalls, specs.LinuxSyscall{
- Names: []string{
- "s390_pci_mmio_read",
- "s390_pci_mmio_write",
- "s390_runtime_instr",
- },
- Action: specs.ActAllow,
- Args: []specs.LinuxSeccompArg{},
- })
- }
-
- admin := false
- for _, c := range sp.Process.Capabilities.Bounding {
- switch c {
- case "CAP_DAC_READ_SEARCH":
- s.Syscalls = append(s.Syscalls, specs.LinuxSyscall{
- Names: []string{"open_by_handle_at"},
- Action: specs.ActAllow,
- Args: []specs.LinuxSeccompArg{},
- })
- case "CAP_SYS_ADMIN":
- admin = true
- s.Syscalls = append(s.Syscalls, specs.LinuxSyscall{
- Names: []string{
- "bpf",
- "clone",
- "fanotify_init",
- "lookup_dcookie",
- "mount",
- "name_to_handle_at",
- "perf_event_open",
- "quotactl",
- "setdomainname",
- "sethostname",
- "setns",
- "syslog",
- "umount",
- "umount2",
- "unshare",
- },
- Action: specs.ActAllow,
- Args: []specs.LinuxSeccompArg{},
- })
- case "CAP_SYS_BOOT":
- s.Syscalls = append(s.Syscalls, specs.LinuxSyscall{
- Names: []string{"reboot"},
- Action: specs.ActAllow,
- Args: []specs.LinuxSeccompArg{},
- })
- case "CAP_SYS_CHROOT":
- s.Syscalls = append(s.Syscalls, specs.LinuxSyscall{
- Names: []string{"chroot"},
- Action: specs.ActAllow,
- Args: []specs.LinuxSeccompArg{},
- })
- case "CAP_SYS_MODULE":
- s.Syscalls = append(s.Syscalls, specs.LinuxSyscall{
- Names: []string{
- "delete_module",
- "init_module",
- "finit_module",
- },
- Action: specs.ActAllow,
- Args: []specs.LinuxSeccompArg{},
- })
- case "CAP_SYS_PACCT":
- s.Syscalls = append(s.Syscalls, specs.LinuxSyscall{
- Names: []string{"acct"},
- Action: specs.ActAllow,
- Args: []specs.LinuxSeccompArg{},
- })
- case "CAP_SYS_PTRACE":
- s.Syscalls = append(s.Syscalls, specs.LinuxSyscall{
- Names: []string{
- "kcmp",
- "process_vm_readv",
- "process_vm_writev",
- "ptrace",
- },
- Action: specs.ActAllow,
- Args: []specs.LinuxSeccompArg{},
- })
- case "CAP_SYS_RAWIO":
- s.Syscalls = append(s.Syscalls, specs.LinuxSyscall{
- Names: []string{
- "iopl",
- "ioperm",
- },
- Action: specs.ActAllow,
- Args: []specs.LinuxSeccompArg{},
- })
- case "CAP_SYS_TIME":
- s.Syscalls = append(s.Syscalls, specs.LinuxSyscall{
- Names: []string{
- "settimeofday",
- "stime",
- "clock_settime",
- },
- Action: specs.ActAllow,
- Args: []specs.LinuxSeccompArg{},
- })
- case "CAP_SYS_TTY_CONFIG":
- s.Syscalls = append(s.Syscalls, specs.LinuxSyscall{
- Names: []string{"vhangup"},
- Action: specs.ActAllow,
- Args: []specs.LinuxSeccompArg{},
- })
- case "CAP_SYSLOG":
- s.Syscalls = append(s.Syscalls, specs.LinuxSyscall{
- Names: []string{"syslog"},
- Action: specs.ActAllow,
- Args: []specs.LinuxSeccompArg{},
- })
- }
- }
-
- if !admin {
- switch runtime.GOARCH {
- case "s390", "s390x":
- s.Syscalls = append(s.Syscalls, specs.LinuxSyscall{
- Names: []string{
- "clone",
- },
- Action: specs.ActAllow,
- Args: []specs.LinuxSeccompArg{
- {
- Index: 1,
- Value: unix.CLONE_NEWNS | unix.CLONE_NEWUTS | unix.CLONE_NEWIPC | unix.CLONE_NEWUSER | unix.CLONE_NEWPID | unix.CLONE_NEWNET | unix.CLONE_NEWCGROUP,
- ValueTwo: 0,
- Op: specs.OpMaskedEqual,
- },
- },
- })
- default:
- s.Syscalls = append(s.Syscalls, specs.LinuxSyscall{
- Names: []string{
- "clone",
- },
- Action: specs.ActAllow,
- Args: []specs.LinuxSeccompArg{
- {
- Index: 0,
- Value: unix.CLONE_NEWNS | unix.CLONE_NEWUTS | unix.CLONE_NEWIPC | unix.CLONE_NEWUSER | unix.CLONE_NEWPID | unix.CLONE_NEWNET | unix.CLONE_NEWCGROUP,
- ValueTwo: 0,
- Op: specs.OpMaskedEqual,
- },
- },
- })
- }
- }
-
- return s
-}
diff --git a/vendor/github.com/containerd/containerd/contrib/seccomp/seccomp_default_unsupported.go b/vendor/github.com/containerd/containerd/contrib/seccomp/seccomp_default_unsupported.go
deleted file mode 100644
index 6d7051058..000000000
--- a/vendor/github.com/containerd/containerd/contrib/seccomp/seccomp_default_unsupported.go
+++ /dev/null
@@ -1,26 +0,0 @@
-// +build !linux
-
-/*
- 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 seccomp
-
-import specs "github.com/opencontainers/runtime-spec/specs-go"
-
-// DefaultProfile defines the allowed syscalls for the default seccomp profile.
-func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
- return &specs.LinuxSeccomp{}
-}
diff --git a/vendor/github.com/containerd/containerd/defaults/defaults.go b/vendor/github.com/containerd/containerd/defaults/defaults.go
deleted file mode 100644
index 6f5b122ec..000000000
--- a/vendor/github.com/containerd/containerd/defaults/defaults.go
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package defaults
-
-const (
- // DefaultMaxRecvMsgSize defines the default maximum message size for
- // receiving protobufs passed over the GRPC API.
- DefaultMaxRecvMsgSize = 16 << 20
- // DefaultMaxSendMsgSize defines the default maximum message size for
- // sending protobufs passed over the GRPC API.
- DefaultMaxSendMsgSize = 16 << 20
- // DefaultRuntimeNSLabel defines the namespace label to check for the
- // default runtime
- DefaultRuntimeNSLabel = "containerd.io/defaults/runtime"
- // DefaultSnapshotterNSLabel defines the namespace label to check for the
- // default snapshotter
- DefaultSnapshotterNSLabel = "containerd.io/defaults/snapshotter"
-)
diff --git a/vendor/github.com/containerd/containerd/defaults/defaults_unix.go b/vendor/github.com/containerd/containerd/defaults/defaults_unix.go
deleted file mode 100644
index 319e8777b..000000000
--- a/vendor/github.com/containerd/containerd/defaults/defaults_unix.go
+++ /dev/null
@@ -1,37 +0,0 @@
-// +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 defaults
-
-const (
- // DefaultRootDir is the default location used by containerd to store
- // persistent data
- DefaultRootDir = "/var/lib/containerd"
- // DefaultStateDir is the default location used by containerd to store
- // transient data
- DefaultStateDir = "/run/containerd"
- // DefaultAddress is the default unix socket address
- DefaultAddress = "/run/containerd/containerd.sock"
- // DefaultDebugAddress is the default unix socket address for pprof data
- DefaultDebugAddress = "/run/containerd/debug.sock"
- // DefaultFIFODir is the default location used by client-side cio library
- // to store FIFOs.
- DefaultFIFODir = "/run/containerd/fifo"
- // DefaultRuntime is the default linux runtime
- DefaultRuntime = "io.containerd.runc.v2"
-)
diff --git a/vendor/github.com/containerd/containerd/defaults/defaults_windows.go b/vendor/github.com/containerd/containerd/defaults/defaults_windows.go
deleted file mode 100644
index 5eede8de8..000000000
--- a/vendor/github.com/containerd/containerd/defaults/defaults_windows.go
+++ /dev/null
@@ -1,45 +0,0 @@
-// +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 defaults
-
-import (
- "os"
- "path/filepath"
-)
-
-var (
- // DefaultRootDir is the default location used by containerd to store
- // persistent data
- DefaultRootDir = filepath.Join(os.Getenv("ProgramData"), "containerd", "root")
- // DefaultStateDir is the default location used by containerd to store
- // transient data
- DefaultStateDir = filepath.Join(os.Getenv("ProgramData"), "containerd", "state")
-)
-
-const (
- // DefaultAddress is the default winpipe address
- DefaultAddress = `\\.\pipe\containerd-containerd`
- // DefaultDebugAddress is the default winpipe address for pprof data
- DefaultDebugAddress = `\\.\pipe\containerd-debug`
- // DefaultFIFODir is the default location used by client-side cio library
- // to store FIFOs. Unused on Windows.
- DefaultFIFODir = ""
- // DefaultRuntime is the default windows runtime
- DefaultRuntime = "io.containerd.runhcs.v1"
-)
diff --git a/vendor/github.com/containerd/containerd/defaults/doc.go b/vendor/github.com/containerd/containerd/defaults/doc.go
deleted file mode 100644
index 6da863ce2..000000000
--- a/vendor/github.com/containerd/containerd/defaults/doc.go
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-// Package defaults provides several common defaults for interacting with
-// containerd. These can be used on the client-side or server-side.
-package defaults
diff --git a/vendor/github.com/containerd/containerd/diff.go b/vendor/github.com/containerd/containerd/diff.go
deleted file mode 100644
index 445df0192..000000000
--- a/vendor/github.com/containerd/containerd/diff.go
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package containerd
-
-import (
- "context"
-
- diffapi "github.com/containerd/containerd/api/services/diff/v1"
- "github.com/containerd/containerd/api/types"
- "github.com/containerd/containerd/diff"
- "github.com/containerd/containerd/errdefs"
- "github.com/containerd/containerd/mount"
- ocispec "github.com/opencontainers/image-spec/specs-go/v1"
-)
-
-// DiffService handles the computation and application of diffs
-type DiffService interface {
- diff.Comparer
- diff.Applier
-}
-
-// NewDiffServiceFromClient returns a new diff service which communicates
-// over a GRPC connection.
-func NewDiffServiceFromClient(client diffapi.DiffClient) DiffService {
- return &diffRemote{
- client: client,
- }
-}
-
-type diffRemote struct {
- client diffapi.DiffClient
-}
-
-func (r *diffRemote) Apply(ctx context.Context, desc ocispec.Descriptor, mounts []mount.Mount, opts ...diff.ApplyOpt) (ocispec.Descriptor, error) {
- var config diff.ApplyConfig
- for _, opt := range opts {
- if err := opt(ctx, desc, &config); err != nil {
- return ocispec.Descriptor{}, err
- }
- }
- req := &diffapi.ApplyRequest{
- Diff: fromDescriptor(desc),
- Mounts: fromMounts(mounts),
- Payloads: config.ProcessorPayloads,
- }
- resp, err := r.client.Apply(ctx, req)
- if err != nil {
- return ocispec.Descriptor{}, errdefs.FromGRPC(err)
- }
- return toDescriptor(resp.Applied), nil
-}
-
-func (r *diffRemote) Compare(ctx context.Context, a, b []mount.Mount, opts ...diff.Opt) (ocispec.Descriptor, error) {
- var config diff.Config
- for _, opt := range opts {
- if err := opt(&config); err != nil {
- return ocispec.Descriptor{}, err
- }
- }
- req := &diffapi.DiffRequest{
- Left: fromMounts(a),
- Right: fromMounts(b),
- MediaType: config.MediaType,
- Ref: config.Reference,
- Labels: config.Labels,
- }
- resp, err := r.client.Diff(ctx, req)
- if err != nil {
- return ocispec.Descriptor{}, errdefs.FromGRPC(err)
- }
- return toDescriptor(resp.Diff), nil
-}
-
-func toDescriptor(d *types.Descriptor) ocispec.Descriptor {
- return ocispec.Descriptor{
- MediaType: d.MediaType,
- Digest: d.Digest,
- Size: d.Size_,
- Annotations: d.Annotations,
- }
-}
-
-func fromDescriptor(d ocispec.Descriptor) *types.Descriptor {
- return &types.Descriptor{
- MediaType: d.MediaType,
- Digest: d.Digest,
- Size_: d.Size,
- Annotations: d.Annotations,
- }
-}
-
-func fromMounts(mounts []mount.Mount) []*types.Mount {
- apiMounts := make([]*types.Mount, len(mounts))
- for i, m := range mounts {
- apiMounts[i] = &types.Mount{
- Type: m.Type,
- Source: m.Source,
- Options: m.Options,
- }
- }
- return apiMounts
-}
diff --git a/vendor/github.com/containerd/containerd/diff/apply/apply.go b/vendor/github.com/containerd/containerd/diff/apply/apply.go
deleted file mode 100644
index ce89daaf2..000000000
--- a/vendor/github.com/containerd/containerd/diff/apply/apply.go
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package apply
-
-import (
- "context"
- "io"
- "io/ioutil"
- "time"
-
- "github.com/containerd/containerd/content"
- "github.com/containerd/containerd/diff"
- "github.com/containerd/containerd/log"
- "github.com/containerd/containerd/mount"
- digest "github.com/opencontainers/go-digest"
- ocispec "github.com/opencontainers/image-spec/specs-go/v1"
- "github.com/pkg/errors"
- "github.com/sirupsen/logrus"
-)
-
-// NewFileSystemApplier returns an applier which simply mounts
-// and applies diff onto the mounted filesystem.
-func NewFileSystemApplier(cs content.Provider) diff.Applier {
- return &fsApplier{
- store: cs,
- }
-}
-
-type fsApplier struct {
- store content.Provider
-}
-
-var emptyDesc = ocispec.Descriptor{}
-
-// Apply applies the content associated with the provided digests onto the
-// provided mounts. Archive content will be extracted and decompressed if
-// necessary.
-func (s *fsApplier) Apply(ctx context.Context, desc ocispec.Descriptor, mounts []mount.Mount, opts ...diff.ApplyOpt) (d ocispec.Descriptor, err error) {
- t1 := time.Now()
- defer func() {
- if err == nil {
- log.G(ctx).WithFields(logrus.Fields{
- "d": time.Since(t1),
- "dgst": desc.Digest,
- "size": desc.Size,
- "media": desc.MediaType,
- }).Debugf("diff applied")
- }
- }()
-
- var config diff.ApplyConfig
- for _, o := range opts {
- if err := o(ctx, desc, &config); err != nil {
- return emptyDesc, errors.Wrap(err, "failed to apply config opt")
- }
- }
-
- ra, err := s.store.ReaderAt(ctx, desc)
- if err != nil {
- return emptyDesc, errors.Wrap(err, "failed to get reader from content store")
- }
- defer ra.Close()
-
- var processors []diff.StreamProcessor
- processor := diff.NewProcessorChain(desc.MediaType, content.NewReader(ra))
- processors = append(processors, processor)
- for {
- if processor, err = diff.GetProcessor(ctx, processor, config.ProcessorPayloads); err != nil {
- return emptyDesc, errors.Wrapf(err, "failed to get stream processor for %s", desc.MediaType)
- }
- processors = append(processors, processor)
- if processor.MediaType() == ocispec.MediaTypeImageLayer {
- break
- }
- }
- defer processor.Close()
-
- digester := digest.Canonical.Digester()
- rc := &readCounter{
- r: io.TeeReader(processor, digester.Hash()),
- }
-
- if err := apply(ctx, mounts, rc); err != nil {
- return emptyDesc, err
- }
-
- // Read any trailing data
- if _, err := io.Copy(ioutil.Discard, rc); err != nil {
- return emptyDesc, err
- }
-
- for _, p := range processors {
- if ep, ok := p.(interface {
- Err() error
- }); ok {
- if err := ep.Err(); err != nil {
- return emptyDesc, err
- }
- }
- }
- return ocispec.Descriptor{
- MediaType: ocispec.MediaTypeImageLayer,
- Size: rc.c,
- Digest: digester.Digest(),
- }, nil
-}
-
-type readCounter struct {
- r io.Reader
- c int64
-}
-
-func (rc *readCounter) Read(p []byte) (n int, err error) {
- n, err = rc.r.Read(p)
- rc.c += int64(n)
- return
-}
diff --git a/vendor/github.com/containerd/containerd/diff/apply/apply_linux.go b/vendor/github.com/containerd/containerd/diff/apply/apply_linux.go
deleted file mode 100644
index 5eeeced5c..000000000
--- a/vendor/github.com/containerd/containerd/diff/apply/apply_linux.go
+++ /dev/null
@@ -1,134 +0,0 @@
-// +build linux
-
-/*
- 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 apply
-
-import (
- "context"
- "io"
- "strings"
-
- "github.com/containerd/containerd/archive"
- "github.com/containerd/containerd/errdefs"
- "github.com/containerd/containerd/mount"
- "github.com/containerd/containerd/sys"
- "github.com/pkg/errors"
-)
-
-func apply(ctx context.Context, mounts []mount.Mount, r io.Reader) error {
- switch {
- case len(mounts) == 1 && mounts[0].Type == "overlay":
- // OverlayConvertWhiteout (mknod c 0 0) doesn't work in userns.
- // https://github.com/containerd/containerd/issues/3762
- if sys.RunningInUserNS() {
- break
- }
- path, parents, err := getOverlayPath(mounts[0].Options)
- if err != nil {
- if errdefs.IsInvalidArgument(err) {
- break
- }
- return err
- }
- opts := []archive.ApplyOpt{
- archive.WithConvertWhiteout(archive.OverlayConvertWhiteout),
- }
- if len(parents) > 0 {
- opts = append(opts, archive.WithParents(parents))
- }
- _, err = archive.Apply(ctx, path, r, opts...)
- return err
- case len(mounts) == 1 && mounts[0].Type == "aufs":
- path, parents, err := getAufsPath(mounts[0].Options)
- if err != nil {
- if errdefs.IsInvalidArgument(err) {
- break
- }
- return err
- }
- opts := []archive.ApplyOpt{
- archive.WithConvertWhiteout(archive.AufsConvertWhiteout),
- }
- if len(parents) > 0 {
- opts = append(opts, archive.WithParents(parents))
- }
- _, err = archive.Apply(ctx, path, r, opts...)
- return err
- }
- return mount.WithTempMount(ctx, mounts, func(root string) error {
- _, err := archive.Apply(ctx, root, r)
- return err
- })
-}
-
-func getOverlayPath(options []string) (upper string, lower []string, err error) {
- const upperdirPrefix = "upperdir="
- const lowerdirPrefix = "lowerdir="
-
- for _, o := range options {
- if strings.HasPrefix(o, upperdirPrefix) {
- upper = strings.TrimPrefix(o, upperdirPrefix)
- } else if strings.HasPrefix(o, lowerdirPrefix) {
- lower = strings.Split(strings.TrimPrefix(o, lowerdirPrefix), ":")
- }
- }
- if upper == "" {
- return "", nil, errors.Wrap(errdefs.ErrInvalidArgument, "upperdir not found")
- }
-
- return
-}
-
-// getAufsPath handles options as given by the containerd aufs package only,
-// formatted as "br:=rw[:=ro+wh]*"
-func getAufsPath(options []string) (upper string, lower []string, err error) {
- const (
- sep = ":"
- brPrefix = "br:"
- rwSuffix = "=rw"
- roSuffix = "=ro+wh"
- )
- for _, o := range options {
- if strings.HasPrefix(o, brPrefix) {
- o = strings.TrimPrefix(o, brPrefix)
- } else {
- continue
- }
-
- for _, b := range strings.Split(o, sep) {
- if strings.HasSuffix(b, rwSuffix) {
- if upper != "" {
- return "", nil, errors.Wrap(errdefs.ErrInvalidArgument, "multiple rw branch found")
- }
- upper = strings.TrimSuffix(b, rwSuffix)
- } else if strings.HasSuffix(b, roSuffix) {
- if upper == "" {
- return "", nil, errors.Wrap(errdefs.ErrInvalidArgument, "rw branch be first")
- }
- lower = append(lower, strings.TrimSuffix(b, roSuffix))
- } else {
- return "", nil, errors.Wrap(errdefs.ErrInvalidArgument, "unhandled aufs suffix")
- }
-
- }
- }
- if upper == "" {
- return "", nil, errors.Wrap(errdefs.ErrInvalidArgument, "rw branch not found")
- }
- return
-}
diff --git a/vendor/github.com/containerd/containerd/diff/apply/apply_other.go b/vendor/github.com/containerd/containerd/diff/apply/apply_other.go
deleted file mode 100644
index 01e0f11bb..000000000
--- a/vendor/github.com/containerd/containerd/diff/apply/apply_other.go
+++ /dev/null
@@ -1,34 +0,0 @@
-// +build !linux
-
-/*
- 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 apply
-
-import (
- "context"
- "io"
-
- "github.com/containerd/containerd/archive"
- "github.com/containerd/containerd/mount"
-)
-
-func apply(ctx context.Context, mounts []mount.Mount, r io.Reader) error {
- return mount.WithTempMount(ctx, mounts, func(root string) error {
- _, err := archive.Apply(ctx, root, r)
- return err
- })
-}
diff --git a/vendor/github.com/containerd/containerd/diff/diff.go b/vendor/github.com/containerd/containerd/diff/diff.go
deleted file mode 100644
index 17aab616e..000000000
--- a/vendor/github.com/containerd/containerd/diff/diff.go
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package diff
-
-import (
- "context"
-
- "github.com/containerd/containerd/mount"
- "github.com/gogo/protobuf/types"
- ocispec "github.com/opencontainers/image-spec/specs-go/v1"
-)
-
-// Config is used to hold parameters needed for a diff operation
-type Config struct {
- // MediaType is the type of diff to generate
- // Default depends on the differ,
- // i.e. application/vnd.oci.image.layer.v1.tar+gzip
- MediaType string
-
- // Reference is the content upload reference
- // Default will use a random reference string
- Reference string
-
- // Labels are the labels to apply to the generated content
- Labels map[string]string
-}
-
-// Opt is used to configure a diff operation
-type Opt func(*Config) error
-
-// Comparer allows creation of filesystem diffs between mounts
-type Comparer interface {
- // Compare computes the difference between two mounts and returns a
- // descriptor for the computed diff. The options can provide
- // a ref which can be used to track the content creation of the diff.
- // The media type which is used to determine the format of the created
- // content can also be provided as an option.
- Compare(ctx context.Context, lower, upper []mount.Mount, opts ...Opt) (ocispec.Descriptor, error)
-}
-
-// ApplyConfig is used to hold parameters needed for a apply operation
-type ApplyConfig struct {
- // ProcessorPayloads specifies the payload sent to various processors
- ProcessorPayloads map[string]*types.Any
-}
-
-// ApplyOpt is used to configure an Apply operation
-type ApplyOpt func(context.Context, ocispec.Descriptor, *ApplyConfig) error
-
-// Applier allows applying diffs between mounts
-type Applier interface {
- // Apply applies the content referred to by the given descriptor to
- // the provided mount. The method of applying is based on the
- // implementation and content descriptor. For example, in the common
- // case the descriptor is a file system difference in tar format,
- // that tar would be applied on top of the mounts.
- Apply(ctx context.Context, desc ocispec.Descriptor, mount []mount.Mount, opts ...ApplyOpt) (ocispec.Descriptor, error)
-}
-
-// WithMediaType sets the media type to use for creating the diff, without
-// specifying the differ will choose a default.
-func WithMediaType(m string) Opt {
- return func(c *Config) error {
- c.MediaType = m
- return nil
- }
-}
-
-// WithReference is used to set the content upload reference used by
-// the diff operation. This allows the caller to track the upload through
-// the content store.
-func WithReference(ref string) Opt {
- return func(c *Config) error {
- c.Reference = ref
- return nil
- }
-}
-
-// WithLabels is used to set content labels on the created diff content.
-func WithLabels(labels map[string]string) Opt {
- return func(c *Config) error {
- c.Labels = labels
- return nil
- }
-}
-
-// WithPayloads sets the apply processor payloads to the config
-func WithPayloads(payloads map[string]*types.Any) ApplyOpt {
- return func(_ context.Context, _ ocispec.Descriptor, c *ApplyConfig) error {
- c.ProcessorPayloads = payloads
- return nil
- }
-}
diff --git a/vendor/github.com/containerd/containerd/diff/lcow/lcow.go b/vendor/github.com/containerd/containerd/diff/lcow/lcow.go
deleted file mode 100644
index 4c5d74ca3..000000000
--- a/vendor/github.com/containerd/containerd/diff/lcow/lcow.go
+++ /dev/null
@@ -1,210 +0,0 @@
-// +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 lcow
-
-import (
- "context"
- "io"
- "os"
- "path"
- "time"
-
- "github.com/Microsoft/go-winio/pkg/security"
- "github.com/Microsoft/hcsshim/ext4/tar2ext4"
- "github.com/containerd/containerd/content"
- "github.com/containerd/containerd/diff"
- "github.com/containerd/containerd/errdefs"
- "github.com/containerd/containerd/log"
- "github.com/containerd/containerd/metadata"
- "github.com/containerd/containerd/mount"
- "github.com/containerd/containerd/plugin"
- digest "github.com/opencontainers/go-digest"
- ocispec "github.com/opencontainers/image-spec/specs-go/v1"
- "github.com/pkg/errors"
- "github.com/sirupsen/logrus"
-)
-
-const (
- // maxLcowVhdSizeGB is the max size in GB of any layer
- maxLcowVhdSizeGB = 128 * 1024 * 1024 * 1024
-)
-
-func init() {
- plugin.Register(&plugin.Registration{
- Type: plugin.DiffPlugin,
- ID: "windows-lcow",
- Requires: []plugin.Type{
- plugin.MetadataPlugin,
- },
- InitFn: func(ic *plugin.InitContext) (interface{}, error) {
- md, err := ic.Get(plugin.MetadataPlugin)
- if err != nil {
- return nil, err
- }
-
- ic.Meta.Platforms = append(ic.Meta.Platforms, ocispec.Platform{
- OS: "linux",
- Architecture: "amd64",
- })
- return NewWindowsLcowDiff(md.(*metadata.DB).ContentStore())
- },
- })
-}
-
-// CompareApplier handles both comparison and
-// application of layer diffs.
-type CompareApplier interface {
- diff.Applier
- diff.Comparer
-}
-
-// windowsLcowDiff does filesystem comparison and application
-// for Windows specific Linux layer diffs.
-type windowsLcowDiff struct {
- store content.Store
-}
-
-var emptyDesc = ocispec.Descriptor{}
-
-// NewWindowsLcowDiff is the Windows LCOW container layer implementation
-// for comparing and applying Linux filesystem layers on Windows
-func NewWindowsLcowDiff(store content.Store) (CompareApplier, error) {
- return windowsLcowDiff{
- store: store,
- }, nil
-}
-
-// Apply applies the content associated with the provided digests onto the
-// provided mounts. Archive content will be extracted and decompressed if
-// necessary.
-func (s windowsLcowDiff) Apply(ctx context.Context, desc ocispec.Descriptor, mounts []mount.Mount, opts ...diff.ApplyOpt) (d ocispec.Descriptor, err error) {
- t1 := time.Now()
- defer func() {
- if err == nil {
- log.G(ctx).WithFields(logrus.Fields{
- "d": time.Since(t1),
- "dgst": desc.Digest,
- "size": desc.Size,
- "media": desc.MediaType,
- }).Debugf("diff applied")
- }
- }()
-
- var config diff.ApplyConfig
- for _, o := range opts {
- if err := o(ctx, desc, &config); err != nil {
- return emptyDesc, errors.Wrap(err, "failed to apply config opt")
- }
- }
-
- layer, _, err := mountsToLayerAndParents(mounts)
- if err != nil {
- return emptyDesc, err
- }
-
- ra, err := s.store.ReaderAt(ctx, desc)
- if err != nil {
- return emptyDesc, errors.Wrap(err, "failed to get reader from content store")
- }
- defer ra.Close()
-
- processor := diff.NewProcessorChain(desc.MediaType, content.NewReader(ra))
- for {
- if processor, err = diff.GetProcessor(ctx, processor, config.ProcessorPayloads); err != nil {
- return emptyDesc, errors.Wrapf(err, "failed to get stream processor for %s", desc.MediaType)
- }
- if processor.MediaType() == ocispec.MediaTypeImageLayer {
- break
- }
- }
- defer processor.Close()
-
- // Calculate the Digest as we go
- digester := digest.Canonical.Digester()
- rc := &readCounter{
- r: io.TeeReader(processor, digester.Hash()),
- }
-
- layerPath := path.Join(layer, "layer.vhd")
- outFile, err := os.Create(layerPath)
- if err != nil {
- return emptyDesc, err
- }
- defer func() {
- if err != nil {
- outFile.Close()
- os.Remove(layerPath)
- }
- }()
-
- err = tar2ext4.Convert(rc, outFile, tar2ext4.ConvertWhiteout, tar2ext4.AppendVhdFooter, tar2ext4.MaximumDiskSize(maxLcowVhdSizeGB))
- if err != nil {
- return emptyDesc, errors.Wrapf(err, "failed to convert tar2ext4 vhd")
- }
- err = outFile.Sync()
- if err != nil {
- return emptyDesc, errors.Wrapf(err, "failed to sync tar2ext4 vhd to disk")
- }
- outFile.Close()
-
- err = security.GrantVmGroupAccess(layerPath)
- if err != nil {
- return emptyDesc, errors.Wrapf(err, "failed GrantVmGroupAccess on layer vhd: %v", layerPath)
- }
-
- return ocispec.Descriptor{
- MediaType: ocispec.MediaTypeImageLayer,
- Size: rc.c,
- Digest: digester.Digest(),
- }, nil
-}
-
-// Compare creates a diff between the given mounts and uploads the result
-// to the content store.
-func (s windowsLcowDiff) Compare(ctx context.Context, lower, upper []mount.Mount, opts ...diff.Opt) (d ocispec.Descriptor, err error) {
- return emptyDesc, errors.Wrap(errdefs.ErrNotImplemented, "windowsLcowDiff does not implement Compare method")
-}
-
-type readCounter struct {
- r io.Reader
- c int64
-}
-
-func (rc *readCounter) Read(p []byte) (n int, err error) {
- n, err = rc.r.Read(p)
- rc.c += int64(n)
- return
-}
-
-func mountsToLayerAndParents(mounts []mount.Mount) (string, []string, error) {
- if len(mounts) != 1 {
- return "", nil, errors.Wrap(errdefs.ErrInvalidArgument, "number of mounts should always be 1 for Windows lcow-layers")
- }
- mnt := mounts[0]
- if mnt.Type != "lcow-layer" {
- return "", nil, errors.Wrap(errdefs.ErrInvalidArgument, "mount layer type must be lcow-layer")
- }
-
- parentLayerPaths, err := mnt.GetParentPaths()
- if err != nil {
- return "", nil, err
- }
-
- return mnt.Source, parentLayerPaths, nil
-}
diff --git a/vendor/github.com/containerd/containerd/diff/stream.go b/vendor/github.com/containerd/containerd/diff/stream.go
deleted file mode 100644
index 1b625feaa..000000000
--- a/vendor/github.com/containerd/containerd/diff/stream.go
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package diff
-
-import (
- "context"
- "io"
- "os"
-
- "github.com/containerd/containerd/archive/compression"
- "github.com/containerd/containerd/images"
- "github.com/gogo/protobuf/types"
- ocispec "github.com/opencontainers/image-spec/specs-go/v1"
- "github.com/pkg/errors"
-)
-
-var (
- handlers []Handler
-
- // ErrNoProcessor is returned when no stream processor is available for a media-type
- ErrNoProcessor = errors.New("no processor for media-type")
-)
-
-func init() {
- // register the default compression handler
- RegisterProcessor(compressedHandler)
-}
-
-// RegisterProcessor registers a stream processor for media-types
-func RegisterProcessor(handler Handler) {
- handlers = append(handlers, handler)
-}
-
-// GetProcessor returns the processor for a media-type
-func GetProcessor(ctx context.Context, stream StreamProcessor, payloads map[string]*types.Any) (StreamProcessor, error) {
- // reverse this list so that user configured handlers come up first
- for i := len(handlers) - 1; i >= 0; i-- {
- processor, ok := handlers[i](ctx, stream.MediaType())
- if ok {
- return processor(ctx, stream, payloads)
- }
- }
- return nil, ErrNoProcessor
-}
-
-// Handler checks a media-type and initializes the processor
-type Handler func(ctx context.Context, mediaType string) (StreamProcessorInit, bool)
-
-// StaticHandler returns the processor init func for a static media-type
-func StaticHandler(expectedMediaType string, fn StreamProcessorInit) Handler {
- return func(ctx context.Context, mediaType string) (StreamProcessorInit, bool) {
- if mediaType == expectedMediaType {
- return fn, true
- }
- return nil, false
- }
-}
-
-// StreamProcessorInit returns the initialized stream processor
-type StreamProcessorInit func(ctx context.Context, stream StreamProcessor, payloads map[string]*types.Any) (StreamProcessor, error)
-
-// RawProcessor provides access to direct fd for processing
-type RawProcessor interface {
- // File returns the fd for the read stream of the underlying processor
- File() *os.File
-}
-
-// StreamProcessor handles processing a content stream and transforming it into a different media-type
-type StreamProcessor interface {
- io.ReadCloser
-
- // MediaType is the resulting media-type that the processor processes the stream into
- MediaType() string
-}
-
-func compressedHandler(ctx context.Context, mediaType string) (StreamProcessorInit, bool) {
- compressed, err := images.DiffCompression(ctx, mediaType)
- if err != nil {
- return nil, false
- }
- if compressed != "" {
- return func(ctx context.Context, stream StreamProcessor, payloads map[string]*types.Any) (StreamProcessor, error) {
- ds, err := compression.DecompressStream(stream)
- if err != nil {
- return nil, err
- }
-
- return &compressedProcessor{
- rc: ds,
- }, nil
- }, true
- }
- return func(ctx context.Context, stream StreamProcessor, payloads map[string]*types.Any) (StreamProcessor, error) {
- return &stdProcessor{
- rc: stream,
- }, nil
- }, true
-}
-
-// NewProcessorChain initialized the root StreamProcessor
-func NewProcessorChain(mt string, r io.Reader) StreamProcessor {
- return &processorChain{
- mt: mt,
- rc: r,
- }
-}
-
-type processorChain struct {
- mt string
- rc io.Reader
-}
-
-func (c *processorChain) MediaType() string {
- return c.mt
-}
-
-func (c *processorChain) Read(p []byte) (int, error) {
- return c.rc.Read(p)
-}
-
-func (c *processorChain) Close() error {
- return nil
-}
-
-type stdProcessor struct {
- rc StreamProcessor
-}
-
-func (c *stdProcessor) MediaType() string {
- return ocispec.MediaTypeImageLayer
-}
-
-func (c *stdProcessor) Read(p []byte) (int, error) {
- return c.rc.Read(p)
-}
-
-func (c *stdProcessor) Close() error {
- return nil
-}
-
-type compressedProcessor struct {
- rc io.ReadCloser
-}
-
-func (c *compressedProcessor) MediaType() string {
- return ocispec.MediaTypeImageLayer
-}
-
-func (c *compressedProcessor) Read(p []byte) (int, error) {
- return c.rc.Read(p)
-}
-
-func (c *compressedProcessor) Close() error {
- return c.rc.Close()
-}
-
-func BinaryHandler(id, returnsMediaType string, mediaTypes []string, path string, args []string) Handler {
- set := make(map[string]struct{}, len(mediaTypes))
- for _, m := range mediaTypes {
- set[m] = struct{}{}
- }
- return func(_ context.Context, mediaType string) (StreamProcessorInit, bool) {
- if _, ok := set[mediaType]; ok {
- return func(ctx context.Context, stream StreamProcessor, payloads map[string]*types.Any) (StreamProcessor, error) {
- payload := payloads[id]
- return NewBinaryProcessor(ctx, mediaType, returnsMediaType, stream, path, args, payload)
- }, true
- }
- return nil, false
- }
-}
-
-const mediaTypeEnvVar = "STREAM_PROCESSOR_MEDIATYPE"
diff --git a/vendor/github.com/containerd/containerd/diff/stream_unix.go b/vendor/github.com/containerd/containerd/diff/stream_unix.go
deleted file mode 100644
index 28f38d998..000000000
--- a/vendor/github.com/containerd/containerd/diff/stream_unix.go
+++ /dev/null
@@ -1,146 +0,0 @@
-// +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 diff
-
-import (
- "bytes"
- "context"
- "fmt"
- "io"
- "os"
- "os/exec"
- "sync"
-
- "github.com/gogo/protobuf/proto"
- "github.com/gogo/protobuf/types"
- "github.com/pkg/errors"
-)
-
-// NewBinaryProcessor returns a binary processor for use with processing content streams
-func NewBinaryProcessor(ctx context.Context, imt, rmt string, stream StreamProcessor, name string, args []string, payload *types.Any) (StreamProcessor, error) {
- cmd := exec.CommandContext(ctx, name, args...)
- cmd.Env = os.Environ()
-
- var payloadC io.Closer
- if payload != nil {
- data, err := proto.Marshal(payload)
- if err != nil {
- return nil, err
- }
- r, w, err := os.Pipe()
- if err != nil {
- return nil, err
- }
- go func() {
- io.Copy(w, bytes.NewReader(data))
- w.Close()
- }()
-
- cmd.ExtraFiles = append(cmd.ExtraFiles, r)
- payloadC = r
- }
- cmd.Env = append(cmd.Env, fmt.Sprintf("%s=%s", mediaTypeEnvVar, imt))
- var (
- stdin io.Reader
- closer func() error
- err error
- )
- if f, ok := stream.(RawProcessor); ok {
- stdin = f.File()
- closer = f.File().Close
- } else {
- stdin = stream
- }
- cmd.Stdin = stdin
- r, w, err := os.Pipe()
- if err != nil {
- return nil, err
- }
- cmd.Stdout = w
-
- stderr := bytes.NewBuffer(nil)
- cmd.Stderr = stderr
-
- if err := cmd.Start(); err != nil {
- return nil, err
- }
- p := &binaryProcessor{
- cmd: cmd,
- r: r,
- mt: rmt,
- stderr: stderr,
- }
- go p.wait()
-
- // close after start and dup
- w.Close()
- if closer != nil {
- closer()
- }
- if payloadC != nil {
- payloadC.Close()
- }
- return p, nil
-}
-
-type binaryProcessor struct {
- cmd *exec.Cmd
- r *os.File
- mt string
- stderr *bytes.Buffer
-
- mu sync.Mutex
- err error
-}
-
-func (c *binaryProcessor) Err() error {
- c.mu.Lock()
- defer c.mu.Unlock()
- return c.err
-}
-
-func (c *binaryProcessor) wait() {
- if err := c.cmd.Wait(); err != nil {
- if _, ok := err.(*exec.ExitError); ok {
- c.mu.Lock()
- c.err = errors.New(c.stderr.String())
- c.mu.Unlock()
- }
- }
-}
-
-func (c *binaryProcessor) File() *os.File {
- return c.r
-}
-
-func (c *binaryProcessor) MediaType() string {
- return c.mt
-}
-
-func (c *binaryProcessor) Read(p []byte) (int, error) {
- return c.r.Read(p)
-}
-
-func (c *binaryProcessor) Close() error {
- err := c.r.Close()
- if kerr := c.cmd.Process.Kill(); err == nil {
- err = kerr
- }
- return err
-}
diff --git a/vendor/github.com/containerd/containerd/diff/stream_windows.go b/vendor/github.com/containerd/containerd/diff/stream_windows.go
deleted file mode 100644
index 8dadd72c9..000000000
--- a/vendor/github.com/containerd/containerd/diff/stream_windows.go
+++ /dev/null
@@ -1,165 +0,0 @@
-// +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 diff
-
-import (
- "bytes"
- "context"
- "fmt"
- "io"
- "io/ioutil"
- "os"
- "os/exec"
- "path/filepath"
- "sync"
-
- winio "github.com/Microsoft/go-winio"
- "github.com/gogo/protobuf/proto"
- "github.com/gogo/protobuf/types"
- "github.com/pkg/errors"
- "github.com/sirupsen/logrus"
-)
-
-const processorPipe = "STREAM_PROCESSOR_PIPE"
-
-// NewBinaryProcessor returns a binary processor for use with processing content streams
-func NewBinaryProcessor(ctx context.Context, imt, rmt string, stream StreamProcessor, name string, args []string, payload *types.Any) (StreamProcessor, error) {
- cmd := exec.CommandContext(ctx, name, args...)
- cmd.Env = os.Environ()
-
- if payload != nil {
- data, err := proto.Marshal(payload)
- if err != nil {
- return nil, err
- }
- up, err := getUiqPath()
- if err != nil {
- return nil, err
- }
- path := fmt.Sprintf("\\\\.\\pipe\\containerd-processor-%s-pipe", up)
- l, err := winio.ListenPipe(path, nil)
- if err != nil {
- return nil, err
- }
- go func() {
- defer l.Close()
- conn, err := l.Accept()
- if err != nil {
- logrus.WithError(err).Error("accept npipe connection")
- return
- }
- io.Copy(conn, bytes.NewReader(data))
- conn.Close()
- }()
- cmd.Env = append(cmd.Env, fmt.Sprintf("%s=%s", processorPipe, path))
- }
- cmd.Env = append(cmd.Env, fmt.Sprintf("%s=%s", mediaTypeEnvVar, imt))
- var (
- stdin io.Reader
- closer func() error
- err error
- )
- if f, ok := stream.(RawProcessor); ok {
- stdin = f.File()
- closer = f.File().Close
- } else {
- stdin = stream
- }
- cmd.Stdin = stdin
- r, w, err := os.Pipe()
- if err != nil {
- return nil, err
- }
- cmd.Stdout = w
- stderr := bytes.NewBuffer(nil)
- cmd.Stderr = stderr
-
- if err := cmd.Start(); err != nil {
- return nil, err
- }
- p := &binaryProcessor{
- cmd: cmd,
- r: r,
- mt: rmt,
- stderr: stderr,
- }
- go p.wait()
-
- // close after start and dup
- w.Close()
- if closer != nil {
- closer()
- }
- return p, nil
-}
-
-type binaryProcessor struct {
- cmd *exec.Cmd
- r *os.File
- mt string
- stderr *bytes.Buffer
-
- mu sync.Mutex
- err error
-}
-
-func (c *binaryProcessor) Err() error {
- c.mu.Lock()
- defer c.mu.Unlock()
- return c.err
-}
-
-func (c *binaryProcessor) wait() {
- if err := c.cmd.Wait(); err != nil {
- if _, ok := err.(*exec.ExitError); ok {
- c.mu.Lock()
- c.err = errors.New(c.stderr.String())
- c.mu.Unlock()
- }
- }
-}
-
-func (c *binaryProcessor) File() *os.File {
- return c.r
-}
-
-func (c *binaryProcessor) MediaType() string {
- return c.mt
-}
-
-func (c *binaryProcessor) Read(p []byte) (int, error) {
- return c.r.Read(p)
-}
-
-func (c *binaryProcessor) Close() error {
- err := c.r.Close()
- if kerr := c.cmd.Process.Kill(); err == nil {
- err = kerr
- }
- return err
-}
-
-func getUiqPath() (string, error) {
- dir, err := ioutil.TempDir("", "")
- if err != nil {
- return "", err
- }
- os.Remove(dir)
- return filepath.Base(dir), nil
-}
diff --git a/vendor/github.com/containerd/containerd/diff/walking/differ.go b/vendor/github.com/containerd/containerd/diff/walking/differ.go
deleted file mode 100644
index 5ce35910c..000000000
--- a/vendor/github.com/containerd/containerd/diff/walking/differ.go
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package walking
-
-import (
- "context"
- "encoding/base64"
- "fmt"
- "io"
- "math/rand"
- "time"
-
- "github.com/containerd/containerd/archive"
- "github.com/containerd/containerd/archive/compression"
- "github.com/containerd/containerd/content"
- "github.com/containerd/containerd/diff"
- "github.com/containerd/containerd/errdefs"
- "github.com/containerd/containerd/log"
- "github.com/containerd/containerd/mount"
- digest "github.com/opencontainers/go-digest"
- ocispec "github.com/opencontainers/image-spec/specs-go/v1"
- "github.com/pkg/errors"
-)
-
-type walkingDiff struct {
- store content.Store
-}
-
-var emptyDesc = ocispec.Descriptor{}
-var uncompressed = "containerd.io/uncompressed"
-
-// NewWalkingDiff is a generic implementation of diff.Comparer. The diff is
-// calculated by mounting both the upper and lower mount sets and walking the
-// mounted directories concurrently. Changes are calculated by comparing files
-// against each other or by comparing file existence between directories.
-// NewWalkingDiff uses no special characteristics of the mount sets and is
-// expected to work with any filesystem.
-func NewWalkingDiff(store content.Store) diff.Comparer {
- return &walkingDiff{
- store: store,
- }
-}
-
-// Compare creates a diff between the given mounts and uploads the result
-// to the content store.
-func (s *walkingDiff) Compare(ctx context.Context, lower, upper []mount.Mount, opts ...diff.Opt) (d ocispec.Descriptor, err error) {
- var config diff.Config
- for _, opt := range opts {
- if err := opt(&config); err != nil {
- return emptyDesc, err
- }
- }
-
- if config.MediaType == "" {
- config.MediaType = ocispec.MediaTypeImageLayerGzip
- }
-
- var isCompressed bool
- switch config.MediaType {
- case ocispec.MediaTypeImageLayer:
- case ocispec.MediaTypeImageLayerGzip:
- isCompressed = true
- default:
- return emptyDesc, errors.Wrapf(errdefs.ErrNotImplemented, "unsupported diff media type: %v", config.MediaType)
- }
-
- var ocidesc ocispec.Descriptor
- if err := mount.WithTempMount(ctx, lower, func(lowerRoot string) error {
- return mount.WithTempMount(ctx, upper, func(upperRoot string) error {
- var newReference bool
- if config.Reference == "" {
- newReference = true
- config.Reference = uniqueRef()
- }
-
- cw, err := s.store.Writer(ctx,
- content.WithRef(config.Reference),
- content.WithDescriptor(ocispec.Descriptor{
- MediaType: config.MediaType, // most contentstore implementations just ignore this
- }))
- if err != nil {
- return errors.Wrap(err, "failed to open writer")
- }
- defer func() {
- if err != nil {
- cw.Close()
- if newReference {
- if err := s.store.Abort(ctx, config.Reference); err != nil {
- log.G(ctx).WithField("ref", config.Reference).Warnf("failed to delete diff upload")
- }
- }
- }
- }()
- if !newReference {
- if err = cw.Truncate(0); err != nil {
- return err
- }
- }
-
- if isCompressed {
- dgstr := digest.SHA256.Digester()
- var compressed io.WriteCloser
- compressed, err = compression.CompressStream(cw, compression.Gzip)
- if err != nil {
- return errors.Wrap(err, "failed to get compressed stream")
- }
- err = archive.WriteDiff(ctx, io.MultiWriter(compressed, dgstr.Hash()), lowerRoot, upperRoot)
- compressed.Close()
- if err != nil {
- return errors.Wrap(err, "failed to write compressed diff")
- }
-
- if config.Labels == nil {
- config.Labels = map[string]string{}
- }
- config.Labels[uncompressed] = dgstr.Digest().String()
- } else {
- if err = archive.WriteDiff(ctx, cw, lowerRoot, upperRoot); err != nil {
- return errors.Wrap(err, "failed to write diff")
- }
- }
-
- var commitopts []content.Opt
- if config.Labels != nil {
- commitopts = append(commitopts, content.WithLabels(config.Labels))
- }
-
- dgst := cw.Digest()
- if err := cw.Commit(ctx, 0, dgst, commitopts...); err != nil {
- if !errdefs.IsAlreadyExists(err) {
- return errors.Wrap(err, "failed to commit")
- }
- }
-
- info, err := s.store.Info(ctx, dgst)
- if err != nil {
- return errors.Wrap(err, "failed to get info from content store")
- }
- if info.Labels == nil {
- info.Labels = make(map[string]string)
- }
- // Set uncompressed label if digest already existed without label
- if _, ok := info.Labels[uncompressed]; !ok {
- info.Labels[uncompressed] = config.Labels[uncompressed]
- if _, err := s.store.Update(ctx, info, "labels."+uncompressed); err != nil {
- return errors.Wrap(err, "error setting uncompressed label")
- }
- }
-
- ocidesc = ocispec.Descriptor{
- MediaType: config.MediaType,
- Size: info.Size,
- Digest: info.Digest,
- }
- return nil
- })
- }); err != nil {
- return emptyDesc, err
- }
-
- return ocidesc, nil
-}
-
-func uniqueRef() string {
- t := time.Now()
- var b [3]byte
- // Ignore read failures, just decreases uniqueness
- rand.Read(b[:])
- return fmt.Sprintf("%d-%s", t.UnixNano(), base64.URLEncoding.EncodeToString(b[:]))
-}
diff --git a/vendor/github.com/containerd/containerd/diff/walking/plugin/plugin.go b/vendor/github.com/containerd/containerd/diff/walking/plugin/plugin.go
deleted file mode 100644
index a2dcc1094..000000000
--- a/vendor/github.com/containerd/containerd/diff/walking/plugin/plugin.go
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package plugin
-
-import (
- "github.com/containerd/containerd/diff"
- "github.com/containerd/containerd/diff/apply"
- "github.com/containerd/containerd/diff/walking"
- "github.com/containerd/containerd/metadata"
- "github.com/containerd/containerd/platforms"
- "github.com/containerd/containerd/plugin"
-)
-
-func init() {
- plugin.Register(&plugin.Registration{
- Type: plugin.DiffPlugin,
- ID: "walking",
- Requires: []plugin.Type{
- plugin.MetadataPlugin,
- },
- InitFn: func(ic *plugin.InitContext) (interface{}, error) {
- md, err := ic.Get(plugin.MetadataPlugin)
- if err != nil {
- return nil, err
- }
-
- ic.Meta.Platforms = append(ic.Meta.Platforms, platforms.DefaultSpec())
- cs := md.(*metadata.DB).ContentStore()
-
- return diffPlugin{
- Comparer: walking.NewWalkingDiff(cs),
- Applier: apply.NewFileSystemApplier(cs),
- }, nil
- },
- })
-}
-
-type diffPlugin struct {
- diff.Comparer
- diff.Applier
-}
diff --git a/vendor/github.com/containerd/containerd/diff/windows/windows.go b/vendor/github.com/containerd/containerd/diff/windows/windows.go
deleted file mode 100644
index 3de358683..000000000
--- a/vendor/github.com/containerd/containerd/diff/windows/windows.go
+++ /dev/null
@@ -1,193 +0,0 @@
-// +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 windows
-
-import (
- "context"
- "io"
- "io/ioutil"
- "time"
-
- winio "github.com/Microsoft/go-winio"
- "github.com/containerd/containerd/archive"
- "github.com/containerd/containerd/content"
- "github.com/containerd/containerd/diff"
- "github.com/containerd/containerd/errdefs"
- "github.com/containerd/containerd/log"
- "github.com/containerd/containerd/metadata"
- "github.com/containerd/containerd/mount"
- "github.com/containerd/containerd/platforms"
- "github.com/containerd/containerd/plugin"
- digest "github.com/opencontainers/go-digest"
- ocispec "github.com/opencontainers/image-spec/specs-go/v1"
- "github.com/pkg/errors"
- "github.com/sirupsen/logrus"
-)
-
-func init() {
- plugin.Register(&plugin.Registration{
- Type: plugin.DiffPlugin,
- ID: "windows",
- Requires: []plugin.Type{
- plugin.MetadataPlugin,
- },
- InitFn: func(ic *plugin.InitContext) (interface{}, error) {
- md, err := ic.Get(plugin.MetadataPlugin)
- if err != nil {
- return nil, err
- }
-
- ic.Meta.Platforms = append(ic.Meta.Platforms, platforms.DefaultSpec())
- return NewWindowsDiff(md.(*metadata.DB).ContentStore())
- },
- })
-}
-
-// CompareApplier handles both comparison and
-// application of layer diffs.
-type CompareApplier interface {
- diff.Applier
- diff.Comparer
-}
-
-// windowsDiff does filesystem comparison and application
-// for Windows specific layer diffs.
-type windowsDiff struct {
- store content.Store
-}
-
-var emptyDesc = ocispec.Descriptor{}
-
-// NewWindowsDiff is the Windows container layer implementation
-// for comparing and applying filesystem layers
-func NewWindowsDiff(store content.Store) (CompareApplier, error) {
- return windowsDiff{
- store: store,
- }, nil
-}
-
-// Apply applies the content associated with the provided digests onto the
-// provided mounts. Archive content will be extracted and decompressed if
-// necessary.
-func (s windowsDiff) Apply(ctx context.Context, desc ocispec.Descriptor, mounts []mount.Mount, opts ...diff.ApplyOpt) (d ocispec.Descriptor, err error) {
- t1 := time.Now()
- defer func() {
- if err == nil {
- log.G(ctx).WithFields(logrus.Fields{
- "d": time.Since(t1),
- "dgst": desc.Digest,
- "size": desc.Size,
- "media": desc.MediaType,
- }).Debugf("diff applied")
- }
- }()
-
- var config diff.ApplyConfig
- for _, o := range opts {
- if err := o(ctx, desc, &config); err != nil {
- return emptyDesc, errors.Wrap(err, "failed to apply config opt")
- }
- }
-
- ra, err := s.store.ReaderAt(ctx, desc)
- if err != nil {
- return emptyDesc, errors.Wrap(err, "failed to get reader from content store")
- }
- defer ra.Close()
-
- processor := diff.NewProcessorChain(desc.MediaType, content.NewReader(ra))
- for {
- if processor, err = diff.GetProcessor(ctx, processor, config.ProcessorPayloads); err != nil {
- return emptyDesc, errors.Wrapf(err, "failed to get stream processor for %s", desc.MediaType)
- }
- if processor.MediaType() == ocispec.MediaTypeImageLayer {
- break
- }
- }
- defer processor.Close()
-
- digester := digest.Canonical.Digester()
- rc := &readCounter{
- r: io.TeeReader(processor, digester.Hash()),
- }
-
- layer, parentLayerPaths, err := mountsToLayerAndParents(mounts)
- if err != nil {
- return emptyDesc, err
- }
-
- // TODO darrenstahlmsft: When this is done isolated, we should disable these.
- // it currently cannot be disabled, unless we add ref counting. Since this is
- // temporary, leaving it enabled is OK for now.
- if err := winio.EnableProcessPrivileges([]string{winio.SeBackupPrivilege, winio.SeRestorePrivilege}); err != nil {
- return emptyDesc, err
- }
-
- if _, err := archive.Apply(ctx, layer, rc, archive.WithParents(parentLayerPaths), archive.AsWindowsContainerLayer()); err != nil {
- return emptyDesc, err
- }
-
- // Read any trailing data
- if _, err := io.Copy(ioutil.Discard, rc); err != nil {
- return emptyDesc, err
- }
-
- return ocispec.Descriptor{
- MediaType: ocispec.MediaTypeImageLayer,
- Size: rc.c,
- Digest: digester.Digest(),
- }, nil
-}
-
-// Compare creates a diff between the given mounts and uploads the result
-// to the content store.
-func (s windowsDiff) Compare(ctx context.Context, lower, upper []mount.Mount, opts ...diff.Opt) (d ocispec.Descriptor, err error) {
- return emptyDesc, errors.Wrap(errdefs.ErrNotImplemented, "windowsDiff does not implement Compare method")
-}
-
-type readCounter struct {
- r io.Reader
- c int64
-}
-
-func (rc *readCounter) Read(p []byte) (n int, err error) {
- n, err = rc.r.Read(p)
- rc.c += int64(n)
- return
-}
-
-func mountsToLayerAndParents(mounts []mount.Mount) (string, []string, error) {
- if len(mounts) != 1 {
- return "", nil, errors.Wrap(errdefs.ErrInvalidArgument, "number of mounts should always be 1 for Windows layers")
- }
- mnt := mounts[0]
- if mnt.Type != "windows-layer" {
- // This is a special case error. When this is received the diff service
- // will attempt the next differ in the chain which for Windows is the
- // lcow differ that we want.
- return "", nil, errors.Wrapf(errdefs.ErrNotImplemented, "windowsDiff does not support layer type %s", mnt.Type)
- }
-
- parentLayerPaths, err := mnt.GetParentPaths()
- if err != nil {
- return "", nil, err
- }
-
- return mnt.Source, parentLayerPaths, nil
-}
diff --git a/vendor/github.com/containerd/containerd/errdefs/errors.go b/vendor/github.com/containerd/containerd/errdefs/errors.go
deleted file mode 100644
index 05a35228c..000000000
--- a/vendor/github.com/containerd/containerd/errdefs/errors.go
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-// Package errdefs defines the common errors used throughout containerd
-// packages.
-//
-// Use with errors.Wrap and error.Wrapf to add context to an error.
-//
-// To detect an error class, use the IsXXX functions to tell whether an error
-// is of a certain type.
-//
-// The functions ToGRPC and FromGRPC can be used to map server-side and
-// client-side errors to the correct types.
-package errdefs
-
-import (
- "context"
-
- "github.com/pkg/errors"
-)
-
-// Definitions of common error types used throughout containerd. All containerd
-// errors returned by most packages will map into one of these errors classes.
-// Packages should return errors of these types when they want to instruct a
-// client to take a particular action.
-//
-// For the most part, we just try to provide local grpc errors. Most conditions
-// map very well to those defined by grpc.
-var (
- ErrUnknown = errors.New("unknown") // used internally to represent a missed mapping.
- ErrInvalidArgument = errors.New("invalid argument")
- ErrNotFound = errors.New("not found")
- ErrAlreadyExists = errors.New("already exists")
- ErrFailedPrecondition = errors.New("failed precondition")
- ErrUnavailable = errors.New("unavailable")
- ErrNotImplemented = errors.New("not implemented") // represents not supported and unimplemented
-)
-
-// IsInvalidArgument returns true if the error is due to an invalid argument
-func IsInvalidArgument(err error) bool {
- return errors.Is(err, ErrInvalidArgument)
-}
-
-// IsNotFound returns true if the error is due to a missing object
-func IsNotFound(err error) bool {
- return errors.Is(err, ErrNotFound)
-}
-
-// IsAlreadyExists returns true if the error is due to an already existing
-// metadata item
-func IsAlreadyExists(err error) bool {
- return errors.Is(err, ErrAlreadyExists)
-}
-
-// IsFailedPrecondition returns true if an operation could not proceed to the
-// lack of a particular condition
-func IsFailedPrecondition(err error) bool {
- return errors.Is(err, ErrFailedPrecondition)
-}
-
-// IsUnavailable returns true if the error is due to a resource being unavailable
-func IsUnavailable(err error) bool {
- return errors.Is(err, ErrUnavailable)
-}
-
-// IsNotImplemented returns true if the error is due to not being implemented
-func IsNotImplemented(err error) bool {
- return errors.Is(err, ErrNotImplemented)
-}
-
-// IsCanceled returns true if the error is due to `context.Canceled`.
-func IsCanceled(err error) bool {
- return errors.Is(err, context.Canceled)
-}
-
-// IsDeadlineExceeded returns true if the error is due to
-// `context.DeadlineExceeded`.
-func IsDeadlineExceeded(err error) bool {
- return errors.Is(err, context.DeadlineExceeded)
-}
diff --git a/vendor/github.com/containerd/containerd/errdefs/grpc.go b/vendor/github.com/containerd/containerd/errdefs/grpc.go
deleted file mode 100644
index 209f63bd0..000000000
--- a/vendor/github.com/containerd/containerd/errdefs/grpc.go
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package errdefs
-
-import (
- "context"
- "strings"
-
- "github.com/pkg/errors"
- "google.golang.org/grpc/codes"
- "google.golang.org/grpc/status"
-)
-
-// ToGRPC will attempt to map the backend containerd error into a grpc error,
-// using the original error message as a description.
-//
-// Further information may be extracted from certain errors depending on their
-// type.
-//
-// If the error is unmapped, the original error will be returned to be handled
-// by the regular grpc error handling stack.
-func ToGRPC(err error) error {
- if err == nil {
- return nil
- }
-
- if isGRPCError(err) {
- // error has already been mapped to grpc
- return err
- }
-
- switch {
- case IsInvalidArgument(err):
- return status.Errorf(codes.InvalidArgument, err.Error())
- case IsNotFound(err):
- return status.Errorf(codes.NotFound, err.Error())
- case IsAlreadyExists(err):
- return status.Errorf(codes.AlreadyExists, err.Error())
- case IsFailedPrecondition(err):
- return status.Errorf(codes.FailedPrecondition, err.Error())
- case IsUnavailable(err):
- return status.Errorf(codes.Unavailable, err.Error())
- case IsNotImplemented(err):
- return status.Errorf(codes.Unimplemented, err.Error())
- case IsCanceled(err):
- return status.Errorf(codes.Canceled, err.Error())
- case IsDeadlineExceeded(err):
- return status.Errorf(codes.DeadlineExceeded, err.Error())
- }
-
- return err
-}
-
-// ToGRPCf maps the error to grpc error codes, assembling the formatting string
-// and combining it with the target error string.
-//
-// This is equivalent to errors.ToGRPC(errors.Wrapf(err, format, args...))
-func ToGRPCf(err error, format string, args ...interface{}) error {
- return ToGRPC(errors.Wrapf(err, format, args...))
-}
-
-// FromGRPC returns the underlying error from a grpc service based on the grpc error code
-func FromGRPC(err error) error {
- if err == nil {
- return nil
- }
-
- var cls error // divide these into error classes, becomes the cause
-
- switch code(err) {
- case codes.InvalidArgument:
- cls = ErrInvalidArgument
- case codes.AlreadyExists:
- cls = ErrAlreadyExists
- case codes.NotFound:
- cls = ErrNotFound
- case codes.Unavailable:
- cls = ErrUnavailable
- case codes.FailedPrecondition:
- cls = ErrFailedPrecondition
- case codes.Unimplemented:
- cls = ErrNotImplemented
- case codes.Canceled:
- cls = context.Canceled
- case codes.DeadlineExceeded:
- cls = context.DeadlineExceeded
- default:
- cls = ErrUnknown
- }
-
- msg := rebaseMessage(cls, err)
- if msg != "" {
- err = errors.Wrap(cls, msg)
- } else {
- err = errors.WithStack(cls)
- }
-
- return err
-}
-
-// rebaseMessage removes the repeats for an error at the end of an error
-// string. This will happen when taking an error over grpc then remapping it.
-//
-// Effectively, we just remove the string of cls from the end of err if it
-// appears there.
-func rebaseMessage(cls error, err error) string {
- desc := errDesc(err)
- clss := cls.Error()
- if desc == clss {
- return ""
- }
-
- return strings.TrimSuffix(desc, ": "+clss)
-}
-
-func isGRPCError(err error) bool {
- _, ok := status.FromError(err)
- return ok
-}
-
-func code(err error) codes.Code {
- if s, ok := status.FromError(err); ok {
- return s.Code()
- }
- return codes.Unknown
-}
-
-func errDesc(err error) string {
- if s, ok := status.FromError(err); ok {
- return s.Message()
- }
- return err.Error()
-}
diff --git a/vendor/github.com/containerd/containerd/events.go b/vendor/github.com/containerd/containerd/events.go
deleted file mode 100644
index 3577b7c3a..000000000
--- a/vendor/github.com/containerd/containerd/events.go
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package containerd
-
-import (
- "context"
-
- eventsapi "github.com/containerd/containerd/api/services/events/v1"
- "github.com/containerd/containerd/errdefs"
- "github.com/containerd/containerd/events"
- "github.com/containerd/typeurl"
-)
-
-// EventService handles the publish, forward and subscribe of events.
-type EventService interface {
- events.Publisher
- events.Forwarder
- events.Subscriber
-}
-
-// NewEventServiceFromClient returns a new event service which communicates
-// over a GRPC connection.
-func NewEventServiceFromClient(client eventsapi.EventsClient) EventService {
- return &eventRemote{
- client: client,
- }
-}
-
-type eventRemote struct {
- client eventsapi.EventsClient
-}
-
-func (e *eventRemote) Publish(ctx context.Context, topic string, event events.Event) error {
- any, err := typeurl.MarshalAny(event)
- if err != nil {
- return err
- }
- req := &eventsapi.PublishRequest{
- Topic: topic,
- Event: any,
- }
- if _, err := e.client.Publish(ctx, req); err != nil {
- return errdefs.FromGRPC(err)
- }
- return nil
-}
-
-func (e *eventRemote) Forward(ctx context.Context, envelope *events.Envelope) error {
- req := &eventsapi.ForwardRequest{
- Envelope: &eventsapi.Envelope{
- Timestamp: envelope.Timestamp,
- Namespace: envelope.Namespace,
- Topic: envelope.Topic,
- Event: envelope.Event,
- },
- }
- if _, err := e.client.Forward(ctx, req); err != nil {
- return errdefs.FromGRPC(err)
- }
- return nil
-}
-
-func (e *eventRemote) Subscribe(ctx context.Context, filters ...string) (ch <-chan *events.Envelope, errs <-chan error) {
- var (
- evq = make(chan *events.Envelope)
- errq = make(chan error, 1)
- )
-
- errs = errq
- ch = evq
-
- session, err := e.client.Subscribe(ctx, &eventsapi.SubscribeRequest{
- Filters: filters,
- })
- if err != nil {
- errq <- err
- close(errq)
- return
- }
-
- go func() {
- defer close(errq)
-
- for {
- ev, err := session.Recv()
- if err != nil {
- errq <- err
- return
- }
-
- select {
- case evq <- &events.Envelope{
- Timestamp: ev.Timestamp,
- Namespace: ev.Namespace,
- Topic: ev.Topic,
- Event: ev.Event,
- }:
- case <-ctx.Done():
- if cerr := ctx.Err(); cerr != context.Canceled {
- errq <- cerr
- }
- return
- }
- }
- }()
-
- return ch, errs
-}
diff --git a/vendor/github.com/containerd/containerd/events/events.go b/vendor/github.com/containerd/containerd/events/events.go
deleted file mode 100644
index b7eb86f1e..000000000
--- a/vendor/github.com/containerd/containerd/events/events.go
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package events
-
-import (
- "context"
- "time"
-
- "github.com/containerd/typeurl"
- "github.com/gogo/protobuf/types"
-)
-
-// Envelope provides the packaging for an event.
-type Envelope struct {
- Timestamp time.Time
- Namespace string
- Topic string
- Event *types.Any
-}
-
-// Field returns the value for the given fieldpath as a string, if defined.
-// If the value is not defined, the second value will be false.
-func (e *Envelope) Field(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- // unhandled: timestamp
- case "namespace":
- return e.Namespace, len(e.Namespace) > 0
- case "topic":
- return e.Topic, len(e.Topic) > 0
- case "event":
- decoded, err := typeurl.UnmarshalAny(e.Event)
- if err != nil {
- return "", false
- }
-
- adaptor, ok := decoded.(interface {
- Field([]string) (string, bool)
- })
- if !ok {
- return "", false
- }
- return adaptor.Field(fieldpath[1:])
- }
- return "", false
-}
-
-// Event is a generic interface for any type of event
-type Event interface{}
-
-// Publisher posts the event.
-type Publisher interface {
- Publish(ctx context.Context, topic string, event Event) error
-}
-
-// Forwarder forwards an event to the underlying event bus
-type Forwarder interface {
- Forward(ctx context.Context, envelope *Envelope) error
-}
-
-// Subscriber allows callers to subscribe to events
-type Subscriber interface {
- Subscribe(ctx context.Context, filters ...string) (ch <-chan *Envelope, errs <-chan error)
-}
diff --git a/vendor/github.com/containerd/containerd/events/exchange/exchange.go b/vendor/github.com/containerd/containerd/events/exchange/exchange.go
deleted file mode 100644
index eb27bf29b..000000000
--- a/vendor/github.com/containerd/containerd/events/exchange/exchange.go
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package exchange
-
-import (
- "context"
- "strings"
- "time"
-
- "github.com/containerd/containerd/errdefs"
- "github.com/containerd/containerd/events"
- "github.com/containerd/containerd/filters"
- "github.com/containerd/containerd/identifiers"
- "github.com/containerd/containerd/log"
- "github.com/containerd/containerd/namespaces"
- "github.com/containerd/typeurl"
- goevents "github.com/docker/go-events"
- "github.com/gogo/protobuf/types"
- "github.com/pkg/errors"
- "github.com/sirupsen/logrus"
-)
-
-// Exchange broadcasts events
-type Exchange struct {
- broadcaster *goevents.Broadcaster
-}
-
-// NewExchange returns a new event Exchange
-func NewExchange() *Exchange {
- return &Exchange{
- broadcaster: goevents.NewBroadcaster(),
- }
-}
-
-var _ events.Publisher = &Exchange{}
-var _ events.Forwarder = &Exchange{}
-var _ events.Subscriber = &Exchange{}
-
-// Forward accepts an envelope to be directly distributed on the exchange.
-//
-// This is useful when an event is forwarded on behalf of another namespace or
-// when the event is propagated on behalf of another publisher.
-func (e *Exchange) Forward(ctx context.Context, envelope *events.Envelope) (err error) {
- if err := validateEnvelope(envelope); err != nil {
- return err
- }
-
- defer func() {
- logger := log.G(ctx).WithFields(logrus.Fields{
- "topic": envelope.Topic,
- "ns": envelope.Namespace,
- "type": envelope.Event.TypeUrl,
- })
-
- if err != nil {
- logger.WithError(err).Error("error forwarding event")
- } else {
- logger.Debug("event forwarded")
- }
- }()
-
- return e.broadcaster.Write(envelope)
-}
-
-// Publish packages and sends an event. The caller will be considered the
-// initial publisher of the event. This means the timestamp will be calculated
-// at this point and this method may read from the calling context.
-func (e *Exchange) Publish(ctx context.Context, topic string, event events.Event) (err error) {
- var (
- namespace string
- encoded *types.Any
- envelope events.Envelope
- )
-
- namespace, err = namespaces.NamespaceRequired(ctx)
- if err != nil {
- return errors.Wrapf(err, "failed publishing event")
- }
- if err := validateTopic(topic); err != nil {
- return errors.Wrapf(err, "envelope topic %q", topic)
- }
-
- encoded, err = typeurl.MarshalAny(event)
- if err != nil {
- return err
- }
-
- envelope.Timestamp = time.Now().UTC()
- envelope.Namespace = namespace
- envelope.Topic = topic
- envelope.Event = encoded
-
- defer func() {
- logger := log.G(ctx).WithFields(logrus.Fields{
- "topic": envelope.Topic,
- "ns": envelope.Namespace,
- "type": envelope.Event.TypeUrl,
- })
-
- if err != nil {
- logger.WithError(err).Error("error publishing event")
- } else {
- logger.Debug("event published")
- }
- }()
-
- return e.broadcaster.Write(&envelope)
-}
-
-// Subscribe to events on the exchange. Events are sent through the returned
-// channel ch. If an error is encountered, it will be sent on channel errs and
-// errs will be closed. To end the subscription, cancel the provided context.
-//
-// Zero or more filters may be provided as strings. Only events that match
-// *any* of the provided filters will be sent on the channel. The filters use
-// the standard containerd filters package syntax.
-func (e *Exchange) Subscribe(ctx context.Context, fs ...string) (ch <-chan *events.Envelope, errs <-chan error) {
- var (
- evch = make(chan *events.Envelope)
- errq = make(chan error, 1)
- channel = goevents.NewChannel(0)
- queue = goevents.NewQueue(channel)
- dst goevents.Sink = queue
- )
-
- closeAll := func() {
- channel.Close()
- queue.Close()
- e.broadcaster.Remove(dst)
- close(errq)
- }
-
- ch = evch
- errs = errq
-
- if len(fs) > 0 {
- filter, err := filters.ParseAll(fs...)
- if err != nil {
- errq <- errors.Wrapf(err, "failed parsing subscription filters")
- closeAll()
- return
- }
-
- dst = goevents.NewFilter(queue, goevents.MatcherFunc(func(gev goevents.Event) bool {
- return filter.Match(adapt(gev))
- }))
- }
-
- e.broadcaster.Add(dst)
-
- go func() {
- defer closeAll()
-
- var err error
- loop:
- for {
- select {
- case ev := <-channel.C:
- env, ok := ev.(*events.Envelope)
- if !ok {
- // TODO(stevvooe): For the most part, we are well protected
- // from this condition. Both Forward and Publish protect
- // from this.
- err = errors.Errorf("invalid envelope encountered %#v; please file a bug", ev)
- break
- }
-
- select {
- case evch <- env:
- case <-ctx.Done():
- break loop
- }
- case <-ctx.Done():
- break loop
- }
- }
-
- if err == nil {
- if cerr := ctx.Err(); cerr != context.Canceled {
- err = cerr
- }
- }
-
- errq <- err
- }()
-
- return
-}
-
-func validateTopic(topic string) error {
- if topic == "" {
- return errors.Wrap(errdefs.ErrInvalidArgument, "must not be empty")
- }
-
- if topic[0] != '/' {
- return errors.Wrapf(errdefs.ErrInvalidArgument, "must start with '/'")
- }
-
- if len(topic) == 1 {
- return errors.Wrapf(errdefs.ErrInvalidArgument, "must have at least one component")
- }
-
- components := strings.Split(topic[1:], "/")
- for _, component := range components {
- if err := identifiers.Validate(component); err != nil {
- return errors.Wrapf(err, "failed validation on component %q", component)
- }
- }
-
- return nil
-}
-
-func validateEnvelope(envelope *events.Envelope) error {
- if err := identifiers.Validate(envelope.Namespace); err != nil {
- return errors.Wrapf(err, "event envelope has invalid namespace")
- }
-
- if err := validateTopic(envelope.Topic); err != nil {
- return errors.Wrapf(err, "envelope topic %q", envelope.Topic)
- }
-
- if envelope.Timestamp.IsZero() {
- return errors.Wrapf(errdefs.ErrInvalidArgument, "timestamp must be set on forwarded event")
- }
-
- return nil
-}
-
-func adapt(ev interface{}) filters.Adaptor {
- if adaptor, ok := ev.(filters.Adaptor); ok {
- return adaptor
- }
-
- return filters.AdapterFunc(func(fieldpath []string) (string, bool) {
- return "", false
- })
-}
diff --git a/vendor/github.com/containerd/containerd/export.go b/vendor/github.com/containerd/containerd/export.go
deleted file mode 100644
index 81f199226..000000000
--- a/vendor/github.com/containerd/containerd/export.go
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package containerd
-
-import (
- "context"
- "io"
-
- "github.com/containerd/containerd/images/archive"
-)
-
-// Export exports images to a Tar stream.
-// The tar archive is in OCI format with a Docker compatible manifest
-// when a single target platform is given.
-func (c *Client) Export(ctx context.Context, w io.Writer, opts ...archive.ExportOpt) error {
- return archive.Export(ctx, c.ContentStore(), w, opts...)
-}
diff --git a/vendor/github.com/containerd/containerd/filters/adaptor.go b/vendor/github.com/containerd/containerd/filters/adaptor.go
deleted file mode 100644
index 5a9c559c1..000000000
--- a/vendor/github.com/containerd/containerd/filters/adaptor.go
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package filters
-
-// Adaptor specifies the mapping of fieldpaths to a type. For the given field
-// path, the value and whether it is present should be returned. The mapping of
-// the fieldpath to a field is deferred to the adaptor implementation, but
-// should generally follow protobuf field path/mask semantics.
-type Adaptor interface {
- Field(fieldpath []string) (value string, present bool)
-}
-
-// AdapterFunc allows implementation specific matching of fieldpaths
-type AdapterFunc func(fieldpath []string) (string, bool)
-
-// Field returns the field name and true if it exists
-func (fn AdapterFunc) Field(fieldpath []string) (string, bool) {
- return fn(fieldpath)
-}
diff --git a/vendor/github.com/containerd/containerd/filters/filter.go b/vendor/github.com/containerd/containerd/filters/filter.go
deleted file mode 100644
index cf09d8d9e..000000000
--- a/vendor/github.com/containerd/containerd/filters/filter.go
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-// Package filters defines a syntax and parser that can be used for the
-// filtration of items across the containerd API. The core is built on the
-// concept of protobuf field paths, with quoting. Several operators allow the
-// user to flexibly select items based on field presence, equality, inequality
-// and regular expressions. Flexible adaptors support working with any type.
-//
-// The syntax is fairly familiar, if you've used container ecosystem
-// projects. At the core, we base it on the concept of protobuf field
-// paths, augmenting with the ability to quote portions of the field path
-// to match arbitrary labels. These "selectors" come in the following
-// syntax:
-//
-// ```
-// []
-// ```
-//
-// A basic example is as follows:
-//
-// ```
-// name==foo
-// ```
-//
-// This would match all objects that have a field `name` with the value
-// `foo`. If we only want to test if the field is present, we can omit the
-// operator. This is most useful for matching labels in containerd. The
-// following will match objects that have the field "labels" and have the
-// label "foo" defined:
-//
-// ```
-// labels.foo
-// ```
-//
-// We also allow for quoting of parts of the field path to allow matching
-// of arbitrary items:
-//
-// ```
-// labels."very complex label"==something
-// ```
-//
-// We also define `!=` and `~=` as operators. The `!=` will match all
-// objects that don't match the value for a field and `~=` will compile the
-// target value as a regular expression and match the field value against that.
-//
-// Selectors can be combined using a comma, such that the resulting
-// selector will require all selectors are matched for the object to match.
-// The following example will match objects that are named `foo` and have
-// the label `bar`:
-//
-// ```
-// name==foo,labels.bar
-// ```
-//
-package filters
-
-import (
- "regexp"
-
- "github.com/containerd/containerd/log"
-)
-
-// Filter matches specific resources based the provided filter
-type Filter interface {
- Match(adaptor Adaptor) bool
-}
-
-// FilterFunc is a function that handles matching with an adaptor
-type FilterFunc func(Adaptor) bool
-
-// Match matches the FilterFunc returning true if the object matches the filter
-func (fn FilterFunc) Match(adaptor Adaptor) bool {
- return fn(adaptor)
-}
-
-// Always is a filter that always returns true for any type of object
-var Always FilterFunc = func(adaptor Adaptor) bool {
- return true
-}
-
-// Any allows multiple filters to be matched against the object
-type Any []Filter
-
-// Match returns true if any of the provided filters are true
-func (m Any) Match(adaptor Adaptor) bool {
- for _, m := range m {
- if m.Match(adaptor) {
- return true
- }
- }
-
- return false
-}
-
-// All allows multiple filters to be matched against the object
-type All []Filter
-
-// Match only returns true if all filters match the object
-func (m All) Match(adaptor Adaptor) bool {
- for _, m := range m {
- if !m.Match(adaptor) {
- return false
- }
- }
-
- return true
-}
-
-type operator int
-
-const (
- operatorPresent = iota
- operatorEqual
- operatorNotEqual
- operatorMatches
-)
-
-func (op operator) String() string {
- switch op {
- case operatorPresent:
- return "?"
- case operatorEqual:
- return "=="
- case operatorNotEqual:
- return "!="
- case operatorMatches:
- return "~="
- }
-
- return "unknown"
-}
-
-type selector struct {
- fieldpath []string
- operator operator
- value string
- re *regexp.Regexp
-}
-
-func (m selector) Match(adaptor Adaptor) bool {
- value, present := adaptor.Field(m.fieldpath)
-
- switch m.operator {
- case operatorPresent:
- return present
- case operatorEqual:
- return present && value == m.value
- case operatorNotEqual:
- return value != m.value
- case operatorMatches:
- if m.re == nil {
- r, err := regexp.Compile(m.value)
- if err != nil {
- log.L.Errorf("error compiling regexp %q", m.value)
- return false
- }
-
- m.re = r
- }
-
- return m.re.MatchString(value)
- default:
- return false
- }
-}
diff --git a/vendor/github.com/containerd/containerd/filters/parser.go b/vendor/github.com/containerd/containerd/filters/parser.go
deleted file mode 100644
index 0825d668c..000000000
--- a/vendor/github.com/containerd/containerd/filters/parser.go
+++ /dev/null
@@ -1,292 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package filters
-
-import (
- "fmt"
- "io"
-
- "github.com/containerd/containerd/errdefs"
- "github.com/pkg/errors"
-)
-
-/*
-Parse the strings into a filter that may be used with an adaptor.
-
-The filter is made up of zero or more selectors.
-
-The format is a comma separated list of expressions, in the form of
-``, known as selectors. All selectors must match the
-target object for the filter to be true.
-
-We define the operators "==" for equality, "!=" for not equal and "~=" for a
-regular expression. If the operator and value are not present, the matcher will
-test for the presence of a value, as defined by the target object.
-
-The formal grammar is as follows:
-
-selectors := selector ("," selector)*
-selector := fieldpath (operator value)
-fieldpath := field ('.' field)*
-field := quoted | [A-Za-z] [A-Za-z0-9_]+
-operator := "==" | "!=" | "~="
-value := quoted | [^\s,]+
-quoted :=
-
-*/
-func Parse(s string) (Filter, error) {
- // special case empty to match all
- if s == "" {
- return Always, nil
- }
-
- p := parser{input: s}
- return p.parse()
-}
-
-// ParseAll parses each filter in ss and returns a filter that will return true
-// if any filter matches the expression.
-//
-// If no filters are provided, the filter will match anything.
-func ParseAll(ss ...string) (Filter, error) {
- if len(ss) == 0 {
- return Always, nil
- }
-
- var fs []Filter
- for _, s := range ss {
- f, err := Parse(s)
- if err != nil {
- return nil, errors.Wrap(errdefs.ErrInvalidArgument, err.Error())
- }
-
- fs = append(fs, f)
- }
-
- return Any(fs), nil
-}
-
-type parser struct {
- input string
- scanner scanner
-}
-
-func (p *parser) parse() (Filter, error) {
- p.scanner.init(p.input)
-
- ss, err := p.selectors()
- if err != nil {
- return nil, errors.Wrap(err, "filters")
- }
-
- return ss, nil
-}
-
-func (p *parser) selectors() (Filter, error) {
- s, err := p.selector()
- if err != nil {
- return nil, err
- }
-
- ss := All{s}
-
-loop:
- for {
- tok := p.scanner.peek()
- switch tok {
- case ',':
- pos, tok, _ := p.scanner.scan()
- if tok != tokenSeparator {
- return nil, p.mkerr(pos, "expected a separator")
- }
-
- s, err := p.selector()
- if err != nil {
- return nil, err
- }
-
- ss = append(ss, s)
- case tokenEOF:
- break loop
- default:
- return nil, p.mkerr(p.scanner.ppos, "unexpected input: %v", string(tok))
- }
- }
-
- return ss, nil
-}
-
-func (p *parser) selector() (selector, error) {
- fieldpath, err := p.fieldpath()
- if err != nil {
- return selector{}, err
- }
-
- switch p.scanner.peek() {
- case ',', tokenSeparator, tokenEOF:
- return selector{
- fieldpath: fieldpath,
- operator: operatorPresent,
- }, nil
- }
-
- op, err := p.operator()
- if err != nil {
- return selector{}, err
- }
-
- var allowAltQuotes bool
- if op == operatorMatches {
- allowAltQuotes = true
- }
-
- value, err := p.value(allowAltQuotes)
- if err != nil {
- if err == io.EOF {
- return selector{}, io.ErrUnexpectedEOF
- }
- return selector{}, err
- }
-
- return selector{
- fieldpath: fieldpath,
- value: value,
- operator: op,
- }, nil
-}
-
-func (p *parser) fieldpath() ([]string, error) {
- f, err := p.field()
- if err != nil {
- return nil, err
- }
-
- fs := []string{f}
-loop:
- for {
- tok := p.scanner.peek() // lookahead to consume field separator
-
- switch tok {
- case '.':
- pos, tok, _ := p.scanner.scan() // consume separator
- if tok != tokenSeparator {
- return nil, p.mkerr(pos, "expected a field separator (`.`)")
- }
-
- f, err := p.field()
- if err != nil {
- return nil, err
- }
-
- fs = append(fs, f)
- default:
- // let the layer above handle the other bad cases.
- break loop
- }
- }
-
- return fs, nil
-}
-
-func (p *parser) field() (string, error) {
- pos, tok, s := p.scanner.scan()
- switch tok {
- case tokenField:
- return s, nil
- case tokenQuoted:
- return p.unquote(pos, s, false)
- case tokenIllegal:
- return "", p.mkerr(pos, p.scanner.err)
- }
-
- return "", p.mkerr(pos, "expected field or quoted")
-}
-
-func (p *parser) operator() (operator, error) {
- pos, tok, s := p.scanner.scan()
- switch tok {
- case tokenOperator:
- switch s {
- case "==":
- return operatorEqual, nil
- case "!=":
- return operatorNotEqual, nil
- case "~=":
- return operatorMatches, nil
- default:
- return 0, p.mkerr(pos, "unsupported operator %q", s)
- }
- case tokenIllegal:
- return 0, p.mkerr(pos, p.scanner.err)
- }
-
- return 0, p.mkerr(pos, `expected an operator ("=="|"!="|"~=")`)
-}
-
-func (p *parser) value(allowAltQuotes bool) (string, error) {
- pos, tok, s := p.scanner.scan()
-
- switch tok {
- case tokenValue, tokenField:
- return s, nil
- case tokenQuoted:
- return p.unquote(pos, s, allowAltQuotes)
- case tokenIllegal:
- return "", p.mkerr(pos, p.scanner.err)
- }
-
- return "", p.mkerr(pos, "expected value or quoted")
-}
-
-func (p *parser) unquote(pos int, s string, allowAlts bool) (string, error) {
- if !allowAlts && s[0] != '\'' && s[0] != '"' {
- return "", p.mkerr(pos, "invalid quote encountered")
- }
-
- uq, err := unquote(s)
- if err != nil {
- return "", p.mkerr(pos, "unquoting failed: %v", err)
- }
-
- return uq, nil
-}
-
-type parseError struct {
- input string
- pos int
- msg string
-}
-
-func (pe parseError) Error() string {
- if pe.pos < len(pe.input) {
- before := pe.input[:pe.pos]
- location := pe.input[pe.pos : pe.pos+1] // need to handle end
- after := pe.input[pe.pos+1:]
-
- return fmt.Sprintf("[%s >|%s|< %s]: %v", before, location, after, pe.msg)
- }
-
- return fmt.Sprintf("[%s]: %v", pe.input, pe.msg)
-}
-
-func (p *parser) mkerr(pos int, format string, args ...interface{}) error {
- return errors.Wrap(parseError{
- input: p.input,
- pos: pos,
- msg: fmt.Sprintf(format, args...),
- }, "parse error")
-}
diff --git a/vendor/github.com/containerd/containerd/filters/quote.go b/vendor/github.com/containerd/containerd/filters/quote.go
deleted file mode 100644
index 2d64e23a3..000000000
--- a/vendor/github.com/containerd/containerd/filters/quote.go
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package filters
-
-import (
- "unicode/utf8"
-
- "github.com/pkg/errors"
-)
-
-// NOTE(stevvooe): Most of this code in this file is copied from the stdlib
-// strconv package and modified to be able to handle quoting with `/` and `|`
-// as delimiters. The copyright is held by the Go authors.
-
-var errQuoteSyntax = errors.New("quote syntax error")
-
-// UnquoteChar decodes the first character or byte in the escaped string
-// or character literal represented by the string s.
-// It returns four values:
-//
-// 1) value, the decoded Unicode code point or byte value;
-// 2) multibyte, a boolean indicating whether the decoded character requires a multibyte UTF-8 representation;
-// 3) tail, the remainder of the string after the character; and
-// 4) an error that will be nil if the character is syntactically valid.
-//
-// The second argument, quote, specifies the type of literal being parsed
-// and therefore which escaped quote character is permitted.
-// If set to a single quote, it permits the sequence \' and disallows unescaped '.
-// If set to a double quote, it permits \" and disallows unescaped ".
-// If set to zero, it does not permit either escape and allows both quote characters to appear unescaped.
-//
-// This is from Go strconv package, modified to support `|` and `/` as double
-// quotes for use with regular expressions.
-func unquoteChar(s string, quote byte) (value rune, multibyte bool, tail string, err error) {
- // easy cases
- switch c := s[0]; {
- case c == quote && (quote == '\'' || quote == '"' || quote == '/' || quote == '|'):
- err = errQuoteSyntax
- return
- case c >= utf8.RuneSelf:
- r, size := utf8.DecodeRuneInString(s)
- return r, true, s[size:], nil
- case c != '\\':
- return rune(s[0]), false, s[1:], nil
- }
-
- // hard case: c is backslash
- if len(s) <= 1 {
- err = errQuoteSyntax
- return
- }
- c := s[1]
- s = s[2:]
-
- switch c {
- case 'a':
- value = '\a'
- case 'b':
- value = '\b'
- case 'f':
- value = '\f'
- case 'n':
- value = '\n'
- case 'r':
- value = '\r'
- case 't':
- value = '\t'
- case 'v':
- value = '\v'
- case 'x', 'u', 'U':
- n := 0
- switch c {
- case 'x':
- n = 2
- case 'u':
- n = 4
- case 'U':
- n = 8
- }
- var v rune
- if len(s) < n {
- err = errQuoteSyntax
- return
- }
- for j := 0; j < n; j++ {
- x, ok := unhex(s[j])
- if !ok {
- err = errQuoteSyntax
- return
- }
- v = v<<4 | x
- }
- s = s[n:]
- if c == 'x' {
- // single-byte string, possibly not UTF-8
- value = v
- break
- }
- if v > utf8.MaxRune {
- err = errQuoteSyntax
- return
- }
- value = v
- multibyte = true
- case '0', '1', '2', '3', '4', '5', '6', '7':
- v := rune(c) - '0'
- if len(s) < 2 {
- err = errQuoteSyntax
- return
- }
- for j := 0; j < 2; j++ { // one digit already; two more
- x := rune(s[j]) - '0'
- if x < 0 || x > 7 {
- err = errQuoteSyntax
- return
- }
- v = (v << 3) | x
- }
- s = s[2:]
- if v > 255 {
- err = errQuoteSyntax
- return
- }
- value = v
- case '\\':
- value = '\\'
- case '\'', '"', '|', '/':
- if c != quote {
- err = errQuoteSyntax
- return
- }
- value = rune(c)
- default:
- err = errQuoteSyntax
- return
- }
- tail = s
- return
-}
-
-// unquote interprets s as a single-quoted, double-quoted,
-// or backquoted Go string literal, returning the string value
-// that s quotes. (If s is single-quoted, it would be a Go
-// character literal; Unquote returns the corresponding
-// one-character string.)
-//
-// This is modified from the standard library to support `|` and `/` as quote
-// characters for use with regular expressions.
-func unquote(s string) (string, error) {
- n := len(s)
- if n < 2 {
- return "", errQuoteSyntax
- }
- quote := s[0]
- if quote != s[n-1] {
- return "", errQuoteSyntax
- }
- s = s[1 : n-1]
-
- if quote == '`' {
- if contains(s, '`') {
- return "", errQuoteSyntax
- }
- if contains(s, '\r') {
- // -1 because we know there is at least one \r to remove.
- buf := make([]byte, 0, len(s)-1)
- for i := 0; i < len(s); i++ {
- if s[i] != '\r' {
- buf = append(buf, s[i])
- }
- }
- return string(buf), nil
- }
- return s, nil
- }
- if quote != '"' && quote != '\'' && quote != '|' && quote != '/' {
- return "", errQuoteSyntax
- }
- if contains(s, '\n') {
- return "", errQuoteSyntax
- }
-
- // Is it trivial? Avoid allocation.
- if !contains(s, '\\') && !contains(s, quote) {
- switch quote {
- case '"', '/', '|': // pipe and slash are treated like double quote
- return s, nil
- case '\'':
- r, size := utf8.DecodeRuneInString(s)
- if size == len(s) && (r != utf8.RuneError || size != 1) {
- return s, nil
- }
- }
- }
-
- var runeTmp [utf8.UTFMax]byte
- buf := make([]byte, 0, 3*len(s)/2) // Try to avoid more allocations.
- for len(s) > 0 {
- c, multibyte, ss, err := unquoteChar(s, quote)
- if err != nil {
- return "", err
- }
- s = ss
- if c < utf8.RuneSelf || !multibyte {
- buf = append(buf, byte(c))
- } else {
- n := utf8.EncodeRune(runeTmp[:], c)
- buf = append(buf, runeTmp[:n]...)
- }
- if quote == '\'' && len(s) != 0 {
- // single-quoted must be single character
- return "", errQuoteSyntax
- }
- }
- return string(buf), nil
-}
-
-// contains reports whether the string contains the byte c.
-func contains(s string, c byte) bool {
- for i := 0; i < len(s); i++ {
- if s[i] == c {
- return true
- }
- }
- return false
-}
-
-func unhex(b byte) (v rune, ok bool) {
- c := rune(b)
- switch {
- case '0' <= c && c <= '9':
- return c - '0', true
- case 'a' <= c && c <= 'f':
- return c - 'a' + 10, true
- case 'A' <= c && c <= 'F':
- return c - 'A' + 10, true
- }
- return
-}
diff --git a/vendor/github.com/containerd/containerd/filters/scanner.go b/vendor/github.com/containerd/containerd/filters/scanner.go
deleted file mode 100644
index 6a485467b..000000000
--- a/vendor/github.com/containerd/containerd/filters/scanner.go
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package filters
-
-import (
- "unicode"
- "unicode/utf8"
-)
-
-const (
- tokenEOF = -(iota + 1)
- tokenQuoted
- tokenValue
- tokenField
- tokenSeparator
- tokenOperator
- tokenIllegal
-)
-
-type token rune
-
-func (t token) String() string {
- switch t {
- case tokenEOF:
- return "EOF"
- case tokenQuoted:
- return "Quoted"
- case tokenValue:
- return "Value"
- case tokenField:
- return "Field"
- case tokenSeparator:
- return "Separator"
- case tokenOperator:
- return "Operator"
- case tokenIllegal:
- return "Illegal"
- }
-
- return string(t)
-}
-
-func (t token) GoString() string {
- return "token" + t.String()
-}
-
-type scanner struct {
- input string
- pos int
- ppos int // bounds the current rune in the string
- value bool
- err string
-}
-
-func (s *scanner) init(input string) {
- s.input = input
- s.pos = 0
- s.ppos = 0
-}
-
-func (s *scanner) next() rune {
- if s.pos >= len(s.input) {
- return tokenEOF
- }
- s.pos = s.ppos
-
- r, w := utf8.DecodeRuneInString(s.input[s.ppos:])
- s.ppos += w
- if r == utf8.RuneError {
- if w > 0 {
- s.error("rune error")
- return tokenIllegal
- }
- return tokenEOF
- }
-
- if r == 0 {
- s.error("unexpected null")
- return tokenIllegal
- }
-
- return r
-}
-
-func (s *scanner) peek() rune {
- pos := s.pos
- ppos := s.ppos
- ch := s.next()
- s.pos = pos
- s.ppos = ppos
- return ch
-}
-
-func (s *scanner) scan() (nextp int, tk token, text string) {
- var (
- ch = s.next()
- pos = s.pos
- )
-
-chomp:
- switch {
- case ch == tokenEOF:
- case ch == tokenIllegal:
- case isQuoteRune(ch):
- if !s.scanQuoted(ch) {
- return pos, tokenIllegal, s.input[pos:s.ppos]
- }
- return pos, tokenQuoted, s.input[pos:s.ppos]
- case isSeparatorRune(ch):
- s.value = false
- return pos, tokenSeparator, s.input[pos:s.ppos]
- case isOperatorRune(ch):
- s.scanOperator()
- s.value = true
- return pos, tokenOperator, s.input[pos:s.ppos]
- case unicode.IsSpace(ch):
- // chomp
- ch = s.next()
- pos = s.pos
- goto chomp
- case s.value:
- s.scanValue()
- s.value = false
- return pos, tokenValue, s.input[pos:s.ppos]
- case isFieldRune(ch):
- s.scanField()
- return pos, tokenField, s.input[pos:s.ppos]
- }
-
- return s.pos, token(ch), ""
-}
-
-func (s *scanner) scanField() {
- for {
- ch := s.peek()
- if !isFieldRune(ch) {
- break
- }
- s.next()
- }
-}
-
-func (s *scanner) scanOperator() {
- for {
- ch := s.peek()
- switch ch {
- case '=', '!', '~':
- s.next()
- default:
- return
- }
- }
-}
-
-func (s *scanner) scanValue() {
- for {
- ch := s.peek()
- if !isValueRune(ch) {
- break
- }
- s.next()
- }
-}
-
-func (s *scanner) scanQuoted(quote rune) bool {
- var illegal bool
- ch := s.next() // read character after quote
- for ch != quote {
- if ch == '\n' || ch < 0 {
- s.error("quoted literal not terminated")
- return false
- }
- if ch == '\\' {
- var legal bool
- ch, legal = s.scanEscape(quote)
- if !legal {
- illegal = true
- }
- } else {
- ch = s.next()
- }
- }
- return !illegal
-}
-
-func (s *scanner) scanEscape(quote rune) (ch rune, legal bool) {
- ch = s.next() // read character after '/'
- switch ch {
- case 'a', 'b', 'f', 'n', 'r', 't', 'v', '\\', quote:
- // nothing to do
- ch = s.next()
- legal = true
- case '0', '1', '2', '3', '4', '5', '6', '7':
- ch, legal = s.scanDigits(ch, 8, 3)
- case 'x':
- ch, legal = s.scanDigits(s.next(), 16, 2)
- case 'u':
- ch, legal = s.scanDigits(s.next(), 16, 4)
- case 'U':
- ch, legal = s.scanDigits(s.next(), 16, 8)
- default:
- s.error("illegal escape sequence")
- }
- return
-}
-
-func (s *scanner) scanDigits(ch rune, base, n int) (rune, bool) {
- for n > 0 && digitVal(ch) < base {
- ch = s.next()
- n--
- }
- if n > 0 {
- s.error("illegal numeric escape sequence")
- return ch, false
- }
- return ch, true
-}
-
-func (s *scanner) error(msg string) {
- if s.err == "" {
- s.err = msg
- }
-}
-
-func digitVal(ch rune) int {
- switch {
- case '0' <= ch && ch <= '9':
- return int(ch - '0')
- case 'a' <= ch && ch <= 'f':
- return int(ch - 'a' + 10)
- case 'A' <= ch && ch <= 'F':
- return int(ch - 'A' + 10)
- }
- return 16 // larger than any legal digit val
-}
-
-func isFieldRune(r rune) bool {
- return (r == '_' || isAlphaRune(r) || isDigitRune(r))
-}
-
-func isAlphaRune(r rune) bool {
- return r >= 'A' && r <= 'Z' || r >= 'a' && r <= 'z'
-}
-
-func isDigitRune(r rune) bool {
- return r >= '0' && r <= '9'
-}
-
-func isOperatorRune(r rune) bool {
- switch r {
- case '=', '!', '~':
- return true
- }
-
- return false
-}
-
-func isQuoteRune(r rune) bool {
- switch r {
- case '/', '|', '"': // maybe add single quoting?
- return true
- }
-
- return false
-}
-
-func isSeparatorRune(r rune) bool {
- switch r {
- case ',', '.':
- return true
- }
-
- return false
-}
-
-func isValueRune(r rune) bool {
- return r != ',' && !unicode.IsSpace(r) &&
- (unicode.IsLetter(r) ||
- unicode.IsDigit(r) ||
- unicode.IsNumber(r) ||
- unicode.IsGraphic(r) ||
- unicode.IsPunct(r))
-}
diff --git a/vendor/github.com/containerd/containerd/gc/gc.go b/vendor/github.com/containerd/containerd/gc/gc.go
deleted file mode 100644
index 4f71cb305..000000000
--- a/vendor/github.com/containerd/containerd/gc/gc.go
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-// Package gc experiments with providing central gc tooling to ensure
-// deterministic resource removal within containerd.
-//
-// For now, we just have a single exported implementation that can be used
-// under certain use cases.
-package gc
-
-import (
- "context"
- "sync"
- "time"
-)
-
-// ResourceType represents type of resource at a node
-type ResourceType uint8
-
-// ResourceMax represents the max resource.
-// Upper bits are stripped out during the mark phase, allowing the upper 3 bits
-// to be used by the caller reference function.
-const ResourceMax = ResourceType(0x1F)
-
-// Node presents a resource which has a type and key,
-// this node can be used to lookup other nodes.
-type Node struct {
- Type ResourceType
- Namespace string
- Key string
-}
-
-// Stats about a garbage collection run
-type Stats interface {
- Elapsed() time.Duration
-}
-
-// Tricolor implements basic, single-thread tri-color GC. Given the roots, the
-// complete set and a refs function, this function returns a map of all
-// reachable objects.
-//
-// Correct usage requires that the caller not allow the arguments to change
-// until the result is used to delete objects in the system.
-//
-// It will allocate memory proportional to the size of the reachable set.
-//
-// We can probably use this to inform a design for incremental GC by injecting
-// callbacks to the set modification algorithms.
-func Tricolor(roots []Node, refs func(ref Node) ([]Node, error)) (map[Node]struct{}, error) {
- var (
- grays []Node // maintain a gray "stack"
- seen = map[Node]struct{}{} // or not "white", basically "seen"
- reachable = map[Node]struct{}{} // or "black", in tri-color parlance
- )
-
- grays = append(grays, roots...)
-
- for len(grays) > 0 {
- // Pick any gray object
- id := grays[len(grays)-1] // effectively "depth first" because first element
- grays = grays[:len(grays)-1]
- seen[id] = struct{}{} // post-mark this as not-white
- rs, err := refs(id)
- if err != nil {
- return nil, err
- }
-
- // mark all the referenced objects as gray
- for _, target := range rs {
- if _, ok := seen[target]; !ok {
- grays = append(grays, target)
- }
- }
-
- // strip bits above max resource type
- id.Type = id.Type & ResourceMax
- // mark as black when done
- reachable[id] = struct{}{}
- }
-
- return reachable, nil
-}
-
-// ConcurrentMark implements simple, concurrent GC. All the roots are scanned
-// and the complete set of references is formed by calling the refs function
-// for each seen object. This function returns a map of all object reachable
-// from a root.
-//
-// Correct usage requires that the caller not allow the arguments to change
-// until the result is used to delete objects in the system.
-//
-// It will allocate memory proportional to the size of the reachable set.
-func ConcurrentMark(ctx context.Context, root <-chan Node, refs func(context.Context, Node, func(Node)) error) (map[Node]struct{}, error) {
- ctx, cancel := context.WithCancel(ctx)
- defer cancel()
-
- var (
- grays = make(chan Node)
- seen = map[Node]struct{}{} // or not "white", basically "seen"
- wg sync.WaitGroup
-
- errOnce sync.Once
- refErr error
- )
-
- go func() {
- for gray := range grays {
- if _, ok := seen[gray]; ok {
- wg.Done()
- continue
- }
- seen[gray] = struct{}{} // post-mark this as non-white
-
- go func(gray Node) {
- defer wg.Done()
-
- send := func(n Node) {
- wg.Add(1)
- select {
- case grays <- n:
- case <-ctx.Done():
- wg.Done()
- }
- }
-
- if err := refs(ctx, gray, send); err != nil {
- errOnce.Do(func() {
- refErr = err
- cancel()
- })
- }
-
- }(gray)
- }
- }()
-
- for r := range root {
- wg.Add(1)
- select {
- case grays <- r:
- case <-ctx.Done():
- wg.Done()
- }
-
- }
-
- // Wait for outstanding grays to be processed
- wg.Wait()
-
- close(grays)
-
- if refErr != nil {
- return nil, refErr
- }
- if cErr := ctx.Err(); cErr != nil {
- return nil, cErr
- }
-
- return seen, nil
-}
-
-// Sweep removes all nodes returned through the slice which are not in
-// the reachable set by calling the provided remove function.
-func Sweep(reachable map[Node]struct{}, all []Node, remove func(Node) error) error {
- // All black objects are now reachable, and all white objects are
- // unreachable. Free those that are white!
- for _, node := range all {
- if _, ok := reachable[node]; !ok {
- if err := remove(node); err != nil {
- return err
- }
- }
- }
-
- return nil
-}
diff --git a/vendor/github.com/containerd/containerd/gc/scheduler/scheduler.go b/vendor/github.com/containerd/containerd/gc/scheduler/scheduler.go
deleted file mode 100644
index f5890fb74..000000000
--- a/vendor/github.com/containerd/containerd/gc/scheduler/scheduler.go
+++ /dev/null
@@ -1,356 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package scheduler
-
-import (
- "context"
- "fmt"
- "sync"
- "time"
-
- "github.com/containerd/containerd/gc"
- "github.com/containerd/containerd/log"
- "github.com/containerd/containerd/plugin"
- "github.com/pkg/errors"
-)
-
-// config configures the garbage collection policies.
-type config struct {
- // PauseThreshold represents the maximum amount of time garbage
- // collection should be scheduled based on the average pause time.
- // For example, a value of 0.02 means that scheduled garbage collection
- // pauses should present at most 2% of real time,
- // or 20ms of every second.
- //
- // A maximum value of .5 is enforced to prevent over scheduling of the
- // garbage collector, trigger options are available to run in a more
- // predictable time frame after mutation.
- //
- // Default is 0.02
- PauseThreshold float64 `toml:"pause_threshold"`
-
- // DeletionThreshold is used to guarantee that a garbage collection is
- // scheduled after configured number of deletions have occurred
- // since the previous garbage collection. A value of 0 indicates that
- // garbage collection will not be triggered by deletion count.
- //
- // Default 0
- DeletionThreshold int `toml:"deletion_threshold"`
-
- // MutationThreshold is used to guarantee that a garbage collection is
- // run after a configured number of database mutations have occurred
- // since the previous garbage collection. A value of 0 indicates that
- // garbage collection will only be run after a manual trigger or
- // deletion. Unlike the deletion threshold, the mutation threshold does
- // not cause scheduling of a garbage collection, but ensures GC is run
- // at the next scheduled GC.
- //
- // Default 100
- MutationThreshold int `toml:"mutation_threshold"`
-
- // ScheduleDelay is the duration in the future to schedule a garbage
- // collection triggered manually or by exceeding the configured
- // threshold for deletion or mutation. A zero value will immediately
- // schedule. Use suffix "ms" for millisecond and "s" for second.
- //
- // Default is "0ms"
- ScheduleDelay duration `toml:"schedule_delay"`
-
- // StartupDelay is the delay duration to do an initial garbage
- // collection after startup. The initial garbage collection is used to
- // set the base for pause threshold and should be scheduled in the
- // future to avoid slowing down other startup processes. Use suffix
- // "ms" for millisecond and "s" for second.
- //
- // Default is "100ms"
- StartupDelay duration `toml:"startup_delay"`
-}
-
-type duration time.Duration
-
-func (d *duration) UnmarshalText(text []byte) error {
- ed, err := time.ParseDuration(string(text))
- if err != nil {
- return err
- }
- *d = duration(ed)
- return nil
-}
-
-func (d duration) MarshalText() (text []byte, err error) {
- return []byte(time.Duration(d).String()), nil
-}
-
-func init() {
- plugin.Register(&plugin.Registration{
- Type: plugin.GCPlugin,
- ID: "scheduler",
- Requires: []plugin.Type{
- plugin.MetadataPlugin,
- },
- Config: &config{
- PauseThreshold: 0.02,
- DeletionThreshold: 0,
- MutationThreshold: 100,
- ScheduleDelay: duration(0),
- StartupDelay: duration(100 * time.Millisecond),
- },
- InitFn: func(ic *plugin.InitContext) (interface{}, error) {
- md, err := ic.Get(plugin.MetadataPlugin)
- if err != nil {
- return nil, err
- }
-
- mdCollector, ok := md.(collector)
- if !ok {
- return nil, errors.Errorf("%s %T must implement collector", plugin.MetadataPlugin, md)
- }
-
- m := newScheduler(mdCollector, ic.Config.(*config))
-
- ic.Meta.Exports = map[string]string{
- "PauseThreshold": fmt.Sprint(m.pauseThreshold),
- "DeletionThreshold": fmt.Sprint(m.deletionThreshold),
- "MutationThreshold": fmt.Sprint(m.mutationThreshold),
- "ScheduleDelay": fmt.Sprint(m.scheduleDelay),
- }
-
- go m.run(ic.Context)
-
- return m, nil
- },
- })
-}
-
-type mutationEvent struct {
- ts time.Time
- mutation bool
- dirty bool
-}
-
-type collector interface {
- RegisterMutationCallback(func(bool))
- GarbageCollect(context.Context) (gc.Stats, error)
-}
-
-type gcScheduler struct {
- c collector
-
- eventC chan mutationEvent
-
- waiterL sync.Mutex
- waiters []chan gc.Stats
-
- pauseThreshold float64
- deletionThreshold int
- mutationThreshold int
- scheduleDelay time.Duration
- startupDelay time.Duration
-}
-
-func newScheduler(c collector, cfg *config) *gcScheduler {
- eventC := make(chan mutationEvent)
-
- s := &gcScheduler{
- c: c,
- eventC: eventC,
- pauseThreshold: cfg.PauseThreshold,
- deletionThreshold: cfg.DeletionThreshold,
- mutationThreshold: cfg.MutationThreshold,
- scheduleDelay: time.Duration(cfg.ScheduleDelay),
- startupDelay: time.Duration(cfg.StartupDelay),
- }
-
- if s.pauseThreshold < 0.0 {
- s.pauseThreshold = 0.0
- }
- if s.pauseThreshold > 0.5 {
- s.pauseThreshold = 0.5
- }
- if s.mutationThreshold < 0 {
- s.mutationThreshold = 0
- }
- if s.scheduleDelay < 0 {
- s.scheduleDelay = 0
- }
- if s.startupDelay < 0 {
- s.startupDelay = 0
- }
-
- c.RegisterMutationCallback(s.mutationCallback)
-
- return s
-}
-
-func (s *gcScheduler) ScheduleAndWait(ctx context.Context) (gc.Stats, error) {
- return s.wait(ctx, true)
-}
-
-func (s *gcScheduler) wait(ctx context.Context, trigger bool) (gc.Stats, error) {
- wc := make(chan gc.Stats, 1)
- s.waiterL.Lock()
- s.waiters = append(s.waiters, wc)
- s.waiterL.Unlock()
-
- if trigger {
- e := mutationEvent{
- ts: time.Now(),
- }
- go func() {
- s.eventC <- e
- }()
- }
-
- var gcStats gc.Stats
- select {
- case stats, ok := <-wc:
- if !ok {
- return gcStats, errors.New("gc failed")
- }
- gcStats = stats
- case <-ctx.Done():
- return gcStats, ctx.Err()
- }
-
- return gcStats, nil
-}
-
-func (s *gcScheduler) mutationCallback(dirty bool) {
- e := mutationEvent{
- ts: time.Now(),
- mutation: true,
- dirty: dirty,
- }
- go func() {
- s.eventC <- e
- }()
-}
-
-func schedule(d time.Duration) (<-chan time.Time, *time.Time) {
- next := time.Now().Add(d)
- return time.After(d), &next
-}
-
-func (s *gcScheduler) run(ctx context.Context) {
- var (
- schedC <-chan time.Time
-
- lastCollection *time.Time
- nextCollection *time.Time
-
- interval = time.Second
- gcTime time.Duration
- collections int
- // TODO(dmcg): expose collection stats as metrics
-
- triggered bool
- deletions int
- mutations int
- )
- if s.startupDelay > 0 {
- schedC, nextCollection = schedule(s.startupDelay)
- }
- for {
- select {
- case <-schedC:
- // Check if garbage collection can be skipped because
- // it is not needed or was not requested and reschedule
- // it to attempt again after another time interval.
- if !triggered && lastCollection != nil && deletions == 0 &&
- (s.mutationThreshold == 0 || mutations < s.mutationThreshold) {
- schedC, nextCollection = schedule(interval)
- continue
- }
- case e := <-s.eventC:
- if lastCollection != nil && lastCollection.After(e.ts) {
- continue
- }
- if e.dirty {
- deletions++
- }
- if e.mutation {
- mutations++
- } else {
- triggered = true
- }
-
- // Check if condition should cause immediate collection.
- if triggered ||
- (s.deletionThreshold > 0 && deletions >= s.deletionThreshold) ||
- (nextCollection == nil && ((s.deletionThreshold == 0 && deletions > 0) ||
- (s.mutationThreshold > 0 && mutations >= s.mutationThreshold))) {
- // Check if not already scheduled before delay threshold
- if nextCollection == nil || nextCollection.After(time.Now().Add(s.scheduleDelay)) {
- // TODO(dmcg): track re-schedules for tuning schedule config
- schedC, nextCollection = schedule(s.scheduleDelay)
- }
- }
-
- continue
- case <-ctx.Done():
- return
- }
-
- s.waiterL.Lock()
-
- stats, err := s.c.GarbageCollect(ctx)
- last := time.Now()
- if err != nil {
- log.G(ctx).WithError(err).Error("garbage collection failed")
-
- // Reschedule garbage collection for same duration + 1 second
- schedC, nextCollection = schedule(nextCollection.Sub(*lastCollection) + time.Second)
-
- // Update last collection time even though failure occurred
- lastCollection = &last
-
- for _, w := range s.waiters {
- close(w)
- }
- s.waiters = nil
- s.waiterL.Unlock()
- continue
- }
-
- log.G(ctx).WithField("d", stats.Elapsed()).Debug("garbage collected")
-
- gcTime += stats.Elapsed()
- collections++
- triggered = false
- deletions = 0
- mutations = 0
-
- // Calculate new interval with updated times
- if s.pauseThreshold > 0.0 {
- // Set interval to average gc time divided by the pause threshold
- // This algorithm ensures that a gc is scheduled to allow enough
- // runtime in between gc to reach the pause threshold.
- // Pause threshold is always 0.0 < threshold <= 0.5
- avg := float64(gcTime) / float64(collections)
- interval = time.Duration(avg/s.pauseThreshold - avg)
- }
-
- lastCollection = &last
- schedC, nextCollection = schedule(interval)
-
- for _, w := range s.waiters {
- w <- stats
- }
- s.waiters = nil
- s.waiterL.Unlock()
- }
-}
diff --git a/vendor/github.com/containerd/containerd/grpc.go b/vendor/github.com/containerd/containerd/grpc.go
deleted file mode 100644
index c3506d735..000000000
--- a/vendor/github.com/containerd/containerd/grpc.go
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package containerd
-
-import (
- "context"
-
- "github.com/containerd/containerd/namespaces"
- "google.golang.org/grpc"
-)
-
-type namespaceInterceptor struct {
- namespace string
-}
-
-func (ni namespaceInterceptor) unary(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
- _, ok := namespaces.Namespace(ctx)
- if !ok {
- ctx = namespaces.WithNamespace(ctx, ni.namespace)
- }
- return invoker(ctx, method, req, reply, cc, opts...)
-}
-
-func (ni namespaceInterceptor) stream(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error) {
- _, ok := namespaces.Namespace(ctx)
- if !ok {
- ctx = namespaces.WithNamespace(ctx, ni.namespace)
- }
-
- return streamer(ctx, desc, cc, method, opts...)
-}
-
-func newNSInterceptors(ns string) (grpc.UnaryClientInterceptor, grpc.StreamClientInterceptor) {
- ni := namespaceInterceptor{
- namespace: ns,
- }
- return grpc.UnaryClientInterceptor(ni.unary), grpc.StreamClientInterceptor(ni.stream)
-}
diff --git a/vendor/github.com/containerd/containerd/identifiers/validate.go b/vendor/github.com/containerd/containerd/identifiers/validate.go
deleted file mode 100644
index f52317b49..000000000
--- a/vendor/github.com/containerd/containerd/identifiers/validate.go
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-// Package identifiers provides common validation for identifiers and keys
-// across containerd.
-//
-// Identifiers in containerd must be a alphanumeric, allowing limited
-// underscores, dashes and dots.
-//
-// While the character set may be expanded in the future, identifiers
-// are guaranteed to be safely used as filesystem path components.
-package identifiers
-
-import (
- "regexp"
-
- "github.com/containerd/containerd/errdefs"
- "github.com/pkg/errors"
-)
-
-const (
- maxLength = 76
- alphanum = `[A-Za-z0-9]+`
- separators = `[._-]`
-)
-
-var (
- // identifierRe defines the pattern for valid identifiers.
- identifierRe = regexp.MustCompile(reAnchor(alphanum + reGroup(separators+reGroup(alphanum)) + "*"))
-)
-
-// Validate returns nil if the string s is a valid identifier.
-//
-// identifiers are similar to the domain name rules according to RFC 1035, section 2.3.1. However
-// rules in this package are relaxed to allow numerals to follow period (".") and mixed case is
-// allowed.
-//
-// In general identifiers that pass this validation should be safe for use as filesystem path components.
-func Validate(s string) error {
- if len(s) == 0 {
- return errors.Wrapf(errdefs.ErrInvalidArgument, "identifier must not be empty")
- }
-
- if len(s) > maxLength {
- return errors.Wrapf(errdefs.ErrInvalidArgument, "identifier %q greater than maximum length (%d characters)", s, maxLength)
- }
-
- if !identifierRe.MatchString(s) {
- return errors.Wrapf(errdefs.ErrInvalidArgument, "identifier %q must match %v", s, identifierRe)
- }
- return nil
-}
-
-func reGroup(s string) string {
- return `(?:` + s + `)`
-}
-
-func reAnchor(s string) string {
- return `^` + s + `$`
-}
diff --git a/vendor/github.com/containerd/containerd/image.go b/vendor/github.com/containerd/containerd/image.go
deleted file mode 100644
index c96b79301..000000000
--- a/vendor/github.com/containerd/containerd/image.go
+++ /dev/null
@@ -1,393 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package containerd
-
-import (
- "context"
- "fmt"
- "strings"
- "sync/atomic"
-
- "github.com/containerd/containerd/content"
- "github.com/containerd/containerd/diff"
- "github.com/containerd/containerd/errdefs"
- "github.com/containerd/containerd/images"
- "github.com/containerd/containerd/platforms"
- "github.com/containerd/containerd/rootfs"
- "github.com/containerd/containerd/snapshots"
- "github.com/opencontainers/go-digest"
- "github.com/opencontainers/image-spec/identity"
- ocispec "github.com/opencontainers/image-spec/specs-go/v1"
- "github.com/pkg/errors"
- "golang.org/x/sync/semaphore"
-)
-
-// Image describes an image used by containers
-type Image interface {
- // Name of the image
- Name() string
- // Target descriptor for the image content
- Target() ocispec.Descriptor
- // Labels of the image
- Labels() map[string]string
- // Unpack unpacks the image's content into a snapshot
- Unpack(context.Context, string, ...UnpackOpt) error
- // RootFS returns the unpacked diffids that make up images rootfs.
- RootFS(ctx context.Context) ([]digest.Digest, error)
- // Size returns the total size of the image's packed resources.
- Size(ctx context.Context) (int64, error)
- // Usage returns a usage calculation for the image.
- Usage(context.Context, ...UsageOpt) (int64, error)
- // Config descriptor for the image.
- Config(ctx context.Context) (ocispec.Descriptor, error)
- // IsUnpacked returns whether or not an image is unpacked.
- IsUnpacked(context.Context, string) (bool, error)
- // ContentStore provides a content store which contains image blob data
- ContentStore() content.Store
- // Metadata returns the underlying image metadata
- Metadata() images.Image
-}
-
-type usageOptions struct {
- manifestLimit *int
- manifestOnly bool
- snapshots bool
-}
-
-// UsageOpt is used to configure the usage calculation
-type UsageOpt func(*usageOptions) error
-
-// WithUsageManifestLimit sets the limit to the number of manifests which will
-// be walked for usage. Setting this value to 0 will require all manifests to
-// be walked, returning ErrNotFound if manifests are missing.
-// NOTE: By default all manifests which exist will be walked
-// and any non-existent manifests and their subobjects will be ignored.
-func WithUsageManifestLimit(i int) UsageOpt {
- // If 0 then don't filter any manifests
- // By default limits to current platform
- return func(o *usageOptions) error {
- o.manifestLimit = &i
- return nil
- }
-}
-
-// WithSnapshotUsage will check for referenced snapshots from the image objects
-// and include the snapshot size in the total usage.
-func WithSnapshotUsage() UsageOpt {
- return func(o *usageOptions) error {
- o.snapshots = true
- return nil
- }
-}
-
-// WithManifestUsage is used to get the usage for an image based on what is
-// reported by the manifests rather than what exists in the content store.
-// NOTE: This function is best used with the manifest limit set to get a
-// consistent value, otherwise non-existent manifests will be excluded.
-func WithManifestUsage() UsageOpt {
- return func(o *usageOptions) error {
- o.manifestOnly = true
- return nil
- }
-}
-
-var _ = (Image)(&image{})
-
-// NewImage returns a client image object from the metadata image
-func NewImage(client *Client, i images.Image) Image {
- return &image{
- client: client,
- i: i,
- platform: client.platform,
- }
-}
-
-// NewImageWithPlatform returns a client image object from the metadata image
-func NewImageWithPlatform(client *Client, i images.Image, platform platforms.MatchComparer) Image {
- return &image{
- client: client,
- i: i,
- platform: platform,
- }
-}
-
-type image struct {
- client *Client
-
- i images.Image
- platform platforms.MatchComparer
-}
-
-func (i *image) Metadata() images.Image {
- return i.i
-}
-
-func (i *image) Name() string {
- return i.i.Name
-}
-
-func (i *image) Target() ocispec.Descriptor {
- return i.i.Target
-}
-
-func (i *image) Labels() map[string]string {
- return i.i.Labels
-}
-
-func (i *image) RootFS(ctx context.Context) ([]digest.Digest, error) {
- provider := i.client.ContentStore()
- return i.i.RootFS(ctx, provider, i.platform)
-}
-
-func (i *image) Size(ctx context.Context) (int64, error) {
- return i.Usage(ctx, WithUsageManifestLimit(1), WithManifestUsage())
-}
-
-func (i *image) Usage(ctx context.Context, opts ...UsageOpt) (int64, error) {
- var config usageOptions
- for _, opt := range opts {
- if err := opt(&config); err != nil {
- return 0, err
- }
- }
-
- var (
- provider = i.client.ContentStore()
- handler = images.ChildrenHandler(provider)
- size int64
- mustExist bool
- )
-
- if config.manifestLimit != nil {
- handler = images.LimitManifests(handler, i.platform, *config.manifestLimit)
- mustExist = true
- }
-
- var wh images.HandlerFunc = func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
- var usage int64
- children, err := handler(ctx, desc)
- if err != nil {
- if !errdefs.IsNotFound(err) || mustExist {
- return nil, err
- }
- if !config.manifestOnly {
- // Do not count size of non-existent objects
- desc.Size = 0
- }
- } else if config.snapshots || !config.manifestOnly {
- info, err := provider.Info(ctx, desc.Digest)
- if err != nil {
- if !errdefs.IsNotFound(err) {
- return nil, err
- }
- if !config.manifestOnly {
- // Do not count size of non-existent objects
- desc.Size = 0
- }
- } else if info.Size > desc.Size {
- // Count actual usage, Size may be unset or -1
- desc.Size = info.Size
- }
-
- if config.snapshots {
- for k, v := range info.Labels {
- const prefix = "containerd.io/gc.ref.snapshot."
- if !strings.HasPrefix(k, prefix) {
- continue
- }
-
- sn := i.client.SnapshotService(k[len(prefix):])
- if sn == nil {
- continue
- }
-
- u, err := sn.Usage(ctx, v)
- if err != nil {
- if !errdefs.IsNotFound(err) && !errdefs.IsInvalidArgument(err) {
- return nil, err
- }
- } else {
- usage += u.Size
- }
- }
- }
- }
-
- // Ignore unknown sizes. Generally unknown sizes should
- // never be set in manifests, however, the usage
- // calculation does not need to enforce this.
- if desc.Size >= 0 {
- usage += desc.Size
- }
-
- atomic.AddInt64(&size, usage)
-
- return children, nil
- }
-
- l := semaphore.NewWeighted(3)
- if err := images.Dispatch(ctx, wh, l, i.i.Target); err != nil {
- return 0, err
- }
-
- return size, nil
-}
-
-func (i *image) Config(ctx context.Context) (ocispec.Descriptor, error) {
- provider := i.client.ContentStore()
- return i.i.Config(ctx, provider, i.platform)
-}
-
-func (i *image) IsUnpacked(ctx context.Context, snapshotterName string) (bool, error) {
- sn, err := i.client.getSnapshotter(ctx, snapshotterName)
- if err != nil {
- return false, err
- }
- cs := i.client.ContentStore()
-
- diffs, err := i.i.RootFS(ctx, cs, i.platform)
- if err != nil {
- return false, err
- }
-
- chainID := identity.ChainID(diffs)
- _, err = sn.Stat(ctx, chainID.String())
- if err == nil {
- return true, nil
- } else if !errdefs.IsNotFound(err) {
- return false, err
- }
-
- return false, nil
-}
-
-// UnpackConfig provides configuration for the unpack of an image
-type UnpackConfig struct {
- // ApplyOpts for applying a diff to a snapshotter
- ApplyOpts []diff.ApplyOpt
- // SnapshotOpts for configuring a snapshotter
- SnapshotOpts []snapshots.Opt
-}
-
-// UnpackOpt provides configuration for unpack
-type UnpackOpt func(context.Context, *UnpackConfig) error
-
-func (i *image) Unpack(ctx context.Context, snapshotterName string, opts ...UnpackOpt) error {
- ctx, done, err := i.client.WithLease(ctx)
- if err != nil {
- return err
- }
- defer done(ctx)
-
- var config UnpackConfig
- for _, o := range opts {
- if err := o(ctx, &config); err != nil {
- return err
- }
- }
-
- layers, err := i.getLayers(ctx, i.platform)
- if err != nil {
- return err
- }
-
- var (
- a = i.client.DiffService()
- cs = i.client.ContentStore()
-
- chain []digest.Digest
- unpacked bool
- )
- snapshotterName, err = i.client.resolveSnapshotterName(ctx, snapshotterName)
- if err != nil {
- return err
- }
- sn, err := i.client.getSnapshotter(ctx, snapshotterName)
- if err != nil {
- return err
- }
- for _, layer := range layers {
- unpacked, err = rootfs.ApplyLayerWithOpts(ctx, layer, chain, sn, a, config.SnapshotOpts, config.ApplyOpts)
- if err != nil {
- return err
- }
-
- if unpacked {
- // Set the uncompressed label after the uncompressed
- // digest has been verified through apply.
- cinfo := content.Info{
- Digest: layer.Blob.Digest,
- Labels: map[string]string{
- "containerd.io/uncompressed": layer.Diff.Digest.String(),
- },
- }
- if _, err := cs.Update(ctx, cinfo, "labels.containerd.io/uncompressed"); err != nil {
- return err
- }
- }
-
- chain = append(chain, layer.Diff.Digest)
- }
-
- desc, err := i.i.Config(ctx, cs, i.platform)
- if err != nil {
- return err
- }
-
- rootfs := identity.ChainID(chain).String()
-
- cinfo := content.Info{
- Digest: desc.Digest,
- Labels: map[string]string{
- fmt.Sprintf("containerd.io/gc.ref.snapshot.%s", snapshotterName): rootfs,
- },
- }
-
- _, err = cs.Update(ctx, cinfo, fmt.Sprintf("labels.containerd.io/gc.ref.snapshot.%s", snapshotterName))
- return err
-}
-
-func (i *image) getLayers(ctx context.Context, platform platforms.MatchComparer) ([]rootfs.Layer, error) {
- cs := i.client.ContentStore()
-
- manifest, err := images.Manifest(ctx, cs, i.i.Target, platform)
- if err != nil {
- return nil, err
- }
-
- diffIDs, err := i.i.RootFS(ctx, cs, platform)
- if err != nil {
- return nil, errors.Wrap(err, "failed to resolve rootfs")
- }
- if len(diffIDs) != len(manifest.Layers) {
- return nil, errors.Errorf("mismatched image rootfs and manifest layers")
- }
- layers := make([]rootfs.Layer, len(diffIDs))
- for i := range diffIDs {
- layers[i].Diff = ocispec.Descriptor{
- // TODO: derive media type from compressed type
- MediaType: ocispec.MediaTypeImageLayer,
- Digest: diffIDs[i],
- }
- layers[i].Blob = manifest.Layers[i]
- }
- return layers, nil
-}
-
-func (i *image) ContentStore() content.Store {
- return i.client.ContentStore()
-}
diff --git a/vendor/github.com/containerd/containerd/image_store.go b/vendor/github.com/containerd/containerd/image_store.go
deleted file mode 100644
index fd79e8929..000000000
--- a/vendor/github.com/containerd/containerd/image_store.go
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package containerd
-
-import (
- "context"
-
- imagesapi "github.com/containerd/containerd/api/services/images/v1"
- "github.com/containerd/containerd/api/types"
- "github.com/containerd/containerd/errdefs"
- "github.com/containerd/containerd/images"
- ptypes "github.com/gogo/protobuf/types"
- ocispec "github.com/opencontainers/image-spec/specs-go/v1"
-)
-
-type remoteImages struct {
- client imagesapi.ImagesClient
-}
-
-// NewImageStoreFromClient returns a new image store client
-func NewImageStoreFromClient(client imagesapi.ImagesClient) images.Store {
- return &remoteImages{
- client: client,
- }
-}
-
-func (s *remoteImages) Get(ctx context.Context, name string) (images.Image, error) {
- resp, err := s.client.Get(ctx, &imagesapi.GetImageRequest{
- Name: name,
- })
- if err != nil {
- return images.Image{}, errdefs.FromGRPC(err)
- }
-
- return imageFromProto(resp.Image), nil
-}
-
-func (s *remoteImages) List(ctx context.Context, filters ...string) ([]images.Image, error) {
- resp, err := s.client.List(ctx, &imagesapi.ListImagesRequest{
- Filters: filters,
- })
- if err != nil {
- return nil, errdefs.FromGRPC(err)
- }
-
- return imagesFromProto(resp.Images), nil
-}
-
-func (s *remoteImages) Create(ctx context.Context, image images.Image) (images.Image, error) {
- created, err := s.client.Create(ctx, &imagesapi.CreateImageRequest{
- Image: imageToProto(&image),
- })
- if err != nil {
- return images.Image{}, errdefs.FromGRPC(err)
- }
-
- return imageFromProto(&created.Image), nil
-}
-
-func (s *remoteImages) Update(ctx context.Context, image images.Image, fieldpaths ...string) (images.Image, error) {
- var updateMask *ptypes.FieldMask
- if len(fieldpaths) > 0 {
- updateMask = &ptypes.FieldMask{
- Paths: fieldpaths,
- }
- }
-
- updated, err := s.client.Update(ctx, &imagesapi.UpdateImageRequest{
- Image: imageToProto(&image),
- UpdateMask: updateMask,
- })
- if err != nil {
- return images.Image{}, errdefs.FromGRPC(err)
- }
-
- return imageFromProto(&updated.Image), nil
-}
-
-func (s *remoteImages) Delete(ctx context.Context, name string, opts ...images.DeleteOpt) error {
- var do images.DeleteOptions
- for _, opt := range opts {
- if err := opt(ctx, &do); err != nil {
- return err
- }
- }
- _, err := s.client.Delete(ctx, &imagesapi.DeleteImageRequest{
- Name: name,
- Sync: do.Synchronous,
- })
-
- return errdefs.FromGRPC(err)
-}
-
-func imageToProto(image *images.Image) imagesapi.Image {
- return imagesapi.Image{
- Name: image.Name,
- Labels: image.Labels,
- Target: descToProto(&image.Target),
- CreatedAt: image.CreatedAt,
- UpdatedAt: image.UpdatedAt,
- }
-}
-
-func imageFromProto(imagepb *imagesapi.Image) images.Image {
- return images.Image{
- Name: imagepb.Name,
- Labels: imagepb.Labels,
- Target: descFromProto(&imagepb.Target),
- CreatedAt: imagepb.CreatedAt,
- UpdatedAt: imagepb.UpdatedAt,
- }
-}
-
-func imagesFromProto(imagespb []imagesapi.Image) []images.Image {
- var images []images.Image
-
- for _, image := range imagespb {
- images = append(images, imageFromProto(&image))
- }
-
- return images
-}
-
-func descFromProto(desc *types.Descriptor) ocispec.Descriptor {
- return ocispec.Descriptor{
- MediaType: desc.MediaType,
- Size: desc.Size_,
- Digest: desc.Digest,
- Annotations: desc.Annotations,
- }
-}
-
-func descToProto(desc *ocispec.Descriptor) types.Descriptor {
- return types.Descriptor{
- MediaType: desc.MediaType,
- Size_: desc.Size,
- Digest: desc.Digest,
- Annotations: desc.Annotations,
- }
-}
diff --git a/vendor/github.com/containerd/containerd/images/annotations.go b/vendor/github.com/containerd/containerd/images/annotations.go
deleted file mode 100644
index 47d92104c..000000000
--- a/vendor/github.com/containerd/containerd/images/annotations.go
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package images
-
-const (
- // AnnotationImageName is an annotation on a Descriptor in an index.json
- // containing the `Name` value as used by an `Image` struct
- AnnotationImageName = "io.containerd.image.name"
-)
diff --git a/vendor/github.com/containerd/containerd/images/archive/exporter.go b/vendor/github.com/containerd/containerd/images/archive/exporter.go
deleted file mode 100644
index c9d3f6ec7..000000000
--- a/vendor/github.com/containerd/containerd/images/archive/exporter.go
+++ /dev/null
@@ -1,468 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package archive
-
-import (
- "archive/tar"
- "context"
- "encoding/json"
- "io"
- "path"
- "sort"
-
- "github.com/containerd/containerd/content"
- "github.com/containerd/containerd/errdefs"
- "github.com/containerd/containerd/images"
- "github.com/containerd/containerd/platforms"
- digest "github.com/opencontainers/go-digest"
- ocispecs "github.com/opencontainers/image-spec/specs-go"
- ocispec "github.com/opencontainers/image-spec/specs-go/v1"
- "github.com/pkg/errors"
-)
-
-type exportOptions struct {
- manifests []ocispec.Descriptor
- platform platforms.MatchComparer
- allPlatforms bool
- skipDockerManifest bool
-}
-
-// ExportOpt defines options for configuring exported descriptors
-type ExportOpt func(context.Context, *exportOptions) error
-
-// WithPlatform defines the platform to require manifest lists have
-// not exporting all platforms.
-// Additionally, platform is used to resolve image configs for
-// Docker v1.1, v1.2 format compatibility.
-func WithPlatform(p platforms.MatchComparer) ExportOpt {
- return func(ctx context.Context, o *exportOptions) error {
- o.platform = p
- return nil
- }
-}
-
-// WithAllPlatforms exports all manifests from a manifest list.
-// Missing content will fail the export.
-func WithAllPlatforms() ExportOpt {
- return func(ctx context.Context, o *exportOptions) error {
- o.allPlatforms = true
- return nil
- }
-}
-
-// WithSkipDockerManifest skips creation of the Docker compatible
-// manifest.json file.
-func WithSkipDockerManifest() ExportOpt {
- return func(ctx context.Context, o *exportOptions) error {
- o.skipDockerManifest = true
- return nil
- }
-}
-
-// WithImage adds the provided images to the exported archive.
-func WithImage(is images.Store, name string) ExportOpt {
- return func(ctx context.Context, o *exportOptions) error {
- img, err := is.Get(ctx, name)
- if err != nil {
- return err
- }
-
- img.Target.Annotations = addNameAnnotation(name, img.Target.Annotations)
- o.manifests = append(o.manifests, img.Target)
-
- return nil
- }
-}
-
-// WithManifest adds a manifest to the exported archive.
-// When names are given they will be set on the manifest in the
-// exported archive, creating an index record for each name.
-// When no names are provided, it is up to caller to put name annotation to
-// on the manifest descriptor if needed.
-func WithManifest(manifest ocispec.Descriptor, names ...string) ExportOpt {
- return func(ctx context.Context, o *exportOptions) error {
- if len(names) == 0 {
- o.manifests = append(o.manifests, manifest)
- }
- for _, name := range names {
- mc := manifest
- mc.Annotations = addNameAnnotation(name, manifest.Annotations)
- o.manifests = append(o.manifests, mc)
- }
-
- return nil
- }
-}
-
-func addNameAnnotation(name string, base map[string]string) map[string]string {
- annotations := map[string]string{}
- for k, v := range base {
- annotations[k] = v
- }
-
- annotations[images.AnnotationImageName] = name
- annotations[ocispec.AnnotationRefName] = ociReferenceName(name)
-
- return annotations
-}
-
-// Export implements Exporter.
-func Export(ctx context.Context, store content.Provider, writer io.Writer, opts ...ExportOpt) error {
- var eo exportOptions
- for _, opt := range opts {
- if err := opt(ctx, &eo); err != nil {
- return err
- }
- }
-
- records := []tarRecord{
- ociLayoutFile(""),
- ociIndexRecord(eo.manifests),
- }
-
- algorithms := map[string]struct{}{}
- dManifests := map[digest.Digest]*exportManifest{}
- resolvedIndex := map[digest.Digest]digest.Digest{}
- for _, desc := range eo.manifests {
- switch desc.MediaType {
- case images.MediaTypeDockerSchema2Manifest, ocispec.MediaTypeImageManifest:
- mt, ok := dManifests[desc.Digest]
- if !ok {
- // TODO(containerd): Skip if already added
- r, err := getRecords(ctx, store, desc, algorithms)
- if err != nil {
- return err
- }
- records = append(records, r...)
-
- mt = &exportManifest{
- manifest: desc,
- }
- dManifests[desc.Digest] = mt
- }
-
- name := desc.Annotations[images.AnnotationImageName]
- if name != "" && !eo.skipDockerManifest {
- mt.names = append(mt.names, name)
- }
- case images.MediaTypeDockerSchema2ManifestList, ocispec.MediaTypeImageIndex:
- d, ok := resolvedIndex[desc.Digest]
- if !ok {
- records = append(records, blobRecord(store, desc))
-
- p, err := content.ReadBlob(ctx, store, desc)
- if err != nil {
- return err
- }
-
- var index ocispec.Index
- if err := json.Unmarshal(p, &index); err != nil {
- return err
- }
-
- var manifests []ocispec.Descriptor
- for _, m := range index.Manifests {
- if eo.platform != nil {
- if m.Platform == nil || eo.platform.Match(*m.Platform) {
- manifests = append(manifests, m)
- } else if !eo.allPlatforms {
- continue
- }
- }
-
- r, err := getRecords(ctx, store, m, algorithms)
- if err != nil {
- return err
- }
-
- records = append(records, r...)
- }
-
- if !eo.skipDockerManifest {
- if len(manifests) >= 1 {
- if len(manifests) > 1 {
- sort.SliceStable(manifests, func(i, j int) bool {
- if manifests[i].Platform == nil {
- return false
- }
- if manifests[j].Platform == nil {
- return true
- }
- return eo.platform.Less(*manifests[i].Platform, *manifests[j].Platform)
- })
- }
- d = manifests[0].Digest
- dManifests[d] = &exportManifest{
- manifest: manifests[0],
- }
- } else if eo.platform != nil {
- return errors.Wrap(errdefs.ErrNotFound, "no manifest found for platform")
- }
- }
- resolvedIndex[desc.Digest] = d
- }
- if d != "" {
- if name := desc.Annotations[images.AnnotationImageName]; name != "" {
- mt := dManifests[d]
- mt.names = append(mt.names, name)
- }
-
- }
- default:
- return errors.Wrap(errdefs.ErrInvalidArgument, "only manifests may be exported")
- }
- }
-
- if len(dManifests) > 0 {
- tr, err := manifestsRecord(ctx, store, dManifests)
- if err != nil {
- return errors.Wrap(err, "unable to create manifests file")
- }
-
- records = append(records, tr)
- }
-
- if len(algorithms) > 0 {
- records = append(records, directoryRecord("blobs/", 0755))
- for alg := range algorithms {
- records = append(records, directoryRecord("blobs/"+alg+"/", 0755))
- }
- }
-
- tw := tar.NewWriter(writer)
- defer tw.Close()
- return writeTar(ctx, tw, records)
-}
-
-func getRecords(ctx context.Context, store content.Provider, desc ocispec.Descriptor, algorithms map[string]struct{}) ([]tarRecord, error) {
- var records []tarRecord
- exportHandler := func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
- records = append(records, blobRecord(store, desc))
- algorithms[desc.Digest.Algorithm().String()] = struct{}{}
- return nil, nil
- }
-
- childrenHandler := images.ChildrenHandler(store)
-
- handlers := images.Handlers(
- childrenHandler,
- images.HandlerFunc(exportHandler),
- )
-
- // Walk sequentially since the number of fetches is likely one and doing in
- // parallel requires locking the export handler
- if err := images.Walk(ctx, handlers, desc); err != nil {
- return nil, err
- }
-
- return records, nil
-}
-
-type tarRecord struct {
- Header *tar.Header
- CopyTo func(context.Context, io.Writer) (int64, error)
-}
-
-func blobRecord(cs content.Provider, desc ocispec.Descriptor) tarRecord {
- path := path.Join("blobs", desc.Digest.Algorithm().String(), desc.Digest.Encoded())
- return tarRecord{
- Header: &tar.Header{
- Name: path,
- Mode: 0444,
- Size: desc.Size,
- Typeflag: tar.TypeReg,
- },
- CopyTo: func(ctx context.Context, w io.Writer) (int64, error) {
- r, err := cs.ReaderAt(ctx, desc)
- if err != nil {
- return 0, errors.Wrap(err, "failed to get reader")
- }
- defer r.Close()
-
- // Verify digest
- dgstr := desc.Digest.Algorithm().Digester()
-
- n, err := io.Copy(io.MultiWriter(w, dgstr.Hash()), content.NewReader(r))
- if err != nil {
- return 0, errors.Wrap(err, "failed to copy to tar")
- }
- if dgstr.Digest() != desc.Digest {
- return 0, errors.Errorf("unexpected digest %s copied", dgstr.Digest())
- }
- return n, nil
- },
- }
-}
-
-func directoryRecord(name string, mode int64) tarRecord {
- return tarRecord{
- Header: &tar.Header{
- Name: name,
- Mode: mode,
- Typeflag: tar.TypeDir,
- },
- }
-}
-
-func ociLayoutFile(version string) tarRecord {
- if version == "" {
- version = ocispec.ImageLayoutVersion
- }
- layout := ocispec.ImageLayout{
- Version: version,
- }
-
- b, err := json.Marshal(layout)
- if err != nil {
- panic(err)
- }
-
- return tarRecord{
- Header: &tar.Header{
- Name: ocispec.ImageLayoutFile,
- Mode: 0444,
- Size: int64(len(b)),
- Typeflag: tar.TypeReg,
- },
- CopyTo: func(ctx context.Context, w io.Writer) (int64, error) {
- n, err := w.Write(b)
- return int64(n), err
- },
- }
-
-}
-
-func ociIndexRecord(manifests []ocispec.Descriptor) tarRecord {
- index := ocispec.Index{
- Versioned: ocispecs.Versioned{
- SchemaVersion: 2,
- },
- Manifests: manifests,
- }
-
- b, err := json.Marshal(index)
- if err != nil {
- panic(err)
- }
-
- return tarRecord{
- Header: &tar.Header{
- Name: "index.json",
- Mode: 0644,
- Size: int64(len(b)),
- Typeflag: tar.TypeReg,
- },
- CopyTo: func(ctx context.Context, w io.Writer) (int64, error) {
- n, err := w.Write(b)
- return int64(n), err
- },
- }
-}
-
-type exportManifest struct {
- manifest ocispec.Descriptor
- names []string
-}
-
-func manifestsRecord(ctx context.Context, store content.Provider, manifests map[digest.Digest]*exportManifest) (tarRecord, error) {
- mfsts := make([]struct {
- Config string
- RepoTags []string
- Layers []string
- }, len(manifests))
-
- var i int
- for _, m := range manifests {
- p, err := content.ReadBlob(ctx, store, m.manifest)
- if err != nil {
- return tarRecord{}, err
- }
-
- var manifest ocispec.Manifest
- if err := json.Unmarshal(p, &manifest); err != nil {
- return tarRecord{}, err
- }
- if err := manifest.Config.Digest.Validate(); err != nil {
- return tarRecord{}, errors.Wrapf(err, "invalid manifest %q", m.manifest.Digest)
- }
-
- dgst := manifest.Config.Digest
- mfsts[i].Config = path.Join("blobs", dgst.Algorithm().String(), dgst.Encoded())
- for _, l := range manifest.Layers {
- path := path.Join("blobs", l.Digest.Algorithm().String(), l.Digest.Encoded())
- mfsts[i].Layers = append(mfsts[i].Layers, path)
- }
-
- for _, name := range m.names {
- nname, err := familiarizeReference(name)
- if err != nil {
- return tarRecord{}, err
- }
-
- mfsts[i].RepoTags = append(mfsts[i].RepoTags, nname)
- }
-
- i++
- }
-
- b, err := json.Marshal(mfsts)
- if err != nil {
- return tarRecord{}, err
- }
-
- return tarRecord{
- Header: &tar.Header{
- Name: "manifest.json",
- Mode: 0644,
- Size: int64(len(b)),
- Typeflag: tar.TypeReg,
- },
- CopyTo: func(ctx context.Context, w io.Writer) (int64, error) {
- n, err := w.Write(b)
- return int64(n), err
- },
- }, nil
-}
-
-func writeTar(ctx context.Context, tw *tar.Writer, records []tarRecord) error {
- sort.Slice(records, func(i, j int) bool {
- return records[i].Header.Name < records[j].Header.Name
- })
-
- var last string
- for _, record := range records {
- if record.Header.Name == last {
- continue
- }
- last = record.Header.Name
- if err := tw.WriteHeader(record.Header); err != nil {
- return err
- }
- if record.CopyTo != nil {
- n, err := record.CopyTo(ctx, tw)
- if err != nil {
- return err
- }
- if n != record.Header.Size {
- return errors.Errorf("unexpected copy size for %s", record.Header.Name)
- }
- } else if record.Header.Size > 0 {
- return errors.Errorf("no content to write to record with non-zero size for %s", record.Header.Name)
- }
- }
- return nil
-}
diff --git a/vendor/github.com/containerd/containerd/images/archive/importer.go b/vendor/github.com/containerd/containerd/images/archive/importer.go
deleted file mode 100644
index 2d046589f..000000000
--- a/vendor/github.com/containerd/containerd/images/archive/importer.go
+++ /dev/null
@@ -1,371 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-// Package archive provides a Docker and OCI compatible importer
-package archive
-
-import (
- "archive/tar"
- "bytes"
- "context"
- "encoding/json"
- "fmt"
- "io"
- "io/ioutil"
- "path"
-
- "github.com/containerd/containerd/archive/compression"
- "github.com/containerd/containerd/content"
- "github.com/containerd/containerd/errdefs"
- "github.com/containerd/containerd/images"
- "github.com/containerd/containerd/log"
- digest "github.com/opencontainers/go-digest"
- specs "github.com/opencontainers/image-spec/specs-go"
- ocispec "github.com/opencontainers/image-spec/specs-go/v1"
- "github.com/pkg/errors"
-)
-
-type importOpts struct {
- compress bool
-}
-
-// ImportOpt is an option for importing an OCI index
-type ImportOpt func(*importOpts) error
-
-// WithImportCompression compresses uncompressed layers on import.
-// This is used for import formats which do not include the manifest.
-func WithImportCompression() ImportOpt {
- return func(io *importOpts) error {
- io.compress = true
- return nil
- }
-}
-
-// ImportIndex imports an index from a tar archive image bundle
-// - implements Docker v1.1, v1.2 and OCI v1.
-// - prefers OCI v1 when provided
-// - creates OCI index for Docker formats
-// - normalizes Docker references and adds as OCI ref name
-// e.g. alpine:latest -> docker.io/library/alpine:latest
-// - existing OCI reference names are untouched
-func ImportIndex(ctx context.Context, store content.Store, reader io.Reader, opts ...ImportOpt) (ocispec.Descriptor, error) {
- var (
- tr = tar.NewReader(reader)
-
- ociLayout ocispec.ImageLayout
- mfsts []struct {
- Config string
- RepoTags []string
- Layers []string
- }
- symlinks = make(map[string]string)
- blobs = make(map[string]ocispec.Descriptor)
- iopts importOpts
- )
-
- for _, o := range opts {
- if err := o(&iopts); err != nil {
- return ocispec.Descriptor{}, err
- }
- }
-
- for {
- hdr, err := tr.Next()
- if err == io.EOF {
- break
- }
- if err != nil {
- return ocispec.Descriptor{}, err
- }
- if hdr.Typeflag == tar.TypeSymlink {
- symlinks[hdr.Name] = path.Join(path.Dir(hdr.Name), hdr.Linkname)
- }
-
- if hdr.Typeflag != tar.TypeReg && hdr.Typeflag != tar.TypeRegA {
- if hdr.Typeflag != tar.TypeDir {
- log.G(ctx).WithField("file", hdr.Name).Debug("file type ignored")
- }
- continue
- }
-
- hdrName := path.Clean(hdr.Name)
- if hdrName == ocispec.ImageLayoutFile {
- if err = onUntarJSON(tr, &ociLayout); err != nil {
- return ocispec.Descriptor{}, errors.Wrapf(err, "untar oci layout %q", hdr.Name)
- }
- } else if hdrName == "manifest.json" {
- if err = onUntarJSON(tr, &mfsts); err != nil {
- return ocispec.Descriptor{}, errors.Wrapf(err, "untar manifest %q", hdr.Name)
- }
- } else {
- dgst, err := onUntarBlob(ctx, tr, store, hdr.Size, "tar-"+hdrName)
- if err != nil {
- return ocispec.Descriptor{}, errors.Wrapf(err, "failed to ingest %q", hdr.Name)
- }
-
- blobs[hdrName] = ocispec.Descriptor{
- Digest: dgst,
- Size: hdr.Size,
- }
- }
- }
-
- // If OCI layout was given, interpret the tar as an OCI layout.
- // When not provided, the layout of the tar will be interpreted
- // as Docker v1.1 or v1.2.
- if ociLayout.Version != "" {
- if ociLayout.Version != ocispec.ImageLayoutVersion {
- return ocispec.Descriptor{}, errors.Errorf("unsupported OCI version %s", ociLayout.Version)
- }
-
- idx, ok := blobs["index.json"]
- if !ok {
- return ocispec.Descriptor{}, errors.Errorf("missing index.json in OCI layout %s", ocispec.ImageLayoutVersion)
- }
-
- idx.MediaType = ocispec.MediaTypeImageIndex
- return idx, nil
- }
-
- if mfsts == nil {
- return ocispec.Descriptor{}, errors.Errorf("unrecognized image format")
- }
-
- for name, linkname := range symlinks {
- desc, ok := blobs[linkname]
- if !ok {
- return ocispec.Descriptor{}, errors.Errorf("no target for symlink layer from %q to %q", name, linkname)
- }
- blobs[name] = desc
- }
-
- idx := ocispec.Index{
- Versioned: specs.Versioned{
- SchemaVersion: 2,
- },
- }
- for _, mfst := range mfsts {
- config, ok := blobs[mfst.Config]
- if !ok {
- return ocispec.Descriptor{}, errors.Errorf("image config %q not found", mfst.Config)
- }
- config.MediaType = images.MediaTypeDockerSchema2Config
-
- layers, err := resolveLayers(ctx, store, mfst.Layers, blobs, iopts.compress)
- if err != nil {
- return ocispec.Descriptor{}, errors.Wrap(err, "failed to resolve layers")
- }
-
- manifest := struct {
- SchemaVersion int `json:"schemaVersion"`
- MediaType string `json:"mediaType"`
- Config ocispec.Descriptor `json:"config"`
- Layers []ocispec.Descriptor `json:"layers"`
- }{
- SchemaVersion: 2,
- MediaType: images.MediaTypeDockerSchema2Manifest,
- Config: config,
- Layers: layers,
- }
-
- desc, err := writeManifest(ctx, store, manifest, manifest.MediaType)
- if err != nil {
- return ocispec.Descriptor{}, errors.Wrap(err, "write docker manifest")
- }
-
- platforms, err := images.Platforms(ctx, store, desc)
- if err != nil {
- return ocispec.Descriptor{}, errors.Wrap(err, "unable to resolve platform")
- }
- if len(platforms) > 0 {
- // Only one platform can be resolved from non-index manifest,
- // The platform can only come from the config included above,
- // if the config has no platform it can be safely omitted.
- desc.Platform = &platforms[0]
- }
-
- if len(mfst.RepoTags) == 0 {
- idx.Manifests = append(idx.Manifests, desc)
- } else {
- // Add descriptor per tag
- for _, ref := range mfst.RepoTags {
- mfstdesc := desc
-
- normalized, err := normalizeReference(ref)
- if err != nil {
- return ocispec.Descriptor{}, err
- }
-
- mfstdesc.Annotations = map[string]string{
- images.AnnotationImageName: normalized,
- ocispec.AnnotationRefName: ociReferenceName(normalized),
- }
-
- idx.Manifests = append(idx.Manifests, mfstdesc)
- }
- }
- }
-
- return writeManifest(ctx, store, idx, ocispec.MediaTypeImageIndex)
-}
-
-func onUntarJSON(r io.Reader, j interface{}) error {
- b, err := ioutil.ReadAll(r)
- if err != nil {
- return err
- }
- return json.Unmarshal(b, j)
-}
-
-func onUntarBlob(ctx context.Context, r io.Reader, store content.Ingester, size int64, ref string) (digest.Digest, error) {
- dgstr := digest.Canonical.Digester()
-
- if err := content.WriteBlob(ctx, store, ref, io.TeeReader(r, dgstr.Hash()), ocispec.Descriptor{Size: size}); err != nil {
- return "", err
- }
-
- return dgstr.Digest(), nil
-}
-
-func resolveLayers(ctx context.Context, store content.Store, layerFiles []string, blobs map[string]ocispec.Descriptor, compress bool) ([]ocispec.Descriptor, error) {
- layers := make([]ocispec.Descriptor, len(layerFiles))
- descs := map[digest.Digest]*ocispec.Descriptor{}
- filters := []string{}
- for i, f := range layerFiles {
- desc, ok := blobs[f]
- if !ok {
- return nil, errors.Errorf("layer %q not found", f)
- }
- layers[i] = desc
- descs[desc.Digest] = &layers[i]
- filters = append(filters, "labels.\"containerd.io/uncompressed\"=="+desc.Digest.String())
- }
-
- err := store.Walk(ctx, func(info content.Info) error {
- dgst, ok := info.Labels["containerd.io/uncompressed"]
- if ok {
- desc := descs[digest.Digest(dgst)]
- if desc != nil {
- desc.MediaType = images.MediaTypeDockerSchema2LayerGzip
- desc.Digest = info.Digest
- desc.Size = info.Size
- }
- }
- return nil
- }, filters...)
- if err != nil {
- return nil, errors.Wrap(err, "failure checking for compressed blobs")
- }
-
- for i, desc := range layers {
- if desc.MediaType != "" {
- continue
- }
- // Open blob, resolve media type
- ra, err := store.ReaderAt(ctx, desc)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to open %q (%s)", layerFiles[i], desc.Digest)
- }
- s, err := compression.DecompressStream(content.NewReader(ra))
- if err != nil {
- return nil, errors.Wrapf(err, "failed to detect compression for %q", layerFiles[i])
- }
- if s.GetCompression() == compression.Uncompressed {
- if compress {
- ref := fmt.Sprintf("compress-blob-%s-%s", desc.Digest.Algorithm().String(), desc.Digest.Encoded())
- labels := map[string]string{
- "containerd.io/uncompressed": desc.Digest.String(),
- }
- layers[i], err = compressBlob(ctx, store, s, ref, content.WithLabels(labels))
- if err != nil {
- s.Close()
- return nil, err
- }
- layers[i].MediaType = images.MediaTypeDockerSchema2LayerGzip
- } else {
- layers[i].MediaType = images.MediaTypeDockerSchema2Layer
- }
- } else {
- layers[i].MediaType = images.MediaTypeDockerSchema2LayerGzip
- }
- s.Close()
-
- }
- return layers, nil
-}
-
-func compressBlob(ctx context.Context, cs content.Store, r io.Reader, ref string, opts ...content.Opt) (desc ocispec.Descriptor, err error) {
- w, err := content.OpenWriter(ctx, cs, content.WithRef(ref))
- if err != nil {
- return ocispec.Descriptor{}, errors.Wrap(err, "failed to open writer")
- }
-
- defer func() {
- w.Close()
- if err != nil {
- cs.Abort(ctx, ref)
- }
- }()
- if err := w.Truncate(0); err != nil {
- return ocispec.Descriptor{}, errors.Wrap(err, "failed to truncate writer")
- }
-
- cw, err := compression.CompressStream(w, compression.Gzip)
- if err != nil {
- return ocispec.Descriptor{}, err
- }
-
- if _, err := io.Copy(cw, r); err != nil {
- return ocispec.Descriptor{}, err
- }
- if err := cw.Close(); err != nil {
- return ocispec.Descriptor{}, err
- }
-
- cst, err := w.Status()
- if err != nil {
- return ocispec.Descriptor{}, errors.Wrap(err, "failed to get writer status")
- }
-
- desc.Digest = w.Digest()
- desc.Size = cst.Offset
-
- if err := w.Commit(ctx, desc.Size, desc.Digest, opts...); err != nil {
- if !errdefs.IsAlreadyExists(err) {
- return ocispec.Descriptor{}, errors.Wrap(err, "failed to commit")
- }
- }
-
- return desc, nil
-}
-
-func writeManifest(ctx context.Context, cs content.Ingester, manifest interface{}, mediaType string) (ocispec.Descriptor, error) {
- manifestBytes, err := json.Marshal(manifest)
- if err != nil {
- return ocispec.Descriptor{}, err
- }
-
- desc := ocispec.Descriptor{
- MediaType: mediaType,
- Digest: digest.FromBytes(manifestBytes),
- Size: int64(len(manifestBytes)),
- }
- if err := content.WriteBlob(ctx, cs, "manifest-"+desc.Digest.String(), bytes.NewReader(manifestBytes), desc); err != nil {
- return ocispec.Descriptor{}, err
- }
-
- return desc, nil
-}
diff --git a/vendor/github.com/containerd/containerd/images/archive/reference.go b/vendor/github.com/containerd/containerd/images/archive/reference.go
deleted file mode 100644
index ce9fe98f9..000000000
--- a/vendor/github.com/containerd/containerd/images/archive/reference.go
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package archive
-
-import (
- "strings"
-
- "github.com/containerd/containerd/reference"
- distref "github.com/containerd/containerd/reference/docker"
- "github.com/opencontainers/go-digest"
- "github.com/pkg/errors"
-)
-
-// FilterRefPrefix restricts references to having the given image
-// prefix. Tag-only references will have the prefix prepended.
-func FilterRefPrefix(image string) func(string) string {
- return refTranslator(image, true)
-}
-
-// AddRefPrefix prepends the given image prefix to tag-only references,
-// while leaving returning full references unmodified.
-func AddRefPrefix(image string) func(string) string {
- return refTranslator(image, false)
-}
-
-// refTranslator creates a reference which only has a tag or verifies
-// a full reference.
-func refTranslator(image string, checkPrefix bool) func(string) string {
- return func(ref string) string {
- // Check if ref is full reference
- if strings.ContainsAny(ref, "/:@") {
- // If not prefixed, don't include image
- if checkPrefix && !isImagePrefix(ref, image) {
- return ""
- }
- return ref
- }
- return image + ":" + ref
- }
-}
-
-func isImagePrefix(s, prefix string) bool {
- if !strings.HasPrefix(s, prefix) {
- return false
- }
- if len(s) > len(prefix) {
- switch s[len(prefix)] {
- case '/', ':', '@':
- // Prevent matching partial namespaces
- default:
- return false
- }
- }
- return true
-}
-
-func normalizeReference(ref string) (string, error) {
- // TODO: Replace this function to not depend on reference package
- normalized, err := distref.ParseDockerRef(ref)
- if err != nil {
- return "", errors.Wrapf(err, "normalize image ref %q", ref)
- }
-
- return normalized.String(), nil
-}
-
-func familiarizeReference(ref string) (string, error) {
- named, err := distref.ParseNormalizedNamed(ref)
- if err != nil {
- return "", errors.Wrapf(err, "failed to parse %q", ref)
- }
- named = distref.TagNameOnly(named)
-
- return distref.FamiliarString(named), nil
-}
-
-func ociReferenceName(name string) string {
- // OCI defines the reference name as only a tag excluding the
- // repository. The containerd annotation contains the full image name
- // since the tag is insufficient for correctly naming and referring to an
- // image
- var ociRef string
- if spec, err := reference.Parse(name); err == nil {
- ociRef = spec.Object
- } else {
- ociRef = name
- }
-
- return ociRef
-}
-
-// DigestTranslator creates a digest reference by adding the
-// digest to an image name
-func DigestTranslator(prefix string) func(digest.Digest) string {
- return func(dgst digest.Digest) string {
- return prefix + "@" + dgst.String()
- }
-}
diff --git a/vendor/github.com/containerd/containerd/images/handlers.go b/vendor/github.com/containerd/containerd/images/handlers.go
deleted file mode 100644
index 05a9017bc..000000000
--- a/vendor/github.com/containerd/containerd/images/handlers.go
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package images
-
-import (
- "context"
- "fmt"
- "sort"
-
- "github.com/containerd/containerd/content"
- "github.com/containerd/containerd/errdefs"
- "github.com/containerd/containerd/platforms"
- ocispec "github.com/opencontainers/image-spec/specs-go/v1"
- "github.com/pkg/errors"
- "golang.org/x/sync/errgroup"
- "golang.org/x/sync/semaphore"
-)
-
-var (
- // ErrSkipDesc is used to skip processing of a descriptor and
- // its descendants.
- ErrSkipDesc = fmt.Errorf("skip descriptor")
-
- // ErrStopHandler is used to signify that the descriptor
- // has been handled and should not be handled further.
- // This applies only to a single descriptor in a handler
- // chain and does not apply to descendant descriptors.
- ErrStopHandler = fmt.Errorf("stop handler")
-)
-
-// Handler handles image manifests
-type Handler interface {
- Handle(ctx context.Context, desc ocispec.Descriptor) (subdescs []ocispec.Descriptor, err error)
-}
-
-// HandlerFunc function implementing the Handler interface
-type HandlerFunc func(ctx context.Context, desc ocispec.Descriptor) (subdescs []ocispec.Descriptor, err error)
-
-// Handle image manifests
-func (fn HandlerFunc) Handle(ctx context.Context, desc ocispec.Descriptor) (subdescs []ocispec.Descriptor, err error) {
- return fn(ctx, desc)
-}
-
-// Handlers returns a handler that will run the handlers in sequence.
-//
-// A handler may return `ErrStopHandler` to stop calling additional handlers
-func Handlers(handlers ...Handler) HandlerFunc {
- return func(ctx context.Context, desc ocispec.Descriptor) (subdescs []ocispec.Descriptor, err error) {
- var children []ocispec.Descriptor
- for _, handler := range handlers {
- ch, err := handler.Handle(ctx, desc)
- if err != nil {
- if errors.Is(err, ErrStopHandler) {
- break
- }
- return nil, err
- }
-
- children = append(children, ch...)
- }
-
- return children, nil
- }
-}
-
-// Walk the resources of an image and call the handler for each. If the handler
-// decodes the sub-resources for each image,
-//
-// This differs from dispatch in that each sibling resource is considered
-// synchronously.
-func Walk(ctx context.Context, handler Handler, descs ...ocispec.Descriptor) error {
- for _, desc := range descs {
-
- children, err := handler.Handle(ctx, desc)
- if err != nil {
- if errors.Is(err, ErrSkipDesc) {
- continue // don't traverse the children.
- }
- return err
- }
-
- if len(children) > 0 {
- if err := Walk(ctx, handler, children...); err != nil {
- return err
- }
- }
- }
-
- return nil
-}
-
-// Dispatch runs the provided handler for content specified by the descriptors.
-// If the handler decode subresources, they will be visited, as well.
-//
-// Handlers for siblings are run in parallel on the provided descriptors. A
-// handler may return `ErrSkipDesc` to signal to the dispatcher to not traverse
-// any children.
-//
-// A concurrency limiter can be passed in to limit the number of concurrent
-// handlers running. When limiter is nil, there is no limit.
-//
-// Typically, this function will be used with `FetchHandler`, often composed
-// with other handlers.
-//
-// If any handler returns an error, the dispatch session will be canceled.
-func Dispatch(ctx context.Context, handler Handler, limiter *semaphore.Weighted, descs ...ocispec.Descriptor) error {
- eg, ctx2 := errgroup.WithContext(ctx)
- for _, desc := range descs {
- desc := desc
-
- if limiter != nil {
- if err := limiter.Acquire(ctx, 1); err != nil {
- return err
- }
- }
-
- eg.Go(func() error {
- desc := desc
-
- children, err := handler.Handle(ctx2, desc)
- if limiter != nil {
- limiter.Release(1)
- }
- if err != nil {
- if errors.Is(err, ErrSkipDesc) {
- return nil // don't traverse the children.
- }
- return err
- }
-
- if len(children) > 0 {
- return Dispatch(ctx2, handler, limiter, children...)
- }
-
- return nil
- })
- }
-
- return eg.Wait()
-}
-
-// ChildrenHandler decodes well-known manifest types and returns their children.
-//
-// This is useful for supporting recursive fetch and other use cases where you
-// want to do a full walk of resources.
-//
-// One can also replace this with another implementation to allow descending of
-// arbitrary types.
-func ChildrenHandler(provider content.Provider) HandlerFunc {
- return func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
- return Children(ctx, provider, desc)
- }
-}
-
-// SetChildrenLabels is a handler wrapper which sets labels for the content on
-// the children returned by the handler and passes through the children.
-// Must follow a handler that returns the children to be labeled.
-func SetChildrenLabels(manager content.Manager, f HandlerFunc) HandlerFunc {
- return SetChildrenMappedLabels(manager, f, nil)
-}
-
-// SetChildrenMappedLabels is a handler wrapper which sets labels for the content on
-// the children returned by the handler and passes through the children.
-// Must follow a handler that returns the children to be labeled.
-// The label map allows the caller to control the labels per child descriptor.
-// For returned labels, the index of the child will be appended to the end
-// except for the first index when the returned label does not end with '.'.
-func SetChildrenMappedLabels(manager content.Manager, f HandlerFunc, labelMap func(ocispec.Descriptor) []string) HandlerFunc {
- if labelMap == nil {
- labelMap = ChildGCLabels
- }
- return func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
- children, err := f(ctx, desc)
- if err != nil {
- return children, err
- }
-
- if len(children) > 0 {
- var (
- info = content.Info{
- Digest: desc.Digest,
- Labels: map[string]string{},
- }
- fields = []string{}
- keys = map[string]uint{}
- )
- for _, ch := range children {
- labelKeys := labelMap(ch)
- for _, key := range labelKeys {
- idx := keys[key]
- keys[key] = idx + 1
- if idx > 0 || key[len(key)-1] == '.' {
- key = fmt.Sprintf("%s%d", key, idx)
- }
-
- info.Labels[key] = ch.Digest.String()
- fields = append(fields, "labels."+key)
- }
- }
-
- _, err := manager.Update(ctx, info, fields...)
- if err != nil {
- return nil, err
- }
- }
-
- return children, err
- }
-}
-
-// FilterPlatforms is a handler wrapper which limits the descriptors returned
-// based on matching the specified platform matcher.
-func FilterPlatforms(f HandlerFunc, m platforms.Matcher) HandlerFunc {
- return func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
- children, err := f(ctx, desc)
- if err != nil {
- return children, err
- }
-
- var descs []ocispec.Descriptor
-
- if m == nil {
- descs = children
- } else {
- for _, d := range children {
- if d.Platform == nil || m.Match(*d.Platform) {
- descs = append(descs, d)
- }
- }
- }
-
- return descs, nil
- }
-}
-
-// LimitManifests is a handler wrapper which filters the manifest descriptors
-// returned using the provided platform.
-// The results will be ordered according to the comparison operator and
-// use the ordering in the manifests for equal matches.
-// A limit of 0 or less is considered no limit.
-// A not found error is returned if no manifest is matched.
-func LimitManifests(f HandlerFunc, m platforms.MatchComparer, n int) HandlerFunc {
- return func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
- children, err := f(ctx, desc)
- if err != nil {
- return children, err
- }
-
- switch desc.MediaType {
- case ocispec.MediaTypeImageIndex, MediaTypeDockerSchema2ManifestList:
- sort.SliceStable(children, func(i, j int) bool {
- if children[i].Platform == nil {
- return false
- }
- if children[j].Platform == nil {
- return true
- }
- return m.Less(*children[i].Platform, *children[j].Platform)
- })
-
- if n > 0 {
- if len(children) == 0 {
- return children, errors.Wrap(errdefs.ErrNotFound, "no match for platform in manifest")
- }
- if len(children) > n {
- children = children[:n]
- }
- }
- default:
- // only limit manifests from an index
- }
- return children, nil
- }
-}
diff --git a/vendor/github.com/containerd/containerd/images/image.go b/vendor/github.com/containerd/containerd/images/image.go
deleted file mode 100644
index 1868ee88d..000000000
--- a/vendor/github.com/containerd/containerd/images/image.go
+++ /dev/null
@@ -1,386 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package images
-
-import (
- "context"
- "encoding/json"
- "sort"
- "time"
-
- "github.com/containerd/containerd/content"
- "github.com/containerd/containerd/errdefs"
- "github.com/containerd/containerd/log"
- "github.com/containerd/containerd/platforms"
- digest "github.com/opencontainers/go-digest"
- ocispec "github.com/opencontainers/image-spec/specs-go/v1"
- "github.com/pkg/errors"
-)
-
-// Image provides the model for how containerd views container images.
-type Image struct {
- // Name of the image.
- //
- // To be pulled, it must be a reference compatible with resolvers.
- //
- // This field is required.
- Name string
-
- // Labels provide runtime decoration for the image record.
- //
- // There is no default behavior for how these labels are propagated. They
- // only decorate the static metadata object.
- //
- // This field is optional.
- Labels map[string]string
-
- // Target describes the root content for this image. Typically, this is
- // a manifest, index or manifest list.
- Target ocispec.Descriptor
-
- CreatedAt, UpdatedAt time.Time
-}
-
-// DeleteOptions provide options on image delete
-type DeleteOptions struct {
- Synchronous bool
-}
-
-// DeleteOpt allows configuring a delete operation
-type DeleteOpt func(context.Context, *DeleteOptions) error
-
-// SynchronousDelete is used to indicate that an image deletion and removal of
-// the image resources should occur synchronously before returning a result.
-func SynchronousDelete() DeleteOpt {
- return func(ctx context.Context, o *DeleteOptions) error {
- o.Synchronous = true
- return nil
- }
-}
-
-// Store and interact with images
-type Store interface {
- Get(ctx context.Context, name string) (Image, error)
- List(ctx context.Context, filters ...string) ([]Image, error)
- Create(ctx context.Context, image Image) (Image, error)
-
- // Update will replace the data in the store with the provided image. If
- // one or more fieldpaths are provided, only those fields will be updated.
- Update(ctx context.Context, image Image, fieldpaths ...string) (Image, error)
-
- Delete(ctx context.Context, name string, opts ...DeleteOpt) error
-}
-
-// TODO(stevvooe): Many of these functions make strong platform assumptions,
-// which are untrue in a lot of cases. More refactoring must be done here to
-// make this work in all cases.
-
-// Config resolves the image configuration descriptor.
-//
-// The caller can then use the descriptor to resolve and process the
-// configuration of the image.
-func (image *Image) Config(ctx context.Context, provider content.Provider, platform platforms.MatchComparer) (ocispec.Descriptor, error) {
- return Config(ctx, provider, image.Target, platform)
-}
-
-// RootFS returns the unpacked diffids that make up and images rootfs.
-//
-// These are used to verify that a set of layers unpacked to the expected
-// values.
-func (image *Image) RootFS(ctx context.Context, provider content.Provider, platform platforms.MatchComparer) ([]digest.Digest, error) {
- desc, err := image.Config(ctx, provider, platform)
- if err != nil {
- return nil, err
- }
- return RootFS(ctx, provider, desc)
-}
-
-// Size returns the total size of an image's packed resources.
-func (image *Image) Size(ctx context.Context, provider content.Provider, platform platforms.MatchComparer) (int64, error) {
- var size int64
- return size, Walk(ctx, Handlers(HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
- if desc.Size < 0 {
- return nil, errors.Errorf("invalid size %v in %v (%v)", desc.Size, desc.Digest, desc.MediaType)
- }
- size += desc.Size
- return nil, nil
- }), LimitManifests(FilterPlatforms(ChildrenHandler(provider), platform), platform, 1)), image.Target)
-}
-
-type platformManifest struct {
- p *ocispec.Platform
- m *ocispec.Manifest
-}
-
-// Manifest resolves a manifest from the image for the given platform.
-//
-// When a manifest descriptor inside of a manifest index does not have
-// a platform defined, the platform from the image config is considered.
-//
-// If the descriptor points to a non-index manifest, then the manifest is
-// unmarshalled and returned without considering the platform inside of the
-// config.
-//
-// TODO(stevvooe): This violates the current platform agnostic approach to this
-// package by returning a specific manifest type. We'll need to refactor this
-// to return a manifest descriptor or decide that we want to bring the API in
-// this direction because this abstraction is not needed.`
-func Manifest(ctx context.Context, provider content.Provider, image ocispec.Descriptor, platform platforms.MatchComparer) (ocispec.Manifest, error) {
- var (
- limit = 1
- m []platformManifest
- wasIndex bool
- )
-
- if err := Walk(ctx, HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
- switch desc.MediaType {
- case MediaTypeDockerSchema2Manifest, ocispec.MediaTypeImageManifest:
- p, err := content.ReadBlob(ctx, provider, desc)
- if err != nil {
- return nil, err
- }
-
- var manifest ocispec.Manifest
- if err := json.Unmarshal(p, &manifest); err != nil {
- return nil, err
- }
-
- if desc.Digest != image.Digest && platform != nil {
- if desc.Platform != nil && !platform.Match(*desc.Platform) {
- return nil, nil
- }
-
- if desc.Platform == nil {
- p, err := content.ReadBlob(ctx, provider, manifest.Config)
- if err != nil {
- return nil, err
- }
-
- var image ocispec.Image
- if err := json.Unmarshal(p, &image); err != nil {
- return nil, err
- }
-
- if !platform.Match(platforms.Normalize(ocispec.Platform{OS: image.OS, Architecture: image.Architecture})) {
- return nil, nil
- }
-
- }
- }
-
- m = append(m, platformManifest{
- p: desc.Platform,
- m: &manifest,
- })
-
- return nil, nil
- case MediaTypeDockerSchema2ManifestList, ocispec.MediaTypeImageIndex:
- p, err := content.ReadBlob(ctx, provider, desc)
- if err != nil {
- return nil, err
- }
-
- var idx ocispec.Index
- if err := json.Unmarshal(p, &idx); err != nil {
- return nil, err
- }
-
- if platform == nil {
- return idx.Manifests, nil
- }
-
- var descs []ocispec.Descriptor
- for _, d := range idx.Manifests {
- if d.Platform == nil || platform.Match(*d.Platform) {
- descs = append(descs, d)
- }
- }
-
- sort.SliceStable(descs, func(i, j int) bool {
- if descs[i].Platform == nil {
- return false
- }
- if descs[j].Platform == nil {
- return true
- }
- return platform.Less(*descs[i].Platform, *descs[j].Platform)
- })
-
- wasIndex = true
-
- if len(descs) > limit {
- return descs[:limit], nil
- }
- return descs, nil
- }
- return nil, errors.Wrapf(errdefs.ErrNotFound, "unexpected media type %v for %v", desc.MediaType, desc.Digest)
- }), image); err != nil {
- return ocispec.Manifest{}, err
- }
-
- if len(m) == 0 {
- err := errors.Wrapf(errdefs.ErrNotFound, "manifest %v", image.Digest)
- if wasIndex {
- err = errors.Wrapf(errdefs.ErrNotFound, "no match for platform in manifest %v", image.Digest)
- }
- return ocispec.Manifest{}, err
- }
- return *m[0].m, nil
-}
-
-// Config resolves the image configuration descriptor using a content provided
-// to resolve child resources on the image.
-//
-// The caller can then use the descriptor to resolve and process the
-// configuration of the image.
-func Config(ctx context.Context, provider content.Provider, image ocispec.Descriptor, platform platforms.MatchComparer) (ocispec.Descriptor, error) {
- manifest, err := Manifest(ctx, provider, image, platform)
- if err != nil {
- return ocispec.Descriptor{}, err
- }
- return manifest.Config, err
-}
-
-// Platforms returns one or more platforms supported by the image.
-func Platforms(ctx context.Context, provider content.Provider, image ocispec.Descriptor) ([]ocispec.Platform, error) {
- var platformSpecs []ocispec.Platform
- return platformSpecs, Walk(ctx, Handlers(HandlerFunc(func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
- if desc.Platform != nil {
- platformSpecs = append(platformSpecs, *desc.Platform)
- return nil, ErrSkipDesc
- }
-
- switch desc.MediaType {
- case MediaTypeDockerSchema2Config, ocispec.MediaTypeImageConfig:
- p, err := content.ReadBlob(ctx, provider, desc)
- if err != nil {
- return nil, err
- }
-
- var image ocispec.Image
- if err := json.Unmarshal(p, &image); err != nil {
- return nil, err
- }
-
- platformSpecs = append(platformSpecs,
- platforms.Normalize(ocispec.Platform{OS: image.OS, Architecture: image.Architecture}))
- }
- return nil, nil
- }), ChildrenHandler(provider)), image)
-}
-
-// Check returns nil if the all components of an image are available in the
-// provider for the specified platform.
-//
-// If available is true, the caller can assume that required represents the
-// complete set of content required for the image.
-//
-// missing will have the components that are part of required but not avaiiable
-// in the provider.
-//
-// If there is a problem resolving content, an error will be returned.
-func Check(ctx context.Context, provider content.Provider, image ocispec.Descriptor, platform platforms.MatchComparer) (available bool, required, present, missing []ocispec.Descriptor, err error) {
- mfst, err := Manifest(ctx, provider, image, platform)
- if err != nil {
- if errdefs.IsNotFound(err) {
- return false, []ocispec.Descriptor{image}, nil, []ocispec.Descriptor{image}, nil
- }
-
- return false, nil, nil, nil, errors.Wrapf(err, "failed to check image %v", image.Digest)
- }
-
- // TODO(stevvooe): It is possible that referenced conponents could have
- // children, but this is rare. For now, we ignore this and only verify
- // that manifest components are present.
- required = append([]ocispec.Descriptor{mfst.Config}, mfst.Layers...)
-
- for _, desc := range required {
- ra, err := provider.ReaderAt(ctx, desc)
- if err != nil {
- if errdefs.IsNotFound(err) {
- missing = append(missing, desc)
- continue
- } else {
- return false, nil, nil, nil, errors.Wrapf(err, "failed to check image %v", desc.Digest)
- }
- }
- ra.Close()
- present = append(present, desc)
-
- }
-
- return true, required, present, missing, nil
-}
-
-// Children returns the immediate children of content described by the descriptor.
-func Children(ctx context.Context, provider content.Provider, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
- var descs []ocispec.Descriptor
- switch desc.MediaType {
- case MediaTypeDockerSchema2Manifest, ocispec.MediaTypeImageManifest:
- p, err := content.ReadBlob(ctx, provider, desc)
- if err != nil {
- return nil, err
- }
-
- // TODO(stevvooe): We just assume oci manifest, for now. There may be
- // subtle differences from the docker version.
- var manifest ocispec.Manifest
- if err := json.Unmarshal(p, &manifest); err != nil {
- return nil, err
- }
-
- descs = append(descs, manifest.Config)
- descs = append(descs, manifest.Layers...)
- case MediaTypeDockerSchema2ManifestList, ocispec.MediaTypeImageIndex:
- p, err := content.ReadBlob(ctx, provider, desc)
- if err != nil {
- return nil, err
- }
-
- var index ocispec.Index
- if err := json.Unmarshal(p, &index); err != nil {
- return nil, err
- }
-
- descs = append(descs, index.Manifests...)
- default:
- if IsLayerType(desc.MediaType) || IsKnownConfig(desc.MediaType) {
- // childless data types.
- return nil, nil
- }
- log.G(ctx).Debugf("encountered unknown type %v; children may not be fetched", desc.MediaType)
- }
-
- return descs, nil
-}
-
-// RootFS returns the unpacked diffids that make up and images rootfs.
-//
-// These are used to verify that a set of layers unpacked to the expected
-// values.
-func RootFS(ctx context.Context, provider content.Provider, configDesc ocispec.Descriptor) ([]digest.Digest, error) {
- p, err := content.ReadBlob(ctx, provider, configDesc)
- if err != nil {
- return nil, err
- }
-
- var config ocispec.Image
- if err := json.Unmarshal(p, &config); err != nil {
- return nil, err
- }
- return config.RootFS.DiffIDs, nil
-}
diff --git a/vendor/github.com/containerd/containerd/images/importexport.go b/vendor/github.com/containerd/containerd/images/importexport.go
deleted file mode 100644
index 843adcadc..000000000
--- a/vendor/github.com/containerd/containerd/images/importexport.go
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package images
-
-import (
- "context"
- "io"
-
- "github.com/containerd/containerd/content"
- ocispec "github.com/opencontainers/image-spec/specs-go/v1"
-)
-
-// Importer is the interface for image importer.
-type Importer interface {
- // Import imports an image from a tar stream.
- Import(ctx context.Context, store content.Store, reader io.Reader) (ocispec.Descriptor, error)
-}
-
-// Exporter is the interface for image exporter.
-type Exporter interface {
- // Export exports an image to a tar stream.
- Export(ctx context.Context, store content.Provider, desc ocispec.Descriptor, writer io.Writer) error
-}
diff --git a/vendor/github.com/containerd/containerd/images/mediatypes.go b/vendor/github.com/containerd/containerd/images/mediatypes.go
deleted file mode 100644
index c51897d25..000000000
--- a/vendor/github.com/containerd/containerd/images/mediatypes.go
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package images
-
-import (
- "context"
- "sort"
- "strings"
-
- "github.com/containerd/containerd/errdefs"
- ocispec "github.com/opencontainers/image-spec/specs-go/v1"
- "github.com/pkg/errors"
-)
-
-// mediatype definitions for image components handled in containerd.
-//
-// oci components are generally referenced directly, although we may centralize
-// here for clarity.
-const (
- MediaTypeDockerSchema2Layer = "application/vnd.docker.image.rootfs.diff.tar"
- MediaTypeDockerSchema2LayerForeign = "application/vnd.docker.image.rootfs.foreign.diff.tar"
- MediaTypeDockerSchema2LayerGzip = "application/vnd.docker.image.rootfs.diff.tar.gzip"
- MediaTypeDockerSchema2LayerForeignGzip = "application/vnd.docker.image.rootfs.foreign.diff.tar.gzip"
- MediaTypeDockerSchema2Config = "application/vnd.docker.container.image.v1+json"
- MediaTypeDockerSchema2Manifest = "application/vnd.docker.distribution.manifest.v2+json"
- MediaTypeDockerSchema2ManifestList = "application/vnd.docker.distribution.manifest.list.v2+json"
- // Checkpoint/Restore Media Types
- MediaTypeContainerd1Checkpoint = "application/vnd.containerd.container.criu.checkpoint.criu.tar"
- MediaTypeContainerd1CheckpointPreDump = "application/vnd.containerd.container.criu.checkpoint.predump.tar"
- MediaTypeContainerd1Resource = "application/vnd.containerd.container.resource.tar"
- MediaTypeContainerd1RW = "application/vnd.containerd.container.rw.tar"
- MediaTypeContainerd1CheckpointConfig = "application/vnd.containerd.container.checkpoint.config.v1+proto"
- MediaTypeContainerd1CheckpointOptions = "application/vnd.containerd.container.checkpoint.options.v1+proto"
- MediaTypeContainerd1CheckpointRuntimeName = "application/vnd.containerd.container.checkpoint.runtime.name"
- MediaTypeContainerd1CheckpointRuntimeOptions = "application/vnd.containerd.container.checkpoint.runtime.options+proto"
- // Legacy Docker schema1 manifest
- MediaTypeDockerSchema1Manifest = "application/vnd.docker.distribution.manifest.v1+prettyjws"
-)
-
-// DiffCompression returns the compression as defined by the layer diff media
-// type. For Docker media types without compression, "unknown" is returned to
-// indicate that the media type may be compressed. If the media type is not
-// recognized as a layer diff, then it returns errdefs.ErrNotImplemented
-func DiffCompression(ctx context.Context, mediaType string) (string, error) {
- base, ext := parseMediaTypes(mediaType)
- switch base {
- case MediaTypeDockerSchema2Layer, MediaTypeDockerSchema2LayerForeign:
- if len(ext) > 0 {
- // Type is wrapped
- return "", nil
- }
- // These media types may have been compressed but failed to
- // use the correct media type. The decompression function
- // should detect and handle this case.
- return "unknown", nil
- case MediaTypeDockerSchema2LayerGzip, MediaTypeDockerSchema2LayerForeignGzip:
- if len(ext) > 0 {
- // Type is wrapped
- return "", nil
- }
- return "gzip", nil
- case ocispec.MediaTypeImageLayer, ocispec.MediaTypeImageLayerNonDistributable:
- if len(ext) > 0 {
- switch ext[len(ext)-1] {
- case "gzip":
- return "gzip", nil
- }
- }
- return "", nil
- default:
- return "", errors.Wrapf(errdefs.ErrNotImplemented, "unrecognised mediatype %s", mediaType)
- }
-}
-
-// parseMediaTypes splits the media type into the base type and
-// an array of sorted extensions
-func parseMediaTypes(mt string) (string, []string) {
- if mt == "" {
- return "", []string{}
- }
-
- s := strings.Split(mt, "+")
- ext := s[1:]
- sort.Strings(ext)
-
- return s[0], ext
-}
-
-// IsLayerTypes returns true if the media type is a layer
-func IsLayerType(mt string) bool {
- if strings.HasPrefix(mt, "application/vnd.oci.image.layer.") {
- return true
- }
-
- // Parse Docker media types, strip off any + suffixes first
- base, _ := parseMediaTypes(mt)
- switch base {
- case MediaTypeDockerSchema2Layer, MediaTypeDockerSchema2LayerGzip,
- MediaTypeDockerSchema2LayerForeign, MediaTypeDockerSchema2LayerForeignGzip:
- return true
- }
- return false
-}
-
-// IsKnownConfig returns true if the media type is a known config type
-func IsKnownConfig(mt string) bool {
- switch mt {
- case MediaTypeDockerSchema2Config, ocispec.MediaTypeImageConfig,
- MediaTypeContainerd1Checkpoint, MediaTypeContainerd1CheckpointConfig:
- return true
- }
- return false
-}
-
-// ChildGCLabels returns the label for a given descriptor to reference it
-func ChildGCLabels(desc ocispec.Descriptor) []string {
- mt := desc.MediaType
- if IsKnownConfig(mt) {
- return []string{"containerd.io/gc.ref.content.config"}
- }
-
- switch mt {
- case MediaTypeDockerSchema2Manifest, ocispec.MediaTypeImageManifest:
- return []string{"containerd.io/gc.ref.content.m."}
- }
-
- if IsLayerType(mt) {
- return []string{"containerd.io/gc.ref.content.l."}
- }
-
- return []string{"containerd.io/gc.ref.content."}
-}
-
-// ChildGCLabelsFilterLayers returns the labels for a given descriptor to
-// reference it, skipping layer media types
-func ChildGCLabelsFilterLayers(desc ocispec.Descriptor) []string {
- if IsLayerType(desc.MediaType) {
- return nil
- }
- return ChildGCLabels(desc)
-}
diff --git a/vendor/github.com/containerd/containerd/import.go b/vendor/github.com/containerd/containerd/import.go
deleted file mode 100644
index 6080161f8..000000000
--- a/vendor/github.com/containerd/containerd/import.go
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package containerd
-
-import (
- "context"
- "encoding/json"
- "io"
-
- "github.com/containerd/containerd/content"
- "github.com/containerd/containerd/errdefs"
- "github.com/containerd/containerd/images"
- "github.com/containerd/containerd/images/archive"
- "github.com/containerd/containerd/platforms"
- digest "github.com/opencontainers/go-digest"
- ocispec "github.com/opencontainers/image-spec/specs-go/v1"
-)
-
-type importOpts struct {
- indexName string
- imageRefT func(string) string
- dgstRefT func(digest.Digest) string
- allPlatforms bool
- compress bool
-}
-
-// ImportOpt allows the caller to specify import specific options
-type ImportOpt func(*importOpts) error
-
-// WithImageRefTranslator is used to translate the index reference
-// to an image reference for the image store.
-func WithImageRefTranslator(f func(string) string) ImportOpt {
- return func(c *importOpts) error {
- c.imageRefT = f
- return nil
- }
-}
-
-// WithDigestRef is used to create digest images for each
-// manifest in the index.
-func WithDigestRef(f func(digest.Digest) string) ImportOpt {
- return func(c *importOpts) error {
- c.dgstRefT = f
- return nil
- }
-}
-
-// WithIndexName creates a tag pointing to the imported index
-func WithIndexName(name string) ImportOpt {
- return func(c *importOpts) error {
- c.indexName = name
- return nil
- }
-}
-
-// WithAllPlatforms is used to import content for all platforms.
-func WithAllPlatforms(allPlatforms bool) ImportOpt {
- return func(c *importOpts) error {
- c.allPlatforms = allPlatforms
- return nil
- }
-}
-
-// WithImportCompression compresses uncompressed layers on import.
-// This is used for import formats which do not include the manifest.
-func WithImportCompression() ImportOpt {
- return func(c *importOpts) error {
- c.compress = true
- return nil
- }
-}
-
-// Import imports an image from a Tar stream using reader.
-// Caller needs to specify importer. Future version may use oci.v1 as the default.
-// Note that unreferenced blobs may be imported to the content store as well.
-func (c *Client) Import(ctx context.Context, reader io.Reader, opts ...ImportOpt) ([]images.Image, error) {
- var iopts importOpts
- for _, o := range opts {
- if err := o(&iopts); err != nil {
- return nil, err
- }
- }
-
- ctx, done, err := c.WithLease(ctx)
- if err != nil {
- return nil, err
- }
- defer done(ctx)
-
- var aio []archive.ImportOpt
- if iopts.compress {
- aio = append(aio, archive.WithImportCompression())
- }
-
- index, err := archive.ImportIndex(ctx, c.ContentStore(), reader, aio...)
- if err != nil {
- return nil, err
- }
-
- var (
- imgs []images.Image
- cs = c.ContentStore()
- is = c.ImageService()
- )
-
- if iopts.indexName != "" {
- imgs = append(imgs, images.Image{
- Name: iopts.indexName,
- Target: index,
- })
- }
- var platformMatcher = platforms.All
- if !iopts.allPlatforms {
- platformMatcher = c.platform
- }
-
- var handler images.HandlerFunc = func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
- // Only save images at top level
- if desc.Digest != index.Digest {
- return images.Children(ctx, cs, desc)
- }
-
- p, err := content.ReadBlob(ctx, cs, desc)
- if err != nil {
- return nil, err
- }
-
- var idx ocispec.Index
- if err := json.Unmarshal(p, &idx); err != nil {
- return nil, err
- }
-
- for _, m := range idx.Manifests {
- name := imageName(m.Annotations, iopts.imageRefT)
- if name != "" {
- imgs = append(imgs, images.Image{
- Name: name,
- Target: m,
- })
- }
- if iopts.dgstRefT != nil {
- ref := iopts.dgstRefT(m.Digest)
- if ref != "" {
- imgs = append(imgs, images.Image{
- Name: ref,
- Target: m,
- })
- }
- }
- }
-
- return idx.Manifests, nil
- }
-
- handler = images.FilterPlatforms(handler, platformMatcher)
- handler = images.SetChildrenLabels(cs, handler)
- if err := images.Walk(ctx, handler, index); err != nil {
- return nil, err
- }
-
- for i := range imgs {
- img, err := is.Update(ctx, imgs[i], "target")
- if err != nil {
- if !errdefs.IsNotFound(err) {
- return nil, err
- }
-
- img, err = is.Create(ctx, imgs[i])
- if err != nil {
- return nil, err
- }
- }
- imgs[i] = img
- }
-
- return imgs, nil
-}
-
-func imageName(annotations map[string]string, ociCleanup func(string) string) string {
- name := annotations[images.AnnotationImageName]
- if name != "" {
- return name
- }
- name = annotations[ocispec.AnnotationRefName]
- if name != "" {
- if ociCleanup != nil {
- name = ociCleanup(name)
- }
- }
- return name
-}
diff --git a/vendor/github.com/containerd/containerd/install.go b/vendor/github.com/containerd/containerd/install.go
deleted file mode 100644
index 7a8311c83..000000000
--- a/vendor/github.com/containerd/containerd/install.go
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package containerd
-
-import (
- "archive/tar"
- "context"
- "os"
- "path/filepath"
- "runtime"
- "strings"
-
- "github.com/containerd/containerd/archive"
- "github.com/containerd/containerd/archive/compression"
- "github.com/containerd/containerd/content"
- "github.com/containerd/containerd/images"
- "github.com/pkg/errors"
-)
-
-// Install a binary image into the opt service
-func (c *Client) Install(ctx context.Context, image Image, opts ...InstallOpts) error {
- var config InstallConfig
- for _, o := range opts {
- o(&config)
- }
- path, err := c.getInstallPath(ctx, config)
- if err != nil {
- return err
- }
- var (
- cs = image.ContentStore()
- platform = c.platform
- )
- manifest, err := images.Manifest(ctx, cs, image.Target(), platform)
- if err != nil {
- return err
- }
-
- var binDir, libDir string
- if runtime.GOOS == "windows" {
- binDir = "Files\\bin"
- libDir = "Files\\lib"
- } else {
- binDir = "bin"
- libDir = "lib"
- }
- for _, layer := range manifest.Layers {
- ra, err := cs.ReaderAt(ctx, layer)
- if err != nil {
- return err
- }
- cr := content.NewReader(ra)
- r, err := compression.DecompressStream(cr)
- if err != nil {
- return err
- }
- if _, err := archive.Apply(ctx, path, r, archive.WithFilter(func(hdr *tar.Header) (bool, error) {
- d := filepath.Dir(hdr.Name)
- result := d == binDir
-
- if config.Libs {
- result = result || d == libDir
- }
-
- if runtime.GOOS == "windows" {
- hdr.Name = strings.Replace(hdr.Name, "Files", "", 1)
- }
- if result && !config.Replace {
- if _, err := os.Lstat(filepath.Join(path, hdr.Name)); err == nil {
- return false, errors.Errorf("cannot replace %s in %s", hdr.Name, path)
- }
- }
- return result, nil
- })); err != nil {
- r.Close()
- return err
- }
- r.Close()
- }
- return nil
-}
-
-func (c *Client) getInstallPath(ctx context.Context, config InstallConfig) (string, error) {
- if config.Path != "" {
- return config.Path, nil
- }
- filters := []string{"id==opt"}
- resp, err := c.IntrospectionService().Plugins(ctx, filters)
- if err != nil {
- return "", err
- }
- if len(resp.Plugins) != 1 {
- return "", errors.New("opt service not enabled")
- }
- path := resp.Plugins[0].Exports["path"]
- if path == "" {
- return "", errors.New("opt path not exported")
- }
- return path, nil
-}
diff --git a/vendor/github.com/containerd/containerd/install_opts.go b/vendor/github.com/containerd/containerd/install_opts.go
deleted file mode 100644
index b0c9213cb..000000000
--- a/vendor/github.com/containerd/containerd/install_opts.go
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package containerd
-
-// InstallOpts configures binary installs
-type InstallOpts func(*InstallConfig)
-
-// InstallConfig sets the binary install configuration
-type InstallConfig struct {
- // Libs installs libs from the image
- Libs bool
- // Replace will overwrite existing binaries or libs in the opt directory
- Replace bool
- // Path to install libs and binaries to
- Path string
-}
-
-// WithInstallLibs installs libs from the image
-func WithInstallLibs(c *InstallConfig) {
- c.Libs = true
-}
-
-// WithInstallReplace will replace existing files
-func WithInstallReplace(c *InstallConfig) {
- c.Replace = true
-}
-
-// WithInstallPath sets the optional install path
-func WithInstallPath(path string) InstallOpts {
- return func(c *InstallConfig) {
- c.Path = path
- }
-}
diff --git a/vendor/github.com/containerd/containerd/labels/validate.go b/vendor/github.com/containerd/containerd/labels/validate.go
deleted file mode 100644
index 0de461663..000000000
--- a/vendor/github.com/containerd/containerd/labels/validate.go
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package labels
-
-import (
- "github.com/containerd/containerd/errdefs"
- "github.com/pkg/errors"
-)
-
-const (
- maxSize = 4096
-)
-
-// Validate a label's key and value are under 4096 bytes
-func Validate(k, v string) error {
- if (len(k) + len(v)) > maxSize {
- if len(k) > 10 {
- k = k[:10]
- }
- return errors.Wrapf(errdefs.ErrInvalidArgument, "label key and value greater than maximum size (%d bytes), key: %s", maxSize, k)
- }
- return nil
-}
diff --git a/vendor/github.com/containerd/containerd/lease.go b/vendor/github.com/containerd/containerd/lease.go
deleted file mode 100644
index 07ea6d932..000000000
--- a/vendor/github.com/containerd/containerd/lease.go
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package containerd
-
-import (
- "context"
- "time"
-
- "github.com/containerd/containerd/leases"
-)
-
-// WithLease attaches a lease on the context
-func (c *Client) WithLease(ctx context.Context, opts ...leases.Opt) (context.Context, func(context.Context) error, error) {
- nop := func(context.Context) error { return nil }
-
- _, ok := leases.FromContext(ctx)
- if ok {
- return ctx, nop, nil
- }
-
- ls := c.LeasesService()
-
- if len(opts) == 0 {
- // Use default lease configuration if no options provided
- opts = []leases.Opt{
- leases.WithRandomID(),
- leases.WithExpiration(24 * time.Hour),
- }
- }
-
- l, err := ls.Create(ctx, opts...)
- if err != nil {
- return ctx, nop, err
- }
-
- ctx = leases.WithLease(ctx, l.ID)
- return ctx, func(ctx context.Context) error {
- return ls.Delete(ctx, l)
- }, nil
-}
diff --git a/vendor/github.com/containerd/containerd/leases/context.go b/vendor/github.com/containerd/containerd/leases/context.go
deleted file mode 100644
index 599c549d3..000000000
--- a/vendor/github.com/containerd/containerd/leases/context.go
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package leases
-
-import "context"
-
-type leaseKey struct{}
-
-// WithLease sets a given lease on the context
-func WithLease(ctx context.Context, lid string) context.Context {
- ctx = context.WithValue(ctx, leaseKey{}, lid)
-
- // also store on the grpc headers so it gets picked up by any clients that
- // are using this.
- return withGRPCLeaseHeader(ctx, lid)
-}
-
-// FromContext returns the lease from the context.
-func FromContext(ctx context.Context) (string, bool) {
- lid, ok := ctx.Value(leaseKey{}).(string)
- if !ok {
- return fromGRPCHeader(ctx)
- }
-
- return lid, ok
-}
diff --git a/vendor/github.com/containerd/containerd/leases/grpc.go b/vendor/github.com/containerd/containerd/leases/grpc.go
deleted file mode 100644
index 22f287a8b..000000000
--- a/vendor/github.com/containerd/containerd/leases/grpc.go
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package leases
-
-import (
- "context"
-
- "google.golang.org/grpc/metadata"
-)
-
-const (
- // GRPCHeader defines the header name for specifying a containerd lease.
- GRPCHeader = "containerd-lease"
-)
-
-func withGRPCLeaseHeader(ctx context.Context, lid string) context.Context {
- // also store on the grpc headers so it gets picked up by any clients
- // that are using this.
- txheader := metadata.Pairs(GRPCHeader, lid)
- md, ok := metadata.FromOutgoingContext(ctx) // merge with outgoing context.
- if !ok {
- md = txheader
- } else {
- // order ensures the latest is first in this list.
- md = metadata.Join(txheader, md)
- }
-
- return metadata.NewOutgoingContext(ctx, md)
-}
-
-func fromGRPCHeader(ctx context.Context) (string, bool) {
- // try to extract for use in grpc servers.
- md, ok := metadata.FromIncomingContext(ctx)
- if !ok {
- return "", false
- }
-
- values := md[GRPCHeader]
- if len(values) == 0 {
- return "", false
- }
-
- return values[0], true
-}
diff --git a/vendor/github.com/containerd/containerd/leases/id.go b/vendor/github.com/containerd/containerd/leases/id.go
deleted file mode 100644
index 8781a1d72..000000000
--- a/vendor/github.com/containerd/containerd/leases/id.go
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package leases
-
-import (
- "encoding/base64"
- "fmt"
- "math/rand"
- "time"
-)
-
-// WithRandomID sets the lease ID to a random unique value
-func WithRandomID() Opt {
- return func(l *Lease) error {
- t := time.Now()
- var b [3]byte
- rand.Read(b[:])
- l.ID = fmt.Sprintf("%d-%s", t.Nanosecond(), base64.URLEncoding.EncodeToString(b[:]))
- return nil
- }
-}
-
-// WithID sets the ID for the lease
-func WithID(id string) Opt {
- return func(l *Lease) error {
- l.ID = id
- return nil
- }
-}
diff --git a/vendor/github.com/containerd/containerd/leases/lease.go b/vendor/github.com/containerd/containerd/leases/lease.go
deleted file mode 100644
index 058d06559..000000000
--- a/vendor/github.com/containerd/containerd/leases/lease.go
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package leases
-
-import (
- "context"
- "time"
-)
-
-// Opt is used to set options on a lease
-type Opt func(*Lease) error
-
-// DeleteOpt allows configuring a delete operation
-type DeleteOpt func(context.Context, *DeleteOptions) error
-
-// Manager is used to create, list, and remove leases
-type Manager interface {
- Create(context.Context, ...Opt) (Lease, error)
- Delete(context.Context, Lease, ...DeleteOpt) error
- List(context.Context, ...string) ([]Lease, error)
- AddResource(context.Context, Lease, Resource) error
- DeleteResource(context.Context, Lease, Resource) error
- ListResources(context.Context, Lease) ([]Resource, error)
-}
-
-// Lease retains resources to prevent cleanup before
-// the resources can be fully referenced.
-type Lease struct {
- ID string
- CreatedAt time.Time
- Labels map[string]string
-}
-
-// Resource represents low level resource of image, like content, ingest and
-// snapshotter.
-type Resource struct {
- ID string
- Type string
-}
-
-// DeleteOptions provide options on image delete
-type DeleteOptions struct {
- Synchronous bool
-}
-
-// SynchronousDelete is used to indicate that a lease deletion and removal of
-// any unreferenced resources should occur synchronously before returning the
-// result.
-func SynchronousDelete(ctx context.Context, o *DeleteOptions) error {
- o.Synchronous = true
- return nil
-}
-
-// WithLabels sets labels on a lease
-func WithLabels(labels map[string]string) Opt {
- return func(l *Lease) error {
- l.Labels = labels
- return nil
- }
-}
-
-// WithExpiration sets an expiration on the lease
-func WithExpiration(d time.Duration) Opt {
- return func(l *Lease) error {
- if l.Labels == nil {
- l.Labels = map[string]string{}
- }
- l.Labels["containerd.io/gc.expire"] = time.Now().Add(d).Format(time.RFC3339)
-
- return nil
- }
-}
diff --git a/vendor/github.com/containerd/containerd/leases/proxy/manager.go b/vendor/github.com/containerd/containerd/leases/proxy/manager.go
deleted file mode 100644
index 96cd5e653..000000000
--- a/vendor/github.com/containerd/containerd/leases/proxy/manager.go
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package proxy
-
-import (
- "context"
-
- leasesapi "github.com/containerd/containerd/api/services/leases/v1"
- "github.com/containerd/containerd/errdefs"
- "github.com/containerd/containerd/leases"
-)
-
-type proxyManager struct {
- client leasesapi.LeasesClient
-}
-
-// NewLeaseManager returns a lease manager which communicates
-// through a grpc lease service.
-func NewLeaseManager(client leasesapi.LeasesClient) leases.Manager {
- return &proxyManager{
- client: client,
- }
-}
-
-func (pm *proxyManager) Create(ctx context.Context, opts ...leases.Opt) (leases.Lease, error) {
- l := leases.Lease{}
- for _, opt := range opts {
- if err := opt(&l); err != nil {
- return leases.Lease{}, err
- }
- }
- resp, err := pm.client.Create(ctx, &leasesapi.CreateRequest{
- ID: l.ID,
- Labels: l.Labels,
- })
- if err != nil {
- return leases.Lease{}, errdefs.FromGRPC(err)
- }
-
- return leases.Lease{
- ID: resp.Lease.ID,
- CreatedAt: resp.Lease.CreatedAt,
- Labels: resp.Lease.Labels,
- }, nil
-}
-
-func (pm *proxyManager) Delete(ctx context.Context, l leases.Lease, opts ...leases.DeleteOpt) error {
- var do leases.DeleteOptions
- for _, opt := range opts {
- if err := opt(ctx, &do); err != nil {
- return err
- }
- }
-
- _, err := pm.client.Delete(ctx, &leasesapi.DeleteRequest{
- ID: l.ID,
- Sync: do.Synchronous,
- })
- return errdefs.FromGRPC(err)
-}
-
-func (pm *proxyManager) List(ctx context.Context, filters ...string) ([]leases.Lease, error) {
- resp, err := pm.client.List(ctx, &leasesapi.ListRequest{
- Filters: filters,
- })
- if err != nil {
- return nil, errdefs.FromGRPC(err)
- }
- l := make([]leases.Lease, len(resp.Leases))
- for i := range resp.Leases {
- l[i] = leases.Lease{
- ID: resp.Leases[i].ID,
- CreatedAt: resp.Leases[i].CreatedAt,
- Labels: resp.Leases[i].Labels,
- }
- }
-
- return l, nil
-}
-
-func (pm *proxyManager) AddResource(ctx context.Context, lease leases.Lease, r leases.Resource) error {
- _, err := pm.client.AddResource(ctx, &leasesapi.AddResourceRequest{
- ID: lease.ID,
- Resource: leasesapi.Resource{
- ID: r.ID,
- Type: r.Type,
- },
- })
- return errdefs.FromGRPC(err)
-}
-
-func (pm *proxyManager) DeleteResource(ctx context.Context, lease leases.Lease, r leases.Resource) error {
- _, err := pm.client.DeleteResource(ctx, &leasesapi.DeleteResourceRequest{
- ID: lease.ID,
- Resource: leasesapi.Resource{
- ID: r.ID,
- Type: r.Type,
- },
- })
- return errdefs.FromGRPC(err)
-}
-
-func (pm *proxyManager) ListResources(ctx context.Context, lease leases.Lease) ([]leases.Resource, error) {
- resp, err := pm.client.ListResources(ctx, &leasesapi.ListResourcesRequest{
- ID: lease.ID,
- })
- if err != nil {
- return nil, errdefs.FromGRPC(err)
- }
-
- rs := make([]leases.Resource, 0, len(resp.Resources))
- for _, i := range resp.Resources {
- rs = append(rs, leases.Resource{
- ID: i.ID,
- Type: i.Type,
- })
- }
- return rs, nil
-}
diff --git a/vendor/github.com/containerd/containerd/log/context.go b/vendor/github.com/containerd/containerd/log/context.go
deleted file mode 100644
index 21599c4fd..000000000
--- a/vendor/github.com/containerd/containerd/log/context.go
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package log
-
-import (
- "context"
-
- "github.com/sirupsen/logrus"
-)
-
-var (
- // G is an alias for GetLogger.
- //
- // We may want to define this locally to a package to get package tagged log
- // messages.
- G = GetLogger
-
- // L is an alias for the standard logger.
- L = logrus.NewEntry(logrus.StandardLogger())
-)
-
-type (
- loggerKey struct{}
-)
-
-// RFC3339NanoFixed is time.RFC3339Nano with nanoseconds padded using zeros to
-// ensure the formatted time is always the same number of characters.
-const RFC3339NanoFixed = "2006-01-02T15:04:05.000000000Z07:00"
-
-// WithLogger returns a new context with the provided logger. Use in
-// combination with logger.WithField(s) for great effect.
-func WithLogger(ctx context.Context, logger *logrus.Entry) context.Context {
- return context.WithValue(ctx, loggerKey{}, logger)
-}
-
-// GetLogger retrieves the current logger from the context. If no logger is
-// available, the default logger is returned.
-func GetLogger(ctx context.Context) *logrus.Entry {
- logger := ctx.Value(loggerKey{})
-
- if logger == nil {
- return L
- }
-
- return logger.(*logrus.Entry)
-}
diff --git a/vendor/github.com/containerd/containerd/metadata/adaptors.go b/vendor/github.com/containerd/containerd/metadata/adaptors.go
deleted file mode 100644
index b165c38e0..000000000
--- a/vendor/github.com/containerd/containerd/metadata/adaptors.go
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package metadata
-
-import (
- "strings"
-
- "github.com/containerd/containerd/containers"
- "github.com/containerd/containerd/content"
- "github.com/containerd/containerd/filters"
- "github.com/containerd/containerd/images"
- "github.com/containerd/containerd/leases"
- "github.com/containerd/containerd/snapshots"
-)
-
-func adaptImage(o interface{}) filters.Adaptor {
- obj := o.(images.Image)
- return filters.AdapterFunc(func(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- case "name":
- return obj.Name, len(obj.Name) > 0
- case "target":
- if len(fieldpath) < 2 {
- return "", false
- }
-
- switch fieldpath[1] {
- case "digest":
- return obj.Target.Digest.String(), len(obj.Target.Digest) > 0
- case "mediatype":
- return obj.Target.MediaType, len(obj.Target.MediaType) > 0
- }
- case "labels":
- return checkMap(fieldpath[1:], obj.Labels)
- // TODO(stevvooe): Greater/Less than filters would be awesome for
- // size. Let's do it!
- case "annotations":
- return checkMap(fieldpath[1:], obj.Target.Annotations)
- }
-
- return "", false
- })
-}
-func adaptContainer(o interface{}) filters.Adaptor {
- obj := o.(containers.Container)
- return filters.AdapterFunc(func(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- case "id":
- return obj.ID, len(obj.ID) > 0
- case "runtime":
- if len(fieldpath) <= 1 {
- return "", false
- }
-
- switch fieldpath[1] {
- case "name":
- return obj.Runtime.Name, len(obj.Runtime.Name) > 0
- default:
- return "", false
- }
- case "image":
- return obj.Image, len(obj.Image) > 0
- case "labels":
- return checkMap(fieldpath[1:], obj.Labels)
- }
-
- return "", false
- })
-}
-
-func adaptContentInfo(info content.Info) filters.Adaptor {
- return filters.AdapterFunc(func(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- case "digest":
- return info.Digest.String(), true
- case "size":
- // TODO: support size based filtering
- case "labels":
- return checkMap(fieldpath[1:], info.Labels)
- }
-
- return "", false
- })
-}
-
-func adaptContentStatus(status content.Status) filters.Adaptor {
- return filters.AdapterFunc(func(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
- switch fieldpath[0] {
- case "ref":
- return status.Ref, true
- }
-
- return "", false
- })
-}
-
-func adaptLease(lease leases.Lease) filters.Adaptor {
- return filters.AdapterFunc(func(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- case "id":
- return lease.ID, len(lease.ID) > 0
- case "labels":
- return checkMap(fieldpath[1:], lease.Labels)
- }
-
- return "", false
- })
-}
-
-func adaptSnapshot(info snapshots.Info) filters.Adaptor {
- return filters.AdapterFunc(func(fieldpath []string) (string, bool) {
- if len(fieldpath) == 0 {
- return "", false
- }
-
- switch fieldpath[0] {
- case "kind":
- switch info.Kind {
- case snapshots.KindActive:
- return "active", true
- case snapshots.KindView:
- return "view", true
- case snapshots.KindCommitted:
- return "committed", true
- }
- case "name":
- return info.Name, true
- case "parent":
- return info.Parent, true
- case "labels":
- return checkMap(fieldpath[1:], info.Labels)
- }
-
- return "", false
- })
-}
-
-func checkMap(fieldpath []string, m map[string]string) (string, bool) {
- if len(m) == 0 {
- return "", false
- }
-
- value, ok := m[strings.Join(fieldpath, ".")]
- return value, ok
-}
diff --git a/vendor/github.com/containerd/containerd/metadata/bolt.go b/vendor/github.com/containerd/containerd/metadata/bolt.go
deleted file mode 100644
index 6ea460866..000000000
--- a/vendor/github.com/containerd/containerd/metadata/bolt.go
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package metadata
-
-import (
- "context"
-
- "github.com/pkg/errors"
- bolt "go.etcd.io/bbolt"
-)
-
-type transactionKey struct{}
-
-// WithTransactionContext returns a new context holding the provided
-// bolt transaction. Functions which require a bolt transaction will
-// first check to see if a transaction is already created on the
-// context before creating their own.
-func WithTransactionContext(ctx context.Context, tx *bolt.Tx) context.Context {
- return context.WithValue(ctx, transactionKey{}, tx)
-}
-
-type transactor interface {
- View(fn func(*bolt.Tx) error) error
- Update(fn func(*bolt.Tx) error) error
-}
-
-// view gets a bolt db transaction either from the context
-// or starts a new one with the provided bolt database.
-func view(ctx context.Context, db transactor, fn func(*bolt.Tx) error) error {
- tx, ok := ctx.Value(transactionKey{}).(*bolt.Tx)
- if !ok {
- return db.View(fn)
- }
- return fn(tx)
-}
-
-// update gets a writable bolt db transaction either from the context
-// or starts a new one with the provided bolt database.
-func update(ctx context.Context, db transactor, fn func(*bolt.Tx) error) error {
- tx, ok := ctx.Value(transactionKey{}).(*bolt.Tx)
- if !ok {
- return db.Update(fn)
- } else if !tx.Writable() {
- return errors.Wrap(bolt.ErrTxNotWritable, "unable to use transaction from context")
- }
- return fn(tx)
-}
diff --git a/vendor/github.com/containerd/containerd/metadata/boltutil/helpers.go b/vendor/github.com/containerd/containerd/metadata/boltutil/helpers.go
deleted file mode 100644
index 94af315f9..000000000
--- a/vendor/github.com/containerd/containerd/metadata/boltutil/helpers.go
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-package boltutil
-
-import (
- "time"
-
- "github.com/pkg/errors"
- bolt "go.etcd.io/bbolt"
-)
-
-var (
- bucketKeyAnnotations = []byte("annotations")
- bucketKeyLabels = []byte("labels")
- bucketKeyCreatedAt = []byte("createdat")
- bucketKeyUpdatedAt = []byte("updatedat")
-)
-
-// ReadLabels reads the labels key from the bucket
-// Uses the key "labels"
-func ReadLabels(bkt *bolt.Bucket) (map[string]string, error) {
- return readMap(bkt, bucketKeyLabels)
-}
-
-// ReadAnnotations reads the OCI Descriptor Annotations key from the bucket
-// Uses the key "annotations"
-func ReadAnnotations(bkt *bolt.Bucket) (map[string]string, error) {
- return readMap(bkt, bucketKeyAnnotations)
-}
-
-func readMap(bkt *bolt.Bucket, bucketName []byte) (map[string]string, error) {
- lbkt := bkt.Bucket(bucketName)
- if lbkt == nil {
- return nil, nil
- }
- labels := map[string]string{}
- if err := lbkt.ForEach(func(k, v []byte) error {
- labels[string(k)] = string(v)
- return nil
- }); err != nil {
- return nil, err
- }
- return labels, nil
-}
-
-// WriteLabels will write a new labels bucket to the provided bucket at key
-// bucketKeyLabels, replacing the contents of the bucket with the provided map.
-//
-// The provide map labels will be modified to have the final contents of the
-// bucket. Typically, this removes zero-value entries.
-// Uses the key "labels"
-func WriteLabels(bkt *bolt.Bucket, labels map[string]string) error {
- return writeMap(bkt, bucketKeyLabels, labels)
-}
-
-// WriteAnnotations writes the OCI Descriptor Annotations
-func WriteAnnotations(bkt *bolt.Bucket, labels map[string]string) error {
- return writeMap(bkt, bucketKeyAnnotations, labels)
-}
-
-func writeMap(bkt *bolt.Bucket, bucketName []byte, labels map[string]string) error {
- // Remove existing labels to keep from merging
- if lbkt := bkt.Bucket(bucketName); lbkt != nil {
- if err := bkt.DeleteBucket(bucketName); err != nil {
- return err
- }
- }
-
- if len(labels) == 0 {
- return nil
- }
-
- lbkt, err := bkt.CreateBucket(bucketName)
- if err != nil {
- return err
- }
-
- for k, v := range labels {
- if v == "" {
- delete(labels, k) // remove since we don't actually set it
- continue
- }
-
- if err := lbkt.Put([]byte(k), []byte(v)); err != nil {
- return errors.Wrapf(err, "failed to set label %q=%q", k, v)
- }
- }
-
- return nil
-}
-
-// ReadTimestamps reads created and updated timestamps from a bucket.
-// Uses keys "createdat" and "updatedat"
-func ReadTimestamps(bkt *bolt.Bucket, created, updated *time.Time) error {
- for _, f := range []struct {
- b []byte
- t *time.Time
- }{
- {bucketKeyCreatedAt, created},
- {bucketKeyUpdatedAt, updated},
- } {
- v := bkt.Get(f.b)
- if v != nil {
- if err := f.t.UnmarshalBinary(v); err != nil {
- return err
- }
- }
- }
- return nil
-}
-
-// WriteTimestamps writes created and updated timestamps to a bucket.
-// Uses keys "createdat" and "updatedat"
-func WriteTimestamps(bkt *bolt.Bucket, created, updated time.Time) error {
- createdAt, err := created.MarshalBinary()
- if err != nil {
- return err
- }
- updatedAt, err := updated.MarshalBinary()
- if err != nil {
- return err
- }
- for _, v := range [][2][]byte{
- {bucketKeyCreatedAt, createdAt},
- {bucketKeyUpdatedAt, updatedAt},
- } {
- if err := bkt.Put(v[0], v[1]); err != nil {
- return err
- }
- }
-
- return nil
-}
diff --git a/vendor/github.com/containerd/containerd/metadata/buckets.go b/vendor/github.com/containerd/containerd/metadata/buckets.go
deleted file mode 100644
index fa947fb25..000000000
--- a/vendor/github.com/containerd/containerd/metadata/buckets.go
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
- Copyright The containerd Authors.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-// Package metadata stores all labels and object specific metadata by namespace.
-// This package also contains the main garbage collection logic for cleaning up
-// resources consistently and atomically. Resources used by backends will be
-// tracked in the metadata store to be exposed to consumers of this package.
-//
-// The layout where a "/" delineates a bucket is described in the following
-// section. Please try to follow this as closely as possible when adding
-// functionality. We can bolster this with helpers and more structure if that
-// becomes an issue.
-//
-// Generically, we try to do the following:
-//
-// //